From 70e7ad85ed5d005b1c1b4e1cf1e0b793d8bae286 Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Thu, 21 Nov 2024 23:11:53 +0800 Subject: [PATCH 001/391] system/adb: Fix log format error The "%pV" format depends on libc extension Log adbd_main (***): 0x3fc9175cV Signed-off-by: wangjianyu3 --- system/adb/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/system/adb/Kconfig b/system/adb/Kconfig index 9c91a4fd082..06d7f940ac6 100644 --- a/system/adb/Kconfig +++ b/system/adb/Kconfig @@ -7,6 +7,7 @@ menuconfig SYSTEM_ADBD tristate "ADB daemon application" default n depends on LIBUV + select LIBC_PRINT_EXTENSION ---help--- Enable support for adb daemon. From 7fb7e21bf245587d87c09e2e00dee16e4d959c87 Mon Sep 17 00:00:00 2001 From: yinshengkai Date: Wed, 30 Oct 2024 21:22:10 +0800 Subject: [PATCH 002/391] system: support gcov output to stdout Signed-off-by: yinshengkai --- system/gcov/gcov.c | 141 ++++++++++++++++++++++++++++++++++++--------- 1 file changed, 115 insertions(+), 26 deletions(-) diff --git a/system/gcov/gcov.c b/system/gcov/gcov.c index 53b88a12108..d96cf6f9ca1 100644 --- a/system/gcov/gcov.c +++ b/system/gcov/gcov.c @@ -22,10 +22,27 @@ * Included Files ****************************************************************************/ +#include #include #include +#include +#include #include +#include +#include + +/**************************************************************************** + * Private Types + ****************************************************************************/ + +struct gcov_arg +{ + FAR const char *name; + struct lib_stdoutstream_s stdoutstream; + struct lib_hexdumpstream_s hexstream; +}; + /**************************************************************************** * Private Functions ****************************************************************************/ @@ -38,7 +55,8 @@ static void show_usage(FAR const char *progname) { printf("\nUsage: %s [-d path] [-t strip] [-r] [-h]\n", progname); printf("\nWhere:\n"); - printf(" -d dump the coverage, path is the path to the coverage file\n"); + printf(" -d dump the coverage, path is the path to the coverage file, " + "the default output is to stdout\n"); printf(" -t strip the path prefix number\n"); printf(" -r reset the coverage\n"); printf(" -h show this text and exits.\n"); @@ -46,14 +64,7 @@ static void show_usage(FAR const char *progname) } /**************************************************************************** - * Public Function Prototypes - ****************************************************************************/ - -void __gcov_dump(void); -void __gcov_reset(void); - -/**************************************************************************** - * Private Functions + * Name: gcov_dump ****************************************************************************/ static void gcov_dump(FAR const char * path, FAR const char *strip) @@ -69,6 +80,75 @@ static void gcov_dump(FAR const char * path, FAR const char *strip) __gcov_dump(); } +/**************************************************************************** + * Name: stdout_dump + ****************************************************************************/ + +#ifndef CONFIG_COVERAGE_TOOLCHAIN +static void stdout_dump(FAR const void *buffer, size_t size, + FAR void *arg) +{ + FAR struct gcov_arg *args = (FAR struct gcov_arg *)arg; + uint16_t checksum = 0; + int i; + + if (size == 0) + { + return; + } + + for (i = 0; i < size; i++) + { + checksum += ((FAR const uint8_t *)buffer)[i]; + } + + lib_sprintf(&args->stdoutstream.common, + "gcov start filename:%s size: %zuByte\n", + args->name, size); + lib_stream_puts(&args->hexstream, buffer, size); + lib_stream_flush(&args->hexstream); + lib_sprintf(&args->stdoutstream.common, + "gcov end filename:%s checksum: %#0x\n", + args->name, checksum); + lib_stream_flush(&args->stdoutstream); +} + +/**************************************************************************** + * Name: stdout_filename + ****************************************************************************/ + +static void stdout_filename(const char *name, FAR void *arg) +{ + FAR struct gcov_arg *args = (FAR struct gcov_arg *)arg; + args->name = name; + __gcov_filename_to_gcfn(name, NULL, NULL); +} + +/**************************************************************************** + * Name: gcov_stdout_dump + * + * Description: + * Dump the gcov information of all translation units to stdout. + * + ****************************************************************************/ + +static void gcov_stdout_dump(void) +{ + FAR struct gcov_info *info = __gcov_info_start; + FAR struct gcov_info *end = __gcov_info_end; + struct gcov_arg arg; + + lib_stdoutstream(&arg.stdoutstream, stdout); + lib_hexdumpstream(&arg.hexstream, &arg.stdoutstream.common); + + while (info != end) + { + __gcov_info_to_gcda(info, stdout_filename, stdout_dump, NULL, &arg); + info = info->next; + } +} +#endif + /**************************************************************************** * Public Functions ****************************************************************************/ @@ -84,32 +164,41 @@ int main(int argc, FAR char *argv[]) show_usage(argv[0]); } - while ((option = getopt(argc, argv, "d:t:rh")) != ERROR) + while ((option = getopt(argc, argv, "d::t:rh")) != ERROR) { switch (option) { - case 'd': - path = optarg; - break; + case 'd': + path = optarg; + break; - case 't': - strip = optarg; + case 't': + strip = optarg; + break; - break; + case 'r': + __gcov_reset(); + break; - case 'r': - __gcov_reset(); - break; + case '?': + default: + fprintf(stderr, "ERROR: Unrecognized option\n"); - case '?': - default: - fprintf(stderr, "ERROR: Unrecognized option\n"); - - case 'h': - show_usage(argv[0]); + case 'h': + show_usage(argv[0]); } } - gcov_dump(path, strip); +#ifndef CONFIG_COVERAGE_TOOLCHAIN + if (path == NULL) + { + gcov_stdout_dump(); + } + else +#endif + { + gcov_dump(path, strip); + } + return 0; } From 3cbcbb65217177dcef4dd8aa584f01d51b31a95d Mon Sep 17 00:00:00 2001 From: anjiahao Date: Wed, 20 Nov 2024 20:01:40 +0800 Subject: [PATCH 003/391] bin:Copy debug info to a separate folder Signed-off-by: anjiahao --- .gitignore | 1 + Application.mk | 4 +++- Make.defs | 3 ++- Makefile | 1 + 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index c30e7faea08..d183a413f57 100644 --- a/.gitignore +++ b/.gitignore @@ -28,6 +28,7 @@ .kconfig *.lock /bin +/bin_debug /boot_romfsimg.h /external /Kconfig diff --git a/Application.mk b/Application.mk index 9bd2fb20aa2..b73d1a68454 100644 --- a/Application.mk +++ b/Application.mk @@ -305,7 +305,9 @@ $(PROGLIST): $(MAINCOBJ) $(MAINCXXOBJ) $(MAINRUSTOBJ) $(MAINZIGOBJ) $(MAINDOBJ) $(Q) mkdir -p $(BINDIR) $(call ELFLD, $(PROGOBJ_$@), $(call CONVERT_PATH,$@)) $(Q) chmod +x $@ -ifneq ($(CONFIG_DEBUG_SYMBOLS),y) +ifneq ($(CONFIG_DEBUG_SYMBOLS),) + $(Q) mkdir -p $(BINDIR_DEBUG) + $(Q) cp $@ $(BINDIR_DEBUG) $(Q) $(MODULESTRIP) $@ endif diff --git a/Make.defs b/Make.defs index 773ceef6280..695dfa2be7a 100644 --- a/Make.defs +++ b/Make.defs @@ -64,6 +64,7 @@ LIBPATH ?= $(TOPDIR)$(DELIM)staging # The install path BINDIR ?= $(APPDIR)$(DELIM)bin +BINDIR_DEBUG ?= $(APPDIR)$(DELIM)bin_debug # The final build target @@ -184,4 +185,4 @@ define CLEANAROBJS $(shell rm -rf $(CLEAN_OBJS_$(BATCH)))) $(eval OBJS :=) endef -endif \ No newline at end of file +endif diff --git a/Makefile b/Makefile index c5910c6d204..b2b90c7c49e 100644 --- a/Makefile +++ b/Makefile @@ -223,6 +223,7 @@ clean: $(foreach SDIR, $(CLEANDIRS), $(SDIR)_clean) $(call DELFILE, $(BIN)) $(call DELFILE, Kconfig) $(call DELDIR, $(BINDIR)) + $(call DELDIR, $(BINDIR_DEBUG)) $(call CLEAN) distclean: $(foreach SDIR, $(CLEANDIRS), $(SDIR)_distclean) From 54a571fc922fbd878e502e355c34c679f3bee95c Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Thu, 14 Nov 2024 20:31:51 +0900 Subject: [PATCH 004/391] testing/ostest/wdog.c: remove a set-only global --- testing/ostest/signest.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/testing/ostest/signest.c b/testing/ostest/signest.c index 69ba7f99765..5140f9cbbd5 100644 --- a/testing/ostest/signest.c +++ b/testing/ostest/signest.c @@ -57,7 +57,6 @@ static sem_t g_sem_signal_finish; static volatile bool g_waiter_running; static volatile bool g_interferer_running; static volatile bool g_done; -static volatile int g_nestlevel; static volatile int g_even_handled; static volatile int g_odd_handled; @@ -259,7 +258,6 @@ void signest_test(void) g_waiter_running = false; g_interferer_running = false; g_done = false; - g_nestlevel = 0; even_signals = 0; odd_signals = 0; From 365869b0a2b1fa2e48e7e50041ac3765622268b2 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Thu, 14 Nov 2024 21:59:33 +0900 Subject: [PATCH 005/391] testing/ostest/signest.c: fix the range of signals Note that MAX_SIGNO is a valid signal number. --- testing/ostest/signest.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/testing/ostest/signest.c b/testing/ostest/signest.c index 5140f9cbbd5..a539986e915 100644 --- a/testing/ostest/signest.c +++ b/testing/ostest/signest.c @@ -143,7 +143,7 @@ static FAR void *waiter_main(FAR void *arg) act.sa_flags = 0; sigemptyset(&act.sa_mask); - for (i = 1; i < MAX_SIGNO; i += 2) + for (i = 1; i <= MAX_SIGNO; i += 2) { if (signest_catchable(i)) { @@ -151,7 +151,7 @@ static FAR void *waiter_main(FAR void *arg) } } - for (i = 1; i < MAX_SIGNO; i++) + for (i = 1; i <= MAX_SIGNO; i++) { if (signest_catchable(i)) { @@ -322,7 +322,7 @@ void signest_test(void) for (i = 0; i < 10; i++) { - for (j = 1; j < MAX_SIGNO; j += 2) + for (j = 1; j + 1 <= MAX_SIGNO; j += 2) { if (signest_catchable(j)) { @@ -377,7 +377,7 @@ void signest_test(void) for (i = 0; i < 10; i++) { - for (j = 1; j < MAX_SIGNO; j += 2) + for (j = 1; j + 1 <= MAX_SIGNO; j += 2) { /* Odd then even */ @@ -439,7 +439,7 @@ void signest_test(void) for (i = 0; i < 10; i++) { - for (j = 1; j < MAX_SIGNO; j += 2) + for (j = 1; j + 1 <= MAX_SIGNO; j += 2) { /* Odd then even */ From 38b54f6fc513ac6885e54acc3cff5e650600a853 Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Fri, 22 Nov 2024 20:27:30 +0800 Subject: [PATCH 006/391] system/adb: Waiting for enumeration to complete before opening endpoint Env esp32s3-devkit:adb Error adbd [3:100] NuttShell (NSH) nsh> adb_uv_usb_setup (154): failed to open usb device -1 2 Test + adb_log("Waiting for %s ..", ep); adbd [3:100] NuttShell (NSH) nsh> adbd_main (161): Waiting for /dev/adb0/ep0 .. nsh> ps PID GROUP PRI POLICY TYPE NPX STATE EVENT SIGMASK STACK COMMAND 0 0 0 FIFO Kthread - Ready 0000000000000000 0003008 Idle_Task 1 0 224 RR Kthread - Waiting Semaphore 0000000000000000 0008080 hpwork 0x3fc8bc00 0x3fc8bc24 2 2 100 RR Task - Running 0000000000000000 0003992 nsh_main 3 3 100 RR Task - Waiting Semaphore 0000000000000000 0008112 adbd nsh> Signed-off-by: wangjianyu3 --- system/adb/adb_main.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/system/adb/adb_main.c b/system/adb/adb_main.c index bc2cd36bc29..93a97d373ac 100644 --- a/system/adb/adb_main.c +++ b/system/adb/adb_main.c @@ -24,6 +24,9 @@ #include "adb.h" +#include +#include +#include #include #include @@ -36,6 +39,16 @@ # include "netutils/netinit.h" #endif +#define ADB_WAIT_EP_READY(ep) \ + { \ + struct stat sb; \ + \ + while (stat(ep, &sb) != 0) \ + { \ + usleep(500000); \ + }; \ + } + /**************************************************************************** * Public Functions ****************************************************************************/ @@ -144,6 +157,10 @@ int main(int argc, FAR char **argv) } #endif /* ADBD_USB_BOARDCTL */ + ADB_WAIT_EP_READY("/dev/adb0/ep0"); + ADB_WAIT_EP_READY("/dev/adb0/ep1"); + ADB_WAIT_EP_READY("/dev/adb0/ep2"); + #ifdef CONFIG_ADBD_NET_INIT /* Bring up the network */ From 3f418f482ea3053c3685f18e661bb9645e2db8d9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 22:58:12 +0000 Subject: [PATCH 007/391] build(deps): bump codelytv/pr-size-labeler from 1.10.1 to 1.10.2 Bumps [codelytv/pr-size-labeler](https://github.com/codelytv/pr-size-labeler) from 1.10.1 to 1.10.2. - [Release notes](https://github.com/codelytv/pr-size-labeler/releases) - [Commits](https://github.com/codelytv/pr-size-labeler/compare/v1.10.1...v1.10.2) --- updated-dependencies: - dependency-name: codelytv/pr-size-labeler dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/labeler.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 22250d40a53..bd75d11d3ed 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -34,7 +34,7 @@ jobs: sync-labels: true - name: Assign labels based on the PR's size - uses: codelytv/pr-size-labeler@v1.10.1 + uses: codelytv/pr-size-labeler@v1.10.2 with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} ignore_file_deletions: true From 0327abb483d5af3ec4e231f060a318bdac4fdba8 Mon Sep 17 00:00:00 2001 From: simbit18 <101105604+simbit18@users.noreply.github.com> Date: Tue, 26 Nov 2024 11:59:46 +0100 Subject: [PATCH 008/391] build.yml: MSYS2 GitHub Action disable ccache and enable You need to disable the msys2 cache from the GitHub action because we moved the Scheduled Merge Jobs to a new NuttX Mirror Repo and approaching total cache storage limit !!! https://github.com/apache/nuttx/actions/caches https://github.com/msys2/setup-msys2?tab=readme-ov-file#cache Enable CMake+Ninja for Msys2 --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c469e8ed94f..7c96f1094f5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -278,6 +278,7 @@ jobs: with: msystem: MSYS update: false + cache: false install: >- base-devel gcc @@ -322,7 +323,7 @@ jobs: git config --global --add safe.directory /github/workspace/sources/nuttx git config --global --add safe.directory /github/workspace/sources/apps cd sources/nuttx/tools/ci - ./cibuild.sh -g -i -A -C -R testlist/${{matrix.boards}}.dat + ./cibuild.sh -g -i -A -C -N -R testlist/${{matrix.boards}}.dat - uses: actions/upload-artifact@v4 with: From 9c7a65e1e72a082961a6b3b9849458d076ae25e8 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Fri, 22 Nov 2024 12:10:57 +0900 Subject: [PATCH 009/391] system/dd/dd_main.c: remove unnecessary header include --- system/dd/dd_main.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/system/dd/dd_main.c b/system/dd/dd_main.c index 37526787a1e..dba8837bcdf 100644 --- a/system/dd/dd_main.c +++ b/system/dd/dd_main.c @@ -24,8 +24,6 @@ #include -#include - #include #include @@ -36,7 +34,6 @@ #include #include #include -#include #include #include From 1caf06bd7707c4a3b6f576e1bd2d2f20d28484b6 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Fri, 22 Nov 2024 12:33:05 +0900 Subject: [PATCH 010/391] system/dd: print help and abort on unknown options --- system/dd/dd_main.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/system/dd/dd_main.c b/system/dd/dd_main.c index dba8837bcdf..b9526f887f4 100644 --- a/system/dd/dd_main.c +++ b/system/dd/dd_main.c @@ -228,6 +228,11 @@ int main(int argc, FAR char **argv) { dd.seek = atoi(&argv[i][5]); } + else + { + print_usage(); + goto errout_with_paths; + } } if (infile == NULL || outfile == NULL) From 1fed08e870433f12f149220f24fe4861789de59e Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Fri, 22 Nov 2024 12:32:33 +0900 Subject: [PATCH 011/391] system/dd: make if= and of= optional --- system/dd/dd_main.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/system/dd/dd_main.c b/system/dd/dd_main.c index b9526f887f4..967f821cc18 100644 --- a/system/dd/dd_main.c +++ b/system/dd/dd_main.c @@ -138,6 +138,12 @@ static int dd_read(FAR struct dd_s *dd) static inline int dd_infopen(FAR const char *name, FAR struct dd_s *dd) { + if (name == NULL) + { + dd->infd = STDIN_FILENO; + return OK; + } + dd->infd = open(name, O_RDONLY); if (dd->infd < 0) { @@ -155,6 +161,12 @@ static inline int dd_infopen(FAR const char *name, FAR struct dd_s *dd) static inline int dd_outfopen(FAR const char *name, FAR struct dd_s *dd) { + if (name == NULL) + { + dd->outfd = STDOUT_FILENO; + return OK; + } + dd->outfd = open(name, O_WRONLY | O_CREAT | O_TRUNC, 0644); if (dd->outfd < 0) { @@ -173,7 +185,7 @@ static inline int dd_outfopen(FAR const char *name, FAR struct dd_s *dd) static void print_usage(void) { fprintf(stderr, "usage:\n"); - fprintf(stderr, " %s if= of= [bs=] " + fprintf(stderr, " %s [if=] [of=] [bs=] " "[count=] [skip=] [seek=]\n", g_dd); } @@ -235,12 +247,6 @@ int main(int argc, FAR char **argv) } } - if (infile == NULL || outfile == NULL) - { - print_usage(); - goto errout_with_paths; - } - /* Allocate the I/O buffer */ dd.buffer = malloc(dd.sectsize); From f6f223e674ec52db41c556adf30320a5bc17a28a Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Fri, 22 Nov 2024 12:35:13 +0900 Subject: [PATCH 012/391] system/dd: portability to non-nuttx platforms eg. ``` /opt/wasi-sdk-24.0/bin/clang -Wall -Oz -s -o dd.wasm dd_main.c ``` --- system/dd/dd_main.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/system/dd/dd_main.c b/system/dd/dd_main.c index 967f821cc18..a0d73a92226 100644 --- a/system/dd/dd_main.c +++ b/system/dd/dd_main.c @@ -22,7 +22,9 @@ * Included Files ****************************************************************************/ +#if defined(__NuttX__) #include +#endif #include #include @@ -50,6 +52,16 @@ #define DEFAULT_SECTSIZE 512 +#if !defined(CONFIG_SYSTEM_DD_PROGNAME) +#define CONFIG_SYSTEM_DD_PROGNAME "dd" +#endif +#if !defined(__NuttX__) +#define FAR +#define NSEC_PER_USEC 1000 +#define USEC_PER_SEC 1000000 +#define NSEC_PER_SEC 1000000000 +#endif + #define g_dd CONFIG_SYSTEM_DD_PROGNAME /**************************************************************************** From 9039b9cb1889ef6cb56fbeb5d6678a4c8c039f50 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Thu, 28 Nov 2024 13:27:35 +0900 Subject: [PATCH 013/391] system/dd: Fix a printf format --- system/dd/dd_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/system/dd/dd_main.c b/system/dd/dd_main.c index a0d73a92226..513e2eb85e3 100644 --- a/system/dd/dd_main.c +++ b/system/dd/dd_main.c @@ -29,6 +29,7 @@ #include #include +#include #include #include #include @@ -350,7 +351,7 @@ int main(int argc, FAR char **argv) total = ((uint64_t)sector * (uint64_t)dd.sectsize); - fprintf(stderr, "%llu bytes copied, %u usec, ", + fprintf(stderr, "%" PRIu64 " bytes copied, %u usec, ", total, (unsigned int)elapsed); fprintf(stderr, "%u KB/s\n" , (unsigned int)(((double)total / 1024) From 65606186004fdab5df842f62181c777ee2350840 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Thu, 28 Nov 2024 13:31:29 +0900 Subject: [PATCH 014/391] system/dd: improve EOF handling a bit --- system/dd/dd_main.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/system/dd/dd_main.c b/system/dd/dd_main.c index 513e2eb85e3..a5e6a13ebe3 100644 --- a/system/dd/dd_main.c +++ b/system/dd/dd_main.c @@ -138,10 +138,14 @@ static int dd_read(FAR struct dd_s *dd) dd->nbytes += nbytes; buffer += nbytes; + if (nbytes == 0) + { + dd->eof = true; + break; + } } while (dd->nbytes < dd->sectsize && nbytes > 0); - dd->eof |= (dd->nbytes == 0); return OK; } @@ -214,7 +218,7 @@ int main(int argc, FAR char **argv) struct timespec ts0; struct timespec ts1; uint64_t elapsed; - uint64_t total; + uint64_t total = 0; uint32_t sector = 0; int ret = ERROR; int i; @@ -325,7 +329,7 @@ int main(int argc, FAR char **argv) /* Has the incoming data stream ended? */ - if (!dd.eof) + if (dd.nbytes > 0) { /* Write one sector to the output file */ @@ -338,6 +342,7 @@ int main(int argc, FAR char **argv) /* Increment the sector number */ sector++; + total += dd.nbytes; } } @@ -349,10 +354,8 @@ int main(int argc, FAR char **argv) elapsed -= (((uint64_t)ts0.tv_sec * NSEC_PER_SEC) + ts0.tv_nsec); elapsed /= NSEC_PER_USEC; /* usec */ - total = ((uint64_t)sector * (uint64_t)dd.sectsize); - - fprintf(stderr, "%" PRIu64 " bytes copied, %u usec, ", - total, (unsigned int)elapsed); + fprintf(stderr, "%" PRIu64 " bytes (%" PRIu32 " blocks) copied, %u usec, ", + total, sector, (unsigned int)elapsed); fprintf(stderr, "%u KB/s\n" , (unsigned int)(((double)total / 1024) / ((double)elapsed / USEC_PER_SEC))); From 52bfcb3ab9ff5db59c6e99e2d190de08589852b2 Mon Sep 17 00:00:00 2001 From: buxiasen Date: Thu, 19 Sep 2024 00:09:53 +0800 Subject: [PATCH 015/391] system/coredump: compatible restore name with NAME_MAX 32 Bytes Coredump should compatible with default 32B NAME_MAX Signed-off-by: buxiasen --- system/coredump/coredump.c | 52 +++++++++++++++++++++----------------- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/system/coredump/coredump.c b/system/coredump/coredump.c index 0d4b0fd895a..4579bca7f5f 100644 --- a/system/coredump/coredump.c +++ b/system/coredump/coredump.c @@ -43,6 +43,14 @@ * Private Types ****************************************************************************/ +#ifdef CONFIG_BOARD_COREDUMP_COMPRESSION +# define COREDUMP_FILE_SUFFIX ".lzf" +#else +# define COREDUMP_FILE_SUFFIX ".core" +#endif + +#define COREDUMP_FILE_SUFFIX_LEN (sizeof(COREDUMP_FILE_SUFFIX) - 1) + typedef CODE void (*dumpfile_cb_t)(FAR char *path, FAR const char *filename, FAR void *arg); @@ -66,6 +74,22 @@ static struct memory_region_s g_memory_region[] = ****************************************************************************/ #ifdef CONFIG_BOARD_COREDUMP_BLKDEV + +static bool dumpfile_is_valid(FAR const char *name) +{ + FAR const char *suffix; + size_t name_len; + + name_len = strlen(name); + if (name_len < COREDUMP_FILE_SUFFIX_LEN) + { + return false; + } + + suffix = name + name_len - COREDUMP_FILE_SUFFIX_LEN; + return !!memcmp(suffix, COREDUMP_FILE_SUFFIX, COREDUMP_FILE_SUFFIX_LEN); +} + static int dumpfile_iterate(FAR char *path, dumpfile_cb_t cb, FAR void *arg) { FAR struct dirent *entry; @@ -84,7 +108,7 @@ static int dumpfile_iterate(FAR char *path, dumpfile_cb_t cb, FAR void *arg) while ((entry = readdir(dir)) != NULL) { - if (entry->d_type == DT_REG && !strncmp(entry->d_name, "core-", 5)) + if (entry->d_type == DT_REG && dumpfile_is_valid(entry->d_name)) { cb(path, entry->d_name, arg); } @@ -132,16 +156,11 @@ static void dumpfile_delete(FAR char *path, FAR const char *filename, static void coredump_restore(FAR char *savepath, size_t maxfile) { FAR struct coredump_info_s *info; - char dumppath[PATH_MAX] = - { - 0 - }; - + char dumppath[PATH_MAX]; unsigned char *swap; struct geometry geo; ssize_t writesize; ssize_t readsize; - struct tm *dtime; size_t offset = 0; size_t max = 0; int dumpfd; @@ -203,22 +222,9 @@ static void coredump_restore(FAR char *savepath, size_t maxfile) } ret = snprintf(dumppath, sizeof(dumppath), - "%s/core-%s", savepath, - info->name.version); - dtime = localtime(&info->time.tv_sec); - if (dtime) - { - ret += snprintf(dumppath + ret, sizeof(dumppath) - ret, - "-%d-%d-%d-%d-%d", dtime->tm_mon + 1, - dtime->tm_mday, dtime->tm_hour, - dtime->tm_min, dtime->tm_sec); - } - -#ifdef CONFIG_BOARD_COREDUMP_COMPRESSION - ret += snprintf(dumppath + ret, sizeof(dumppath) - ret, ".lzf"); -#else - ret += snprintf(dumppath + ret, sizeof(dumppath) - ret, ".core"); -#endif + "%s/%.16s-%x"COREDUMP_FILE_SUFFIX, + savepath, info->name.version, + (unsigned int)info->time.tv_sec); while (ret--) { From 04f49f179b951fda4fd3de0fd81872bcee6d2d16 Mon Sep 17 00:00:00 2001 From: buxiasen Date: Wed, 30 Oct 2024 21:12:02 +0800 Subject: [PATCH 016/391] system/coredump: coredump restore independ and support mtd Signed-off-by: buxiasen --- system/coredump/Kconfig | 21 +++++++-- system/coredump/coredump.c | 91 ++++++++++++++++---------------------- 2 files changed, 55 insertions(+), 57 deletions(-) diff --git a/system/coredump/Kconfig b/system/coredump/Kconfig index 1ddeaf0cdb8..c6e74964bed 100644 --- a/system/coredump/Kconfig +++ b/system/coredump/Kconfig @@ -22,10 +22,23 @@ config SYSTEM_COREDUMP_PRIORITY ---help--- This is the task priority that will be used when starting the coredump. -config SYSTEM_COREDUMP_SWAPBUFFER_NUMS - int "coredump read/write swap buffer nums" - default 64 +config SYSTEM_COREDUMP_SWAPBUFFER_SIZE + int "coredump read/write swap buffer size" + default 16384 ---help--- - The coredump read/write swap buffer nums. swap buffer size = sectorsize * nums + The coredump read/write swap buffer size in bytes. + +config SYSTEM_COREDUMP_RESTORE + bool "coredump restore from block/mtd device to filesystem" + default BOARD_COREDUMP_BLKDEV || BOARD_COREDUMP_MTDDEV + ---help--- + Userspace restore from block/mtd device to specific filesystem path. + +config SYSTEM_COREDUMP_DEVPATH + string "coredump block device path to restore" + depends on SYSTEM_COREDUMP_RESTORE + default BOARD_COREDUMP_DEVPATH if BOARD_COREDUMP_BLKDEV || BOARD_COREDUMP_MTDDEV + ---help--- + This is the block device path to restore. endif # SYSTEM_COREDUMP diff --git a/system/coredump/coredump.c b/system/coredump/coredump.c index 4579bca7f5f..0b7c9b7ba08 100644 --- a/system/coredump/coredump.c +++ b/system/coredump/coredump.c @@ -73,7 +73,7 @@ static struct memory_region_s g_memory_region[] = * dumpfile_iterate ****************************************************************************/ -#ifdef CONFIG_BOARD_COREDUMP_BLKDEV +#ifdef CONFIG_SYSTEM_COREDUMP_RESTORE static bool dumpfile_is_valid(FAR const char *name) { @@ -155,10 +155,9 @@ static void dumpfile_delete(FAR char *path, FAR const char *filename, static void coredump_restore(FAR char *savepath, size_t maxfile) { - FAR struct coredump_info_s *info; + struct coredump_info_s info; char dumppath[PATH_MAX]; unsigned char *swap; - struct geometry geo; ssize_t writesize; ssize_t readsize; size_t offset = 0; @@ -168,48 +167,36 @@ static void coredump_restore(FAR char *savepath, size_t maxfile) off_t off; int ret; - blkfd = open(CONFIG_BOARD_COREDUMP_BLKDEV_PATH, O_RDWR); + blkfd = open(CONFIG_SYSTEM_COREDUMP_DEVPATH, O_RDWR); if (blkfd < 0) { return; } - ret = ioctl(blkfd, BIOC_GEOMETRY, (unsigned long)((uintptr_t)&geo)); - if (ret < 0) + off = lseek(blkfd, -(off_t)sizeof(info), SEEK_END); + if (off < 0) { + printf("Seek %s fail\n", CONFIG_SYSTEM_COREDUMP_DEVPATH); goto blkfd_err; } - info = malloc(geo.geo_sectorsize); - if (info == NULL) + readsize = read(blkfd, &info, sizeof(info)); + if (readsize != sizeof(info)) { + printf("Read %s fail\n", CONFIG_SYSTEM_COREDUMP_DEVPATH); goto blkfd_err; } - off = lseek(blkfd, (geo.geo_nsectors - 1) * geo.geo_sectorsize, SEEK_SET); - if (off < 0) + if (info.magic != COREDUMP_MAGIC) { - printf("Seek %s fail\n", CONFIG_BOARD_COREDUMP_BLKDEV_PATH); - goto info_err; - } - - readsize = read(blkfd, info, geo.geo_sectorsize); - if (readsize != geo.geo_sectorsize) - { - printf("Read %s fail\n", CONFIG_BOARD_COREDUMP_BLKDEV_PATH); - goto info_err; - } - - if (info->magic != COREDUMP_MAGIC) - { - printf("%s coredump not found!\n", CONFIG_BOARD_COREDUMP_BLKDEV_PATH); - goto info_err; + printf("%s coredump not found!\n", CONFIG_SYSTEM_COREDUMP_DEVPATH); + goto blkfd_err; } ret = dumpfile_iterate(savepath, dumpfile_count, &max); if (ret < 0) { - goto info_err; + goto blkfd_err; } if (max >= maxfile) @@ -217,14 +204,16 @@ static void coredump_restore(FAR char *savepath, size_t maxfile) ret = dumpfile_iterate(savepath, dumpfile_delete, dumppath); if (ret < 0) { - goto info_err; + goto blkfd_err; } } + /* 'date -d @$(printf "%d" 0x6720C67E)' restore utc to date */ + ret = snprintf(dumppath, sizeof(dumppath), "%s/%.16s-%x"COREDUMP_FILE_SUFFIX, - savepath, info->name.version, - (unsigned int)info->time.tv_sec); + savepath, info.name.version, + (unsigned int)info.time.tv_sec); while (ret--) { @@ -238,11 +227,10 @@ static void coredump_restore(FAR char *savepath, size_t maxfile) if (dumpfd < 0) { printf("Open %s fail\n", dumppath); - goto info_err; + goto blkfd_err; } - swap = malloc(geo.geo_sectorsize * - CONFIG_SYSTEM_COREDUMP_SWAPBUFFER_NUMS); + swap = malloc(CONFIG_SYSTEM_COREDUMP_SWAPBUFFER_SIZE); if (swap == NULL) { printf("Malloc fail\n"); @@ -250,13 +238,12 @@ static void coredump_restore(FAR char *savepath, size_t maxfile) } lseek(blkfd, 0, SEEK_SET); - while (offset < info->size) + while (offset < info.size) { - readsize = read(blkfd, swap, geo.geo_sectorsize * - CONFIG_SYSTEM_COREDUMP_SWAPBUFFER_NUMS); + readsize = read(blkfd, swap, CONFIG_SYSTEM_COREDUMP_SWAPBUFFER_SIZE); if (readsize < 0) { - printf("Read %s fail\n", CONFIG_BOARD_COREDUMP_BLKDEV_PATH); + printf("Read %s fail\n", CONFIG_SYSTEM_COREDUMP_DEVPATH); break; } else if (readsize == 0) @@ -274,36 +261,34 @@ static void coredump_restore(FAR char *savepath, size_t maxfile) offset += writesize; } - if (offset < info->size) + if (offset < info.size) { printf("Coredump error [%s] need [%zu], but just get %zu\n", - dumppath, info->size, offset); + dumppath, info.size, offset); } else { - printf("Coredump finish [%s][%zu]\n", dumppath, info->size); + printf("Coredump finish [%s][%zu]\n", dumppath, info.size); } - info->magic = 0; - off = lseek(blkfd, (geo.geo_nsectors - 1) * geo.geo_sectorsize, SEEK_SET); + info.magic = 0; + off = lseek(blkfd, -(off_t)sizeof(info), SEEK_END); if (off < 0) { - printf("Seek %s fail\n", CONFIG_BOARD_COREDUMP_BLKDEV_PATH); + printf("Seek %s fail\n", CONFIG_SYSTEM_COREDUMP_DEVPATH); goto swap_err; } - writesize = write(blkfd, info, geo.geo_sectorsize); - if (writesize != geo.geo_sectorsize) + writesize = write(blkfd, &info, sizeof(info)); + if (writesize != sizeof(info)) { - printf("Write %s fail\n", CONFIG_BOARD_COREDUMP_BLKDEV_PATH); + printf("Write %s fail\n", CONFIG_SYSTEM_COREDUMP_DEVPATH); } swap_err: free(swap); fd_err: close(dumpfd); -info_err: - free(info); blkfd_err: close(blkfd); } @@ -422,10 +407,10 @@ static void usage(FAR const char *progname, int exitcode) fprintf(stderr, "\t -p, --pid , Default, all thread\n"); fprintf(stderr, "\t -f, --filename , Default stdout\n"); -#ifdef CONFIG_BOARD_COREDUMP_BLKDEV +#ifdef CONFIG_SYSTEM_COREDUMP_RESTORE fprintf(stderr, "Second usage, will restore coredump" "from %s to savepath\n", - CONFIG_BOARD_COREDUMP_BLKDEV_PATH); + CONFIG_SYSTEM_COREDUMP_DEVPATH); fprintf(stderr, "\t -s, --savepath \n"); fprintf(stderr, "\t -m, --maxfile ," "Maximum number of coredump files, Default 1\n"); @@ -443,7 +428,7 @@ static void usage(FAR const char *progname, int exitcode) int main(int argc, FAR char *argv[]) { -#ifdef CONFIG_BOARD_COREDUMP_BLKDEV +#ifdef CONFIG_SYSTEM_COREDUMP_RESTORE FAR char *savepath = NULL; size_t maxfile = 1; #endif @@ -455,7 +440,7 @@ int main(int argc, FAR char *argv[]) { {"pid", 1, NULL, 'p'}, {"filename", 1, NULL, 'f'}, -#ifdef CONFIG_BOARD_COREDUMP_BLKDEV +#ifdef CONFIG_SYSTEM_COREDUMP_RESTORE {"savepath", 1, NULL, 's'}, {"maxfile", 1, NULL, 'm'}, #endif @@ -473,7 +458,7 @@ int main(int argc, FAR char *argv[]) case 'f': name = optarg; break; -#ifdef CONFIG_BOARD_COREDUMP_BLKDEV +#ifdef CONFIG_SYSTEM_COREDUMP_RESTORE case 's': savepath = optarg; break; @@ -488,7 +473,7 @@ int main(int argc, FAR char *argv[]) } } -#ifdef CONFIG_BOARD_COREDUMP_BLKDEV +#ifdef CONFIG_SYSTEM_COREDUMP_RESTORE if (savepath != NULL) { coredump_restore(savepath, maxfile); From b75e404ec18b238cf8090fe70f746d3b170a5b5a Mon Sep 17 00:00:00 2001 From: buxiasen Date: Tue, 19 Nov 2024 12:39:21 +0800 Subject: [PATCH 017/391] coredump: use llx to fix coverity report Signed-off-by: buxiasen --- system/coredump/coredump.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/coredump/coredump.c b/system/coredump/coredump.c index 0b7c9b7ba08..762fb20e285 100644 --- a/system/coredump/coredump.c +++ b/system/coredump/coredump.c @@ -211,9 +211,9 @@ static void coredump_restore(FAR char *savepath, size_t maxfile) /* 'date -d @$(printf "%d" 0x6720C67E)' restore utc to date */ ret = snprintf(dumppath, sizeof(dumppath), - "%s/%.16s-%x"COREDUMP_FILE_SUFFIX, + "%s/%.16s-%llx"COREDUMP_FILE_SUFFIX, savepath, info.name.version, - (unsigned int)info.time.tv_sec); + (unsigned long long)info.time.tv_sec); while (ret--) { From 22d5d1d9d8b462a0e8bb26ad8d9a00eb7aeb5748 Mon Sep 17 00:00:00 2001 From: buxiasen Date: Fri, 29 Nov 2024 21:26:14 +0800 Subject: [PATCH 018/391] coredump: move definition out of types Signed-off-by: buxiasen --- system/coredump/coredump.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/system/coredump/coredump.c b/system/coredump/coredump.c index 762fb20e285..1846dc9ee88 100644 --- a/system/coredump/coredump.c +++ b/system/coredump/coredump.c @@ -40,7 +40,7 @@ #include /**************************************************************************** - * Private Types + * Pre-processor Definitions ****************************************************************************/ #ifdef CONFIG_BOARD_COREDUMP_COMPRESSION @@ -51,6 +51,10 @@ #define COREDUMP_FILE_SUFFIX_LEN (sizeof(COREDUMP_FILE_SUFFIX) - 1) +/**************************************************************************** + * Private Types + ****************************************************************************/ + typedef CODE void (*dumpfile_cb_t)(FAR char *path, FAR const char *filename, FAR void *arg); From bd94b6da1a218e512bf7bea8f89f9fdab87c154a Mon Sep 17 00:00:00 2001 From: chao an Date: Thu, 28 Nov 2024 19:21:21 +0800 Subject: [PATCH 019/391] system/flatbuffers: fix patch flow of flatbuffers Applying patch to flatbuffers patching file '<' Hunk #1 FAILED at 1. 1 out of 1 hunk FAILED -- saving rejects to file '<.rej' patching file '<' Hunk #1 FAILED at 39. 1 out of 1 hunk FAILED -- saving rejects to file '<.rej' patching file '<' Hunk #1 FAILED at 495. 1 out of 1 hunk FAILED -- saving rejects to file '<.rej' patching file '<' Hunk #1 FAILED at 23. 1 out of 1 hunk FAILED -- saving rejects to file '<.rej' patch: **** Can't reopen file '<' : No such file or directory -- Configuring done (12.8s) -- Generating done (0.3s) Signed-off-by: chao an --- system/flatbuffers/CMakeLists.txt | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/system/flatbuffers/CMakeLists.txt b/system/flatbuffers/CMakeLists.txt index 06e5d13fdbe..82fad521b7b 100644 --- a/system/flatbuffers/CMakeLists.txt +++ b/system/flatbuffers/CMakeLists.txt @@ -33,6 +33,8 @@ if(CONFIG_SYSTEM_FLATBUFFERS) flatbuffers_fetch URL ${FLATBUFFERS_URL} SOURCE_DIR ${FLATBUFFERS_DIR} BINARY_DIR ${CMAKE_BINARY_DIR}/apps/math/flatbuffers/flatbuffers + PATCH_COMMAND patch -d ${FLATBUFFERS_DIR} -p1 < + ${CMAKE_CURRENT_LIST_DIR}/flatbuffers.patch DOWNLOAD_NO_PROGRESS true TIMEOUT 30) @@ -40,14 +42,6 @@ if(CONFIG_SYSTEM_FLATBUFFERS) if(NOT flatbuffers_fetch_POPULATED) FetchContent_Populate(flatbuffers_fetch) - - # Apply the patch after fetching the content - execute_process( - COMMAND ${CMAKE_COMMAND} -E echo "Applying patch to flatbuffers" - WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}) - - execute_process(COMMAND patch -d ${FLATBUFFERS_DIR} -p1 < - ${CMAKE_CURRENT_LIST_DIR}/flatbuffers.patch) endif() endif() From 8bc824a5e703884f71109940c6f5c6e0bc0a2d86 Mon Sep 17 00:00:00 2001 From: chao an Date: Fri, 29 Nov 2024 14:43:05 +0800 Subject: [PATCH 020/391] system/tflite-micro: fix patch flow of tflite-micro Signed-off-by: chao an --- math/kissfft/CMakeLists.txt | 10 ++-------- mlearning/tflite-micro/CMakeLists.txt | 23 ++++++++--------------- mlearning/tflite-micro/Kconfig | 6 +++--- 3 files changed, 13 insertions(+), 26 deletions(-) diff --git a/math/kissfft/CMakeLists.txt b/math/kissfft/CMakeLists.txt index 07c8e5f06f2..86841307542 100644 --- a/math/kissfft/CMakeLists.txt +++ b/math/kissfft/CMakeLists.txt @@ -33,6 +33,8 @@ if(CONFIG_MATH_KISSFFT) kissfft_fetch URL ${KISSFFT_URL} SOURCE_DIR ${KISSFFT_DIR} BINARY_DIR ${CMAKE_BINARY_DIR}/apps/math/kissfft/kissfft + PATCH_COMMAND patch -d ${KISSFFT_DIR} -p1 < + ${CMAKE_CURRENT_LIST_DIR}/kissfft.patch DOWNLOAD_NO_PROGRESS true TIMEOUT 30) @@ -40,14 +42,6 @@ if(CONFIG_MATH_KISSFFT) if(NOT kissfft_fetch_POPULATED) FetchContent_Populate(kissfft_fetch) - - # Apply the patch after fetching the content - execute_process( - COMMAND ${CMAKE_COMMAND} -E echo "Applying patch to kissfft" - WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}) - - execute_process(COMMAND patch -d ${KISSFFT_DIR} -p1 < - ${CMAKE_CURRENT_LIST_DIR}/kissfft.patch) endif() endif() diff --git a/mlearning/tflite-micro/CMakeLists.txt b/mlearning/tflite-micro/CMakeLists.txt index c52d492d0d3..c5da0ea2d55 100644 --- a/mlearning/tflite-micro/CMakeLists.txt +++ b/mlearning/tflite-micro/CMakeLists.txt @@ -34,6 +34,14 @@ if(CONFIG_TFLITEMICRO) tflite_micro_fetch URL ${TFLITE_MICRO_URL} SOURCE_DIR ${TFLITE_MICRO_DIR} BINARY_DIR ${CMAKE_BINARY_DIR}/apps/mlearning/tflite-micro/tflite-micro + PATCH_COMMAND + patch -d ${TFLITE_MICRO_DIR} -p1 < + ${CMAKE_CURRENT_LIST_DIR}/tflite-micro.patch && patch -d + ${TFLITE_MICRO_DIR} -p1 < + ${CMAKE_CURRENT_LIST_DIR}/0001-dequantize-int8.patch && patch -d + ${TFLITE_MICRO_DIR} -p1 < + ${CMAKE_CURRENT_LIST_DIR}/0002-quantize-int8.patch && patch -d + ${TFLITE_MICRO_DIR} -p1 < ${CMAKE_CURRENT_LIST_DIR}/0003-mean-int8.patch DOWNLOAD_NO_PROGRESS true TIMEOUT 30) @@ -41,21 +49,6 @@ if(CONFIG_TFLITEMICRO) if(NOT tflite_micro_fetch_POPULATED) FetchContent_Populate(tflite_micro_fetch) - - # Apply the patch after fetching the content - execute_process( - COMMAND ${CMAKE_COMMAND} -E echo "Applying patch to tflite-micro" - WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}) - execute_process(COMMAND patch -d ${TFLITE_MICRO_DIR} -p1 < - ${CMAKE_CURRENT_LIST_DIR}/tflite-micro.patch) - execute_process( - COMMAND patch -d ${TFLITE_MICRO_DIR} -p1 < - ${CMAKE_CURRENT_LIST_DIR}/0001-dequantize-int8.patch) - execute_process( - COMMAND patch -d ${TFLITE_MICRO_DIR} -p1 < - ${CMAKE_CURRENT_LIST_DIR}/0002-quantize-int8.patch) - execute_process(COMMAND patch -d ${TFLITE_MICRO_DIR} -p1 < - ${CMAKE_CURRENT_LIST_DIR}/0003-mean-int8.patch) endif() endif() diff --git a/mlearning/tflite-micro/Kconfig b/mlearning/tflite-micro/Kconfig index 4363d7c88e9..b7eaf75cc23 100644 --- a/mlearning/tflite-micro/Kconfig +++ b/mlearning/tflite-micro/Kconfig @@ -24,7 +24,7 @@ config TFLITEMICRO depends on SYSTEM_FLATBUFFERS && MATH_GEMMLOWP && MATH_KISSFFT && MATH_RUY if TFLITEMICRO - config TFLITEMICRO_DEBUG +config TFLITEMICRO_DEBUG bool "Print tflite-micro's debug message" default n @@ -33,11 +33,11 @@ config TFLITEMICRO_TOOL default n if TFLITEMICRO_TOOL - config TFLITEMICRO_TOOL_PRIORITY +config TFLITEMICRO_TOOL_PRIORITY int "tflite-micro tool priority" default 100 - config TFLITEMICRO_TOOL_STACKSIZE +config TFLITEMICRO_TOOL_STACKSIZE int "tflite-micro tool stacksize" default 4096 From 581b4cb6733f57bcc970e3708fefc94b14d7a52e Mon Sep 17 00:00:00 2001 From: chao an Date: Fri, 29 Nov 2024 14:43:35 +0800 Subject: [PATCH 021/391] mlearning/CMakeLists: include subdirectory to ensure ML module could be compile Signed-off-by: chao an --- mlearning/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mlearning/CMakeLists.txt b/mlearning/CMakeLists.txt index fcc400cd67e..c4b8742ba35 100644 --- a/mlearning/CMakeLists.txt +++ b/mlearning/CMakeLists.txt @@ -18,4 +18,6 @@ # # ############################################################################## +nuttx_add_subdirectory() + nuttx_generate_kconfig(MENUDESC "Machine Learning Support") From 5cb1cc7ac7acdda010fd55da03ca02849575b9b7 Mon Sep 17 00:00:00 2001 From: chao an Date: Fri, 29 Nov 2024 14:46:23 +0800 Subject: [PATCH 022/391] mlearning/tflite-micro: correct include patch of support library 1. correct include patch of support library 2. add flatbuffers include path Signed-off-by: chao an --- mlearning/tflite-micro/CMakeLists.txt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/mlearning/tflite-micro/CMakeLists.txt b/mlearning/tflite-micro/CMakeLists.txt index c5da0ea2d55..474f165d6d7 100644 --- a/mlearning/tflite-micro/CMakeLists.txt +++ b/mlearning/tflite-micro/CMakeLists.txt @@ -136,13 +136,15 @@ if(CONFIG_TFLITEMICRO) # ############################################################################ set(INCDIR - ${CMAKE_BINARY_DIR}/apps/math/gemmlowp/gemmlowp - ${CMAKE_BINARY_DIR}/apps/math/ruy/ruy - ${CMAKE_BINARY_DIR}/apps/math/kissfft/kissfft - ${CMAKE_BINARY_DIR}/apps/math/tflite-micro/tflite-micro) + ${NUTTX_APPS_DIR}/math/gemmlowp/gemmlowp + ${NUTTX_APPS_DIR}/math/ruy/ruy + ${NUTTX_APPS_DIR}/math/kissfft/kissfft + ${NUTTX_APPS_DIR}/math/kissfft/kissfft + ${NUTTX_APPS_DIR}/mlearning/tflite-micro/tflite-micro + ${NUTTX_APPS_DIR}/system/flatbuffers/flatbuffers/include) if(CONFIG_MLEARNING_CMSIS_NN) - list(APPEND INCDIR ${CMAKE_BINARY_DIR}/apps/mlearning/cmsis-nn/cmsis-nn) + list(APPEND INCDIR ${NUTTX_APPS_DIR}/apps/mlearning/cmsis-nn/cmsis-nn) endif() # ############################################################################ From 3fd04e86e8d61dc3e12cafb18a5523ece92f4703 Mon Sep 17 00:00:00 2001 From: chao an Date: Fri, 29 Nov 2024 14:47:24 +0800 Subject: [PATCH 023/391] math/ruy: remove ruy library from cmake list ruy is not really used, tflite just uses the header file Error log from CMake: ================================================================ -- Configuring done (2.1s) CMake Error at cmake/nuttx_add_library.cmake:183 (add_library): No SOURCES given to target: ruy Call Stack (most recent call first): apps/math/ruy/CMakeLists.txt:57 (nuttx_add_library) Signed-off-by: chao an --- math/ruy/CMakeLists.txt | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/math/ruy/CMakeLists.txt b/math/ruy/CMakeLists.txt index 94dbcf73050..b31f497f271 100644 --- a/math/ruy/CMakeLists.txt +++ b/math/ruy/CMakeLists.txt @@ -44,17 +44,4 @@ if(CONFIG_MATH_RUY) endif() endif() - # ############################################################################ - # Include Directory - # ############################################################################ - - set(INCDIR ${CMAKE_CURRENT_LIST_DIR}/ruy) - - # ############################################################################ - # Library Configuration - # ############################################################################ - - nuttx_add_library(ruy STATIC) - target_include_directories(ruy PUBLIC ${INCDIR}) - endif() From 8b253d699cffb1ff720ac5fd2ccff10ae8148802 Mon Sep 17 00:00:00 2001 From: chao an Date: Fri, 29 Nov 2024 14:59:18 +0800 Subject: [PATCH 024/391] mlearning/tflite-micro: add tflm tool into cmake build Signed-off-by: chao an --- mlearning/tflite-micro/CMakeLists.txt | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/mlearning/tflite-micro/CMakeLists.txt b/mlearning/tflite-micro/CMakeLists.txt index 474f165d6d7..788408607a3 100644 --- a/mlearning/tflite-micro/CMakeLists.txt +++ b/mlearning/tflite-micro/CMakeLists.txt @@ -59,7 +59,6 @@ if(CONFIG_TFLITEMICRO) set(COMMON_FLAGS -DTF_LITE_STATIC_MEMORY -DTF_LITE_DISABLE_X86_NEON - -DTF_LITE_STRIP_ERROR_STRINGS -Wno-sign-compare -Wno-unused-variable -Wno-undef @@ -70,6 +69,13 @@ if(CONFIG_TFLITEMICRO) list(APPEND COMMON_FLAGS -DCMSIS_NN) endif() + if(CONFIG_TFLITEMICRO_DEBUG) + list(APPEND COMMON_FLAGS -DTF_LITE_SHOW_MEMORY_USE) + list(APPEND COMMON_FLAGS -DTF_LITE_USE_CTIME) + else() + list(APPEND COMMON_FLAGS -DTF_LITE_STRIP_ERROR_STRINGS) + endif() + # ############################################################################ # Sources # ############################################################################ @@ -156,4 +162,20 @@ if(CONFIG_TFLITEMICRO) target_sources(tflite_micro PRIVATE ${TFLITE_MICRO_SRCS}) target_include_directories(tflite_micro PUBLIC ${INCDIR}) + if(CONFIG_TFLITEMICRO_TOOL) + nuttx_add_application( + NAME + tflm + STACKSIZE + ${CONFIG_TFLITEMICRO_TOOL_STACKSIZE} + PRIORITY + ${CONFIG_TFLITEMICRO_TOOL_PRIORITY} + SRCS + ${CMAKE_CURRENT_LIST_DIR}/tflm_tool.cc + INCLUDE_DIRECTORIES + ${INCDIR} + COMPILE_FLAGS + ${COMMON_FLAGS}) + endif() + endif() From 0b3428942fa3b814dde24ffb336bc9a5efd0e428 Mon Sep 17 00:00:00 2001 From: George Poulios Date: Sun, 1 Dec 2024 02:11:17 +0200 Subject: [PATCH 025/391] Update MbedTLS 3.4.0 -> 3.6.2 and set it as default Even though one could in theory simply set CONFIG_MBEDTLS_VERSION="3.6.2", this commit is needed for 2 reasons: 1. The patches need to be updated: 0001 works almost as-is (with fuzz 2) but 0002 hunk #4 fails and needed adjustment. Otherwise, the patches are identical. 2. mbedtls_config.h needs to be updated: Following the same approach for the Kconfig this commit updates both Kconfig and mbedtls_config.h according to the changes: mbedtls$ git diff v3.4.0...v3.6.2 -- include/mbedtls/mbedtls_config.h Minor edits also to crypto/controlse to comply with v3.6.2. Signed-off-by: George Poulios --- crypto/controlse/Kconfig | 2 +- crypto/controlse/cmbedtls_se05x_extension.hxx | 5 +- ...poll-use-getrandom-to-get-the-system.patch | 33 +- ...02-mbedtls-add-mbedtls-x509-crt-pool.patch | 82 +- crypto/mbedtls/Kconfig | 148 ++- .../mbedtls/include/mbedtls/mbedtls_config.h | 1072 +++++++++++------ 6 files changed, 910 insertions(+), 432 deletions(-) diff --git a/crypto/controlse/Kconfig b/crypto/controlse/Kconfig index e1da37dcd11..76b85ec571e 100644 --- a/crypto/controlse/Kconfig +++ b/crypto/controlse/Kconfig @@ -8,7 +8,7 @@ config CRYPTO_CONTROLSE default n depends on DEV_SE05X depends on CRYPTO_MBEDTLS - depends on MBEDTLS_VERSION = "3.4.0" + depends on MBEDTLS_VERSION = "3.6.2" select MBEDTLS_ECDSA_C select MBEDTLS_ECP_C select MBEDTLS_ECP_DP_SECP256R1_ENABLED diff --git a/crypto/controlse/cmbedtls_se05x_extension.hxx b/crypto/controlse/cmbedtls_se05x_extension.hxx index 9568ad66779..4e8fda7703d 100644 --- a/crypto/controlse/cmbedtls_se05x_extension.hxx +++ b/crypto/controlse/cmbedtls_se05x_extension.hxx @@ -89,7 +89,7 @@ public: return result; } - static int ecdsa_sign_wrap(void *ctx, mbedtls_md_type_t md_alg, + static int ecdsa_sign_wrap(mbedtls_pk_context *pk, mbedtls_md_type_t md_alg, const unsigned char *hash, size_t hash_len, unsigned char *sig, size_t sig_size, size_t *sig_len, @@ -97,7 +97,8 @@ public: void *p_rng) { - mbedtls_ecp_keypair *key = reinterpret_cast(ctx); + mbedtls_ecp_keypair *key = + reinterpret_cast(pk->pk_ctx); auto se05x_ctx = reinterpret_cast(key->d.p); struct se05x_signature_s args diff --git a/crypto/mbedtls/0001-mbedtls-entropy_poll-use-getrandom-to-get-the-system.patch b/crypto/mbedtls/0001-mbedtls-entropy_poll-use-getrandom-to-get-the-system.patch index c97804e3dd4..8a8aeab8abf 100644 --- a/crypto/mbedtls/0001-mbedtls-entropy_poll-use-getrandom-to-get-the-system.patch +++ b/crypto/mbedtls/0001-mbedtls-entropy_poll-use-getrandom-to-get-the-system.patch @@ -1,22 +1,31 @@ -From e40fdc9238384ee62013c41d74cb4d47ae8c1aad Mon Sep 17 00:00:00 2001 -From: makejian -Date: Mon, 11 Sep 2023 19:40:04 +0800 -Subject: [PATCH] mbedtls/entropy_poll: use 'getrandom' to get the system +From b82b0c314d78d44f717a69924e7a60d8d43eb200 Mon Sep 17 00:00:00 2001 +From: George Poulios +Date: Fri, 29 Nov 2024 10:32:54 +0200 +Subject: [PATCH 1/2] mbedtls/entropy_poll: use 'getrandom' to get the system entropy -VELAPLATFO-16390 +Original patch: + From e40fdc9238384ee62013c41d74cb4d47ae8c1aad Mon Sep 17 00:00:00 2001 + From: makejian + Date: Mon, 11 Sep 2023 19:40:04 +0800 + Subject: [PATCH] mbedtls/entropy_poll: use 'getrandom' to get the system + entropy -Change-Id: I885969c441cd174f5eedf8c9ce17b89e501148c8 -Signed-off-by: makejian + VELAPLATFO-16390 + + Change-Id: I885969c441cd174f5eedf8c9ce17b89e501148c8 + Signed-off-by: makejian + +Signed-off-by: George Poulios --- library/entropy_poll.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -diff --git mbedtls/library/entropy_poll.c mbedtls/library/entropy_poll.c -index b5024c83f..e9431e812 100644 ---- mbedtls/library/entropy_poll.c -+++ mbedtls/library/entropy_poll.c -@@ -103,10 +103,11 @@ static int getrandom_wrapper(void *buf, size_t buflen, unsigned int flags) +diff --git a/library/entropy_poll.c b/library/entropy_poll.c +index 611768cd85..a26e154db1 100644 +--- a/library/entropy_poll.c ++++ b/library/entropy_poll.c +@@ -95,10 +95,11 @@ static int getrandom_wrapper(void *buf, size_t buflen, unsigned int flags) #endif /* SYS_getrandom */ #endif /* __linux__ || __midipix__ */ diff --git a/crypto/mbedtls/0002-mbedtls-add-mbedtls-x509-crt-pool.patch b/crypto/mbedtls/0002-mbedtls-add-mbedtls-x509-crt-pool.patch index 3bac43e8c77..728903abec3 100644 --- a/crypto/mbedtls/0002-mbedtls-add-mbedtls-x509-crt-pool.patch +++ b/crypto/mbedtls/0002-mbedtls-add-mbedtls-x509-crt-pool.patch @@ -1,9 +1,17 @@ -From e9eeb5721637faa451f66bbb2789046b9a7963d5 Mon Sep 17 00:00:00 2001 -From: makejian -Date: Fri, 18 Aug 2023 15:52:45 +0800 -Subject: [PATCH 1/2] mbedtls: add mbedtls x509 crt pool +From f846c8fb13238a4db1f7d5e1a9ebce459c21faf7 Mon Sep 17 00:00:00 2001 +From: George Poulios +Date: Fri, 29 Nov 2024 10:33:57 +0200 +Subject: [PATCH 2/2] mbedtls: add mbedtls x509 crt pool -Signed-off-by: makejian +Original patch: + From e9eeb5721637faa451f66bbb2789046b9a7963d5 Mon Sep 17 00:00:00 2001 + From: makejian + Date: Fri, 18 Aug 2023 15:52:45 +0800 + Subject: [PATCH 1/2] mbedtls: add mbedtls x509 crt pool + + Signed-off-by: makejian + +Signed-off-by: George Poulios --- include/mbedtls/threading.h | 4 + library/threading.c | 3 + @@ -14,13 +22,13 @@ Signed-off-by: makejian create mode 100644 library/x509_crt_pool.c create mode 100644 library/x509_crt_pool.h -diff --git mbedtls/include/mbedtls/threading.h mbedtls/include/mbedtls/threading.h -index 1b9c7ced2..e3986cd67 100644 ---- mbedtls/include/mbedtls/threading.h -+++ mbedtls/include/mbedtls/threading.h -@@ -108,6 +108,10 @@ extern mbedtls_threading_mutex_t mbedtls_threading_readdir_mutex; - extern mbedtls_threading_mutex_t mbedtls_threading_gmtime_mutex; - #endif /* MBEDTLS_HAVE_TIME_DATE && !MBEDTLS_PLATFORM_GMTIME_R_ALT */ +diff --git a/include/mbedtls/threading.h b/include/mbedtls/threading.h +index d50d04ead1..9fffe6705d 100644 +--- a/include/mbedtls/threading.h ++++ b/include/mbedtls/threading.h +@@ -128,6 +128,10 @@ extern mbedtls_threading_mutex_t mbedtls_threading_psa_globaldata_mutex; + extern mbedtls_threading_mutex_t mbedtls_threading_psa_rngdata_mutex; + #endif +#if defined(MBEDTLS_X509_CRT_POOL) +extern mbedtls_threading_mutex_t mbedtls_threading_x509crtpool_mutex; @@ -29,24 +37,24 @@ index 1b9c7ced2..e3986cd67 100644 #endif /* MBEDTLS_THREADING_C */ #ifdef __cplusplus -diff --git mbedtls/library/threading.c mbedtls/library/threading.c -index 130c6963d..c91df6f6a 100644 ---- mbedtls/library/threading.c -+++ mbedtls/library/threading.c -@@ -189,5 +189,8 @@ mbedtls_threading_mutex_t mbedtls_threading_readdir_mutex MUTEX_INIT; - #if defined(THREADING_USE_GMTIME) - mbedtls_threading_mutex_t mbedtls_threading_gmtime_mutex MUTEX_INIT; +diff --git a/library/threading.c b/library/threading.c +index 85db243f21..da500193f5 100644 +--- a/library/threading.c ++++ b/library/threading.c +@@ -191,5 +191,8 @@ mbedtls_threading_mutex_t mbedtls_threading_key_slot_mutex MUTEX_INIT; + mbedtls_threading_mutex_t mbedtls_threading_psa_globaldata_mutex MUTEX_INIT; + mbedtls_threading_mutex_t mbedtls_threading_psa_rngdata_mutex MUTEX_INIT; #endif +#if defined(MBEDTLS_X509_CRT_POOL) +mbedtls_threading_mutex_t mbedtls_threading_x509crtpool_mutex MUTEX_INIT; +#endif #endif /* MBEDTLS_THREADING_C */ -diff --git mbedtls/library/x509_crt.c mbedtls/library/x509_crt.c -index cf62532f2..8d058a092 100644 ---- mbedtls/library/x509_crt.c -+++ mbedtls/library/x509_crt.c -@@ -78,6 +78,10 @@ +diff --git a/library/x509_crt.c b/library/x509_crt.c +index 53cdcf0266..dd3c83a91a 100644 +--- a/library/x509_crt.c ++++ b/library/x509_crt.c +@@ -71,6 +71,10 @@ #endif /* !_WIN32 || EFIX64 || EFI32 */ #endif @@ -57,9 +65,9 @@ index cf62532f2..8d058a092 100644 /* * Item in a verification chain: cert and flags for it */ -@@ -995,6 +999,12 @@ static int x509_crt_parse_der_core(mbedtls_x509_crt *crt, +@@ -1113,6 +1117,12 @@ static int x509_crt_parse_der_core(mbedtls_x509_crt *crt, end = crt_end = p + len; - crt->raw.len = crt_end - buf; + crt->raw.len = (size_t) (crt_end - buf); if (make_copy != 0) { +#if defined(MBEDTLS_X509_CRT_POOL) + crt->raw.p = p = x509_crt_pool_ref_buf(buf, crt->raw.len); @@ -70,7 +78,7 @@ index cf62532f2..8d058a092 100644 /* Create and populate a new buffer for the raw field. */ crt->raw.p = p = mbedtls_calloc(1, crt->raw.len); if (crt->raw.p == NULL) { -@@ -1002,6 +1012,7 @@ static int x509_crt_parse_der_core(mbedtls_x509_crt *crt, +@@ -1120,6 +1130,7 @@ static int x509_crt_parse_der_core(mbedtls_x509_crt *crt, } memcpy(crt->raw.p, buf, crt->raw.len); @@ -78,24 +86,23 @@ index cf62532f2..8d058a092 100644 crt->own_buffer = 1; p += crt->raw.len - len; -@@ -2839,8 +2850,12 @@ void mbedtls_x509_crt_free(mbedtls_x509_crt *crt) - mbedtls_asn1_sequence_free(cert_cur->certificate_policies.next); +@@ -3246,7 +3257,11 @@ void mbedtls_x509_crt_free(mbedtls_x509_crt *crt) + mbedtls_asn1_sequence_free(cert_cur->authority_key_id.authorityCertIssuer.next); if (cert_cur->raw.p != NULL && cert_cur->own_buffer) { +#if defined(MBEDTLS_X509_CRT_POOL) + x509_crt_pool_unref_buf(cert_cur->raw.p); +#else - mbedtls_platform_zeroize(cert_cur->raw.p, cert_cur->raw.len); - mbedtls_free(cert_cur->raw.p); + mbedtls_zeroize_and_free(cert_cur->raw.p, cert_cur->raw.len); +#endif } cert_prv = cert_cur; -diff --git mbedtls/library/x509_crt_pool.c mbedtls/library/x509_crt_pool.c +diff --git a/library/x509_crt_pool.c b/library/x509_crt_pool.c new file mode 100644 -index 000000000..da00c88a8 +index 0000000000..da00c88a85 --- /dev/null -+++ mbedtls/library/x509_crt_pool.c ++++ b/library/x509_crt_pool.c @@ -0,0 +1,142 @@ +/* + * X.509 certificate pool @@ -239,11 +246,11 @@ index 000000000..da00c88a8 +} + +#endif /* MBEDTLS_X509_CRT_POOL */ -diff --git mbedtls/library/x509_crt_pool.h mbedtls/library/x509_crt_pool.h +diff --git a/library/x509_crt_pool.h b/library/x509_crt_pool.h new file mode 100644 -index 000000000..8592761de +index 0000000000..8592761de4 --- /dev/null -+++ mbedtls/library/x509_crt_pool.h ++++ b/library/x509_crt_pool.h @@ -0,0 +1,30 @@ +/** + * \file x509_crt_pool.h @@ -277,4 +284,3 @@ index 000000000..8592761de +#endif /* mbedtls_x509_crt_pool.h */ -- 2.40.0 - diff --git a/crypto/mbedtls/Kconfig b/crypto/mbedtls/Kconfig index 2a5d5d53c22..c843bda7f4f 100644 --- a/crypto/mbedtls/Kconfig +++ b/crypto/mbedtls/Kconfig @@ -13,7 +13,7 @@ if CRYPTO_MBEDTLS config MBEDTLS_VERSION string "Mbed TLS Version" - default "3.4.0" + default "3.6.2" config MBEDTLS_DEBUG_C bool "This module provides debugging functions." @@ -107,7 +107,7 @@ config MBEDTLS_SSL_DTLS_HELLO_VERIFY default y config MBEDTLS_SSL_DTLS_CONNECTION_ID - bool "Enable the Connection ID extension." + bool "Enable support for the DTLS Connection ID (CID) extension." default y config MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT @@ -142,6 +142,10 @@ config MBEDTLS_NET_C bool "Enable the TCP and UDP over IPv6/IPv4 networking routines" default LIBC_NETDB +config MBEDTLS_OID_C + bool "Enable the OID database." + default y + config MBEDTLS_ECDSA_C bool "Enable the elliptic curve DSA library." default y @@ -158,8 +162,19 @@ config MBEDTLS_PEM_WRITE_C bool "Enable PEM encoding / writing." default y +config MBEDTLS_PK_C + bool "Enable the generic public (asymmetric) key layer." + depends on MBEDTLS_MD_C && MBEDTLS_RSA_C && MBEDTLS_ECP_C + default y + +config MBEDTLS_PK_PARSE_C + bool "Enable the generic public (asymmetric) key parser" + depends on MBEDTLS_ASN1_PARSE_C && MBEDTLS_OID_C && MBEDTLS_PK_C + default y + config MBEDTLS_PK_WRITE_C bool "Enable the generic public (asymmetric) key writer." + depends on MBEDTLS_ASN1_WRITE_C && MBEDTLS_OID_C && MBEDTLS_PK_C default y config MBEDTLS_X509_CREATE_C @@ -324,6 +339,10 @@ config MBEDTLS_PK_PARSE_EC_EXTENDED bool "Enhance support for reading EC keys using variants of SEC1 not allowed by RFC 5915 and RFC 5480." default y +config MBEDTLS_PK_PARSE_EC_COMPRESSED + bool "Enable the support for parsing public keys of type Short Weierstrass (MBEDTLS_ECP_DP_SECP_XXX and MBEDTLS_ECP_DP_BP_XXX) which are using the compressed point format." + default y + config MBEDTLS_ERROR_STRERROR_DUMMY bool "Enable a dummy error function to make use of mbedtls_strerror()." default y @@ -336,11 +355,24 @@ config MBEDTLS_PK_RSA_ALT_SUPPORT bool "Support external private RSA keys (eg from a HSM) in the PK layer." default y +config MBEDTLS_PKCS1_V21 + bool "Enable support for PKCS#1 v2.1 encoding." + default y + config MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG bool "Make the PSA Crypto module use an external random generator provided by a driver, instead of Mbed TLS's entropy and DRBG modules." depends on DEV_RANDOM default n +config MBEDTLS_PSA_KEY_STORE_DYNAMIC + bool "Dynamically resize the PSA key store to accommodate any number of volatile keys (until the heap memory is exhausted)." + depends on MBEDTLS_PSA_CRYPTO_C + default y + +config MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS + bool "Assume all buffers passed to PSA functions are owned exclusively by the PSA function and are not stored in shared memory." + default n + config MBEDTLS_SSL_CONTEXT_SERIALIZATION bool "Enable serialization of the TLS context structures." depends on MBEDTLS_GCM_C || MBEDTLS_CCM_C || MBEDTLS_CHACHAPOLY_C @@ -362,23 +394,43 @@ config MBEDTLS_SSL_MAX_FRAGMENT_LENGTH bool "Enable support for RFC 6066 max_fragment_length extension in SSL." default y +config MBEDTLS_SSL_PROTO_TLS1_2 + bool "Enable support for TLS 1.2 (and DTLS 1.2 if DTLS is enabled)." + depends on (MBEDTLS_USE_PSA_CRYPTO ||\ + (MBEDTLS_MD_C && (MBEDTLS_SHA256_C || MBEDTLS_SHA384_C))) + default y + help + If MBEDTLS_USE_PSA_CRYPTO is set, then PSA_WANT_ALG_SHA_256 or PSA_WANT_ALG_SHA_384 + must be defined. + +config MBEDTLS_SSL_PROTO_TLS1_3 + bool "Enable support for TLS 1.3." + depends on MBEDTLS_SSL_KEEP_PEER_CERTIFICATE && MBEDTLS_PSA_CRYPTO_C + default y + +config MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE + bool "Enable TLS 1.3 middlebox compatibility mode." + default y + config MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED bool "Enable TLS 1.3 PSK key exchange mode." default y config MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED bool "Enable TLS 1.3 ephemeral key exchange mode." - depends on MBEDTLS_ECDH_C + depends on MBEDTLS_X509_CRT_PARSE_C && \ + (MBEDTLS_ECDSA_C || MBEDTLS_USE_PSA_CRYPTO || MBEDTLS_PKCS1_V21) default y + help + Requires PSA_WANT_ALG_ECDH or PSA_WANT_ALG_FFDH to be defined. Also, if + MBEDTLS_USE_PSA_CRYPTO is used to satisfy its dependencies, then PSA_WANT_ALG_ECDSA + must also be defined. config MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED bool "Enable TLS 1.3 PSK ephemeral key exchange mode." - depends on MBEDTLS_ECDH_C default y - -config MBEDTLS_SSL_MAX_EARLY_DATA_SIZE - int "The default maximum amount of 0-RTT data." - default 1024 + help + Requires PSA_WANT_ALG_ECDH or PSA_WANT_ALG_FFDH. config MBEDTLS_SSL_SESSION_TICKETS bool "Enable support for RFC 5077 session tickets in SSL." @@ -393,6 +445,11 @@ config MBEDTLS_THREADING_PTHREAD depends on MBEDTLS_THREADING_C default n +config MBEDTLS_USE_PSA_CRYPTO + bool "Make the X.509 and TLS library use PSA for cryptographic operations, and enable new APIs for using keys handled by PSA Crypto." + depends on MBEDTLS_PSA_CRYPTO_C + default n + config MBEDTLS_VERSION_FEATURES bool "Allow run-time checking of compile-time enabled features." depends on MBEDTLS_VERSION_C @@ -400,11 +457,24 @@ config MBEDTLS_VERSION_FEATURES config MBEDTLS_X509_RSASSA_PSS_SUPPORT bool "Enable parsing and verification of X.509 certificates, CRLs and CSRS signed with RSASSA-PSS." + depends on MBEDTLS_PKCS1_V21 default y config MBEDTLS_AESCE_C bool "Enable AES cryptographic extension support on 64-bit Arm." - depends on MBEDTLS_HAVE_ASM + depends on MBEDTLS_AES_C + default y + +config MBEDTLS_AES_C + bool "Enable the AES block cipher." + default y + +config MBEDTLS_ASN1_PARSE_C + bool "Enable the generic ASN1 parser." + default y + +config MBEDTLS_ASN1_WRITE_C + bool "Enable the generic ASN1 writer." default y config MBEDTLS_ARC4_C @@ -483,17 +553,32 @@ config MBEDTLS_NIST_KW_C bool "Enable the Key Wrapping mode for 128-bit block ciphers." default y +config MBEDTLS_MD_C + bool "Enable the generic layer for message digest (hashing) and HMAC." + depends on MBEDTLS_MD5_C || MBEDTLS_RIPEMD160_C || MBEDTLS_SHA1_C ||\ + MBEDTLS_SHA224_C || MBEDTLS_SHA256_C || MBEDTLS_SHA384_C ||\ + MBEDTLS_SHA512_C || MBEDTLS_PSA_CRYPTO_C + default y + +config MBEDTLS_MD5_C + bool "Enable the MD5 hash algorithm." + default y + config MBEDTLS_PKCS5_C bool "Enable PKCS#5 functions." + select MBEDTLS_MD_C default y config MBEDTLS_PKCS7_C bool "Enable PKCS #7 core for using PKCS #7-formatted signatures." - depends on MBEDTLS_X509_CRL_PARSE_C + depends on MBEDTLS_ASN1_PARSE_C && MBEDTLS_OID_C && MBEDTLS_PK_PARSE_C &&\ + MBEDTLS_X509_CRT_PARSE_C && MBEDTLS_X509_CRL_PARSE_C &&\ + MBEDTLS_MD_C default y config MBEDTLS_PKCS12_C bool "Enable PKCS#12 PBE functions." + depends on MBEDTLS_ASN1_PARSE_C && (MBEDTLS_MD_C || MBEDTLS_PSA_CRYPTO_C) default y config MBEDTLS_PLATFORM_C @@ -521,6 +606,23 @@ config MBEDTLS_RIPEMD160_C bool "Enable the RIPEMD-160 hash algorithm." default y +config MBEDTLS_RSA_C + bool "Enable the RSA public-key cryptosystem." + depends on MBEDTLS_OID_C + default y + +config MBEDTLS_SHA1_C + bool "Enable the SHA1 cryptographic hash algorithm." + default y + +config MBEDTLS_SHA224_C + bool "Enable the SHA-224 cryptographic hash algorithm." + default y + +config MBEDTLS_SHA256_C + bool "Enable the SHA-256 cryptographic hash algorithm." + default y + config MBEDTLS_SHA384_C bool "Enable the SHA-384 cryptographic hash algorithm." default y @@ -529,6 +631,10 @@ config MBEDTLS_SHA512_C bool "Enable SHA-512 cryptographic hash algorithms." default y +config MBEDTLS_SHA3_C + bool "Enable the SHA3 cryptographic hash algorithm." + default y + config MBEDTLS_SSL_CACHE_C bool "Enable simple SSL cache implementation." default y @@ -547,21 +653,19 @@ config MBEDTLS_VERSION_C bool "Enable run-time version information." default y -config MBEDTLS_X509_CRL_PARSE_C - bool "Enable X.509 CRL parsing." +config MBEDTLS_X509_USE_C + bool "Enable X.509 core for using certificates." + depends on MBEDTLS_ASN1_PARSE_C && MBEDTLS_OID_C && MBEDTLS_PK_PARSE_C &&\ + (MBEDTLS_MD_C || MBEDTLS_USE_PSA_CRYPTO) default y -config MBEDTLS_SSL_TLS1_3_TICKET_AGE_TOLERANCE - int "Maximum time difference in milliseconds tolerated between the age of a ticket from the server and client point of view." - default 6000 - -config MBEDTLS_SSL_TLS1_3_TICKET_NONCE_LENGTH - int "Size in bytes of a ticket nonce." - default 32 +config MBEDTLS_X509_CRT_PARSE_C + bool "Enable X.509 certificate parsing." + default y -config MBEDTLS_SSL_TLS1_3_DEFAULT_NEW_SESSION_TICKETS - int "Default number of NewSessionTicket messages to be sent by a TLS 1.3 server after handshake completion." - default 1 +config MBEDTLS_X509_CRL_PARSE_C + bool "Enable X.509 CRL parsing." + default y if CRYPTO_CRYPTODEV diff --git a/crypto/mbedtls/include/mbedtls/mbedtls_config.h b/crypto/mbedtls/include/mbedtls/mbedtls_config.h index 97dbec93e49..bf8c7b72fca 100644 --- a/crypto/mbedtls/include/mbedtls/mbedtls_config.h +++ b/crypto/mbedtls/include/mbedtls/mbedtls_config.h @@ -192,19 +192,56 @@ * * Enable the memory allocation layer. * - * By default mbed TLS uses the system-provided calloc() and free(). + * By default Mbed TLS uses the system-provided calloc() and free(). * This allows different allocators (self-implemented or provided) to be * provided to the platform abstraction layer. * - * Enabling MBEDTLS_PLATFORM_MEMORY without the + * Enabling #MBEDTLS_PLATFORM_MEMORY without the * MBEDTLS_PLATFORM_{FREE,CALLOC}_MACROs will provide * "mbedtls_platform_set_calloc_free()" allowing you to set an alternative * calloc() and free() function pointer at runtime. * - * Enabling MBEDTLS_PLATFORM_MEMORY and specifying + * Enabling #MBEDTLS_PLATFORM_MEMORY and specifying * MBEDTLS_PLATFORM_{CALLOC,FREE}_MACROs will allow you to specify the * alternate function at compile time. * + * An overview of how the value of mbedtls_calloc is determined: + * + * - if !MBEDTLS_PLATFORM_MEMORY + * - mbedtls_calloc = calloc + * - if MBEDTLS_PLATFORM_MEMORY + * - if (MBEDTLS_PLATFORM_CALLOC_MACRO && MBEDTLS_PLATFORM_FREE_MACRO): + * - mbedtls_calloc = MBEDTLS_PLATFORM_CALLOC_MACRO + * - if !(MBEDTLS_PLATFORM_CALLOC_MACRO && MBEDTLS_PLATFORM_FREE_MACRO): + * - Dynamic setup via mbedtls_platform_set_calloc_free is no + * possible with a default value MBEDTLS_PLATFORM_STD_CALLOC. + * - How is MBEDTLS_PLATFORM_STD_CALLOC handled? + * - if MBEDTLS_PLATFORM_NO_STD_FUNCTIONS: + * - MBEDTLS_PLATFORM_STD_CALLOC is not set to anything; + * - MBEDTLS_PLATFORM_STD_MEM_HDR can be included if present; + * - if !MBEDTLS_PLATFORM_NO_STD_FUNCTIONS: + * - if MBEDTLS_PLATFORM_STD_CALLOC is present: + * - User-defined MBEDTLS_PLATFORM_STD_CALLOC is respected; + * - if !MBEDTLS_PLATFORM_STD_CALLOC: + * - MBEDTLS_PLATFORM_STD_CALLOC = calloc + * + * - At this point the presence of MBEDTLS_PLATFORM_STD_CALLOC is + * checked. + * - if !MBEDTLS_PLATFORM_STD_CALLOC + * - MBEDTLS_PLATFORM_STD_CALLOC = uninitialized_calloc + * + * - mbedtls_calloc = MBEDTLS_PLATFORM_STD_CALLOC. + * + * Defining MBEDTLS_PLATFORM_CALLOC_MACRO and #MBEDTLS_PLATFORM_STD_CALLOC at + * the same time is not possible. MBEDTLS_PLATFORM_CALLOC_MACRO and + * MBEDTLS_PLATFORM_FREE_MACRO must both be defined or undefined at the same + * time. #MBEDTLS_PLATFORM_STD_CALLOC and #MBEDTLS_PLATFORM_STD_FREE do not + * have to be defined at the same time, as, if they are used, dynamic setup + * of these functions is possible. See the tree above to see how are they + * handled in all cases. An uninitialized #MBEDTLS_PLATFORM_STD_CALLOC always + * fails, returning a null pointer. An uninitialized + * #MBEDTLS_PLATFORM_STD_FREE does not do anything. + * * Requires: MBEDTLS_PLATFORM_C * * Enable this layer to allow use of alternative memory allocators. @@ -236,10 +273,10 @@ /** * \def MBEDTLS_PLATFORM_EXIT_ALT * - * MBEDTLS_PLATFORM_XXX_ALT: Uncomment a macro to let mbed TLS support the + * MBEDTLS_PLATFORM_XXX_ALT: Uncomment a macro to let Mbed TLS support the * function in the platform abstraction layer. * - * Example: In case you uncomment MBEDTLS_PLATFORM_PRINTF_ALT, mbed TLS will + * Example: In case you uncomment MBEDTLS_PLATFORM_PRINTF_ALT, Mbed TLS will * provide a function "mbedtls_platform_set_printf()" that allows you to set * an alternative printf function pointer. * @@ -266,8 +303,54 @@ * #define MBEDTLS_PLATFORM_VSNPRINTF_ALT * #define MBEDTLS_PLATFORM_NV_SEED_ALT * #define MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT + * #define MBEDTLS_PLATFORM_MS_TIME_ALT */ +/** + * Uncomment the macro to let Mbed TLS use your alternate implementation of + * mbedtls_platform_gmtime_r(). This replaces the default implementation in + * platform_util.c. + * + * gmtime() is not a thread-safe function as defined in the C standard. The + * library will try to use safer implementations of this function, such as + * gmtime_r() when available. However, if Mbed TLS cannot identify the target + * system, the implementation of mbedtls_platform_gmtime_r() will default to + * using the standard gmtime(). In this case, calls from the library to + * gmtime() will be guarded by the global mutex + * mbedtls_threading_gmtime_mutex if MBEDTLS_THREADING_C is enabled. We + * recommend that calls from outside the library are also guarded with this + * mutex to avoid race conditions. However, if the macro + * MBEDTLS_PLATFORM_GMTIME_R_ALT is defined, Mbed TLS will unconditionally + * use the implementation for mbedtls_platform_gmtime_r() supplied at + * compile time. + */ + +/* #define MBEDTLS_PLATFORM_GMTIME_R_ALT */ + +/** + * Uncomment the macro to let Mbed TLS use your alternate implementation of + * mbedtls_platform_zeroize(), to wipe sensitive data in memory. This + * replaces the default implementation in platform_util.c. + * + * By default, the library uses a system function such as memset_s() + * (optional feature of C11), explicit_bzero() (BSD and compatible), or + * SecureZeroMemory (Windows). If no such function is detected, the library + * falls back to a plain C implementation. Compilers are technically + * permitted to optimize this implementation out, meaning that the memory is + * not actually wiped. The library tries to prevent that, but the C language + * makes it impossible to guarantee that the memory will always be wiped. + * + * If your platform provides a guaranteed method to wipe memory which + * `platform_util.c` does not detect, define this macro to the name of + * a function that takes two arguments, a `void *` pointer and a length, + * and wipes that many bytes starting at the specified address. For example, + * if your platform has explicit_bzero() but `platform_util.c` does not + * detect its presence, define `MBEDTLS_PLATFORM_ZEROIZE_ALT` to be + * `explicit_bzero` to use that function as mbedtls_platform_zeroize(). + */ + +/* #define MBEDTLS_PLATFORM_ZEROIZE_ALT */ + /** * \def MBEDTLS_DEPRECATED_WARNING * @@ -302,7 +385,7 @@ /** \} name SECTION: System support */ /** - * \name SECTION: mbed TLS feature support + * \name SECTION: Mbed TLS feature support * * This section sets support for features that are or are not needed * within the modules that are enabled. @@ -326,7 +409,7 @@ /** * \def MBEDTLS_AES_ALT * - * MBEDTLS__MODULE_NAME__ALT: Uncomment a macro to let mbed TLS use your + * MBEDTLS__MODULE_NAME__ALT: Uncomment a macro to let Mbed TLS use your * alternate core implementation of a symmetric crypto, an arithmetic or hash * module (e.g. platform specific assembly optimized implementations). Keep * in mind that the function prototypes should remain the same. @@ -334,7 +417,7 @@ * This replaces the whole module. If you only want to replace one of the * functions, use one of the MBEDTLS__FUNCTION_NAME__ALT flags. * - * Example: In case you uncomment MBEDTLS_AES_ALT, mbed TLS will no longer + * Example: In case you uncomment MBEDTLS_AES_ALT, Mbed TLS will no longer * provide the "struct mbedtls_aes_context" definition and omit the base * function declarations and implementations. "aes_alt.h" will be included * from "aes.h" to include the new function definitions. @@ -342,18 +425,17 @@ * Uncomment a macro to enable alternate implementation of the corresponding * module. * - * \warning MD2, MD4, MD5, ARC4, DES and SHA-1 are considered weak and - * their use constitutes a security risk. If possible, we - * recommend avoiding dependencies on them, and considering - * stronger message digests and ciphers instead. + * \warning MD5, DES and SHA-1 are considered weak and their + * use constitutes a security risk. If possible, we recommend + * avoiding dependencies on them, and considering stronger message + * digests and ciphers instead. * */ #ifdef CONFIG_MBEDTLS_AES_ALT #define MBEDTLS_AES_ALT #endif -/* #define MBEDTLS_ARC4_ALT - * #define MBEDTLS_ARIA_ALT +/* #define MBEDTLS_ARIA_ALT * #define MBEDTLS_BLOWFISH_ALT * #define MBEDTLS_CAMELLIA_ALT * #define MBEDTLS_CCM_ALT @@ -368,8 +450,6 @@ * #define MBEDTLS_ECJPAKE_ALT * #define MBEDTLS_GCM_ALT * #define MBEDTLS_NIST_KW_ALT - * #define MBEDTLS_MD2_ALT - * #define MBEDTLS_MD4_ALT */ #ifdef CONFIG_MBEDTLS_MD5_ALT #define MBEDTLS_MD5_ALT @@ -412,20 +492,18 @@ /** * \def MBEDTLS_SHA256_PROCESS_ALT * - * MBEDTLS__FUNCTION_NAME__ALT: Uncomment a macro to let mbed TLS use you - * alternate core implementation of symmetric crypto or hash function. - * Keep in mind that function prototypes should remain the same. + * MBEDTLS__FUNCTION_NAME__ALT: Uncomment a macro to let Mbed TLS use you + * alternate core implementation of symmetric crypto or hash function. Keep + * in mind that function prototypes should remain the same. * - * This replaces only one function. The header file from mbed TLS is still + * This replaces only one function. The header file from Mbed TLS is still * used, in contrast to the MBEDTLS__MODULE_NAME__ALT flags. * - * Example: In case you uncomment MBEDTLS_SHA256_PROCESS_ALT, mbed TLS will + * Example: In case you uncomment MBEDTLS_SHA256_PROCESS_ALT, Mbed TLS will * no longer provide the mbedtls_sha1_process() function, but it will still * provide the other function (using your mbedtls_sha1_process() function) * and the definition of mbedtls_sha1_context, so your implementation of - * mbedtls_sha1_process must be compatible - * - * with this definition. + * mbedtls_sha1_process must be compatible with this definition. * * \note If you use the AES_xxx_ALT macros, then it is recommended to also * set MBEDTLS_AES_ROM_TABLES in order to help the linker @@ -434,25 +512,23 @@ * Uncomment a macro to enable alternate implementation of the corresponding * function. * - * \warning MD2, MD4, MD5, DES and SHA-1 are considered weak and their use + * \warning MD5, DES and SHA-1 are considered weak and their use * constitutes a security risk. If possible, we recommend avoiding * dependencies on them, and considering stronger message digests * and ciphers instead. * * \warning If both MBEDTLS_ECDSA_SIGN_ALT and MBEDTLS_ECDSA_DETERMINISTIC * are enabled, then the deterministic ECDH signature functions - * pass the the static HMAC-DRBG as RNG to mbedtls_ecdsa_sign(). + * pass the static HMAC-DRBG as RNG to mbedtls_ecdsa_sign(). * Therefore alternative implementations should use the RNG only - * for generating the ephemeral key and nothing else. + * for generating the ephemeral key and nothing else. If this is + * not possible, then MBEDTLS_ECDSA_DETERMINISTIC should be + * disabled and an alternative implementation should be provided + * for mbedtls_ecdsa_sign_det_ext(). * - * If this is not possible, then MBEDTLS_ECDSA_DETERMINISTIC - * should be disabled and an alternative implementation should - * be provided for mbedtls_ecdsa_sign_det_ext(). */ -/* #define MBEDTLS_MD2_PROCESS_ALT - * #define MBEDTLS_MD4_PROCESS_ALT - * #define MBEDTLS_MD5_PROCESS_ALT +/* #define MBEDTLS_MD5_PROCESS_ALT * #define MBEDTLS_RIPEMD160_PROCESS_ALT * #define MBEDTLS_SHA1_PROCESS_ALT * #define MBEDTLS_SHA256_PROCESS_ALT @@ -512,7 +588,7 @@ * mbedtls_internal_ecp_double_jac() if the group for the operation is * supported by your implementation (i.e. * yourmbedtls_internal_ecp_grp_capable() function returns 1 for this group) - * group is not supported by your implementation, then the original mbed TLS + * group is not supported by your implementation, then the original Mbed TLS * If the implementation of ecp_double_jac() is used instead, unless this * fallback behaviour is disabled by setting MBEDTLS_ECP_NO_FALLBACK * (in which case ecp_double_jac() will return @@ -554,7 +630,7 @@ /** * \def MBEDTLS_ENTROPY_HARDWARE_ALT * - * Uncomment this macro to let mbed TLS use your own implementation of a + * Uncomment this macro to let Mbed TLS use your own implementation of a * hardware entropy collector. * * Your function must be called \c mbedtls_hardware_poll(), have the same @@ -612,6 +688,41 @@ /* #define MBEDTLS_AES_FEWER_TABLES */ +/** + * \def MBEDTLS_AES_ONLY_128_BIT_KEY_LENGTH + * + * Use only 128-bit keys in AES operations to save ROM. + * + * Uncomment this macro to remove support for AES operations that use 192- + * or 256-bit keys. + * + * Uncommenting this macro reduces the size of AES code by ~300 bytes + * on v8-M/Thumb2. + * + * Module: library/aes.c + * + * Requires: MBEDTLS_AES_C + */ + +/* #define MBEDTLS_AES_ONLY_128_BIT_KEY_LENGTH */ + +/** + * \def MBEDTLS_AES_USE_HARDWARE_ONLY + * + * Disable plain C implementation for AES. + * + * When the plain C implementation is enabled, and an implementation using a + * special CPU feature (such as MBEDTLS_AESCE_C) is also enabled, runtime + * detection will be used to select between them. + * + * If only one implementation is present, runtime detection will not be used. + * This configuration will crash at runtime if running on a CPU without the + * necessary features. It will not build unless at least one of + * MBEDTLS_AESCE_C and/or MBEDTLS_AESNI_C is enabled & present in the build. + */ + +/* #define MBEDTLS_AES_USE_HARDWARE_ONLY */ + /** * \def MBEDTLS_CAMELLIA_SMALL_MEMORY * @@ -749,11 +860,26 @@ /** \def MBEDTLS_CTR_DRBG_USE_128_BIT_KEY * * Uncomment this macro to use a 128-bit key in the CTR_DRBG module. - * By default, CTR_DRBG uses a 256-bit key. + * Without this, CTR_DRBG uses a 256-bit key + * unless \c MBEDTLS_AES_ONLY_128_BIT_KEY_LENGTH is set. */ /* #define MBEDTLS_CTR_DRBG_USE_128_BIT_KEY */ +/** + * Enable the verified implementations of ECDH primitives from Project + * Everest (currently only Curve25519). This feature changes the layout of + * ECDH contexts and therefore is a compatibility break for applications that + * access fields of a mbedtls_ecdh_context structure directly. See also + * MBEDTLS_ECDH_LEGACY_CONTEXT in include/mbedtls/ecdh.h. + * + * The Everest code is provided under the Apache 2.0 license only; therefore + * enabling this option is not compatible with taking the library under the + * GPL v2.0-or-later license. + */ + +/* #define MBEDTLS_ECDH_VARIANT_EVEREST_ENABLED */ + /** * \def MBEDTLS_ECP_DP_SECP192R1_ENABLED * @@ -876,6 +1002,15 @@ #define MBEDTLS_ECP_RESTARTABLE #endif +/** + * Uncomment to enable using new bignum code in the ECC modules. + * + * \warning This is currently experimental, incomplete and therefore should + * not be used in production. + */ + +/* #define MBEDTLS_ECP_WITH_MPI_UINT */ + /** * \def MBEDTLS_ECDSA_DETERMINISTIC * @@ -950,7 +1085,7 @@ * * Enable the ECDHE-PSK based ciphersuite modes in SSL / TLS. * - * Requires: MBEDTLS_ECDH_C + * Requires: MBEDTLS_ECDH_C or (MBEDTLS_USE_PSA_CRYPTO and PSA_WANT_ALG_ECDH) * * This enables the following ciphersuites (if other requisites are * enabled as well): @@ -1069,7 +1204,9 @@ * * Enable the ECDHE-RSA based ciphersuite modes in SSL / TLS. * - * Requires: MBEDTLS_ECDH_C, MBEDTLS_RSA_C, MBEDTLS_PKCS1_V15, + * Requires: MBEDTLS_ECDH_C or (MBEDTLS_USE_PSA_CRYPTO and PSA_WANT_ALG_ECDH) + * MBEDTLS_RSA_C + * MBEDTLS_PKCS1_V15 * MBEDTLS_X509_CRT_PARSE_C * * This enables the following ciphersuites (if other requisites are @@ -1094,7 +1231,10 @@ * * Enable the ECDHE-ECDSA based ciphersuite modes in SSL / TLS. * - * Requires: MBEDTLS_ECDH_C, MBEDTLS_ECDSA_C, MBEDTLS_X509_CRT_PARSE_C, + * Requires: MBEDTLS_ECDH_C or (MBEDTLS_USE_PSA_CRYPTO and PSA_WANT_ALG_ECDH) + * MBEDTLS_ECDSA_C or (MBEDTLS_USE_PSA_CRYPTO and + * PSA_WANT_ALG_ECDSA) + * MBEDTLS_X509_CRT_PARSE_C * * This enables the following ciphersuites (if other requisites are * enabled as well): @@ -1118,7 +1258,10 @@ * * Enable the ECDH-ECDSA based ciphersuite modes in SSL / TLS. * - * Requires: MBEDTLS_ECDH_C, MBEDTLS_ECDSA_C, MBEDTLS_X509_CRT_PARSE_C + * Requires: MBEDTLS_ECDH_C or (MBEDTLS_USE_PSA_CRYPTO and PSA_WANT_ALG_ECDH) + * MBEDTLS_ECDSA_C or (MBEDTLS_USE_PSA_CRYPTO and + * PSA_WANT_ALG_ECDSA) + * MBEDTLS_X509_CRT_PARSE_C * * This enables the following ciphersuites (if other requisites are * enabled as well): @@ -1142,7 +1285,9 @@ * * Enable the ECDH-RSA based ciphersuite modes in SSL / TLS. * - * Requires: MBEDTLS_ECDH_C, MBEDTLS_RSA_C, MBEDTLS_X509_CRT_PARSE_C + * Requires: MBEDTLS_ECDH_C or (MBEDTLS_USE_PSA_CRYPTO and PSA_WANT_ALG_ECDH) + * MBEDTLS_RSA_C + * MBEDTLS_X509_CRT_PARSE_C * * This enables the following ciphersuites (if other requisites are * enabled as well): @@ -1170,10 +1315,15 @@ * Thread v1.0.0 specification; incompatible changes to the specification * might still happen. For this reason, this is disabled by default. * - * Requires: MBEDTLS_ECJPAKE_C - * SHA-256 (via MD if present, or via PSA, see MBEDTLS_ECJPAKE_C) + * Requires: MBEDTLS_ECJPAKE_C or (MBEDTLS_USE_PSA_CRYPTO and + * PSA_WANT_ALG_JPAKE) + * SHA-256 (via MBEDTLS_SHA256_C or a PSA driver) * MBEDTLS_ECP_DP_SECP256R1_ENABLED * + * \warning If SHA-256 is provided only by a PSA driver, you must call + * psa_crypto_init() before the first handshake (even if + * MBEDTLS_USE_PSA_CRYPTO is disabled). + * * This enables the following ciphersuites (if other requisites are * enabled as well): * MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8 @@ -1197,6 +1347,22 @@ #define MBEDTLS_PK_PARSE_EC_EXTENDED #endif +/** + * \def MBEDTLS_PK_PARSE_EC_COMPRESSED + * + * Enable the support for parsing public keys of type Short Weierstrass + * (MBEDTLS_ECP_DP_SECP_XXX and MBEDTLS_ECP_DP_BP_XXX) which are using the + * compressed point format. This parsing is done through ECP module's + * functions. + * + * \note As explained in the description of MBEDTLS_ECP_PF_COMPRESSED + * (in ecp.h) the only unsupported curves are MBEDTLS_ECP_DP_SECP224R1 + * and MBEDTLS_ECP_DP_SECP224K1. + */ +#ifdef CONFIG_MBEDTLS_PK_PARSE_EC_COMPRESSED +#define MBEDTLS_PK_PARSE_EC_COMPRESSED +#endif + /** * \def MBEDTLS_ERROR_STRERROR_DUMMY * @@ -1374,19 +1540,16 @@ * * Enable support for PKCS#1 v2.1 encoding. * - * Requires: MBEDTLS_RSA_C and (MBEDTLS_MD_C or MBEDTLS_PSA_CRYPTO_C). - * - * \warning If building without MBEDTLS_MD_C, you must call psa_crypto_init() - * before doing any PKCS#1 v2.1 operation. + * Requires: MBEDTLS_RSA_C * - * \warning When building with MBEDTLS_MD_C, all hashes used with this - * need to be available as built-ins (that is, for SHA-256, MBEDTLS_SHA256_C, - * etc.) as opposed to just PSA drivers. So far, PSA drivers are only used by - * this module in builds where MBEDTLS_MD_C is disabled. + * \warning If using a hash that is only provided by PSA drivers, you must + * call psa_crypto_init() before doing any PKCS#1 v2.1 operation. * * This enables support for RSAES-OAEP and RSASSA-PSS operations. */ +#ifdef CONFIG_MBEDTLS_PKCS1_V21 #define MBEDTLS_PKCS1_V21 +#endif /** \def MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS * @@ -1422,19 +1585,6 @@ /* #define MBEDTLS_PSA_CRYPTO_CLIENT */ -/** \def MBEDTLS_PSA_CRYPTO_DRIVERS - * - * Enable support for the experimental PSA crypto driver interface. - * - * Requires: MBEDTLS_PSA_CRYPTO_C - * - * \warning This interface is experimental. We intend to maintain backward - * compatibility with application code that relies on drivers, - * but the driver interfaces may change without notice. - */ - -/* #define MBEDTLS_PSA_CRYPTO_DRIVERS */ - /** \def MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG * * Make the PSA Crypto module use an external random generator provided @@ -1459,8 +1609,8 @@ * ); * ``` * The \c context value is initialized to 0 before the first call. - * The function must fill the \c output buffer with \p output_size bytes - * of random data and set \c *output_length to \p output_size. + * The function must fill the \c output buffer with \c output_size bytes + * of random data and set \c *output_length to \c output_size. * * Requires: MBEDTLS_PSA_CRYPTO_C * @@ -1484,6 +1634,13 @@ * NSPE (Non-Secure Process Environment) and an SPE (Secure Process * Environment). * + * If you enable this option, your build environment must include a header + * file `"crypto_spe.h"` (either in the `psa` subdirectory of the Mbed TLS + * header files, or in another directory on the compiler's include search + * path). Alternatively, your platform may customize the header + * `psa/crypto_platform.h`, in which case it can skip or replace the + * inclusion of `"crypto_spe.h"`. + * * Module: library/psa_crypto.c * Requires: MBEDTLS_PSA_CRYPTO_C * @@ -1491,6 +1648,68 @@ /* #define MBEDTLS_PSA_CRYPTO_SPM */ +/** + * \def MBEDTLS_PSA_KEY_STORE_DYNAMIC + * + * Dynamically resize the PSA key store to accommodate any number of + * volatile keys (until the heap memory is exhausted). + * + * If this option is disabled, the key store has a fixed size + * #MBEDTLS_PSA_KEY_SLOT_COUNT for volatile keys and loaded persistent keys + * together. + * + * This option has no effect when #MBEDTLS_PSA_CRYPTO_C is disabled. + * + * Module: library/psa_crypto.c + * Requires: MBEDTLS_PSA_CRYPTO_C + */ +#ifdef CONFIG_MBEDTLS_PSA_KEY_STORE_DYNAMIC +#define MBEDTLS_PSA_KEY_STORE_DYNAMIC +#endif + +/** + * Uncomment to enable p256-m. This is an alternative implementation of + * key generation, ECDH and (randomized) ECDSA on the curve SECP256R1. + * Compared to the default implementation: + * + * - p256-m has a much smaller code size and RAM footprint. + * - p256-m is only available via the PSA API. This includes the pk module + * when #MBEDTLS_USE_PSA_CRYPTO is enabled. + * - p256-m does not support deterministic ECDSA, EC-JPAKE, custom protocols + * over the core arithmetic, or deterministic derivation of keys. + * + * We recommend enabling this option if your application uses the PSA API + * and the only elliptic curve support it needs is ECDH and ECDSA over + * SECP256R1. + * + * If you enable this option, you do not need to enable any ECC-related + * MBEDTLS_xxx option. You do need to separately request support for the + * cryptographic mechanisms through the PSA API: + * - #MBEDTLS_PSA_CRYPTO_C and #MBEDTLS_PSA_CRYPTO_CONFIG for PSA-based + * configuration; + * - #MBEDTLS_USE_PSA_CRYPTO if you want to use p256-m from PK, X.509 or TLS; + * - #PSA_WANT_ECC_SECP_R1_256; + * - #PSA_WANT_ALG_ECDH and/or #PSA_WANT_ALG_ECDSA as needed; + * - #PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY, + * #PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC, + * #PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT, + * #PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT and/or + * #PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE as needed. + * + * \note To benefit from the smaller code size of p256-m, make sure that you + * do not enable any ECC-related option not supported by p256-m: this + * would cause the built-in ECC implementation to be built as well, in + * order to provide the required option. + * Make sure #PSA_WANT_ALG_DETERMINISTIC_ECDSA, #PSA_WANT_ALG_JPAKE and + * #PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE, and curves other than + * SECP256R1 are disabled as they are not supported by this driver. + * Also, avoid defining #MBEDTLS_PK_PARSE_EC_COMPRESSED or + * #MBEDTLS_PK_PARSE_EC_EXTENDED as those currently require a subset of + * the built-in ECC implementation, see docs/driver-only-builds.md. + */ + +/* #define MBEDTLS_PSA_P256M_DRIVER_ENABLED */ + /** * \def MBEDTLS_PSA_INJECT_ENTROPY * @@ -1505,6 +1724,29 @@ /* #define MBEDTLS_PSA_INJECT_ENTROPY */ +/** + * \def MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS + * + * Assume all buffers passed to PSA functions are owned exclusively by the + * PSA function and are not stored in shared memory. + * + * This option may be enabled if all buffers passed to any PSA function + * reside in memory that is accessible only to the PSA function during its + * execution. + * + * This option MUST be disabled whenever buffer arguments are in memory + * shared with an untrusted party, for example where arguments to PSA calls + * are passed across a trust boundary. + * + * \note Enabling this option reduces memory usage and code size. + * + * \note Enabling this option causes overlap of input and output buffers + * not to be supported by PSA functions. + */ +#ifdef CONFIG_MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS +#define MBEDTLS_PSA_ASSUME_EXCLUSIVE_BUFFERS +#endif + /** * \def MBEDTLS_RSA_NO_CRT * @@ -1558,13 +1800,12 @@ * \def MBEDTLS_SSL_ALL_ALERT_MESSAGES * * Enable sending of alert messages in case of encountered errors as per RFC. - * If you choose not to send the alert messages, mbed TLS can still - *communicate - * with other servers, only debugging of failures is harder. + * If you choose not to send the alert messages, Mbed TLS can still + * communicate with other servers, only debugging of failures is harder. * * The advantage of not sending alert messages, is that no information is - *given - * about reasons for failures thus preventing adversaries of gaining intel. + * given about reasons for failures thus preventing adversaries of gaining + * intel. * * Enable sending of all alert messages */ @@ -1617,7 +1858,8 @@ * Requires: MBEDTLS_SSL_DTLS_CONNECTION_ID */ #ifdef CONFIG_MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT -#define MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT CONFIG_MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT +#define MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT \ + CONFIG_MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT #endif /** @@ -1755,6 +1997,8 @@ * it has been associated with security issues in the past and is easy to * misuse/misunderstand. * + * Requires: MBEDTLS_SSL_PROTO_TLS1_2 + * * Comment this to disable support for renegotiation. * * \note Even if this option is disabled, both client and server are aware @@ -1786,10 +2030,6 @@ * Enable support for RFC 8449 record_size_limit extension in SSL (TLS 1.3 *only). * - * \warning This extension is currently in development and must NOT be used - *except - * for testing purposes. - * * Requires: MBEDTLS_SSL_PROTO_TLS1_3 * * Uncomment this macro to enable support for the record_size_limit extension @@ -1803,34 +2043,36 @@ * Enable support for TLS 1.2 (and DTLS 1.2 if DTLS is enabled). * * Requires: Without MBEDTLS_USE_PSA_CRYPTO: MBEDTLS_MD_C and - * (MBEDTLS_SHA1_C or MBEDTLS_SHA256_C or MBEDTLS_SHA512_C) + * (MBEDTLS_SHA256_C or MBEDTLS_SHA384_C or + * SHA-256 or SHA-512 provided by a PSA driver) * With MBEDTLS_USE_PSA_CRYPTO: - * PSA_WANT_ALG_SHA_1 or PSA_WANT_ALG_SHA_256 or - * PSA_WANT_ALG_SHA_512 + * PSA_WANT_ALG_SHA_256 or PSA_WANT_ALG_SHA_384 * - * \warning If building with MBEDTLS_USE_PSA_CRYPTO, you must call - * psa_crypto_init() before doing any TLS operations. + * \warning If building with MBEDTLS_USE_PSA_CRYPTO, or if the hash(es) used + * are only provided by PSA drivers, you must call psa_crypto_init() before + * doing any TLS operations. * * Comment this macro to disable support for TLS 1.2 / DTLS 1.2 */ +#ifdef CONFIG_MBEDTLS_SSL_PROTO_TLS1_2 #define MBEDTLS_SSL_PROTO_TLS1_2 +#endif /** * \def MBEDTLS_SSL_PROTO_TLS1_3 * * Enable support for TLS 1.3. * - * \note The support for TLS 1.3 is not comprehensive yet, in particular - * pre-shared keys are not supported. - * See docs/architecture/tls13-support.md for a description of the TLS + * \note See docs/architecture/tls13-support.md for a description of the TLS * 1.3 support that this option enables. * * Requires: MBEDTLS_SSL_KEEP_PEER_CERTIFICATE * Requires: MBEDTLS_PSA_CRYPTO_C * * \note TLS 1.3 uses PSA crypto for cryptographic operations that are - * directly performed by TLS 1.3 code. As a consequence, you must - * call psa_crypto_init() before the first TLS 1.3 handshake. + * directly performed by TLS 1.3 code. As a consequence, when TLS 1.3 + * is enabled, a TLS handshake may call psa_crypto_init(), even + * if it ends up negotiating a different TLS version. * * \note Cryptographic operations performed indirectly via another module * (X.509, PK) or by code shared with TLS 1.2 (record protection, @@ -1839,8 +2081,9 @@ * * Uncomment this macro to enable the support for TLS 1.3. */ - -/* #define MBEDTLS_SSL_PROTO_TLS1_3 */ +#ifdef CONFIG_MBEDTLS_SSL_PROTO_TLS1_3 +#define MBEDTLS_SSL_PROTO_TLS1_3 +#endif /** * \def MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE @@ -1863,8 +2106,9 @@ * effect on the build. * */ - -/* #define MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE */ +#ifdef CONFIG_MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE +#define MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE +#endif /** * \def MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED @@ -1885,8 +2129,12 @@ * * Enable TLS 1.3 ephemeral key exchange mode. * - * Requires: MBEDTLS_ECDH_C, MBEDTLS_X509_CRT_PARSE_C, MBEDTLS_ECDSA_C or - * MBEDTLS_PKCS1_V21 + * Requires: PSA_WANT_ALG_ECDH or PSA_WANT_ALG_FFDH + * MBEDTLS_X509_CRT_PARSE_C + * and at least one of: + * MBEDTLS_ECDSA_C or (MBEDTLS_USE_PSA_CRYPTO and + * PSA_WANT_ALG_ECDSA) + * MBEDTLS_PKCS1_V21 * * Comment to disable support for the ephemeral key exchange mode in TLS 1.3. * If MBEDTLS_SSL_PROTO_TLS1_3 is not enabled, this option does not have any @@ -1902,7 +2150,7 @@ * * Enable TLS 1.3 PSK ephemeral key exchange mode. * - * Requires: MBEDTLS_ECDH_C + * Requires: PSA_WANT_ALG_ECDH or PSA_WANT_ALG_FFDH * * Comment to disable support for the PSK ephemeral key exchange mode in * TLS 1.3. If MBEDTLS_SSL_PROTO_TLS1_3 is not enabled, this option does not @@ -1922,36 +2170,17 @@ * MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED or * MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED * - * Comment this to disable support for early data. - * If MBEDTLS_SSL_PROTO_TLS1_3 is not enabled, - * this option does not have any effect on the build. + * Comment this to disable support for early data. If + * MBEDTLS_SSL_PROTO_TLS1_3 is not enabled, this option does not have any + * effect on the build. * - * This feature is experimental, not completed and thus not ready for - * production. + * \note The maximum amount of early data can be set with + * MBEDTLS_SSL_MAX_EARLY_DATA_SIZE. * */ /* #define MBEDTLS_SSL_EARLY_DATA */ -/** - * \def MBEDTLS_SSL_MAX_EARLY_DATA_SIZE - * - * The default maximum amount of 0-RTT data. See the documentation of - * \c mbedtls_ssl_tls13_conf_max_early_data_size() for more information. - * - * It must be positive and smaller than UINT32_MAX. - * - * If MBEDTLS_SSL_EARLY_DATA is not defined, this default value does not - * have any impact on the build. - * - * This feature is experimental, not completed and thus not ready for - * production. - * - */ -#ifdef CONFIG_MBEDTLS_SSL_MAX_EARLY_DATA_SIZE -#define MBEDTLS_SSL_MAX_EARLY_DATA_SIZE CONFIG_MBEDTLS_SSL_MAX_EARLY_DATA_SIZE -#endif - /** * \def MBEDTLS_SSL_PROTO_DTLS * @@ -2196,28 +2425,38 @@ /** * \def MBEDTLS_USE_PSA_CRYPTO * - * Make the X.509 and TLS library use PSA for cryptographic operations, and - * enable new APIs for using keys handled by PSA Crypto. + * Make the X.509 and TLS libraries use PSA for cryptographic operations as + * much as possible, and enable new APIs for using keys handled by PSA + * Crypto. * * \note Development of this option is currently in progress, and parts of - *Mbed - * TLS's X.509 and TLS modules are not ported to PSA yet. - * However, these parts will still continue to work as usual, - * so enabling this option should not break backwards compatibility. - * - * \note See docs/use-psa-crypto.md for a complete description of what this - * option currently does, and of parts that are not affected by it so far. + * Mbed TLS's X.509 and TLS modules are not ported to PSA yet. However, these + * parts will still continue to work as usual, so enabling this option should + * not break backwards compatibility. * * \warning If you enable this option, you need to call `psa_crypto_init()` - * before calling any function from the SSL/TLS, X.509 or PK modules. + * before calling any function from the SSL/TLS, X.509 or PK modules, except + * for the various mbedtls_xxx_init() functions which can be called at any + * time. + * + * \note An important and desirable effect of this option is that it allows + * PK, X.509 and TLS to take advantage of PSA drivers. For example, enabling + * this option is what allows use of drivers for ECDSA, ECDH and EC J-PAKE in + * those modules. However, note that even with this option disabled, some + * code in PK, X.509, TLS or the crypto library might still use PSA drivers, + * if it can determine it's safe to do so; currently that's the case for + * hashes. + * + * \note See docs/use-psa-crypto.md for a complete description this option. * * Requires: MBEDTLS_PSA_CRYPTO_C. * * Uncomment this to enable internal use of PSA Crypto and new associated *APIs. */ - -/* #define MBEDTLS_USE_PSA_CRYPTO */ +#ifdef CONFIG_MBEDTLS_USE_PSA_CRYPTO +#define MBEDTLS_USE_PSA_CRYPTO +#endif /** * \def MBEDTLS_PSA_CRYPTO_CONFIG @@ -2239,8 +2478,15 @@ * If the symbol #MBEDTLS_PSA_CRYPTO_CONFIG_FILE is defined, it specifies * an alternative header to include instead of include/psa/crypto_config.h. * - * This feature is still experimental and is not ready for production since - * it is not completed. + * \warning This option is experimental, in that the set of `PSA_WANT_XXX` + * symbols is not completely finalized yet, and the configuration + * tooling is not ideally adapted to having two separate + * configuration files. + * Future minor releases of Mbed TLS may make minor changes to those + * symbols, but we will endeavor to provide a transition path. + * Nonetheless, this option is considered mature enough to use in + * production, as long as you accept that you may need to make + * minor changes to psa/crypto_config.h when upgrading Mbed TLS. */ /* #define MBEDTLS_PSA_CRYPTO_CONFIG */ @@ -2302,18 +2548,20 @@ * Enable parsing and verification of X.509 certificates, CRLs and CSRS * signed with RSASSA-PSS (aka PKCS#1 v2.1). * + * Requires: MBEDTLS_PKCS1_V21 + * * Comment this macro to disallow using RSASSA-PSS in certificates. */ #ifdef CONFIG_MBEDTLS_X509_RSASSA_PSS_SUPPORT #define MBEDTLS_X509_RSASSA_PSS_SUPPORT #endif -/** \} name SECTION: mbed TLS feature support */ +/** \} name SECTION: Mbed TLS feature support */ /** - * \name SECTION: mbed TLS modules + * \name SECTION: Mbed TLS modules * - * This section enables or disables entire modules in mbed TLS + * This section enables or disables entire modules in Mbed TLS * \{ */ @@ -2323,7 +2571,7 @@ * Enable AES-NI support on x86-64 or x86-32. * * \note AESNI is only supported with certain compilers and target options: - * - Visual Studio 2013: supported. + * - Visual Studio: supported. * - GCC, x86-64, target not explicitly supporting AESNI: * requires MBEDTLS_HAVE_ASM. * - GCC, x86-32, target not explicitly supporting AESNI: @@ -2354,19 +2602,28 @@ /** * \def MBEDTLS_AESCE_C * - * Enable AES cryptographic extension support on 64-bit Arm. + * Enable AES cryptographic extension support on Armv8. * * Module: library/aesce.c * Caller: library/aes.c * - * Requires: MBEDTLS_HAVE_ASM, MBEDTLS_AES_C + * Requires: MBEDTLS_AES_C * * \warning Runtime detection only works on Linux. For non-Linux operating * system, Armv8-A Cryptographic Extensions must be supported by * the CPU when this option is enabled. * + * \note Minimum compiler versions for this feature when targeting aarch64 + * are Clang 4.0; armclang 6.6; GCC 6.0; or MSVC 2019 version + * 16.11.2. Minimum compiler versions for this feature when + * targeting 32-bit Arm or Thumb are Clang 11.0; armclang 6.20; or + * GCC 6.0. + * + * \note \c CFLAGS must be set to a minimum of \c -march=armv8-a+crypto for + * armclang <= 6.9 + * * This module adds support for the AES Armv8-A Cryptographic Extensions on - *Aarch64 systems. + * Armv8 systems. */ #ifdef CONFIG_MBEDTLS_AESCE_C #define MBEDTLS_AESCE_C @@ -2445,26 +2702,8 @@ * * PEM_PARSE uses AES for decrypting encrypted keys. */ +#ifdef CONFIG_MBEDTLS_AES_C #define MBEDTLS_AES_C - -/** - * \def MBEDTLS_ARC4_C - * - * Enable the ARCFOUR stream cipher. - * - * Module: library/arc4.c - * Caller: library/cipher.c - * - * This module enables the following ciphersuites (if other requisites are - * enabled as well): - * - * \warning ARC4 is considered a weak cipher and its use constitutes a - * security risk. If possible, we recommend avoidng dependencies - * on it, and considering stronger ciphers instead. - * - */ -#ifdef CONFIG_MBEDTLS_ARC4_C -#define MBEDTLS_ARC4_C #endif /** @@ -2479,7 +2718,9 @@ * library/pkcs5.c * library/pkparse.c */ +#ifdef CONFIG_MBEDTLS_ASN1_PARSE_C #define MBEDTLS_ASN1_PARSE_C +#endif /** * \def MBEDTLS_ASN1_WRITE_C @@ -2493,7 +2734,9 @@ * library/x509write_crt.c * library/x509write_csr.c */ +#ifdef CONFIG_MBEDTLS_ASN1_WRITE_C #define MBEDTLS_ASN1_WRITE_C +#endif /** * \def MBEDTLS_BASE64_C @@ -2507,6 +2750,30 @@ */ #define MBEDTLS_BASE64_C +/** + * \def MBEDTLS_BLOCK_CIPHER_NO_DECRYPT + * + * Remove decryption operation for AES, ARIA and Camellia block cipher. + * + * \note This feature is incompatible with insecure block cipher, + * MBEDTLS_DES_C, and cipher modes which always require decryption + * operation, MBEDTLS_CIPHER_MODE_CBC, MBEDTLS_CIPHER_MODE_XTS and + * MBEDTLS_NIST_KW_C. When #MBEDTLS_PSA_CRYPTO_CONFIG is enabled, + * this feature is incompatible with following supported PSA + * equivalence, PSA_WANT_ALG_ECB_NO_PADDING, + * PSA_WANT_ALG_CBC_NO_PADDING, PSA_WANT_ALG_CBC_PKCS7 and + * PSA_WANT_KEY_TYPE_DES. + * + * Module: library/aes.c + * library/aesce.c + * library/aesni.c + * library/aria.c + * library/camellia.c + * library/cipher.c + */ + +/* #define MBEDTLS_BLOCK_CIPHER_NO_DECRYPT */ + /** * \def MBEDTLS_BIGNUM_C * @@ -2707,6 +2974,9 @@ * library/ssl_ciphersuites.c * library/ssl_msg.c * library/ssl_ticket.c (unless MBEDTLS_USE_PSA_CRYPTO is enabled) + * Auto-enabled by: MBEDTLS_PSA_CRYPTO_C depending on which ciphers are + * enabled (see the documentation of that option for + * details). * * Uncomment to enable generic cipher wrappers. */ @@ -2740,6 +3010,16 @@ * The CTR_DRBG generator uses AES-256 by default. * To use AES-128 instead, enable \c MBEDTLS_CTR_DRBG_USE_128_BIT_KEY above. * + * AES support can either be achieved through builtin (MBEDTLS_AES_C) or PSA. + * Builtin is the default option when MBEDTLS_AES_C is defined otherwise PSA + * is used. + * + * \warning When using PSA, the user should call `psa_crypto_init()` before + * using any CTR_DRBG operation (except `mbedtls_ctr_drbg_init()`). + * + * \note AES-128 will be used if \c MBEDTLS_AES_ONLY_128_BIT_KEY_LENGTH is + * set. + * * \note To achieve a 256-bit security strength with CTR_DRBG, * you must use AES-256 *and* use sufficient entropy. * See ctr_drbg.h for more details. @@ -2747,7 +3027,9 @@ * Module: library/ctr_drbg.c * Caller: * - * Requires: MBEDTLS_AES_C + * Requires: MBEDTLS_AES_C or + * (PSA_WANT_KEY_TYPE_AES and PSA_WANT_ALG_ECB_NO_PADDING and + * MBEDTLS_PSA_CRYPTO_C) * * This module provides the CTR_DRBG AES random number generator. */ @@ -2867,13 +3149,8 @@ * * Requires: MBEDTLS_ECP_C and either MBEDTLS_MD_C or MBEDTLS_PSA_CRYPTO_C * - * \warning If building without MBEDTLS_MD_C, you must call psa_crypto_init() - * before doing any EC J-PAKE operations. - * - * \warning When building with MBEDTLS_MD_C, all hashes used with this - * need to be available as built-ins (that is, for SHA-256, MBEDTLS_SHA256_C, - * etc.) as opposed to just PSA drivers. So far, PSA drivers are only used by - * this module in builds where MBEDTLS_MD_C is disabled. + * \warning If using a hash that is only provided by PSA drivers, you must + * call psa_crypto_init() before doing any EC J-PAKE operations. */ #ifdef CONFIG_MBEDTLS_ECJPAKE_C #define MBEDTLS_ECJPAKE_C @@ -2940,6 +3217,23 @@ #define MBEDTLS_GCM_C #endif +/** + * \def MBEDTLS_GCM_LARGE_TABLE + * + * Enable large pre-computed tables for Galois/Counter Mode (GCM). + * Can significantly increase throughput on systems without GCM hardware + * acceleration (e.g., AESNI, AESCE). + * + * The mbedtls_gcm_context size will increase by 3840 bytes. + * The code size will increase by roughly 344 bytes. + * + * Module: library/gcm.c + * + * Requires: MBEDTLS_GCM_C + */ + +/* #define MBEDTLS_GCM_LARGE_TABLE */ + /** * \def MBEDTLS_HKDF_C * @@ -3027,7 +3321,8 @@ * * Requires: one of: MBEDTLS_MD5_C, MBEDTLS_RIPEMD160_C, MBEDTLS_SHA1_C, * MBEDTLS_SHA224_C, MBEDTLS_SHA256_C, MBEDTLS_SHA384_C, - * MBEDTLS_SHA512_C. + * MBEDTLS_SHA512_C, or MBEDTLS_PSA_CRYPTO_C with at least + * one hash. * Module: library/md.c * Caller: library/constant_time.c * library/ecdsa.c @@ -3050,45 +3345,9 @@ * * Uncomment to enable generic message digest wrappers. */ +#ifdef CONFIG_MBEDTLS_MD_C #define MBEDTLS_MD_C - -/** - * \def MBEDTLS_MD2_C - * - * Enable the MD2 hash algorithm. - * - * Module: library/md2.c - * Caller: - * - * Uncomment to enable support for (rare) MD2-signed X.509 certs. - * - * \warning MD2 is considered a weak message digest and its use constitutes - *a - * security risk. If possible, we recommend avoiding dependencies - *on - * it, and considering stronger message digests instead. - * - */ - -/* #define MBEDTLS_MD2_C */ - -/** - * \def MBEDTLS_MD4_C - * - * Enable the MD4 hash algorithm. - * - * Module: library/md4.c - * Caller: - * - * Uncomment to enable support for (rare) MD4-signed X.509 certs. - * - * \warning MD4 is considered a weak message digest and its use - * constitutes a security risk. If possible, we recommend - * avoiding dependencies on it, and considering stronger - * message digests instead. - */ - -/* #define MBEDTLS_MD4_C */ +#endif /** * \def MBEDTLS_MD5_C @@ -3111,7 +3370,9 @@ * it, and considering stronger message digests instead. * */ +#ifdef CONFIG_MBEDTLS_MD5_C #define MBEDTLS_MD5_C +#endif /** * \def MBEDTLS_MEMORY_BUFFER_ALLOC_C @@ -3123,7 +3384,7 @@ * Module: library/memory_buffer_alloc.c * * Requires: MBEDTLS_PLATFORM_C - * MBEDTLS_PLATFORM_MEMORY (to use it within mbed TLS) + * MBEDTLS_PLATFORM_MEMORY (to use it within Mbed TLS) * * Enable this module to enable the buffer memory allocator. */ @@ -3173,7 +3434,9 @@ * * This modules translates between OIDs and internal values. */ +#ifdef CONFIG_MBEDTLS_OID_C #define MBEDTLS_OID_C +#endif /** * \def MBEDTLS_PADLOCK_C @@ -3204,6 +3467,10 @@ * library/x509_csr.c * * Requires: MBEDTLS_BASE64_C + * optionally MBEDTLS_MD5_C, or PSA Crypto with MD5 (see below) + * + * \warning When parsing password-protected files, if MD5 is provided only by + * a PSA driver, you must call psa_crypto_init() before the first file. * * This modules adds support for decoding / parsing PEM files. */ @@ -3243,7 +3510,9 @@ * * Uncomment to enable generic public key wrappers. */ +#ifdef CONFIG_MBEDTLS_PK_C #define MBEDTLS_PK_C +#endif /** * \def MBEDTLS_PK_PARSE_C @@ -3254,11 +3523,13 @@ * Caller: library/x509_crt.c * library/x509_csr.c * - * Requires: MBEDTLS_PK_C + * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_OID_C, MBEDTLS_PK_C * * Uncomment to enable generic public key parse functions. */ +#ifdef CONFIG_MBEDTLS_PK_PARSE_C #define MBEDTLS_PK_PARSE_C +#endif /** * \def MBEDTLS_PK_WRITE_C @@ -3268,7 +3539,7 @@ * Module: library/pkwrite.c * Caller: library/x509write.c * - * Requires: MBEDTLS_PK_C + * Requires: MBEDTLS_ASN1_WRITE_C, MBEDTLS_OID_C, MBEDTLS_PK_C * * Uncomment to enable generic public key write functions. */ @@ -3283,16 +3554,10 @@ * * Module: library/pkcs5.c * - * Requires: MBEDTLS_CIPHER_C and either MBEDTLS_MD_C or - * MBEDTLS_PSA_CRYPTO_C. - * - * \warning If building without MBEDTLS_MD_C, you must call psa_crypto_init() - * before doing any PKCS5 operation. + * Auto-enables: MBEDTLS_MD_C * - * \warning When building with MBEDTLS_MD_C, all hashes used with this - * need to be available as built-ins (that is, for SHA-256, MBEDTLS_SHA256_C, - * etc.) as opposed to just PSA drivers. So far, PSA drivers are only used by - * this module in builds where MBEDTLS_MD_C is disabled. + * \warning If using a hash that is only provided by PSA drivers, you must + * call psa_crypto_init() before doing any PKCS5 operations. * * This module adds support for the PKCS#5 functions. */ @@ -3327,16 +3592,11 @@ * Module: library/pkcs12.c * Caller: library/pkparse.c * - * Requires: MBEDTLS_ASN1_PARSE_C, MBEDTLS_CIPHER_C and either - * MBEDTLS_MD_C or MBEDTLS_PSA_CRYPTO_C. - * - * \warning If building without MBEDTLS_MD_C, you must call psa_crypto_init() - * before doing any PKCS12 operation. + * Requires: MBEDTLS_ASN1_PARSE_C and either MBEDTLS_MD_C or + * MBEDTLS_PSA_CRYPTO_C. * - * \warning When building with MBEDTLS_MD_C, all hashes used with this - * need to be available as built-ins (that is, for SHA-256, MBEDTLS_SHA256_C, - * etc.) as opposed to just PSA drivers. So far, PSA drivers are only used by - * this module in builds where MBEDTLS_MD_C is disabled. + * \warning If using a hash that is only provided by PSA drivers, you must + * call psa_crypto_init() before doing any PKCS12 operations. * * This module enables PKCS#12 functions. */ @@ -3385,11 +3645,12 @@ * * Module: library/psa_crypto.c * - * Requires: MBEDTLS_CIPHER_C, - * either MBEDTLS_CTR_DRBG_C and MBEDTLS_ENTROPY_C, + * Requires: either MBEDTLS_CTR_DRBG_C and MBEDTLS_ENTROPY_C, * or MBEDTLS_HMAC_DRBG_C and MBEDTLS_ENTROPY_C, * or MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG. - * + * Auto-enables: MBEDTLS_CIPHER_C if any unauthenticated (ie, non-AEAD) + * cipher is enabled in PSA (unless it's fully accelerated, see + * docs/driver-only-builds.md about that). */ #ifdef CONFIG_MBEDTLS_PSA_CRYPTO_C #define MBEDTLS_PSA_CRYPTO_C @@ -3401,8 +3662,11 @@ * Enable dynamic secure element support in the Platform Security * Architecture cryptography API. * - * \deprecated This feature is deprecated. Please switch to the driver - * interface enabled by #MBEDTLS_PSA_CRYPTO_DRIVERS. + * \deprecated This feature is deprecated. Please switch to the PSA driver + * interface. + * + * \warning This feature is not thread-safe, and should not be used in a + * multi-threaded environment. * * Module: library/psa_crypto_se.c * @@ -3472,7 +3736,9 @@ * * Requires: MBEDTLS_BIGNUM_C, MBEDTLS_OID_C */ +#ifdef CONFIG_MBEDTLS_RSA_C #define MBEDTLS_RSA_C +#endif /** * \def MBEDTLS_SHA1_C @@ -3491,7 +3757,9 @@ * avoiding dependencies on it, and considering stronger * message digests instead. */ +#ifdef CONFIG_MBEDTLS_SHA1_C #define MBEDTLS_SHA1_C +#endif /** * \def MBEDTLS_SHA224_C @@ -3504,7 +3772,9 @@ * * This module adds support for SHA-224. */ +#ifdef CONFIG_MBEDTLS_SHA224_C #define MBEDTLS_SHA224_C +#endif /** * \def MBEDTLS_SHA256_C @@ -3521,54 +3791,94 @@ * This module adds support for SHA-256. * This module is required for the SSL/TLS 1.2 PRF function. */ +#ifdef CONFIG_MBEDTLS_SHA256_C #define MBEDTLS_SHA256_C +#endif /** - * \def MBEDTLS_SHA256_USE_A64_CRYPTO_IF_PRESENT + * \def MBEDTLS_SHA256_USE_ARMV8_A_CRYPTO_IF_PRESENT * * Enable acceleration of the SHA-256 and SHA-224 cryptographic hash - * algorithms - * with the ARMv8 cryptographic extensions if they are available at runtime. - * If not, the library will fall back to the C implementation. + * algorithms with the ARMv8 cryptographic extensions if they are available + * at runtime. If not, the library will fall back to the C implementation. * - * \note If MBEDTLS_SHA256_USE_A64_CRYPTO_IF_PRESENT is defined when building - * for a non-Aarch64 build it will be silently ignored. + * \note If MBEDTLS_SHA256_USE_ARMV8_A_CRYPTO_IF_PRESENT is defined when + * building for a non-Armv8-A build it will be silently ignored. + * + * \note Minimum compiler versions for this feature are Clang 4.0, + * armclang 6.6 or GCC 6.0. + * + * \note \c CFLAGS must be set to a minimum of \c -march=armv8-a+crypto for + * armclang <= 6.9 * - * \warning MBEDTLS_SHA256_USE_A64_CRYPTO_IF_PRESENT cannot be defined at the - * same time as MBEDTLS_SHA256_USE_A64_CRYPTO_ONLY. + * \note This was previously known as + * MBEDTLS_SHA256_USE_A64_CRYPTO_IF_PRESENT. That name is deprecated, but may + * still be used as an alternative form for this option. + * + * \warning MBEDTLS_SHA256_USE_ARMV8_A_CRYPTO_IF_PRESENT cannot be defined at + * the same time as MBEDTLS_SHA256_USE_ARMV8_A_CRYPTO_ONLY. * * Requires: MBEDTLS_SHA256_C. * * Module: library/sha256.c * - * Uncomment to have the library check for the A64 SHA-256 crypto extensions - * and use them if available. + * Uncomment to have the library check for the Armv8-A SHA-256 crypto + * extensions and use them if available. + */ + +/* #define MBEDTLS_SHA256_USE_ARMV8_A_CRYPTO_IF_PRESENT */ + +/** + * \def MBEDTLS_SHA256_USE_A64_CRYPTO_IF_PRESENT + * + * \deprecated This is now known as + * MBEDTLS_SHA256_USE_ARMV8_A_CRYPTO_IF_PRESENT. This name is now deprecated, + * but may still be used as an alternative form for this option. */ /* #define MBEDTLS_SHA256_USE_A64_CRYPTO_IF_PRESENT */ /** - * \def MBEDTLS_SHA256_USE_A64_CRYPTO_ONLY + * \def MBEDTLS_SHA256_USE_ARMV8_A_CRYPTO_ONLY * * Enable acceleration of the SHA-256 and SHA-224 cryptographic hash - * algorithms - * with the ARMv8 cryptographic extensions, which must be available at - * runtime or else an illegal instruction fault will occur. + * algorithms with the ARMv8 cryptographic extensions, which must be + * available at runtime or else an illegal instruction fault will occur. * * \note This allows builds with a smaller code size than with - * MBEDTLS_SHA256_USE_A64_CRYPTO_IF_PRESENT + * MBEDTLS_SHA256_USE_ARMV8_A_CRYPTO_IF_PRESENT + * + * \note Minimum compiler versions for this feature are Clang 4.0, + * armclang 6.6 or GCC 6.0. + * + * \note \c CFLAGS must be set to a minimum of \c -march=armv8-a+crypto for + * armclang <= 6.9 * - * \warning MBEDTLS_SHA256_USE_A64_CRYPTO_ONLY cannot be defined at the same - * time as MBEDTLS_SHA256_USE_A64_CRYPTO_IF_PRESENT. + * \note This was previously known as MBEDTLS_SHA256_USE_A64_CRYPTO_ONLY. + * That name is deprecated, but may still be used as an alternative form for + * this option. + * + * \warning MBEDTLS_SHA256_USE_ARMV8_A_CRYPTO_ONLY cannot be defined at the + * same time as MBEDTLS_SHA256_USE_ARMV8_A_CRYPTO_IF_PRESENT. * * Requires: MBEDTLS_SHA256_C. * * Module: library/sha256.c * - * Uncomment to have the library use the A64 SHA-256 crypto extensions + * Uncomment to have the library use the Armv8-A SHA-256 crypto extensions * unconditionally. */ +/* #define MBEDTLS_SHA256_USE_ARMV8_A_CRYPTO_ONLY */ + +/** + * \def MBEDTLS_SHA256_USE_A64_CRYPTO_ONLY + * + * \deprecated This is now known as MBEDTLS_SHA256_USE_ARMV8_A_CRYPTO_ONLY. + * This name is now deprecated, but may still be used as an alternative form + * for this option. + */ + /* #define MBEDTLS_SHA256_USE_A64_CRYPTO_ONLY */ /** @@ -3606,19 +3916,34 @@ #define MBEDTLS_SHA512_C #endif +/** + * \def MBEDTLS_SHA3_C + * + * Enable the SHA3 cryptographic hash algorithm. + * + * Module: library/sha3.c + * + * This module adds support for SHA3. + */ +#ifdef CONFIG_MBEDTLS_SHA3_C +#define MBEDTLS_SHA3_C +#endif + /** * \def MBEDTLS_SHA512_USE_A64_CRYPTO_IF_PRESENT * * Enable acceleration of the SHA-512 and SHA-384 cryptographic hash - *algorithms - * with the ARMv8 cryptographic extensions if they are available at runtime. - * If not, the library will fall back to the C implementation. + * algorithms with the ARMv8 cryptographic extensions if they are available + * at runtime. If not, the library will fall back to the C implementation. * * \note If MBEDTLS_SHA512_USE_A64_CRYPTO_IF_PRESENT is defined when building * for a non-Aarch64 build it will be silently ignored. * - * \note The code uses the SHA-512 Neon intrinsics, so requires GCC >= 8 or - * Clang >= 7. + * \note Minimum compiler versions for this feature are Clang 7.0, + * armclang 6.9 or GCC 8.0. + * + * \note \c CFLAGS must be set to a minimum of \c -march=armv8.2-a+sha3 for + * armclang 6.9 * * \warning MBEDTLS_SHA512_USE_A64_CRYPTO_IF_PRESENT cannot be defined at the * same time as MBEDTLS_SHA512_USE_A64_CRYPTO_ONLY. @@ -3638,14 +3963,16 @@ * * Enable acceleration of the SHA-512 and SHA-384 cryptographic hash * algorithms with the ARMv8 cryptographic extensions, which must be - * available at runtime or else an illegal instruction fault will - * occur. + * available at runtime or else an illegal instruction fault will occur. * * \note This allows builds with a smaller code size than with * MBEDTLS_SHA512_USE_A64_CRYPTO_IF_PRESENT * - * \note The code uses the SHA-512 Neon intrinsics, so requires GCC >= 8 or - * Clang >= 7. + * \note Minimum compiler versions for this feature are Clang 7.0, + * armclang 6.9 or GCC 8.0. + * + * \note \c CFLAGS must be set to a minimum of \c -march=armv8.2-a+sha3 for + * armclang 6.9 * * \warning MBEDTLS_SHA512_USE_A64_CRYPTO_ONLY cannot be defined at the same * time as MBEDTLS_SHA512_USE_A64_CRYPTO_IF_PRESENT. @@ -3751,11 +4078,10 @@ * \def MBEDTLS_THREADING_C * * Enable the threading abstraction layer. - * By default mbed TLS assumes it is used in a non-threaded environment or - * that - * contexts are not shared between threads. If you do intend to use contexts - * between threads, you will need to enable this layer to prevent race - * conditions. See also our Knowledge Base article about threading: + * By default Mbed TLS assumes it is used in a non-threaded environment or + * that contexts are not shared between threads. If you do intend to use + * contexts between threads, you will need to enable this layer to prevent + * race conditions. See also our Knowledge Base article about threading: * https://mbed-tls.readthedocs.io/en/latest/kb/development/ \ * thread-safety-and-multi-threading * @@ -3767,7 +4093,7 @@ * You will have to enable either MBEDTLS_THREADING_ALT or * MBEDTLS_THREADING_PTHREAD. * - * Enable this layer to allow use of mutexes within mbed TLS + * Enable this layer to allow use of mutexes within Mbed TLS */ #ifdef CONFIG_MBEDTLS_THREADING_C #define MBEDTLS_THREADING_C @@ -3832,7 +4158,9 @@ * * This module is required for the X.509 parsing modules. */ +#ifdef CONFIG_MBEDTLS_X509_USE_C #define MBEDTLS_X509_USE_C +#endif /** * \def MBEDTLS_X509_CRT_PARSE_C @@ -3848,7 +4176,9 @@ * * This module is required for X.509 certificate parsing. */ +#ifdef CONFIG_MBEDTLS_X509_CRT_PARSE_C #define MBEDTLS_X509_CRT_PARSE_C +#endif /** * \def MBEDTLS_X509_CRL_PARSE_C @@ -3943,7 +4273,7 @@ #define MBEDTLS_XTEA_C #endif -/** \} name SECTION: mbed TLS modules */ +/** \} name SECTION: Mbed TLS modules */ /** * \name SECTION: General configuration options @@ -4170,7 +4500,7 @@ /* Date: Mon, 2 Dec 2024 10:27:44 +0800 Subject: [PATCH 026/391] tflm: add tflm hello world example into nuttx build 1. add tflm hello world example into nuttx build 2. add tflm model convert flow Test on sim/tflm $ cmake -B build -DBOARD_CONFIG=sim/tflm -GNinja $ cmake --build build $ ./build/nuttx NuttShell (NSH) NuttX-10.4.0 nsh> tflm_hello 0 (id=0): size=16, offset=0, first_used=0 last_used=1 1 (id=1): size=64, offset=64, first_used=1 last_used=2 2 (id=2): size=64, offset=0, first_used=2 last_used=3 3 (id=3): size=16, offset=64, first_used=3 last_used=3 0: 0000000000...................................................................... (1k) 1: 0000000000..............................1111111111111111111111111111111111111111 (1k) 2: 22222222222222222222222222222222222222221111111111111111111111111111111111111111 (1k) 3: 22222222222222222222222222222222222222223333333333.............................. (1k) "Unique Tag","Total ticks across all events with that tag." FULLY_CONNECTED, 0 "total number of ticks", 0 [RecordingMicroAllocator] Arena allocation total 2344 bytes [RecordingMicroAllocator] Arena allocation head 128 bytes [RecordingMicroAllocator] Arena allocation tail 2216 bytes [RecordingMicroAllocator] 'TfLiteEvalTensor data' used 240 bytes with alignment overhead (requested 240 bytes for 10 allocations) [RecordingMicroAllocator] 'Persistent TfLiteTensor data' used 128 bytes with alignment overhead (requested 128 bytes for 2 tensors) [RecordingMicroAllocator] 'Persistent buffer data' used 1152 bytes with alignment overhead (requested 1100 bytes for 7 allocations) [RecordingMicroAllocator] 'NodeAndRegistration struct' used 192 bytes with alignment overhead (requested 192 bytes for 3 NodeAndRegistration structs) 0 (id=0): size=16, offset=0, first_used=0 last_used=1 1 (id=1): size=64, offset=64, first_used=1 last_used=2 2 (id=2): size=64, offset=0, first_used=2 last_used=3 3 (id=3): size=16, offset=64, first_used=3 last_used=3 0: 0000000000...................................................................... (1k) 1: 0000000000..............................1111111111111111111111111111111111111111 (1k) 2: 22222222222222222222222222222222222222221111111111111111111111111111111111111111 (1k) 3: 22222222222222222222222222222222222222223333333333.............................. (1k) 0 (id=0): size=16, offset=16, first_used=0 last_used=1 1 (id=1): size=16, offset=0, first_used=1 last_used=2 2 (id=2): size=16, offset=16, first_used=2 last_used=3 3 (id=3): size=16, offset=0, first_used=3 last_used=3 0: ................0000000000000000................................................ (1k) 1: 11111111111111110000000000000000................................................ (1k) 2: 11111111111111112222222222222222................................................ (1k) 3: 33333333333333332222222222222222................................................ (1k) ~~~ALL TESTS PASSED~~~ nsh> Signed-off-by: chao an --- ...n-C-to-main-function-to-avoid-c-mang.patch | 26 ++++++++ mlearning/tflite-micro/CMakeLists.txt | 64 +++++++++++++++++++ mlearning/tflite-micro/Kconfig | 19 +++++- 3 files changed, 107 insertions(+), 2 deletions(-) create mode 100644 mlearning/tflite-micro/0004-tflite-add-extern-C-to-main-function-to-avoid-c-mang.patch diff --git a/mlearning/tflite-micro/0004-tflite-add-extern-C-to-main-function-to-avoid-c-mang.patch b/mlearning/tflite-micro/0004-tflite-add-extern-C-to-main-function-to-avoid-c-mang.patch new file mode 100644 index 00000000000..84f0bc028b7 --- /dev/null +++ b/mlearning/tflite-micro/0004-tflite-add-extern-C-to-main-function-to-avoid-c-mang.patch @@ -0,0 +1,26 @@ +From 971d7129e14c012bb10215cbc7370c3176490617 Mon Sep 17 00:00:00 2001 +From: chao an +Date: Mon, 2 Dec 2024 10:23:12 +0800 +Subject: [PATCH] tflite: add extern "C" to main function to avoid c++ mangling + +Signed-off-by: chao an +--- + tensorflow/lite/micro/examples/hello_world/hello_world_test.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tensorflow/lite/micro/examples/hello_world/hello_world_test.cc b/tensorflow/lite/micro/examples/hello_world/hello_world_test.cc +index ec23571a..24982e90 100644 +--- a/tensorflow/lite/micro/examples/hello_world/hello_world_test.cc ++++ b/tensorflow/lite/micro/examples/hello_world/hello_world_test.cc +@@ -149,7 +149,7 @@ TfLiteStatus LoadQuantModelAndPerformInference() { + return kTfLiteOk; + } + +-int main(int argc, char* argv[]) { ++extern "C" int main(int argc, char* argv[]) { + tflite::InitializeTarget(); + TF_LITE_ENSURE_STATUS(ProfileMemoryAndLatency()); + TF_LITE_ENSURE_STATUS(LoadFloatModelAndPerformInference()); +-- +2.34.1 + diff --git a/mlearning/tflite-micro/CMakeLists.txt b/mlearning/tflite-micro/CMakeLists.txt index 788408607a3..482e920b7bb 100644 --- a/mlearning/tflite-micro/CMakeLists.txt +++ b/mlearning/tflite-micro/CMakeLists.txt @@ -42,6 +42,8 @@ if(CONFIG_TFLITEMICRO) ${TFLITE_MICRO_DIR} -p1 < ${CMAKE_CURRENT_LIST_DIR}/0002-quantize-int8.patch && patch -d ${TFLITE_MICRO_DIR} -p1 < ${CMAKE_CURRENT_LIST_DIR}/0003-mean-int8.patch + && patch -d ${TFLITE_MICRO_DIR} -p1 < + ${CMAKE_CURRENT_LIST_DIR}/0004-tflite-add-extern-C-to-main-function-to-avoid-c-mang.patch DOWNLOAD_NO_PROGRESS true TIMEOUT 30) @@ -162,6 +164,42 @@ if(CONFIG_TFLITEMICRO) target_sources(tflite_micro PRIVATE ${TFLITE_MICRO_SRCS}) target_include_directories(tflite_micro PUBLIC ${INCDIR}) + # Help function to generate tflite data + # + # TFLM is designed to run on microcontrollers and other platforms without + # dynamic memory allocation and without filesystems. This means that data + # files such as TFLite models and test inputs must be built into the binary. + # + # Historically, data files have been included as cc arrays generated manually + # using `xxd -i ` + + function(tflite_generate_data in out declare) + set(tflm_data_out + ${CMAKE_BINARY_DIR}/apps/mlearning/tflite-micro/tflite-micro/${out}) + if(NOT EXISTS ${tflm_data_out}) + get_filename_component(TFLM_OUT ${tflm_data_out} DIRECTORY) + if(NOT EXISTS ${TFLM_OUT}) + file(MAKE_DIRECTORY ${TFLM_OUT}) + endif() + execute_process(COMMAND xxd -i ${TFLITE_MICRO_DIR}/${in} ${tflm_data_out}) + + # Replace array name + + string(REGEX REPLACE "([/|.])" "_" tflm_data_define + ${TFLITE_MICRO_DIR}/${in}) + string(REPLACE "-" "_" _tflm_data_define ${tflm_data_define}) + file(READ ${tflm_data_out} tflm_contents) + encode_brackets(tflm_contents) + encode_semicolon(tflm_contents) + string(REPLACE ${_tflm_data_define} ${declare} tflm_contents + ${tflm_contents}) + decode_semicolon(tflm_contents) + decode_brackets(tflm_contents) + file(WRITE ${tflm_data_out} "${tflm_contents}") + + endif() + endfunction() + if(CONFIG_TFLITEMICRO_TOOL) nuttx_add_application( NAME @@ -178,4 +216,30 @@ if(CONFIG_TFLITEMICRO) ${COMMON_FLAGS}) endif() + if(CONFIG_TFLITEMICRO_HELLOWORLD) + tflite_generate_data( + tensorflow/lite/micro/examples/hello_world/models/hello_world_float.tflite + tensorflow/lite/micro/examples/hello_world/models/hello_world_float_model_data.h + g_hello_world_float_model_data) + tflite_generate_data( + tensorflow/lite/micro/examples/hello_world/models/hello_world_int8.tflite + tensorflow/lite/micro/examples/hello_world/models/hello_world_int8_model_data.h + g_hello_world_int8_model_data) + + nuttx_add_application( + NAME + tflm_hello + STACKSIZE + ${CONFIG_TFLITEMICRO_HELLOWORLD_STACKSIZE} + PRIORITY + ${CONFIG_TFLITEMICRO_HELLOWORLD_PRIORITY} + SRCS + ${TFLITE_MICRO_DIR}/tensorflow/lite/micro/examples/hello_world/hello_world_test.cc + INCLUDE_DIRECTORIES + ${INCDIR} + ${CMAKE_BINARY_DIR}/apps/mlearning/tflite-micro/tflite-micro + COMPILE_FLAGS + ${COMMON_FLAGS}) + endif() + endif() diff --git a/mlearning/tflite-micro/Kconfig b/mlearning/tflite-micro/Kconfig index b7eaf75cc23..06193fff16e 100644 --- a/mlearning/tflite-micro/Kconfig +++ b/mlearning/tflite-micro/Kconfig @@ -41,5 +41,20 @@ config TFLITEMICRO_TOOL_STACKSIZE int "tflite-micro tool stacksize" default 4096 -endif -endif +endif # TFLITEMICRO_TOOL + +config TFLITEMICRO_HELLOWORLD + bool "Enable Tflite-micro hello world example" + default n + +if TFLITEMICRO_HELLOWORLD +config TFLITEMICRO_HELLOWORLD_PRIORITY + int "Tflite-micro hello world priority" + default 100 + +config TFLITEMICRO_HELLOWORLD_STACKSIZE + int "Tflite-micro hello world stacksize" + default 4096 + +endif # TFLITEMICRO_HELLOWORLD +endif # TFLITEMICRO From ce217b874437b2bd60ad2a2343442506cd8b50b8 Mon Sep 17 00:00:00 2001 From: pengyiqiang Date: Mon, 2 Dec 2024 16:11:42 +0800 Subject: [PATCH 027/391] lvgldemo: add LVGL duplicate initialization protection Signed-off-by: pengyiqiang --- examples/lvgldemo/lvgldemo.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/lvgldemo/lvgldemo.c b/examples/lvgldemo/lvgldemo.c index 44bf7400e9e..34b1b6e8c14 100644 --- a/examples/lvgldemo/lvgldemo.c +++ b/examples/lvgldemo/lvgldemo.c @@ -114,6 +114,12 @@ int main(int argc, FAR char *argv[]) lv_memzero(&ui_loop, sizeof(ui_loop)); #endif + if (lv_is_initialized()) + { + LV_LOG_ERROR("LVGL already initialized! aborting."); + return -1; + } + #ifdef NEED_BOARDINIT /* Perform board-specific driver initialization */ From 818a3e6b63313f586a706b7dcdc29fc340f1177b Mon Sep 17 00:00:00 2001 From: wangmingrong1 Date: Mon, 2 Dec 2024 14:59:08 +0800 Subject: [PATCH 028/391] kasantest.c: Adding Dependencies Signed-off-by: wangmingrong1 --- testing/kasantest/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/testing/kasantest/Kconfig b/testing/kasantest/Kconfig index 5c59684c35a..eb0623f490f 100644 --- a/testing/kasantest/Kconfig +++ b/testing/kasantest/Kconfig @@ -5,6 +5,7 @@ config TESTING_KASAN tristate "KASan validity test" + depends on MM_KASAN default n ---help--- Enable the KASan validity test From 6600a5fd08fc7c3b3454f2280883049d60f76ec7 Mon Sep 17 00:00:00 2001 From: George Poulios Date: Thu, 5 Dec 2024 02:43:42 +0200 Subject: [PATCH 029/391] MbedTLS: patch warning when DTLS is off This is to patch upstream MbedTLS issue: https://github.com/Mbed-TLS/mbedtls/issues/9425 that triggers a -Werror=undef when MBEDTLS_SSL_PROTO_DTLS is undefined. There is no other way to silence that warning and it breaks builds in systems with -Werror. Once the upstream issue is resolved, this can be reverted. Signed-off-by: George Poulios --- ...SL_DTLS_CONNECTION_ID_COMPAT-warning.patch | 33 +++++++++++++++++++ crypto/mbedtls/CMakeLists.txt | 2 ++ crypto/mbedtls/Makefile | 1 + 3 files changed, 36 insertions(+) create mode 100644 crypto/mbedtls/0003-Fix-MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT-warning.patch diff --git a/crypto/mbedtls/0003-Fix-MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT-warning.patch b/crypto/mbedtls/0003-Fix-MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT-warning.patch new file mode 100644 index 00000000000..df8d4524187 --- /dev/null +++ b/crypto/mbedtls/0003-Fix-MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT-warning.patch @@ -0,0 +1,33 @@ +From 84d6430f412d869a56bbcce070d5b730386e540a Mon Sep 17 00:00:00 2001 +From: George Poulios +Date: Thu, 5 Dec 2024 02:28:19 +0200 +Subject: [PATCH 3/3] Fix MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT warning + +When MBEDTLS_SSL_PROTO_DTLS is not defined, config_adjust_ssl.h +undefines (among others) MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT. +Then the preprocessor comparison with 0 generates Wundef. Wrap +the comparison under a defined() check to suppress this. This +breaks builds on systems with -Werror. + +Signed-off-by: George Poulios +--- + include/mbedtls/ssl.h | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/include/mbedtls/ssl.h b/include/mbedtls/ssl.h +index 42fffbf860..c68be5e30a 100644 +--- a/include/mbedtls/ssl.h ++++ b/include/mbedtls/ssl.h +@@ -620,7 +620,8 @@ + #define MBEDTLS_TLS_EXT_SIG_ALG_CERT 50 /* RFC 8446 TLS 1.3 */ + #define MBEDTLS_TLS_EXT_KEY_SHARE 51 /* RFC 8446 TLS 1.3 */ + +-#if MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT == 0 ++#if !defined(MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT) || \ ++ MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT == 0 + #define MBEDTLS_TLS_EXT_CID 54 /* RFC 9146 DTLS 1.2 CID */ + #else + #define MBEDTLS_TLS_EXT_CID 254 /* Pre-RFC 9146 DTLS 1.2 CID */ +-- +2.39.5 (Apple Git-154) + diff --git a/crypto/mbedtls/CMakeLists.txt b/crypto/mbedtls/CMakeLists.txt index 1506a0c0f44..1c93dc89491 100644 --- a/crypto/mbedtls/CMakeLists.txt +++ b/crypto/mbedtls/CMakeLists.txt @@ -38,6 +38,8 @@ if(CONFIG_CRYPTO_MBEDTLS) ${CMAKE_CURRENT_LIST_DIR}/0001-mbedtls-entropy_poll-use-getrandom-to-get-the-system.patch && patch -p1 -d ${MBEDTLS_DIR} < ${CMAKE_CURRENT_LIST_DIR}/0002-mbedtls-add-mbedtls-x509-crt-pool.patch + && patch -p1 -d ${MBEDTLS_DIR} < + ${CMAKE_CURRENT_LIST_DIR}/0003-Fix-MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT-warning.patch DOWNLOAD_NO_PROGRESS true TIMEOUT 30) diff --git a/crypto/mbedtls/Makefile b/crypto/mbedtls/Makefile index 62e310070f7..574f297b893 100644 --- a/crypto/mbedtls/Makefile +++ b/crypto/mbedtls/Makefile @@ -68,6 +68,7 @@ $(MBEDTLS_UNPACKNAME): $(MBEDTLS_ZIP) $(Q) mv mbedtls-$(MBEDTLS_VERSION) $(MBEDTLS_UNPACKNAME) $(Q) patch -p1 -d $(MBEDTLS_UNPACKNAME) < 0001-mbedtls-entropy_poll-use-getrandom-to-get-the-system.patch $(Q) patch -p1 -d $(MBEDTLS_UNPACKNAME) < 0002-mbedtls-add-mbedtls-x509-crt-pool.patch + $(Q) patch -p1 -d $(MBEDTLS_UNPACKNAME) < 0003-Fix-MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT-warning.patch $(Q) touch $(MBEDTLS_UNPACKNAME) # Download and unpack tarball if no git repo found From b08c29617bbf1f2c6227f74e23ffdd7706997e0c Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Mon, 2 Dec 2024 17:02:43 +0800 Subject: [PATCH 030/391] system/usbmsc: Add support for setting paths that bind to LUN at runtime Help nsh> msconn -h Usage: msconn [-o OPTION]... [-l LUNs]... Configures the USB mass storage device and exports the LUN(s). Supported arguments -o nc: No const LUN ro: Readonly rw: Read/Write(default) -l Device path to export Examples 1. Export const LUN(s) only msconn 2. Export /dev/ramx and const LUN(s) msconn -l /dev/ramx Signed-off-by: wangjianyu3 --- system/usbmsc/Kconfig | 30 +++++-- system/usbmsc/usbmsc.h | 42 --------- system/usbmsc/usbmsc_main.c | 174 +++++++++++++++++++++++------------- 3 files changed, 131 insertions(+), 115 deletions(-) diff --git a/system/usbmsc/Kconfig b/system/usbmsc/Kconfig index 5844cba1b38..d57d8fe3ad7 100644 --- a/system/usbmsc/Kconfig +++ b/system/usbmsc/Kconfig @@ -18,19 +18,21 @@ if SYSTEM_USBMSC config SYSTEM_USBMSC_NLUNS int "Number of LUNs" - default 1 + default 8 ---help--- - Defines the number of logical units (LUNs) exported by the USB + Defines the max number of logical units (LUNs) exported by the USB storage driver. Each LUN corresponds to one exported block driver - (or partition of a block driver). May be 1, 2, or 3. Default is 1. + (or partition of a block driver). May be 1, 2, or 3. config SYSTEM_USBMSC_DEVMINOR1 int "LUN1 Minor Device Number" - default 0 + default -1 ---help--- The minor device number of the block driver for the first LUN. For example, N in /dev/mmcsdN. Used for registering the block driver. - Default is zero. + Default -1 means the LUN is disabled. + +if SYSTEM_USBMSC_DEVMINOR1 > -1 config SYSTEM_USBMSC_DEVPATH1 string "LUN1 Device Path" @@ -46,13 +48,17 @@ config SYSTEM_USBMSC_WRITEPROTECT1 Enable this if you want to write-protect the first LUN. Default is off. +endif + config SYSTEM_USBMSC_DEVMINOR2 int "LUN2 Minor Device Number" - default 1 + default -1 ---help--- The minor device number of the block driver for the second LUN. For example, N in /dev/mmcsdN. Used for registering the block driver. - Ignored if SYSTEM_USBMSC_NLUNS < 2. Default is one. + Default -1 means the LUN is disabled. + +if SYSTEM_USBMSC_DEVMINOR2 > -1 config SYSTEM_USBMSC_DEVPATH2 string "LUN2 Device Path" @@ -68,13 +74,17 @@ config SYSTEM_USBMSC_WRITEPROTECT2 Enable this if you want to write-protect the second LUN. Ignored if SYSTEM_USBMSC_NLUNS < 2. Default is off. +endif + config SYSTEM_USBMSC_DEVMINOR3 int "LUN3 Minor Device Number" - default 2 + default -1 ---help--- The minor device number of the block driver for the third LUN. For example, N in /dev/mmcsdN. Used for registering the block driver. - Ignored if SYSTEM_USBMSC_NLUNS < 3. Default is two. + Default -1 means the LUN is disabled. + +if SYSTEM_USBMSC_DEVMINOR3 > -1 config SYSTEM_USBMSC_DEVPATH3 string "LUN3 Device Path" @@ -90,6 +100,8 @@ config SYSTEM_USBMSC_WRITEPROTECT3 Enable this if you want to write-protect the third LUN. Ignored if SYSTEM_USBMSC_NLUNS < 3. Default is off. +endif + config SYSTEM_USBMSC_DEBUGMM bool "USB MSC MM Debug" default n diff --git a/system/usbmsc/usbmsc.h b/system/usbmsc/usbmsc.h index 6ed81b434bf..70a47970463 100644 --- a/system/usbmsc/usbmsc.h +++ b/system/usbmsc/usbmsc.h @@ -32,48 +32,6 @@ * Pre-Processor Definitions ****************************************************************************/ -/* Configuration ************************************************************/ - -#ifndef CONFIG_SYSTEM_USBMSC_NLUNS -# define CONFIG_SYSTEM_USBMSC_NLUNS 1 -#endif - -#ifndef CONFIG_SYSTEM_USBMSC_DEVMINOR1 -# define CONFIG_SYSTEM_USBMSC_DEVMINOR1 0 -#endif - -#ifndef CONFIG_SYSTEM_USBMSC_DEVPATH1 -# define CONFIG_SYSTEM_USBMSC_DEVPATH1 "/dev/mmcsd0" -#endif - -#if CONFIG_SYSTEM_USBMSC_NLUNS > 1 -# ifndef CONFIG_SYSTEM_USBMSC_DEVMINOR2 -# error "CONFIG_SYSTEM_USBMSC_DEVMINOR2 for LUN=2" -# endif -# ifndef CONFIG_SYSTEM_USBMSC_DEVPATH2 -# error "CONFIG_SYSTEM_USBMSC_DEVPATH2 for LUN=2" -# endif -# if CONFIG_SYSTEM_USBMSC_NLUNS > 2 -# ifndef CONFIG_SYSTEM_USBMSC_DEVMINOR3 -# error "CONFIG_SYSTEM_USBMSC_DEVMINOR2 for LUN=3" -# endif -# ifndef CONFIG_SYSTEM_USBMSC_DEVPATH3 -# error "CONFIG_SYSTEM_USBMSC_DEVPATH3 for LUN=3" -# endif -# if CONFIG_SYSTEM_USBMSC_NLUNS > 3 -# error "CONFIG_SYSTEM_USBMSC_NLUNS must be {1,2,3}" -# endif -# else -# undef CONFIG_SYSTEM_USBMSC_DEVMINOR3 -# undef CONFIG_SYSTEM_USBMSC_DEVPATH3 -# endif -#else -# undef CONFIG_SYSTEM_USBMSC_DEVMINOR2 -# undef CONFIG_SYSTEM_USBMSC_DEVPATH2 -# undef CONFIG_SYSTEM_USBMSC_DEVMINOR3 -# undef CONFIG_SYSTEM_USBMSC_DEVPATH3 -#endif - /**************************************************************************** * Public Types ****************************************************************************/ diff --git a/system/usbmsc/usbmsc_main.c b/system/usbmsc/usbmsc_main.c index d4d1162c593..0da82e6ce47 100644 --- a/system/usbmsc/usbmsc_main.c +++ b/system/usbmsc/usbmsc_main.c @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -80,6 +81,26 @@ #define TRACE_BITSET (TRACE_INIT_BITS|TRACE_ERROR_BITS|TRACE_CLASS_BITS|\ TRACE_TRANSFER_BITS|TRACE_CONTROLLER_BITS|TRACE_INTERRUPT_BITS) +/* Save device path that will bind to a USB storage LUN later */ + +#define LUN_ADD_BIND(l, i, p, f) \ + do \ + { \ + l[i].path = p; \ + l[i].flags = f; \ + i++; \ + } while (0) + +/**************************************************************************** + * Private Types + ****************************************************************************/ + +struct usbmsc_lun_t +{ + FAR const char *path; /* The full path to the block driver */ + int flags; /* Access modes */ +}; + /**************************************************************************** * Private Data ****************************************************************************/ @@ -392,6 +413,23 @@ static void usbmsc_disconnect(FAR void *handle) boardctl(BOARDIOC_USBDEV_CONTROL, (uintptr_t)&ctrl); } +static void help_conn(void) +{ + printf("Usage: msconn [-o OPTION]... [-l LUNs]...\n"); + printf("Configures the USB mass storage device and exports the LUN(s).\n"); + printf("\nSupported arguments\n"); + printf(" -o\n"); + printf(" ro: Readonly\n"); + printf(" rw: Read/Write(default)\n"); + printf(" -l\n"); + printf(" Device path to export\n"); + printf("\nExamples\n"); + printf(" 1. Export const LUN(s) only\n"); + printf(" msconn\n"); + printf(" 2. Export /dev/ramx and const LUN(s)\n"); + printf(" msconn -l /dev/ramx\n"); +} + /**************************************************************************** * Public Functions ****************************************************************************/ @@ -410,9 +448,34 @@ static void usbmsc_disconnect(FAR void *handle) int main(int argc, FAR char *argv[]) { struct boardioc_usbdev_ctrl_s ctrl; + struct usbmsc_lun_t luns[CONFIG_SYSTEM_USBMSC_NLUNS]; + int num_luns = 0; + int flags = O_RDWR; FAR void *handle = NULL; int ret; + memset(luns, 0, sizeof(luns)); + + while ((ret = getopt(argc, argv, "l:o:")) != -1) + { + switch (ret) + { + case 'o': + if (!strcmp("ro", optarg)) + { + flags = O_RDONLY; + } + else if (!strcmp("rw", optarg)) + { + flags = O_RDWR; + } + break; + case 'l': + LUN_ADD_BIND(luns, num_luns, optarg, flags); + break; + } + } + /* If this program is implemented as the NSH 'msconn' command, then we * need to do a little error checking to assure that we are not being * called re-entrantly. @@ -428,6 +491,38 @@ int main(int argc, FAR char *argv[]) return EXIT_FAILURE; } + /* Add const LUNs */ + +#if CONFIG_SYSTEM_USBMSC_DEVMINOR1 > -1 +# ifdef CONFIG_SYSTEM_USBMSC_WRITEPROTECT1 + LUN_ADD_BIND(luns, num_luns, CONFIG_SYSTEM_USBMSC_DEVPATH1, O_RDONLY); +# else + LUN_ADD_BIND(luns, num_luns, CONFIG_SYSTEM_USBMSC_DEVPATH1, O_RDWR); +# endif +#endif + +#if CONFIG_SYSTEM_USBMSC_DEVMINOR2 > -1 +# ifdef CONFIG_SYSTEM_USBMSC_WRITEPROTECT2 + LUN_ADD_BIND(luns, num_luns, CONFIG_SYSTEM_USBMSC_DEVPATH2, O_RDONLY); +# else + LUN_ADD_BIND(luns, num_luns, CONFIG_SYSTEM_USBMSC_DEVPATH2, O_RDWR); +# endif +#endif + +#if CONFIG_SYSTEM_USBMSC_DEVMINOR3 > -1 +# ifdef CONFIG_SYSTEM_USBMSC_WRITEPROTECT3 + LUN_ADD_BIND(luns, num_luns, CONFIG_SYSTEM_USBMSC_DEVPATH3, O_RDONLY); +# else + LUN_ADD_BIND(luns, num_luns, CONFIG_SYSTEM_USBMSC_DEVPATH3, O_RDWR); +# endif +#endif + + if (num_luns <= 0) + { + help_conn(); + return EINVAL; + } + #ifdef CONFIG_SYSTEM_USBMSC_DEBUGMM g_usbmsc.mmstart = mallinfo(); g_usbmsc.mmprevious = g_usbmsc.mmstart; @@ -462,8 +557,8 @@ int main(int argc, FAR char *argv[]) /* Then exports the LUN(s) */ printf("mcsonn_main: Configuring with NLUNS=%d\n", - CONFIG_SYSTEM_USBMSC_NLUNS); - ret = usbmsc_configure(CONFIG_SYSTEM_USBMSC_NLUNS, &handle); + num_luns); + ret = usbmsc_configure(num_luns, &handle); if (ret < 0) { printf("mcsonn_main: usbmsc_configure failed: %d\n", -ret); @@ -478,73 +573,24 @@ int main(int argc, FAR char *argv[]) printf("mcsonn_main: handle=%p\n", handle); check_test_memory_usage("After usbmsc_configure()"); - printf("mcsonn_main: Bind LUN=0 to %s\n", - CONFIG_SYSTEM_USBMSC_DEVPATH1); - -#ifdef CONFIG_SYSTEM_USBMSC_WRITEPROTECT1 - ret = usbmsc_bindlun(handle, CONFIG_SYSTEM_USBMSC_DEVPATH1, 0, 0, 0, - true); -#else - ret = usbmsc_bindlun(handle, CONFIG_SYSTEM_USBMSC_DEVPATH1, 0, 0, 0, - false); -#endif - if (ret < 0) + while (--num_luns >= 0 && luns[num_luns].path != NULL) { - printf("mcsonn_main: usbmsc_bindlun failed for LUN 1 using %s: %d\n", - CONFIG_SYSTEM_USBMSC_DEVPATH1, -ret); - usbmsc_disconnect(handle); - return EXIT_FAILURE; - } - - check_test_memory_usage("After usbmsc_bindlun()"); - -#if CONFIG_SYSTEM_USBMSC_NLUNS > 1 - - printf("mcsonn_main: Bind LUN=1 to %s\n", - CONFIG_SYSTEM_USBMSC_DEVPATH2); - -#ifdef CONFIG_SYSTEM_USBMSC_WRITEPROTECT2 - ret = usbmsc_bindlun(handle, CONFIG_SYSTEM_USBMSC_DEVPATH2, 1, 0, 0, - true); -#else - ret = usbmsc_bindlun(handle, CONFIG_SYSTEM_USBMSC_DEVPATH2, 1, 0, 0, - false); -#endif - if (ret < 0) - { - printf("mcsonn_main: usbmsc_bindlun failed for LUN 2 using %s: %d\n", - CONFIG_SYSTEM_USBMSC_DEVPATH2, -ret); - usbmsc_disconnect(handle); - return EXIT_FAILURE; - } - - check_test_memory_usage("After usbmsc_bindlun() #2"); - -#if CONFIG_SYSTEM_USBMSC_NLUNS > 2 + printf("mcsonn_main: Bind LUN=%d to %s\n", + num_luns, luns[num_luns].path); - printf("mcsonn_main: Bind LUN=2 to %s\n", - CONFIG_SYSTEM_USBMSC_DEVPATH3); + ret = usbmsc_bindlun(handle, luns[num_luns].path, 0, 0, 0, + luns[num_luns].flags & O_WROK ? false : true); + if (ret < 0) + { + printf("mcsonn_main: usbmsc_bindlun failed for LUN %d using %s: " + "%d\n", num_luns, luns[num_luns].path, -ret); + usbmsc_disconnect(handle); + return EXIT_FAILURE; + } -#ifdef CONFIG_SYSTEM_USBMSC_WRITEPROTECT3 - ret = usbmsc_bindlun(handle, CONFIG_SYSTEM_USBMSC_DEVPATH3, 2, 0, 0, - true); -#else - ret = usbmsc_bindlun(handle, CONFIG_SYSTEM_USBMSC_DEVPATH3, 2, 0, 0, - false); -#endif - if (ret < 0) - { - printf("mcsonn_main: usbmsc_bindlun failed for LUN 3 using %s: %d\n", - CONFIG_SYSTEM_USBMSC_DEVPATH3, -ret); - usbmsc_disconnect(handle); - return EXIT_FAILURE; + check_test_memory_usage("After usbmsc_bindlun()"); } - check_test_memory_usage("After usbmsc_bindlun() #3"); - -#endif -#endif - ret = usbmsc_exportluns(handle); if (ret < 0) { From 9d7714f8430a1cb4c017dacd46f50247d1997779 Mon Sep 17 00:00:00 2001 From: Tiago Medicci Date: Thu, 5 Dec 2024 16:08:55 -0300 Subject: [PATCH 031/391] system/nxdiag: Change the order to generate the sysinfo.h file The generation of `sys info.h` depends on evaluating whether Espressif's HAL exists in the arch folder. However, cloning the HAL itself happens in the `context` phase of the build, so it is necessary to wait for it to finish before proceeding to the evaluation in nxdiag. This is done by using the `depend` phase to generate the `sysinfo.h` file. --- system/nxdiag/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/nxdiag/Makefile b/system/nxdiag/Makefile index f25d17aac8d..0da0a0a84b1 100644 --- a/system/nxdiag/Makefile +++ b/system/nxdiag/Makefile @@ -113,7 +113,7 @@ sysinfo.h : checkpython3 $(INFO_DEPS) exit 1; \ fi -context:: sysinfo.h +depend:: sysinfo.h distclean:: $(call DELFILE, sysinfo.h) From efc1bf710c8be1e0f0ae5e1bf2b292f8b57076a6 Mon Sep 17 00:00:00 2001 From: Tiago Medicci Date: Wed, 4 Dec 2024 16:48:38 -0300 Subject: [PATCH 032/391] interpreters/python: Add Python's port to NuttX This is the NuttX's port of Python (cpython)! Initial support of Python includes building the Python's static library and the `python` (Programs/python.c) application. Python's modules are stored in `pyc` (byte-code file) and loaded as needed from flash. --- interpreters/python/.gitignore | 6 + interpreters/python/Kconfig | 58 ++++++ interpreters/python/Make.defs | 30 +++ interpreters/python/Makefile | 172 ++++++++++++++++ interpreters/python/Setup.local | 50 +++++ interpreters/python/config.site | 21 ++ interpreters/python/mount_modules.c | 132 ++++++++++++ ...around-newlib-resource.h-limitations.patch | 29 +++ ...32_t-unsigned-int-type-mismatch-issu.patch | 151 ++++++++++++++ ...s.py-for-generating-an-archive-of-py.patch | 42 ++++ ...04-recognize-nuttx-as-a-supported-OS.patch | 60 ++++++ ...ilds-Without-HAVE_DYNAMIC_LOADING-Se.patch | 189 ++++++++++++++++++ ...to-avoid-conflict-with-nuttx-unused_.patch | 168 ++++++++++++++++ .../patch/0007-undef-atexit_register.patch | 29 +++ .../patch/0008-declare-struct-timeval.patch | 27 +++ ...s-select-header-to-define-FD_SETSIZE.patch | 27 +++ ...d_ino-member-of-the-structure-dirent.patch | 173 ++++++++++++++++ 17 files changed, 1364 insertions(+) create mode 100644 interpreters/python/.gitignore create mode 100644 interpreters/python/Kconfig create mode 100644 interpreters/python/Make.defs create mode 100644 interpreters/python/Makefile create mode 100644 interpreters/python/Setup.local create mode 100644 interpreters/python/config.site create mode 100644 interpreters/python/mount_modules.c create mode 100644 interpreters/python/patch/0001-workaround-newlib-resource.h-limitations.patch create mode 100644 interpreters/python/patch/0002-fix-various-uint32_t-unsigned-int-type-mismatch-issu.patch create mode 100644 interpreters/python/patch/0003-reuse-wasm_assets.py-for-generating-an-archive-of-py.patch create mode 100644 interpreters/python/patch/0004-recognize-nuttx-as-a-supported-OS.patch create mode 100644 interpreters/python/patch/0005-gh-122907-Fix-Builds-Without-HAVE_DYNAMIC_LOADING-Se.patch create mode 100644 interpreters/python/patch/0006-change-var-name-to-avoid-conflict-with-nuttx-unused_.patch create mode 100644 interpreters/python/patch/0007-undef-atexit_register.patch create mode 100644 interpreters/python/patch/0008-declare-struct-timeval.patch create mode 100644 interpreters/python/patch/0009-include-nuttx-sys-select-header-to-define-FD_SETSIZE.patch create mode 100644 interpreters/python/patch/0010-check-for-the-d_ino-member-of-the-structure-dirent.patch diff --git a/interpreters/python/.gitignore b/interpreters/python/.gitignore new file mode 100644 index 00000000000..ad58719cdd4 --- /dev/null +++ b/interpreters/python/.gitignore @@ -0,0 +1,6 @@ +/*.zip +/build/ +/install/ +/Python/ +/romfs_cpython_modules.h +/romfs_cpython_modules.img diff --git a/interpreters/python/Kconfig b/interpreters/python/Kconfig new file mode 100644 index 00000000000..da20c8ec43f --- /dev/null +++ b/interpreters/python/Kconfig @@ -0,0 +1,58 @@ +# +# For a description of the syntax of this configuration file, +# see the file kconfig-language.txt in the NuttX tools repository. +# + +config INTERPRETER_CPYTHON + tristate "CPython" + depends on LIB_ZLIB + depends on EXPERIMENTAL + default n + ---help--- + Enable the CPython port to NuttX. This is a port of the Python + interpreter to NuttX. Initially, it is tweaked to work with the + RISC-V QEMU virtual board (`rv-virt`). + +if INTERPRETER_CPYTHON + +config INTERPRETER_CPYTHON_VERSION + string "Python Version" + default "3.13.0" + +config INTERPRETER_CPYTHON_STACKSIZE + int "CPython stack size" + default 307200 + ---help--- + This is the stack size allocated when the CPython task runs. + +config INTERPRETER_CPYTHON_PRIORITY + int "CPython task priority" + default 150 + ---help--- + This is the priority of the CPython task. + +config INTERPRETER_CPYTHON_PROGNAME + string "CPython name" + default "python" + ---help--- + This is the name of the program that will be used from the nsh. + +config INTERPRETER_CPYTHON_MOUNT_MODULES_STACKSIZE + int "CPython's Modules Mount stack size" + default 4096 + ---help--- + This is the stack size allocated when the CPython's Modules Mount task runs. + +config INTERPRETER_CPYTHON_MOUNT_MODULES_PRIORITY + int "CPython's Modules Mount task priority" + default 150 + ---help--- + This is the priority of the CPython's Modules Mount task. + +config INTERPRETER_CPYTHON_MOUNT_MODULES_PROGNAME + string "CPython's Modules Mount app name" + default "python_mount_modules" + ---help--- + This is the name of the program that will be used from the nsh. + +endif diff --git a/interpreters/python/Make.defs b/interpreters/python/Make.defs new file mode 100644 index 00000000000..a1aecbdb4bc --- /dev/null +++ b/interpreters/python/Make.defs @@ -0,0 +1,30 @@ +############################################################################ +# apps/interpreters/python/Make.defs +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +ifneq ($(CONFIG_INTERPRETER_CPYTHON),) + +CPYTHON_VERSION = $(patsubst "%",%,$(strip $(CONFIG_INTERPRETER_CPYTHON_VERSION))) +CPYTHON_VERSION_MINOR=$(basename $(CPYTHON_VERSION)) + +EXTRA_LIBPATHS += -L$(APPDIR)/interpreters/python/install/target +EXTRA_LIBS += -lpython$(CPYTHON_VERSION_MINOR) + +CONFIGURED_APPS += $(APPDIR)/interpreters/python +endif diff --git a/interpreters/python/Makefile b/interpreters/python/Makefile new file mode 100644 index 00000000000..80db1722e36 --- /dev/null +++ b/interpreters/python/Makefile @@ -0,0 +1,172 @@ +############################################################################ +# apps/interpreters/python/Makefile +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +include $(APPDIR)/Make.defs + +CPYTHON_URL ?= "https://github.com/python/cpython/archive" +CPYTHON_VERSION = $(patsubst "%",%,$(strip $(CONFIG_INTERPRETER_CPYTHON_VERSION))) +CPYTHON_VERSION_MINOR=$(basename $(CPYTHON_VERSION)) +CPYTHON_ZIP = v$(CPYTHON_VERSION).zip + +CPYTHON_UNPACKNAME = Python +UNPACK ?= unzip -q -o + +MACHDEP=nuttx +CONFIG_SITE=${CURDIR}/config.site +CPYTHON_PATH=$(CURDIR)/$(CPYTHON_UNPACKNAME) + +BUILDIR=$(CURDIR)/build +INSTALLDIR=$(CURDIR)/install +HOSTBUILD=$(BUILDIR)/host +HOSTINSTALL=$(INSTALLDIR)/host +HOSTPYTHON=$(HOSTINSTALL)/bin/python3 +TARGETBUILD=$(BUILDIR)/target +TARGETINSTALL=$(INSTALLDIR)/target +TARGETLIBPYTHON=$(TARGETINSTALL)/libpython$(CPYTHON_VERSION_MINOR).a +TARGETMODULESPACK=$(TARGETBUILD)/lib/python$(shell echo $(CPYTHON_VERSION_MINOR) | tr -d .).zip +TARGETMODULES=$(TARGETINSTALL)/lib/ + +DEPPATH += --dep-path $(CPYTHON_UNPACKNAME)$(DELIM)Programs +VPATH += :$(CPYTHON_UNPACKNAME)$(DELIM)Programs + +$(CPYTHON_ZIP): + @echo "Downloading: $(CPYTHON_URL)/$(CPYTHON_ZIP)" + $(Q) $(call DOWNLOAD,$(CPYTHON_URL),$(CPYTHON_ZIP)) + +$(CPYTHON_UNPACKNAME): $(CPYTHON_ZIP) + @echo "Unpacking: $(CPYTHON_ZIP) -> $(CPYTHON_UNPACKNAME)" + $(Q) $(UNPACK) $(CPYTHON_ZIP) + $(Q) mv cpython-$(CPYTHON_VERSION) $(CPYTHON_UNPACKNAME) + @echo "Patching $(CPYTHON_UNPACKNAME)" + $(Q) patch -p1 -d $(CPYTHON_UNPACKNAME) < patch$(DELIM)0001-workaround-newlib-resource.h-limitations.patch + $(Q) patch -p1 -d $(CPYTHON_UNPACKNAME) < patch$(DELIM)0002-fix-various-uint32_t-unsigned-int-type-mismatch-issu.patch + $(Q) patch -p1 -d $(CPYTHON_UNPACKNAME) < patch$(DELIM)0003-reuse-wasm_assets.py-for-generating-an-archive-of-py.patch + $(Q) patch -p1 -d $(CPYTHON_UNPACKNAME) < patch$(DELIM)0004-recognize-nuttx-as-a-supported-OS.patch + $(Q) patch -p1 -d $(CPYTHON_UNPACKNAME) < patch$(DELIM)0005-gh-122907-Fix-Builds-Without-HAVE_DYNAMIC_LOADING-Se.patch + $(Q) patch -p1 -d $(CPYTHON_UNPACKNAME) < patch$(DELIM)0006-change-var-name-to-avoid-conflict-with-nuttx-unused_.patch + $(Q) patch -p1 -d $(CPYTHON_UNPACKNAME) < patch$(DELIM)0007-undef-atexit_register.patch + $(Q) patch -p1 -d $(CPYTHON_UNPACKNAME) < patch$(DELIM)0008-declare-struct-timeval.patch + $(Q) patch -p1 -d $(CPYTHON_UNPACKNAME) < patch$(DELIM)0009-include-nuttx-sys-select-header-to-define-FD_SETSIZE.patch + $(Q) patch -p1 -d $(CPYTHON_UNPACKNAME) < patch$(DELIM)0010-check-for-the-d_ino-member-of-the-structure-dirent.patch + +$(HOSTPYTHON): + mkdir -p $(HOSTBUILD) + mkdir -p $(HOSTINSTALL) + $(Q) ( \ + cd $(HOSTBUILD) && $(CPYTHON_PATH)/configure \ + --with-pydebug \ + --prefix=$(HOSTINSTALL) \ + ) + $(MAKE) -C $(HOSTBUILD) install + +# For the Python's `configure` script, please consider the following +# when building for NuttX: +# +# Use sed to remove optimization flags from NuttX's CFLAGS because +# Python's configure script requires them in OPT. Having the flags in +# both places causes a conflict. +# +# Also, use -O0 for OPT because -Os is causing problems in +# Python/Modules/getpath.c (issue will be filed soon to track this +# problem). + +$(TARGETBUILD)/Makefile: $(HOSTPYTHON) + $(Q) mkdir -p $(TARGETBUILD)/Modules + $(Q) mkdir -p $(TARGETMODULES)/python$(CPYTHON_VERSION_MINOR) + $(Q) ( cp Setup.local $(TARGETBUILD)/Modules/Setup.local ) + $(Q) ( \ + cd $(TARGETBUILD); \ + CFLAGS="$(CFLAGS)"; \ + ARCH=$(CONFIG_ARCH); \ + ARCH_CHIP=$(CONFIG_ARCH_CHIP); \ + ARCH="$${ARCH//-/}"; \ + ARCH_CHIP="$${ARCH_CHIP//-/}"; \ + CFLAGS="$$(echo "$${CFLAGS}" | sed 's/-Os //')" \ + CC="$(CC)" \ + CXX="$(CXX)" \ + AR="$(AR)" \ + ARFLAGS=" " \ + MACHDEP="$(MACHDEP)" \ + OPT="-g -O0 -Wall" \ + CONFIG_SITE="$(CONFIG_SITE)" \ + $(CPYTHON_PATH)/configure \ + --prefix=${TARGETINSTALL} \ + --disable-shared \ + --host=$${ARCH}-$${ARCH_CHIP}-nuttx \ + --build=$(shell $(CPYTHON_PATH)/config.guess) \ + --with-build-python=${HOSTPYTHON} \ + --without-mimalloc \ + --without-pymalloc \ + --disable-test-modules \ + ) + +$(TARGETLIBPYTHON): $(TARGETBUILD)/Makefile + $(MAKE) -C $(TARGETBUILD) regen-frozen + $(MAKE) -C $(TARGETBUILD) libpython$(CPYTHON_VERSION_MINOR).a wasm_stdlib + $(Q) ( cp $(TARGETBUILD)/libpython$(CPYTHON_VERSION_MINOR).a $(TARGETLIBPYTHON) ) + $(Q) $(UNPACK) $(TARGETMODULESPACK) -d $(TARGETMODULES)/python$(CPYTHON_VERSION_MINOR) + +CFLAGS += ${INCDIR_PREFIX}$(CPYTHON_PATH)$(DELIM)Include +CFLAGS += ${INCDIR_PREFIX}$(CPYTHON_PATH)$(DELIM)Test +CFLAGS += ${INCDIR_PREFIX}$(CPYTHON_PATH)$(DELIM)Include$(DELIM)internal +CFLAGS += ${INCDIR_PREFIX}$(APPDIR)$(DELIM)system +CFLAGS += ${INCDIR_PREFIX}$(APPDIR)$(DELIM)system$(DELIM)zlib$(DELIM)zlib +CFLAGS += ${INCDIR_PREFIX}$(TARGETBUILD) + +MODULE = $(CONFIG_INTERPRETER_CPYTHON) + +PROGNAME += $(CONFIG_INTERPRETER_CPYTHON_PROGNAME) +PRIORITY += $(CONFIG_INTERPRETER_CPYTHON_PRIORITY) +STACKSIZE += $(CONFIG_INTERPRETER_CPYTHON_STACKSIZE) + +MAINSRC += python.c + +PROGNAME += $(CONFIG_INTERPRETER_CPYTHON_MOUNT_MODULES_PROGNAME) +PRIORITY += $(CONFIG_INTERPRETER_CPYTHON_MOUNT_MODULES_PRIORITY) +STACKSIZE += $(CONFIG_INTERPRETER_CPYTHON_MOUNT_MODULES_STACKSIZE) + +MAINSRC += mount_modules.c + +checkgenromfs: + @genromfs -h 1>/dev/null 2>&1 || { \ + echo "Host executable genromfs not available in PATH"; \ + echo "You may need to download in from https://romfs.sourceforge.net/"; \ + exit 1; \ + } + +romfs_cpython_modules.img : $(TARGETLIBPYTHON) checkgenromfs + @genromfs -f $@ -d $(TARGETMODULES) -V "ROMFS_Test" || { echo "genromfs failed" ; exit 1 ; } + +romfs_cpython_modules.h : romfs_cpython_modules.img + @xxd -i $< >$@ || { echo "xxd of $< failed" ; exit 1 ; } + +context:: $(CPYTHON_UNPACKNAME) + +depend:: romfs_cpython_modules.h + +distclean:: + $(call DELDIR, $(BUILDIR)) + $(call DELDIR, $(INSTALLDIR)) + $(call DELDIR, $(CPYTHON_UNPACKNAME)) + $(call DELFILE, $(CPYTHON_ZIP)) + $(call DELFILE, romfs_cpython_modules.img) + $(call DELFILE, romfs_cpython_modules.h) + +include $(APPDIR)/Application.mk diff --git a/interpreters/python/Setup.local b/interpreters/python/Setup.local new file mode 100644 index 00000000000..beca9d6663a --- /dev/null +++ b/interpreters/python/Setup.local @@ -0,0 +1,50 @@ +# This file gets copied into the Modules/ folder when building +# newlib configurations which do not support dynamic library +# loading. + +*disabled* +_asyncio +_blake2 +_bz2 +_codecs_cn +_codecs_hk +_codecs_iso2022 +_codecs_jp +_codecs_kr +_codecs_tw +_ctypes +_decimal +_elementtree +_hashlib +_heapq +_interpchannels +_interpqueues +_lsprof +_lzma +_md5 +_multibytecodec +_sha1 +_sha2 +_sha2 +_sha3 +_sha3 +_socket +_sqlite3 +_ssl +_statistics +_testbuffer +_testcapi +_testclinic +_testclinic_limited +_testexternalinspection +_testinternalcapi +_testlimitedcapi +_uuid +_xxtestfuzz +_zoneinfo +mmap +pwd +pyexpat +readline +resource +xxsubtype diff --git a/interpreters/python/config.site b/interpreters/python/config.site new file mode 100644 index 00000000000..d806ba564d7 --- /dev/null +++ b/interpreters/python/config.site @@ -0,0 +1,21 @@ +export ac_cv_file__dev_ptmx="no" +export ac_cv_file__dev_ptc="no" +export ac_cv_buggy_getaddrinfo="no" +export ac_cv_func_getaddrinfo="yes" +export ac_cv_pthread_is_default="yes" +export ac_cv_func_acosh="yes" +export ac_cv_func_asinh="yes" +export ac_cv_func_atanh="yes" +export ac_cv_func_erf="yes" +export ac_cv_func_erfc="yes" +export ac_cv_func_expm1="yes" +export ac_cv_func_log1p="yes" +export ac_cv_func_log2="yes" +export ac_cv_func_clock_gettime="yes" +export ac_cv_header_sys_syscall_h="no" +export ac_cv_func_timegm="yes" +export ac_cv_func_clock="yes" +export ac_cv_func_fork="yes" +export ac_cv_func_waitpid="yes" +export ac_cv_func_pipe="yes" +export MODULE_BUILDTYPE="static" diff --git a/interpreters/python/mount_modules.c b/interpreters/python/mount_modules.c new file mode 100644 index 00000000000..89a7bc377a5 --- /dev/null +++ b/interpreters/python/mount_modules.c @@ -0,0 +1,132 @@ +/**************************************************************************** + * apps/interpreters/python/mount_modules.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "romfs_cpython_modules.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* Configuration settings */ + +#ifndef CONFIG_CPYTHON_ROMFS_RAMDEVNO +# define CONFIG_CPYTHON_ROMFS_RAMDEVNO 1 +#endif + +#ifndef CONFIG_CPYTHON_ROMFS_SECTORSIZE +# define CONFIG_CPYTHON_ROMFS_SECTORSIZE 64 +#endif + +#ifndef CONFIG_CPYTHON_ROMFS_MOUNTPOINT +# define CONFIG_CPYTHON_ROMFS_MOUNTPOINT "/usr/local/lib/" +#endif + +#ifdef CONFIG_DISABLE_MOUNTPOINT +# error "Mountpoint support is disabled" +#endif + +#ifndef CONFIG_FS_ROMFS +# error "ROMFS support not enabled" +#endif + +#define NSECTORS(b) (((b)+CONFIG_CPYTHON_ROMFS_SECTORSIZE-1)/CONFIG_CPYTHON_ROMFS_SECTORSIZE) +#define STR_RAMDEVNO(m) #m +#define MKMOUNT_DEVNAME(m) "/dev/ram" STR_RAMDEVNO(m) +#define MOUNT_DEVNAME MKMOUNT_DEVNAME(CONFIG_CPYTHON_ROMFS_RAMDEVNO) + +/**************************************************************************** + * Private Types + ****************************************************************************/ + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: mount_modules + ****************************************************************************/ + +int main(int argc, FAR char *argv[]) +{ + int ret; + struct boardioc_romdisk_s desc; + + /* Create a RAM disk for the test */ + + desc.minor = CONFIG_CPYTHON_ROMFS_RAMDEVNO; /* Minor device number of the ROM disk. */ + desc.nsectors = NSECTORS(romfs_cpython_modules_img_len); /* The number of sectors in the ROM disk */ + desc.sectsize = CONFIG_CPYTHON_ROMFS_SECTORSIZE; /* The size of one sector in bytes */ + desc.image = (FAR uint8_t *)romfs_cpython_modules_img; /* File system image */ + + ret = boardctl(BOARDIOC_ROMDISK, (uintptr_t)&desc); + + if (ret < 0) + { + printf("ERROR: Failed to create RAM disk: %s\n", strerror(errno)); + return 1; + } + + /* Mount the test file system */ + + printf("Mounting ROMFS filesystem at target=%s with source=%s\n", + CONFIG_CPYTHON_ROMFS_MOUNTPOINT, MOUNT_DEVNAME); + + ret = mount(MOUNT_DEVNAME, CONFIG_CPYTHON_ROMFS_MOUNTPOINT, "romfs", + MS_RDONLY, NULL); + if (ret < 0) + { + printf("ERROR: Mount failed: %s\n", strerror(errno)); + return 1; + } + + return 0; +} diff --git a/interpreters/python/patch/0001-workaround-newlib-resource.h-limitations.patch b/interpreters/python/patch/0001-workaround-newlib-resource.h-limitations.patch new file mode 100644 index 00000000000..dfb9d437a3b --- /dev/null +++ b/interpreters/python/patch/0001-workaround-newlib-resource.h-limitations.patch @@ -0,0 +1,29 @@ +From b2ac42cefa3747c7f7a9066fceed834286e829af Mon Sep 17 00:00:00 2001 +From: Ivan Grokhotkov +Date: Tue, 22 Oct 2024 23:58:17 +0200 +Subject: [PATCH 01/10] workaround newlib resource.h limitations + +configure script checks if resource.h is available but doesn't check +if it defines all the necessary functions. + +Temporary workaround until these functions are added to IDF. +--- + Modules/faulthandler.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Modules/faulthandler.c b/Modules/faulthandler.c +index b62362f2777..327d883f94e 100644 +--- a/Modules/faulthandler.c ++++ b/Modules/faulthandler.c +@@ -968,7 +968,7 @@ faulthandler_suppress_crash_report(void) + SetErrorMode(mode | SEM_NOGPFAULTERRORBOX); + #endif + +-#ifdef HAVE_SYS_RESOURCE_H ++#if 0 && defined(HAVE_SYS_RESOURCE_H) + struct rlimit rl; + + /* Disable creation of core dump */ +-- +2.46.1 + diff --git a/interpreters/python/patch/0002-fix-various-uint32_t-unsigned-int-type-mismatch-issu.patch b/interpreters/python/patch/0002-fix-various-uint32_t-unsigned-int-type-mismatch-issu.patch new file mode 100644 index 00000000000..0bf12755af3 --- /dev/null +++ b/interpreters/python/patch/0002-fix-various-uint32_t-unsigned-int-type-mismatch-issu.patch @@ -0,0 +1,151 @@ +From 036b39478c2419af1e0a64763b9ac741cf886387 Mon Sep 17 00:00:00 2001 +From: Ivan Grokhotkov +Date: Wed, 23 Oct 2024 16:48:49 +0200 +Subject: [PATCH 02/10] fix various uint32_t/'unsigned int' type mismatch + issues + +In a few places existing code assumes that uint32_t == unsigned int. +Since in Xtensa and RISC-V bare metal toolchains uint32_t is instead +'unsigned long', the original code fails to build. +--- + Modules/zlibmodule.c | 28 ++++++++++++++-------------- + Objects/typeobject.c | 2 +- + 2 files changed, 15 insertions(+), 15 deletions(-) + +diff --git a/Modules/zlibmodule.c b/Modules/zlibmodule.c +index b115f67f228..034a9420b16 100644 +--- a/Modules/zlibmodule.c ++++ b/Modules/zlibmodule.c +@@ -28,13 +28,13 @@ + On failure, return -1 */ + static inline Py_ssize_t + OutputBuffer_InitAndGrow(_BlocksOutputBuffer *buffer, Py_ssize_t max_length, +- Bytef **next_out, uint32_t *avail_out) ++ Bytef **next_out, unsigned int *avail_out) + { + Py_ssize_t allocated; + + allocated = _BlocksOutputBuffer_InitAndGrow( + buffer, max_length, (void**) next_out); +- *avail_out = (uint32_t) allocated; ++ *avail_out = (unsigned) allocated; + return allocated; + } + +@@ -42,24 +42,24 @@ OutputBuffer_InitAndGrow(_BlocksOutputBuffer *buffer, Py_ssize_t max_length, + On failure, return -1 */ + static inline Py_ssize_t + OutputBuffer_Grow(_BlocksOutputBuffer *buffer, +- Bytef **next_out, uint32_t *avail_out) ++ Bytef **next_out, unsigned int *avail_out) + { + Py_ssize_t allocated; + + allocated = _BlocksOutputBuffer_Grow( + buffer, (void**) next_out, (Py_ssize_t) *avail_out); +- *avail_out = (uint32_t) allocated; ++ *avail_out = (unsigned int) allocated; + return allocated; + } + + static inline Py_ssize_t +-OutputBuffer_GetDataSize(_BlocksOutputBuffer *buffer, uint32_t avail_out) ++OutputBuffer_GetDataSize(_BlocksOutputBuffer *buffer, unsigned int avail_out) + { + return _BlocksOutputBuffer_GetDataSize(buffer, (Py_ssize_t) avail_out); + } + + static inline PyObject * +-OutputBuffer_Finish(_BlocksOutputBuffer *buffer, uint32_t avail_out) ++OutputBuffer_Finish(_BlocksOutputBuffer *buffer, unsigned int avail_out) + { + return _BlocksOutputBuffer_Finish(buffer, (Py_ssize_t) avail_out); + } +@@ -97,7 +97,7 @@ typedef struct { + static inline Py_ssize_t + OutputBuffer_WindowInitWithSize(_BlocksOutputBuffer *buffer, _Uint32Window *window, + Py_ssize_t init_size, +- Bytef **next_out, uint32_t *avail_out) ++ Bytef **next_out, unsigned int *avail_out) + { + Py_ssize_t allocated = _BlocksOutputBuffer_InitWithSize( + buffer, init_size, (void**) next_out); +@@ -105,7 +105,7 @@ OutputBuffer_WindowInitWithSize(_BlocksOutputBuffer *buffer, _Uint32Window *wind + if (allocated >= 0) { + // the UINT32_MAX sliding window + Py_ssize_t window_size = Py_MIN((size_t)allocated, UINT32_MAX); +- *avail_out = (uint32_t) window_size; ++ *avail_out = (unsigned int) window_size; + + window->left_bytes = allocated - window_size; + window->next_posi = *next_out + window_size; +@@ -119,7 +119,7 @@ OutputBuffer_WindowInitWithSize(_BlocksOutputBuffer *buffer, _Uint32Window *wind + On failure, return value < 0 */ + static inline Py_ssize_t + OutputBuffer_WindowGrow(_BlocksOutputBuffer *buffer, _Uint32Window *window, +- Bytef **next_out, uint32_t *avail_out) ++ Bytef **next_out, unsigned int *avail_out) + { + Py_ssize_t allocated; + +@@ -136,7 +136,7 @@ OutputBuffer_WindowGrow(_BlocksOutputBuffer *buffer, _Uint32Window *window, + Py_ssize_t window_size = Py_MIN((size_t)window->left_bytes, UINT32_MAX); + + *next_out = window->next_posi; +- *avail_out = (uint32_t) window_size; ++ *avail_out = (unsigned int) window_size; + + window->left_bytes -= window_size; + window->next_posi += window_size; +@@ -148,7 +148,7 @@ OutputBuffer_WindowGrow(_BlocksOutputBuffer *buffer, _Uint32Window *window, + // only the first block may > UINT32_MAX + allocated = _BlocksOutputBuffer_Grow( + buffer, (void**) next_out, (Py_ssize_t) *avail_out); +- *avail_out = (uint32_t) allocated; ++ *avail_out = (unsigned int) allocated; + return allocated; + } + +@@ -158,7 +158,7 @@ OutputBuffer_WindowGrow(_BlocksOutputBuffer *buffer, _Uint32Window *window, + On failure, return NULL */ + static inline PyObject * + OutputBuffer_WindowFinish(_BlocksOutputBuffer *buffer, _Uint32Window *window, +- uint32_t avail_out) ++ unsigned avail_out) + { + Py_ssize_t real_avail_out = (Py_ssize_t) avail_out + window->left_bytes; + return _BlocksOutputBuffer_Finish(buffer, real_avail_out); +@@ -1398,7 +1398,7 @@ set_inflate_zdict_ZlibDecompressor(zlibstate *state, ZlibDecompressor *self) + } + + static Py_ssize_t +-arrange_output_buffer_with_maximum(uint32_t *avail_out, ++arrange_output_buffer_with_maximum(unsigned int *avail_out, + uint8_t **next_out, + PyObject **buffer, + Py_ssize_t length, +@@ -1430,7 +1430,7 @@ arrange_output_buffer_with_maximum(uint32_t *avail_out, + } + } + +- *avail_out = (uint32_t)Py_MIN((size_t)(length - occupied), UINT32_MAX); ++ *avail_out = (unsigned)Py_MIN((size_t)(length - occupied), UINT32_MAX); + *next_out = (uint8_t *)PyBytes_AS_STRING(*buffer) + occupied; + + return length; +diff --git a/Objects/typeobject.c b/Objects/typeobject.c +index c911c302003..9c640e0ab65 100644 +--- a/Objects/typeobject.c ++++ b/Objects/typeobject.c +@@ -5140,7 +5140,7 @@ is_dunder_name(PyObject *name) + static PyObject * + update_cache(struct type_cache_entry *entry, PyObject *name, unsigned int version_tag, PyObject *value) + { +- _Py_atomic_store_uint32_relaxed(&entry->version, version_tag); ++ _Py_atomic_store_uint32_relaxed((uint32_t*) &entry->version, version_tag); + _Py_atomic_store_ptr_relaxed(&entry->value, value); /* borrowed */ + assert(_PyASCIIObject_CAST(name)->hash != -1); + OBJECT_STAT_INC_COND(type_cache_collisions, entry->name != Py_None && entry->name != name); +-- +2.46.1 + diff --git a/interpreters/python/patch/0003-reuse-wasm_assets.py-for-generating-an-archive-of-py.patch b/interpreters/python/patch/0003-reuse-wasm_assets.py-for-generating-an-archive-of-py.patch new file mode 100644 index 00000000000..f8e03a2cfc0 --- /dev/null +++ b/interpreters/python/patch/0003-reuse-wasm_assets.py-for-generating-an-archive-of-py.patch @@ -0,0 +1,42 @@ +From 4af7a9b726ca2c8ac330b51f98acf0a103f6fa71 Mon Sep 17 00:00:00 2001 +From: Ivan Grokhotkov +Date: Wed, 23 Oct 2024 16:54:39 +0200 +Subject: [PATCH 03/10] reuse wasm_assets.py for generating an archive of + python lib dir + +wasm_assets.py is a useful script to prepare the smallest possible +package of pre-compiled python stdlib modules. There is very little +wasm-specific there. + +This patch adds nuttx to the supported OS list in the script, as well +as fixes what I think is a bug in path calculation. + +Co-authored-by: Tiago Medicci Serrano +--- + Tools/wasm/wasm_assets.py | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/Tools/wasm/wasm_assets.py b/Tools/wasm/wasm_assets.py +index ffa5e303412..381d4819c39 100755 +--- a/Tools/wasm/wasm_assets.py ++++ b/Tools/wasm/wasm_assets.py +@@ -99,6 +99,7 @@ + "_sysconfigdata__emscripten_wasm32-emscripten", + "_sysconfigdata__wasi_wasm32-wasi", + "_sysconfigdata__wasi_wasm64-wasi", ++ "_sysconfigdata__nuttx_" + ) + + +@@ -203,7 +204,7 @@ def main() -> None: + relative_prefix = args.prefix.relative_to(pathlib.Path("/")) + args.srcdir = SRCDIR + args.srcdir_lib = SRCDIR_LIB +- args.wasm_root = args.buildroot / relative_prefix ++ args.wasm_root = args.buildroot #/ relative_prefix + args.wasm_stdlib_zip = args.wasm_root / WASM_STDLIB_ZIP + args.wasm_stdlib = args.wasm_root / WASM_STDLIB + args.wasm_dynload = args.wasm_root / WASM_DYNLOAD +-- +2.46.1 + diff --git a/interpreters/python/patch/0004-recognize-nuttx-as-a-supported-OS.patch b/interpreters/python/patch/0004-recognize-nuttx-as-a-supported-OS.patch new file mode 100644 index 00000000000..6d8531ce66d --- /dev/null +++ b/interpreters/python/patch/0004-recognize-nuttx-as-a-supported-OS.patch @@ -0,0 +1,60 @@ +From 1bb8d824a4b4e4b38c3541b7c26c5d71f0970266 Mon Sep 17 00:00:00 2001 +From: Ivan Grokhotkov +Date: Wed, 23 Oct 2024 16:55:53 +0200 +Subject: [PATCH 04/10] recognize *-*-nuttx as a supported OS + +cpython's configure script bails out when cross-compiling for an +unknown OS, so we have to add "nuttx" to the list, even though it +is not used almost anywhere else. + +Co-authored-by: Tiago Medicci Serrano +--- + config.sub | 2 +- + configure | 3 +++ + configure.ac | 3 +++ + 3 files changed, 7 insertions(+), 1 deletion(-) + +diff --git a/config.sub b/config.sub +index 1bb6a05dc11..2a87d3e0ddb 100755 +--- a/config.sub ++++ b/config.sub +@@ -1769,7 +1769,7 @@ case $os in + | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ + | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ + | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \ +- | fiwix* | mlibc* | cos* | mbr* | ironclad* ) ++ | fiwix* | mlibc* | cos* | mbr* | ironclad* | nuttx* ) + ;; + # This one is extra strict with allowed versions + sco3.2v2 | sco3.2v[4-9]* | sco5v6*) +diff --git a/configure b/configure +index 7cdd386c387..6da5e9f3832 100755 +--- a/configure ++++ b/configure +@@ -4527,6 +4527,9 @@ printf "%s\n" "$IPHONEOS_DEPLOYMENT_TARGET" >&6; } + wasm32-*-* | wasm64-*-*) + _host_ident=$host_cpu + ;; ++ *-*-nuttx*) ++ _host_ident=$host_cpu ++ ;; + *) + # for now, limit cross builds to known configurations + MACHDEP="unknown" +diff --git a/configure.ac b/configure.ac +index 24e28a1e2de..80d6738fab5 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -777,6 +777,9 @@ if test "$cross_compiling" = yes; then + wasm32-*-* | wasm64-*-*) + _host_ident=$host_cpu + ;; ++ *-*-nuttx*) ++ _host_ident=$host_cpu ++ ;; + *) + # for now, limit cross builds to known configurations + MACHDEP="unknown" +-- +2.46.1 + diff --git a/interpreters/python/patch/0005-gh-122907-Fix-Builds-Without-HAVE_DYNAMIC_LOADING-Se.patch b/interpreters/python/patch/0005-gh-122907-Fix-Builds-Without-HAVE_DYNAMIC_LOADING-Se.patch new file mode 100644 index 00000000000..cf25d88c2bd --- /dev/null +++ b/interpreters/python/patch/0005-gh-122907-Fix-Builds-Without-HAVE_DYNAMIC_LOADING-Se.patch @@ -0,0 +1,189 @@ +From cd8af3cbc9881e5a4a7c0644c8844478c8d0245d Mon Sep 17 00:00:00 2001 +From: Eric Snow +Date: Tue, 13 Aug 2024 14:44:57 -0600 +Subject: [PATCH 05/10] gh-122907: Fix Builds Without HAVE_DYNAMIC_LOADING Set + (gh-122952) + +As of 529a160 (gh-118204), building with HAVE_DYNAMIC_LOADING stopped working. This is a minimal fix just to get builds working again. There are actually a number of long-standing deficiencies with HAVE_DYNAMIC_LOADING builds that need to be resolved separately. +(cherry picked from commit ee1b8ce26e700350e47a5f65201097121c41912e) + +Co-authored-by: Eric Snow +--- + Include/internal/pycore_importdl.h | 4 ++++ + Lib/importlib/_bootstrap_external.py | 16 ++++++++-------- + ...024-08-12-11-19-37.gh-issue-122907.q68096.rst | 3 +++ + Python/importdl.c | 12 ++++++++---- + Tools/build/check_extension_modules.py | 9 +++++++++ + 5 files changed, 32 insertions(+), 12 deletions(-) + create mode 100644 Misc/NEWS.d/next/Core_and_Builtins/2024-08-12-11-19-37.gh-issue-122907.q68096.rst + +diff --git a/Include/internal/pycore_importdl.h b/Include/internal/pycore_importdl.h +index e5f222b371a..525a16f6b97 100644 +--- a/Include/internal/pycore_importdl.h ++++ b/Include/internal/pycore_importdl.h +@@ -56,9 +56,11 @@ extern int _Py_ext_module_loader_info_init_for_core( + extern int _Py_ext_module_loader_info_init_for_builtin( + struct _Py_ext_module_loader_info *p_info, + PyObject *name); ++#ifdef HAVE_DYNAMIC_LOADING + extern int _Py_ext_module_loader_info_init_from_spec( + struct _Py_ext_module_loader_info *info, + PyObject *spec); ++#endif + + /* The result from running an extension module's init function. */ + struct _Py_ext_module_loader_result { +@@ -87,9 +89,11 @@ extern void _Py_ext_module_loader_result_apply_error( + + /* The module init function. */ + typedef PyObject *(*PyModInitFunction)(void); ++#ifdef HAVE_DYNAMIC_LOADING + extern PyModInitFunction _PyImport_GetModInitFunc( + struct _Py_ext_module_loader_info *info, + FILE *fp); ++#endif + extern int _PyImport_RunModInitFunc( + PyModInitFunction p0, + struct _Py_ext_module_loader_info *info, +diff --git a/Lib/importlib/_bootstrap_external.py b/Lib/importlib/_bootstrap_external.py +index 7742855e8b2..d8c61c92558 100644 +--- a/Lib/importlib/_bootstrap_external.py ++++ b/Lib/importlib/_bootstrap_external.py +@@ -1793,14 +1793,14 @@ def _get_supported_file_loaders(): + + Each item is a tuple (loader, suffixes). + """ +- if sys.platform in {"ios", "tvos", "watchos"}: +- extension_loaders = [(AppleFrameworkLoader, [ +- suffix.replace(".so", ".fwork") +- for suffix in _imp.extension_suffixes() +- ])] +- else: +- extension_loaders = [] +- extension_loaders.append((ExtensionFileLoader, _imp.extension_suffixes())) ++ extension_loaders = [] ++ if hasattr(_imp, 'create_dynamic'): ++ if sys.platform in {"ios", "tvos", "watchos"}: ++ extension_loaders = [(AppleFrameworkLoader, [ ++ suffix.replace(".so", ".fwork") ++ for suffix in _imp.extension_suffixes() ++ ])] ++ extension_loaders.append((ExtensionFileLoader, _imp.extension_suffixes())) + source = SourceFileLoader, SOURCE_SUFFIXES + bytecode = SourcelessFileLoader, BYTECODE_SUFFIXES + return extension_loaders + [source, bytecode] +diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2024-08-12-11-19-37.gh-issue-122907.q68096.rst b/Misc/NEWS.d/next/Core_and_Builtins/2024-08-12-11-19-37.gh-issue-122907.q68096.rst +new file mode 100644 +index 00000000000..88c872f4ef4 +--- /dev/null ++++ b/Misc/NEWS.d/next/Core_and_Builtins/2024-08-12-11-19-37.gh-issue-122907.q68096.rst +@@ -0,0 +1,3 @@ ++Building with ``HAVE_DYNAMIC_LOADING`` now works as well as it did in 3.12. ++Existing deficiences will be addressed separately. ++(See https://github.com/python/cpython/issues/122950.) +diff --git a/Python/importdl.c b/Python/importdl.c +index 7c42d37283c..b1a6fcc8223 100644 +--- a/Python/importdl.c ++++ b/Python/importdl.c +@@ -8,6 +8,8 @@ + #include "pycore_pystate.h" + #include "pycore_runtime.h" + ++#include "pycore_importdl.h" ++ + /* ./configure sets HAVE_DYNAMIC_LOADING if dynamic loading of modules is + supported on this platform. configure will then compile and link in one + of the dynload_*.c files, as appropriate. We will call a function in +@@ -15,8 +17,6 @@ + */ + #ifdef HAVE_DYNAMIC_LOADING + +-#include "pycore_importdl.h" +- + #ifdef MS_WINDOWS + extern dl_funcptr _PyImport_FindSharedFuncptrWindows(const char *prefix, + const char *shortname, +@@ -28,6 +28,8 @@ extern dl_funcptr _PyImport_FindSharedFuncptr(const char *prefix, + const char *pathname, FILE *fp); + #endif + ++#endif /* HAVE_DYNAMIC_LOADING */ ++ + + /***********************************/ + /* module info to use when loading */ +@@ -205,6 +207,7 @@ _Py_ext_module_loader_info_init_for_core( + return 0; + } + ++#ifdef HAVE_DYNAMIC_LOADING + int + _Py_ext_module_loader_info_init_from_spec( + struct _Py_ext_module_loader_info *p_info, +@@ -226,6 +229,7 @@ _Py_ext_module_loader_info_init_from_spec( + Py_DECREF(filename); + return err; + } ++#endif /* HAVE_DYNAMIC_LOADING */ + + + /********************************/ +@@ -372,6 +376,7 @@ _Py_ext_module_loader_result_apply_error( + /* getting/running the module init function */ + /********************************************/ + ++#ifdef HAVE_DYNAMIC_LOADING + PyModInitFunction + _PyImport_GetModInitFunc(struct _Py_ext_module_loader_info *info, + FILE *fp) +@@ -406,6 +411,7 @@ _PyImport_GetModInitFunc(struct _Py_ext_module_loader_info *info, + + return (PyModInitFunction)exportfunc; + } ++#endif /* HAVE_DYNAMIC_LOADING */ + + int + _PyImport_RunModInitFunc(PyModInitFunction p0, +@@ -513,5 +519,3 @@ _PyImport_RunModInitFunc(PyModInitFunction p0, + p_res->err = &p_res->_err; + return -1; + } +- +-#endif /* HAVE_DYNAMIC_LOADING */ +diff --git a/Tools/build/check_extension_modules.py b/Tools/build/check_extension_modules.py +index 7de35b499da..66b2a262e11 100644 +--- a/Tools/build/check_extension_modules.py ++++ b/Tools/build/check_extension_modules.py +@@ -27,6 +27,7 @@ + import sys + import sysconfig + import warnings ++import _imp + + from importlib._bootstrap import _load as bootstrap_load + from importlib.machinery import BuiltinImporter, ExtensionFileLoader, ModuleSpec +@@ -154,6 +155,11 @@ def __init__(self, cross_compiling: bool = False, strict: bool = False): + self.notavailable = [] + + def check(self): ++ if not hasattr(_imp, 'create_dynamic'): ++ logger.warning( ++ ('Dynamic extensions not supported ' ++ '(HAVE_DYNAMIC_LOADING not defined)'), ++ ) + for modinfo in self.modules: + logger.debug("Checking '%s' (%s)", modinfo.name, self.get_location(modinfo)) + if modinfo.state == ModuleState.DISABLED: +@@ -415,6 +421,9 @@ def check_module_import(self, modinfo: ModuleInfo): + logger.error("%s failed to import: %s", modinfo.name, e) + raise + except Exception as e: ++ if not hasattr(_imp, 'create_dynamic'): ++ logger.warning("Dynamic extension '%s' ignored", modinfo.name) ++ return + logger.exception("Importing extension '%s' failed!", modinfo.name) + raise + +-- +2.46.1 + diff --git a/interpreters/python/patch/0006-change-var-name-to-avoid-conflict-with-nuttx-unused_.patch b/interpreters/python/patch/0006-change-var-name-to-avoid-conflict-with-nuttx-unused_.patch new file mode 100644 index 00000000000..641233bf4eb --- /dev/null +++ b/interpreters/python/patch/0006-change-var-name-to-avoid-conflict-with-nuttx-unused_.patch @@ -0,0 +1,168 @@ +From d424766bff74fb34a80a09c6e2ed8d9b40350bb8 Mon Sep 17 00:00:00 2001 +From: Tiago Medicci +Date: Wed, 13 Nov 2024 14:20:36 -0300 +Subject: [PATCH 06/10] change var name to avoid conflict with nuttx + unused_data macro + +--- + Modules/zlibmodule.c | 42 +++++++++++++++++++++--------------------- + 1 file changed, 21 insertions(+), 21 deletions(-) + +diff --git a/Modules/zlibmodule.c b/Modules/zlibmodule.c +index 034a9420b16..595d4ad32e9 100644 +--- a/Modules/zlibmodule.c ++++ b/Modules/zlibmodule.c +@@ -213,7 +213,7 @@ typedef struct + { + PyObject_HEAD + z_stream zst; +- PyObject *unused_data; ++ PyObject *unused_data_var; + PyObject *unconsumed_tail; + char eof; + bool is_initialised; +@@ -267,8 +267,8 @@ newcompobject(PyTypeObject *type) + self->eof = 0; + self->is_initialised = 0; + self->zdict = NULL; +- self->unused_data = PyBytes_FromStringAndSize("", 0); +- if (self->unused_data == NULL) { ++ self->unused_data_var = PyBytes_FromStringAndSize("", 0); ++ if (self->unused_data_var == NULL) { + Py_DECREF(self); + return NULL; + } +@@ -708,7 +708,7 @@ Dealloc(compobject *self) + { + PyObject *type = (PyObject *)Py_TYPE(self); + PyThread_free_lock(self->lock); +- Py_XDECREF(self->unused_data); ++ Py_XDECREF(self->unused_data_var); + Py_XDECREF(self->unconsumed_tail); + Py_XDECREF(self->zdict); + PyObject_Free(self); +@@ -803,15 +803,15 @@ zlib_Compress_compress_impl(compobject *self, PyTypeObject *cls, + } + + /* Helper for objdecompress() and flush(). Saves any unconsumed input data in +- self->unused_data or self->unconsumed_tail, as appropriate. */ ++ self->unused_data_var or self->unconsumed_tail, as appropriate. */ + static int + save_unconsumed_input(compobject *self, Py_buffer *data, int err) + { + if (err == Z_STREAM_END) { + /* The end of the compressed data has been reached. Store the leftover +- input data in self->unused_data. */ ++ input data in self->unused_data_var. */ + if (self->zst.avail_in > 0) { +- Py_ssize_t old_size = PyBytes_GET_SIZE(self->unused_data); ++ Py_ssize_t old_size = PyBytes_GET_SIZE(self->unused_data_var); + Py_ssize_t new_size, left_size; + PyObject *new_data; + left_size = (Byte *)data->buf + data->len - self->zst.next_in; +@@ -824,10 +824,10 @@ save_unconsumed_input(compobject *self, Py_buffer *data, int err) + if (new_data == NULL) + return -1; + memcpy(PyBytes_AS_STRING(new_data), +- PyBytes_AS_STRING(self->unused_data), old_size); ++ PyBytes_AS_STRING(self->unused_data_var), old_size); + memcpy(PyBytes_AS_STRING(new_data) + old_size, + self->zst.next_in, left_size); +- Py_SETREF(self->unused_data, new_data); ++ Py_SETREF(self->unused_data_var, new_data); + self->zst.avail_in = 0; + } + } +@@ -1091,7 +1091,7 @@ zlib_Compress_copy_impl(compobject *self, PyTypeObject *cls) + zlib_error(state, self->zst, err, "while copying compression object"); + goto error; + } +- Py_XSETREF(return_value->unused_data, Py_NewRef(self->unused_data)); ++ Py_XSETREF(return_value->unused_data_var, Py_NewRef(self->unused_data_var)); + Py_XSETREF(return_value->unconsumed_tail, Py_NewRef(self->unconsumed_tail)); + Py_XSETREF(return_value->zdict, Py_XNewRef(self->zdict)); + return_value->eof = self->eof; +@@ -1176,7 +1176,7 @@ zlib_Decompress_copy_impl(compobject *self, PyTypeObject *cls) + goto error; + } + +- Py_XSETREF(return_value->unused_data, Py_NewRef(self->unused_data)); ++ Py_XSETREF(return_value->unused_data_var, Py_NewRef(self->unused_data_var)); + Py_XSETREF(return_value->unconsumed_tail, Py_NewRef(self->unconsumed_tail)); + Py_XSETREF(return_value->zdict, Py_XNewRef(self->zdict)); + return_value->eof = self->eof; +@@ -1341,7 +1341,7 @@ typedef struct { + z_stream zst; + PyObject *zdict; + PyThread_type_lock lock; +- PyObject *unused_data; ++ PyObject *unused_data_var; + uint8_t *input_buffer; + Py_ssize_t input_buffer_size; + /* zst>avail_in is only 32 bit, so we store the true length +@@ -1367,7 +1367,7 @@ ZlibDecompressor_dealloc(ZlibDecompressor *self) + inflateEnd(&self->zst); + } + PyMem_Free(self->input_buffer); +- Py_CLEAR(self->unused_data); ++ Py_CLEAR(self->unused_data_var); + Py_CLEAR(self->zdict); + PyObject_Free(self); + Py_DECREF(type); +@@ -1602,12 +1602,12 @@ decompress(ZlibDecompressor *self, uint8_t *data, + self->needs_input = 0; + + if (self->avail_in_real > 0) { +- PyObject *unused_data = PyBytes_FromStringAndSize( ++ PyObject *unused_data_var = PyBytes_FromStringAndSize( + (char *)self->zst.next_in, self->avail_in_real); +- if (unused_data == NULL) { ++ if (unused_data_var == NULL) { + goto error; + } +- Py_XSETREF(self->unused_data, unused_data); ++ Py_XSETREF(self->unused_data_var, unused_data_var); + } + } + else if (self->avail_in_real == 0) { +@@ -1671,7 +1671,7 @@ was less than *max_length* bytes, or because *max_length* was negative), + + Attempting to decompress data after the end of stream is reached raises an + EOFError. Any data found after the end of the stream is ignored and saved in +-the unused_data attribute. ++the unused_data_var attribute. + [clinic start generated code]*/ + + static PyObject * +@@ -1739,8 +1739,8 @@ ZlibDecompressor__new__(PyTypeObject *cls, + self->zst.zfree = PyZlib_Free; + self->zst.next_in = NULL; + self->zst.avail_in = 0; +- self->unused_data = PyBytes_FromStringAndSize(NULL, 0); +- if (self->unused_data == NULL) { ++ self->unused_data_var = PyBytes_FromStringAndSize(NULL, 0); ++ if (self->unused_data_var == NULL) { + Py_CLEAR(self); + return NULL; + } +@@ -1806,7 +1806,7 @@ static PyMethodDef ZlibDecompressor_methods[] = { + + #define COMP_OFF(x) offsetof(compobject, x) + static PyMemberDef Decomp_members[] = { +- {"unused_data", _Py_T_OBJECT, COMP_OFF(unused_data), Py_READONLY}, ++ {"unused_data_var", _Py_T_OBJECT, COMP_OFF(unused_data_var), Py_READONLY}, + {"unconsumed_tail", _Py_T_OBJECT, COMP_OFF(unconsumed_tail), Py_READONLY}, + {"eof", Py_T_BOOL, COMP_OFF(eof), Py_READONLY}, + {NULL}, +@@ -1824,7 +1824,7 @@ PyDoc_STRVAR(ZlibDecompressor_needs_input_doc, + static PyMemberDef ZlibDecompressor_members[] = { + {"eof", Py_T_BOOL, offsetof(ZlibDecompressor, eof), + Py_READONLY, ZlibDecompressor_eof__doc__}, +- {"unused_data", Py_T_OBJECT_EX, offsetof(ZlibDecompressor, unused_data), ++ {"unused_data_var", Py_T_OBJECT_EX, offsetof(ZlibDecompressor, unused_data_var), + Py_READONLY, ZlibDecompressor_unused_data__doc__}, + {"needs_input", Py_T_BOOL, offsetof(ZlibDecompressor, needs_input), Py_READONLY, + ZlibDecompressor_needs_input_doc}, +-- +2.46.1 + diff --git a/interpreters/python/patch/0007-undef-atexit_register.patch b/interpreters/python/patch/0007-undef-atexit_register.patch new file mode 100644 index 00000000000..266f704a946 --- /dev/null +++ b/interpreters/python/patch/0007-undef-atexit_register.patch @@ -0,0 +1,29 @@ +From 1b802bfd159a6a9766ca5834af90f55d54285b4b Mon Sep 17 00:00:00 2001 +From: Tiago Medicci +Date: Wed, 13 Nov 2024 14:22:04 -0300 +Subject: [PATCH 07/10] undef atexit_register + +Even if not built, nuttx/include/nuttx/atexit.h defines it and this +causes conflicts. +--- + Modules/atexitmodule.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/Modules/atexitmodule.c b/Modules/atexitmodule.c +index 297a8d74ba3..1fea72fbc99 100644 +--- a/Modules/atexitmodule.c ++++ b/Modules/atexitmodule.c +@@ -175,6 +175,10 @@ Register a function to be executed upon normal program termination\n\ + \n\ + func is returned to facilitate usage as a decorator."); + ++#ifdef atexit_register ++# undef atexit_register ++#endif ++ + static PyObject * + atexit_register(PyObject *module, PyObject *args, PyObject *kwargs) + { +-- +2.46.1 + diff --git a/interpreters/python/patch/0008-declare-struct-timeval.patch b/interpreters/python/patch/0008-declare-struct-timeval.patch new file mode 100644 index 00000000000..bb8d3cb43d8 --- /dev/null +++ b/interpreters/python/patch/0008-declare-struct-timeval.patch @@ -0,0 +1,27 @@ +From b40e89c190ec7c6b3b0116a3f7025ab13854398f Mon Sep 17 00:00:00 2001 +From: Tiago Medicci +Date: Wed, 13 Nov 2024 14:23:34 -0300 +Subject: [PATCH 08/10] declare struct timeval + +Otherwise, build will fail due to redefinition of _PyTime_FromTimeval +--- + Include/internal/pycore_time.h | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/Include/internal/pycore_time.h b/Include/internal/pycore_time.h +index 205ac5d3781..c30e07f4b4a 100644 +--- a/Include/internal/pycore_time.h ++++ b/Include/internal/pycore_time.h +@@ -58,9 +58,7 @@ extern "C" { + #endif + + +-#ifdef __clang__ + struct timeval; +-#endif + + #define _SIZEOF_PYTIME_T 8 + +-- +2.46.1 + diff --git a/interpreters/python/patch/0009-include-nuttx-sys-select-header-to-define-FD_SETSIZE.patch b/interpreters/python/patch/0009-include-nuttx-sys-select-header-to-define-FD_SETSIZE.patch new file mode 100644 index 00000000000..b52b76be1b2 --- /dev/null +++ b/interpreters/python/patch/0009-include-nuttx-sys-select-header-to-define-FD_SETSIZE.patch @@ -0,0 +1,27 @@ +From 9a32a300c95e0061220d2608a014c7fa39dedab3 Mon Sep 17 00:00:00 2001 +From: Tiago Medicci +Date: Thu, 14 Nov 2024 13:44:49 -0300 +Subject: [PATCH 09/10] include nuttx sys/select header to define FD_SETSIZE + +--- + Modules/selectmodule.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c +index 5bd9b7732a4..e9fab839122 100644 +--- a/Modules/selectmodule.c ++++ b/Modules/selectmodule.c +@@ -63,6 +63,10 @@ extern void bzero(void *, int); + #include + #endif + ++#ifdef HAVE_SYS_SELECT_H ++#include ++#endif ++ + #ifdef MS_WINDOWS + # ifndef WIN32_LEAN_AND_MEAN + # define WIN32_LEAN_AND_MEAN +-- +2.46.1 + diff --git a/interpreters/python/patch/0010-check-for-the-d_ino-member-of-the-structure-dirent.patch b/interpreters/python/patch/0010-check-for-the-d_ino-member-of-the-structure-dirent.patch new file mode 100644 index 00000000000..d65b1f287c6 --- /dev/null +++ b/interpreters/python/patch/0010-check-for-the-d_ino-member-of-the-structure-dirent.patch @@ -0,0 +1,173 @@ +From 4f6a1db85c56df378dc3856ed95a0a7342f44d89 Mon Sep 17 00:00:00 2001 +From: Tiago Medicci +Date: Tue, 3 Dec 2024 17:18:50 -0300 +Subject: [PATCH 10/10] check for the d_ino member of the structure dirent + +--- + Modules/posixmodule.c | 18 ++++++++++++++++-- + configure | 43 +++++++++++++++++++++++++++++++++++++++++++ + configure.ac | 5 +++++ + pyconfig.h.in | 3 +++ + 4 files changed, 67 insertions(+), 2 deletions(-) + +diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c +index 51e34b5f4b7..2aa507aa942 100644 +--- a/Modules/posixmodule.c ++++ b/Modules/posixmodule.c +@@ -15522,7 +15522,9 @@ typedef struct { + #ifdef HAVE_DIRENT_D_TYPE + unsigned char d_type; + #endif ++#ifdef HAVE_DIRENT_D_INO + ino_t d_ino; ++#endif + int dir_fd; + #endif + } DirEntry; +@@ -15821,6 +15823,7 @@ os.DirEntry.inode + Return inode of the entry; cached per entry. + [clinic start generated code]*/ + ++#ifdef HAVE_DIRENT_D_INO + static PyObject * + os_DirEntry_inode_impl(DirEntry *self) + /*[clinic end generated code: output=156bb3a72162440e input=3ee7b872ae8649f0]*/ +@@ -15856,6 +15859,7 @@ os_DirEntry_inode_impl(DirEntry *self) + return PyLong_FromUnsignedLongLong(self->d_ino); + #endif + } ++#endif + + static PyObject * + DirEntry_repr(DirEntry *self) +@@ -15892,7 +15896,9 @@ static PyMethodDef DirEntry_methods[] = { + OS_DIRENTRY_IS_SYMLINK_METHODDEF + OS_DIRENTRY_IS_JUNCTION_METHODDEF + OS_DIRENTRY_STAT_METHODDEF ++#ifdef HAVE_DIRENT_D_INO + OS_DIRENTRY_INODE_METHODDEF ++#endif + OS_DIRENTRY___FSPATH___METHODDEF + {"__class_getitem__", Py_GenericAlias, + METH_O|METH_CLASS, PyDoc_STR("See PEP 585")}, +@@ -16043,7 +16049,10 @@ join_path_filename(const char *path_narrow, const char* filename, Py_ssize_t fil + + static PyObject * + DirEntry_from_posix_info(PyObject *module, path_t *path, const char *name, +- Py_ssize_t name_len, ino_t d_ino ++ Py_ssize_t name_len ++#ifdef HAVE_DIRENT_D_INO ++ , ino_t d_ino ++#endif + #ifdef HAVE_DIRENT_D_TYPE + , unsigned char d_type + #endif +@@ -16095,7 +16104,9 @@ DirEntry_from_posix_info(PyObject *module, path_t *path, const char *name, + #ifdef HAVE_DIRENT_D_TYPE + entry->d_type = d_type; + #endif ++#ifdef HAVE_DIRENT_D_INO + entry->d_ino = d_ino; ++#endif + + return (PyObject *)entry; + +@@ -16248,7 +16259,10 @@ ScandirIterator_iternext(ScandirIterator *iterator) + PyObject *module = PyType_GetModule(Py_TYPE(iterator)); + entry = DirEntry_from_posix_info(module, + &iterator->path, direntp->d_name, +- name_len, direntp->d_ino ++ name_len ++#ifdef HAVE_DIRENT_D_INO ++ , direntp->d_ino ++#endif + #ifdef HAVE_DIRENT_D_TYPE + , direntp->d_type + #endif +diff --git a/configure b/configure +index 6da5e9f3832..c89beb7ef6a 100755 +--- a/configure ++++ b/configure +@@ -27746,6 +27746,49 @@ then : + printf "%s\n" "#define HAVE_DIRENT_D_TYPE 1" >>confdefs.h + + ++fi ++ ++# check if the dirent structure of a d_ino is defined ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the dirent structure of a d_ino field" >&5 ++printf %s "checking if the dirent structure of a d_ino field... " >&6; } ++if test ${ac_cv_dirent_d_ino+y} ++then : ++ printf %s "(cached) " >&6 ++else $as_nop ++ ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++ ++ #include ++ ++ int main(void) { ++ struct dirent entry; ++ return entry.d_ino == 0; ++ } ++ ++ ++_ACEOF ++if ac_fn_c_try_link "$LINENO" ++then : ++ ac_cv_dirent_d_ino=yes ++else $as_nop ++ ac_cv_dirent_d_ino=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.beam \ ++ conftest$ac_exeext conftest.$ac_ext ++ ++fi ++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_dirent_d_ino" >&5 ++printf "%s\n" "$ac_cv_dirent_d_ino" >&6; } ++ ++if test "x$ac_cv_dirent_d_ino" = xyes ++then : ++ ++ ++printf "%s\n" "#define HAVE_DIRENT_D_INO 1" >>confdefs.h ++ ++ + fi + + # check if the Linux getrandom() syscall is available +diff --git a/configure.ac b/configure.ac +index 80d6738fab5..40f2f950b36 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -7084,6 +7084,11 @@ AS_VAR_IF([ac_cv_dirent_d_type], [yes], [ + [Define to 1 if the dirent structure has a d_type field]) + ]) + ++AS_VAR_IF([ac_cv_dirent_d_ino], [yes], [ ++ AC_DEFINE([HAVE_DIRENT_D_INO], [1], ++ [Define to 1 if the dirent structure has a d_ino field]) ++]) ++ + # check if the Linux getrandom() syscall is available + AC_CACHE_CHECK([for the Linux getrandom() syscall], [ac_cv_getrandom_syscall], [ + AC_LINK_IFELSE( +diff --git a/pyconfig.h.in b/pyconfig.h.in +index 4d8b1d4f254..4a2ba83a872 100644 +--- a/pyconfig.h.in ++++ b/pyconfig.h.in +@@ -277,6 +277,9 @@ + /* Define to 1 if the dirent structure has a d_type field */ + #undef HAVE_DIRENT_D_TYPE + ++/* Define to 1 if the dirent structure has a d_ino field */ ++#undef HAVE_DIRENT_D_INO ++ + /* Define to 1 if you have the header file, and it defines `DIR'. + */ + #undef HAVE_DIRENT_H +-- +2.46.1 + From f1ae5f32f53dbe059814507654c82cadce0538f2 Mon Sep 17 00:00:00 2001 From: wangmingrong1 Date: Mon, 2 Dec 2024 16:33:08 +0800 Subject: [PATCH 033/391] mtetest: Add a series of tests for the mte instruction set MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added basic mte instructions, ldg, stg, irg, gmi instruction tests ➜ NX git:(master) ✗ qemu-system-aarch64 -cpu max -nographic \ -machine virt,virtualization=on,gic-version=3,mte=on \ -chardev stdio,id=con,mux=on, -serial chardev:con \ -mon chardev=con,mode=readline -kernel ./nuttx/nuttx - Ready to Boot Primary CPU - Boot from EL2 - Boot from EL1 - Boot to C runtime for OS Initialize NuttShell (NSH) nsh> nsh> nsh> mtetest Spawning process for test: mtetest1 Running test: mtetest1 Test 'mtetest1' completed Spawning process for test: mtetest2 Running test: mtetest2 Test 'mtetest2' completed Spawning process for test: mtetest3 Running test: mtetest3 Test 'mtetest3' completed Spawning process for test: mtetest4 Running test: mtetest4 Test 'mtetest4' completed Spawning process for test: mtetest5 Running test: mtetest5 Test 'mtetest5' completed All tests completed. nsh> Signed-off-by: wangmingrong1 --- testing/mtetest/CMakeLists.txt | 23 ++ testing/mtetest/Kconfig | 11 + testing/mtetest/Make.defs | 23 ++ testing/mtetest/Makefile | 28 +++ testing/mtetest/mtetest.c | 371 +++++++++++++++++++++++++++++++++ 5 files changed, 456 insertions(+) create mode 100644 testing/mtetest/CMakeLists.txt create mode 100644 testing/mtetest/Kconfig create mode 100644 testing/mtetest/Make.defs create mode 100644 testing/mtetest/Makefile create mode 100644 testing/mtetest/mtetest.c diff --git a/testing/mtetest/CMakeLists.txt b/testing/mtetest/CMakeLists.txt new file mode 100644 index 00000000000..a3a9737b812 --- /dev/null +++ b/testing/mtetest/CMakeLists.txt @@ -0,0 +1,23 @@ +# ############################################################################## +# apps/testing/mtetest/CMakeLists.txt +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_TESTING_MTE) + nuttx_add_application(NAME mtetest COMPILE_FLAGS ${CFLAGS} SRCS mtetest.c) +endif() diff --git a/testing/mtetest/Kconfig b/testing/mtetest/Kconfig new file mode 100644 index 00000000000..e4574d58149 --- /dev/null +++ b/testing/mtetest/Kconfig @@ -0,0 +1,11 @@ +# +# For a description of the syntax of this configuration file, +# see the file kconfig-language.txt in the NuttX tools repository. +# + +config TESTING_MTE + tristate "MTE instruction set test" + depends on ARM64_MTE + default n + ---help--- + Enable MTE instruction set test diff --git a/testing/mtetest/Make.defs b/testing/mtetest/Make.defs new file mode 100644 index 00000000000..e927e21187a --- /dev/null +++ b/testing/mtetest/Make.defs @@ -0,0 +1,23 @@ +############################################################################ +# apps/testing/mtetest/Make.defs +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +ifneq ($(CONFIG_TESTING_MTE),) +CONFIGURED_APPS += $(APPDIR)/testing/mtetest +endif diff --git a/testing/mtetest/Makefile b/testing/mtetest/Makefile new file mode 100644 index 00000000000..b95a2a04fb7 --- /dev/null +++ b/testing/mtetest/Makefile @@ -0,0 +1,28 @@ +############################################################################ +# apps/testing/mtetest/Makefile +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +include $(APPDIR)/Make.defs + +MAINSRC = mtetest.c +PROGNAME = mtetest +PRIORITY = $(CONFIG_TESTING_KASAN_PRIORITY) +STACKSIZE = $(CONFIG_DEFAULT_TASK_STACKSIZE) + +include $(APPDIR)/Application.mk diff --git a/testing/mtetest/mtetest.c b/testing/mtetest/mtetest.c new file mode 100644 index 00000000000..a08ef382583 --- /dev/null +++ b/testing/mtetest/mtetest.c @@ -0,0 +1,371 @@ +/**************************************************************************** + * apps/testing/mtetest/mtetest.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include + +#include +#include +#include +#include +#include +#include + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#define MTETEST_BUFFER_LEN 512 + +struct mte_test_s +{ + FAR const char *name; + FAR void (*func)(void); +}; + +/**************************************************************************** + * Private Function Prototypes + ****************************************************************************/ + +static void mtetest1(void); +static void mtetest2(void); +static void mtetest3(void); +static void mtetest4(void); +static void mtetest5(void); + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +/* The instruction requires a 16-byte aligned memory block. */ + +static aligned_data(16) char g_buffer[MTETEST_BUFFER_LEN]; + +static const struct mte_test_s g_mtetest[] = +{ + { "mtetest1", mtetest1 }, + { "mtetest2", mtetest2 }, + { "mtetest3", mtetest3 }, + { "mtetest4", mtetest4 }, + { "mtetest5", mtetest5 }, + { NULL, NULL } +}; + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: tagset + * + * Description: + * Applies tags to a memory block starting from the pointer `p` for a + * given size (`size`). The function iterates through the memory in + * 16-byte chunks and uses the `stg` (store tag) instruction to assign + * a tag to each address. + * + * - `p`: The starting pointer to the memory block. + * - `size`: The size of the memory block (in bytes) to tag. + * + * The function uses inline assembly to store the tag at each memory + * location in the specified region, ensuring that the entire block is + * tagged. + ****************************************************************************/ + +static void __attribute__((noinline)) tagset(void *p, size_t size) +{ + size_t i; + for (i = 0; i < size; i += 16) + { + asm("stg %0, [%0]" : : "r"(p + i)); + } +} + +/**************************************************************************** + * Name: tagcheck + * + * Description: + * Verifies the consistency of tags in memory block starting from ptr `p` + * for the given `size`. The function checks each 16-byte chunk using the + * `ldg` (load tag) instruction to load the tag and compares it with the + * original pointer `p` to ensure consistency. + * + * - `p`: The starting pointer to the memory block. + * - `size`: The size of the memory block (in bytes) to check for + * tag consistency. + * + * The function loads the tag for each chunk and ensures that the tag + * matches the expected value. If the tag does not match, the function + * triggers an assertion failure, providing a mechanism to validate + * correct memory tagging and access. + ****************************************************************************/ + +static void __attribute__((noinline)) tagcheck(void *p, size_t size) +{ + size_t i; + void *c; + + for (i = 0; i < size; i += 16) + { + asm("ldg %0, [%1]" : "=r"(c) : "r"(p + i), "0"(p)); + assert(c == p); + } +} + +/**************************************************************************** + * Name: mtetest1 + * + * Description: + * 1. Initializes the pointer `p0` to point to `g_buffer`, which is assumed + * to contain enough data. + * 2. Uses the assembly instruction `irg` to create a tagged pointer `p1` + * from `p0`. Asserts that `p1` is not equal to `p0`, confirming the + * tagging operation worked. + * 3. Uses the assembly instruction `subp` to calculate the difference + * between `p0` and `p1`, storing it in `c`. Asserts that `c` is zero, + * confirming that `p1` and `p0` are the same address. + * 4. Uses `stg` to store the tag from `p1` at the address of `p1`. + * 5. Uses `ldg` to load the tag from `p0` into `p2`. Asserts that `p1` + * and `p2` are equal, confirming the tag stored at `p0` is correctly + * retrieved into `p2`. + ****************************************************************************/ + +static void mtetest1(void) +{ + long c; + int *p0; + int *p1; + int *p2; + + p0 = (int *)g_buffer; + + asm("irg %0,%1,%2" : "=r"(p1) : "r"(p0), "r"(1l)); + assert(p1 != p0); + + asm("subp %0,%1,%2" : "=r"(c) : "r"(p0), "r"(p1)); + assert(c == 0); + + asm("stg %0, [%0]" : : "r"(p1)); + asm("ldg %0, [%1]" : "=r"(p2) : "r"(p0), "0"(p0)); + assert(p1 == p2); +} + +/**************************************************************************** + * Name: mtetest2 + * + * Description: + * 1. Initializes the pointer `p0` to point to `g_buffer`, which is assumed + * to contain sufficient data. + * 2. Uses the assembly instruction `irg` to create a tagged pointer `p1` + * from `p0` using `excl`. The `gmi` instruction is used to modify `excl`, + * and asserts that `excl` is different from 1, confirming the change. + * 3. Creates a second tagged pointer `p2` using the modified `excl` and + * asserts that `p1` and `p2` are different, validating that two distinct + * tagged pointers are created. + ****************************************************************************/ + +static void mtetest2(void) +{ + long excl = 1; + int *p0; + int *p1; + int *p2; + + p0 = (int *)g_buffer; + + /* Create two differently tagged pointers. */ + + asm("irg %0,%1,%2" : "=r"(p1) : "r"(p0), "r"(excl)); + asm("gmi %0,%1,%0" : "+r"(excl) : "r" (p1)); + assert(excl != 1); + + asm("irg %0,%1,%2" : "=r"(p2) : "r"(p0), "r"(excl)); + assert(p1 != p2); +} + +/**************************************************************************** + * Name: mtetest3 + * + * Description: + * 1. Initializes `p0` to point to `g_buffer`, which is assumed to contain + * enough data. + * 2. Uses the assembly instruction `irg` to create a tagged pointer `p1` + * from `p0`. It then uses `gmi` to modify the `excl` value, ensuring it + * is different from 1 (validated by an `assert`). + * 3. Uses `irg` again to create a tagged pointer `p2` from `p0`. Asserts + * that `p1` and `p2` are different, validating the creation of two + * distinct tagged pointers. + * 4. Stores the tag from the first pointer (`p1`) using the assembly + * instruction `stg`. + * 5. Stores the value at `p1` using the assembly instruction `str`, followed + * by a `yield` to allow other tasks to execute. + ****************************************************************************/ + +static void mtetest3(void) +{ + long excl = 1; + int *p0; + int *p1; + int *p2; + + p0 = (int *)g_buffer; + + /* Create two differently tagged pointers. */ + + asm("irg %0,%1,%2" : "=r"(p1) : "r"(p0), "r"(excl)); + asm("gmi %0,%1,%0" : "+r"(excl) : "r" (p1)); + assert(excl != 1); + + asm("irg %0,%1,%2" : "=r"(p2) : "r"(p0), "r"(excl)); + assert(p1 != p2); + + /* Store the tag from the first pointer. */ + + asm("stg %0, [%0]" : : "r"(p1)); + asm("str %0, [%0]; yield" : : "r"(p1)); +} + +/**************************************************************************** + * Name: mtetest4 + * + * Description: + * 1. Initializes the pointer `p0` to point to `g_buffer`, which is assumed + * to contain sufficient data. + * 2. Uses the assembly instruction `irg` (likely a custom instruction) to + * process `p0` and `excl`, storing the result in `p1`. + * 3. Calls the `tagset` function with `p1` and `MTETEST_BUFFER_LEN` to set + * tags for the buffer. + * 4. Calls the `tagcheck` function with `p1` and `MTETEST_BUFFER_LEN` to + * verify the tags for the buffer. + ****************************************************************************/ + +static void mtetest4(void) +{ + long excl = 1; + int *p0; + int *p1; + + p0 = (int *)g_buffer; + + /* Tag the pointer. */ + + asm("irg %0,%1,%2" : "=r"(p1) : "r"(p0), "r"(excl)); + + tagset(p1, MTETEST_BUFFER_LEN); + tagcheck(p1, MTETEST_BUFFER_LEN); +} + +/**************************************************************************** + * Name: mtetest5 + * + * Description: + * 1. Initializes the pointer `p0` to point to `g_buffer`, which is assumed + * to contain enough data. + * 2. Uses the assembly instruction `irg` (possibly a custom instruction) + * to process `p0` and `excl`, storing the result in `p1`. + * 3. Uses the assembly instruction `stg` to store data at the address + * `p0 + 16`. + * 4. Uses standard C syntax to assign the value 1 to the address `p0 + 16`. + * 5. Uses the assembly instruction `stg` to store data at the address + * `p1 + 16`. + * 6. Uses `assert` to verify that the value at `p1 + 16` is 1, ensuring + * that the assignment was successful. + ****************************************************************************/ + +static void mtetest5(void) +{ + long excl = 1; + int *p0; + int *p1; + + p0 = (int *)g_buffer; + + /* Tag the pointer. */ + + asm("irg %0,%1,%2" : "=r"(p1) : "r"(p0), "r"(excl)); + + /* Assign value 1 to the address p0 + 16 */ + + asm("stg %0, [%0]" : : "r"(p0 + 16)); + *(p0 + 16) = 1; + + asm("stg %0, [%0]" : : "r"(p1 + 16)); + assert(1 == *(p1 + 16)); +} + +static void spawn_test_process(const struct mte_test_s *test) +{ + char *args[3]; + int status; + pid_t pid; + + args[0] = "mtetest"; + args[1] = (char *)test->name; + args[2] = NULL; + + if (posix_spawn(&pid, "mtetest", NULL, NULL, args, environ) != 0) + { + perror("posix_spawn"); + return; + } + + waitpid(pid, &status, 0); + printf("Test '%s' completed\n", test->name); +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +int main(int argc, char *argv[]) +{ + int i; + + if (argc < 2) + { + /* Loop through the tests and spawn a process for each one */ + + for (i = 0; g_mtetest[i].name != NULL; i++) + { + printf("Spawning process for test: %s\n", g_mtetest[i].name); + spawn_test_process(&g_mtetest[i]); + } + + printf("All tests completed.\n"); + } + else + { + for (i = 0; g_mtetest[i].name != NULL; i++) + { + if (strcmp(argv[1], g_mtetest[i].name) == 0) + { + printf("Running test: %s\n", g_mtetest[i].name); + g_mtetest[i].func(); + break; + } + } + } + + return 0; +} From f2e5d5c13f16addd3f0edca203a1653b68449056 Mon Sep 17 00:00:00 2001 From: Eren Terzioglu Date: Wed, 20 Nov 2024 13:03:29 +0100 Subject: [PATCH 034/391] apps/nxdiag: Add dignostic info logging support during build on nxdiag example for Espressif devices --- system/nxdiag/Kconfig | 6 ++++ system/nxdiag/Makefile | 4 +++ tools/host_sysinfo.py | 81 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 91 insertions(+) diff --git a/system/nxdiag/Kconfig b/system/nxdiag/Kconfig index ceec711f8dd..904c9c08ed9 100644 --- a/system/nxdiag/Kconfig +++ b/system/nxdiag/Kconfig @@ -74,4 +74,10 @@ config SYSTEM_NXDIAG_ESPRESSIF_CHIP ---help--- Enable Espressif-specific information about chip. Chip must be connected during build process. +config SYSTEM_NXDIAG_ESPRESSIF_VERBOSE + bool "Espressif Verbose" + default n + ---help--- + Enable printing Espressif-specific information about chip during build. + endif # SYSTEM_NXDIAG diff --git a/system/nxdiag/Makefile b/system/nxdiag/Makefile index 0da0a0a84b1..e757901a877 100644 --- a/system/nxdiag/Makefile +++ b/system/nxdiag/Makefile @@ -93,6 +93,10 @@ ifeq ($(CONFIG_SYSTEM_NXDIAG_ESPRESSIF_CHIP),y) NXDIAG_FLAGS += --espressif_chip endif +ifeq ($(CONFIG_SYSTEM_NXDIAG_ESPRESSIF_VERBOSE),y) +NXDIAG_FLAGS += --espressif_verbose +endif + endif # Common build diff --git a/tools/host_sysinfo.py b/tools/host_sysinfo.py index 2d25a0e0fda..65479d780c9 100755 --- a/tools/host_sysinfo.py +++ b/tools/host_sysinfo.py @@ -234,6 +234,56 @@ def get_espressif_hal_version(hal_dir): return hal_version +def espressif_verbose(info, esp_logs): + """ + Prepare and print information on build screen. + + Args: + info (dict): Information dictionary of build system. + esp_logs (str): Information string of espressif specific features. + + Returns: + None. + """ + esp_verbose = "=" * 79 + "\n" + + esp_verbose += "NuttX RTOS info: {}\n\n".format(info["OS_VERSION"]) + if args.flags: + esp_verbose += "NuttX CFLAGS: {}\n\n".format(info["NUTTX_CFLAGS"]) + esp_verbose += "NuttX CXXFLAGS: {}\n\n".format(info["NUTTX_CXXFLAGS"]) + esp_verbose += "NuttX LDFLAGS: {}\n\n".format(info["NUTTX_LDFLAGS"]) + + if args.config: + esp_verbose += "NuttX configuration options: \n" + for i in range(len(info["NUTTX_CONFIG"])): + esp_verbose += " " + info["NUTTX_CONFIG"][i].replace('"', '\\"') + "\n" + esp_verbose += "\n\n" + + if args.path: + esp_verbose += "Host system PATH: \n" + for i in range(len(info["SYSTEM_PATH"])): + esp_verbose += " " + info["SYSTEM_PATH"][i] + "\n" + esp_verbose += "\n\n" + + if args.packages: + esp_verbose += "Host system installed packages: \n" + for i in range(len(info["INSTALLED_PACKAGES"])): + esp_verbose += " " + info["INSTALLED_PACKAGES"][i] + "\n" + esp_verbose += "\n\n" + + if args.modules: + esp_verbose += "Host system installed python modules: \n" + for i in range(len(info["PYTHON_MODULES"])): + esp_verbose += " " + info["PYTHON_MODULES"][i] + "\n" + esp_verbose += "\n\n" + + esp_verbose += "Espressif specific information: \n\n" + esp_verbose += esp_logs + esp_verbose += "=" * 79 + "\n" + + eprint(esp_verbose) + + # Common functions # @@ -602,9 +652,12 @@ def generate_header(args): len(info["ESPRESSIF_BOOTLOADER"]) ) output += "static const char *ESPRESSIF_BOOTLOADER[ESPRESSIF_BOOTLOADER_ARRAY_SIZE] =\n{\n" + build_output = "Bootloader version:\n" for key, value in info["ESPRESSIF_BOOTLOADER"].items(): output += ' "{}: {}",\n'.format(key, value) + build_output += " {}: {},\n".format(key, value) output += "};\n\n" + build_output += "\n\n" # Espressif toolchain version @@ -613,9 +666,12 @@ def generate_header(args): len(info["ESPRESSIF_TOOLCHAIN"]) ) output += "static const char *ESPRESSIF_TOOLCHAIN[ESPRESSIF_TOOLCHAIN_ARRAY_SIZE] =\n{\n" + build_output += "Toolchain version:\n" for key, value in info["ESPRESSIF_TOOLCHAIN"].items(): output += ' "{}: {}",\n'.format(key, value) + build_output += " {}: {},\n".format(key, value) output += "};\n\n" + build_output += "\n\n" # Espressif esptool version @@ -625,6 +681,9 @@ def generate_header(args): output += 'static const char ESPRESSIF_ESPTOOL[] = "{}";\n\n'.format( info["ESPRESSIF_ESPTOOL"].split("-")[1] ) + build_output += "Esptool version: {}\n\n".format( + info["ESPRESSIF_ESPTOOL"].split("-")[1] + ) # Espressif HAL version @@ -632,40 +691,53 @@ def generate_header(args): output += 'static const char ESPRESSIF_HAL[] = "{}";\n\n'.format( info["ESPRESSIF_HAL"] ) + build_output += "HAL version: {}\n\n".format(info["ESPRESSIF_HAL"]) if args.espressif_chip and info["ESPRESSIF_ESPTOOL"] not in "Not found": info["ESPRESSIF_CHIP_ID"] = get_espressif_chip_id() output += 'static const char ESPRESSIF_CHIP_ID[] = "{}";\n\n'.format( info["ESPRESSIF_CHIP_ID"] ) + build_output += "CHIP ID: = {}\n\n".format(info["ESPRESSIF_CHIP_ID"]) info["ESPRESSIF_FLASH_ID"] = get_espressif_flash_id() output += "#define ESPRESSIF_FLASH_ID_ARRAY_SIZE {}\n".format( len(info["ESPRESSIF_FLASH_ID"]) ) output += "static const char *ESPRESSIF_FLASH_ID[ESPRESSIF_FLASH_ID_ARRAY_SIZE] =\n{\n" + build_output += "Flash ID:\n" for each_item in info["ESPRESSIF_FLASH_ID"]: output += ' "{}",\n'.format(each_item) + build_output += " {}\n".format(each_item) output += "};\n\n" + build_output += "\n\n" info["ESPRESSIF_SECURITY_INFO"] = get_espressif_security_info() output += "#define ESPRESSIF_SECURITY_INFO_ARRAY_SIZE {}\n".format( len(info["ESPRESSIF_SECURITY_INFO"]) ) output += "static const char *ESPRESSIF_SECURITY_INFO[ESPRESSIF_SECURITY_INFO_ARRAY_SIZE] =\n{\n" + build_output += "Security information: \n" for each_item in info["ESPRESSIF_SECURITY_INFO"]: output += ' "{}",\n'.format(each_item) + build_output += " {}\n".format(each_item) output += "};\n\n" + build_output += "\n\n" info["ESPRESSIF_FLASH_STAT"] = get_espressif_flash_status() output += 'static const char ESPRESSIF_FLASH_STAT[] = "{}";\n\n'.format( info["ESPRESSIF_FLASH_STAT"] ) + build_output += "Flash status: {}\n\n".format(info["ESPRESSIF_FLASH_STAT"]) info["ESPRESSIF_MAC_ADDR"] = get_espressif_mac_address() output += 'static const char ESPRESSIF_MAC_ADDR[] = "{}";\n\n'.format( info["ESPRESSIF_MAC_ADDR"] ) + build_output += "MAC address: {}\n\n".format(info["ESPRESSIF_MAC_ADDR"]) + + if args.espressif_verbose: + espressif_verbose(info, build_output) output += "#endif /* __SYSTEM_INFO_H */\n" @@ -703,6 +775,9 @@ def generate_header(args): --espressif_chip: Get Espressif specific information about chip. Requires device connection during build. + --espressif_verbose: + Enable printing Espressif-specific information about + chip during build. """ # Generic arguments @@ -766,6 +841,12 @@ def generate_header(args): help="Get Espressif specific information about chip. Requires device connection during build.", ) + parser.add_argument( + "--espressif_verbose", + action="store_true", + help="Enable printing Espressif-specific information about chip during build", + ) + # Parse arguments if len(sys.argv) == 1: From 95a8c43b739f7c8bbf0f4fb85ead986ef23580d0 Mon Sep 17 00:00:00 2001 From: Eren Terzioglu Date: Fri, 22 Nov 2024 13:38:23 +0100 Subject: [PATCH 035/391] apps/nxdiag: Add dignostic info without esptool support for Espressif devices --- system/nxdiag/Kconfig | 7 +++++++ system/nxdiag/Makefile | 4 ++++ system/nxdiag/nxdiag.c | 31 +++++++++++++++++++++++++++++-- tools/host_sysinfo.py | 15 +++++++++++++++ 4 files changed, 55 insertions(+), 2 deletions(-) diff --git a/system/nxdiag/Kconfig b/system/nxdiag/Kconfig index 904c9c08ed9..2c04ae83c04 100644 --- a/system/nxdiag/Kconfig +++ b/system/nxdiag/Kconfig @@ -74,6 +74,13 @@ config SYSTEM_NXDIAG_ESPRESSIF_CHIP ---help--- Enable Espressif-specific information about chip. Chip must be connected during build process. +config SYSTEM_NXDIAG_ESPRESSIF_CHIP_WO_TOOL + bool "Espressif Chip info without esptool" + depends on SYSTEM_NXDIAG_ESPRESSIF_CHIP + default n + ---help--- + Enable Espressif-specific information about chip without using esptool. + config SYSTEM_NXDIAG_ESPRESSIF_VERBOSE bool "Espressif Verbose" default n diff --git a/system/nxdiag/Makefile b/system/nxdiag/Makefile index e757901a877..931c6c3a217 100644 --- a/system/nxdiag/Makefile +++ b/system/nxdiag/Makefile @@ -90,7 +90,11 @@ NXDIAG_FLAGS += --espressif "$(TOPDIR)" "$(HALDIR)" endif ifeq ($(CONFIG_SYSTEM_NXDIAG_ESPRESSIF_CHIP),y) +ifneq ($(CONFIG_SYSTEM_NXDIAG_ESPRESSIF_CHIP_WO_TOOL),y) NXDIAG_FLAGS += --espressif_chip +else +NXDIAG_FLAGS += --espressif_chip_runtime +endif endif ifeq ($(CONFIG_SYSTEM_NXDIAG_ESPRESSIF_VERBOSE),y) diff --git a/system/nxdiag/nxdiag.c b/system/nxdiag/nxdiag.c index b7d94ff7e94..dae2a342be6 100644 --- a/system/nxdiag/nxdiag.c +++ b/system/nxdiag/nxdiag.c @@ -32,6 +32,9 @@ #include #include "sysinfo.h" +#ifdef CONFIG_SYSTEM_NXDIAG_ESPRESSIF_CHIP_WO_TOOL +#include +#endif /**************************************************************************** * Private Data @@ -224,6 +227,11 @@ static void print_usage(char *prg) int main(int argc, char *argv[]) { +#ifdef CONFIG_SYSTEM_NXDIAG_ESPRESSIF_CHIP_WO_TOOL + int fd; + int ret; +#endif + if (argc == 1 || !are_valid_args(argc, argv)) { print_usage(argv[0]); @@ -346,6 +354,7 @@ int main(int argc, char *argv[]) printf("Esptool version: %s\n\n", ESPRESSIF_ESPTOOL); printf("HAL version: %s\n\n", ESPRESSIF_HAL); #ifdef CONFIG_SYSTEM_NXDIAG_ESPRESSIF_CHIP +#ifndef CONFIG_SYSTEM_NXDIAG_ESPRESSIF_CHIP_WO_TOOL printf("CHIP ID: %s\n\n", ESPRESSIF_CHIP_ID); printf("Flash ID:\n"); print_array(ESPRESSIF_FLASH_ID, ESPRESSIF_FLASH_ID_ARRAY_SIZE); @@ -354,8 +363,26 @@ int main(int argc, char *argv[]) ESPRESSIF_SECURITY_INFO_ARRAY_SIZE); printf("Flash status: %s\n\n", ESPRESSIF_FLASH_STAT); printf("MAC address: %s\n\n", ESPRESSIF_MAC_ADDR); -#endif -#endif +#else + fd = open("/dev/nxdiag", O_RDONLY); + if (fd < 0) + { + printf("Failed to open device\n"); + return ERROR; + } + + ret = read(fd, ESPRESSIF_INFO, ESPRESSIF_INFO_SIZE); + if (ret <= 0) + { + printf("Failed to read device\n"); + return ERROR; + } + + printf("%s\n\n", ESPRESSIF_INFO); + +#endif /* CONFIG_SYSTEM_NXDIAG_ESPRESSIF_CHIP_WO_TOOL */ +#endif /* CONFIG_SYSTEM_NXDIAG_ESPRESSIF_CHIP */ +#endif /* CONFIG_SYSTEM_NXDIAG_ESPRESSIF */ } return 0; diff --git a/tools/host_sysinfo.py b/tools/host_sysinfo.py index 65479d780c9..f5212c18b62 100755 --- a/tools/host_sysinfo.py +++ b/tools/host_sysinfo.py @@ -736,9 +736,14 @@ def generate_header(args): ) build_output += "MAC address: {}\n\n".format(info["ESPRESSIF_MAC_ADDR"]) + elif args.espressif_chip_runtime: + output += "#define ESPRESSIF_INFO_SIZE 384\n" + output += 'static char ESPRESSIF_INFO[ESPRESSIF_TOOLCHAIN_ARRAY_SIZE] =\n{\n 0\n};\n\n' + if args.espressif_verbose: espressif_verbose(info, build_output) + output += "#endif /* __SYSTEM_INFO_H */\n" return output @@ -775,6 +780,10 @@ def generate_header(args): --espressif_chip: Get Espressif specific information about chip. Requires device connection during build. + --espressif_chip_runtime: + Get Espressif specific information about chip + on runtime. + Requires device connection during build. --espressif_verbose: Enable printing Espressif-specific information about chip during build. @@ -841,6 +850,12 @@ def generate_header(args): help="Get Espressif specific information about chip. Requires device connection during build.", ) + parser.add_argument( + "--espressif_chip_runtime", + action="store_true", + help="Get Espressif specific information about chip on runtime. Requires device connection during build.", + ) + parser.add_argument( "--espressif_verbose", action="store_true", From 9411e898e60e9948195b2c902f3808702b23d535 Mon Sep 17 00:00:00 2001 From: Eren Terzioglu Date: Fri, 6 Dec 2024 12:53:56 +0100 Subject: [PATCH 036/391] Move verbose option to common use --- system/nxdiag/Kconfig | 12 +++--- system/nxdiag/Makefile | 8 ++-- tools/host_sysinfo.py | 93 +++++++++++++++++++++--------------------- 3 files changed, 57 insertions(+), 56 deletions(-) diff --git a/system/nxdiag/Kconfig b/system/nxdiag/Kconfig index 2c04ae83c04..e9d16d425fa 100644 --- a/system/nxdiag/Kconfig +++ b/system/nxdiag/Kconfig @@ -60,6 +60,12 @@ config SYSTEM_NXDIAG_HOST_MODULES modules on the host system. This is useful for debugging the host system. Enables the "-m" and "--host-modules" options. +config SYSTEM_NXDIAG_VERBOSE + bool "Verbose" + default n + ---help--- + Enable printing nxdiag application information during build. + comment "Vendor specific information" config SYSTEM_NXDIAG_ESPRESSIF @@ -81,10 +87,4 @@ config SYSTEM_NXDIAG_ESPRESSIF_CHIP_WO_TOOL ---help--- Enable Espressif-specific information about chip without using esptool. -config SYSTEM_NXDIAG_ESPRESSIF_VERBOSE - bool "Espressif Verbose" - default n - ---help--- - Enable printing Espressif-specific information about chip during build. - endif # SYSTEM_NXDIAG diff --git a/system/nxdiag/Makefile b/system/nxdiag/Makefile index 931c6c3a217..5180b62be7e 100644 --- a/system/nxdiag/Makefile +++ b/system/nxdiag/Makefile @@ -57,6 +57,10 @@ ifeq ($(CONFIG_SYSTEM_NXDIAG_HOST_PATH),y) NXDIAG_FLAGS += --path endif +ifeq ($(CONFIG_SYSTEM_NXDIAG_VERBOSE),y) +NXDIAG_FLAGS += --verbose +endif + # Vendor-specific checks # Espressif @@ -97,10 +101,6 @@ NXDIAG_FLAGS += --espressif_chip_runtime endif endif -ifeq ($(CONFIG_SYSTEM_NXDIAG_ESPRESSIF_VERBOSE),y) -NXDIAG_FLAGS += --espressif_verbose -endif - endif # Common build diff --git a/tools/host_sysinfo.py b/tools/host_sysinfo.py index f5212c18b62..3e86cfb3557 100755 --- a/tools/host_sysinfo.py +++ b/tools/host_sysinfo.py @@ -234,57 +234,61 @@ def get_espressif_hal_version(hal_dir): return hal_version -def espressif_verbose(info, esp_logs): +# Common functions # + + +def verbose(info, logs): """ Prepare and print information on build screen. Args: info (dict): Information dictionary of build system. - esp_logs (str): Information string of espressif specific features. + logs (str): Vendor specific information string. Returns: None. """ - esp_verbose = "=" * 79 + "\n" - esp_verbose += "NuttX RTOS info: {}\n\n".format(info["OS_VERSION"]) - if args.flags: - esp_verbose += "NuttX CFLAGS: {}\n\n".format(info["NUTTX_CFLAGS"]) - esp_verbose += "NuttX CXXFLAGS: {}\n\n".format(info["NUTTX_CXXFLAGS"]) - esp_verbose += "NuttX LDFLAGS: {}\n\n".format(info["NUTTX_LDFLAGS"]) + if args.verbose: - if args.config: - esp_verbose += "NuttX configuration options: \n" - for i in range(len(info["NUTTX_CONFIG"])): - esp_verbose += " " + info["NUTTX_CONFIG"][i].replace('"', '\\"') + "\n" - esp_verbose += "\n\n" + out_str = "\n" + "=" * 79 + "\n" - if args.path: - esp_verbose += "Host system PATH: \n" - for i in range(len(info["SYSTEM_PATH"])): - esp_verbose += " " + info["SYSTEM_PATH"][i] + "\n" - esp_verbose += "\n\n" + out_str += "NuttX RTOS info: {}\n\n".format(info["OS_VERSION"]) + if args.flags: + out_str += "NuttX CFLAGS: {}\n\n".format(info["NUTTX_CFLAGS"]) + out_str += "NuttX CXXFLAGS: {}\n\n".format(info["NUTTX_CXXFLAGS"]) + out_str += "NuttX LDFLAGS: {}\n\n".format(info["NUTTX_LDFLAGS"]) - if args.packages: - esp_verbose += "Host system installed packages: \n" - for i in range(len(info["INSTALLED_PACKAGES"])): - esp_verbose += " " + info["INSTALLED_PACKAGES"][i] + "\n" - esp_verbose += "\n\n" + if args.config: + out_str += "NuttX configuration options: \n" + for i in range(len(info["NUTTX_CONFIG"])): + out_str += " " + info["NUTTX_CONFIG"][i].replace('"', '\\"') + "\n" + out_str += "\n\n" - if args.modules: - esp_verbose += "Host system installed python modules: \n" - for i in range(len(info["PYTHON_MODULES"])): - esp_verbose += " " + info["PYTHON_MODULES"][i] + "\n" - esp_verbose += "\n\n" + if args.path: + out_str += "Host system PATH: \n" + for i in range(len(info["SYSTEM_PATH"])): + out_str += " " + info["SYSTEM_PATH"][i] + "\n" + out_str += "\n\n" - esp_verbose += "Espressif specific information: \n\n" - esp_verbose += esp_logs - esp_verbose += "=" * 79 + "\n" + if args.packages: + out_str += "Host system installed packages: \n" + for i in range(len(info["INSTALLED_PACKAGES"])): + out_str += " " + info["INSTALLED_PACKAGES"][i] + "\n" + out_str += "\n\n" - eprint(esp_verbose) + if args.modules: + out_str += "Host system installed python modules: \n" + for i in range(len(info["PYTHON_MODULES"])): + out_str += " " + info["PYTHON_MODULES"][i] + "\n" + out_str += "\n\n" + if args.espressif: + out_str += "Espressif specific information: \n\n" + out_str += logs + out_str += "=" * 79 + "\n" -# Common functions # + eprint(out_str) def eprint(*args, **kwargs): @@ -519,6 +523,7 @@ def generate_header(args): info = {} output = "" + build_output = "" output += "/****************************************************************************\n" output += " * sysinfo.h\n" @@ -738,11 +743,9 @@ def generate_header(args): elif args.espressif_chip_runtime: output += "#define ESPRESSIF_INFO_SIZE 384\n" - output += 'static char ESPRESSIF_INFO[ESPRESSIF_TOOLCHAIN_ARRAY_SIZE] =\n{\n 0\n};\n\n' - - if args.espressif_verbose: - espressif_verbose(info, build_output) + output += "static char ESPRESSIF_INFO[ESPRESSIF_TOOLCHAIN_ARRAY_SIZE] =\n{\n 0\n};\n\n" + verbose(info, build_output) output += "#endif /* __SYSTEM_INFO_H */\n" @@ -774,6 +777,8 @@ def generate_header(args): Get the NuttX compilation configurations used. -f, --flags : Provide the NuttX compilation flags used. + --verbose: + Enable printing information during build. --espressif : Get Espressif specific information. Requires the path to the bootloader binary directory. @@ -784,9 +789,6 @@ def generate_header(args): Get Espressif specific information about chip on runtime. Requires device connection during build. - --espressif_verbose: - Enable printing Espressif-specific information about - chip during build. """ # Generic arguments @@ -833,6 +835,11 @@ def generate_header(args): action=validate_flags_arg, help="Provide the NuttX compilation and linker flags used.", ) + parser.add_argument( + "--verbose", + action="store_true", + help="Enable printing information during build", + ) # Vendor specific arguments @@ -856,12 +863,6 @@ def generate_header(args): help="Get Espressif specific information about chip on runtime. Requires device connection during build.", ) - parser.add_argument( - "--espressif_verbose", - action="store_true", - help="Enable printing Espressif-specific information about chip during build", - ) - # Parse arguments if len(sys.argv) == 1: From 37acd5e6712bc91e6c5fd3b9cdde06ff9a3cada3 Mon Sep 17 00:00:00 2001 From: chao an Date: Mon, 9 Dec 2024 15:07:22 +0800 Subject: [PATCH 037/391] mlearning: fix build break if enable cmsis-nn apps/mlearning/tflite-micro/tflite-micro/tensorflow/lite/micro/kernels/cmsis_nn/conv.cc:18:10: fatal error: Include/arm_nnfunctions.h: No such file or directory 18 | #include "Include/arm_nnfunctions.h" | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: chao an --- mlearning/cmsis-nn/CMakeLists.txt | 3 +++ mlearning/tflite-micro/CMakeLists.txt | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/mlearning/cmsis-nn/CMakeLists.txt b/mlearning/cmsis-nn/CMakeLists.txt index c5944620d27..43cbcfe8941 100644 --- a/mlearning/cmsis-nn/CMakeLists.txt +++ b/mlearning/cmsis-nn/CMakeLists.txt @@ -69,6 +69,8 @@ if(CONFIG_MLEARNING_CMSIS_NN) ${CMSIS_NN_DIR}/Source/LSTMFunctions/*.c ${CMSIS_NN_DIR}/Source/ReshapeFunctions/*.c) + set(CMSIS_NN_INCDIR ${CMAKE_CURRENT_LIST_DIR}/cmsis-nn/Include) + if(CONFIG_ARM_NEON) list( REMOVE_ITEM @@ -86,5 +88,6 @@ if(CONFIG_MLEARNING_CMSIS_NN) nuttx_add_library(cmsis_nn STATIC) target_compile_options(cmsis_nn PRIVATE ${CFLAGS}) target_sources(cmsis_nn PRIVATE ${CMSIS_NN_SRCS}) + target_include_directories(cmsis_nn PUBLIC ${CMSIS_NN_INCDIR}) endif() diff --git a/mlearning/tflite-micro/CMakeLists.txt b/mlearning/tflite-micro/CMakeLists.txt index 482e920b7bb..abc9b9fa5f6 100644 --- a/mlearning/tflite-micro/CMakeLists.txt +++ b/mlearning/tflite-micro/CMakeLists.txt @@ -152,7 +152,7 @@ if(CONFIG_TFLITEMICRO) ${NUTTX_APPS_DIR}/system/flatbuffers/flatbuffers/include) if(CONFIG_MLEARNING_CMSIS_NN) - list(APPEND INCDIR ${NUTTX_APPS_DIR}/apps/mlearning/cmsis-nn/cmsis-nn) + list(APPEND INCDIR ${NUTTX_APPS_DIR}/mlearning/cmsis-nn/cmsis-nn) endif() # ############################################################################ From 9c5a2ad062069cadc3209186f35338260360efd4 Mon Sep 17 00:00:00 2001 From: chao an Date: Mon, 9 Dec 2024 13:25:11 +0800 Subject: [PATCH 038/391] mlearning/tflite-micro: add a config option to redirect micro log to syslog new config option TFLITEMICRO_SYSLOG to redirect micro log to syslog Signed-off-by: chao an --- mlearning/tflite-micro/CMakeLists.txt | 4 ++ mlearning/tflite-micro/Kconfig | 24 ++++++++++ mlearning/tflite-micro/Makefile | 5 ++ mlearning/tflite-micro/tflm_syslog.cc | 66 +++++++++++++++++++++++++++ 4 files changed, 99 insertions(+) create mode 100644 mlearning/tflite-micro/tflm_syslog.cc diff --git a/mlearning/tflite-micro/CMakeLists.txt b/mlearning/tflite-micro/CMakeLists.txt index abc9b9fa5f6..eb5221ec4ef 100644 --- a/mlearning/tflite-micro/CMakeLists.txt +++ b/mlearning/tflite-micro/CMakeLists.txt @@ -101,6 +101,10 @@ if(CONFIG_TFLITEMICRO) # Remove test file list(FILTER TFLITE_MICRO_SRCS EXCLUDE REGEX ".*test.cc") + if(CONFIG_TFLITEMICRO_SYSLOG) + list(FILTER TFLITE_MICRO_SRCS EXCLUDE REGEX "micro_log.cc") + list(APPEND TFLITE_MICRO_SRCS ${CMAKE_CURRENT_LIST_DIR}/tflm_syslog.cc) + endif() if(CONFIG_MLEARNING_CMSIS_NN) list(APPEND COMMON_FLAGS -DCMSIS_NN) diff --git a/mlearning/tflite-micro/Kconfig b/mlearning/tflite-micro/Kconfig index 06193fff16e..359ea581934 100644 --- a/mlearning/tflite-micro/Kconfig +++ b/mlearning/tflite-micro/Kconfig @@ -32,6 +32,30 @@ config TFLITEMICRO_TOOL bool "tflite-micro cmdline tool" default n +config TFLITEMICRO_SYSLOG + bool "tflite-micro syslog backend" + default n + +if TFLITEMICRO_SYSLOG + +config TFLITEMICRO_SYSLOG_LEVEL + int "tflite-micro syslog level" + default 6 + ---help--- + Syslog level mapping of tflm, This log level mapping is consistent + with the nuttx syslog level, please refer to syslog.h: + + define LOG_EMERG 0 /* System is unusable */ + define LOG_ALERT 1 /* Action must be taken immediately */ + define LOG_CRIT 2 /* Critical conditions */ + define LOG_ERR 3 /* Error conditions */ + define LOG_WARNING 4 /* Warning conditions */ + define LOG_NOTICE 5 /* Normal, but significant, condition */ + define LOG_INFO 6 /* Informational message */ + define LOG_DEBUG 7 /* Debug-level message */ + +endif # TFLITEMICRO_SYSLOG + if TFLITEMICRO_TOOL config TFLITEMICRO_TOOL_PRIORITY int "tflite-micro tool priority" diff --git a/mlearning/tflite-micro/Makefile b/mlearning/tflite-micro/Makefile index b5dbd7f814a..dd0c1c6ad71 100644 --- a/mlearning/tflite-micro/Makefile +++ b/mlearning/tflite-micro/Makefile @@ -78,6 +78,11 @@ CXXSRCS += $(wildcard $(TFLM_DIR)/tensorflow/lite/micro/tflite_bridge/*.cc) CXXSRCS += $(wildcard $(TFLM_DIR)/tensorflow/lite/schema/*.cc) CXXSRCS := $(filter-out %test.cc, $(CXXSRCS)) +ifneq ($(CONFIG_TFLITEMICRO_SYSLOG),) + CXXSRCS := $(filter-out %micro_log.cc, $(CXXSRCS)) + CXXSRCS += $(wildcard $(CURDIR)/tflm_syslog.cc) +endif + # cmsis ifneq ($(CONFIG_MLEARNING_CMSIS_NN),) COMMON_FLAGS += -DCMSIS_NN diff --git a/mlearning/tflite-micro/tflm_syslog.cc b/mlearning/tflite-micro/tflm_syslog.cc new file mode 100644 index 00000000000..f306a9153bf --- /dev/null +++ b/mlearning/tflite-micro/tflm_syslog.cc @@ -0,0 +1,66 @@ +/**************************************************************************** + * apps/mlearning/tflite-micro/tflm_syslog.cc + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +#include "tensorflow/lite/micro/micro_log.h" + +#include +#include + +#if !defined(TF_LITE_STRIP_ERROR_STRINGS) +#include "tensorflow/lite/micro/debug_log.h" +#endif + +#if !defined(TF_LITE_STRIP_ERROR_STRINGS) + +void VMicroPrintf(FAR const char *format, va_list ap) +{ + vsyslog(CONFIG_TFLITEMICRO_SYSLOG_LEVEL, format, ap); +} + +void MicroPrintf(FAR const char *format, ...) +{ + va_list ap; + + /* Let vsyslog do the work */ + + va_start(ap, format); + vsyslog(CONFIG_TFLITEMICRO_SYSLOG_LEVEL, format, ap); + va_end(ap); +} + +int MicroSnprintf(FAR char *buffer, size_t buf_size, FAR const char *format, ...) +{ + va_list ap; + int ret; + + va_start(ap, format); + ret = vsnprintf(buffer, buf_size, format, ap); + va_end(ap); + + return ret; +} + +int MicroVsnprintf(FAR char *buffer, size_t buf_size, + FAR const char *format, va_list vlist) +{ + return vsnprintf(buffer, buf_size, format, vlist); +} + +#endif // !defined(TF_LITE_STRIP_ERROR_STRINGS) From b232fa42cfa971a80780ecbfd3557db0d3e3de37 Mon Sep 17 00:00:00 2001 From: buxiasen Date: Wed, 4 Dec 2024 17:13:39 +0800 Subject: [PATCH 039/391] drivertest: add arm-m signal through isr case Signed-off-by: buxiasen --- testing/drivertest/CMakeLists.txt | 36 ++- testing/drivertest/Makefile | 2 + .../drivertest/drivertest_mps2_isr_signal.c | 219 ++++++++++++++++++ 3 files changed, 254 insertions(+), 3 deletions(-) create mode 100644 testing/drivertest/drivertest_mps2_isr_signal.c diff --git a/testing/drivertest/CMakeLists.txt b/testing/drivertest/CMakeLists.txt index 73ef14c0389..0f36f09320b 100644 --- a/testing/drivertest/CMakeLists.txt +++ b/testing/drivertest/CMakeLists.txt @@ -357,10 +357,40 @@ if(CONFIG_TESTING_DRIVER_TEST) drivertest_touchpanel.c) endif() - if(CONFIG_ARCH_CHIP_MPS2_AN500 AND CONFIG_ARCH_IRQPRIO) + if(CONFIG_ARCH_CHIP_MPS2_AN500) + if(CONFIG_ARCH_IRQPRIO) + nuttx_add_application( + NAME + cmocka_driver_mps2 + PRIORITY + ${CONFIG_TESTING_DRIVER_TEST_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_DRIVER_TEST_STACKSIZE} + MODULE + ${CONFIG_TESTING_DRIVER_TEST} + DEPENDS + cmocka + SRCS + drivertest_mps2.c) + + nuttx_add_application( + NAME + cmocka_driver_mps2_zerointerrupt + PRIORITY + ${CONFIG_TESTING_DRIVER_TEST_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_DRIVER_TEST_STACKSIZE} + MODULE + ${CONFIG_TESTING_DRIVER_TEST} + DEPENDS + cmocka + SRCS + drivertest_mps2_zerointerrupt.c) + endif() + nuttx_add_application( NAME - cmocka_driver_mps2 + cmocka_driver_mps2_isr_signal PRIORITY ${CONFIG_TESTING_DRIVER_TEST_PRIORITY} STACKSIZE @@ -370,7 +400,7 @@ if(CONFIG_TESTING_DRIVER_TEST) DEPENDS cmocka SRCS - drivertest_mps2.c) + drivertest_mps2_isr_signal.c) endif() if(CONFIG_PM) diff --git a/testing/drivertest/Makefile b/testing/drivertest/Makefile index 5bd0744af32..50a0a56131d 100644 --- a/testing/drivertest/Makefile +++ b/testing/drivertest/Makefile @@ -138,6 +138,8 @@ PROGNAME += cmocka_driver_mps2 MAINSRC += drivertest_mps2_zerointerrupt.c PROGNAME += cmocka_driver_mps2_zerointerrupt endif +MAINSRC += drivertest_mps2_isr_signal.c +PROGNAME += cmocka_driver_mps2_isr_signal endif ifeq ($(CONFIG_PM),y) diff --git a/testing/drivertest/drivertest_mps2_isr_signal.c b/testing/drivertest/drivertest_mps2_isr_signal.c new file mode 100644 index 00000000000..2c5785694c1 --- /dev/null +++ b/testing/drivertest/drivertest_mps2_isr_signal.c @@ -0,0 +1,219 @@ +/**************************************************************************** + * apps/testing/drivertest/drivertest_mps2_isr_signal.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#define CONFIG_TEST_ISR_SIGNAL_US 10000 + +#define MPS2_ADDR2REG_PTR(base, off) (uint32_t*)((uint32_t*)(base) + (off)) +#define MPS2_IRQ_FROMBASE(base, off) ((base) + (off)) + +/* https://developer.arm.com/documentation/101104/0200/programmers-model/ + * base-element/cmsdk-timer + */ + +#define MPS_TIMER_CTRL_OFFSET 0 +#define MPS_TIMER_VALUE_OFFSET 1 +#define MPS_TIMER_RELOAD_OFFSET 2 +#define MPS_TIMER_CLEAR_OFFSET 3 + +#define MPS_TIMER_CTRL_ENABLE (1<<0) +#define MPS_TIMER_CTRL_IE (1<<3) + +static_assert(NVIC_SYSH_PRIORITY_DEFAULT == 0x80, "prio"); + +/**************************************************************************** + * Private Types + ****************************************************************************/ + +typedef struct mps2_an500_timer_s +{ + volatile uint32_t *reload; + volatile uint32_t *ctrl; + volatile uint32_t *clear; + pid_t pid; + int irq; +} mps2_an500_timer_t; + +/**************************************************************************** + * Private Functions Prototypes + ****************************************************************************/ + +static int timer_irq_handle(int irq, void *context, void *arg); + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +static int last_sig = 0; + +static mps2_an500_timer_t timer[2]; + +static const int armv7m_gpio_base = 16; + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +static void mps_timer_init(void) +{ + static const uint32_t timerbase[] = + { + 0x40000000, 0x40001000 + }; + + static const int timerirq[] = + { + 8, 9 + }; + +#ifdef CONFIG_ARCH_IRQPRIO + static const int timer_irq_prio[] = + { + 0x80, 0xa0 + }; +#endif + + for (int i = 0; i < 2; i++) + { + mps2_an500_timer_t *t = &timer[i]; + + t->reload = MPS2_ADDR2REG_PTR(timerbase[i], MPS_TIMER_RELOAD_OFFSET); + t->ctrl = MPS2_ADDR2REG_PTR(timerbase[i], MPS_TIMER_CTRL_OFFSET); + t->clear = MPS2_ADDR2REG_PTR(timerbase[i], MPS_TIMER_CLEAR_OFFSET); + t->irq = MPS2_IRQ_FROMBASE(armv7m_gpio_base, timerirq[i]); + + irq_attach(t->irq, timer_irq_handle, t); + up_enable_irq(t->irq); + +#ifdef CONFIG_ARCH_IRQPRIO + up_prioritize_irq(t->irq, timer_irq_prio[i]); +#endif + } +} + +static int timer_irq_handle(int irq, void *context, void *arg) +{ + mps2_an500_timer_t *t = arg; + *t->clear = 1; + *t->ctrl = 0; + + tgkill(t->pid, t->pid, SIGINT); + return 0; +} + +static void timer_begin_test(mps2_an500_timer_t *t, uint32_t reload_us) +{ + uint32_t reload = reload_us * 25; + *t->reload = reload; + + *t->ctrl = MPS_TIMER_CTRL_IE | MPS_TIMER_CTRL_ENABLE; +} + +static void timer_end_test(mps2_an500_timer_t *t) +{ + *t->ctrl = 0; + *t->clear = 1; +} + +static void test_sa_handler(int signo) +{ + last_sig = signo; +} + +static void test_irq_signal(void **argv) +{ + mps2_an500_timer_t *t = &timer[1]; + struct timespec ts; + + signal(SIGINT, test_sa_handler); + + clock_gettime(CLOCK_MONOTONIC, &ts); + + t->pid = getpid(); + timer_begin_test(t, CONFIG_TEST_ISR_SIGNAL_US); + + /* Runing thread interrupt by exception_direct causing signal miss */ + + while (true) + { + struct timespec now; + up_udelay(1000); + clock_gettime(CLOCK_MONOTONIC, &now); + if (now.tv_sec - ts.tv_sec > 1 || last_sig != 0) + { + break; + } + } + + assert_int_equal(last_sig, SIGINT); +} + +static int setup(void **argv) +{ + mps_timer_init(); + return 0; +} + +static int teardown(void **argv) +{ + timer_end_test(&timer[0]); + timer_end_test(&timer[1]); + return 0; +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +int main(int argc, char *argv[]) +{ + const struct CMUnitTest tests[] = { + cmocka_unit_test_prestate_setup_teardown( + test_irq_signal, setup, teardown, NULL), + }; + + return cmocka_run_group_tests(tests, NULL, NULL); +} From 1f8b9aa74c38460fe8fe47646f70e85e79bcc21f Mon Sep 17 00:00:00 2001 From: buxiasen Date: Tue, 10 Dec 2024 23:46:56 +0800 Subject: [PATCH 040/391] drivertest: update comment in driver test Kconfig Signed-off-by: buxiasen --- testing/drivertest/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/drivertest/Kconfig b/testing/drivertest/Kconfig index e0d073d51bd..c0975e9b889 100644 --- a/testing/drivertest/Kconfig +++ b/testing/drivertest/Kconfig @@ -4,7 +4,7 @@ # config TESTING_DRIVER_TEST - tristate "vela cmocka driver test" + tristate "cmocka driver test" default n depends on TESTING_CMOCKA ---help--- From d7ed69200fe61d47ee5211777728f2e03422a8f3 Mon Sep 17 00:00:00 2001 From: Tiago Medicci Date: Tue, 10 Dec 2024 12:06:53 -0300 Subject: [PATCH 041/391] interpreters/python: Avoid warnings that could be treated as errors This commit disables some warnings when building CPython to avoid CI failing when `EXTRAFLAGS="-Wno-cpp -Werror"` is set. --- interpreters/python/Makefile | 20 +++++++---- interpreters/python/config.site | 1 + ...around-newlib-resource.h-limitations.patch | 6 ++-- ...32_t-unsigned-int-type-mismatch-issu.patch | 6 ++-- ...s.py-for-generating-an-archive-of-py.patch | 5 +-- ...04-recognize-nuttx-as-a-supported-OS.patch | 5 +-- ...ilds-Without-HAVE_DYNAMIC_LOADING-Se.patch | 5 +-- ...to-avoid-conflict-with-nuttx-unused_.patch | 5 +-- .../patch/0007-undef-atexit_register.patch | 6 ++-- .../patch/0008-declare-struct-timeval.patch | 6 ++-- ...s-select-header-to-define-FD_SETSIZE.patch | 5 +-- ...d_ino-member-of-the-structure-dirent.patch | 36 +++++++++++++++---- ...on-warning-if-UNUSED-is-already-defi.patch | 26 ++++++++++++++ 13 files changed, 100 insertions(+), 32 deletions(-) create mode 100644 interpreters/python/patch/0011-avoid-redefinition-warning-if-UNUSED-is-already-defi.patch diff --git a/interpreters/python/Makefile b/interpreters/python/Makefile index 80db1722e36..e3cda75dfef 100644 --- a/interpreters/python/Makefile +++ b/interpreters/python/Makefile @@ -43,6 +43,18 @@ TARGETLIBPYTHON=$(TARGETINSTALL)/libpython$(CPYTHON_VERSION_MINOR).a TARGETMODULESPACK=$(TARGETBUILD)/lib/python$(shell echo $(CPYTHON_VERSION_MINOR) | tr -d .).zip TARGETMODULES=$(TARGETINSTALL)/lib/ +CFLAGS += ${INCDIR_PREFIX}$(CPYTHON_PATH)$(DELIM)Include +CFLAGS += ${INCDIR_PREFIX}$(CPYTHON_PATH)$(DELIM)Test +CFLAGS += ${INCDIR_PREFIX}$(CPYTHON_PATH)$(DELIM)Include$(DELIM)internal +CFLAGS += ${INCDIR_PREFIX}$(APPDIR)$(DELIM)system +CFLAGS += ${INCDIR_PREFIX}$(APPDIR)$(DELIM)system$(DELIM)zlib$(DELIM)zlib +CFLAGS += ${INCDIR_PREFIX}$(TARGETBUILD) +CFLAGS += -Wno-shadow -Wno-undef -Wno-format -Wno-builtin-macro-redefined +CFLAGS += -Wno-type-limits -Wno-implicit-fallthrough -Wno-char-subscripts +CFLAGS += -Wno-sign-compare -Wno-unused-const-variable -Wno-unused-function +CFLAGS += -Wno-unused-variable -Wno-overflow -Wno-unused-but-set-variable +CFLAGS += -Wno-strict-prototypes + DEPPATH += --dep-path $(CPYTHON_UNPACKNAME)$(DELIM)Programs VPATH += :$(CPYTHON_UNPACKNAME)$(DELIM)Programs @@ -65,6 +77,7 @@ $(CPYTHON_UNPACKNAME): $(CPYTHON_ZIP) $(Q) patch -p1 -d $(CPYTHON_UNPACKNAME) < patch$(DELIM)0008-declare-struct-timeval.patch $(Q) patch -p1 -d $(CPYTHON_UNPACKNAME) < patch$(DELIM)0009-include-nuttx-sys-select-header-to-define-FD_SETSIZE.patch $(Q) patch -p1 -d $(CPYTHON_UNPACKNAME) < patch$(DELIM)0010-check-for-the-d_ino-member-of-the-structure-dirent.patch + $(Q) patch -p1 -d $(CPYTHON_UNPACKNAME) < patch$(DELIM)0011-avoid-redefinition-warning-if-UNUSED-is-already-defi.patch $(HOSTPYTHON): mkdir -p $(HOSTBUILD) @@ -123,13 +136,6 @@ $(TARGETLIBPYTHON): $(TARGETBUILD)/Makefile $(Q) ( cp $(TARGETBUILD)/libpython$(CPYTHON_VERSION_MINOR).a $(TARGETLIBPYTHON) ) $(Q) $(UNPACK) $(TARGETMODULESPACK) -d $(TARGETMODULES)/python$(CPYTHON_VERSION_MINOR) -CFLAGS += ${INCDIR_PREFIX}$(CPYTHON_PATH)$(DELIM)Include -CFLAGS += ${INCDIR_PREFIX}$(CPYTHON_PATH)$(DELIM)Test -CFLAGS += ${INCDIR_PREFIX}$(CPYTHON_PATH)$(DELIM)Include$(DELIM)internal -CFLAGS += ${INCDIR_PREFIX}$(APPDIR)$(DELIM)system -CFLAGS += ${INCDIR_PREFIX}$(APPDIR)$(DELIM)system$(DELIM)zlib$(DELIM)zlib -CFLAGS += ${INCDIR_PREFIX}$(TARGETBUILD) - MODULE = $(CONFIG_INTERPRETER_CPYTHON) PROGNAME += $(CONFIG_INTERPRETER_CPYTHON_PROGNAME) diff --git a/interpreters/python/config.site b/interpreters/python/config.site index d806ba564d7..c99b73e5644 100644 --- a/interpreters/python/config.site +++ b/interpreters/python/config.site @@ -18,4 +18,5 @@ export ac_cv_func_clock="yes" export ac_cv_func_fork="yes" export ac_cv_func_waitpid="yes" export ac_cv_func_pipe="yes" +export ac_cv_enable_strict_prototypes_warning="no" export MODULE_BUILDTYPE="static" diff --git a/interpreters/python/patch/0001-workaround-newlib-resource.h-limitations.patch b/interpreters/python/patch/0001-workaround-newlib-resource.h-limitations.patch index dfb9d437a3b..d2ef33c3cdd 100644 --- a/interpreters/python/patch/0001-workaround-newlib-resource.h-limitations.patch +++ b/interpreters/python/patch/0001-workaround-newlib-resource.h-limitations.patch @@ -1,12 +1,14 @@ -From b2ac42cefa3747c7f7a9066fceed834286e829af Mon Sep 17 00:00:00 2001 +From 3917fd37644948096c6bebf53e701b59fa527cf5 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Tue, 22 Oct 2024 23:58:17 +0200 -Subject: [PATCH 01/10] workaround newlib resource.h limitations +Subject: [PATCH 01/11] workaround newlib resource.h limitations configure script checks if resource.h is available but doesn't check if it defines all the necessary functions. Temporary workaround until these functions are added to IDF. + +Signed-off-by: Tiago Medicci --- Modules/faulthandler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interpreters/python/patch/0002-fix-various-uint32_t-unsigned-int-type-mismatch-issu.patch b/interpreters/python/patch/0002-fix-various-uint32_t-unsigned-int-type-mismatch-issu.patch index 0bf12755af3..4dcef4e78c0 100644 --- a/interpreters/python/patch/0002-fix-various-uint32_t-unsigned-int-type-mismatch-issu.patch +++ b/interpreters/python/patch/0002-fix-various-uint32_t-unsigned-int-type-mismatch-issu.patch @@ -1,12 +1,14 @@ -From 036b39478c2419af1e0a64763b9ac741cf886387 Mon Sep 17 00:00:00 2001 +From 562138b0486ad050b5ce601d434910973ff6f094 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Wed, 23 Oct 2024 16:48:49 +0200 -Subject: [PATCH 02/10] fix various uint32_t/'unsigned int' type mismatch +Subject: [PATCH 02/11] fix various uint32_t/'unsigned int' type mismatch issues In a few places existing code assumes that uint32_t == unsigned int. Since in Xtensa and RISC-V bare metal toolchains uint32_t is instead 'unsigned long', the original code fails to build. + +Signed-off-by: Tiago Medicci --- Modules/zlibmodule.c | 28 ++++++++++++++-------------- Objects/typeobject.c | 2 +- diff --git a/interpreters/python/patch/0003-reuse-wasm_assets.py-for-generating-an-archive-of-py.patch b/interpreters/python/patch/0003-reuse-wasm_assets.py-for-generating-an-archive-of-py.patch index f8e03a2cfc0..83b46c6d5be 100644 --- a/interpreters/python/patch/0003-reuse-wasm_assets.py-for-generating-an-archive-of-py.patch +++ b/interpreters/python/patch/0003-reuse-wasm_assets.py-for-generating-an-archive-of-py.patch @@ -1,7 +1,7 @@ -From 4af7a9b726ca2c8ac330b51f98acf0a103f6fa71 Mon Sep 17 00:00:00 2001 +From dcc6b2b6aa396f96e7c9efe3e793d96c7004ef4f Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Wed, 23 Oct 2024 16:54:39 +0200 -Subject: [PATCH 03/10] reuse wasm_assets.py for generating an archive of +Subject: [PATCH 03/11] reuse wasm_assets.py for generating an archive of python lib dir wasm_assets.py is a useful script to prepare the smallest possible @@ -12,6 +12,7 @@ This patch adds nuttx to the supported OS list in the script, as well as fixes what I think is a bug in path calculation. Co-authored-by: Tiago Medicci Serrano +Signed-off-by: Tiago Medicci --- Tools/wasm/wasm_assets.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/interpreters/python/patch/0004-recognize-nuttx-as-a-supported-OS.patch b/interpreters/python/patch/0004-recognize-nuttx-as-a-supported-OS.patch index 6d8531ce66d..d187e248ca5 100644 --- a/interpreters/python/patch/0004-recognize-nuttx-as-a-supported-OS.patch +++ b/interpreters/python/patch/0004-recognize-nuttx-as-a-supported-OS.patch @@ -1,13 +1,14 @@ -From 1bb8d824a4b4e4b38c3541b7c26c5d71f0970266 Mon Sep 17 00:00:00 2001 +From ff067ccb26c91de352de362a25d87bcbabe924dc Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Wed, 23 Oct 2024 16:55:53 +0200 -Subject: [PATCH 04/10] recognize *-*-nuttx as a supported OS +Subject: [PATCH 04/11] recognize *-*-nuttx as a supported OS cpython's configure script bails out when cross-compiling for an unknown OS, so we have to add "nuttx" to the list, even though it is not used almost anywhere else. Co-authored-by: Tiago Medicci Serrano +Signed-off-by: Tiago Medicci --- config.sub | 2 +- configure | 3 +++ diff --git a/interpreters/python/patch/0005-gh-122907-Fix-Builds-Without-HAVE_DYNAMIC_LOADING-Se.patch b/interpreters/python/patch/0005-gh-122907-Fix-Builds-Without-HAVE_DYNAMIC_LOADING-Se.patch index cf25d88c2bd..52bbd6b68c8 100644 --- a/interpreters/python/patch/0005-gh-122907-Fix-Builds-Without-HAVE_DYNAMIC_LOADING-Se.patch +++ b/interpreters/python/patch/0005-gh-122907-Fix-Builds-Without-HAVE_DYNAMIC_LOADING-Se.patch @@ -1,13 +1,14 @@ -From cd8af3cbc9881e5a4a7c0644c8844478c8d0245d Mon Sep 17 00:00:00 2001 +From 7e646549488f2d3de4cf1e04ad975625342a9218 Mon Sep 17 00:00:00 2001 From: Eric Snow Date: Tue, 13 Aug 2024 14:44:57 -0600 -Subject: [PATCH 05/10] gh-122907: Fix Builds Without HAVE_DYNAMIC_LOADING Set +Subject: [PATCH 05/11] gh-122907: Fix Builds Without HAVE_DYNAMIC_LOADING Set (gh-122952) As of 529a160 (gh-118204), building with HAVE_DYNAMIC_LOADING stopped working. This is a minimal fix just to get builds working again. There are actually a number of long-standing deficiencies with HAVE_DYNAMIC_LOADING builds that need to be resolved separately. (cherry picked from commit ee1b8ce26e700350e47a5f65201097121c41912e) Co-authored-by: Eric Snow +Signed-off-by: Tiago Medicci --- Include/internal/pycore_importdl.h | 4 ++++ Lib/importlib/_bootstrap_external.py | 16 ++++++++-------- diff --git a/interpreters/python/patch/0006-change-var-name-to-avoid-conflict-with-nuttx-unused_.patch b/interpreters/python/patch/0006-change-var-name-to-avoid-conflict-with-nuttx-unused_.patch index 641233bf4eb..a7787b4ff26 100644 --- a/interpreters/python/patch/0006-change-var-name-to-avoid-conflict-with-nuttx-unused_.patch +++ b/interpreters/python/patch/0006-change-var-name-to-avoid-conflict-with-nuttx-unused_.patch @@ -1,9 +1,10 @@ -From d424766bff74fb34a80a09c6e2ed8d9b40350bb8 Mon Sep 17 00:00:00 2001 +From 82a3c7c021324e4245289c565b2d379b83ed4be3 Mon Sep 17 00:00:00 2001 From: Tiago Medicci Date: Wed, 13 Nov 2024 14:20:36 -0300 -Subject: [PATCH 06/10] change var name to avoid conflict with nuttx +Subject: [PATCH 06/11] change var name to avoid conflict with nuttx unused_data macro +Signed-off-by: Tiago Medicci --- Modules/zlibmodule.c | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/interpreters/python/patch/0007-undef-atexit_register.patch b/interpreters/python/patch/0007-undef-atexit_register.patch index 266f704a946..7003f155fb8 100644 --- a/interpreters/python/patch/0007-undef-atexit_register.patch +++ b/interpreters/python/patch/0007-undef-atexit_register.patch @@ -1,10 +1,12 @@ -From 1b802bfd159a6a9766ca5834af90f55d54285b4b Mon Sep 17 00:00:00 2001 +From 7eab2315d75d5e78e67e0b049ebb2fc71914b7ea Mon Sep 17 00:00:00 2001 From: Tiago Medicci Date: Wed, 13 Nov 2024 14:22:04 -0300 -Subject: [PATCH 07/10] undef atexit_register +Subject: [PATCH 07/11] undef atexit_register Even if not built, nuttx/include/nuttx/atexit.h defines it and this causes conflicts. + +Signed-off-by: Tiago Medicci --- Modules/atexitmodule.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/interpreters/python/patch/0008-declare-struct-timeval.patch b/interpreters/python/patch/0008-declare-struct-timeval.patch index bb8d3cb43d8..646c87c28a1 100644 --- a/interpreters/python/patch/0008-declare-struct-timeval.patch +++ b/interpreters/python/patch/0008-declare-struct-timeval.patch @@ -1,9 +1,11 @@ -From b40e89c190ec7c6b3b0116a3f7025ab13854398f Mon Sep 17 00:00:00 2001 +From fc042cfa496f37f2a859495ad281583f79af0044 Mon Sep 17 00:00:00 2001 From: Tiago Medicci Date: Wed, 13 Nov 2024 14:23:34 -0300 -Subject: [PATCH 08/10] declare struct timeval +Subject: [PATCH 08/11] declare struct timeval Otherwise, build will fail due to redefinition of _PyTime_FromTimeval + +Signed-off-by: Tiago Medicci --- Include/internal/pycore_time.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/interpreters/python/patch/0009-include-nuttx-sys-select-header-to-define-FD_SETSIZE.patch b/interpreters/python/patch/0009-include-nuttx-sys-select-header-to-define-FD_SETSIZE.patch index b52b76be1b2..312797960f3 100644 --- a/interpreters/python/patch/0009-include-nuttx-sys-select-header-to-define-FD_SETSIZE.patch +++ b/interpreters/python/patch/0009-include-nuttx-sys-select-header-to-define-FD_SETSIZE.patch @@ -1,8 +1,9 @@ -From 9a32a300c95e0061220d2608a014c7fa39dedab3 Mon Sep 17 00:00:00 2001 +From 3d140751ebec3aedd8ed3cdf2a7eff5009693112 Mon Sep 17 00:00:00 2001 From: Tiago Medicci Date: Thu, 14 Nov 2024 13:44:49 -0300 -Subject: [PATCH 09/10] include nuttx sys/select header to define FD_SETSIZE +Subject: [PATCH 09/11] include nuttx sys/select header to define FD_SETSIZE +Signed-off-by: Tiago Medicci --- Modules/selectmodule.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/interpreters/python/patch/0010-check-for-the-d_ino-member-of-the-structure-dirent.patch b/interpreters/python/patch/0010-check-for-the-d_ino-member-of-the-structure-dirent.patch index d65b1f287c6..13cffe3fa0c 100644 --- a/interpreters/python/patch/0010-check-for-the-d_ino-member-of-the-structure-dirent.patch +++ b/interpreters/python/patch/0010-check-for-the-d_ino-member-of-the-structure-dirent.patch @@ -1,15 +1,37 @@ -From 4f6a1db85c56df378dc3856ed95a0a7342f44d89 Mon Sep 17 00:00:00 2001 +From 4191bf1e4505776efa0780ebc4fc5195a6ce79d3 Mon Sep 17 00:00:00 2001 From: Tiago Medicci Date: Tue, 3 Dec 2024 17:18:50 -0300 -Subject: [PATCH 10/10] check for the d_ino member of the structure dirent +Subject: [PATCH 10/11] check for the d_ino member of the structure dirent +Signed-off-by: Tiago Medicci --- - Modules/posixmodule.c | 18 ++++++++++++++++-- - configure | 43 +++++++++++++++++++++++++++++++++++++++++++ - configure.ac | 5 +++++ - pyconfig.h.in | 3 +++ - 4 files changed, 67 insertions(+), 2 deletions(-) + Modules/clinic/posixmodule.c.h | 2 ++ + Modules/posixmodule.c | 18 ++++++++++++-- + configure | 43 ++++++++++++++++++++++++++++++++++ + configure.ac | 5 ++++ + pyconfig.h.in | 3 +++ + 5 files changed, 69 insertions(+), 2 deletions(-) +diff --git a/Modules/clinic/posixmodule.c.h b/Modules/clinic/posixmodule.c.h +index 14a6efb9ac9..6e716f77db8 100644 +--- a/Modules/clinic/posixmodule.c.h ++++ b/Modules/clinic/posixmodule.c.h +@@ -11652,6 +11652,7 @@ PyDoc_STRVAR(os_DirEntry_inode__doc__, + #define OS_DIRENTRY_INODE_METHODDEF \ + {"inode", (PyCFunction)os_DirEntry_inode, METH_NOARGS, os_DirEntry_inode__doc__}, + ++#ifdef HAVE_DIRENT_D_INO + static PyObject * + os_DirEntry_inode_impl(DirEntry *self); + +@@ -11660,6 +11661,7 @@ os_DirEntry_inode(DirEntry *self, PyObject *Py_UNUSED(ignored)) + { + return os_DirEntry_inode_impl(self); + } ++#endif + + PyDoc_STRVAR(os_DirEntry___fspath____doc__, + "__fspath__($self, /)\n" diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 51e34b5f4b7..2aa507aa942 100644 --- a/Modules/posixmodule.c diff --git a/interpreters/python/patch/0011-avoid-redefinition-warning-if-UNUSED-is-already-defi.patch b/interpreters/python/patch/0011-avoid-redefinition-warning-if-UNUSED-is-already-defi.patch new file mode 100644 index 00000000000..15b5cf0c0f1 --- /dev/null +++ b/interpreters/python/patch/0011-avoid-redefinition-warning-if-UNUSED-is-already-defi.patch @@ -0,0 +1,26 @@ +From b82ab44e498a9e9bcdcbbfa1d6161023d8ea8c5b Mon Sep 17 00:00:00 2001 +From: Tiago Medicci +Date: Tue, 10 Dec 2024 12:03:47 -0300 +Subject: [PATCH 11/11] avoid redefinition warning if UNUSED is already defined + +--- + Parser/pegen.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/Parser/pegen.h b/Parser/pegen.h +index 32c64e7774b..42574456f23 100644 +--- a/Parser/pegen.h ++++ b/Parser/pegen.h +@@ -250,7 +250,9 @@ void * _PyPegen_seq_last_item(asdl_seq *seq); + #define PyPegen_last_item(seq, type) ((type)_PyPegen_seq_last_item((asdl_seq*)seq)) + void * _PyPegen_seq_first_item(asdl_seq *seq); + #define PyPegen_first_item(seq, type) ((type)_PyPegen_seq_first_item((asdl_seq*)seq)) ++#ifndef UNUSED + #define UNUSED(expr) do { (void)(expr); } while (0) ++#endif + #define EXTRA_EXPR(head, tail) head->lineno, (head)->col_offset, (tail)->end_lineno, (tail)->end_col_offset, p->arena + #define EXTRA _start_lineno, _start_col_offset, _end_lineno, _end_col_offset, p->arena + PyObject *_PyPegen_new_type_comment(Parser *, const char *); +-- +2.46.1 + From e861ea8b53e6c86b28274e3651036761d17d88ea Mon Sep 17 00:00:00 2001 From: chao an Date: Tue, 10 Dec 2024 21:06:08 +0800 Subject: [PATCH 042/391] nshlib/[cd|ls|pwd]: add support for local CWD(Current working directory) This PR will still allow basic shell operations such as cd/ls/pwd to be used even when the environment is disabled. Signed-off-by: chao an --- nshlib/nsh.h | 14 ++++++-------- nshlib/nsh_command.c | 8 ++------ nshlib/nsh_console.c | 7 +++++++ nshlib/nsh_console.h | 6 ++++++ nshlib/nsh_envcmds.c | 35 +++++++++++++++++++++-------------- nshlib/nsh_fscmds.c | 7 +------ 6 files changed, 43 insertions(+), 34 deletions(-) diff --git a/nshlib/nsh.h b/nshlib/nsh.h index 75c84f856ee..42b7167c2e3 100644 --- a/nshlib/nsh.h +++ b/nshlib/nsh.h @@ -867,10 +867,10 @@ int nsh_fileapp(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd, FAR char **argv, FAR const struct nsh_param_s *param); #endif -#ifndef CONFIG_DISABLE_ENVIRON /* Working directory support */ -FAR const char *nsh_getcwd(void); +FAR const char *nsh_getcwd(FAR struct nsh_vtbl_s *vtbl); +#ifndef CONFIG_DISABLE_ENVIRON FAR char *nsh_getfullpath(FAR struct nsh_vtbl_s *vtbl, FAR const char *relpath); void nsh_freefullpath(FAR char *fullpath); @@ -1071,14 +1071,12 @@ int cmd_irqinfo(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv); # endif #endif /* !CONFIG_DISABLE_MOUNTPOINT */ -#if !defined(CONFIG_DISABLE_ENVIRON) -# ifndef CONFIG_NSH_DISABLE_CD +#ifndef CONFIG_NSH_DISABLE_CD int cmd_cd(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv); -# endif -# ifndef CONFIG_NSH_DISABLE_PWD +#endif +#ifndef CONFIG_NSH_DISABLE_PWD int cmd_pwd(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv); -# endif -#endif /* !CONFIG_DISABLE_MOUNTPOINT */ +#endif #ifndef CONFIG_NSH_DISABLE_ENV int cmd_env(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv); diff --git a/nshlib/nsh_command.c b/nshlib/nsh_command.c index c31a89b86e8..69fd54a92ea 100644 --- a/nshlib/nsh_command.c +++ b/nshlib/nsh_command.c @@ -162,10 +162,8 @@ static const struct cmdmap_s g_cmdmap[] = "[ [ [ ...]]]"), #endif -#ifndef CONFIG_DISABLE_ENVIRON -# ifndef CONFIG_NSH_DISABLE_CD +#ifndef CONFIG_NSH_DISABLE_CD CMD_MAP("cd", cmd_cd, 1, 2, "[|-|~|..]"), -# endif #endif #ifndef CONFIG_NSH_DISABLE_CP @@ -485,10 +483,8 @@ static const struct cmdmap_s g_cmdmap[] = # endif #endif -#ifndef CONFIG_DISABLE_ENVIRON -# ifndef CONFIG_NSH_DISABLE_PWD +#ifndef CONFIG_NSH_DISABLE_PWD CMD_MAP("pwd", cmd_pwd, 1, 1, NULL), -# endif #endif #if !defined(CONFIG_NSH_DISABLE_READLINK) && defined(CONFIG_PSEUDOFS_SOFTLINKS) diff --git a/nshlib/nsh_console.c b/nshlib/nsh_console.c index ad1191df72e..ffa05864068 100644 --- a/nshlib/nsh_console.c +++ b/nshlib/nsh_console.c @@ -442,6 +442,13 @@ FAR struct console_stdio_s *nsh_newconsole(bool isctty) /* Initialize the input stream */ INFD(pstate) = STDIN_FILENO; + + /* Initialize current working directory */ + +#ifdef CONFIG_DISABLE_ENVIRON + strlcpy(pstate->cn_vtbl.cwd, CONFIG_LIBC_HOMEDIR, + sizeof(pstate->cn_vtbl.cwd)); +#endif } return pstate; diff --git a/nshlib/nsh_console.h b/nshlib/nsh_console.h index 31edf27e689..9d305be014b 100644 --- a/nshlib/nsh_console.h +++ b/nshlib/nsh_console.h @@ -150,6 +150,12 @@ struct nsh_vtbl_s /* Ctrl tty or not */ bool isctty; + + /* Current working directory */ + +#ifdef CONFIG_DISABLE_ENVIRON + char cwd[PATH_MAX]; +#endif }; /* This structure describes a console front-end that is based on stdin and diff --git a/nshlib/nsh_envcmds.c b/nshlib/nsh_envcmds.c index 7f06e48b322..331af3e9f9e 100644 --- a/nshlib/nsh_envcmds.c +++ b/nshlib/nsh_envcmds.c @@ -49,9 +49,12 @@ #ifndef CONFIG_DISABLE_ENVIRON static const char g_pwd[] = "PWD"; -#ifndef CONFIG_NSH_DISABLE_CD +# ifndef CONFIG_NSH_DISABLE_CD static const char g_oldpwd[] = "OLDPWD"; +# endif #endif + +#if !defined(CONFIG_NSH_DISABLE_CD) || !defined(CONFIG_DISABLE_ENVIRON) static const char g_home[] = CONFIG_LIBC_HOMEDIR; #endif @@ -169,12 +172,14 @@ static int nsh_dumpvar(FAR struct nsh_vtbl_s *vtbl, FAR void *arg, * Name: nsh_getwd ****************************************************************************/ -#ifndef CONFIG_DISABLE_ENVIRON -FAR const char *nsh_getcwd(void) +FAR const char *nsh_getcwd(FAR struct nsh_vtbl_s *vtbl) { +#ifndef CONFIG_DISABLE_ENVIRON return nsh_getwd(g_pwd); -} +#else + return vtbl->cwd; #endif +} /**************************************************************************** * Name: nsh_getfullpath @@ -201,7 +206,7 @@ FAR char *nsh_getfullpath(FAR struct nsh_vtbl_s *vtbl, /* Get the path to the current working directory */ - wd = nsh_getcwd(); + wd = nsh_getcwd(vtbl); /* Fake the '.' directory */ @@ -214,13 +219,11 @@ FAR char *nsh_getfullpath(FAR struct nsh_vtbl_s *vtbl, return nsh_getdirpath(vtbl, wd, relpath); } -#endif /**************************************************************************** * Name: nsh_freefullpath ****************************************************************************/ -#ifndef CONFIG_DISABLE_ENVIRON void nsh_freefullpath(FAR char *fullpath) { if (fullpath) @@ -228,13 +231,12 @@ void nsh_freefullpath(FAR char *fullpath) free(fullpath); } } -#endif +#endif /* CONFIG_DISABLE_ENVIRON */ /**************************************************************************** * Name: cmd_cd ****************************************************************************/ -#ifndef CONFIG_DISABLE_ENVIRON #ifndef CONFIG_NSH_DISABLE_CD int cmd_cd(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv) { @@ -249,14 +251,16 @@ int cmd_cd(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv) { path = g_home; } +#ifndef CONFIG_DISABLE_ENVIRON else if (strcmp(path, "-") == 0) { alloc = strdup(nsh_getwd(g_oldpwd)); path = alloc; } +#endif else if (strcmp(path, "..") == 0) { - alloc = strdup(nsh_getcwd()); + alloc = strdup(nsh_getcwd(vtbl)); path = dirname(alloc); } else @@ -273,6 +277,12 @@ int cmd_cd(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv) nsh_error(vtbl, g_fmtcmdfailed, argv[0], "chdir", NSH_ERRNO); ret = ERROR; } +#ifdef CONFIG_DISABLE_ENVIRON + else + { + strlcpy(vtbl->cwd, path, sizeof(vtbl->cwd)); + } +#endif /* Free any memory that was allocated */ @@ -289,7 +299,6 @@ int cmd_cd(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv) return ret; } #endif -#endif /**************************************************************************** * Name: cmd_echo @@ -394,18 +403,16 @@ int cmd_env(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv) * Name: cmd_pwd ****************************************************************************/ -#ifndef CONFIG_DISABLE_ENVIRON #ifndef CONFIG_NSH_DISABLE_PWD int cmd_pwd(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv) { UNUSED(argc); UNUSED(argv); - nsh_output(vtbl, "%s\n", nsh_getcwd()); + nsh_output(vtbl, "%s\n", nsh_getcwd(vtbl)); return OK; } #endif -#endif /**************************************************************************** * Name: cmd_set diff --git a/nshlib/nsh_fscmds.c b/nshlib/nsh_fscmds.c index 88f76d1ee3f..aef6fd72f62 100644 --- a/nshlib/nsh_fscmds.c +++ b/nshlib/nsh_fscmds.c @@ -1578,12 +1578,7 @@ int cmd_ls(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv) } else if (optind >= argc) { -#ifndef CONFIG_DISABLE_ENVIRON - relpath = nsh_getcwd(); -#else - nsh_error(vtbl, g_fmtargrequired, argv[0]); - return ERROR; -#endif + relpath = nsh_getcwd(vtbl); } else { From fa22f80ee3a0b6b232752e8d796129bd79082da8 Mon Sep 17 00:00:00 2001 From: buxiasen Date: Wed, 11 Dec 2024 21:23:16 +0800 Subject: [PATCH 043/391] ramspeed: fix dest align typo, add not-aligned print Signed-off-by: buxiasen --- benchmarks/ramspeed/ramspeed_main.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/benchmarks/ramspeed/ramspeed_main.c b/benchmarks/ramspeed/ramspeed_main.c index b11bdaf76dc..6eb4bfe678d 100644 --- a/benchmarks/ramspeed/ramspeed_main.c +++ b/benchmarks/ramspeed/ramspeed_main.c @@ -152,16 +152,18 @@ static void parse_commandline(int argc, FAR char **argv, OPTARG_TO_VALUE(info->src, const void *, 16); if (((uintptr_t)info->src & ALIGN_MASK) != 0) { - printf(RAMSPEED_PREFIX " must align\n"); + printf(RAMSPEED_PREFIX " must align %p\n", + info->src); exit(EXIT_FAILURE); } break; case 'w': OPTARG_TO_VALUE(info->dest, void *, 16); - if (((uintptr_t)info->src & ALIGN_MASK) != 0) + if (((uintptr_t)info->dest & ALIGN_MASK) != 0) { - printf(RAMSPEED_PREFIX " must align\n"); + printf(RAMSPEED_PREFIX " must align %p\n", + info->dest); exit(EXIT_FAILURE); } break; From 9c5568c2afb8ae5f4ed8bfc68c07e8e8beba3d4f Mon Sep 17 00:00:00 2001 From: Lup Yuen Lee Date: Mon, 16 Dec 2024 21:54:20 +0800 Subject: [PATCH 044/391] testing/ltp: Increase Stack Size Inside CI Build risc-v-05: `rv-virt:citest` fails with a Stack Overflow at ltp_interfaces_pthread_barrierattr_init_2_1: - https://github.com/apache/nuttx/issues/15170 This PR doubles the Stack Size for `testing/ltp` (from 4096 bytes to 8192), so that `rv-virt:citest` completes successfully. --- testing/ltp/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/ltp/Kconfig b/testing/ltp/Kconfig index 764dda7f701..6fc5d1fdb72 100644 --- a/testing/ltp/Kconfig +++ b/testing/ltp/Kconfig @@ -13,6 +13,6 @@ if TESTING_LTP config TESTING_LTP_STACKSIZE int "Linux Test Project stack size" - default 4096 + default 8192 endif #TESTING_LTP From 32ee7611bbd4d5d6a31609bcd2dafa273133b894 Mon Sep 17 00:00:00 2001 From: hujun5 Date: Tue, 17 Dec 2024 10:01:44 +0800 Subject: [PATCH 045/391] fix a typo Signed-off-by: hujun5 --- netutils/chat/chat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netutils/chat/chat.c b/netutils/chat/chat.c index cbc2326a552..38ab5dc9201 100644 --- a/netutils/chat/chat.c +++ b/netutils/chat/chat.c @@ -61,7 +61,7 @@ #define CHAT_TOKEN_SIZE 128 /**************************************************************************** - * Pivate types + * Private types ****************************************************************************/ /* Type of singly-linked list of tokens */ From 2e0b5776804547bfa4df5bd5b34627b84c04475d Mon Sep 17 00:00:00 2001 From: zhangshoukui Date: Thu, 7 Nov 2024 21:17:18 +0800 Subject: [PATCH 046/391] drivertest_uart: The string was not truncated because one more character was read #0 0x43c7443a in strnlen nuttx/libs/libc/string/lib_strnlen.c:42 #1 0x43c698aa in vsprintf_internal nuttx/libs/libc/stdio/lib_libvsprintf.c:933 #2 0x43c6ca80 in lib_vsprintf nuttx/libs/libc/stdio/lib_libvsprintf.c:1383 #3 0x4409c0bd in vsnprintf nuttx/libs/libc/stdio/lib_vsnprintf.c:72 #4 0x47137cd0 in vcmocka_print_error apps/testing/cmocka/cmocka/src/cmocka.c:2097 #5 0x47139573 in cmocka_print_error apps/testing/cmocka/cmocka/src/cmocka.c:2422 #6 0x471376ff in string_equal_display_error apps/testing/cmocka/cmocka/src/cmocka.c:1410 #7 0x471379a0 in _assert_string_equal apps/testing/cmocka/cmocka/src/cmocka.c:1952 #8 0x4433d972 in read_default apps/testing/drivertest/drivertest_uart.c:242 #9 0x4713c6cd in cmocka_run_one_test_or_fixture apps/testing/cmocka/cmocka/src/cmocka.c:3029 #10 0x4713d487 in cmocka_run_one_tests apps/testing/cmocka/cmocka/src/cmocka.c:3143 #11 0x4713f2ca in _cmocka_run_group_tests apps/testing/cmocka/cmocka/src/cmocka.c:3294 #12 0x443444c6 in cmocka_driver_uart_main apps/testing/drivertest/drivertest_uart.c:358 #13 0x4409a472 in nxtask_startup nuttx/libs/libc/sched/task_startup.c:72 #14 0x43dc92e7 in nxtask_start nuttx/sched/task/task_start.c:116 #15 0x43e31f00 in pre_start nuttx/arch/sim/src/sim/sim_initialstate.c:52 Signed-off-by: zhangshoukui --- testing/drivertest/drivertest_uart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/drivertest/drivertest_uart.c b/testing/drivertest/drivertest_uart.c index d26d07005cf..093d002c375 100644 --- a/testing/drivertest/drivertest_uart.c +++ b/testing/drivertest/drivertest_uart.c @@ -226,7 +226,7 @@ static void read_default(FAR void **state) while (cnt < sizeof(DEFAULT_CONTENT) - 1) { - ssize_t n = read(test_state->fd, buffer + cnt, buffer_size - cnt); + ssize_t n = read(test_state->fd, buffer + cnt, buffer_size - cnt - 1); assert_true(n >= 0); if (n == 0) From 7e77ab29e574c3831d6d079191b1af7a909ee879 Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Mon, 16 Dec 2024 21:34:58 +0800 Subject: [PATCH 047/391] uORB/sensor: Add macro for satellite format string Make it easier to extend the format of struct member Signed-off-by: wangjianyu3 --- system/uorb/sensor/gnss.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/system/uorb/sensor/gnss.c b/system/uorb/sensor/gnss.c index 6a8a6e50a53..d3ba1f4a54a 100644 --- a/system/uorb/sensor/gnss.c +++ b/system/uorb/sensor/gnss.c @@ -34,6 +34,12 @@ "altitude:%hf,altitude_ellipsoid:%hf,eph:%hf,epv:%hf,hdop:%hf,pdop:%hf," \ "vdop:%hf,ground_speed:%hf,course:%hf,satellites_used:%" PRIu32 "" +#define SENSOR_GNSS_SATELLITE_INFO_FORMAT(idx) \ + ",svid" #idx ":%" PRIu32 \ + ",elevation" #idx ":%" PRIu32 \ + ",azimuth" #idx ":%" PRIu32 \ + ",snr" #idx ":%" PRIu32 "" + static const char sensor_gnss_format[] = UORB_DEBUG_FORMAT_SENSOR_GNSS ",firmware_version:%" PRIu32 ""; @@ -62,13 +68,12 @@ static const char sensor_gnss_measurement_format[] = static const char sensor_gnss_satellite_format[] = "timestamp:%" PRIu64 ",count:%" PRIu32 ",satellites:%" PRIu32 "," - "constellation:%" PRIu32 "," - "svid0:%" PRIu32 ",elevation0:%" PRIu32 ",azimuth0:%" PRIu32 "," - "snr0:%" PRIu32 ",svid1:%" PRIu32 ",elevation1:%" PRIu32 "," - "azimuth1:%" PRIu32 ",snr1:%" PRIu32 ",svid2:%" PRIu32 "," - "elevation2:%" PRIu32 ",azimuth2:%" PRIu32 ",snr2:%" PRIu32 "," - "svid3:%" PRIu32 ",elevation3:%" PRIu32 ",azimuth3:%" PRIu32 "," - "snr3:%" PRIu32 ""; + "constellation:%" PRIu32 "" + SENSOR_GNSS_SATELLITE_INFO_FORMAT(0) + SENSOR_GNSS_SATELLITE_INFO_FORMAT(1) + SENSOR_GNSS_SATELLITE_INFO_FORMAT(2) + SENSOR_GNSS_SATELLITE_INFO_FORMAT(3) + ; #endif /**************************************************************************** From 9c8a96aa51625b27f2d72215f016c8f27e087d94 Mon Sep 17 00:00:00 2001 From: chao an Date: Tue, 17 Dec 2024 11:47:48 +0800 Subject: [PATCH 048/391] nshlib: add support for disable sigmask from ps command before: nsh> ps PID GROUP PRI POLICY TYPE NPX STATE EVENT SIGMASK STACK COMMAND 0 0 0 FIFO Kthread - Ready 0000000000000000 0069616 Idle_Task 1 0 224 FIFO Kthread - Waiting Signal 0000000000000000 0067536 loop_task 2 0 224 FIFO Kthread - Waiting Semaphore 0000000000000000 0067504 hpwork 0x400fcfe0 0x400fd028 3 3 100 FIFO Task - Running 0000000000000000 0067536 nsh_main after: nsh> ps PID GROUP PRI POLICY TYPE NPX STATE EVENT STACK COMMAND 0 0 0 FIFO Kthread - Ready 0069616 Idle_Task 1 0 224 FIFO Kthread - Waiting Signal 0067536 loop_task 2 0 224 FIFO Kthread - Waiting Semaphore 0067504 hpwork 0x400fcfe0 0x400fd028 3 3 100 FIFO Task - Running 0067536 nsh_main Signed-off-by: chao an --- nshlib/Kconfig | 7 +++++++ nshlib/nsh_proccmds.c | 25 ++++++++++++++++++++++--- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/nshlib/Kconfig b/nshlib/Kconfig index 388099ef0a7..78633e9da41 100644 --- a/nshlib/Kconfig +++ b/nshlib/Kconfig @@ -564,6 +564,13 @@ config NSH_DISABLE_PSSTACKUSAGE ---help--- Disable to save space and not pull in floating point routines +config NSH_DISABLE_PSSIGMASK + bool "Disable ps sigmask" + depends on !NSH_DISABLE_PS + default DEFAULT_SMALL + ---help--- + Disable sigmask print from ps + config NSH_DISABLE_PUT bool "Disable put" default DEFAULT_SMALL diff --git a/nshlib/nsh_proccmds.c b/nshlib/nsh_proccmds.c index 73f97aa111e..497aa0e00e7 100644 --- a/nshlib/nsh_proccmds.c +++ b/nshlib/nsh_proccmds.c @@ -93,7 +93,9 @@ struct nsh_taskstatus_s FAR const char *td_flags; /* Thread flags */ FAR const char *td_priority; /* Thread priority */ FAR const char *td_policy; /* Thread scheduler */ +#ifndef CONFIG_NSH_DISABLE_PSSIGMASK FAR const char *td_sigmask; /* Signal mask */ +#endif FAR char *td_cmdline; /* Command line */ int td_pid; /* Task ID */ #ifdef NSH_HAVE_CPULOAD @@ -134,7 +136,9 @@ static const char g_state[] = "State:"; static const char g_flags[] = "Flags:"; static const char g_priority[] = "Priority:"; static const char g_scheduler[] = "Scheduler:"; +#ifndef CONFIG_NSH_DISABLE_PSSIGMASK static const char g_sigmask[] = "SigMask:"; +#endif # ifdef PS_SHOW_HEAPSIZE static const char g_heapsize[] = "AllocSize:"; # endif /* PS_SHOW_HEAPSIZE */ @@ -244,10 +248,12 @@ static void nsh_parse_statusline(FAR char *line, status->td_policy = nsh_trimspaces(&line[12 + 6]); } +#ifndef CONFIG_NSH_DISABLE_PSSIGMASK else if (strncmp(line, g_sigmask, strlen(g_sigmask)) == 0) { status->td_sigmask = nsh_trimspaces(&line[12]); } +#endif } #endif @@ -342,7 +348,9 @@ static int ps_record(FAR struct nsh_vtbl_s *vtbl, FAR const char *dirpath, status->td_flags = ""; status->td_priority = ""; status->td_policy = ""; +#ifndef CONFIG_NSH_DISABLE_PSSIGMASK status->td_sigmask = ""; +#endif status->td_cmdline = ""; status->td_pid = atoi(entryp->d_name); #ifdef NSH_HAVE_CPULOAD @@ -547,7 +555,10 @@ static void ps_title(FAR struct nsh_vtbl_s *vtbl, bool heap) #ifdef CONFIG_SMP "%3s " #endif - "%3s %-8s %-7s %3s %-8s %-9s %-16s " + "%3s %-8s %-7s %3s %-8s %-9s " +#ifndef CONFIG_NSH_DISABLE_PSSIGMASK + "%-16s " +#endif #ifdef PS_SHOW_HEAPSIZE "%s " #endif @@ -565,7 +576,10 @@ static void ps_title(FAR struct nsh_vtbl_s *vtbl, bool heap) #ifdef CONFIG_SMP , "CPU" #endif - , "PRI", "POLICY", "TYPE", "NPX", "STATE", "EVENT", "SIGMASK" + , "PRI", "POLICY", "TYPE", "NPX", "STATE", "EVENT" +#ifndef CONFIG_NSH_DISABLE_PSSIGMASK + , "SIGMASK" +#endif #ifdef PS_SHOW_HEAPSIZE , heapsize #endif @@ -608,7 +622,10 @@ static void ps_output(FAR struct nsh_vtbl_s *vtbl, bool heap, #ifdef CONFIG_SMP "%3s " #endif - "%3s %-8s %-7s %3s %-8s %-9s %-8s " + "%3s %-8s %-7s %3s %-8s %-9s " +#ifndef CONFIG_NSH_DISABLE_PSSIGMASK + "%-8s " +#endif #ifdef PS_SHOW_HEAPSIZE "%s " #endif @@ -628,7 +645,9 @@ static void ps_output(FAR struct nsh_vtbl_s *vtbl, bool heap, #endif , status->td_priority, status->td_policy , status->td_type , status->td_flags , status->td_state, status->td_event +#ifndef CONFIG_NSH_DISABLE_PSSIGMASK , status->td_sigmask +#endif #ifdef PS_SHOW_HEAPSIZE , heapsize #endif From 53db7817d9a1800346840a0015f55056bb064f02 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Wed, 18 Dec 2024 10:45:37 +0900 Subject: [PATCH 049/391] Remove all references to CONFIG_SCHED_ATEXIT It has been removed a few years ago. https://github.com/apache/nuttx/pull/6197 --- crypto/libtomcrypt/Kconfig | 1 - interpreters/luamodules/luv/Kconfig | 1 - 2 files changed, 2 deletions(-) diff --git a/crypto/libtomcrypt/Kconfig b/crypto/libtomcrypt/Kconfig index fcf22323164..2af14e6e1c7 100644 --- a/crypto/libtomcrypt/Kconfig +++ b/crypto/libtomcrypt/Kconfig @@ -54,7 +54,6 @@ endif # LIBTOMCRYPT_LTCRYPT config LIBTOMCRYPT_HASHSUM tristate "LibTomCrypt hashsum" - depends on SCHED_ATEXIT default n ---help--- Demo hashsum application diff --git a/interpreters/luamodules/luv/Kconfig b/interpreters/luamodules/luv/Kconfig index fafe2fc2b61..88b2bcb14f4 100644 --- a/interpreters/luamodules/luv/Kconfig +++ b/interpreters/luamodules/luv/Kconfig @@ -15,7 +15,6 @@ config LUA_LUV_MODULE select NET_TCP select NET_UDP select PSEUDOFS_SOFTLINKS - select SCHED_ATEXIT select SCHED_HAVE_PARENT ---help--- Bare libuv bindings for Lua From 1e199e4d4fbbb06b0568e0d0794f9b5f49c535e9 Mon Sep 17 00:00:00 2001 From: tengshuangshuang Date: Tue, 17 Dec 2024 11:15:40 +0800 Subject: [PATCH 050/391] test:add mutex socket syscall directory some test cases have been added that cover the functionality of fs, mutex, pthread, socket, and syscall Signed-off-by: tengshuangshuang --- testing/testsuites/Kconfig | 15 + testing/testsuites/Makefile | 24 + .../kernel/fs/cases/fs_append_test.c | 40 +- .../kernel/fs/cases/fs_creat_test.c | 29 +- .../testsuites/kernel/fs/cases/fs_dup2_test.c | 29 +- .../testsuites/kernel/fs/cases/fs_dup_test.c | 40 +- .../kernel/fs/cases/fs_eventfd_test.c | 38 +- .../kernel/fs/cases/fs_fcntl_test.c | 41 +- .../kernel/fs/cases/fs_fstat_test.c | 36 +- .../kernel/fs/cases/fs_fstatfs_test.c | 41 +- .../kernel/fs/cases/fs_fsync_test.c | 49 +- .../kernel/fs/cases/fs_getfilep_test.c | 34 +- .../kernel/fs/cases/fs_mkdir_test.c | 22 +- .../testsuites/kernel/fs/cases/fs_open_test.c | 62 +- .../kernel/fs/cases/fs_opendir_test.c | 22 +- .../testsuites/kernel/fs/cases/fs_poll_test.c | 23 +- .../kernel/fs/cases/fs_pread_test.c | 22 +- .../kernel/fs/cases/fs_pwrite_test.c | 22 +- .../testsuites/kernel/fs/cases/fs_read_test.c | 26 +- .../kernel/fs/cases/fs_readdir_test.c | 45 +- .../kernel/fs/cases/fs_readlink_test.c | 36 +- .../kernel/fs/cases/fs_rename_test.c | 30 +- .../kernel/fs/cases/fs_rewinddir_test.c | 44 +- .../kernel/fs/cases/fs_rmdir_test.c | 162 ++-- .../testsuites/kernel/fs/cases/fs_seek_test.c | 41 +- .../kernel/fs/cases/fs_sendfile_test.c | 41 +- .../testsuites/kernel/fs/cases/fs_stat_test.c | 29 +- .../kernel/fs/cases/fs_statfs_test.c | 32 +- .../kernel/fs/cases/fs_stream_test.c | 104 +-- .../kernel/fs/cases/fs_symlink_test.c | 43 +- .../kernel/fs/cases/fs_truncate_test.c | 22 +- .../kernel/fs/cases/fs_unlink_test.c | 25 +- .../kernel/fs/cases/fs_write_test.c | 22 +- testing/testsuites/kernel/fs/cmocka_fs_test.c | 218 ++--- .../kernel/fs/common/test_fs_common.c | 69 +- testing/testsuites/kernel/fs/include/fstest.h | 132 +-- .../testsuites/kernel/mm/cases/mm_test_001.c | 21 +- .../testsuites/kernel/mm/cases/mm_test_002.c | 23 +- .../testsuites/kernel/mm/cases/mm_test_003.c | 19 +- .../testsuites/kernel/mm/cases/mm_test_004.c | 19 +- .../testsuites/kernel/mm/cases/mm_test_005.c | 23 +- .../testsuites/kernel/mm/cases/mm_test_006.c | 22 +- .../testsuites/kernel/mm/cases/mm_test_007.c | 41 +- .../testsuites/kernel/mm/cases/mm_test_008.c | 61 +- testing/testsuites/kernel/mm/cmocka_mm_test.c | 66 +- .../kernel/mm/common/test_mm_common.c | 44 +- testing/testsuites/kernel/mm/include/MmTest.h | 58 +- .../kernel/mm/tool/mem_batch_opt_perf_test.c | 57 +- .../kernel/mm/tool/mem_cycle_opt_perf_test.c | 61 +- .../kernel/mutex/cases/posix_mutex_test_001.c | 56 ++ .../kernel/mutex/cases/posix_mutex_test_019.c | 276 +++++++ .../kernel/mutex/cases/posix_mutex_test_020.c | 89 ++ .../kernel/mutex/cmocka_mutex_test.c | 62 ++ .../kernel/mutex/include/MutexTest.h | 66 ++ .../pthread/cases/posix_pthread_test_003.c | 28 +- .../pthread/cases/posix_pthread_test_004.c | 41 +- .../pthread/cases/posix_pthread_test_005.c | 39 +- .../pthread/cases/posix_pthread_test_006.c | 25 +- .../pthread/cases/posix_pthread_test_009.c | 47 +- .../pthread/cases/posix_pthread_test_018.c | 85 +- .../pthread/cases/posix_pthread_test_019.c | 43 +- .../pthread/cases/posix_pthread_test_021.c | 31 +- .../kernel/pthread/cmocka_pthread_test.c | 49 +- .../pthread/common/test_pthread_common.c | 26 +- .../kernel/pthread/include/PthreadTest.h | 60 +- .../kernel/sched/cases/api_pthread_test_001.c | 23 +- .../kernel/sched/cases/api_pthread_test_002.c | 23 +- .../kernel/sched/cases/api_pthread_test_003.c | 25 +- .../kernel/sched/cases/api_pthread_test_004.c | 30 +- .../kernel/sched/cases/api_pthread_test_005.c | 23 +- .../kernel/sched/cases/api_pthread_test_006.c | 25 +- .../kernel/sched/cases/api_pthread_test_007.c | 39 +- .../kernel/sched/cases/api_pthread_test_008.c | 33 +- .../kernel/sched/cases/api_pthread_test_009.c | 36 +- .../kernel/sched/cases/api_task_test_001.c | 25 +- .../kernel/sched/cases/api_task_test_002.c | 25 +- .../kernel/sched/cases/api_task_test_003.c | 25 +- .../kernel/sched/cases/api_task_test_004.c | 26 +- .../kernel/sched/cases/api_task_test_005.c | 25 +- .../kernel/sched/cases/api_task_test_006.c | 25 +- .../kernel/sched/cases/api_task_test_007.c | 25 +- .../kernel/sched/cmocka_sched_test.c | 31 +- .../kernel/sched/common/test_sched_common.c | 25 +- .../kernel/sched/include/SchedTest.h | 79 +- .../kernel/socket/cases/net_socket_test_005.c | 81 ++ .../kernel/socket/cases/net_socket_test_006.c | 110 +++ .../kernel/socket/cases/net_socket_test_008.c | 339 ++++++++ .../kernel/socket/cases/net_socket_test_009.c | 337 ++++++++ .../kernel/socket/cases/net_socket_test_010.c | 259 ++++++ .../kernel/socket/cases/net_socket_test_011.c | 319 ++++++++ .../kernel/socket/cmocka_socket_test.c | 71 ++ .../kernel/socket/include/SocketTest.h | 80 ++ .../kernel/syscall/cases/Fstatfs_test.c | 104 +++ .../kernel/syscall/cases/accept_test.c | 154 ++++ .../kernel/syscall/cases/bind_test.c | 137 ++++ .../kernel/syscall/cases/chdir_test.c | 103 +++ .../kernel/syscall/cases/clock_gettime_test.c | 106 +++ .../syscall/cases/clock_nanosleep_test.c | 91 +++ .../kernel/syscall/cases/clock_settime_test.c | 67 ++ .../kernel/syscall/cases/close_test.c | 150 ++++ .../kernel/syscall/cases/connect_test.c | 372 +++++++++ .../kernel/syscall/cases/creat_test.c | 123 +++ .../kernel/syscall/cases/dup2_test.c | 157 ++++ .../kernel/syscall/cases/dup_test.c | 244 ++++++ .../kernel/syscall/cases/fcntl_test.c | 318 ++++++++ .../kernel/syscall/cases/fpathconf_test.c | 103 +++ .../kernel/syscall/cases/fsync_test.c | 253 ++++++ .../kernel/syscall/cases/ftruncate_test.c | 126 +++ .../kernel/syscall/cases/getTimeofday_test.c | 94 +++ .../kernel/syscall/cases/getcwd_test.c | 133 +++ .../kernel/syscall/cases/getegid_test.c | 73 ++ .../kernel/syscall/cases/geteuid_test.c | 74 ++ .../kernel/syscall/cases/getgid_test.c | 74 ++ .../kernel/syscall/cases/gethostname_test.c | 53 ++ .../kernel/syscall/cases/getitimer_test.c | 139 ++++ .../kernel/syscall/cases/getpeername_test.c | 197 +++++ .../kernel/syscall/cases/getpid_test.c | 56 ++ .../kernel/syscall/cases/getppid_test.c | 56 ++ .../kernel/syscall/cases/getsocketopt_test.c | 214 +++++ .../kernel/syscall/cases/getuid_test.c | 74 ++ .../kernel/syscall/cases/listen_test.c | 145 ++++ .../kernel/syscall/cases/lseek_test.c | 230 ++++++ .../kernel/syscall/cases/lstat_test.c | 80 ++ .../kernel/syscall/cases/memcmp_test.c | 130 +++ .../kernel/syscall/cases/memcpy_test.c | 135 +++ .../kernel/syscall/cases/memset_test.c | 108 +++ .../kernel/syscall/cases/mkdir_test.c | 198 +++++ .../kernel/syscall/cases/nansleep_test.c | 91 +++ .../kernel/syscall/cases/pathconf_test.c | 86 ++ .../kernel/syscall/cases/pipe_test.c | 98 +++ .../kernel/syscall/cases/pread_test.c | 377 +++++++++ .../kernel/syscall/cases/pwrite_test.c | 322 ++++++++ .../kernel/syscall/cases/read_test.c | 201 +++++ .../kernel/syscall/cases/readdir_test.c | 108 +++ .../kernel/syscall/cases/recvfrom_test.c | 448 ++++++++++ .../kernel/syscall/cases/rmdir_test.c | 121 +++ .../kernel/syscall/cases/sched_test.c | 204 +++++ .../syscall/cases/setsocketopt01_test.c | 162 ++++ .../kernel/syscall/cases/socket_test.c | 208 +++++ .../kernel/syscall/cases/socketpair_test.c | 230 ++++++ .../kernel/syscall/cases/symlink_test.c | 132 +++ .../kernel/syscall/cases/time_test.c | 84 ++ .../kernel/syscall/cases/timer_create_test.c | 62 ++ .../kernel/syscall/cases/timer_delete_test.c | 64 ++ .../kernel/syscall/cases/timer_gettime_test.c | 69 ++ .../kernel/syscall/cases/truncate_test.c | 150 ++++ .../kernel/syscall/cases/unlink_test.c | 78 ++ .../kernel/syscall/cases/write_test.c | 177 ++++ .../kernel/syscall/cmocka_syscall_test.c | 458 +++++++++++ .../syscall/common/test_syscall_common.c | 767 ++++++++++++++++++ .../kernel/syscall/include/SyscallTest.h | 457 +++++++++++ .../kernel/time/cases/clock_test_clock01.c | 38 +- .../kernel/time/cases/clock_test_clock02.c | 17 +- .../kernel/time/cases/clock_test_smoke.c | 86 +- .../kernel/time/cases/clock_test_timer01.c | 45 +- .../kernel/time/cases/clock_test_timer03.c | 58 +- .../kernel/time/cases/clock_test_timer04.c | 37 +- .../kernel/time/cases/clock_test_timer05.c | 72 +- .../testsuites/kernel/time/cmocka_time_test.c | 31 +- .../testsuites/kernel/time/include/TimeTest.h | 41 +- 160 files changed, 14163 insertions(+), 1699 deletions(-) create mode 100644 testing/testsuites/kernel/mutex/cases/posix_mutex_test_001.c create mode 100644 testing/testsuites/kernel/mutex/cases/posix_mutex_test_019.c create mode 100644 testing/testsuites/kernel/mutex/cases/posix_mutex_test_020.c create mode 100644 testing/testsuites/kernel/mutex/cmocka_mutex_test.c create mode 100644 testing/testsuites/kernel/mutex/include/MutexTest.h create mode 100644 testing/testsuites/kernel/socket/cases/net_socket_test_005.c create mode 100644 testing/testsuites/kernel/socket/cases/net_socket_test_006.c create mode 100644 testing/testsuites/kernel/socket/cases/net_socket_test_008.c create mode 100644 testing/testsuites/kernel/socket/cases/net_socket_test_009.c create mode 100644 testing/testsuites/kernel/socket/cases/net_socket_test_010.c create mode 100644 testing/testsuites/kernel/socket/cases/net_socket_test_011.c create mode 100644 testing/testsuites/kernel/socket/cmocka_socket_test.c create mode 100644 testing/testsuites/kernel/socket/include/SocketTest.h create mode 100644 testing/testsuites/kernel/syscall/cases/Fstatfs_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/accept_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/bind_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/chdir_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/clock_gettime_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/clock_nanosleep_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/clock_settime_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/close_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/connect_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/creat_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/dup2_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/dup_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/fcntl_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/fpathconf_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/fsync_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/ftruncate_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/getTimeofday_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/getcwd_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/getegid_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/geteuid_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/getgid_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/gethostname_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/getitimer_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/getpeername_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/getpid_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/getppid_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/getsocketopt_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/getuid_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/listen_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/lseek_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/lstat_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/memcmp_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/memcpy_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/memset_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/mkdir_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/nansleep_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/pathconf_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/pipe_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/pread_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/pwrite_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/read_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/readdir_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/recvfrom_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/rmdir_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/sched_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/setsocketopt01_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/socket_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/socketpair_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/symlink_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/time_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/timer_create_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/timer_delete_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/timer_gettime_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/truncate_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/unlink_test.c create mode 100644 testing/testsuites/kernel/syscall/cases/write_test.c create mode 100644 testing/testsuites/kernel/syscall/cmocka_syscall_test.c create mode 100644 testing/testsuites/kernel/syscall/common/test_syscall_common.c create mode 100644 testing/testsuites/kernel/syscall/include/SyscallTest.h diff --git a/testing/testsuites/Kconfig b/testing/testsuites/Kconfig index b3338d3c86e..1b9070fccbc 100644 --- a/testing/testsuites/Kconfig +++ b/testing/testsuites/Kconfig @@ -49,4 +49,19 @@ config CM_PTHREAD_TEST default n depends on TESTS_TESTSUITES +config CM_SOCKET_TEST + bool "enbale socket test" + default n + depends on TESTS_TESTSUITES + +config CM_SYSCALL_TEST + bool "enbale syscall test" + default n + depends on TESTS_TESTSUITES + +config CM_MUTEX_TEST + bool "enbale mutex test" + default n + depends on TESTS_TESTSUITES + endif # TESTS_TESTSUITES diff --git a/testing/testsuites/Makefile b/testing/testsuites/Makefile index 728b66d0bcf..1b896ef5bf1 100644 --- a/testing/testsuites/Makefile +++ b/testing/testsuites/Makefile @@ -69,4 +69,28 @@ PROGNAME += cmocka_pthread_test MAINSRC += $(CURDIR)/kernel/pthread/cmocka_pthread_test.c endif +ifneq ($(CONFIG_CM_MUTEX_TEST),) +CFLAGS += -I$(CURDIR)/kernel/mutex/include +CSRCS += $(wildcard kernel/mutex/cases/*.c) +CSRCS += $(wildcard kernel/mutex/common/*.c) +PROGNAME += cmocka_mutex_test +MAINSRC += $(CURDIR)/kernel/mutex/cmocka_mutex_test.c +endif + +ifneq ($(CONFIG_CM_SOCKET_TEST),) +CFLAGS += -I$(CURDIR)/kernel/socket/include +CSRCS += $(wildcard kernel/socket/cases/*.c) +PROGNAME += cmocka_socket_test +MAINSRC += $(CURDIR)/kernel/socket/cmocka_socket_test.c +endif + +ifneq ($(CONFIG_CM_SYSCALL_TEST),) +CFLAGS += -I$(CURDIR)/kernel/syscall/include +CFLAGS += -I$(APPDIR)/nshlib +CSRCS += $(wildcard kernel/syscall/cases/*.c) +CSRCS += $(wildcard kernel/syscall/common/*.c) +PROGNAME += cmocka_syscall_test +MAINSRC += $(CURDIR)/kernel/syscall/cmocka_syscall_test.c +endif + include $(APPDIR)/Application.mk diff --git a/testing/testsuites/kernel/fs/cases/fs_append_test.c b/testing/testsuites/kernel/fs/cases/fs_append_test.c index 4beaf284f8b..691109c4c26 100644 --- a/testing/testsuites/kernel/fs/cases/fs_append_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_append_test.c @@ -1,24 +1,26 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_append_test.c - * Copyright (C) 2020 Xiaomi Corporation * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -38,20 +40,20 @@ #define TESTFILENAME "stream01Testfile" -/**************************************************************************** - * Public Functions - ****************************************************************************/ - /**************************************************************************** * Name: stream * Example description: - * 1. open a file with "a+". - * 2. Write some strings to the file. - * 3. Check if the file pointer is offset. + * 1. open a file with "a+". + * 2. Write some strings to the file. + * 3. Check if the file pointer is offset. * Test item: fopen() fseek() ftell() * Expect results: TEST PASSED ****************************************************************************/ +/**************************************************************************** + * Public Functions + ****************************************************************************/ + void test_nuttx_fs_append01(FAR void **state) { FILE *fd; @@ -61,8 +63,8 @@ void test_nuttx_fs_append01(FAR void **state) fd = fopen(TESTFILENAME, "a+"); if (fd == NULL) { - syslog(LOG_ERR, "Unable to open file %s, errno %d\n", - TESTFILENAME, errno); + syslog(LOG_ERR, "Unable to open file %s, errno %d\n", TESTFILENAME, + errno); assert_true(1 == 0); } diff --git a/testing/testsuites/kernel/fs/cases/fs_creat_test.c b/testing/testsuites/kernel/fs/cases/fs_creat_test.c index ce393bb9008..af88a4292dd 100644 --- a/testing/testsuites/kernel/fs/cases/fs_creat_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_creat_test.c @@ -1,24 +1,26 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_creat_test.c - * Copyright (C) 2020 Xiaomi Corporation * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -53,9 +55,10 @@ void test_nuttx_fs_creat01(FAR void **state) { int fd; int ret; - char buf[20] = { - 0 - }; + char buf[20] = + { + 0 + }; struct fs_testsuites_state_s *test_state; diff --git a/testing/testsuites/kernel/fs/cases/fs_dup2_test.c b/testing/testsuites/kernel/fs/cases/fs_dup2_test.c index a1e7bab40a4..7e5faefe53b 100644 --- a/testing/testsuites/kernel/fs/cases/fs_dup2_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_dup2_test.c @@ -1,24 +1,26 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_dup2_test.c - * Copyright (C) 2020 Xiaomi Corporation * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -50,9 +52,10 @@ void test_nuttx_fs_dup201(FAR void **state) { - char buf[16] = { - 0 - }; + char buf[16] = + { + 0 + }; off_t currpos; struct fs_testsuites_state_s *test_state; diff --git a/testing/testsuites/kernel/fs/cases/fs_dup_test.c b/testing/testsuites/kernel/fs/cases/fs_dup_test.c index 3a374fb7dce..7b57379ca64 100644 --- a/testing/testsuites/kernel/fs/cases/fs_dup_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_dup_test.c @@ -1,24 +1,26 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_dup_test.c - * Copyright (C) 2020 Xiaomi Corporation * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -53,9 +55,9 @@ void test_nuttx_fs_dup01(FAR void **state) int fd; int newfd; int rval; - char buf_fd[5] = "hello"; - char buf_new_fd[8] = "littleFS"; - char read_buf[20] = ""; + char buffd[5] = "hello"; + char bufnewfd[8] = "littleFS"; + char readbuf[20] = ""; struct fs_testsuites_state_s *test_state; test_state = (struct fs_testsuites_state_s *)*state; @@ -68,7 +70,7 @@ void test_nuttx_fs_dup01(FAR void **state) /* do write */ - assert_int_in_range(write(fd, buf_fd, sizeof(buf_fd)), 1, sizeof(buf_fd)); + assert_int_in_range(write(fd, buffd, sizeof(buffd)), 1, sizeof(buffd)); /* refresh to storage */ @@ -88,8 +90,8 @@ void test_nuttx_fs_dup01(FAR void **state) /* write newfd after dup */ - rval = write(newfd, buf_new_fd, sizeof(buf_new_fd)); - assert_int_in_range(rval, 1, sizeof(buf_new_fd)); + rval = write(newfd, bufnewfd, sizeof(bufnewfd)); + assert_int_in_range(rval, 1, sizeof(bufnewfd)); /* refresh to storage */ @@ -102,10 +104,10 @@ void test_nuttx_fs_dup01(FAR void **state) /* do double check */ - rval = read(newfd, read_buf, 20); + rval = read(newfd, readbuf, 20); assert_int_in_range(rval, 1, 20); - /* check read_buf */ + /* check readbuf */ - assert_int_equal(strncmp(read_buf, "hellolittleFS", 13), 0); + assert_int_equal(strncmp(readbuf, "hellolittleFS", 13), 0); } diff --git a/testing/testsuites/kernel/fs/cases/fs_eventfd_test.c b/testing/testsuites/kernel/fs/cases/fs_eventfd_test.c index 583c8c21acc..805311eb5e8 100644 --- a/testing/testsuites/kernel/fs/cases/fs_eventfd_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_eventfd_test.c @@ -1,24 +1,26 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_eventfd_test.c - * Copyright (C) 2020 Xiaomi Corporation * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -39,15 +41,17 @@ ****************************************************************************/ /**************************************************************************** - * Name: thread_func + * Name: threadfunc ****************************************************************************/ -__attribute__((unused)) static void *thread_func(void *args) +__attribute__((unused)) static void *threadfunc(void *args) { eventfd_t eventfd01_buffer; + int fd = *(int *)args; + for (int i = 1; i < 6; i++) { - read(*(int *)args, &eventfd01_buffer, sizeof(eventfd_t)); + read(fd, &eventfd01_buffer, sizeof(eventfd_t)); sleep(1); } @@ -75,13 +79,13 @@ void test_nuttx_fs_eventfd(FAR void **state) eventfd01_efd = eventfd(0, 0); assert_int_not_equal(eventfd01_efd, -1); test_state->fd1 = eventfd01_efd; - assert_true(pthread_create(&eventfd01_tid, NULL, - thread_func, &eventfd01_efd) >= 0); + assert_true(pthread_create(&eventfd01_tid, NULL, threadfunc, + &eventfd01_efd) >= 0); for (int i = 1; i < 5; i++) { - eventfd01_ret = write(eventfd01_efd, &eventfd01_buf, - sizeof(eventfd_t)); + eventfd01_ret = + write(eventfd01_efd, &eventfd01_buf, sizeof(eventfd_t)); assert_int_equal(eventfd01_ret, sizeof(eventfd_t)); eventfd01_buf++; sleep(1); diff --git a/testing/testsuites/kernel/fs/cases/fs_fcntl_test.c b/testing/testsuites/kernel/fs/cases/fs_fcntl_test.c index 3b20e0e2603..94007b22a72 100644 --- a/testing/testsuites/kernel/fs/cases/fs_fcntl_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_fcntl_test.c @@ -1,24 +1,26 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_fcntl_test.c - * Copyright (C) 2020 Xiaomi Corporation * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -33,7 +35,6 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ - #define BUFSIZE 512 #define TEST_FILE_1 "fcntl01_testfile" @@ -109,7 +110,7 @@ void test_nuttx_fs_fcntl02(FAR void **state) /* open file */ fd = open(TEST_FILE_2, O_RDWR | O_CREAT, 0700); - assert_int_in_range(fd, 0, 255); + assert_true(fd > 0); /* do fcntl */ @@ -133,10 +134,10 @@ void test_nuttx_fs_fcntl02(FAR void **state) ****************************************************************************/ /**************************************************************************** - * Name: fs_fcntl_set_lile_status + * Name: fsfcntlsetlilestatus ****************************************************************************/ -static int fs_fcntl_set_lile_status(int mode, int fd) +static int fsfcntlsetlilestatus(int mode, int fd) { int flags; int ret; @@ -177,12 +178,14 @@ void test_nuttx_fs_fcntl03(FAR void **state) int ret; int size; int ret2; - char path[32] = { - 0 + char path[32] = + { + 0 }; - char buf[10] = { - 0 + char buf[10] = + { + 0 }; getcwd(path, sizeof(path)); @@ -214,7 +217,7 @@ void test_nuttx_fs_fcntl03(FAR void **state) /* F_SETFL */ - ret = fs_fcntl_set_lile_status(O_APPEND, fd); + ret = fsfcntlsetlilestatus(O_APPEND, fd); assert_int_equal(ret, 0); /* set memory */ diff --git a/testing/testsuites/kernel/fs/cases/fs_fstat_test.c b/testing/testsuites/kernel/fs/cases/fs_fstat_test.c index b79012c7ee3..e0eb6c8dee6 100644 --- a/testing/testsuites/kernel/fs/cases/fs_fstat_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_fstat_test.c @@ -1,24 +1,26 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_fstat_test.c - * Copyright (C) 2020 Xiaomi Corporation * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -127,4 +129,18 @@ void test_nuttx_fs_fstat02(FAR void **state) /* close file */ assert_int_equal(close(fd), 0); + + /* #if defined(CONFIG_NET) + * // creat socket + * fd = socket(AF_INET, SOCK_STREAM, 0); + * assert_int_not_equal(fd, -1); + + * // get file size again + * ret = fstat(fd, &file_s); + * assert_int_equal(ret, 0); + + * assert_true(S_ISSOCK(file_s.st_mode)); + * assert_int_equal(close(fd), 0); + * #endif + */ } diff --git a/testing/testsuites/kernel/fs/cases/fs_fstatfs_test.c b/testing/testsuites/kernel/fs/cases/fs_fstatfs_test.c index cc9b64b3d1c..ab6653878dc 100644 --- a/testing/testsuites/kernel/fs/cases/fs_fstatfs_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_fstatfs_test.c @@ -1,24 +1,26 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_fstatfs_test.c - * Copyright (C) 2020 Xiaomi Corporation * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -44,23 +46,26 @@ ****************************************************************************/ /**************************************************************************** - * Name: test_nuttx_fs_print_statfs + * Name: test_nuttx_fs_printstatfs ****************************************************************************/ -__attribute__((unused)) static void test_nuttx_fs_print_statfs - (struct statfs *buf) +__attribute__((unused)) static void +test_nuttx_fs_printstatfs(struct statfs *buf) { syslog(LOG_INFO, "statfs buffer:\n"); syslog(LOG_INFO, " f_type: %lu\n", (unsigned long)buf->f_type); syslog(LOG_INFO, " f_namelen: %lu\n", (unsigned long)buf->f_namelen); syslog(LOG_INFO, " f_bsize: %lu\n", (unsigned long)buf->f_bsize); syslog(LOG_INFO, " f_blocks: %llu\n", - (unsigned long long)buf->f_blocks); - syslog(LOG_INFO, " f_bfree: %llu\n", (unsigned long long)buf->f_bfree); + (unsigned long long)buf->f_blocks); + syslog(LOG_INFO, " f_bfree: %llu\n", + (unsigned long long)buf->f_bfree); syslog(LOG_INFO, " f_bavail: %llu\n", - (unsigned long long)buf->f_bavail); - syslog(LOG_INFO, " f_files: %llu\n", (unsigned long long)buf->f_files); - syslog(LOG_INFO, " f_ffree: %llu\n", (unsigned long long)buf->f_ffree); + (unsigned long long)buf->f_bavail); + syslog(LOG_INFO, " f_files: %llu\n", + (unsigned long long)buf->f_files); + syslog(LOG_INFO, " f_ffree: %llu\n", + (unsigned long long)buf->f_ffree); } /**************************************************************************** diff --git a/testing/testsuites/kernel/fs/cases/fs_fsync_test.c b/testing/testsuites/kernel/fs/cases/fs_fsync_test.c index e449ab808fe..2518da2b737 100644 --- a/testing/testsuites/kernel/fs/cases/fs_fsync_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_fsync_test.c @@ -1,24 +1,26 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_fsync_test.c - * Copyright (C) 2020 Xiaomi Corporation * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -40,8 +42,10 @@ ****************************************************************************/ #define TESTFILE "FsyncTestFile" -#define BUF "testData123#$%*-=/ sdafasd37575sasdfasdf3563456345" \ - "63456ADSFASDFASDFQWREdf4as5df4as5dfsd ###" +#define BUF \ + "testData123#$%*-=/ " \ + "sdafasd37575sasdfasdf356345634563456ADSFASDFASDFQWREdf4as5df4as5dfs" \ + "d ###" /**************************************************************************** * Public Functions @@ -53,6 +57,8 @@ void test_nuttx_fs_fsync01(FAR void **state) { + /* clock_t start, finish; */ + int fd; int rval; int ret; @@ -97,7 +103,9 @@ void test_nuttx_fs_fsync02(FAR void **state) ssize_t writen = 0; struct statfs statfsbuf; struct fs_testsuites_state_s *test_state; + struct mallinfo mem_info; + memset(&mem_info, 0, sizeof(mem_info)); test_state = (struct fs_testsuites_state_s *)*state; /* delete test file */ @@ -114,10 +122,23 @@ void test_nuttx_fs_fsync02(FAR void **state) ret = fstatfs(fd, &statfsbuf); assert_int_equal(ret, 0); - +#ifdef CONFIG_ARCH_SIM bufsize = statfsbuf.f_bsize; +#else + get_mem_info(&mem_info); + if (mem_info.mxordblk < statfsbuf.f_bsize) + { + bufsize = mem_info.mxordblk - 16; + } + + else + { + bufsize = statfsbuf.f_bsize; + } - syslog(LOG_INFO, "the bsize = %" PRIdPTR "\n", statfsbuf.f_bsize); +#endif + syslog(LOG_INFO, "the fbsize = %"PRIu64",buffer size=%d\n", + statfsbuf.f_bsize, bufsize); /* malloc memory */ diff --git a/testing/testsuites/kernel/fs/cases/fs_getfilep_test.c b/testing/testsuites/kernel/fs/cases/fs_getfilep_test.c index f894c17162a..41a19cbd782 100644 --- a/testing/testsuites/kernel/fs/cases/fs_getfilep_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_getfilep_test.c @@ -1,24 +1,26 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_getfilep_test.c - * Copyright (C) 2020 Xiaomi Corporation * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -27,9 +29,6 @@ #include #include #include - -#include - #include "fstest.h" /**************************************************************************** @@ -97,6 +96,10 @@ void test_nuttx_fs_getfilep01(FAR void **state) fsync(fileno(fp)); + /* put filep */ + + fs_putfilep(filep); + /* get struct file again */ ret = fs_getfilep(fileno(fp), &filep); @@ -105,5 +108,10 @@ void test_nuttx_fs_getfilep01(FAR void **state) assert_int_equal(filep->f_pos, BUF_SIZE); test_state->fd2 = fileno(fp); + + /* put filep */ + + fs_putfilep(filep); + assert_int_equal(fclose(fp), 0); } diff --git a/testing/testsuites/kernel/fs/cases/fs_mkdir_test.c b/testing/testsuites/kernel/fs/cases/fs_mkdir_test.c index 12740b7a56f..a44eed1c795 100644 --- a/testing/testsuites/kernel/fs/cases/fs_mkdir_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_mkdir_test.c @@ -1,24 +1,26 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_mkdir_test.c - * Copyright (C) 2020 Xiaomi Corporation * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include diff --git a/testing/testsuites/kernel/fs/cases/fs_open_test.c b/testing/testsuites/kernel/fs/cases/fs_open_test.c index 898e148f82a..cd45266cec7 100644 --- a/testing/testsuites/kernel/fs/cases/fs_open_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_open_test.c @@ -1,24 +1,26 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_open_test.c - * Copyright (C) 2020 Xiaomi Corporation * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -38,6 +40,7 @@ ****************************************************************************/ #define TESTFILE "testOpenFile" +#define TESTDIR "testOpenDir" /**************************************************************************** * Public Functions @@ -52,9 +55,10 @@ void test_nuttx_fs_open01(FAR void **state) int fd; int ret; char s[] = "test data!"; - char buffer[50] = { - 0 - }; + char buffer[50] = + { + 0 + }; struct fs_testsuites_state_s *test_state; @@ -82,3 +86,35 @@ void test_nuttx_fs_open01(FAR void **state) ret = read(fd, buffer, sizeof(buffer)); assert_true(ret > 0); } + +/**************************************************************************** + * Name: test_nuttx_fs_open02 + ****************************************************************************/ + +void test_nuttx_fs_open02(FAR void **state) +{ + int fd = -1; + int ret = 0; + + /* create a dir for test */ + + ret = mkdir(TESTDIR, 0777); + assert_int_equal(ret, 0); + + /* open file with RDONLY:fatfs will fail,so skip currently 2024-9-25 + */ + +#if 0 + fd = open(TESTDIR, O_RDONLY); + assert_true(fd > 0); + close(fd); +#endif + /* open file with RDWR */ + + fd = open(TESTDIR, O_RDWR); + assert_true(fd < 0); + + /* do rmdir */ + + assert_int_equal(rmdir(TESTDIR), 0); +} diff --git a/testing/testsuites/kernel/fs/cases/fs_opendir_test.c b/testing/testsuites/kernel/fs/cases/fs_opendir_test.c index 01a900f6ecd..83864b49dd0 100644 --- a/testing/testsuites/kernel/fs/cases/fs_opendir_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_opendir_test.c @@ -1,24 +1,26 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_opendir_test.c - * Copyright (C) 2020 Xiaomi Corporation * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include diff --git a/testing/testsuites/kernel/fs/cases/fs_poll_test.c b/testing/testsuites/kernel/fs/cases/fs_poll_test.c index 63ecef44a40..896ea7b9d7c 100644 --- a/testing/testsuites/kernel/fs/cases/fs_poll_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_poll_test.c @@ -1,24 +1,26 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_poll_test.c - * Copyright (C) 2020 Xiaomi Corporation * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -40,7 +42,6 @@ #define I_FILE1 "poll_test1" #define I_FILE2 "poll_test2" - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/testing/testsuites/kernel/fs/cases/fs_pread_test.c b/testing/testsuites/kernel/fs/cases/fs_pread_test.c index 3993a7bf12e..8af428459f5 100644 --- a/testing/testsuites/kernel/fs/cases/fs_pread_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_pread_test.c @@ -1,24 +1,26 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_pread_test.c - * Copyright (C) 2020 Xiaomi Corporation * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include diff --git a/testing/testsuites/kernel/fs/cases/fs_pwrite_test.c b/testing/testsuites/kernel/fs/cases/fs_pwrite_test.c index c224ad487df..9c8fadd1bbd 100644 --- a/testing/testsuites/kernel/fs/cases/fs_pwrite_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_pwrite_test.c @@ -1,24 +1,26 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_pwrite_test.c - * Copyright (C) 2020 Xiaomi Corporation * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include diff --git a/testing/testsuites/kernel/fs/cases/fs_read_test.c b/testing/testsuites/kernel/fs/cases/fs_read_test.c index 13512e9af0d..f0164894a56 100644 --- a/testing/testsuites/kernel/fs/cases/fs_read_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_read_test.c @@ -1,24 +1,26 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_read_test.c - * Copyright (C) 2020 Xiaomi Corporation * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -60,7 +62,7 @@ void test_nuttx_fs_read01(FAR void **state) test_state = (struct fs_testsuites_state_s *)*state; fd = open(TESTFILE, O_WRONLY | O_CREAT, 0777); - assert_int_in_range(fd, 0, 255); + assert_true(fd > 0); test_state->fd1 = fd; size = write(fd, s, sizeof(s)); @@ -68,7 +70,7 @@ void test_nuttx_fs_read01(FAR void **state) close(fd); fd = open(TESTFILE, O_RDONLY, 0777); - assert_int_in_range(fd, 0, 255); + assert_true(fd > 0); test_state->fd1 = fd; size = read(fd, buffer, sizeof(buffer)); assert_int_equal(size, sizeof(s)); diff --git a/testing/testsuites/kernel/fs/cases/fs_readdir_test.c b/testing/testsuites/kernel/fs/cases/fs_readdir_test.c index b2cabbe6471..c7b9b0e5cdb 100644 --- a/testing/testsuites/kernel/fs/cases/fs_readdir_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_readdir_test.c @@ -1,24 +1,26 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_readdir_test.c - * Copyright (C) 2020 Xiaomi Corporation * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -48,19 +50,16 @@ void test_nuttx_fs_readdir01(FAR void **state) { int fd; int ret; - char buf[20] = { - 0 - }; - - char *filename[] = { - "testFile1", - "testFile2", - "testFile3", - "testFile4", - "testFile5", - "testFile6", - "testFile7" - }; + char buf[20] = + { + 0 + }; + + char *filename[] = + { + "testfile1", "testfile2", "testfile3", "testfile4", + "testfile5", "testfile6", "testfile7" + }; DIR *test_dir; struct dirent *dptr; diff --git a/testing/testsuites/kernel/fs/cases/fs_readlink_test.c b/testing/testsuites/kernel/fs/cases/fs_readlink_test.c index 09511681adf..b01da9607c3 100644 --- a/testing/testsuites/kernel/fs/cases/fs_readlink_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_readlink_test.c @@ -1,24 +1,26 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_readlink_test.c - * Copyright (C) 2020 Xiaomi Corporation * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -58,13 +60,15 @@ void test_nuttx_fs_readlink01(FAR void **state) /* test symlink */ - char path[PATH_MAX_SIZE] = { - 0 - }; + char path[PATH_MAX_SIZE] = + { + 0 + }; - char buf[PATH_MAX_SIZE] = { - 0 - }; + char buf[PATH_MAX_SIZE] = + { + 0 + }; struct fs_testsuites_state_s *test_state; diff --git a/testing/testsuites/kernel/fs/cases/fs_rename_test.c b/testing/testsuites/kernel/fs/cases/fs_rename_test.c index 9005e2a6622..656d575d1d0 100644 --- a/testing/testsuites/kernel/fs/cases/fs_rename_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_rename_test.c @@ -1,24 +1,26 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_rename_test.c - * Copyright (C) 2020 Xiaomi Corporation * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -48,15 +50,11 @@ void test_nuttx_fs_rename01(FAR void **state) int ret; char buffer[50]; char filename1[] = "testRenameFile1"; - struct fs_testsuites_state_s *test_state; - - test_state = (struct fs_testsuites_state_s *)*state; /* open file */ fd = open(filename1, O_WRONLY | O_CREAT, 0700); assert_true(fd > 0); - test_state->fd1 = fd; /* set memory */ @@ -67,6 +65,10 @@ void test_nuttx_fs_rename01(FAR void **state) ret = write(fd, buffer, 50); assert_int_in_range(ret, 1, 50); + /* close file befor rename */ + + close(fd); + /* do rename */ status = rename(filename1, "newNameFile1"); diff --git a/testing/testsuites/kernel/fs/cases/fs_rewinddir_test.c b/testing/testsuites/kernel/fs/cases/fs_rewinddir_test.c index f1f5e97c6f2..f88645e14fb 100644 --- a/testing/testsuites/kernel/fs/cases/fs_rewinddir_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_rewinddir_test.c @@ -1,24 +1,26 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_rewinddir_test.c - * Copyright (C) 2020 Xiaomi Corporation * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -58,15 +60,16 @@ ****************************************************************************/ /**************************************************************************** - * Name: test_nuttx_fs_cteat_file + * Name: test_nuttx_fs_cteatfile ****************************************************************************/ -static void test_nuttx_fs_cteat_file(char *filename, size_t write_size) +static void test_nuttx_fs_cteatfile(char *filename, size_t write_size) { int fd; - char w_buffer[WRITE_BUF_SIZE] = { - 0 - }; + char w_buffer[WRITE_BUF_SIZE] = + { + 0 + }; ssize_t size = 0; @@ -126,13 +129,16 @@ void test_nuttx_fs_rewinddir01(FAR void **state) fail_msg("Failed to obtain partition information !\n"); } - /* Stop the test if the available space of the partition is less than 50K */ + /* Stop the test if the available space of the partition is less than + * 50K + */ if (size < 51200) { syslog(LOG_WARNING, "Partitioned free space not enough !\n"); syslog(LOG_WARNING, "Test case (%s) exits early !\n", __func__); } + else { /* make directory */ @@ -146,9 +152,9 @@ void test_nuttx_fs_rewinddir01(FAR void **state) /* create */ - test_nuttx_fs_cteat_file(TEST_CHILD_FILE1, 10); - test_nuttx_fs_cteat_file(TEST_CHILD_FILE2, 10); - test_nuttx_fs_cteat_file(TEST_CHILD_FILE3, 10); + test_nuttx_fs_cteatfile(TEST_CHILD_FILE1, 10); + test_nuttx_fs_cteatfile(TEST_CHILD_FILE2, 10); + test_nuttx_fs_cteatfile(TEST_CHILD_FILE3, 10); /* open directory */ diff --git a/testing/testsuites/kernel/fs/cases/fs_rmdir_test.c b/testing/testsuites/kernel/fs/cases/fs_rmdir_test.c index 6b848bc48ab..57e84ca2f43 100644 --- a/testing/testsuites/kernel/fs/cases/fs_rmdir_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_rmdir_test.c @@ -1,24 +1,26 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_rmdir_test.c - * Copyright (C) 2020 Xiaomi Corporation * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -46,31 +48,36 @@ ****************************************************************************/ /**************************************************************************** - * Name: test_nuttx_fs_fmdir01 + * Name: test_nuttx_fs_rmdir01 ****************************************************************************/ -void test_nuttx_fs_fmdir01(FAR void **state) +void test_nuttx_fs_rmdir01(FAR void **state) { int status; int fd; char str[5]; - char test_file_name[20] = { + char testfilename[20] = + { 0 }; - char test_dir_name[20] = { + char testdirname[20] = + { 0 }; - char absolute_directory[100] = { + char absolutedirectory[100] = + { 0 }; - char current_path[100] = { + char currentpath[100] = + { 0 }; - char parent_directory[PATH_MAX] = { + char parentdirectory[PATH_MAX] = + { 0 }; @@ -81,8 +88,8 @@ void test_nuttx_fs_fmdir01(FAR void **state) fail_msg("Failed to obtain partition information !\n"); } - /* Stop the test if the available space of - * the partition is less than 160K + /* Stop the test if the available space of the partition is less than + * 160K */ if (size < 163840) @@ -99,19 +106,19 @@ void test_nuttx_fs_fmdir01(FAR void **state) /* get test path */ - getcwd(current_path, sizeof(current_path)); + getcwd(currentpath, sizeof(currentpath)); - strcpy(absolute_directory, current_path); - strcat(current_path, "/"); - strcat(current_path, PARENTDIR1); + strcpy(absolutedirectory, currentpath); + strcat(currentpath, "/"); + strcat(currentpath, PARENTDIR1); - strcpy(parent_directory, current_path); + strcpy(parentdirectory, currentpath); - chdir(current_path); + chdir(currentpath); /* get test path */ - getcwd(current_path, sizeof(current_path)); + getcwd(currentpath, sizeof(currentpath)); /* create 10 2-level subfolders */ @@ -128,13 +135,13 @@ void test_nuttx_fs_fmdir01(FAR void **state) /* enter sub-directory */ - strcat(current_path, "/"); - strcat(current_path, str); - chdir(current_path); + strcat(currentpath, "/"); + strcat(currentpath, str); + chdir(currentpath); /* get test path */ - getcwd(current_path, sizeof(current_path)); + getcwd(currentpath, sizeof(currentpath)); /* make directory */ @@ -152,29 +159,29 @@ void test_nuttx_fs_fmdir01(FAR void **state) /* enter sub-directory */ - memset(current_path, 0, sizeof(current_path)); - strcpy(current_path, parent_directory); - strcat(current_path, "/"); - strcat(current_path, str); - chdir(current_path); + memset(currentpath, 0, sizeof(currentpath)); + strcpy(currentpath, parentdirectory); + strcat(currentpath, "/"); + strcat(currentpath, str); + chdir(currentpath); /* get test path */ - getcwd(current_path, sizeof(current_path)); + getcwd(currentpath, sizeof(currentpath)); for (int j = 1; j <= 10; j++) { - sprintf(test_file_name, "test_3_file_%d", j); + sprintf(testfilename, "test_3_file_%d", j); /* creat a test file */ - fd = creat(test_file_name, 0700); + fd = creat(testfilename, 0700); assert_true(fd > 0); close(fd); /* set memory */ - memset(test_file_name, 0, sizeof(test_file_name)); + memset(testfilename, 0, sizeof(testfilename)); } /* switch to directory 2 */ @@ -183,45 +190,45 @@ void test_nuttx_fs_fmdir01(FAR void **state) /* enter sub-directory */ - memset(current_path, 0, sizeof(current_path)); - strcpy(current_path, parent_directory); - strcat(current_path, "/"); - strcat(current_path, str); - chdir(current_path); + memset(currentpath, 0, sizeof(currentpath)); + strcpy(currentpath, parentdirectory); + strcat(currentpath, "/"); + strcat(currentpath, str); + chdir(currentpath); /* get test path */ - getcwd(current_path, sizeof(current_path)); + getcwd(currentpath, sizeof(currentpath)); for (int k = 1; k <= 5; k++) { - sprintf(test_file_name, "test_3_file_%d", k); - sprintf(test_dir_name, "test_3_dir_%d", k); + sprintf(testfilename, "test_3_file_%d", k); + sprintf(testdirname, "test_3_dir_%d", k); /* create a test file */ - fd = creat(test_file_name, 0700); + fd = creat(testfilename, 0700); assert_true(fd > 0); close(fd); /* make directory */ - status = mkdir(test_dir_name, 0700); + status = mkdir(testdirname, 0700); assert_int_equal(status, 0); /* set memory */ - memset(test_file_name, 0, sizeof(test_file_name)); - memset(test_dir_name, 0, sizeof(test_dir_name)); + memset(testfilename, 0, sizeof(testfilename)); + memset(testdirname, 0, sizeof(testdirname)); } /* wwitch to the test absolute directory */ - chdir(absolute_directory); + chdir(absolutedirectory); /* call the recursive delete interface */ - cm_unlink_recursive(parent_directory); + cm_unlink_recursive(parentdirectory); } } @@ -243,19 +250,23 @@ void test_nuttx_fs_rmdir02(FAR void **state) { int status; int ret; - char str[20] = { + char str[20] = + { 0 }; - char absolute_directory[20] = { + char absolutedirectory[20] = + { 0 }; - char parent_directory[PATH_MAX] = { + char parentdirectory[PATH_MAX] = + { 0 }; - char temporary_path[300] = { + char temporarypath[300] = + { 0 }; @@ -267,7 +278,9 @@ void test_nuttx_fs_rmdir02(FAR void **state) fail_msg("Failed to obtain partition information !\n"); } - /* Stop the test if the available space of the partition is less than 98K */ + /* Stop the test if the available space of the partition is less than + * 98K + */ if (size < 98304) { @@ -276,20 +289,20 @@ void test_nuttx_fs_rmdir02(FAR void **state) } else { - getcwd(absolute_directory, sizeof(absolute_directory)); + getcwd(absolutedirectory, sizeof(absolutedirectory)); /* create directory */ status = mkdir(PARENTDIR2, 0700); assert_int_equal(status, 0); - strcpy(parent_directory, absolute_directory); - strcat(parent_directory, "/"); - strcat(parent_directory, PARENTDIR2); + strcpy(parentdirectory, absolutedirectory); + strcat(parentdirectory, "/"); + strcat(parentdirectory, PARENTDIR2); /* switch to test PARENTDIR */ - chdir(parent_directory); + chdir(parentdirectory); /* create a 6-level directory in a loop */ @@ -297,36 +310,36 @@ void test_nuttx_fs_rmdir02(FAR void **state) { /* get current path */ - getcwd(temporary_path, sizeof(temporary_path)); - strcat(temporary_path, "/"); + getcwd(temporarypath, sizeof(temporarypath)); + strcat(temporarypath, "/"); /* do snprintf */ ret = snprintf(str, 20, "test_dir_%d", i); assert_true(ret > 0); - strcat(temporary_path, str); + strcat(temporarypath, str); /* make directory */ - status = mkdir(temporary_path, 0700); + status = mkdir(temporarypath, 0700); assert_int_equal(status, 0); - chdir(temporary_path); + chdir(temporarypath); /* set memory */ - memset(temporary_path, 0, sizeof(temporary_path)); + memset(temporarypath, 0, sizeof(temporarypath)); memset(str, 0, sizeof(str)); } /* wwitch to the test absolute directory */ - chdir(absolute_directory); + chdir(absolutedirectory); /* call the recursive delete interface */ - cm_unlink_recursive(parent_directory); + cm_unlink_recursive(parentdirectory); } } @@ -343,7 +356,8 @@ void test_nuttx_fs_rmdir03(FAR void **state) int status; DIR *dir = NULL; char str[5]; - char buf[20] = { + char buf[20] = + { 0 }; @@ -356,7 +370,9 @@ void test_nuttx_fs_rmdir03(FAR void **state) fail_msg("Failed to obtain partition information !\n"); } - /* Stop the test if the available space of the partition is less than 80K */ + /* Stop the test if the available space of the partition is less than + * 80K + */ if (size < 81920) { diff --git a/testing/testsuites/kernel/fs/cases/fs_seek_test.c b/testing/testsuites/kernel/fs/cases/fs_seek_test.c index e5c4d8677da..da49382eadf 100644 --- a/testing/testsuites/kernel/fs/cases/fs_seek_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_seek_test.c @@ -1,24 +1,26 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_seek_test.c - * Copyright (C) 2020 Xiaomi Corporation * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -148,10 +150,10 @@ tcases[] = ****************************************************************************/ /**************************************************************************** - * Name: test_nuttx_fs_verify_lseek + * Name: test_nuttx_fs_verifylseek ****************************************************************************/ -static int test_nuttx_fs_verify_lseek(unsigned int n) +static int test_nuttx_fs_verifylseek(unsigned int n) { char read_buf[64]; struct tcase *tc = &tcases[n]; @@ -182,7 +184,8 @@ static int test_nuttx_fs_verify_lseek(unsigned int n) if (ret != tc->exp_off) { syslog(LOG_ERR, "lseek(%s, %lld, %s) returned %d, expected %lld\n", - TFILE, (long long)tc->off, tc->wname, ret, (long long)tc->exp_off); + TFILE, (long long)tc->off, tc->wname, ret, + (long long)tc->exp_off); return -1; } @@ -196,8 +199,8 @@ static int test_nuttx_fs_verify_lseek(unsigned int n) if (tc->exp_data && strcmp(read_buf, tc->exp_data)) { - syslog(LOG_ERR, "lseek(%s, %lld, %s) read incorrect data\n", - TFILE, (long long)tc->off, tc->wname); + syslog(LOG_ERR, "lseek(%s, %lld, %s) read incorrect data\n", TFILE, + (long long)tc->off, tc->wname); return -1; } else @@ -254,22 +257,22 @@ void test_nuttx_fs_seek02(FAR void **state) /* do verify lseek */ - ret = test_nuttx_fs_verify_lseek(0); + ret = test_nuttx_fs_verifylseek(0); assert_int_equal(ret, 0); /* do verify lseek */ - ret = test_nuttx_fs_verify_lseek(1); + ret = test_nuttx_fs_verifylseek(1); assert_int_equal(ret, 0); /* do verify lseek */ - ret = test_nuttx_fs_verify_lseek(2); + ret = test_nuttx_fs_verifylseek(2); assert_int_equal(ret, 0); /* do verify lseek */ - ret = test_nuttx_fs_verify_lseek(3); + ret = test_nuttx_fs_verifylseek(3); assert_int_equal(ret, 0); /* do clean */ diff --git a/testing/testsuites/kernel/fs/cases/fs_sendfile_test.c b/testing/testsuites/kernel/fs/cases/fs_sendfile_test.c index 7ce21ac19f5..eb6dec014f1 100644 --- a/testing/testsuites/kernel/fs/cases/fs_sendfile_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_sendfile_test.c @@ -1,24 +1,26 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_sendfile_test.c - * Copyright (C) 2020 Xiaomi Corporation * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -41,28 +43,20 @@ #define I_FILE1 "inputFile1" #define I_FILE2 "inputFile2" -/**************************************************************************** - * Private Functions - ****************************************************************************/ - static void set_test(void) { int fd; fd = open(O_FILE, O_CREAT | O_RDWR, 0777); if (fd == -1) { - syslog(LOG_ERR, "Unable to open file %s, errno %d\n", O_FILE, errno); + syslog(LOG_ERR, "Unable to open file %s, errno %d\n", O_FILE, + errno); assert_true(1 == 0); } - write(fd, "ABCDEFGHIJ", 10); close(fd); } -/**************************************************************************** - * Public Functions - ****************************************************************************/ - /**************************************************************************** * Name: sendfile * Example description: @@ -70,6 +64,10 @@ static void set_test(void) * Expect results: TEST PASSED ****************************************************************************/ +/**************************************************************************** + * Public Functions + ****************************************************************************/ + void test_nuttx_fs_sendfile01(FAR void **state) { int ret; @@ -195,7 +193,8 @@ void test_nuttx_fs_sendfile02(FAR void **state) close(fd_o); close(fd_i); - /* Checks whether the file pointer is offset to the specified position */ + /* Checks whether the file pointer is offset to the specified position + */ assert_int_equal(offset, f_stat.st_size); } diff --git a/testing/testsuites/kernel/fs/cases/fs_stat_test.c b/testing/testsuites/kernel/fs/cases/fs_stat_test.c index b90b11f5122..3420b30731c 100644 --- a/testing/testsuites/kernel/fs/cases/fs_stat_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_stat_test.c @@ -1,24 +1,26 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_stat_test.c - * Copyright (C) 2020 Xiaomi Corporation * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -51,10 +53,10 @@ ****************************************************************************/ /**************************************************************************** - * Name: test_nuttx_fs_print_time + * Name: test_nuttx_fs_printtime ****************************************************************************/ -__attribute__((unused)) static void test_nuttx_fs_print_time(struct tm *TM) +__attribute__((unused)) static void test_nuttx_fs_printtime(struct tm *TM) { syslog(LOG_INFO, " tm_year: %d\n", TM->tm_year + 1900); syslog(LOG_INFO, " tm_mon: %d\n", TM->tm_mon); @@ -78,7 +80,8 @@ void test_nuttx_fs_stat01(FAR void **state) int ret; int ret2; struct stat file_s; - char buf[BUF_SIZE] = { + char buf[BUF_SIZE] = + { 0 }; diff --git a/testing/testsuites/kernel/fs/cases/fs_statfs_test.c b/testing/testsuites/kernel/fs/cases/fs_statfs_test.c index d5b0e297c51..8fa30b8e3cb 100644 --- a/testing/testsuites/kernel/fs/cases/fs_statfs_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_statfs_test.c @@ -1,24 +1,26 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_statfs_test.c - * Copyright (C) 2020 Xiaomi Corporation * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -48,11 +50,11 @@ ****************************************************************************/ /**************************************************************************** - * Name: test_nuttx_fs_print_statfs + * Name: test_nuttx_fs_printstatfs ****************************************************************************/ -__attribute__((unused)) static void test_nuttx_fs_print_statfs - (struct statfs *buf) +__attribute__((unused)) static void +test_nuttx_fs_printstatfs(struct statfs *buf) { syslog(LOG_INFO, "statfs buffer:\n"); syslog(LOG_INFO, " f_type: %u \n", (unsigned)buf->f_type); @@ -80,12 +82,12 @@ __attribute__((unused)) static void test_nuttx_fs_print_statfs void test_nuttx_fs_statfs01(FAR void **state) { - struct statfs disk_info; + struct statfs diskinfo; /* call statfs() */ char *buf = getcwd(NULL, 0); - int ret = statfs(buf, &disk_info); + int ret = statfs(buf, &diskinfo); free(buf); assert_int_equal(ret, 0); } diff --git a/testing/testsuites/kernel/fs/cases/fs_stream_test.c b/testing/testsuites/kernel/fs/cases/fs_stream_test.c index 27d43ef852e..6074a7b6f89 100644 --- a/testing/testsuites/kernel/fs/cases/fs_stream_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_stream_test.c @@ -1,24 +1,26 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_stream_test.c - * Copyright (C) 2020 Xiaomi Corporation * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -37,10 +39,6 @@ #include "fstest.h" #define TESTFILENAME "streamTestfile" -/**************************************************************************** - * Public Functions - ****************************************************************************/ - /**************************************************************************** * Name: stream * Example description: @@ -52,6 +50,10 @@ * Expect results: TEST PASSED ****************************************************************************/ +/**************************************************************************** + * Public Functions + ****************************************************************************/ + void test_nuttx_fs_stream01(FAR void **state) { FILE *stream; @@ -100,9 +102,9 @@ void test_nuttx_fs_stream01(FAR void **state) * Name: stream * Example description: * 1. open a file with "a+". - * 2. Write the file multiple times. - * 3. Check that the file pointer is in the correct - * position after each write. + * 2. Write the file multiple times. + * 3. Check that the file pointer is in the correct position after + *each write. * 4. Reset the file pointer position. Repeat step 2-3 * 4. Check the returned results. * Test item: fopen() fwrite() rewind() ftell() fseek() fgets() @@ -127,7 +129,8 @@ void test_nuttx_fs_stream02(FAR void **state) pos = ftell(stream); if (pos != 0) { - syslog(LOG_ERR, "file pointer descrepancy 1, errno %d\n", errno); + syslog(LOG_ERR, "file pointer descrepancy 1, errno %d\n", + errno); fclose(stream); assert_true(1 == 0); } @@ -142,13 +145,15 @@ void test_nuttx_fs_stream02(FAR void **state) pos = ftell(stream); if (pos != strlen(junk)) { - syslog(LOG_ERR, - "strlen(junk)=%zi: file pointer descrepancy 2 (pos=%li)", - strlen(junk), pos); + syslog( + LOG_ERR, + "strlen(junk)=%zi: file pointer descrepancy 2 (pos=%li)", + strlen(junk), pos); fclose(stream); assert_true(1 == 0); } + usleep(1000); rewind(stream); pos = ftell(stream); if (pos != 0) @@ -171,9 +176,10 @@ void test_nuttx_fs_stream02(FAR void **state) if (pos != strlen(junk)) { fclose(stream); - syslog(LOG_ERR, - "strlen(junk)=%zi: file pointer descrepancy 4 (pos=%li)", - strlen(junk), pos); + syslog( + LOG_ERR, + "strlen(junk)=%zi: file pointer descrepancy 4 (pos=%li)", + strlen(junk), pos); assert_true(1 == 0); } @@ -188,9 +194,10 @@ void test_nuttx_fs_stream02(FAR void **state) if (pos != strlen(junk)) { fclose(stream); - syslog(LOG_ERR, - "strlen(junk)=%zi: file pointer descrepancy 5 (pos=%li)", - strlen(junk), pos); + syslog( + LOG_ERR, + "strlen(junk)=%zi: file pointer descrepancy 5 (pos=%li)", + strlen(junk), pos); assert_true(1 == 0); } @@ -206,7 +213,8 @@ void test_nuttx_fs_stream02(FAR void **state) { fclose(stream); syslog(LOG_ERR, - "file pointer descrepancy 6 (pos=%li, wanted pos=0)", pos); + "file pointer descrepancy 6 (pos=%li, wanted pos=0)", + pos); assert_true(1 == 0); } @@ -215,28 +223,30 @@ void test_nuttx_fs_stream02(FAR void **state) pos = ftell(stream); if (pos != strlen(junk)) { - syslog(LOG_ERR, - "strlen(junk)=%zi: file pointer descrepancy 7 (pos=%li)", - strlen(junk), pos); + syslog( + LOG_ERR, + "strlen(junk)=%zi: file pointer descrepancy 7 (pos=%li)", + strlen(junk), pos); assert_true(1 == 0); } fclose(stream); unlink(TESTFILENAME); + usleep(40000); } } /**************************************************************************** * Name: stream * Example description: - * 1. open a file with "a+". - * 2. Write the file multiple times. - * 3. close the file. - * 4. open the file again with "r+" - * 5. Request a piece of memory and read the contents of the file. - * 6. Check that the read file class is correct. - * 7. repeat step 2-3-4-5-6 for 10 times. - * 8. Check that the test returns results. + * 1. open a file with "a+". + * 2. Write the file multiple times. + * 3. close the file. + * 4. open the file again with "r+" + * 5. Request a piece of memory and read the contents of the file. + * 6. Check that the read file class is correct. + * 7. repeat step 2-3-4-5-6 for 10 times. + * 8. Check that the test returns results. * Test item: fopen() fwrite() fread() malloc() * Expect results: TEST PASSED ****************************************************************************/ @@ -266,8 +276,7 @@ void test_nuttx_fs_stream03(FAR void **state) if ((size_t)ret != len) { - syslog(LOG_ERR, - "len = %zi != return value from fwrite = %i", + syslog(LOG_ERR, "len = %zu != return value from fwrite = %d", len, ret); fclose(stream); assert_true(1 == 0); @@ -299,8 +308,7 @@ void test_nuttx_fs_stream03(FAR void **state) if ((size_t)ret != len) { - syslog(LOG_ERR, - "len = %zi != return value from fread = %i", + syslog(LOG_ERR, "len = %zu != return value from fread = %d", len, ret); free(inbuf); fclose(stream); @@ -351,8 +359,7 @@ void test_nuttx_fs_stream04(FAR void **state) if (ferror(stream) != 0) { - syslog(LOG_ERR, - "ferror did not return zero, return %d\n", + syslog(LOG_ERR, "ferror did not return zero, return %d\n", ferror(stream)); fclose(stream); assert_true(1 == 0); @@ -386,14 +393,15 @@ void test_nuttx_fs_stream04(FAR void **state) if ((stream = fopen(TESTFILENAME, "r+")) == NULL) { - syslog(LOG_ERR, - "fopen(%s) r+ failed, errno %d\n", TESTFILENAME, errno); + syslog(LOG_ERR, "fopen(%s) r+ failed, errno %d\n", + TESTFILENAME, errno); assert_true(1 == 0); } if (feof(stream) != 0) { - syslog(LOG_ERR, "feof returned non-zero when it should not \n"); + syslog(LOG_ERR, + "feof returned non-zero when it should not \n"); fclose(stream); assert_true(1 == 0); } diff --git a/testing/testsuites/kernel/fs/cases/fs_symlink_test.c b/testing/testsuites/kernel/fs/cases/fs_symlink_test.c index e8c8dcaf32d..05f6a908e16 100644 --- a/testing/testsuites/kernel/fs/cases/fs_symlink_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_symlink_test.c @@ -1,24 +1,26 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_symlink_test.c - * Copyright (C) 2020 Xiaomi Corporation * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -54,28 +56,34 @@ static char *path; ****************************************************************************/ /**************************************************************************** - * Name: test_nuttx_fs_run_test + * Name: test_nuttx_fs_runtest ****************************************************************************/ -static int test_nuttx_fs_run_test(void) +static int test_nuttx_fs_runtest(void) { int ret; /* test symlink */ - char buf[64] = { + char buf[64] = + { 0 }; ret = symlink(path, "/file_link"); + + /* syslog(LOG_INFO, "the symlink return : %d\n", ret); */ + if (ret != 0) { return ERROR; } - else { ret = readlink("/file_link", buf, PATH_MAX_SIZE); + + /* syslog(LOG_INFO, "buf = %s\n", buf); */ + unlink("/file_link"); } @@ -116,11 +124,14 @@ void test_nuttx_fs_symlink01(FAR void **state) fd = open(path, O_WRONLY | O_CREAT, 0700); assert_true(fd > 0); - test_state->fd1 = fd; /* do run test */ - ret = test_nuttx_fs_run_test(); + ret = test_nuttx_fs_runtest(); + + /* close file */ + + close(fd); /* do remove */ diff --git a/testing/testsuites/kernel/fs/cases/fs_truncate_test.c b/testing/testsuites/kernel/fs/cases/fs_truncate_test.c index f2151d6bf96..32afc989c21 100644 --- a/testing/testsuites/kernel/fs/cases/fs_truncate_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_truncate_test.c @@ -1,24 +1,26 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_truncate_test.c - * Copyright (C) 2020 Xiaomi Corporation * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include diff --git a/testing/testsuites/kernel/fs/cases/fs_unlink_test.c b/testing/testsuites/kernel/fs/cases/fs_unlink_test.c index e610ab32022..7097bc114e8 100644 --- a/testing/testsuites/kernel/fs/cases/fs_unlink_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_unlink_test.c @@ -1,24 +1,26 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_unlink_test.c - * Copyright (C) 2020 Xiaomi Corporation * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -64,7 +66,8 @@ void test_nuttx_fs_unlink01(FAR void **state) assert_true(fd > 0); test_state->fd1 = fd; - char buf[MAXSIZE] = { + char buf[MAXSIZE] = + { 0 }; diff --git a/testing/testsuites/kernel/fs/cases/fs_write_test.c b/testing/testsuites/kernel/fs/cases/fs_write_test.c index 064eac34bab..954704ed213 100644 --- a/testing/testsuites/kernel/fs/cases/fs_write_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_write_test.c @@ -1,24 +1,26 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_write_test.c - * Copyright (C) 2020 Xiaomi Corporation * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include diff --git a/testing/testsuites/kernel/fs/cmocka_fs_test.c b/testing/testsuites/kernel/fs/cmocka_fs_test.c index 17aa48abcfe..f4b581f816e 100644 --- a/testing/testsuites/kernel/fs/cmocka_fs_test.c +++ b/testing/testsuites/kernel/fs/cmocka_fs_test.c @@ -1,24 +1,26 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cmocka_fs_test.c - * Copyright (C) 2020 Xiaomi Corporation * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -29,161 +31,169 @@ #include "fstest.h" /**************************************************************************** - * Public Functions + * Name: cmocka_fs_test_main ****************************************************************************/ /**************************************************************************** - * Name: cmocka_fs_test_main + * Public Functions ****************************************************************************/ int main(int argc, char *argv[]) { /* Add Test Cases */ - const struct CMUnitTest nuttx_fs_test_suites[] = { + const struct CMUnitTest nuttx_fs_test_suites[] = + { cmocka_unit_test_setup_teardown(test_nuttx_fs_creat01, - test_nuttx_fs_fest_group_set_up, - test_nuttx_fs_test_group_tear_down), + test_nuttx_fs_test_group_setup, + test_nuttx_fs_test_group_teardown), cmocka_unit_test_setup_teardown(test_nuttx_fs_dup01, - test_nuttx_fs_fest_group_set_up, - test_nuttx_fs_test_group_tear_down), + test_nuttx_fs_test_group_setup, + test_nuttx_fs_test_group_teardown), + /* cmocka_unit_test_setup_teardown(test_nuttx_fs_dup201, + * test_nuttx_fs_test_group_setup, test_nuttx_fs_test_group_teardown), + */ + cmocka_unit_test_setup_teardown(test_nuttx_fs_fcntl01, - test_nuttx_fs_fest_group_set_up, - test_nuttx_fs_test_group_tear_down), + test_nuttx_fs_test_group_setup, + test_nuttx_fs_test_group_teardown), #ifndef CONFIG_ARCH_SIM cmocka_unit_test_setup_teardown(test_nuttx_fs_fcntl02, - test_nuttx_fs_fest_group_set_up, - test_nuttx_fs_test_group_tear_down), + test_nuttx_fs_test_group_setup, + test_nuttx_fs_test_group_teardown), cmocka_unit_test_setup_teardown(test_nuttx_fs_fcntl03, - test_nuttx_fs_fest_group_set_up, - test_nuttx_fs_test_group_tear_down), + test_nuttx_fs_test_group_setup, + test_nuttx_fs_test_group_teardown), #endif cmocka_unit_test_setup_teardown(test_nuttx_fs_fstat01, - test_nuttx_fs_fest_group_set_up, - test_nuttx_fs_test_group_tear_down), + test_nuttx_fs_test_group_setup, + test_nuttx_fs_test_group_teardown), #ifndef CONFIG_ARCH_SIM cmocka_unit_test_setup_teardown(test_nuttx_fs_fstat02, - test_nuttx_fs_fest_group_set_up, - test_nuttx_fs_test_group_tear_down), + test_nuttx_fs_test_group_setup, + test_nuttx_fs_test_group_teardown), #endif cmocka_unit_test_setup_teardown(test_nuttx_fs_fstatfs01, - test_nuttx_fs_fest_group_set_up, - test_nuttx_fs_test_group_tear_down), + test_nuttx_fs_test_group_setup, + test_nuttx_fs_test_group_teardown), cmocka_unit_test_setup_teardown(test_nuttx_fs_fsync01, - test_nuttx_fs_fest_group_set_up, - test_nuttx_fs_test_group_tear_down), + test_nuttx_fs_test_group_setup, + test_nuttx_fs_test_group_teardown), cmocka_unit_test_setup_teardown(test_nuttx_fs_fsync02, - test_nuttx_fs_fest_group_set_up, - test_nuttx_fs_test_group_tear_down), + test_nuttx_fs_test_group_setup, + test_nuttx_fs_test_group_teardown), cmocka_unit_test_setup_teardown(test_nuttx_fs_getfilep01, - test_nuttx_fs_fest_group_set_up, - test_nuttx_fs_test_group_tear_down), + test_nuttx_fs_test_group_setup, + test_nuttx_fs_test_group_teardown), cmocka_unit_test_setup_teardown(test_nuttx_fs_mkdir01, - test_nuttx_fs_fest_group_set_up, - test_nuttx_fs_test_group_tear_down), + test_nuttx_fs_test_group_setup, + test_nuttx_fs_test_group_teardown), cmocka_unit_test_setup_teardown(test_nuttx_fs_open01, - test_nuttx_fs_fest_group_set_up, - test_nuttx_fs_test_group_tear_down), + test_nuttx_fs_test_group_setup, + test_nuttx_fs_test_group_teardown), + cmocka_unit_test_setup_teardown(test_nuttx_fs_open02, + test_nuttx_fs_test_group_setup, + test_nuttx_fs_test_group_teardown), cmocka_unit_test_setup_teardown(test_nuttx_fs_opendir01, - test_nuttx_fs_fest_group_set_up, - test_nuttx_fs_test_group_tear_down), + test_nuttx_fs_test_group_setup, + test_nuttx_fs_test_group_teardown), cmocka_unit_test_setup_teardown(test_nuttx_fs_opendir02, - test_nuttx_fs_fest_group_set_up, - test_nuttx_fs_test_group_tear_down), + test_nuttx_fs_test_group_setup, + test_nuttx_fs_test_group_teardown), cmocka_unit_test_setup_teardown(test_nuttx_fs_pread01, - test_nuttx_fs_fest_group_set_up, - test_nuttx_fs_test_group_tear_down), + test_nuttx_fs_test_group_setup, + test_nuttx_fs_test_group_teardown), cmocka_unit_test_setup_teardown(test_nuttx_fs_pwrite01, - test_nuttx_fs_fest_group_set_up, - test_nuttx_fs_test_group_tear_down), + test_nuttx_fs_test_group_setup, + test_nuttx_fs_test_group_teardown), #ifndef CONFIG_ARCH_SIM cmocka_unit_test_setup_teardown(test_nuttx_fs_read01, - test_nuttx_fs_fest_group_set_up, - test_nuttx_fs_test_group_tear_down), + test_nuttx_fs_test_group_setup, + test_nuttx_fs_test_group_teardown), #endif cmocka_unit_test_setup_teardown(test_nuttx_fs_readdir01, - test_nuttx_fs_fest_group_set_up, - test_nuttx_fs_test_group_tear_down), + test_nuttx_fs_test_group_setup, + test_nuttx_fs_test_group_teardown), cmocka_unit_test_setup_teardown(test_nuttx_fs_readlink01, - test_nuttx_fs_fest_group_set_up, - test_nuttx_fs_test_group_tear_down), + test_nuttx_fs_test_group_setup, + test_nuttx_fs_test_group_teardown), cmocka_unit_test_setup_teardown(test_nuttx_fs_rename01, - test_nuttx_fs_fest_group_set_up, - test_nuttx_fs_test_group_tear_down), + test_nuttx_fs_test_group_setup, + test_nuttx_fs_test_group_teardown), cmocka_unit_test_setup_teardown(test_nuttx_fs_rename02, - test_nuttx_fs_fest_group_set_up, - test_nuttx_fs_test_group_tear_down), + test_nuttx_fs_test_group_setup, + test_nuttx_fs_test_group_teardown), cmocka_unit_test_setup_teardown(test_nuttx_fs_rewinddir01, - test_nuttx_fs_fest_group_set_up, - test_nuttx_fs_test_group_tear_down), - cmocka_unit_test_setup_teardown(test_nuttx_fs_fmdir01, - test_nuttx_fs_fest_group_set_up, - test_nuttx_fs_test_group_tear_down), + test_nuttx_fs_test_group_setup, + test_nuttx_fs_test_group_teardown), + cmocka_unit_test_setup_teardown(test_nuttx_fs_rmdir01, + test_nuttx_fs_test_group_setup, + test_nuttx_fs_test_group_teardown), cmocka_unit_test_setup_teardown(test_nuttx_fs_rmdir02, - test_nuttx_fs_fest_group_set_up, - test_nuttx_fs_test_group_tear_down), + test_nuttx_fs_test_group_setup, + test_nuttx_fs_test_group_teardown), cmocka_unit_test_setup_teardown(test_nuttx_fs_rmdir03, - test_nuttx_fs_fest_group_set_up, - test_nuttx_fs_test_group_tear_down), + test_nuttx_fs_test_group_setup, + test_nuttx_fs_test_group_teardown), cmocka_unit_test_setup_teardown(test_nuttx_fs_seek01, - test_nuttx_fs_fest_group_set_up, - test_nuttx_fs_test_group_tear_down), + test_nuttx_fs_test_group_setup, + test_nuttx_fs_test_group_teardown), cmocka_unit_test_setup_teardown(test_nuttx_fs_seek02, - test_nuttx_fs_fest_group_set_up, - test_nuttx_fs_test_group_tear_down), + test_nuttx_fs_test_group_setup, + test_nuttx_fs_test_group_teardown), #ifndef CONFIG_ARCH_SIM cmocka_unit_test_setup_teardown(test_nuttx_fs_stat01, - test_nuttx_fs_fest_group_set_up, - test_nuttx_fs_test_group_tear_down), + test_nuttx_fs_test_group_setup, + test_nuttx_fs_test_group_teardown), #endif cmocka_unit_test_setup_teardown(test_nuttx_fs_statfs01, - test_nuttx_fs_fest_group_set_up, - test_nuttx_fs_test_group_tear_down), + test_nuttx_fs_test_group_setup, + test_nuttx_fs_test_group_teardown), cmocka_unit_test_setup_teardown(test_nuttx_fs_symlink01, - test_nuttx_fs_fest_group_set_up, - test_nuttx_fs_test_group_tear_down), + test_nuttx_fs_test_group_setup, + test_nuttx_fs_test_group_teardown), cmocka_unit_test_setup_teardown(test_nuttx_fs_truncate01, - test_nuttx_fs_fest_group_set_up, - test_nuttx_fs_test_group_tear_down), + test_nuttx_fs_test_group_setup, + test_nuttx_fs_test_group_teardown), cmocka_unit_test_setup_teardown(test_nuttx_fs_unlink01, - test_nuttx_fs_fest_group_set_up, - test_nuttx_fs_test_group_tear_down), + test_nuttx_fs_test_group_setup, + test_nuttx_fs_test_group_teardown), cmocka_unit_test_setup_teardown(test_nuttx_fs_write01, - test_nuttx_fs_fest_group_set_up, - test_nuttx_fs_test_group_tear_down), + test_nuttx_fs_test_group_setup, + test_nuttx_fs_test_group_teardown), cmocka_unit_test_setup_teardown(test_nuttx_fs_write02, - test_nuttx_fs_fest_group_set_up, - test_nuttx_fs_test_group_tear_down), + test_nuttx_fs_test_group_setup, + test_nuttx_fs_test_group_teardown), cmocka_unit_test_setup_teardown(test_nuttx_fs_write03, - test_nuttx_fs_fest_group_set_up, - test_nuttx_fs_test_group_tear_down), + test_nuttx_fs_test_group_setup, + test_nuttx_fs_test_group_teardown), cmocka_unit_test_setup_teardown(test_nuttx_fs_append01, - test_nuttx_fs_fest_group_set_up, - test_nuttx_fs_test_group_tear_down), + test_nuttx_fs_test_group_setup, + test_nuttx_fs_test_group_teardown), cmocka_unit_test_setup_teardown(test_nuttx_fs_sendfile01, - test_nuttx_fs_fest_group_set_up, - test_nuttx_fs_test_group_tear_down), + test_nuttx_fs_test_group_setup, + test_nuttx_fs_test_group_teardown), cmocka_unit_test_setup_teardown(test_nuttx_fs_sendfile02, - test_nuttx_fs_fest_group_set_up, - test_nuttx_fs_test_group_tear_down), + test_nuttx_fs_test_group_setup, + test_nuttx_fs_test_group_teardown), cmocka_unit_test_setup_teardown(test_nuttx_fs_stream01, - test_nuttx_fs_fest_group_set_up, - test_nuttx_fs_test_group_tear_down), + test_nuttx_fs_test_group_setup, + test_nuttx_fs_test_group_teardown), cmocka_unit_test_setup_teardown(test_nuttx_fs_stream02, - test_nuttx_fs_fest_group_set_up, - test_nuttx_fs_test_group_tear_down), + test_nuttx_fs_test_group_setup, + test_nuttx_fs_test_group_teardown), cmocka_unit_test_setup_teardown(test_nuttx_fs_stream03, - test_nuttx_fs_fest_group_set_up, - test_nuttx_fs_test_group_tear_down), + test_nuttx_fs_test_group_setup, + test_nuttx_fs_test_group_teardown), cmocka_unit_test_setup_teardown(test_nuttx_fs_stream04, - test_nuttx_fs_fest_group_set_up, - test_nuttx_fs_test_group_tear_down), + test_nuttx_fs_test_group_setup, + test_nuttx_fs_test_group_teardown), cmocka_unit_test_setup_teardown(test_nuttx_fs_eventfd, - test_nuttx_fs_fest_group_set_up, - test_nuttx_fs_test_group_tear_down), + test_nuttx_fs_test_group_setup, + test_nuttx_fs_test_group_teardown), cmocka_unit_test_setup_teardown(test_nuttx_fs_poll01, - test_nuttx_fs_fest_group_set_up, - test_nuttx_fs_test_group_tear_down), + test_nuttx_fs_test_group_setup, + test_nuttx_fs_test_group_teardown), }; /* Run Test cases */ diff --git a/testing/testsuites/kernel/fs/common/test_fs_common.c b/testing/testsuites/kernel/fs/common/test_fs_common.c index 868e42d2340..3761f8fac37 100644 --- a/testing/testsuites/kernel/fs/common/test_fs_common.c +++ b/testing/testsuites/kernel/fs/common/test_fs_common.c @@ -1,24 +1,26 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/common/test_fs_common.c - * Copyright (C) 2020 Xiaomi Corporation * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -46,15 +48,15 @@ unsigned long long cm_get_partition_available_size(void) { unsigned long long size = 0; int ret; - struct statfs stat_info; + struct statfs statinfo; /* call statfs() */ - ret = statfs(MOUNT_DIR, &stat_info); + ret = statfs(MOUNT_DIR, &statinfo); if (ret == 0) { - size = (unsigned long long)stat_info.f_bsize - * (unsigned long long)stat_info.f_bfree; + size = (unsigned long long)statinfo.f_bsize * + (unsigned long long)statinfo.f_bfree; } else { @@ -63,6 +65,12 @@ unsigned long long cm_get_partition_available_size(void) return size; } +int get_mem_info(struct mallinfo *mem_info) +{ + *mem_info = mallinfo(); + return 0; +} + int cm_unlink_recursive(FAR char *path) { struct dirent *d; @@ -112,10 +120,10 @@ int cm_unlink_recursive(FAR char *path) ret = closedir(dp); if (ret >= 0) - { - path[len] = '\0'; - ret = rmdir(path); - } + { + path[len] = '\0'; + ret = rmdir(path); + } return ret; } @@ -125,10 +133,10 @@ int cm_unlink_recursive(FAR char *path) ****************************************************************************/ /**************************************************************************** - * Name: test_nuttx_fs_fest_group_set_up + * Name: test_nuttx_fs_test_group_setup ****************************************************************************/ -int test_nuttx_fs_fest_group_set_up(void **state) +int test_nuttx_fs_test_group_setup(void **state) { int res; struct stat buf; @@ -148,9 +156,10 @@ int test_nuttx_fs_fest_group_set_up(void **state) } else { - char testdir[PATH_MAX] = { - 0 - }; + char testdir[PATH_MAX] = + { + 0 + }; sprintf(testdir, "%s/%s", MOUNT_DIR, CM_FSTESTDIR); @@ -160,7 +169,8 @@ int test_nuttx_fs_fest_group_set_up(void **state) res = mkdir(CM_FSTESTDIR, 0777); if (res != 0) { - syslog(LOG_INFO, "ERROR: Failed to creat the test directory\n"); + syslog(LOG_INFO, + "ERROR: Failed to creat the test directory\n"); exit(1); } @@ -178,15 +188,16 @@ int test_nuttx_fs_fest_group_set_up(void **state) } /**************************************************************************** - * Name: test_nuttx_fs_test_group_tear_down + * Name: test_nuttx_fs_testgroupteardown ****************************************************************************/ -int test_nuttx_fs_test_group_tear_down(void **state) +int test_nuttx_fs_test_group_teardown(void **state) { int res; - char testdir[PATH_MAX] = { - 0 - }; + char testdir[PATH_MAX] = + { + 0 + }; struct fs_testsuites_state_s *test_state; diff --git a/testing/testsuites/kernel/fs/include/fstest.h b/testing/testsuites/kernel/fs/include/fstest.h index 4a0ec5f1253..f16677fb6ff 100644 --- a/testing/testsuites/kernel/fs/include/fstest.h +++ b/testing/testsuites/kernel/fs/include/fstest.h @@ -1,27 +1,29 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/include/fstest.h - * Copyright (C) 2020 Xiaomi Corporation * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/**************************************************************************** - * Included Files + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * ****************************************************************************/ #ifndef __TEST_H #define __TEST_H +/**************************************************************************** + * Included Files + ****************************************************************************/ #include #include #include @@ -36,14 +38,13 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ - #define TEST_PASS 0 #define TEST_FAIL -1 #define MAX_PATH 300 -/* The test files generated during the 'fs-test' - * are stored in this directory +/* The test files generated during the 'fs-test' are stored in this + * directory */ #define FS_TEST_DIR "fs_test_dir" @@ -65,145 +66,178 @@ struct fs_testsuites_state_s unsigned long long cm_get_partition_available_size(void); int cm_unlink_recursive(FAR char *path); -int test_nuttx_fs_fest_group_set_up(FAR void **state); -int test_nuttx_fs_test_group_tear_down(FAR void **state); +int test_nuttx_fs_test_group_setup(FAR void **state); +int test_nuttx_fs_test_group_teardown(FAR void **state); +int get_mem_info(struct mallinfo *mem_info); -/* cases/fs_creat_test.c ****************************************************/ +/* cases/fs_creat_test.c + * ************************************************/ void test_nuttx_fs_creat01(FAR void **state); -/* cases/fs_dup_test.c ******************************************************/ +/* cases/fs_dup_test.c + * ************************************************/ void test_nuttx_fs_dup01(FAR void **state); -/* cases/fs_dup2_test.c *****************************************************/ +/* cases/fs_dup2_test.c + * ************************************************/ void test_nuttx_fs_dup201(FAR void **state); -/* cases/fs_fcntl_test.c ****************************************************/ +/* cases/fs_fcntl_test.c + * ************************************************/ void test_nuttx_fs_fcntl01(FAR void **state); void test_nuttx_fs_fcntl02(FAR void **state); void test_nuttx_fs_fcntl03(FAR void **state); -/* cases/fs_fstat_test.c ****************************************************/ +/* cases/fs_fstat_test.c + * ************************************************/ void test_nuttx_fs_fstat01(FAR void **state); void test_nuttx_fs_fstat02(FAR void **state); -/* cases/fs_fstatfs_test.c **************************************************/ +/* cases/fs_fstatfs_test.c + * ************************************************/ void test_nuttx_fs_fstatfs01(FAR void **state); -/* cases/fs_fsync_test.c ****************************************************/ +/* cases/fs_fsync_test.c + * ************************************************/ void test_nuttx_fs_fsync01(FAR void **state); void test_nuttx_fs_fsync02(FAR void **state); -/* cases/fs_getfilep_test.c *************************************************/ +/* cases/fs_getfilep_test.c + * ************************************************/ void test_nuttx_fs_getfilep01(FAR void **state); -/* cases/fs_mkdir_test.c ****************************************************/ +/* cases/fs_mkdir_test.c + * ************************************************/ void test_nuttx_fs_mkdir01(FAR void **state); -/* cases/fs_open_test.c *****************************************************/ +/* cases/fs_open_test.c + * ************************************************/ void test_nuttx_fs_open01(FAR void **state); +void test_nuttx_fs_open02(FAR void **state); -/* cases/fs_opendir_test.c **************************************************/ +/* cases/fs_opendir_test.c + * ************************************************/ void test_nuttx_fs_opendir01(FAR void **state); void test_nuttx_fs_opendir02(FAR void **state); -/* cases/fs_pread_test.c ****************************************************/ +/* cases/fs_pread_test.c + * ************************************************/ void test_nuttx_fs_pread01(FAR void **state); -/* cases/fs_pwrite_test.c ***************************************************/ +/* cases/fs_pwrite_test.c + * ************************************************/ void test_nuttx_fs_pwrite01(FAR void **state); -/* cases/fs_read_test.c *****************************************************/ +/* cases/fs_read_test.c + * ************************************************/ void test_nuttx_fs_read01(FAR void **state); -/* cases/fs_readdir_test.c **************************************************/ +/* cases/fs_readdir_test.c + * ************************************************/ void test_nuttx_fs_readdir01(FAR void **state); -/* cases/fs_readlink_test.c *************************************************/ +/* cases/fs_readlink_test.c + * ************************************************/ void test_nuttx_fs_readlink01(FAR void **state); -/* cases/fs_rename_test.c ***************************************************/ +/* cases/fs_rename_test.c + * ************************************************/ void test_nuttx_fs_rename01(FAR void **state); void test_nuttx_fs_rename02(FAR void **state); -/* cases/fs_rewinddir_test.c ************************************************/ +/* cases/fs_rewinddir_test.c + * ************************************************/ void test_nuttx_fs_rewinddir01(FAR void **state); -/* cases/fs_rmdir_test.c ****************************************************/ +/* cases/fs_rmdir_test.c + * ************************************************/ -void test_nuttx_fs_fmdir01(FAR void **state); +void test_nuttx_fs_rmdir01(FAR void **state); void test_nuttx_fs_rmdir02(FAR void **state); void test_nuttx_fs_rmdir03(FAR void **state); -/* cases/fs_seek_test.c *****************************************************/ +/* cases/fs_seek_test.c + * ************************************************/ void test_nuttx_fs_seek01(FAR void **state); void test_nuttx_fs_seek02(FAR void **state); -/* cases/fs_stat_test.c *****************************************************/ +/* cases/fs_stat_test.c + * ************************************************/ void test_nuttx_fs_stat01(FAR void **state); -/* cases/fs_statfs_test.c ***************************************************/ +/* cases/fs_statfs_test.c + * ************************************************/ void test_nuttx_fs_statfs01(FAR void **state); -/* cases/fs_symlink_test.c **************************************************/ +/* cases/fs_symlink_test.c + * ************************************************/ void test_nuttx_fs_symlink01(FAR void **state); -/* cases/fs_truncate_test.c *************************************************/ +/* cases/fs_truncate_test.c + * ************************************************/ void test_nuttx_fs_truncate01(FAR void **state); -/* cases/fs_unlink_test.c ***************************************************/ +/* cases/fs_unlink_test.c + * ************************************************/ void test_nuttx_fs_unlink01(FAR void **state); -/* cases/fs_write_test.c ****************************************************/ +/* cases/fs_write_test.c + * ************************************************/ void test_nuttx_fs_write01(FAR void **state); void test_nuttx_fs_write02(FAR void **state); void test_nuttx_fs_write03(FAR void **state); -/* cases/fs_append_test.c ***************************************************/ +/* cases/fs_append_test.c + * ************************************************/ void test_nuttx_fs_append01(FAR void **state); -/* cases/fs_sendfile_test.c *************************************************/ +/* cases/fs_sendfile_test.c + * ************************************************/ void test_nuttx_fs_sendfile01(FAR void **state); void test_nuttx_fs_sendfile02(FAR void **state); -/* cases/fs_stream_test.c ***************************************************/ +/* cases/fs_stream_test.c + * ************************************************/ void test_nuttx_fs_stream01(FAR void **state); void test_nuttx_fs_stream02(FAR void **state); void test_nuttx_fs_stream03(FAR void **state); void test_nuttx_fs_stream04(FAR void **state); -/* cases/fs_eventfd_test.c **************************************************/ +/* cases/fs_eventfd_test.c + * ************************************************/ void test_nuttx_fs_eventfd(FAR void **state); -/* fs_poll_test.c ***********************************************************/ +/* fs_poll_test.c + * ************************************************/ void test_nuttx_fs_poll01(FAR void **state); diff --git a/testing/testsuites/kernel/mm/cases/mm_test_001.c b/testing/testsuites/kernel/mm/cases/mm_test_001.c index aecee6970fe..7eb27c541bc 100644 --- a/testing/testsuites/kernel/mm/cases/mm_test_001.c +++ b/testing/testsuites/kernel/mm/cases/mm_test_001.c @@ -3,25 +3,24 @@ * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -38,12 +37,12 @@ ****************************************************************************/ /**************************************************************************** - * Name: TestNuttxMm01 + * Name: test_nuttx_mm01 ****************************************************************************/ void test_nuttx_mm01(FAR void **state) { - int i = 0; + int i; int flag = 0; char *pm1; char *pm2; diff --git a/testing/testsuites/kernel/mm/cases/mm_test_002.c b/testing/testsuites/kernel/mm/cases/mm_test_002.c index bad38c4ca8f..e749b84eeb2 100644 --- a/testing/testsuites/kernel/mm/cases/mm_test_002.c +++ b/testing/testsuites/kernel/mm/cases/mm_test_002.c @@ -3,25 +3,24 @@ * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -38,12 +37,12 @@ ****************************************************************************/ /**************************************************************************** - * Name: TestNuttxMm02 + * Name: test_nuttx_mm02 ****************************************************************************/ void test_nuttx_mm02(FAR void **state) { - int i = 0; + int i; int flag = 0; char *pm1; char *pm2; @@ -63,7 +62,7 @@ void test_nuttx_mm02(FAR void **state) pm2 = pm1; for (i = 0; i < memsize; i++) - *pm2++ = 'X'; + *pm2++ = 'X'; pm2 = pm1; for (i = 0; i < memsize; i++) { diff --git a/testing/testsuites/kernel/mm/cases/mm_test_003.c b/testing/testsuites/kernel/mm/cases/mm_test_003.c index 09553c465cf..cfa9935cf9f 100644 --- a/testing/testsuites/kernel/mm/cases/mm_test_003.c +++ b/testing/testsuites/kernel/mm/cases/mm_test_003.c @@ -3,25 +3,24 @@ * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -38,7 +37,7 @@ ****************************************************************************/ /**************************************************************************** - * Name: TestNuttxMm03 + * Name: test_nuttx_mm03 ****************************************************************************/ void test_nuttx_mm03(FAR void **state) diff --git a/testing/testsuites/kernel/mm/cases/mm_test_004.c b/testing/testsuites/kernel/mm/cases/mm_test_004.c index 59960fd1b89..2dafc6f2320 100644 --- a/testing/testsuites/kernel/mm/cases/mm_test_004.c +++ b/testing/testsuites/kernel/mm/cases/mm_test_004.c @@ -3,25 +3,24 @@ * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -39,7 +38,7 @@ ****************************************************************************/ /**************************************************************************** - * Name: TestNuttxMm04 + * Name: test_nuttx_mm04 ****************************************************************************/ void test_nuttx_mm04(FAR void **state) diff --git a/testing/testsuites/kernel/mm/cases/mm_test_005.c b/testing/testsuites/kernel/mm/cases/mm_test_005.c index 12739151518..6329c73464a 100644 --- a/testing/testsuites/kernel/mm/cases/mm_test_005.c +++ b/testing/testsuites/kernel/mm/cases/mm_test_005.c @@ -3,25 +3,24 @@ * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -43,14 +42,14 @@ ****************************************************************************/ /**************************************************************************** - * Name: TestNuttxMm05 + * Name: test_nuttx_mm05 ****************************************************************************/ void test_nuttx_mm05(FAR void **state) { - int i = 0; + int i; int flag = 0; - char *ptr = NULL; + char *ptr; char *temp_ptr = NULL; ptr = temp_ptr = zalloc(1024 * sizeof(char)); diff --git a/testing/testsuites/kernel/mm/cases/mm_test_006.c b/testing/testsuites/kernel/mm/cases/mm_test_006.c index 8525b954357..98a19c1f260 100644 --- a/testing/testsuites/kernel/mm/cases/mm_test_006.c +++ b/testing/testsuites/kernel/mm/cases/mm_test_006.c @@ -3,25 +3,24 @@ * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -52,7 +51,7 @@ ****************************************************************************/ /**************************************************************************** - * Name: TestNuttxMm06 + * Name: test_nuttx_mm06 ****************************************************************************/ void test_nuttx_mm06(FAR void **state) @@ -68,7 +67,8 @@ void test_nuttx_mm06(FAR void **state) /* Produces a random size */ - malloc_size = mmtest_get_rand_size(MALLOC_MIN_SIZE, MALLOC_MAX_SIZE); + malloc_size = + mmtest_get_rand_size(MALLOC_MIN_SIZE, MALLOC_MAX_SIZE); address_ptr = (char *)malloc(malloc_size * sizeof(char)); assert_non_null(address_ptr); memset(address_ptr, check_character, malloc_size); diff --git a/testing/testsuites/kernel/mm/cases/mm_test_007.c b/testing/testsuites/kernel/mm/cases/mm_test_007.c index a131200b24a..efe33221ce2 100644 --- a/testing/testsuites/kernel/mm/cases/mm_test_007.c +++ b/testing/testsuites/kernel/mm/cases/mm_test_007.c @@ -3,25 +3,24 @@ * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -55,7 +54,7 @@ ****************************************************************************/ /**************************************************************************** - * Name: TestNuttxMm07 + * Name: test_nuttx_mm07 ****************************************************************************/ void test_nuttx_mm07(FAR void **state) @@ -69,7 +68,8 @@ void test_nuttx_mm07(FAR void **state) struct mallinfo test_befor_info; struct mallinfo test_during_info; struct mallinfo test_after_info; - + struct mallinfo mem_info; + memset(&mem_info, 0, sizeof(mem_info)); for (int i = 0; i < MEMORY_LIST_LENGTH; i++) { mem_list[i] = NULL; @@ -79,13 +79,30 @@ void test_nuttx_mm07(FAR void **state) /* get a random size */ - malloc_size = mmtest_get_rand_size(MALLOC_MIN_SIZE, MALLOC_MAX_SIZE); for (int k = 0; k < MEMORY_LIST_LENGTH; k++) { + get_mem_info(&mem_info); + malloc_size = + mmtest_get_rand_size(MALLOC_MIN_SIZE, MALLOC_MAX_SIZE); + if (mem_info.mxordblk - 16 < 0) + { + syslog(LOG_INFO, + "TEST END because of the mem_info.mxordblk is:%d", + mem_info.mxordblk); + break; + } + + if (malloc_size > mem_info.mxordblk - 16) + { + syslog(LOG_INFO, "SET memsize to:%d", mem_info.mxordblk - 16); + malloc_size = mem_info.mxordblk - 16; + } + if (malloc_size > 0) { tmp_str = (char *)malloc(malloc_size * sizeof(char)); } + else { malloc_size = 512; diff --git a/testing/testsuites/kernel/mm/cases/mm_test_008.c b/testing/testsuites/kernel/mm/cases/mm_test_008.c index 892de5bff40..99aab0c67b3 100644 --- a/testing/testsuites/kernel/mm/cases/mm_test_008.c +++ b/testing/testsuites/kernel/mm/cases/mm_test_008.c @@ -3,25 +3,24 @@ * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -39,9 +38,6 @@ #include #include #include - -#include - #include "MmTest.h" /**************************************************************************** @@ -55,11 +51,7 @@ #define MALLOC_MIN_SIZE 32 #define MALLOC_MAX_SIZE 2048 -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -static int test_nuttx08_routine_1(int argc, char *argv[]) +static int test_nuttx_08_routine_1(int argc, char *argv[]) { char *ptr = NULL; char *tmp_ptr = NULL; @@ -94,7 +86,7 @@ static int test_nuttx08_routine_1(int argc, char *argv[]) return 0; } -static int test_nuttx08_routine_2(int argc, char *argv[]) +static int test_nuttx_08_routine_2(int argc, char *argv[]) { char *temp_ptr = NULL; int flag = 0; @@ -118,15 +110,32 @@ static int test_nuttx08_routine_2(int argc, char *argv[]) return 0; } -static int test_nuttx08_routine_3(int argc, char *argv[]) +static int test_nuttx_08_routine_3(int argc, char *argv[]) { char *pm; unsigned long memsize; + struct mallinfo mem_info; + memset(&mem_info, 0, sizeof(mem_info)); for (int i = 0; i < 500; i++) { /* Apply for as much memory as a system allows */ + get_mem_info(&mem_info); memsize = mmtest_get_rand_size(1024, 2048); + if (mem_info.mxordblk - 16 < 0) + { + syslog(LOG_INFO, + "TEST END because of the mem_info.mxordblk is:%d", + mem_info.mxordblk); + break; + } + + if (memsize > mem_info.mxordblk - 16) + { + syslog(LOG_INFO, "SET memsize to:%d", mem_info.mxordblk - 16); + memsize = mem_info.mxordblk - 16; + } + pm = malloc(memsize); assert_non_null(pm); free(pm); @@ -140,7 +149,7 @@ static int test_nuttx08_routine_3(int argc, char *argv[]) ****************************************************************************/ /**************************************************************************** - * Name: TestNuttxMm08 + * Name: test_nuttx_mm08 ****************************************************************************/ void test_nuttx_mm08(FAR void **state) @@ -148,14 +157,14 @@ void test_nuttx_mm08(FAR void **state) pid_t pid; int status; - pid = task_create("TestNuttx08_routine_1", - TASK_PRIORITY, DEFAULT_STACKSIZE, test_nuttx08_routine_1, NULL); + pid = task_create("test_nuttx_08_routine_1", TASK_PRIORITY, + DEFAULT_STACKSIZE, test_nuttx_08_routine_1, NULL); assert_true(pid > 0); - pid = task_create("TestNuttx08_routine_2", - TASK_PRIORITY, DEFAULT_STACKSIZE, test_nuttx08_routine_2, NULL); + pid = task_create("test_nuttx_08_routine_2", TASK_PRIORITY, + DEFAULT_STACKSIZE, test_nuttx_08_routine_2, NULL); assert_true(pid > 0); - pid = task_create("TestNuttx08_routine_3", - TASK_PRIORITY, DEFAULT_STACKSIZE, test_nuttx08_routine_3, NULL); + pid = task_create("test_nuttx_08_routine_3", TASK_PRIORITY, + DEFAULT_STACKSIZE, test_nuttx_08_routine_3, NULL); assert_true(pid > 0); waitpid(pid, &status, 0); } diff --git a/testing/testsuites/kernel/mm/cmocka_mm_test.c b/testing/testsuites/kernel/mm/cmocka_mm_test.c index 3b6ea07fe11..27341a84ab8 100644 --- a/testing/testsuites/kernel/mm/cmocka_mm_test.c +++ b/testing/testsuites/kernel/mm/cmocka_mm_test.c @@ -1,19 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/mm/cmocka_mm_test.c - * Copyright (C) 2020 Xiaomi Corporation * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ /**************************************************************************** * Included Files @@ -31,7 +34,7 @@ #include /**************************************************************************** - * Public Functions + * Private Functions ****************************************************************************/ /**************************************************************************** @@ -42,31 +45,24 @@ int main(int argc, char *argv[]) { /* Add Test Cases */ - const struct CMUnitTest nuttx_mm_test_suites[] = { - cmocka_unit_test_setup_teardown(test_nuttx_mm01, - test_nuttx_mmsetup, - test_nuttx_mmteardown), - cmocka_unit_test_setup_teardown(test_nuttx_mm02, - test_nuttx_mmsetup, - test_nuttx_mmteardown), - cmocka_unit_test_setup_teardown(test_nuttx_mm03, - test_nuttx_mmsetup, - test_nuttx_mmteardown), - cmocka_unit_test_setup_teardown(test_nuttx_mm04, - test_nuttx_mmsetup, - test_nuttx_mmteardown), - cmocka_unit_test_setup_teardown(test_nuttx_mm05, - test_nuttx_mmsetup, - test_nuttx_mmteardown), - cmocka_unit_test_setup_teardown(test_nuttx_mm06, - test_nuttx_mmsetup, - test_nuttx_mmteardown), - cmocka_unit_test_setup_teardown(test_nuttx_mm07, - test_nuttx_mmsetup, - test_nuttx_mmteardown), - cmocka_unit_test_setup_teardown(test_nuttx_mm08, - test_nuttx_mmsetup, - test_nuttx_mmteardown), + const struct CMUnitTest nuttx_mm_test_suites[] = + { + cmocka_unit_test_setup_teardown(test_nuttx_mm01, test_nuttx_mm_setup, + test_nuttx_mm_teardown), + cmocka_unit_test_setup_teardown(test_nuttx_mm02, test_nuttx_mm_setup, + test_nuttx_mm_teardown), + cmocka_unit_test_setup_teardown(test_nuttx_mm03, test_nuttx_mm_setup, + test_nuttx_mm_teardown), + cmocka_unit_test_setup_teardown(test_nuttx_mm04, test_nuttx_mm_setup, + test_nuttx_mm_teardown), + cmocka_unit_test_setup_teardown(test_nuttx_mm05, test_nuttx_mm_setup, + test_nuttx_mm_teardown), + cmocka_unit_test_setup_teardown(test_nuttx_mm06, test_nuttx_mm_setup, + test_nuttx_mm_teardown), + cmocka_unit_test_setup_teardown(test_nuttx_mm07, test_nuttx_mm_setup, + test_nuttx_mm_teardown), + cmocka_unit_test_setup_teardown(test_nuttx_mm08, test_nuttx_mm_setup, + test_nuttx_mm_teardown), }; /* Run Test cases */ diff --git a/testing/testsuites/kernel/mm/common/test_mm_common.c b/testing/testsuites/kernel/mm/common/test_mm_common.c index a5f2ba2b2eb..07157579128 100644 --- a/testing/testsuites/kernel/mm/common/test_mm_common.c +++ b/testing/testsuites/kernel/mm/common/test_mm_common.c @@ -1,24 +1,26 @@ /**************************************************************************** * apps/testing/testsuites/kernel/mm/common/test_mm_common.c - * Copyright (C) 2020 Xiaomi Corporation * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -45,7 +47,7 @@ int mmtest_get_rand_size(int min, int max) int rval = 1; if (min > 0 && max > 0 && (max - min) > 0) { - rval = rand() % (max - min) + min; + rval = rand() % (max - min) + min; } return rval; @@ -61,15 +63,15 @@ void mmtest_showmallinfo(void) alloc_info = mallinfo(); syslog(LOG_INFO, " mallinfo:\n"); syslog(LOG_INFO, " Total space allocated from system = %lu\n", - (unsigned long)alloc_info.arena); + (unsigned long)alloc_info.arena); syslog(LOG_INFO, " Number of non-inuse chunks = %lu\n", - (unsigned long)alloc_info.ordblks); + (unsigned long)alloc_info.ordblks); syslog(LOG_INFO, " Largest non-inuse chunk = %lu\n", - (unsigned long)alloc_info.mxordblk); + (unsigned long)alloc_info.mxordblk); syslog(LOG_INFO, " Total allocated space = %lu\n", - (unsigned long)alloc_info.uordblks); + (unsigned long)alloc_info.uordblks); syslog(LOG_INFO, " Total non-inuse space = %lu\n", - (unsigned long)alloc_info.fordblks); + (unsigned long)alloc_info.fordblks); } /**************************************************************************** @@ -93,7 +95,7 @@ unsigned long mmtest_get_memsize(void) if (memsize > 1024 * 1024 * 2) { - memsize = 1024 * 1024 * 2; + memsize = 1024 * 1024 * 2; } return memsize; @@ -105,19 +107,19 @@ unsigned long mmtest_get_memsize(void) ****************************************************************************/ /**************************************************************************** - * Name: TestNuttxMmsetup + * Name: test_nuttx_mm_setup ****************************************************************************/ -int test_nuttx_mmsetup(void **state) +int test_nuttx_mm_setup(void **state) { return 0; } /**************************************************************************** - * Name: TestNuttxMmteardown + * Name: test_nuttx_mm_teardown ****************************************************************************/ -int test_nuttx_mmteardown(void **state) +int test_nuttx_mm_teardown(void **state) { return 0; } diff --git a/testing/testsuites/kernel/mm/include/MmTest.h b/testing/testsuites/kernel/mm/include/MmTest.h index 3f8509250c4..6d1812d9aff 100644 --- a/testing/testsuites/kernel/mm/include/MmTest.h +++ b/testing/testsuites/kernel/mm/include/MmTest.h @@ -1,19 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/mm/include/MmTest.h - * Copyright (C) 2020 Xiaomi Corporation * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ #ifndef __SYSCALLTEST_H #define __SYSCALLTEST_H @@ -21,15 +24,14 @@ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include +#include /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ - #define PTHREAD_STACK_SIZE CONFIG_DEFAULT_TASK_STACKSIZE #define DEFAULT_STACKSIZE CONFIG_DEFAULT_TASK_STACKSIZE #define TASK_PRIORITY SCHED_PRIORITY_DEFAULT @@ -41,41 +43,55 @@ int mmtest_get_rand_size(int min, int max); void mmtest_showmallinfo(void); unsigned long mmtest_get_memsize(void); +static int __attribute__((unused)) +get_mem_info(struct mallinfo *mem_info) +{ + *mem_info = mallinfo(); + return 0; +} -int test_nuttx_mmsetup(void **state); -int test_nuttx_mmteardown(void **state); +int test_nuttx_mm_setup(void **state); +int test_nuttx_mm_teardown(void **state); /* test case function */ -/* cases/mm_test_001.c ******************************************************/ +/* cases/mm_test_001.c + * *****************************************************/ void test_nuttx_mm01(FAR void **state); -/* cases/mm_test_002.c ******************************************************/ +/* cases/mm_test_002.c + * *****************************************************/ void test_nuttx_mm02(FAR void **state); -/* cases/mm_test_003.c ******************************************************/ +/* cases/mm_test_003.c + * *****************************************************/ void test_nuttx_mm03(FAR void **state); -/* cases/mm_test_004.c ******************************************************/ +/* cases/mm_test_004.c + * *****************************************************/ void test_nuttx_mm04(FAR void **state); -/* cases/mm_test_005.c ******************************************************/ +/* cases/mm_test_005.c + * *****************************************************/ void test_nuttx_mm05(FAR void **state); -/* cases/mm_test_006.c ******************************************************/ +/* cases/mm_test_006.c + * *****************************************************/ void test_nuttx_mm06(FAR void **state); -/* cases/mm_test_007.c ******************************************************/ +/* cases/mm_test_007.c + * *****************************************************/ void test_nuttx_mm07(FAR void **state); -/* cases/mm_test_008.c ******************************************************/ +/* cases/mm_test_008.c + * *****************************************************/ void test_nuttx_mm08(FAR void **state); diff --git a/testing/testsuites/kernel/mm/tool/mem_batch_opt_perf_test.c b/testing/testsuites/kernel/mm/tool/mem_batch_opt_perf_test.c index 780779cbd90..740aa343584 100644 --- a/testing/testsuites/kernel/mm/tool/mem_batch_opt_perf_test.c +++ b/testing/testsuites/kernel/mm/tool/mem_batch_opt_perf_test.c @@ -3,25 +3,24 @@ * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -42,8 +41,9 @@ static void show_usage(void) { - printf("\nUsage: mm_stress_test \ - \n"); + printf( + "\nUsage: mm_stress_test " + "\n"); printf("\nWhere:\n"); printf(" Minimum number of memory requests.\n"); printf(" Maximum number of memory requests.\n"); @@ -51,10 +51,6 @@ static void show_usage(void) printf(" Number of tests.\n"); } -/**************************************************************************** - * Public Functions - ****************************************************************************/ - /**************************************************************************** * Name: main ****************************************************************************/ @@ -62,8 +58,10 @@ static void show_usage(void) int main(int argc, FAR char *argv[]) { int malloc_size = 0; - int mallc_min_size; /* The minimum memory length requested in the test */ - int mallc_max_size; /* The maximum memory length requested in the test */ + int mallc_min_size; /* The minimum memory length requested in the test + */ + int mallc_max_size; /* The maximum memory length requested in the test + */ int list_length; int test_num = 1; struct timespec t_start; @@ -96,29 +94,32 @@ int main(int argc, FAR char *argv[]) for (int i = 0; i < list_length; i++) { srand(i + gettid()); - malloc_size = mmtest_get_rand_size(mallc_min_size, mallc_max_size); + malloc_size = + mmtest_get_rand_size(mallc_min_size, mallc_max_size); clock_gettime(CLOCK_MONOTONIC, &t_start); address_ptr = (char *)malloc(malloc_size * sizeof(char)); clock_gettime(CLOCK_MONOTONIC, &t_end); - timedif = 1000000 * (t_end.tv_sec - t_start.tv_sec) - + (t_end.tv_nsec - t_start.tv_nsec) / 1000; + timedif = 1000000 * (t_end.tv_sec - t_start.tv_sec) + + (t_end.tv_nsec - t_start.tv_nsec) / 1000; if (address_ptr != NULL) { syslog(LOG_INFO, - "[Test %d Round] Allocate success -> mem_list[%d]" - " (address:%p size:%d) takes:%ld microseconds\n", - n, i, address_ptr, malloc_size, timedif); + "[Test %d Round] Allocate success -> mem_list[%d] " + "(address:%p size:%d) takes:%ld microseconds\n", + n, i, address_ptr, malloc_size, timedif); memset(address_ptr, 0x67, malloc_size); /* Add to list */ mem_list[i] = address_ptr; } + else { syslog(LOG_ERR, - "Malloc failed ! The remaining memory may be insufficient\n"); + "Malloc failed ! The remaining memory may be " + "insufficient\n"); syslog(LOG_ERR, "Continue to test !!\n"); /* Memory allocation failure */ @@ -136,11 +137,11 @@ int main(int argc, FAR char *argv[]) clock_gettime(CLOCK_MONOTONIC, &t_start); free(address_ptr); clock_gettime(CLOCK_MONOTONIC, &t_end); - timedif = 1000000 * (t_end.tv_sec - t_start.tv_sec) - + (t_end.tv_nsec - t_start.tv_nsec) / 1000; + timedif = 1000000 * (t_end.tv_sec - t_start.tv_sec) + + (t_end.tv_nsec - t_start.tv_nsec) / 1000; syslog(LOG_INFO, - "[Test %d Round] Free -> mem_list[%d] (size:%d)" - " takes:%ld microseconds\n", + "[Test %d Round] Free -> mem_list[%d] (size:%d) " + "takes:%ld microseconds\n", n, k, malloc_size, timedif); mem_list[k] = NULL; } diff --git a/testing/testsuites/kernel/mm/tool/mem_cycle_opt_perf_test.c b/testing/testsuites/kernel/mm/tool/mem_cycle_opt_perf_test.c index d4890a7b441..858f7abb516 100644 --- a/testing/testsuites/kernel/mm/tool/mem_cycle_opt_perf_test.c +++ b/testing/testsuites/kernel/mm/tool/mem_cycle_opt_perf_test.c @@ -3,25 +3,24 @@ * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -42,8 +41,9 @@ static void show_usage(void) { - printf("\nUsage: mm_stress_test \ - \n"); + printf( + "\nUsage: mm_stress_test " + "\n"); printf("\nWhere:\n"); printf(" Minimum number of memory requests.\n"); printf(" Maximum number of memory requests.\n"); @@ -51,10 +51,6 @@ static void show_usage(void) printf(" Malloc delay time, Unit: microseconds.\n"); } -/**************************************************************************** - * Public Functions - ****************************************************************************/ - /**************************************************************************** * Name: main ****************************************************************************/ @@ -62,11 +58,16 @@ static void show_usage(void) int main(int argc, FAR char *argv[]) { int malloc_size; - int mallc_min_size; /* The minimum memory length requested in the test */ - int mallc_max_size; /* The maximum memory length requested in the test */ + int mallc_min_size; /* The minimum memory length requested in the test + */ + int mallc_max_size; /* The maximum memory length requested in the test + */ int test_num; int application_delay_time = 1; /* Delay in test */ - char check_character; /* Memory write content check character */ + + /* Memory write content check character */ + + char check_character; char *address_ptr = NULL; struct timespec t_start; struct timespec t_end; @@ -92,19 +93,22 @@ int main(int argc, FAR char *argv[]) clock_gettime(CLOCK_MONOTONIC, &t_start); address_ptr = (char *)malloc(malloc_size * sizeof(char)); clock_gettime(CLOCK_MONOTONIC, &t_end); - timedif = 1000000 * (t_end.tv_sec - t_start.tv_sec) - + (t_end.tv_nsec - t_start.tv_nsec) / 1000; + timedif = 1000000 * (t_end.tv_sec - t_start.tv_sec) + + (t_end.tv_nsec - t_start.tv_nsec) / 1000; if (address_ptr != NULL) { syslog(LOG_INFO, - "[Test malloc] (address:%p size:%d) takes:%ld microseconds\n", - address_ptr, malloc_size, timedif); + "[Test malloc] (address:%p size:%d) takes:%ld " + "microseconds\n", + address_ptr, malloc_size, timedif); memset(address_ptr, check_character, malloc_size); } + else { syslog(LOG_ERR, - "Malloc failed ! The remaining memory may be insufficient\n"); + "Malloc failed ! The remaining memory may be " + "insufficient\n"); syslog(LOG_ERR, "Continue to test !!\n"); continue; } @@ -126,11 +130,12 @@ int main(int argc, FAR char *argv[]) /* Free test memory */ clock_gettime(CLOCK_MONOTONIC, &t_end); - timedif = 1000000 * (t_end.tv_sec - t_start.tv_sec) - + (t_end.tv_nsec - t_start.tv_nsec) / 1000; - syslog(LOG_INFO, - "[Test free] (address:%p size:%d) takes:%ld microseconds\n\n", - address_ptr, malloc_size, timedif); + timedif = 1000000 * (t_end.tv_sec - t_start.tv_sec) + + (t_end.tv_nsec - t_start.tv_nsec) / 1000; + syslog( + LOG_INFO, + "[Test free] (address:%p size:%d) takes:%ld microseconds\n\n", + address_ptr, malloc_size, timedif); free(address_ptr); usleep(application_delay_time); } diff --git a/testing/testsuites/kernel/mutex/cases/posix_mutex_test_001.c b/testing/testsuites/kernel/mutex/cases/posix_mutex_test_001.c new file mode 100644 index 00000000000..de3c521d7d8 --- /dev/null +++ b/testing/testsuites/kernel/mutex/cases/posix_mutex_test_001.c @@ -0,0 +1,56 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/mutex/cases/posix_mutex_test_001.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include "MutexTest.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_mutex_test01 + ****************************************************************************/ + +void test_nuttx_mutex_test01(FAR void **state) +{ + pthread_mutexattr_t mta; + int rc; + + /* Initialize a mutex attributes object */ + + rc = pthread_mutexattr_init(&mta); + syslog(LOG_INFO, "rc : %d\n", rc); + assert_int_equal(rc, 0); + + rc = pthread_mutexattr_destroy(&mta); + syslog(LOG_INFO, "rc : %d\n", rc); + assert_int_equal(rc, 0); +} diff --git a/testing/testsuites/kernel/mutex/cases/posix_mutex_test_019.c b/testing/testsuites/kernel/mutex/cases/posix_mutex_test_019.c new file mode 100644 index 00000000000..ed4326e53ec --- /dev/null +++ b/testing/testsuites/kernel/mutex/cases/posix_mutex_test_019.c @@ -0,0 +1,276 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/mutex/cases/posix_mutex_test_019.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include "MutexTest.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +static pthread_mutex_t *g_mtx; +static sem_t g_sema; +static sem_t g_semb; +static pthread_mutex_t g_mtxnull; +static pthread_mutex_t g_mtxdef; +static int g_testmutexretval; +static UINT32 g_testmutexcount; + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +static void *taskf01(void *arg) +{ + int ret; + + /* testbusytaskdelay(20); */ + + usleep(50000); + g_testmutexcount++; + + if ((ret = pthread_mutex_lock(g_mtx))) + { + syslog(LOG_INFO, "ret: %d \n", ret); + goto EXIT; + } + + if ((ret = sem_post(&g_sema))) + { + syslog(LOG_INFO, "ret: %d \n", ret); + goto EXIT; + } + + if ((ret = sem_wait(&g_semb))) + { + syslog(LOG_INFO, "ret: %d \n", ret); + goto EXIT; + } + + if (g_testmutexretval != 0) + { + /* parent thread failed to unlock the mutex) */ + + if ((ret = pthread_mutex_unlock(g_mtx))) + { + syslog(LOG_INFO, "ret: %d \n", ret); + goto EXIT; + } + } + + g_testmutexcount++; + return NULL; + +EXIT: + assert_int_equal(1, 0); + return NULL; +} + +/**************************************************************************** + * Name: test_nuttx_mutex_test19 + ****************************************************************************/ + +void test_nuttx_mutex_test19(FAR void **state) +{ + pthread_mutexattr_t mattr; + pthread_t thr; + + pthread_mutex_t *tabmutex[2]; + int tabres[2][3] = + { + { + 0, 0, 0 + }, + { + 0, 0, 0 + } + }; + + int ret; + void *thret = NULL; + int i; + g_testmutexretval = 0; + g_testmutexcount = 0; + + /* We first initialize the two mutexes. */ + + if ((ret = pthread_mutex_init(&g_mtxnull, NULL))) + { + syslog(LOG_INFO, "ret: %d \n", ret); + assert_int_equal(1, 0); + } + + if ((ret = pthread_mutexattr_init(&mattr))) + { + syslog(LOG_INFO, "ret: %d \n", ret); + assert_int_equal(1, 0); + } + + if ((ret = pthread_mutex_init(&g_mtxdef, &mattr))) + { + syslog(LOG_INFO, "ret: %d \n", ret); + assert_int_equal(1, 0); + } + + if ((ret = pthread_mutexattr_destroy(&mattr))) + { + syslog(LOG_INFO, "ret: %d \n", ret); + assert_int_equal(1, 0); + } + + tabmutex[0] = &g_mtxnull; + tabmutex[1] = &g_mtxdef; + + if ((ret = sem_init(&g_sema, 0, 0))) + { + syslog(LOG_INFO, "ret: %d \n", ret); + assert_int_equal(1, 0); + } + + if ((ret = sem_init(&g_semb, 0, 0))) + { + syslog(LOG_INFO, "ret: %d \n", ret); + assert_int_equal(1, 0); + } + + /* OK let's go for the first part of the test : abnormals unlocking */ + + /* We first check if unlocking an unlocked mutex returns an uwErr. */ + + ret = pthread_mutex_unlock(tabmutex[0]); + syslog(LOG_INFO, "ret: %d \n", ret); + assert_int_not_equal(ret, ENOERR); + + ret = pthread_mutex_unlock(tabmutex[1]); + syslog(LOG_INFO, "ret: %d \n", ret); + assert_int_not_equal(ret, ENOERR); + + /* Now we focus on unlocking a mutex lock by another thread */ + + for (i = 0; i < 2; i++) + { + /* 2, Set the timeout of runtime */ + + g_mtx = tabmutex[i]; + tabres[i][0] = 0; + tabres[i][1] = 0; + tabres[i][2] = 0; /* 2, buffer index. */ + + if ((ret = pthread_create(&thr, NULL, taskf01, NULL))) + { + syslog(LOG_INFO, "ret: %d \n", ret); + assert_int_equal(1, 0); + } + + if (i == 0) + { + syslog(LOG_INFO, "g_testmutexcount: %d \n", g_testmutexcount); + assert_int_equal(g_testmutexcount, 0); + } + + if (i == 1) + { + syslog(LOG_INFO, "g_testmutexcount: %d \n", g_testmutexcount); + assert_int_equal(g_testmutexcount, + 2); /* 2, Here, assert the g_testmutexcount. */ + } + + if ((ret = sem_wait(&g_sema))) + { + syslog(LOG_INFO, "ret: %d \n", ret); + assert_int_equal(1, 0); + } + + g_testmutexretval = pthread_mutex_unlock(g_mtx); + syslog(LOG_INFO, "g_testmutexretval: %d \n", g_testmutexretval); + assert_int_equal(g_testmutexretval, EPERM); + + if (i == 0) + { + syslog(LOG_INFO, "g_testmutexcount: %d \n", g_testmutexcount); + assert_int_equal(g_testmutexcount, 1); + } + + if (i == 1) + { + syslog(LOG_INFO, "g_testmutexcount: %d \n", g_testmutexcount); + assert_int_equal(g_testmutexcount, + 3); /* 3, Here, assert the g_testmutexcount. */ + } + + if ((ret = sem_post(&g_semb))) + { + syslog(LOG_INFO, "ret: %d \n", ret); + assert_int_equal(1, 0); + } + + if ((ret = pthread_join(thr, &thret))) + { + syslog(LOG_INFO, "ret: %d \n", ret); + assert_int_equal(1, 0); + } + + if (i == 0) + { + syslog(LOG_INFO, "g_testmutexcount: %d \n", g_testmutexcount); + assert_int_equal(g_testmutexcount, + 2); /* 2, Here, assert the g_testmutexcount. */ + } + + if (i == 1) + { + syslog(LOG_INFO, "g_testmutexcount: %d \n", g_testmutexcount); + assert_int_equal(g_testmutexcount, + 4); /* 4, Here, assert the g_testmutexcount. */ + } + + tabres[i][0] = g_testmutexretval; + } + + if (tabres[0][0] != tabres[1][0]) + { + assert_int_equal(1, 0); + } + + /* We start with testing the NULL mutex features */ + + (void)pthread_mutexattr_destroy(&mattr); + ret = pthread_mutex_destroy(&g_mtxnull); + syslog(LOG_INFO, "ret: %d \n", ret); + assert_int_equal(ret, 0); + + ret = pthread_mutex_destroy(&g_mtxdef); + syslog(LOG_INFO, "ret: %d \n", ret); + assert_int_equal(ret, 0); + + ret = sem_destroy(&g_sema); + syslog(LOG_INFO, "ret: %d \n", ret); + assert_int_equal(ret, 0); + + ret = sem_destroy(&g_semb); + syslog(LOG_INFO, "ret: %d \n", ret); + assert_int_equal(ret, 0); +} diff --git a/testing/testsuites/kernel/mutex/cases/posix_mutex_test_020.c b/testing/testsuites/kernel/mutex/cases/posix_mutex_test_020.c new file mode 100644 index 00000000000..c4c795ff0ff --- /dev/null +++ b/testing/testsuites/kernel/mutex/cases/posix_mutex_test_020.c @@ -0,0 +1,89 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/mutex/cases/posix_mutex_test_020.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include "MutexTest.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_mutex_test20 + ****************************************************************************/ + +void test_nuttx_mutex_test20(FAR void **state) +{ + pthread_mutex_t mutex; + int rc; + + /* Initialize a mutex object */ + + rc = pthread_mutex_init(&mutex, NULL); + syslog(LOG_INFO, "rc : %d\n", rc); + assert_int_equal(rc, ENOERR); + + /* Acquire the mutex object using pthread_mutex_lock */ + + if ((rc = pthread_mutex_lock(&mutex))) + { + syslog(LOG_INFO, "rc: %d \n", rc); + goto EXIT1; + } + + sleep(1); + + /* Release the mutex object using pthread_mutex_unlock */ + + if ((rc = pthread_mutex_unlock(&mutex))) + { + syslog(LOG_INFO, "rc: %d \n", rc); + goto EXIT2; + } + + /* Destroy the mutex object */ + + if ((rc = pthread_mutex_destroy(&mutex))) + { + syslog(LOG_INFO, "rc: %d \n", rc); + goto EXIT1; + } + + return; + +EXIT2: + pthread_mutex_unlock(&mutex); + assert_int_equal(1, 0); + +EXIT1: + pthread_mutex_destroy(&mutex); + assert_int_equal(1, 0); + return; +} diff --git a/testing/testsuites/kernel/mutex/cmocka_mutex_test.c b/testing/testsuites/kernel/mutex/cmocka_mutex_test.c new file mode 100644 index 00000000000..8ac241bec3f --- /dev/null +++ b/testing/testsuites/kernel/mutex/cmocka_mutex_test.c @@ -0,0 +1,62 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/mutex/cmocka_mutex_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "MutexTest.h" +#include + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: cmocka_sched_test_main + ****************************************************************************/ + +int main(int argc, char *argv[]) +{ + /* Add Test Cases */ + + const struct CMUnitTest nuttx_mutex_test_suites[] = + { + cmocka_unit_test_setup_teardown(test_nuttx_mutex_test01, NULL, NULL), +#ifdef CONFIG_PTHREAD_MUTEX_ROBUST + cmocka_unit_test_setup_teardown(test_nuttx_mutex_test19, NULL, NULL), +#endif + cmocka_unit_test_setup_teardown(test_nuttx_mutex_test20, NULL, NULL), + }; + + /* Run Test cases */ + + cmocka_run_group_tests(nuttx_mutex_test_suites, NULL, NULL); + + return 0; +} diff --git a/testing/testsuites/kernel/mutex/include/MutexTest.h b/testing/testsuites/kernel/mutex/include/MutexTest.h new file mode 100644 index 00000000000..f99a775de3b --- /dev/null +++ b/testing/testsuites/kernel/mutex/include/MutexTest.h @@ -0,0 +1,66 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/mutex/include/MutexTest.h + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ +#ifndef PTHREAD_TEST_H +#define PTHREAD_TEST_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "sched.h" +#include "semaphore.h" +#include "unistd.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ +#define MUTEX_TEST_NUM 100 +#define ENOERR 0 +typedef unsigned int UINT32; + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +/* test case function */ + +/* cases/posix_mutex_test_001.c + * ************************************************/ + +void test_nuttx_mutex_test01(FAR void **state); + +/* cases/posix_mutex_test_019.c + * ************************************************/ + +void test_nuttx_mutex_test19(FAR void **state); + +/* cases/posix_mutex_test_020.c + * ************************************************/ + +void test_nuttx_mutex_test20(FAR void **state); +#endif diff --git a/testing/testsuites/kernel/pthread/cases/posix_pthread_test_003.c b/testing/testsuites/kernel/pthread/cases/posix_pthread_test_003.c index 30aaea94ac4..1fe33deff09 100644 --- a/testing/testsuites/kernel/pthread/cases/posix_pthread_test_003.c +++ b/testing/testsuites/kernel/pthread/cases/posix_pthread_test_003.c @@ -3,30 +3,28 @@ * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include #include - #include "PthreadTest.h" /**************************************************************************** @@ -37,19 +35,19 @@ * Public Functions ****************************************************************************/ -static void *thread_f01(void *arg) +static void *threadf01(void *arg) { pthread_exit(NULL); return NULL; } /**************************************************************************** - * Name: TestNuttxPthreadTest03 + * Name: test_nuttx_pthread_test03 ****************************************************************************/ void test_nuttx_pthread_test03(FAR void **state) { - pthread_t a_thread; + pthread_t athread; pthread_t ptid; pthread_t a = 0; pthread_t b = 0; @@ -65,7 +63,7 @@ void test_nuttx_pthread_test03(FAR void **state) ptid = pthread_self(); syslog(LOG_INFO, "ptid: %d \n", ptid); assert_int_not_equal(ptid, 0); - pthread_create(&a_thread, NULL, thread_f01, NULL); + pthread_create(&athread, NULL, threadf01, NULL); tmp = pthread_equal(a, b); syslog(LOG_INFO, "ret: %d\n", tmp); @@ -83,7 +81,7 @@ void test_nuttx_pthread_test03(FAR void **state) pthread_attr_destroy(&aa); - ret = pthread_join(a_thread, NULL); + ret = pthread_join(athread, NULL); syslog(LOG_INFO, "ret of pthread_join: %d\n", ret); assert_int_equal(ret, 0); } diff --git a/testing/testsuites/kernel/pthread/cases/posix_pthread_test_004.c b/testing/testsuites/kernel/pthread/cases/posix_pthread_test_004.c index 3a6b98186b5..bd968c5769f 100644 --- a/testing/testsuites/kernel/pthread/cases/posix_pthread_test_004.c +++ b/testing/testsuites/kernel/pthread/cases/posix_pthread_test_004.c @@ -3,25 +3,24 @@ * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -37,24 +36,24 @@ * Public Functions ****************************************************************************/ -static void *thread_f01(void *arg) +static void *threadf01(void *arg) { pthread_exit((void *)2); /* 2, here set value of the exit status. */ return NULL; } /**************************************************************************** - * Name: TestNuttxPthreadTest04 + * Name: test_nuttx_pthread_test04 ****************************************************************************/ void test_nuttx_pthread_test04(FAR void **state) { - pthread_t main_th; - pthread_t new_th; + pthread_t mainth; + pthread_t newth; UINT32 ret; UINTPTR temp; - if (pthread_create(&new_th, NULL, thread_f01, NULL) != 0) + if (pthread_create(&newth, NULL, threadf01, NULL) != 0) { printf("Error creating thread\n"); assert_int_equal(1, 0); @@ -62,17 +61,17 @@ void test_nuttx_pthread_test04(FAR void **state) usleep(1000); - /* LOS_TaskDelay(1); - * Obtain the thread ID of this main function - */ + /* los_taskdelay(1); */ + + /* Obtain the thread ID of this main function */ - main_th = test_pthread_self(); + mainth = testpthreadself(); /* Compare the thread ID of the new thread to the main thread. * They should be different. If not, the test fails. */ - if (pthread_equal(new_th, main_th) != 0) + if (pthread_equal(newth, mainth) != 0) { printf("Test FAILED: A new thread wasn't created\n"); assert_int_equal(1, 0); @@ -80,9 +79,9 @@ void test_nuttx_pthread_test04(FAR void **state) usleep(1000); - /* TestExtraTaskDelay(1); */ + /* testextrataskdelay(1); */ - ret = pthread_join(new_th, (void *)&temp); + ret = pthread_join(newth, (void *)&temp); syslog(LOG_INFO, "ret: %d \n", ret); syslog(LOG_INFO, "temp: %ld \n", temp); assert_int_equal(ret, 0); diff --git a/testing/testsuites/kernel/pthread/cases/posix_pthread_test_005.c b/testing/testsuites/kernel/pthread/cases/posix_pthread_test_005.c index 7c3e9210440..32ec5f8c5ce 100644 --- a/testing/testsuites/kernel/pthread/cases/posix_pthread_test_005.c +++ b/testing/testsuites/kernel/pthread/cases/posix_pthread_test_005.c @@ -3,30 +3,29 @@ * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include #include -#include +#include #include "PthreadTest.h" /**************************************************************************** @@ -37,7 +36,7 @@ * Public Functions ****************************************************************************/ -static void *thread_f01(void *arg) +static void *threadf01(void *arg) { sleep(500); @@ -50,20 +49,19 @@ static void *thread_f01(void *arg) } /**************************************************************************** - * Name: TestNuttxPthreadTest05 + * Name: test_nuttx_pthread_test05 ****************************************************************************/ void test_nuttx_pthread_test05(FAR void **state) { - pthread_t new_th; + pthread_t newth; UINT32 ret; UINTPTR temp; - clock_t start; - clock_t finish; + clock_t start, finish; double duration; start = clock(); - if (pthread_create(&new_th, NULL, thread_f01, NULL) < 0) + if (pthread_create(&newth, NULL, threadf01, NULL) < 0) { syslog(LOG_INFO, "Error creating thread\n"); assert_int_equal(1, 0); @@ -71,18 +69,19 @@ void test_nuttx_pthread_test05(FAR void **state) usleep(1000); - /* LOS_TaskDelay(1); - * Try to cancel the newly created thread. If an error is returned, + /* los_taskdelay(1); */ + + /* Try to cancel the newly created thread. If an error is returned, * then the thread wasn't created successfully. */ - if (pthread_cancel(new_th) != 0) + if (pthread_cancel(newth) != 0) { syslog(LOG_INFO, "Test FAILED: A new thread wasn't created\n"); assert_int_equal(1, 0); } - ret = pthread_join(new_th, (void *)&temp); + ret = pthread_join(newth, (void *)&temp); finish = clock(); duration = (double)(finish - start) / CLOCKS_PER_SEC * 1000; syslog(LOG_INFO, "duration: %f \n", duration); diff --git a/testing/testsuites/kernel/pthread/cases/posix_pthread_test_006.c b/testing/testsuites/kernel/pthread/cases/posix_pthread_test_006.c index bf23bcb32c3..64c3266992b 100644 --- a/testing/testsuites/kernel/pthread/cases/posix_pthread_test_006.c +++ b/testing/testsuites/kernel/pthread/cases/posix_pthread_test_006.c @@ -3,25 +3,24 @@ * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -37,7 +36,7 @@ * Public Functions ****************************************************************************/ -static void *thread_f01(void *arg) +static void *threadf01(void *arg) { pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL); @@ -48,7 +47,7 @@ static void *thread_f01(void *arg) } /**************************************************************************** - * Name: TestNuttxPthreadTest06 + * Name: test_nuttx_pthread_test06 ****************************************************************************/ void test_nuttx_pthread_test06(FAR void **state) @@ -61,7 +60,7 @@ void test_nuttx_pthread_test06(FAR void **state) /* Create a new thread. */ - if (pthread_create(&a, NULL, thread_f01, NULL) != 0) + if (pthread_create(&a, NULL, threadf01, NULL) != 0) { printf("Error creating thread\n"); assert_int_equal(1, 0); @@ -69,7 +68,7 @@ void test_nuttx_pthread_test06(FAR void **state) usleep(1000); - /* LOS_TaskDelay(1); */ + /* los_taskdelay(1); */ pthread_cancel(a); diff --git a/testing/testsuites/kernel/pthread/cases/posix_pthread_test_009.c b/testing/testsuites/kernel/pthread/cases/posix_pthread_test_009.c index 4d14b0e2a98..731c097f9dd 100644 --- a/testing/testsuites/kernel/pthread/cases/posix_pthread_test_009.c +++ b/testing/testsuites/kernel/pthread/cases/posix_pthread_test_009.c @@ -3,25 +3,24 @@ * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -37,9 +36,9 @@ * Public Functions ****************************************************************************/ -static void *pthread_f01(void *arg) +static void *pthreadf01(void *arg) { - g_test_pthread_count++; + g_testpthreadcount++; pthread_exit(NULL); @@ -47,31 +46,31 @@ static void *pthread_f01(void *arg) } /**************************************************************************** - * Name: TestNuttxPthreadTest09 + * Name: test_nuttx_pthread_test09 ****************************************************************************/ void test_nuttx_pthread_test09(FAR void **state) { - pthread_t new_th; + pthread_t newth; UINT32 ret; UINTPTR temp = 1; /* _pthread_data *joinee = NULL; */ - g_test_pthread_count = 0; - g_test_pthread_task_max_num = 128; + g_testpthreadcount = 0; + g_testpthreadtaskmaxnum = 128; - ret = pthread_create(&new_th, NULL, pthread_f01, NULL); + ret = pthread_create(&newth, NULL, pthreadf01, NULL); syslog(LOG_INFO, "ret: %d \n", ret); assert_int_equal(ret, 0); usleep(1000); - /* LOS_TaskDelay(1); */ + /* los_taskdelay(1); */ - syslog(LOG_INFO, "g_testPthreadCount: %d \n", g_test_pthread_count); - assert_int_equal(g_test_pthread_count, 1); + syslog(LOG_INFO, "g_testpthreadcount: %d \n", g_testpthreadcount); + assert_int_equal(g_testpthreadcount, 1); - ret = pthread_join(g_test_pthread_task_max_num, (void *)&temp); + ret = pthread_join(g_testpthreadtaskmaxnum, (void *)&temp); syslog(LOG_INFO, "ret: %d \n", ret); syslog(LOG_INFO, "temp: %ld \n", temp); assert_int_equal(ret, ESRCH); @@ -83,20 +82,20 @@ void test_nuttx_pthread_test09(FAR void **state) syslog(LOG_INFO, "temp: %ld \n", temp); assert_int_equal(temp, 1); - ret = pthread_detach(g_test_pthread_task_max_num); + ret = pthread_detach(g_testpthreadtaskmaxnum); syslog(LOG_INFO, "ret: %d \n", ret); assert_int_equal(ret, ESRCH); - ret = pthread_join(new_th, NULL); + ret = pthread_join(newth, NULL); syslog(LOG_INFO, "ret: %d \n", ret); assert_int_equal(ret, 0); sleep(1); - ret = pthread_detach(new_th); + ret = pthread_detach(newth); syslog(LOG_INFO, "ret: %d \n", ret); assert_int_equal(ret, ESRCH); - ret = pthread_join(new_th, NULL); + ret = pthread_join(newth, NULL); syslog(LOG_INFO, "ret: %d \n", ret); assert_int_equal(ret, ESRCH); } diff --git a/testing/testsuites/kernel/pthread/cases/posix_pthread_test_018.c b/testing/testsuites/kernel/pthread/cases/posix_pthread_test_018.c index 1753538e73b..b4ca6b9eeb2 100644 --- a/testing/testsuites/kernel/pthread/cases/posix_pthread_test_018.c +++ b/testing/testsuites/kernel/pthread/cases/posix_pthread_test_018.c @@ -3,25 +3,24 @@ * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -33,40 +32,40 @@ * Pre-processor Definitions ****************************************************************************/ -static sem_t re_pthread_f01; +static sem_t re_pthreadf01; /**************************************************************************** * Public Functions ****************************************************************************/ -static void *pthread_f01(void *argument) +static void *pthreadf01(void *argument) { - g_test_pthread_count++; - sem_wait(&re_pthread_f01); + g_testpthreadcount++; + sem_wait(&re_pthreadf01); return argument; } /**************************************************************************** - * Name: TestNuttxPthreadTest18 + * Name: test_nuttx_pthread_test18 ****************************************************************************/ void test_nuttx_pthread_test18(FAR void **state) { pthread_attr_t attr; - pthread_t new_th; + pthread_t newth; UINT32 ret; UINTPTR temp; int policy; struct sched_param param; struct sched_param param2 = - { - 2 - }; /* 2, init */ + { + 2 + }; /* 2, init */ - g_test_pthread_count = 0; + g_testpthreadcount = 0; - ret = sem_init(&re_pthread_f01, 0, 0); + ret = sem_init(&re_pthreadf01, 0, 0); syslog(LOG_INFO, "ret: %d \n", ret); assert_int_equal(ret, 0); @@ -74,65 +73,73 @@ void test_nuttx_pthread_test18(FAR void **state) syslog(LOG_INFO, "ret: %d \n", ret); assert_int_equal(ret, 0); - ret = pthread_create(&new_th, NULL, pthread_f01, (void *)9); /* 9, test param of the function. */ + ret = pthread_create(&newth, NULL, pthreadf01, + (void *)9); /* 9, test param of the function. */ syslog(LOG_INFO, "ret: %d \n", ret); assert_int_equal(ret, 0); usleep(1000); - /* LOS_TaskDelay(1); */ + /* los_taskdelay(1); */ - syslog(LOG_INFO, "g_testPthreadCount: %d \n", g_test_pthread_count); - assert_int_equal(g_test_pthread_count, 1); + syslog(LOG_INFO, "g_testpthreadcount: %d \n", g_testpthreadcount); + assert_int_equal(g_testpthreadcount, 1); - ret = pthread_setschedparam(new_th, -1, ¶m); + ret = pthread_setschedparam(newth, -1, ¶m); syslog(LOG_INFO, "ret: %d \n", ret); assert_int_equal(ret, EINVAL); - ret = pthread_setschedparam(new_th, 100, ¶m); /* 4, test for invalid param. */ + ret = pthread_setschedparam(newth, 100, + ¶m); /* 4, test for invalid param. */ syslog(LOG_INFO, "ret: %d \n", ret); assert_int_equal(ret, EINVAL); #if CONFIG_RR_INTERVAL > 0 param.sched_priority = 31; /* 31, init */ - ret = pthread_setschedparam(new_th, SCHED_RR, ¶m); + ret = pthread_setschedparam(newth, SCHED_RR, ¶m); syslog(LOG_INFO, "ret: %d \n", ret); assert_int_equal(ret, 0); #endif - ret = pthread_getschedparam(new_th, NULL, ¶m2); + ret = pthread_getschedparam(newth, NULL, ¶m2); syslog(LOG_INFO, "ret: %d \n", ret); - syslog(LOG_INFO, "param2.sched_priority: %d \n", param2.sched_priority); + syslog(LOG_INFO, "param2.sched_priority: %d \n", + param2.sched_priority); assert_int_equal(ret, EINVAL); - assert_int_equal(param2.sched_priority, 2); /* 2, here assert the result. */ + assert_int_equal(param2.sched_priority, + 2); /* 2, here assert the result. */ - ret = pthread_getschedparam(new_th, &policy, NULL); + ret = pthread_getschedparam(newth, &policy, NULL); syslog(LOG_INFO, "ret: %d \n", ret); assert_int_equal(ret, EINVAL); - ret = pthread_getschedparam(new_th, &policy, ¶m2); + ret = pthread_getschedparam(newth, &policy, ¶m2); syslog(LOG_INFO, "ret: %d \n", ret); - syslog(LOG_INFO, "param2.sched_priority: %d \n", param2.sched_priority); + syslog(LOG_INFO, "param2.sched_priority: %d \n", + param2.sched_priority); assert_int_equal(ret, 0); #if CONFIG_RR_INTERVAL > 0 - assert_int_equal(param2.sched_priority, 31); /* 31, here assert the result. */ + assert_int_equal(param2.sched_priority, + 31); /* 31, here assert the result. */ #endif - ret = sem_post(&re_pthread_f01); + ret = sem_post(&re_pthreadf01); syslog(LOG_INFO, "ret of sem_post: %d \n", ret); assert_int_equal(ret, 0); - ret = pthread_join(new_th, (void *)&temp); + ret = pthread_join(newth, (void *)&temp); syslog(LOG_INFO, "ret: %d \n", ret); syslog(LOG_INFO, "temp: %ld \n", temp); assert_int_equal(ret, 0); assert_int_equal(temp, 9); /* 9, here assert the result. */ #if CONFIG_RR_INTERVAL > 0 - ret = pthread_setschedparam(new_th + 9, SCHED_RR, ¶m); /* 9, test for invalid param. */ + ret = pthread_setschedparam(newth + 9, SCHED_RR, + ¶m); /* 9, test for invalid param. */ syslog(LOG_INFO, "ret: %d \n", ret); assert_int_equal(ret, ESRCH); #endif - ret = pthread_getschedparam(new_th + 8, &policy, ¶m2); /* 8, test for invalid param. */ + ret = pthread_getschedparam(newth + 8, &policy, + ¶m2); /* 8, test for invalid param. */ syslog(LOG_INFO, "ret: %d \n", ret); assert_int_equal(ret, ESRCH); @@ -140,7 +147,7 @@ void test_nuttx_pthread_test18(FAR void **state) syslog(LOG_INFO, "ret: %d \n", ret); assert_int_equal(ret, 0); - ret = sem_destroy(&re_pthread_f01); + ret = sem_destroy(&re_pthreadf01); syslog(LOG_INFO, "ret: %d \n", ret); assert_int_equal(ret, 0); } diff --git a/testing/testsuites/kernel/pthread/cases/posix_pthread_test_019.c b/testing/testsuites/kernel/pthread/cases/posix_pthread_test_019.c index 875c43bc8aa..58134db0529 100644 --- a/testing/testsuites/kernel/pthread/cases/posix_pthread_test_019.c +++ b/testing/testsuites/kernel/pthread/cases/posix_pthread_test_019.c @@ -3,25 +3,24 @@ * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -37,39 +36,39 @@ * Public Functions ****************************************************************************/ -static void pthread_once_f01(void) +static void pthreadoncef01(void) { - g_test_pthread_count++; + g_testpthreadcount++; } /**************************************************************************** - * Name: TestNuttxPthreadTest19 + * Name: test_nuttx_pthread_test19 ****************************************************************************/ void test_nuttx_pthread_test19(FAR void **state) { UINT32 ret; - pthread_once_t once_block = PTHREAD_ONCE_INIT; + pthread_once_t onceblock = PTHREAD_ONCE_INIT; - g_test_pthread_count = 0; + g_testpthreadcount = 0; - ret = pthread_once(NULL, pthread_once_f01); + ret = pthread_once(NULL, pthreadoncef01); syslog(LOG_INFO, "ret: %d \n", ret); assert_int_equal(ret, EINVAL); - ret = pthread_once(&once_block, NULL); + ret = pthread_once(&onceblock, NULL); syslog(LOG_INFO, "ret: %d \n", ret); assert_int_equal(ret, EINVAL); - ret = pthread_once(&once_block, pthread_once_f01); + ret = pthread_once(&onceblock, pthreadoncef01); syslog(LOG_INFO, "ret: %d \n", ret); assert_int_equal(ret, 0); - syslog(LOG_INFO, "g_testPthreadCount: %d \n", g_test_pthread_count); - assert_int_equal(g_test_pthread_count, 1); + syslog(LOG_INFO, "g_testpthreadcount: %d \n", g_testpthreadcount); + assert_int_equal(g_testpthreadcount, 1); - ret = pthread_once(&once_block, pthread_once_f01); + ret = pthread_once(&onceblock, pthreadoncef01); syslog(LOG_INFO, "ret: %d \n", ret); - syslog(LOG_INFO, "g_testPthreadCount: %d \n", g_test_pthread_count); + syslog(LOG_INFO, "g_testpthreadcount: %d \n", g_testpthreadcount); assert_int_equal(ret, 0); - assert_int_equal(g_test_pthread_count, 1); + assert_int_equal(g_testpthreadcount, 1); } diff --git a/testing/testsuites/kernel/pthread/cases/posix_pthread_test_021.c b/testing/testsuites/kernel/pthread/cases/posix_pthread_test_021.c index cc81e71bbb7..93a833a028a 100644 --- a/testing/testsuites/kernel/pthread/cases/posix_pthread_test_021.c +++ b/testing/testsuites/kernel/pthread/cases/posix_pthread_test_021.c @@ -3,25 +3,24 @@ * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -38,7 +37,7 @@ ****************************************************************************/ /**************************************************************************** - * Name: TestNuttxPthreadTest21 + * Name: test_nuttx_pthread_test21 ****************************************************************************/ void test_nuttx_pthread_test21(FAR void **state) @@ -47,11 +46,13 @@ void test_nuttx_pthread_test21(FAR void **state) int oldstate; int oldstype; - ret = pthread_setcancelstate(2, &oldstate); /* 2, test for invalid param. */ + ret = + pthread_setcancelstate(2, &oldstate); /* 2, test for invalid param. */ syslog(LOG_INFO, "ret: %d \n", ret); assert_int_equal(ret, EINVAL); - ret = pthread_setcancelstate(3, &oldstate); /* 3, test for invalid param. */ + ret = + pthread_setcancelstate(3, &oldstate); /* 3, test for invalid param. */ syslog(LOG_INFO, "ret: %d \n", ret); assert_int_equal(ret, EINVAL); @@ -65,11 +66,13 @@ void test_nuttx_pthread_test21(FAR void **state) syslog(LOG_INFO, "oldstate: %d \n", oldstate); assert_int_equal(oldstate, PTHREAD_CANCEL_ENABLE); - ret = pthread_setcanceltype(2, &oldstype); /* 2, test for invalid param. */ + ret = + pthread_setcanceltype(2, &oldstype); /* 2, test for invalid param. */ syslog(LOG_INFO, "ret: %d \n", ret); assert_int_equal(ret, EINVAL); - ret = pthread_setcanceltype(3, &oldstype); /* 3, test for invalid param. */ + ret = + pthread_setcanceltype(3, &oldstype); /* 3, test for invalid param. */ syslog(LOG_INFO, "ret: %d \n", ret); assert_int_equal(ret, EINVAL); diff --git a/testing/testsuites/kernel/pthread/cmocka_pthread_test.c b/testing/testsuites/kernel/pthread/cmocka_pthread_test.c index 364b57d0d4a..1045ff6fea6 100644 --- a/testing/testsuites/kernel/pthread/cmocka_pthread_test.c +++ b/testing/testsuites/kernel/pthread/cmocka_pthread_test.c @@ -1,24 +1,26 @@ /**************************************************************************** * apps/testing/testsuites/kernel/pthread/cmocka_pthread_test.c - * Copyright (C) 2020 Xiaomi Corporation * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -43,15 +45,24 @@ int main(int argc, char *argv[]) { /* Add Test Cases */ - const struct CMUnitTest nuttx_pthread_test_suites[] = { - cmocka_unit_test_setup_teardown(test_nuttx_pthread_test03, NULL, NULL), - cmocka_unit_test_setup_teardown(test_nuttx_pthread_test04, NULL, NULL), - cmocka_unit_test_setup_teardown(test_nuttx_pthread_test05, NULL, NULL), - cmocka_unit_test_setup_teardown(test_nuttx_pthread_test06, NULL, NULL), - cmocka_unit_test_setup_teardown(test_nuttx_pthread_test09, NULL, NULL), - cmocka_unit_test_setup_teardown(test_nuttx_pthread_test18, NULL, NULL), - cmocka_unit_test_setup_teardown(test_nuttx_pthread_test19, NULL, NULL), - cmocka_unit_test_setup_teardown(test_nuttx_pthread_test21, NULL, NULL), + const struct CMUnitTest nuttx_pthread_test_suites[] = + { + cmocka_unit_test_setup_teardown(test_nuttx_pthread_test03, NULL, + NULL), + cmocka_unit_test_setup_teardown(test_nuttx_pthread_test04, NULL, + NULL), + cmocka_unit_test_setup_teardown(test_nuttx_pthread_test05, NULL, + NULL), + cmocka_unit_test_setup_teardown(test_nuttx_pthread_test06, NULL, + NULL), + cmocka_unit_test_setup_teardown(test_nuttx_pthread_test09, NULL, + NULL), + cmocka_unit_test_setup_teardown(test_nuttx_pthread_test18, NULL, + NULL), + cmocka_unit_test_setup_teardown(test_nuttx_pthread_test19, NULL, + NULL), + cmocka_unit_test_setup_teardown(test_nuttx_pthread_test21, NULL, + NULL), }; /* Run Test cases */ diff --git a/testing/testsuites/kernel/pthread/common/test_pthread_common.c b/testing/testsuites/kernel/pthread/common/test_pthread_common.c index f0c2ce6e4de..0c395f5b474 100644 --- a/testing/testsuites/kernel/pthread/common/test_pthread_common.c +++ b/testing/testsuites/kernel/pthread/common/test_pthread_common.c @@ -3,25 +3,24 @@ * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -38,9 +37,8 @@ #include #include "PthreadTest.h" -UINT32 g_test_pthread_count; -UINT32 g_test_pthread_task_max_num = 128; - +UINT32 g_testpthreadcount; +UINT32 g_testpthreadtaskmaxnum = 128; /**************************************************************************** * Private Functions ****************************************************************************/ @@ -50,10 +48,10 @@ UINT32 g_test_pthread_task_max_num = 128; ****************************************************************************/ /**************************************************************************** - * Name: TestPthreadSelf + * Name: testpthreadself ****************************************************************************/ -pthread_t test_pthread_self(void) +pthread_t testpthreadself(void) { pthread_t tid = pthread_self(); return tid; diff --git a/testing/testsuites/kernel/pthread/include/PthreadTest.h b/testing/testsuites/kernel/pthread/include/PthreadTest.h index 9dc03c7ae3f..8a0c8655f8e 100644 --- a/testing/testsuites/kernel/pthread/include/PthreadTest.h +++ b/testing/testsuites/kernel/pthread/include/PthreadTest.h @@ -3,28 +3,26 @@ * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. * ****************************************************************************/ +#ifndef PTHREAD_TEST_H +#define PTHREAD_TEST_H /**************************************************************************** * Included Files ****************************************************************************/ - -#ifndef PTHREAD_TEST_H -#define PTHREAD_TEST_H - #include #include #include @@ -59,7 +57,10 @@ typedef unsigned long UINTPTR; #define THREAD_NUM 3 #define PTHREAD_TIMEOUT (THREAD_NUM * 2) #define PTHREAD_INTHREAD_TEST 0 /* Control going to or is already for Thread */ -#define PTHREAD_INMAIN_TEST 1 /* Control going to or is already for Main */ + +/* Control going to or is already for Main */ + +#define PTHREAD_INMAIN_TEST 1 #define INVALID_PSHARED_VALUE (-100) #define NUM_OF_CONDATTR 10 #define RUNTIME 5 @@ -75,52 +76,63 @@ typedef unsigned long UINTPTR; /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */ +#ifndef _POSIX_C_SOURCE #define _POSIX_C_SOURCE 200112L +#endif + #define PRIORITY_OTHER (-1) #define PRIORITY_FIFO 20 #define PRIORITY_RR 20 #define LOSCFG_BASE_CORE_TSK_CONFIG 1024 -extern UINT32 g_test_pthread_count; -extern UINT32 g_test_pthread_task_max_num; +extern UINT32 g_testpthreadcount; +extern UINT32 g_testpthreadtaskmaxnum; /**************************************************************************** * Public Function Prototypes ****************************************************************************/ -pthread_t test_pthread_self(void); +pthread_t testpthreadself(void); /* test case function */ -/* cases/posix_pthread_test_003.c *******************************************/ +/* cases/posix_pthread_test_003.c + * ************************************************/ void test_nuttx_pthread_test03(FAR void **state); -/* cases/posix_pthread_test_004.c *******************************************/ +/* cases/posix_pthread_test_004.c + * ************************************************/ void test_nuttx_pthread_test04(FAR void **state); -/* cases/posix_pthread_test_005.c *******************************************/ +/* cases/posix_pthread_test_005.c + * ************************************************/ void test_nuttx_pthread_test05(FAR void **state); -/* cases/posix_pthread_test_006.c *******************************************/ +/* cases/posix_pthread_test_006.c + * ************************************************/ void test_nuttx_pthread_test06(FAR void **state); -/* cases/posix_pthread_test_009.c *******************************************/ +/* cases/posix_pthread_test_009.c + * ************************************************/ void test_nuttx_pthread_test09(FAR void **state); -/* cases/posix_pthread_test_018.c *******************************************/ +/* cases/posix_pthread_test_018.c + * ************************************************/ void test_nuttx_pthread_test18(FAR void **state); -/* cases/posix_pthread_test_019.c *******************************************/ +/* cases/posix_pthread_test_019.c + * ************************************************/ void test_nuttx_pthread_test19(FAR void **state); -/* cases/posix_pthread_test_021.c *******************************************/ +/* cases/posix_pthread_test_021.c + * ************************************************/ void test_nuttx_pthread_test21(FAR void **state); #endif diff --git a/testing/testsuites/kernel/sched/cases/api_pthread_test_001.c b/testing/testsuites/kernel/sched/cases/api_pthread_test_001.c index 84b17c3a23f..f7e3dd367a7 100644 --- a/testing/testsuites/kernel/sched/cases/api_pthread_test_001.c +++ b/testing/testsuites/kernel/sched/cases/api_pthread_test_001.c @@ -3,25 +3,24 @@ * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -44,10 +43,10 @@ ****************************************************************************/ /**************************************************************************** - * Name: sched_pthread01_threadroutine + * Name: schedpthread01threadroutine ****************************************************************************/ -static void *sched_pthread01_threadroutine(void *arg) +static void *schedpthread01threadroutine(void *arg) { int flag; flag = 1; @@ -70,7 +69,7 @@ void test_nuttx_sched_pthread01(FAR void **state) /* create thread */ - pthread_create(&p_t, NULL, sched_pthread01_threadroutine, &run_flag); + pthread_create(&p_t, NULL, schedpthread01threadroutine, &run_flag); /* pthread_join Wait for the thread to end */ diff --git a/testing/testsuites/kernel/sched/cases/api_pthread_test_002.c b/testing/testsuites/kernel/sched/cases/api_pthread_test_002.c index 5da762dad83..bc70ca80945 100644 --- a/testing/testsuites/kernel/sched/cases/api_pthread_test_002.c +++ b/testing/testsuites/kernel/sched/cases/api_pthread_test_002.c @@ -3,25 +3,24 @@ * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -44,10 +43,10 @@ ****************************************************************************/ /**************************************************************************** - * Name: sched_pthread02_threadroutine + * Name: schedpthread02threadroutine ****************************************************************************/ -static void *sched_pthread02_threadroutine(void *arg) +static void *schedpthread02threadroutine(void *arg) { return NULL; } @@ -87,7 +86,7 @@ void test_nuttx_sched_pthread02(FAR void **state) /* create thread */ - pthread_create(&p_t, &attr, sched_pthread02_threadroutine, NULL); + pthread_create(&p_t, &attr, schedpthread02threadroutine, NULL); /* Wait for the child thread finish */ diff --git a/testing/testsuites/kernel/sched/cases/api_pthread_test_003.c b/testing/testsuites/kernel/sched/cases/api_pthread_test_003.c index 609c6bdafcd..2d4998043d3 100644 --- a/testing/testsuites/kernel/sched/cases/api_pthread_test_003.c +++ b/testing/testsuites/kernel/sched/cases/api_pthread_test_003.c @@ -3,25 +3,24 @@ * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -44,10 +43,10 @@ ****************************************************************************/ /**************************************************************************** - * Name: sched_pthread03_threadroutine + * Name: schedpthread03threadroutine ****************************************************************************/ -static void *sched_pthread03_threadroutine(void *arg) +static void *schedpthread03threadroutine(void *arg) { int i = 0; for (i = 0; i <= 5; i++) @@ -80,8 +79,8 @@ void test_nuttx_sched_pthread03(FAR void **state) /* create test thread */ - ret = pthread_create(&pid_1, NULL, - (void *)sched_pthread03_threadroutine, &run_flag); + ret = pthread_create(&pid_1, NULL, (void *)schedpthread03threadroutine, + &run_flag); assert_int_equal(ret, 0); pthread_join(pid_1, NULL); diff --git a/testing/testsuites/kernel/sched/cases/api_pthread_test_004.c b/testing/testsuites/kernel/sched/cases/api_pthread_test_004.c index 5d276beaf99..5c37ac9b3a6 100644 --- a/testing/testsuites/kernel/sched/cases/api_pthread_test_004.c +++ b/testing/testsuites/kernel/sched/cases/api_pthread_test_004.c @@ -3,25 +3,24 @@ * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -44,10 +43,10 @@ ****************************************************************************/ /**************************************************************************** - * Name: sched_pthread04_threadroutine + * Name: schedpthread04threadroutine ****************************************************************************/ -static void *sched_pthread04_threadroutine(void *arg) +static void *schedpthread04threadroutine(void *arg) { /* set enable */ @@ -82,13 +81,12 @@ void test_nuttx_sched_pthread04(FAR void **state) /* int flag */ - int sched_pthread_test04_run_flag = 0; + int schedpthreadtest04_run_flag = 0; /* create thread_1 */ - res = pthread_create(&p_t_1, NULL, - sched_pthread04_threadroutine, - &sched_pthread_test04_run_flag); + res = pthread_create(&p_t_1, NULL, schedpthread04threadroutine, + &schedpthreadtest04_run_flag); assert_int_equal(res, OK); res = pthread_cancel(p_t_1); @@ -97,5 +95,5 @@ void test_nuttx_sched_pthread04(FAR void **state) /* join thread_1 */ pthread_join(p_t_1, NULL); - assert_int_equal(sched_pthread_test04_run_flag, 0); + assert_int_equal(schedpthreadtest04_run_flag, 0); } diff --git a/testing/testsuites/kernel/sched/cases/api_pthread_test_005.c b/testing/testsuites/kernel/sched/cases/api_pthread_test_005.c index cffbfaacb8b..5dc47df2f7d 100644 --- a/testing/testsuites/kernel/sched/cases/api_pthread_test_005.c +++ b/testing/testsuites/kernel/sched/cases/api_pthread_test_005.c @@ -3,25 +3,24 @@ * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -44,10 +43,10 @@ ****************************************************************************/ /**************************************************************************** - * Name: sched_pthread05_threadroutine + * Name: schedpthread05threadroutine ****************************************************************************/ -static void *sched_pthread05_threadroutine(void *arg) +static void *schedpthread05threadroutine(void *arg) { int i; for (i = 0; i <= 5; i++) @@ -76,7 +75,7 @@ void test_nuttx_sched_pthread05(FAR void **state) /* create thread */ - res = pthread_create(&p_t, NULL, sched_pthread05_threadroutine, NULL); + res = pthread_create(&p_t, NULL, schedpthread05threadroutine, NULL); assert_int_equal(res, 0); diff --git a/testing/testsuites/kernel/sched/cases/api_pthread_test_006.c b/testing/testsuites/kernel/sched/cases/api_pthread_test_006.c index 7a52f2ecf95..9a962f5fe0b 100644 --- a/testing/testsuites/kernel/sched/cases/api_pthread_test_006.c +++ b/testing/testsuites/kernel/sched/cases/api_pthread_test_006.c @@ -3,25 +3,24 @@ * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -44,10 +43,10 @@ ****************************************************************************/ /**************************************************************************** - * Name: sched_pthread06_threadroutine + * Name: schedpthread06threadroutine ****************************************************************************/ -static void *sched_pthread06_threadroutine(void *arg) +static void *schedpthread06threadroutine(void *arg) { int pid; @@ -59,6 +58,7 @@ static void *sched_pthread06_threadroutine(void *arg) { *((int *)arg) = 0; } + else { *((int *)arg) = 1; @@ -83,7 +83,8 @@ void test_nuttx_sched_pthread06(FAR void **state) /* create thread */ - res = pthread_create(&p_t, NULL, sched_pthread06_threadroutine, &run_flag); + res = + pthread_create(&p_t, NULL, schedpthread06threadroutine, &run_flag); assert_int_equal(res, OK); pthread_join(p_t, NULL); diff --git a/testing/testsuites/kernel/sched/cases/api_pthread_test_007.c b/testing/testsuites/kernel/sched/cases/api_pthread_test_007.c index 82bc5948989..f26d3e1795a 100644 --- a/testing/testsuites/kernel/sched/cases/api_pthread_test_007.c +++ b/testing/testsuites/kernel/sched/cases/api_pthread_test_007.c @@ -3,25 +3,24 @@ * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -44,18 +43,18 @@ ****************************************************************************/ /**************************************************************************** - * Name: sched_pthread07_threadroutine + * Name: schedpthread07threadroutine ****************************************************************************/ -static void *sched_pthread07_threadroutine(void *arg) +static void *schedpthread07threadroutine(void *arg) { int i; - pthread_mutex_t sched_pthread_test07_mutex = PTHREAD_MUTEX_INITIALIZER; + pthread_mutex_t schedpthreadtest07_mutex = PTHREAD_MUTEX_INITIALIZER; for (i = 0; i < 100; i++) { - pthread_mutex_lock(&sched_pthread_test07_mutex); + pthread_mutex_lock(&schedpthreadtest07_mutex); (*((int *)arg))++; - pthread_mutex_unlock(&sched_pthread_test07_mutex); + pthread_mutex_unlock(&schedpthreadtest07_mutex); } return NULL; @@ -75,14 +74,14 @@ void test_nuttx_sched_pthread07(FAR void **state) pthread_t pt_1, pt_2, pt_3; int run_flag = 0; - res = pthread_create(&pt_1, NULL, - (void *)sched_pthread07_threadroutine, &run_flag); + res = pthread_create(&pt_1, NULL, (void *)schedpthread07threadroutine, + &run_flag); assert_int_equal(res, OK); - res = pthread_create(&pt_2, NULL, - (void *)sched_pthread07_threadroutine, &run_flag); + res = pthread_create(&pt_2, NULL, (void *)schedpthread07threadroutine, + &run_flag); assert_int_equal(res, OK); - res = pthread_create(&pt_3, NULL, - (void *)sched_pthread07_threadroutine, &run_flag); + res = pthread_create(&pt_3, NULL, (void *)schedpthread07threadroutine, + &run_flag); assert_int_equal(res, OK); pthread_join(pt_1, NULL); diff --git a/testing/testsuites/kernel/sched/cases/api_pthread_test_008.c b/testing/testsuites/kernel/sched/cases/api_pthread_test_008.c index a2d25a52238..e180fc8d0bc 100644 --- a/testing/testsuites/kernel/sched/cases/api_pthread_test_008.c +++ b/testing/testsuites/kernel/sched/cases/api_pthread_test_008.c @@ -3,25 +3,24 @@ * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -43,22 +42,22 @@ * Private Data ****************************************************************************/ -static sem_t sched_task08_sem; +static sem_t schedtask08_sem; /**************************************************************************** * Private Functions ****************************************************************************/ /**************************************************************************** - * Name: sched_pthread08_threadroutine + * Name: schedpthread08threadroutine ****************************************************************************/ -static void *sched_pthread08_threadroutine(void *arg) +static void *schedpthread08threadroutine(void *arg) { int i; for (i = 0; i < 5; i++) { - sem_wait(&sched_task08_sem); + sem_wait(&schedtask08_sem); (*((int *)arg))++; } @@ -79,25 +78,25 @@ void test_nuttx_sched_pthread08(FAR void **state) pthread_t pthread_id; int run_flag = 0; - res = sem_init(&sched_task08_sem, 0, 0); + res = sem_init(&schedtask08_sem, 0, 0); assert_int_equal(res, OK); /* create pthread */ res = pthread_create(&pthread_id, NULL, - (void *)sched_pthread08_threadroutine, &run_flag); + (void *)schedpthread08threadroutine, &run_flag); assert_int_equal(res, OK); while (1) { sleep(2); - res = sem_post(&sched_task08_sem); + res = sem_post(&schedtask08_sem); assert_int_equal(res, OK); if (run_flag == 5) break; } - res = sem_destroy(&sched_task08_sem); + res = sem_destroy(&schedtask08_sem); assert_int_equal(res, OK); assert_int_equal(run_flag, 5); } diff --git a/testing/testsuites/kernel/sched/cases/api_pthread_test_009.c b/testing/testsuites/kernel/sched/cases/api_pthread_test_009.c index 2e884011104..1885d5dc312 100644 --- a/testing/testsuites/kernel/sched/cases/api_pthread_test_009.c +++ b/testing/testsuites/kernel/sched/cases/api_pthread_test_009.c @@ -3,25 +3,24 @@ * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -43,26 +42,26 @@ * Private Data ****************************************************************************/ -static sem_t sched_task09_sem; +static sem_t schedtask09_sem; /**************************************************************************** * Private Functions ****************************************************************************/ /**************************************************************************** - * Name: sched_pthread09_threadroutine + * Name: schedpthread09threadroutine ****************************************************************************/ -static void *sched_pthread09_threadroutine(void *arg) +static void *schedpthread09threadroutine(void *arg) { int i; int res; for (i = 0; i < 10; i++) { - res = sem_wait(&sched_task09_sem); + res = sem_wait(&schedtask09_sem); assert_int_equal(res, OK); (*((int *)arg))++; - res = sem_post(&sched_task09_sem); + res = sem_post(&schedtask09_sem); assert_int_equal(res, OK); } @@ -83,14 +82,15 @@ void test_nuttx_sched_pthread09(FAR void **state) pthread_t pthread_id[10]; int run_flag = 0; - res = sem_init(&sched_task09_sem, 0, 1); + res = sem_init(&schedtask09_sem, 0, 1); assert_int_equal(res, OK); int i; for (i = 0; i < 10; i++) { - res = pthread_create(&pthread_id[i], NULL, - (void *)sched_pthread09_threadroutine, &run_flag); + res = + pthread_create(&pthread_id[i], NULL, + (void *)schedpthread09threadroutine, &run_flag); assert_int_equal(res, OK); } @@ -98,7 +98,7 @@ void test_nuttx_sched_pthread09(FAR void **state) for (j = 0; j < 10; j++) pthread_join(pthread_id[j], NULL); - res = sem_destroy(&sched_task09_sem); + res = sem_destroy(&schedtask09_sem); assert_int_equal(res, OK); assert_int_equal(run_flag, 100); diff --git a/testing/testsuites/kernel/sched/cases/api_task_test_001.c b/testing/testsuites/kernel/sched/cases/api_task_test_001.c index a5b2ebf408d..d2ebc9d1250 100644 --- a/testing/testsuites/kernel/sched/cases/api_task_test_001.c +++ b/testing/testsuites/kernel/sched/cases/api_task_test_001.c @@ -3,25 +3,24 @@ * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -47,10 +46,10 @@ ****************************************************************************/ /**************************************************************************** - * Name: sched_task01_routine + * Name: schedtask01routine ****************************************************************************/ -static int sched_task01_routine(int argc, char *argv[]) +static int schedtask01routine(int argc, char *argv[]) { char *str = NULL; str = (char *)malloc(sizeof(char) * 1024); @@ -73,8 +72,8 @@ void test_nuttx_sched_task01(FAR void **state) pid_t pid; int status; - pid = task_create("sched_task01_routine", TASK_PRIORITY, - DEFAULT_STACKSIZE, sched_task01_routine, NULL); + pid = task_create("schedtask01routine", TASK_PRIORITY, + DEFAULT_STACKSIZE, schedtask01routine, NULL); assert_true(pid > 0); waitpid(pid, &status, 0); } diff --git a/testing/testsuites/kernel/sched/cases/api_task_test_002.c b/testing/testsuites/kernel/sched/cases/api_task_test_002.c index 9b7a1dfa6aa..13242e962c5 100644 --- a/testing/testsuites/kernel/sched/cases/api_task_test_002.c +++ b/testing/testsuites/kernel/sched/cases/api_task_test_002.c @@ -3,25 +3,24 @@ * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -47,10 +46,10 @@ ****************************************************************************/ /**************************************************************************** - * Name: sched_task02_routine + * Name: schedtask02routine ****************************************************************************/ -static int sched_task02_routine(int argc, char *argv[]) +static int schedtask02routine(int argc, char *argv[]) { int i; for (i = 0; i < 10; i++) @@ -75,8 +74,8 @@ void test_nuttx_sched_task02(FAR void **state) int status; int res; - pid = task_create("sched_task02_routine", TASK_PRIORITY, - DEFAULT_STACKSIZE, sched_task02_routine, NULL); + pid = task_create("schedtask02routine", TASK_PRIORITY, + DEFAULT_STACKSIZE, schedtask02routine, NULL); assert_true(pid > 0); for (int i = 0; i < 2; i++) { diff --git a/testing/testsuites/kernel/sched/cases/api_task_test_003.c b/testing/testsuites/kernel/sched/cases/api_task_test_003.c index e26c289c604..b2dd239bf92 100644 --- a/testing/testsuites/kernel/sched/cases/api_task_test_003.c +++ b/testing/testsuites/kernel/sched/cases/api_task_test_003.c @@ -3,25 +3,24 @@ * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -47,10 +46,10 @@ ****************************************************************************/ /**************************************************************************** - * Name: sched_task03_routine + * Name: schedtask03routine ****************************************************************************/ -static int sched_task03_routine(int argc, char *argv[]) +static int schedtask03routine(int argc, char *argv[]) { int i; for (i = 0; i < 100; ++i) @@ -75,8 +74,8 @@ void test_nuttx_sched_task03(FAR void **state) { pid_t pid; int res; - pid = task_create("sched_task03_routine", TASK_PRIORITY, - DEFAULT_STACKSIZE, sched_task03_routine, NULL); + pid = task_create("schedtask03routine", TASK_PRIORITY, + DEFAULT_STACKSIZE, schedtask03routine, NULL); assert_true(pid > 0); int i; diff --git a/testing/testsuites/kernel/sched/cases/api_task_test_004.c b/testing/testsuites/kernel/sched/cases/api_task_test_004.c index 05dea32fdb7..915c31477d5 100644 --- a/testing/testsuites/kernel/sched/cases/api_task_test_004.c +++ b/testing/testsuites/kernel/sched/cases/api_task_test_004.c @@ -3,25 +3,24 @@ * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -47,10 +46,10 @@ ****************************************************************************/ /**************************************************************************** - * Name: sched_task04_routine + * Name: schedtask04routine ****************************************************************************/ -static int sched_task04_routine(int argc, char *argv[]) +static int schedtask04routine(int argc, char *argv[]) { for (int i = 0; i < 5; i++) { @@ -75,13 +74,12 @@ void test_nuttx_sched_task04(FAR void **state) pid_t pid; int status; int ret; - struct sched_param task_entry_param; /* create a test task */ - pid = task_create("sched_task04_routine", TASK_PRIORITY, - DEFAULT_STACKSIZE, sched_task04_routine, NULL); + pid = task_create("schedtask04routine", TASK_PRIORITY, + DEFAULT_STACKSIZE, schedtask04routine, NULL); assert_true(pid > 0); ret = sched_getparam(pid, &task_entry_param); assert_int_equal(ret, 0); diff --git a/testing/testsuites/kernel/sched/cases/api_task_test_005.c b/testing/testsuites/kernel/sched/cases/api_task_test_005.c index 7e6d2fa960e..2d46a75ade0 100644 --- a/testing/testsuites/kernel/sched/cases/api_task_test_005.c +++ b/testing/testsuites/kernel/sched/cases/api_task_test_005.c @@ -3,25 +3,24 @@ * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -47,10 +46,10 @@ ****************************************************************************/ /**************************************************************************** - * Name: sched_task05_routine + * Name: schedtask05routine ****************************************************************************/ -static int sched_task05_routine(int argc, char *argv[]) +static int schedtask05routine(int argc, char *argv[]) { int ret; int i; @@ -79,8 +78,8 @@ void test_nuttx_sched_task05(FAR void **state) pid_t pid; int status; - pid = task_create("sched_task05_routine", TASK_PRIORITY, - DEFAULT_STACKSIZE, sched_task05_routine, NULL); + pid = task_create("schedtask05routine", TASK_PRIORITY, + DEFAULT_STACKSIZE, schedtask05routine, NULL); assert_true(pid > 0); waitpid(pid, &status, 0); } diff --git a/testing/testsuites/kernel/sched/cases/api_task_test_006.c b/testing/testsuites/kernel/sched/cases/api_task_test_006.c index 04e5ac995e4..c0031409c56 100644 --- a/testing/testsuites/kernel/sched/cases/api_task_test_006.c +++ b/testing/testsuites/kernel/sched/cases/api_task_test_006.c @@ -3,25 +3,24 @@ * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -48,10 +47,10 @@ ****************************************************************************/ /**************************************************************************** - * Name: sched_task06_routine + * Name: schedtask06routine ****************************************************************************/ -static int sched_task06_routine(int argc, char *argv[]) +static int schedtask06routine(int argc, char *argv[]) { return 0; } @@ -73,8 +72,8 @@ void test_nuttx_sched_task06(FAR void **state) /* struct sched_param task_entry_param */ - pid = task_create("sched_task06_routine", TASK_PRIORITY, - DEFAULT_STACKSIZE, sched_task06_routine, NULL); + pid = task_create("schedtask06routine", TASK_PRIORITY, + DEFAULT_STACKSIZE, schedtask06routine, NULL); assert_true(pid > 0); priority_max = sched_get_priority_max(SCHED_FIFO); priority_min = sched_get_priority_min(SCHED_FIFO); diff --git a/testing/testsuites/kernel/sched/cases/api_task_test_007.c b/testing/testsuites/kernel/sched/cases/api_task_test_007.c index 7c29dcbb208..de279236b12 100644 --- a/testing/testsuites/kernel/sched/cases/api_task_test_007.c +++ b/testing/testsuites/kernel/sched/cases/api_task_test_007.c @@ -3,25 +3,24 @@ * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -48,10 +47,10 @@ ****************************************************************************/ /**************************************************************************** - * Name: sched_task07_routine + * Name: schedtask07routine ****************************************************************************/ -static int sched_task07_routine(int argc, char *argv[]) +static int schedtask07routine(int argc, char *argv[]) { /* lock */ @@ -89,8 +88,8 @@ void test_nuttx_sched_task07(FAR void **state) pid_t pid; int status; - pid = task_create("sched_task07_routine", TASK_PRIORITY, - DEFAULT_STACKSIZE, sched_task07_routine, NULL); + pid = task_create("schedtask07routine", TASK_PRIORITY, + DEFAULT_STACKSIZE, schedtask07routine, NULL); assert_true(pid > 0); waitpid(pid, &status, 0); diff --git a/testing/testsuites/kernel/sched/cmocka_sched_test.c b/testing/testsuites/kernel/sched/cmocka_sched_test.c index c962a5e790a..c71569a47bb 100644 --- a/testing/testsuites/kernel/sched/cmocka_sched_test.c +++ b/testing/testsuites/kernel/sched/cmocka_sched_test.c @@ -1,24 +1,26 @@ /**************************************************************************** * apps/testing/testsuites/kernel/sched/cmocka_sched_test.c - * Copyright (C) 2020 Xiaomi Corporation * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -40,7 +42,8 @@ int main(int argc, char *argv[]) { /* Add Test Cases */ - const struct CMUnitTest nuttx_sched_testsuites[] = { + const struct CMUnitTest nuttx_sched_test_suites[] = + { cmocka_unit_test(test_nuttx_sched_pthread01), cmocka_unit_test(test_nuttx_sched_pthread02), cmocka_unit_test(test_nuttx_sched_pthread03), @@ -61,8 +64,8 @@ int main(int argc, char *argv[]) /* Run Test cases */ - cmocka_run_group_tests(nuttx_sched_testsuites, - test_nuttx_schedtest_group_setup, - test_nuttx_schedtest_group_teardown); + cmocka_run_group_tests(nuttx_sched_test_suites, + test_nuttx_sched_test_group_setup, + test_nuttx_sched_test_group_teardown); return 0; } diff --git a/testing/testsuites/kernel/sched/common/test_sched_common.c b/testing/testsuites/kernel/sched/common/test_sched_common.c index f83c4416b74..4495a2a2a76 100644 --- a/testing/testsuites/kernel/sched/common/test_sched_common.c +++ b/testing/testsuites/kernel/sched/common/test_sched_common.c @@ -3,25 +3,24 @@ * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -37,10 +36,10 @@ ****************************************************************************/ /**************************************************************************** - * Name: test_nuttx_schedtest_group_setup + * Name: test_nuttx_sched_test_group_setup ****************************************************************************/ -int test_nuttx_schedtest_group_setup(void **state) +int test_nuttx_sched_test_group_setup(void **state) { /* syslog(LOG_INFO, "This is goup setup !\n"); */ @@ -48,10 +47,10 @@ int test_nuttx_schedtest_group_setup(void **state) } /**************************************************************************** - * Name: test_nuttx_schedtest_group_teardown + * Name: test_nuttx_sched_test_group_teardown ****************************************************************************/ -int test_nuttx_schedtest_group_teardown(void **state) +int test_nuttx_sched_test_group_teardown(void **state) { /* syslog(LOG_INFO, "This is goup tearDown !\n"); */ diff --git a/testing/testsuites/kernel/sched/include/SchedTest.h b/testing/testsuites/kernel/sched/include/SchedTest.h index 19312d68803..a1070fdabbc 100644 --- a/testing/testsuites/kernel/sched/include/SchedTest.h +++ b/testing/testsuites/kernel/sched/include/SchedTest.h @@ -1,19 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/sched/include/SchedTest.h - * Copyright (C) 2020 Xiaomi Corporation * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ #ifndef __SCHEDTEST_H #define __SCHEDTEST_H @@ -21,15 +24,12 @@ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include - /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ - #define PTHREAD_STACK_SIZE CONFIG_DEFAULT_TASK_STACKSIZE #define DEFAULT_STACKSIZE CONFIG_DEFAULT_TASK_STACKSIZE #define TASK_PRIORITY SCHED_PRIORITY_DEFAULT @@ -38,74 +38,91 @@ * Public Function Prototypes ****************************************************************************/ -/* common/common_test.c *****************************************************/ +/* common/common_test.c + * *****************************************************/ -int test_nuttx_schedtest_group_setup(void **state); -int test_nuttx_schedtest_group_teardown(void **state); +int test_nuttx_sched_test_group_setup(void **state); +int test_nuttx_sched_test_group_teardown(void **state); /* testcase function */ -/* cases/api_pthread_test_001.c *********************************************/ +/* cases/api_pthread_test_001.c + * *********************************************/ void test_nuttx_sched_pthread01(FAR void **state); -/* cases/api_pthread_test_002.c *********************************************/ +/* cases/api_pthread_test_002.c + * *********************************************/ void test_nuttx_sched_pthread02(FAR void **state); -/* cases/api_pthread_test_003.c *********************************************/ +/* cases/api_pthread_test_003.c + * *********************************************/ void test_nuttx_sched_pthread03(FAR void **state); -/* cases/api_pthread_test_004.c *********************************************/ +/* cases/api_pthread_test_004.c + * *********************************************/ void test_nuttx_sched_pthread04(FAR void **state); -/* cases/api_pthread_test_005.c *********************************************/ +/* cases/api_pthread_test_005.c + * *********************************************/ void test_nuttx_sched_pthread05(FAR void **state); -/* cases/api_pthread_test_006.c *********************************************/ +/* cases/api_pthread_test_006.c + * *********************************************/ void test_nuttx_sched_pthread06(FAR void **state); -/* cases/api_pthread_test_007.c *********************************************/ +/* cases/api_pthread_test_007.c + * *********************************************/ void test_nuttx_sched_pthread07(FAR void **state); -/* cases/api_pthread_test_008.c *********************************************/ +/* cases/api_pthread_test_008.c + * *********************************************/ void test_nuttx_sched_pthread08(FAR void **state); -/* cases/api_pthread_test_009.c *********************************************/ +/* cases/api_pthread_test_009.c + * *********************************************/ void test_nuttx_sched_pthread09(FAR void **state); -/* cases/api_task_test_001.c ************************************************/ +/* cases/api_task_test_001.c + * ************************************************/ void test_nuttx_sched_task01(FAR void **state); -/* cases/api_task_test_002.c ************************************************/ +/* cases/api_task_test_002.c + * ************************************************/ void test_nuttx_sched_task02(FAR void **state); -/* cases/api_task_test_003.c ************************************************/ +/* cases/api_task_test_003.c + * ************************************************/ void test_nuttx_sched_task03(FAR void **state); -/* cases/api_task_test_004.c ************************************************/ +/* cases/api_task_test_004.c + * ************************************************/ void test_nuttx_sched_task04(FAR void **state); -/* cases/api_task_test_005.c ************************************************/ +/* cases/api_task_test_005.c + * ************************************************/ void test_nuttx_sched_task05(FAR void **state); -/* cases/api_task_test_006.c ************************************************/ +/* cases/api_task_test_006.c + * ************************************************/ void test_nuttx_sched_task06(FAR void **state); -/* cases/api_task_test_007.c ************************************************/ +/* cases/api_task_test_007.c + * ************************************************/ void test_nuttx_sched_task07(FAR void **state); diff --git a/testing/testsuites/kernel/socket/cases/net_socket_test_005.c b/testing/testsuites/kernel/socket/cases/net_socket_test_005.c new file mode 100644 index 00000000000..7b9853d05c2 --- /dev/null +++ b/testing/testsuites/kernel/socket/cases/net_socket_test_005.c @@ -0,0 +1,81 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/socket/cases/net_socket_test_005.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include + +#include "SocketTest.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_net_socket_test05 + ****************************************************************************/ + +void test_nuttx_net_socket_test05(FAR void **state) +{ +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ + uint32_t hl = ntohl(0x12345678); + syslog(LOG_INFO, "hl %#" PRIx32, hl); + assert_int_equal(hl, 0x78563412); + + uint32_t nl = htonl(0x12345678); + syslog(LOG_INFO, "nl %#" PRIx32, nl); + assert_int_equal(nl, 0x78563412); + + uint16_t hs = ntohs(0x1234); + syslog(LOG_INFO, "hs %#" PRIx16, hs); + assert_int_equal(hs, 0x3412); + + uint16_t ns = htons(0x1234); + syslog(LOG_INFO, "ns %#" PRIx16, ns); + assert_int_equal(ns, 0x3412); +#else + uint32_t hl = ntohl(0x12345678); + syslog(LOG_INFO, "hl %#" PRIx32, hl); + assert_int_equal(hl, 0x12345678); + + uint32_t nl = htonl(0x12345678); + syslog(LOG_INFO, "nl %#" PRIx32, nl); + assert_int_equal(nl, 0x12345678); + + uint16_t hs = ntohs(0x1234); + syslog(LOG_INFO, "hs %#" PRIx16, hs); + assert_int_equal(hs, 0x1234); + + uint16_t ns = htons(0x1234); + syslog(LOG_INFO, "ns %#" PRIx16, ns); + assert_int_equal(ns, 0x1234); +#endif +} diff --git a/testing/testsuites/kernel/socket/cases/net_socket_test_006.c b/testing/testsuites/kernel/socket/cases/net_socket_test_006.c new file mode 100644 index 00000000000..c959e75cd2e --- /dev/null +++ b/testing/testsuites/kernel/socket/cases/net_socket_test_006.c @@ -0,0 +1,110 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/socket/cases/net_socket_test_006.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include + +#include "SocketTest.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_net_socket_test06 + ****************************************************************************/ + +void test_nuttx_net_socket_test06(FAR void **state) +{ + struct in_addr in; + int ret = inet_pton(AF_INET, "300.10.10.10", &in); + syslog(LOG_INFO, "ret: %d", ret); + assert_int_equal(ret, 0); + + ret = inet_pton(AF_INET, "10.11.12.13", &in); + syslog(LOG_INFO, "ret: %d", ret); + assert_int_equal(ret, 1); +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ + syslog(LOG_INFO, "in.s_addr: %#" PRIx32, in.s_addr); + assert_int_equal(in.s_addr, 0x0d0c0b0a); +#else + syslog(LOG_INFO, "in.s_addr: %#" PRIx32, in.s_addr); + assert_int_equal(in.s_addr, 0x0a0b0c0d); +#endif + /* Currently nuttx does not support the following interfaces inet_lnaof, + * inet_netof, inet_makeaddr + */ + + /* host order */ + + /* in_addr_t lna = inet_lnaof(in); + * syslog(LOG_INFO, "lna: %#"PRIx32, lna); + * assert_int_equal(lna, 0x000b0c0d); + */ + + /* host order */ + + /* in_addr_t net = inet_netof(in); + * syslog(LOG_INFO, "net: %#"PRIx32, net); + * assert_int_equal(net, 0x0000000a); + + * in = inet_makeaddr(net, lna); + * #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ + * syslog(LOG_INFO, "in.s_addr: %#"PRIx32, in.s_addr); + * assert_int_equal(in.s_addr, 0x0d0c0b0a); + * #else + * syslog(LOG_INFO, "in.s_addr: %#"PRIx32, in.s_addr); + * assert_int_equal(in.s_addr, 0x0a0b0c0d); + * #endif + */ + + in_addr_t net = inet_network("300.10.10.10"); + syslog(LOG_INFO, "net: %#" PRIx32, net); + assert_int_equal((int32_t)net, -1); + + /* host order */ + + net = inet_network("10.11.12.13"); + syslog(LOG_INFO, "host order net: %#" PRIx32, net); + assert_int_equal(net, 0x0a0b0c0d); + + const char *p = inet_ntoa(in); + syslog(LOG_INFO, "inet_ntoa p: %s", p); + assert_int_equal(strcmp(p, "10.11.12.13"), 0); + + char buf[32]; + p = inet_ntop(AF_INET, &in, buf, sizeof(buf)); + syslog(LOG_INFO, "inet_ntop p: %s", p); + assert_string_equal(p, buf); + assert_int_equal(strcmp(p, "10.11.12.13"), 0); +} diff --git a/testing/testsuites/kernel/socket/cases/net_socket_test_008.c b/testing/testsuites/kernel/socket/cases/net_socket_test_008.c new file mode 100644 index 00000000000..c3268f78b68 --- /dev/null +++ b/testing/testsuites/kernel/socket/cases/net_socket_test_008.c @@ -0,0 +1,339 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/socket/cases/net_socket_test_008.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include + +#include "SocketTest.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#define SERVER_PORT 9001 // +#define INVALID_SOCKET -1 // +#define BACKLOG CLIENT_NUM + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +static int gfds[FD_SETSIZE]; +static int gbye; + +static void initfds(void) +{ + for (int i = 0; i < FD_SETSIZE; ++i) + { + gfds[i] = INVALID_SOCKET; + } +} + +static void getreadfds(fd_set *fds, int *nfd) +{ + for (int i = 0; i < FD_SETSIZE; i++) + { + if (gfds[i] == INVALID_SOCKET) + { + continue; + } + + FD_SET(gfds[i], fds); + if (*nfd < gfds[i]) + { + *nfd = gfds[i]; + } + } +} + +static int addfd(int fd) +{ + for (int i = 0; i < FD_SETSIZE; ++i) + { + if (gfds[i] == INVALID_SOCKET) + { + gfds[i] = fd; + return 0; + } + } + + return -1; +} + +static void delfd(int fd) +{ + for (int i = 0; i < FD_SETSIZE; ++i) + { + if (gfds[i] == fd) + { + gfds[i] = INVALID_SOCKET; + } + } + + (void)close(fd); +} + +static int closeallfd(void) +{ + for (int i = 0; i < FD_SETSIZE; ++i) + { + if (gfds[i] != INVALID_SOCKET) + { + (void)close(gfds[i]); + gfds[i] = INVALID_SOCKET; + } + } + + return 0; +} + +static int handlerecv(int fd) +{ + char buf[256]; + int ret = recv(fd, buf, sizeof(buf) - 1, 0); + if (ret < 0) + { + syslog(LOG_INFO, "[%d]Error: %s", fd, strerror(errno)); + delfd(fd); + } + + else if (ret == 0) + { + syslog(LOG_INFO, "[%d]Closed", fd); + delfd(fd); + } + + else + { + buf[ret] = 0; + syslog(LOG_INFO, "[%d]Received: %s", fd, buf); + if (strstr(buf, "Bye") != NULL) + { + delfd(fd); + gbye++; + } + } + + return -(ret < 0); +} + +static int handleaccept(int lsfd) +{ + struct sockaddr_in sa; + socklen_t salen = sizeof(sa); + int fd = accept(lsfd, (struct sockaddr *)&sa, &salen); + if (fd == INVALID_SOCKET) + { + perror("accept"); + return -1; + } + + if (addfd(fd) == -1) + { + syslog(LOG_INFO, "Too many clients, refuse %s:%d", + inet_ntoa(sa.sin_addr), ntohs(sa.sin_port)); + close(fd); + return -1; + } + + syslog(LOG_INFO, "New client %d: %s:%d", fd, inet_ntoa(sa.sin_addr), + ntohs(sa.sin_port)); + return 0; +} + +static int handlereadfds(fd_set *fds, int lsfd) +{ + int ret = 0; + for (int i = 0; i < FD_SETSIZE; ++i) + { + if (gfds[i] == INVALID_SOCKET || !FD_ISSET(gfds[i], fds)) + { + continue; + } + + if (gfds[i] == lsfd) + { + ret += handleaccept(lsfd); + } + + else + { + ret += handlerecv(gfds[i]); + } + } + + return ret; +} + +static void *clientsthread(void *param) +{ + int fd; + int thrno = (int)(intptr_t)param; + + syslog(LOG_INFO, "<%d>socket client thread started", thrno); + fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); + if (fd == INVALID_SOCKET) + { + perror("socket"); + return NULL; + } + + struct sockaddr_in sa; + sa.sin_family = AF_INET; + sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + sa.sin_port = htons(SERVER_PORT); + if (connect(fd, (struct sockaddr *)(&sa), sizeof(sa)) == -1) + { + perror("connect"); + return NULL; + } + + syslog(LOG_INFO, "[%d]<%d>connected to %s:%d successful", fd, thrno, + inet_ntoa(sa.sin_addr), SERVER_PORT); + + const char *msg[] = + { + "hello, ", "ohos, ", + "my name is net_socket_test_008, ", + "see u next time, ", "Bye!" + }; + + for (int i = 0; i < sizeof(msg) / sizeof(msg[0]); ++i) + { + if (send(fd, msg[i], strlen(msg[i]), 0) < 0) + { + syslog(LOG_INFO, "[%d]<%d>send msg [%s] fail", fd, thrno, + msg[i]); + } + } + + (void)shutdown(fd, SHUT_RDWR); + (void)close(fd); + return param; +} + +static int startclients(pthread_t *cli, int clinum) +{ + int ret; + pthread_attr_t attr; + + for (int i = 0; i < clinum; ++i) + { + ret = pthread_attr_init(&attr); + assert_int_equal(ret, 0); + + ret = pthread_create(&cli[i], &attr, clientsthread, + (void *)(intptr_t)i); + assert_int_equal(ret, 0); + + ret = pthread_attr_destroy(&attr); + assert_int_equal(ret, 0); + } + + return 0; +} + +/**************************************************************************** + * Name: test_nuttx_net_socket_test08 + ****************************************************************************/ + +void test_nuttx_net_socket_test08(FAR void **state) +{ + struct sockaddr_in sa = + { + 0 + }; + + int lsfd; + int ret; + + lsfd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); + assert_int_not_equal(lsfd, -1); + + sa.sin_family = AF_INET; + sa.sin_addr.s_addr = htonl(INADDR_ANY); + sa.sin_port = htons(SERVER_PORT); + ret = bind(lsfd, (struct sockaddr *)(&sa), sizeof(sa)); + assert_int_not_equal(ret, -1); + + ret = listen(lsfd, BACKLOG); + assert_int_not_equal(ret, -1); + + initfds(); + addfd(lsfd); + syslog(LOG_INFO, "[%d]Waiting for client to connect on port %d", lsfd, + SERVER_PORT); + + pthread_t clients[CLIENT_NUM]; + + ret = startclients(clients, CLIENT_NUM); + assert_int_equal(ret, 0); + + for (; ; ) + { + int nfd; + fd_set readfds; + struct timeval timeout; + + timeout.tv_sec = 3; + timeout.tv_usec = 0; + + nfd = 0; + FD_ZERO(&readfds); + + getreadfds(&readfds, &nfd); + + ret = select(nfd + 1, &readfds, NULL, NULL, &timeout); + syslog(LOG_INFO, "select %d", ret); + if (ret == -1) + { + perror("select"); + break; /* error occurred */ + } + + else if (ret == 0) + { + break; /* timed out */ + } + + if (handlereadfds(&readfds, lsfd) < 0) + { + break; + } + } + + for (int i = 0; i < CLIENT_NUM; ++i) + { + ret = pthread_join(clients[i], NULL); + assert_int_equal(ret, 0); + } + + assert_int_equal(gbye, CLIENT_NUM); + (void)closeallfd(); +} diff --git a/testing/testsuites/kernel/socket/cases/net_socket_test_009.c b/testing/testsuites/kernel/socket/cases/net_socket_test_009.c new file mode 100644 index 00000000000..56ad3ced6a1 --- /dev/null +++ b/testing/testsuites/kernel/socket/cases/net_socket_test_009.c @@ -0,0 +1,337 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/socket/cases/net_socket_test_009.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "SocketTest.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#define SERVER_PORT 8888 +#define INVALID_SOCKET -1 +#define BACKLOG CLIENT_NUM + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +static int gfds[FD_SETSIZE]; +static int gbye; + +static void initfds(void) +{ + for (int i = 0; i < FD_SETSIZE; ++i) + { + gfds[i] = INVALID_SOCKET; + } +} + +static void getreadfds(struct pollfd *fds, int *nfd) +{ + for (int i = 0; i < FD_SETSIZE; i++) + { + if (gfds[i] == INVALID_SOCKET) + { + continue; + } + + fds[*nfd].fd = gfds[i]; + fds[*nfd].events = POLLIN; + (*nfd)++; + } +} + +static int addfd(int fd) +{ + for (int i = 0; i < FD_SETSIZE; ++i) + { + if (gfds[i] == INVALID_SOCKET) + { + gfds[i] = fd; + return 0; + } + } + + return -1; +} + +static void delfd(int fd) +{ + for (int i = 0; i < FD_SETSIZE; ++i) + { + if (gfds[i] == fd) + { + gfds[i] = INVALID_SOCKET; + } + } + + (void)close(fd); +} + +static int closeallfd(void) +{ + for (int i = 0; i < FD_SETSIZE; ++i) + { + if (gfds[i] != INVALID_SOCKET) + { + (void)close(gfds[i]); + gfds[i] = INVALID_SOCKET; + } + } + + return 0; +} + +static int handlerecv(int fd) +{ + char buf[256]; + int ret = recv(fd, buf, sizeof(buf) - 1, 0); + if (ret < 0) + { + syslog(LOG_INFO, "[%d]Error: %s", fd, strerror(errno)); + delfd(fd); + } + + else if (ret == 0) + { + syslog(LOG_INFO, "[%d]Closed", fd); + delfd(fd); + } + + else + { + buf[ret] = 0; + syslog(LOG_INFO, "[%d]Received: %s", fd, buf); + if (strstr(buf, "Bye") != NULL) + { + delfd(fd); + gbye++; + } + } + + return -(ret < 0); +} + +static int handleaccept(int lsfd) +{ + struct sockaddr_in sa; + int salen = sizeof(sa); + int fd = accept(lsfd, (struct sockaddr *)&sa, (socklen_t *)&salen); + if (fd == INVALID_SOCKET) + { + perror("accept"); + return -1; + } + + if (addfd(fd) == -1) + { + syslog(LOG_INFO, "Too many clients, refuse %s:%d", + inet_ntoa(sa.sin_addr), ntohs(sa.sin_port)); + close(fd); + return -1; + } + + syslog(LOG_INFO, "New client %d: %s:%d", fd, inet_ntoa(sa.sin_addr), + ntohs(sa.sin_port)); + return 0; +} + +static int handlereadfds(struct pollfd *fds, int nfds, int lsfd) +{ + int ret = 0; + for (int i = 0; i < nfds; ++i) + { + if (fds[i].revents == 0) + { + continue; + } + + syslog(LOG_INFO, "[%d]revents: %04" PRIx32, fds[i].fd, + fds[i].revents); + if (fds[i].fd == lsfd) + { + ret += handleaccept(lsfd); + } + + else + { + ret += handlerecv(fds[i].fd); + } + } + + return ret; +} + +static void *clientsthread(void *param) +{ + int fd; + int thrno = (int)(intptr_t)param; + + syslog(LOG_INFO, "<%d>socket client thread started", thrno); + fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); + if (fd == INVALID_SOCKET) + { + perror("socket"); + return NULL; + } + + struct sockaddr_in sa; + sa.sin_family = AF_INET; + sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + sa.sin_port = htons(SERVER_PORT); + if (connect(fd, (struct sockaddr *)&sa, sizeof(sa)) == -1) + { + perror("connect"); + return NULL; + } + + syslog(LOG_INFO, "[%d]<%d>connected to %s:%d successful", fd, thrno, + inet_ntoa(sa.sin_addr), SERVER_PORT); + + const char *msg[] = + { + "hello, ", "ohos, ", + "my name is net_socket_test_009, ", + "see u next time, ", "Bye!" + }; + + for (int i = 0; i < sizeof(msg) / sizeof(msg[0]); ++i) + { + if (send(fd, msg[i], strlen(msg[i]), 0) < 0) + { + syslog(LOG_INFO, "[%d]<%d>send msg [%s] fail", fd, thrno, + msg[i]); + } + } + + (void)shutdown(fd, SHUT_RDWR); + (void)close(fd); + return param; +} + +static int startclients(pthread_t *cli, int clinum) +{ + int ret; + pthread_attr_t attr; + + for (int i = 0; i < clinum; ++i) + { + ret = pthread_attr_init(&attr); + assert_int_equal(ret, 0); + + ret = pthread_create(&cli[i], &attr, clientsthread, + (void *)(intptr_t)i); + assert_int_equal(ret, 0); + + ret = pthread_attr_destroy(&attr); + assert_int_equal(ret, 0); + } + + return 0; +} + +/**************************************************************************** + * Name: test_nuttx_net_socket_test09 + ****************************************************************************/ + +void test_nuttx_net_socket_test09(FAR void **state) +{ + struct sockaddr_in sa = + { + 0 + }; + + int lsfd; + int ret; + + lsfd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); + assert_int_not_equal(lsfd, -1); + + sa.sin_family = AF_INET; + sa.sin_addr.s_addr = htonl(INADDR_ANY); + sa.sin_port = htons(SERVER_PORT); + ret = bind(lsfd, (struct sockaddr *)&sa, sizeof(sa)); + assert_int_not_equal(ret, -1); + + ret = listen(lsfd, BACKLOG); + assert_int_not_equal(ret, -1); + + initfds(); + addfd(lsfd); + syslog(LOG_INFO, "[%d]Waiting for client to connect on port %d", lsfd, + SERVER_PORT); + + pthread_t clients[CLIENT_NUM]; + + ret = startclients(clients, CLIENT_NUM); + assert_int_equal(ret, 0); + + for (; ; ) + { + int nfd; + struct pollfd readfds[FD_SETSIZE]; + int timeoutms; + + timeoutms = 3000; + nfd = 0; + getreadfds(readfds, &nfd); + + ret = poll(readfds, nfd, timeoutms); + syslog(LOG_INFO, "poll %d", ret); + if (ret == -1) + { + perror("poll"); + break; /* error occurred */ + } + + else if (ret == 0) + { + break; /* timed out */ + } + + if (handlereadfds(readfds, nfd, lsfd) < 0) + { + break; + } + } + + for (int i = 0; i < CLIENT_NUM; ++i) + { + ret = pthread_join(clients[i], NULL); + assert_int_equal(ret, 0); + } + + assert_int_equal(gbye, CLIENT_NUM); + (void)closeallfd(); +} diff --git a/testing/testsuites/kernel/socket/cases/net_socket_test_010.c b/testing/testsuites/kernel/socket/cases/net_socket_test_010.c new file mode 100644 index 00000000000..d344709ea90 --- /dev/null +++ b/testing/testsuites/kernel/socket/cases/net_socket_test_010.c @@ -0,0 +1,259 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/socket/cases/net_socket_test_010.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "SocketTest.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#define IFF_PROMISC 0x100 + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +static char gdefaultnetif[IFNAMSIZ] = "eth0"; + +static void initifreq(struct ifreq *ifr) +{ + *ifr = (struct ifreq) + { + { + 0 + } + }; + + /* (void)strncpy_s(ifr->ifr_name, sizeof(ifr->ifr_name) - 1, */ + + /* gdefaultnetif, sizeof(ifr->ifr_name) - 1); */ + + (void)strlcpy(ifr->ifr_name, gdefaultnetif, sizeof(ifr->ifr_name)); + ifr->ifr_name[sizeof(ifr->ifr_name) - 1] = '\0'; +} + +static char *ifindex2name(int fd, unsigned index, char *name) +{ +#ifdef CONFIG_NETDEV_IFINDEX + return if_indextoname(index, name); +#else + struct ifreq ifr; + int ret; + + ifr.ifr_ifindex = index; + ret = ioctl(fd, siocgifname, &ifr); + if (ret < 0) + { + return NULL; + } + + /* ret = strncpy_s(name, IF_NAMESIZE - 1, ifr.ifr_name, IF_NAMESIZE - + * 1); + */ + + strncpy(name, ifr.ifr_name, IF_NAMESIZE - 1); + name[IF_NAMESIZE - 1] = '\0'; + return name; +#endif +} + +static unsigned ifname2index(int fd, const char *name) +{ +#ifdef CONFIG_NETDEV_IFINDEX + return if_nametoindex(name); +#else + struct ifreq ifr; + int ret; + + /* (void)strncpy_s(ifr.ifr_name, sizeof(ifr.ifr_name) - 1, name, + * sizeof(ifr.ifr_name) - 1); + */ + + (void)strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name) - 1); + ifr.ifr_name[sizeof(ifr.ifr_name) - 1] = '\0'; + ret = ioctl(fd, SIOCGIFINDEX, &ifr); + return ret < 0 ? 0 : ifr.ifr_ifindex; +#endif +} + +/**************************************************************************** + * Name: test_nuttx_net_socket_test10 + ****************************************************************************/ + +static int ioctltestinternal(int sfd) +{ + struct ifreq ifr = + { + { + 0 + } + }; + + char ifname[IFNAMSIZ] = + { + 0 + }; + + char *p = NULL; + unsigned int loindex = 0; + unsigned int lanindex = 0; + char lanname[IFNAMSIZ]; + int maxindex = 256; + int ret; + char *ret_s = NULL; + + for (int i = 0; i < maxindex; ++i) + { + p = ifindex2name(sfd, i, ifname); + if (p) + { + if (strcmp(p, "lo") == 0) + { + loindex = i; + } + + else + { + lanindex = i; + strcpy(lanname, p); + syslog(LOG_INFO, "name of lan: %s", lanname); + } + } + } + + syslog(LOG_INFO, "ifindex of lo: %u, ifindex of lan: %u", loindex, + lanindex); + assert_int_not_equal(loindex, 0); + assert_int_not_equal(lanindex, 0); + + p = ifindex2name(sfd, loindex, ifname); + syslog(LOG_INFO, "ifindex %u: %s", loindex, p); + assert_non_null(p); + assert_string_equal(p, "lo"); + + p = ifindex2name(sfd, lanindex, ifname); + syslog(LOG_INFO, "ifindex %u: %s", lanindex, p); + assert_non_null(p); + assert_string_equal(p, lanname); + + /* ret = strncpy_s(gdefaultnetif, sizeof(gdefaultnetif) -1, p, + * sizeof(gdefaultnetif) - 1); + */ + + ret_s = strncpy(gdefaultnetif, p, sizeof(gdefaultnetif) - 1); + assert_non_null(ret_s); + gdefaultnetif[sizeof(gdefaultnetif) - 1] = '\0'; + + ret = (int)ifname2index(sfd, p); + syslog(LOG_INFO, "index of %s: %d", p, ret); + assert_int_not_equal(ret, 0); + assert_int_equal(ret, lanindex); + + ifr.ifr_ifindex = lanindex; + ret = ioctl(sfd, siocgifname, &ifr); + assert_int_equal(ret, 0); + syslog(LOG_INFO, "name of ifindex %u: %s", lanindex, ifr.ifr_name); + assert_string_equal(ifr.ifr_name, lanname); + + initifreq(&ifr); + ret = ioctl(sfd, SIOCGIFINDEX, &ifr); + assert_int_equal(ret, 0); + syslog(LOG_INFO, "index of ifname %s: %d", ifr.ifr_name, + ifr.ifr_ifindex); + assert_int_equal(ifr.ifr_ifindex, lanindex); + + initifreq(&ifr); + ret = ioctl(sfd, SIOCGIFHWADDR, &ifr); + assert_int_equal(ret, 0); + syslog(LOG_INFO, "hwaddr: %02hhX:%02hhX:%02hhX:XX:XX:XX", + ifr.ifr_hwaddr.sa_data[0], ifr.ifr_hwaddr.sa_data[1], + ifr.ifr_hwaddr.sa_data[2]); + + initifreq(&ifr); + ret = ioctl(sfd, SIOCGIFFLAGS, &ifr); + assert_int_equal(ret, 0); + syslog(LOG_INFO, "FLAGS of ifname %s: %#" PRIx32 ", IFF_PROMISC: %d", + ifr.ifr_name, ifr.ifr_flags, !!(ifr.ifr_flags & IFF_PROMISC)); + + if (ifr.ifr_flags & IFF_PROMISC) + { + ifr.ifr_flags &= ~(IFF_PROMISC); + } + + else + { + ifr.ifr_flags |= IFF_PROMISC; + } + + syslog(LOG_INFO, "SIOCSIFFLAGS FLAGS: %#" PRIx32, ifr.ifr_flags); + ret = ioctl(sfd, SIOCSIFFLAGS, &ifr); + if (ret == -1) + { + assert_int_equal(errno, EPERM); + } + + else + { + assert_int_equal(ret, 0); + } + + initifreq(&ifr); + ret = ioctl(sfd, SIOCGIFFLAGS, &ifr); + assert_int_equal(ret, 0); + syslog(LOG_INFO, "FLAGS of ifname %s: %#" PRIx32 ", IFF_PROMISC: %d", + ifr.ifr_name, ifr.ifr_flags, !!(ifr.ifr_flags & IFF_PROMISC)); + + ret = fcntl(sfd, F_GETFL, 0); + assert_int_equal(ret < 0, 0); + + ret = fcntl(sfd, F_SETFL, ret | O_NONBLOCK); + assert_int_equal(ret < 0, 0); + + return 0; +} + +void test_nuttx_net_socket_test10(FAR void **state) +{ + int sfd; + + sfd = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP); + syslog(LOG_INFO, "socket(PF_INET, SOCK_STREAM, IPPROTO_TCP): %d", sfd); + assert_int_not_equal(sfd, -1); + + (void)ioctltestinternal(sfd); + + (void)close(sfd); +} diff --git a/testing/testsuites/kernel/socket/cases/net_socket_test_011.c b/testing/testsuites/kernel/socket/cases/net_socket_test_011.c new file mode 100644 index 00000000000..f10c04aaa66 --- /dev/null +++ b/testing/testsuites/kernel/socket/cases/net_socket_test_011.c @@ -0,0 +1,319 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/socket/cases/net_socket_test_011.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include + +#include "SocketTest.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#define SERVER_PORT 7777 +#define INVALID_SOCKET -1 + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +static int gfds[FD_SETSIZE]; +static int gbye; + +static void initfds(void) +{ + for (int i = 0; i < FD_SETSIZE; ++i) + { + gfds[i] = INVALID_SOCKET; + } +} + +static void getreadfds(fd_set *fds, int *nfd) +{ + for (int i = 0; i < FD_SETSIZE; i++) + { + if (gfds[i] == INVALID_SOCKET) + { + continue; + } + + FD_SET(gfds[i], fds); + if (*nfd < gfds[i]) + { + *nfd = gfds[i]; + } + } +} + +static int addfd(int fd) +{ + for (int i = 0; i < FD_SETSIZE; ++i) + { + if (gfds[i] == INVALID_SOCKET) + { + gfds[i] = fd; + return 0; + } + } + + return -1; +} + +static void delfd(int fd) +{ + for (int i = 0; i < FD_SETSIZE; ++i) + { + if (gfds[i] == fd) + { + gfds[i] = INVALID_SOCKET; + } + } + + (void)close(fd); +} + +static int closeallfd(void) +{ + for (int i = 0; i < FD_SETSIZE; ++i) + { + if (gfds[i] != INVALID_SOCKET) + { + (void)close(gfds[i]); + gfds[i] = INVALID_SOCKET; + } + } + + return 0; +} + +static int handlerecv(int fd) +{ + char buf[128]; + int ret = recv(fd, buf, sizeof(buf) - 1, 0); + if (ret < 0) + { + syslog(LOG_INFO, "[%d]Error: %s", fd, strerror(errno)); + delfd(fd); + } + + else if (ret == 0) + { + syslog(LOG_INFO, "[%d]Closed", fd); + delfd(fd); + } + + else + { + buf[ret] = 0; + syslog(LOG_INFO, "[%d]Received: %s", fd, buf); + if (strstr(buf, "Bye") != NULL) + { + gbye++; + } + } + + return -(ret < 0); +} + +static int handlereadfds(fd_set *fds, int lsfd) +{ + int ret = 0; + for (int i = 0; i < FD_SETSIZE; ++i) + { + if (gfds[i] == INVALID_SOCKET || !FD_ISSET(gfds[i], fds)) + { + continue; + } + + ret += handlerecv(gfds[i]); + } + + return ret; +} + +static void *clientsthread(void *param) +{ + int fd; + int thrno = (int)(intptr_t)param; + + syslog(LOG_INFO, "<%d>socket client thread started", thrno); + fd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); + if (fd == INVALID_SOCKET) + { + perror("socket"); + return NULL; + } + + struct sockaddr_in sa; + sa.sin_family = AF_INET; + sa.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + sa.sin_port = htons(SERVER_PORT); + if (connect(fd, (struct sockaddr *)(&sa), sizeof(sa)) == -1) + { + perror("connect"); + return NULL; + } + + syslog(LOG_INFO, "[%d]<%d>connected to udp://%s:%d successful", fd, + thrno, inet_ntoa(sa.sin_addr), SERVER_PORT); + + const char *msg[] = + { + "ohos, ", + "hello, ", + "my name is net_socket_test_011, ", + "see u next time, ", + "Bye!", + }; + + for (int i = 0; i < sizeof(msg) / sizeof(msg[0]); ++i) + { + if (send(fd, msg[i], strlen(msg[i]), 0) < 0) + { + syslog(LOG_INFO, "[%d]<%d>send msg [%s] fail", fd, thrno, + msg[i]); + } + } + + (void)shutdown(fd, SHUT_RDWR); + (void)close(fd); + return param; +} + +static int startclients(pthread_t *cli, int clinum) +{ + int ret; + pthread_attr_t attr = + { + 0 + }; + + struct sched_param param = + { + 0 + }; + + int policy; + ret = pthread_getschedparam(pthread_self(), &policy, ¶m); + assert_int_equal(ret, 0); + + for (int i = 0; i < clinum; ++i) + { + ret = pthread_attr_init(&attr); + param.sched_priority = param.sched_priority + 1; + pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED); + pthread_attr_setschedparam(&attr, ¶m); + + ret = pthread_create(&cli[i], &attr, clientsthread, + (void *)(intptr_t)i); + assert_int_equal(ret, 0); + ret = pthread_attr_destroy(&attr); + assert_int_equal(ret, 0); + } + + return 0; +} + +/**************************************************************************** + * Name: test_nuttx_net_socket_test11 + ****************************************************************************/ + +void test_nuttx_net_socket_test11(FAR void **state) +{ + struct sockaddr_in sa = + { + 0 + }; + + int lsfd; + int ret; + + lsfd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); + assert_int_not_equal(lsfd, -1); + + sa.sin_family = AF_INET; + sa.sin_addr.s_addr = htonl(INADDR_ANY); + sa.sin_port = htons(SERVER_PORT); + ret = bind(lsfd, (struct sockaddr *)(&sa), sizeof(sa)); + assert_int_not_equal(ret, -1); + + initfds(); + addfd(lsfd); + syslog(LOG_INFO, "[%d]Waiting for client to connect on UDP port %d", + lsfd, SERVER_PORT); + + pthread_t clients[CLIENT_NUM]; + + ret = startclients(clients, CLIENT_NUM); + assert_int_equal(ret, 0); + + for (; ; ) + { + int nfd; + fd_set readfds; + struct timeval timeout; + + timeout.tv_sec = 3; + timeout.tv_usec = 0; + + nfd = 0; + FD_ZERO(&readfds); + + getreadfds(&readfds, &nfd); + + ret = select(nfd + 1, &readfds, NULL, NULL, &timeout); + syslog(LOG_INFO, "select %d", ret); + if (ret == -1) + { + perror("select"); + break; /* error occurred */ + } + + else if (ret == 0) + { + break; /* timed out */ + } + + if (handlereadfds(&readfds, lsfd) < 0) + { + break; + } + } + + for (int i = 0; i < CLIENT_NUM; ++i) + { + ret = pthread_join(clients[i], NULL); + assert_int_equal(ret, 0); + } + +#ifdef CONFIG_NET_UDP_NOTIFIER + assert_int_equal(gbye, CLIENT_NUM); +#endif + (void)closeallfd(); +} diff --git a/testing/testsuites/kernel/socket/cmocka_socket_test.c b/testing/testsuites/kernel/socket/cmocka_socket_test.c new file mode 100644 index 00000000000..5f694031c91 --- /dev/null +++ b/testing/testsuites/kernel/socket/cmocka_socket_test.c @@ -0,0 +1,71 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/socket/cmocka_socket_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SocketTest.h" +#include + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: cmocka_sched_test_main + ****************************************************************************/ + +int main(int argc, char *argv[]) +{ + /* Add Test Cases */ + + const struct CMUnitTest nuttx_socket_test_suites[] = + { + cmocka_unit_test_setup_teardown(test_nuttx_net_socket_test05, NULL, + NULL), + cmocka_unit_test_setup_teardown(test_nuttx_net_socket_test06, NULL, + NULL), +#if defined(CONFIG_NET_LOOPBACK) || defined(CONFIG_NET_USRSOCK) + cmocka_unit_test_setup_teardown(test_nuttx_net_socket_test08, NULL, + NULL), + cmocka_unit_test_setup_teardown(test_nuttx_net_socket_test09, NULL, + NULL), + cmocka_unit_test_setup_teardown(test_nuttx_net_socket_test10, NULL, + NULL), + cmocka_unit_test_setup_teardown(test_nuttx_net_socket_test11, NULL, + NULL), +#endif + }; + + /* Run Test cases */ + + cmocka_run_group_tests(nuttx_socket_test_suites, NULL, NULL); + + return 0; +} diff --git a/testing/testsuites/kernel/socket/include/SocketTest.h b/testing/testsuites/kernel/socket/include/SocketTest.h new file mode 100644 index 00000000000..56440c3fcfa --- /dev/null +++ b/testing/testsuites/kernel/socket/include/SocketTest.h @@ -0,0 +1,80 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/socket/include/SocketTest.h + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +#ifndef __TEST_H +#define __TEST_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ +#define CLIENT_NUM 8 + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +/* test case function */ + +/* cases/net_socket_test_005.c + * ***********************************************/ + +void test_nuttx_net_socket_test05(FAR void **state); + +/* cases/net_socket_test_006.c + * ************************************************/ + +void test_nuttx_net_socket_test06(FAR void **state); + +/* cases/net_socket_test_008.c + * ************************************************/ + +void test_nuttx_net_socket_test08(FAR void **state); + +/* cases/net_socket_test_009.c + * ************************************************/ + +void test_nuttx_net_socket_test09(FAR void **state); + +/* cases/net_socket_test_010.c + * ************************************************/ + +void test_nuttx_net_socket_test10(FAR void **state); + +/* cases/net_socket_test_011.c + * ************************************************/ + +void test_nuttx_net_socket_test11(FAR void **state); + +#endif diff --git a/testing/testsuites/kernel/syscall/cases/Fstatfs_test.c b/testing/testsuites/kernel/syscall/cases/Fstatfs_test.c new file mode 100644 index 00000000000..d08113ebea4 --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/Fstatfs_test.c @@ -0,0 +1,104 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/Fstatfs_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_fstatfs01 + ****************************************************************************/ + +void test_nuttx_syscall_fstatfs01(FAR void **state) +{ + int file_fd; + int pipe_fd; + int lc; + int i; + int ret; + int p[2]; + struct statfs stats; + char fname[256] = ""; + + struct tcase + { + int *fd; + const char *msg; + } + + tcases[2] = + { + { + NULL, "fstatfs() on a file" + }, + + { + NULL, "fstatfs() on a pipe" + }, + }; + + tcases[0].fd = &file_fd; + tcases[1].fd = &pipe_fd; + + sprintf(fname, "Fstatfs01_%d", gettid()); + + file_fd = open(fname, O_RDWR | O_CREAT, 0700); + assert_true(file_fd > 0); + + assert_int_equal(pipe(p), 0); + pipe_fd = p[0]; + assert_int_equal(close(p[1]), 0); + + for (lc = 0; lc < 2; lc++) + { + for (i = 0; i < 1; i++) + { + ret = fstatfs(*(tcases[i].fd), &stats); + assert_int_equal(ret, 0); + } + } + + if (file_fd > 0) + assert_int_equal(close(file_fd), 0); + + if (pipe_fd > 0) + assert_int_equal(close(pipe_fd), 0); + + assert_int_equal(unlink(fname), 0); +} diff --git a/testing/testsuites/kernel/syscall/cases/accept_test.c b/testing/testsuites/kernel/syscall/cases/accept_test.c new file mode 100644 index 00000000000..2954a906835 --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/accept_test.c @@ -0,0 +1,154 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/accept_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_verityaccept01 + ****************************************************************************/ + +__attribute__((unused)) void test_nuttx_syscall_verityaccept01( + int testno, int domain, int type, int proto, int fd, + struct sockaddr *sockaddr, unsigned int *salen, int experrno) +{ +#ifdef CONFIG_NET_TCP + int ret; + errno = 0; + ret = accept(fd, sockaddr, salen); + close(fd); + assert_int_equal(ret, -1); + + /* syslog(LOG_INFO, "ret=%d errnor=%d\n experrno=%d", ret, + * errno,experrno); + */ + +#endif +} + +/**************************************************************************** + * Name: test_nuttx_syscall_accept01 + ****************************************************************************/ + +void test_nuttx_syscall_accept01(FAR void **state) +{ +#ifdef CONFIG_NET_TCP + struct sockaddr_in sin0; + struct sockaddr_in sin1; + struct sockaddr_in fsin1; + int invalid_socketfd = -400; + int devnull_fd; + int socket_fd; + int udp_fd; + + sin0.sin_family = AF_INET; + sin0.sin_port = 0; + sin0.sin_addr.s_addr = INADDR_ANY; + + devnull_fd = open("/dev/null", O_WRONLY); + + socket_fd = socket(PF_INET, SOCK_STREAM, 0); + assert_int_not_equal(socket_fd, -1); + bind(socket_fd, (struct sockaddr *)&sin0, sizeof(sin0)); + + sin1.sin_family = AF_INET; + sin1.sin_port = 0; + sin1.sin_addr.s_addr = INADDR_ANY; + udp_fd = socket(PF_INET, SOCK_DGRAM, 0); + assert_int_not_equal(udp_fd, -1); + bind(udp_fd, (struct sockaddr *)&sin1, sizeof(sin1)); + + struct test_case + { + int domain; + int type; + int proto; + int *fd; + struct sockaddr *sockaddr; + socklen_t salen; + int experrno; + } + + tcases[] = + { + { + PF_INET, SOCK_STREAM, 0, &invalid_socketfd, + (struct sockaddr *)&fsin1, sizeof(fsin1), EBADF + }, + + { + PF_INET, SOCK_STREAM, 0, &devnull_fd, (struct sockaddr *)&fsin1, + sizeof(fsin1), ENOTSOCK + }, + + { + PF_INET, SOCK_STREAM, 0, &socket_fd, (struct sockaddr *)3, + sizeof(fsin1), EINVAL + }, + + { + PF_INET, SOCK_STREAM, 0, &socket_fd, (struct sockaddr *)&fsin1, 1, + EINVAL + }, + + { + PF_INET, SOCK_STREAM, 0, &socket_fd, (struct sockaddr *)&fsin1, + sizeof(fsin1), EINVAL + }, + + { + PF_INET, SOCK_STREAM, 0, &udp_fd, (struct sockaddr *)&fsin1, + sizeof(fsin1), EOPNOTSUPP + }, + }; + + for (int i = 0; i < 6; i++) + { + test_nuttx_syscall_verityaccept01( + i, tcases[i].domain, tcases[i].type, tcases[i].proto, + *tcases[i].fd, tcases[i].sockaddr, &tcases[i].salen, + tcases[i].experrno); + } +#endif +} diff --git a/testing/testsuites/kernel/syscall/cases/bind_test.c b/testing/testsuites/kernel/syscall/cases/bind_test.c new file mode 100644 index 00000000000..e035bf8a1f6 --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/bind_test.c @@ -0,0 +1,137 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/bind_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_bind01 + ****************************************************************************/ + +void test_nuttx_syscall_bind01(FAR void **state) +{ + int inet_socket; + int dev_null; + + struct sockaddr_in sin1; + struct sockaddr_in sin2; + struct sockaddr_un sun; + struct test_case + { + int *socket_fd; + struct sockaddr *sockaddr; + socklen_t salen; + int retval; + int experrno; + char *desc; + } + + tcases[] = + { + { + &inet_socket, (struct sockaddr *)&sin1, 3, -1, EINVAL, + "invalid salen" + }, + + { + &dev_null, (struct sockaddr *)&sin1, sizeof(sin1), -1, ENOTSOCK, + "invalid socket" + }, + + { + &inet_socket, (struct sockaddr *)&sin2, sizeof(sin2), 0, 0, + "INADDR_ANYPORT" + }, + + { + &inet_socket, (struct sockaddr *)&sun, sizeof(sun), -1, + EAFNOSUPPORT, "UNIX-domain of current directory" + }, + }; + + /* initialize sockaddr's */ + + sin1.sin_family = AF_INET; + sin1.sin_port = 25197; + sin1.sin_addr.s_addr = INADDR_ANY; + sin2.sin_family = AF_INET; + sin2.sin_port = 0; + sin2.sin_addr.s_addr = INADDR_ANY; + + sun.sun_family = AF_UNIX; + strncpy(sun.sun_path, ".", sizeof(sun.sun_path)); + inet_socket = socket(PF_INET, SOCK_STREAM, 0); + dev_null = open("/dev/null", O_WRONLY); + + int test_ret; + int test_err; + int i; + for (i = 0; i < 4; i++) + { + inet_socket = socket(PF_INET, SOCK_STREAM, 0); + dev_null = open("/dev/null", O_WRONLY); + if (tcases[i].experrno) + { + test_ret = bind(*tcases[i].socket_fd, tcases[i].sockaddr, + tcases[i].salen); + test_err = errno; + close(inet_socket); + close(dev_null); + assert_int_not_equal(test_ret, 0); + assert_int_equal(test_ret, -1); + assert_int_equal(test_err, tcases[i].experrno); + } + + else + { + test_ret = bind(*tcases[i].socket_fd, tcases[i].sockaddr, + tcases[i].salen); + close(inet_socket); + close(dev_null); + assert_int_not_equal(test_ret, -1); + assert_int_equal(test_ret, 0); + } + } +} diff --git a/testing/testsuites/kernel/syscall/cases/chdir_test.c b/testing/testsuites/kernel/syscall/cases/chdir_test.c new file mode 100644 index 00000000000..73c8d750c36 --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/chdir_test.c @@ -0,0 +1,103 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/chdir_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_chdir01 + ****************************************************************************/ + +void test_nuttx_syscall_chdir01(FAR void **state) +{ + char testdir[64] = + { + 0 + }; + + int ret; + + sprintf(testdir, "%s_dir", __func__); + rmdir(testdir); + assert_int_equal(mkdir(testdir, S_IRWXU), 0); + + ret = chdir(testdir); + assert_int_equal(ret, 0); + rmdir(testdir); +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_chdir02 + ****************************************************************************/ + +void test_nuttx_syscall_chdir02(FAR void **state) +{ + int ret; + char dirs[64] = + { + 0 + }; + + getcwd(dirs, sizeof(dirs)); + + /* Switch the directory 100 times */ + + for (int lc = 0; lc < 100; lc++) + { + if (lc % 2 == 0) + { + ret = chdir("/"); + assert_int_equal(ret, 0); + } + + else + { + ret = chdir(dirs); + assert_int_equal(ret, 0); + } + } +} diff --git a/testing/testsuites/kernel/syscall/cases/clock_gettime_test.c b/testing/testsuites/kernel/syscall/cases/clock_gettime_test.c new file mode 100644 index 00000000000..60495c72b6b --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/clock_gettime_test.c @@ -0,0 +1,106 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/clock_gettime_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_clockgettime01 + ****************************************************************************/ + +void test_nuttx_syscall_clockgettime01(FAR void **state) +{ + int ret; + clockid_t type; + struct test_case + { + clockid_t clktype; + int allow_inval; + } + + tc[] = + { + { + CLOCK_REALTIME, + }, + + { + CLOCK_MONOTONIC, + }, + + { + CLOCK_BOOTTIME, 1 + }, + }; + + struct timespec spec; + + for (int i = 0; i < 3; i++) + { + type = tc[i].clktype; + switch (type) + { + case CLOCK_REALTIME: + + /* syslog(LOG_INFO, "clock_gettime test CLOCK_REALTIME\n"); */ + + break; + case CLOCK_MONOTONIC: + + /* syslog(LOG_INFO, "clock_gettime test CLOCK_MONOTONIC\n"); */ + + break; + case CLOCK_BOOTTIME: + + /* syslog(LOG_INFO, "clock_gettime test CLOCK_BOOTTIME\n"); */ + + break; + default: + break; + } + + ret = clock_gettime(type, &spec); + assert_int_equal(ret, 0); + } +} diff --git a/testing/testsuites/kernel/syscall/cases/clock_nanosleep_test.c b/testing/testsuites/kernel/syscall/cases/clock_nanosleep_test.c new file mode 100644 index 00000000000..f0a45ff6118 --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/clock_nanosleep_test.c @@ -0,0 +1,91 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/clock_nanosleep_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_clocknanosleep01 + ****************************************************************************/ + +void test_nuttx_syscall_clocknanosleep01(FAR void **state) +{ + int ret; + clockid_t type = CLOCK_REALTIME; + struct timespec t; + clock_t start_time, end_time; + t.tv_sec = 2; + t.tv_nsec = 0; + start_time = clock(); + ret = clock_nanosleep(type, 0, &t, NULL); + assert_int_equal(ret, 0); + end_time = clock(); + assert_int_equal((time_t)(end_time - start_time) / CLOCKS_PER_SEC, + t.tv_sec); +} + +/**************************************************************************** + * Name: test_nuttx_syscall_clocknanosleep02 + ****************************************************************************/ + +void test_nuttx_syscall_clocknanosleep02(FAR void **state) +{ + int ret; + struct timespec ts; + clockid_t tcase[] = + { + CLOCK_MONOTONIC, + CLOCK_REALTIME, + }; + + ret = clock_gettime(tcase[0], &ts); + assert_int_equal(ret, 0); + + ts.tv_sec = 4; + ts.tv_nsec = 1000; + + ret = clock_nanosleep(tcase[0], TIMER_ABSTIME, &ts, NULL); + assert_int_equal(ret, 0); + + ret = clock_gettime(tcase[1], &ts); + assert_int_equal(ret, 0); + + ts.tv_sec = 4; + ts.tv_nsec = 1000; + + ret = clock_nanosleep(tcase[1], TIMER_ABSTIME, &ts, NULL); + assert_int_equal(ret, 0); +} diff --git a/testing/testsuites/kernel/syscall/cases/clock_settime_test.c b/testing/testsuites/kernel/syscall/cases/clock_settime_test.c new file mode 100644 index 00000000000..b819508a852 --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/clock_settime_test.c @@ -0,0 +1,67 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/clock_settime_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_clocksettime01 + ****************************************************************************/ + +void test_nuttx_syscall_clocksettime01(FAR void **state) +{ + int ret; + struct timespec ts; + time_t begin_time; + time_t end_time; + + /* do clock_gettime */ + + ret = clock_gettime(CLOCK_REALTIME, &ts); + assert_int_equal(ret, 0); + + begin_time = ts.tv_sec; + ts.tv_sec = ts.tv_sec + 10; + ret = clock_settime(CLOCK_REALTIME, &ts); + assert_int_equal(ret, 0); + + ret = clock_gettime(CLOCK_REALTIME, &ts); + assert_int_equal(ret, 0); + + end_time = ts.tv_sec; + assert_true((end_time - begin_time) >= 10); +} diff --git a/testing/testsuites/kernel/syscall/cases/close_test.c b/testing/testsuites/kernel/syscall/cases/close_test.c new file mode 100644 index 00000000000..1893d0d681e --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/close_test.c @@ -0,0 +1,150 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/close_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_close01 + ****************************************************************************/ + +void test_nuttx_syscall_close01(FAR void **state) +{ + int fd; + int newfd; + int pipefd[2] = + { + 0 + }; + + char filename[128] = + { + 0 + }; + + int ret; + + sprintf(filename, "%s_dir", __func__); + + fd = creat(filename, 0777); + + newfd = dup(fd); + + ret = pipe(pipefd); + assert_int_equal(ret, 0); + + for (int i = 0; i < 2; i++) + { + if (pipefd[i] > 0) + { + ret = close(pipefd[i]); + assert_int_equal(ret, 0); + } + } + + if (fd > 0) + close(fd); + if (newfd > 0) + close(newfd); + remove(filename); +} + +/**************************************************************************** + * Name: test_nuttx_syscall_close02 + ****************************************************************************/ + +void test_nuttx_syscall_close02(FAR void **state) +{ +#ifndef CONFIG_FDSAN + int ret; + int badfd1 = -1; + int badfd2 = 99999999; + + ret = close(badfd1); + assert_int_equal(ret, ERROR); + + /* Check that an invalid file descriptor returns EBADF + */ + + assert_int_equal(errno, EBADF); + + ret = close(badfd2); + assert_int_equal(ret, ERROR); + + /* Check that an invalid file descriptor returns EBADF + */ + + assert_int_equal(errno, EBADF); +#endif +} + +/**************************************************************************** + * Name: test_nuttx_syscall_close03 + ****************************************************************************/ + +void test_nuttx_syscall_close03(FAR void **state) +{ + char filename[128] = + { + 0 + }; + + int fd; + int ret; + + for (int i = 0; i < 100; i++) + { + memset(filename, 0, sizeof(filename)); + sprintf(filename, "%s_dir%d", __func__, i + 1); + + fd = open(filename, O_RDWR | O_CREAT, 0700); + if (fd < 0) + { + fail_msg("open test file fail !\n"); + } + + ret = close(fd); + assert_int_equal(ret, 0); + + unlink(filename); + } +} diff --git a/testing/testsuites/kernel/syscall/cases/connect_test.c b/testing/testsuites/kernel/syscall/cases/connect_test.c new file mode 100644 index 00000000000..9e252b47026 --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/connect_test.c @@ -0,0 +1,372 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/connect_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#ifndef UCLINUX +#define UCLINUX +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef CONFIG_FDCHECK +#include +#endif +#include "SyscallTest.h" + +__attribute__((unused)) static int s; /* socket descriptor */ +__attribute__((unused)) static int testno; +__attribute__((unused)) static struct sockaddr_in sin1, sin2, sin4; +__attribute__((unused)) static pthread_t thread; +__attribute__((unused)) static int + sfd; /* shared between start_server and do_child */ +__attribute__((unused)) static int setup(void), setup0(void), + setup1(void), setup2(void), cleanup(void), cleanup0(void), + cleanup1(void); +__attribute__((unused)) static void do_child(void); + +__attribute__((unused)) static void *start_server(void *); + +__attribute__((unused)) static struct test_case_t +{ + int domain; /* PF_INET, PF_UNIX, ... */ + int type; /* SOCK_STREAM, SOCK_DGRAM ... */ + int proto; /* protocol number (usually 0 = default) */ + struct sockaddr *sockaddr; /* socket address buffer */ + int salen; /* connect's 3rd argument */ + int retval; /* syscall return value */ + int experrno; /* expected errno */ + int (*setup)(void); + int (*cleanup)(void); + char *desc; +} + +tdat[] = + { + { + PF_INET, SOCK_STREAM, 0, (struct sockaddr *)&sin1, + sizeof(struct sockaddr_in), -1, EBADF, setup0, cleanup0, + "bad file descriptor" + }, + #ifndef UCLINUX + + /* Skip since uClinux does not implement memory protection */ + + { + PF_INET, SOCK_STREAM, 0, (struct sockaddr *)-1, + sizeof(struct sockaddr_in), -1, EFAULT, setup1, cleanup1, + "invalid socket buffer" + }, + + #endif + { + PF_INET, SOCK_STREAM, 0, (struct sockaddr *)&sin1, 3, -1, EINVAL, + setup1, cleanup1, "invalid salen" + }, + + { + 0, 0, 0, (struct sockaddr *)&sin1, sizeof(sin1), -1, ENOTSOCK, + setup0, cleanup0, "invalid socket" + }, + + { + PF_INET, SOCK_STREAM, 0, (struct sockaddr *)&sin1, + sizeof(sin1), -1, EISCONN, setup2, cleanup1, + "already connected" + }, + + { + PF_INET, SOCK_STREAM, 0, (struct sockaddr *)&sin2, + sizeof(sin2), -1, ECONNREFUSED, setup1, cleanup1, + "connection refused" + }, + + /* if CONFIG_DEBUG_ASSERTIONS is set, + * the connect operation will be crash + */ + + #ifndef CONFIG_DEBUG_ASSERTIONS + { + PF_INET, SOCK_STREAM, 0, (struct sockaddr *)&sin4, + sizeof(sin4), -1, EAFNOSUPPORT, setup1, cleanup1, + "invalid address family" + }, + #endif + }; + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_connect01 + ****************************************************************************/ + +void test_nuttx_syscall_connect01(FAR void **state) +{ +#ifdef CONFIG_NET_TCP + int ret; + int flag = 1; + setup(); + + for (testno = 0; testno < sizeof(tdat) / sizeof((tdat)[0]); ++testno) + { + usleep(100000); + if (tdat[testno].setup() < 0) + { + tdat[testno].cleanup(); + continue; + } + + ret = connect(s, tdat[testno].sockaddr, tdat[testno].salen); + + if (ret != tdat[testno].retval || + (ret < 0 && errno != tdat[testno].experrno)) + { + syslog(LOG_ERR, + "test connect %s failed; " + "returned %d (expected %d), errno %d " + "(expected %d)\n", + tdat[testno].desc, ret, tdat[testno].retval, errno, + tdat[testno].experrno); + + /* fail_msg("test fail !"); */ + + flag = 1; + } + + tdat[testno].cleanup(); + } + + cleanup(); + assert_true(flag); +#endif +} + +__attribute__((unused)) static int setup(void) +{ + int r = pthread_create(&thread, NULL, start_server, (void *)&sin1); + if (r < 0) + return -1; + + sin2.sin_family = AF_INET; + + /* this port must be unused! */ + + sin2.sin_port = get_unused_port(NULL, AF_INET, SOCK_STREAM); + if (sin2.sin_port < 0) + return -1; + sin2.sin_addr.s_addr = INADDR_ANY; + + sin4.sin_family = 47; /* bogus address family */ + sin4.sin_port = 0; + sin4.sin_addr.s_addr = htonl(0x0afffefd); + return 0; +} + +__attribute__((unused)) static int cleanup(void) +{ + assert_true(pthread_cancel(thread) == 0); + assert_true(pthread_join(thread, NULL) == 0); + return 0; +} + +__attribute__((unused)) static int setup0(void) +{ + if (tdat[testno].experrno == EBADF) + s = -400; /* anything not an open file */ + else if ((s = open("/dev/null", O_WRONLY)) == -1) + { + syslog(LOG_ERR, "open /dev/null fail, errno %d\n", errno); + fail_msg("test fail !"); + return -1; + } + + return 0; +} + +__attribute__((unused)) static int cleanup0(void) +{ + close(s); + s = -1; + return 0; +} + +__attribute__((unused)) static int setup1(void) +{ + s = safe_socket(tdat[testno].domain, tdat[testno].type, + tdat[testno].proto); + return s; +} + +__attribute__((unused)) static int cleanup1(void) +{ + (void)close(s); + s = -1; + return 0; +} + +__attribute__((unused)) static int setup2(void) +{ + if (setup1() < 0) /* get a socket in s */ + return -1; + return safe_connect(s, (const struct sockaddr *)&sin1, sizeof(sin1)); +} + +__attribute__((unused)) static void *start_server(void *arg) +{ + /* 设置取消状态为启用 */ + + pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL); + + /* 设置取消类型为异步取消 */ + + pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL); + + struct sockaddr_in *sin0 = (struct sockaddr_in *)arg; + socklen_t slen = sizeof(*sin0); + + sin0->sin_family = AF_INET; + sin0->sin_port = 0; /* pick random free port */ + sin0->sin_addr.s_addr = INADDR_ANY; + + sfd = socket(PF_INET, SOCK_STREAM, 0); + if (sfd < 0) + { + syslog(LOG_ERR, "server socket failed\n"); + fail_msg("test fail !"); + return NULL; + } + + if (bind(sfd, (struct sockaddr *)sin0, sizeof(*sin0)) < 0) + { + syslog(LOG_ERR, "server bind failed\n"); + close(sfd); + fail_msg("test fail !"); + return NULL; + } + + if (listen(sfd, 10) < 0) + { + syslog(LOG_ERR, "server listen failed\n"); + close(sfd); + fail_msg("test fail !"); + return NULL; + } + + safe_getsockname(sfd, (struct sockaddr *)sin0, &slen); + do_child(); + return NULL; +} + +__attribute__((unused)) static void do_child(void) +{ + struct sockaddr_in fsin; + fd_set afds; + fd_set rfds; + int nfds; + int cc; + int fd; +#ifdef CONFIG_FDCHECK + int fd_tmp = 0; +#endif + char c; + + FD_ZERO(&afds); + FD_SET(sfd, &afds); + + nfds = sfd + 1; + + /* accept connections until killed */ + + while (1) + { + socklen_t fromlen; + + memcpy(&rfds, &afds, sizeof(rfds)); + + if (select(nfds, &rfds, NULL, NULL, NULL) < 0) + if (errno != EINTR) + { + syslog(LOG_ERR, "select exit fail\n"); + fail_msg("test fail !"); + return; + } + + if (FD_ISSET(sfd, &rfds)) + { + int newfd; + + fromlen = sizeof(fsin); + newfd = accept(sfd, (struct sockaddr *)&fsin, &fromlen); + if (newfd >= 0) + { + FD_SET(newfd, &afds); + nfds = (nfds > newfd + 1) ? (nfds) : (newfd + 1); + } + } + +#ifdef CONFIG_FDCHECK + for (fd = 0; fd < fdcheck_restore(nfds - 1) + 1; ++fd) + { + fd_tmp = fdcheck_protect(fd); + if (fd_tmp != sfd && FD_ISSET(fd_tmp, &rfds)) + { + if ((cc = read(fd_tmp, &c, 1)) == 0) + { + (void)close(fd_tmp); + FD_CLR(fd_tmp, &afds); + } + } + } + +#else + for (fd = 0; fd < nfds; ++fd) + if (fd != sfd && FD_ISSET(fd, &rfds)) + { + if ((cc = read(fd, &c, 1)) == 0) + { + (void)close(fd); + FD_CLR(fd, &afds); + } + } + +#endif + pthread_testcancel(); + } +} + +#undef UCLINUX +#endif diff --git a/testing/testsuites/kernel/syscall/cases/creat_test.c b/testing/testsuites/kernel/syscall/cases/creat_test.c new file mode 100644 index 00000000000..ccf0239c0ca --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/creat_test.c @@ -0,0 +1,123 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/creat_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_creat01 + ****************************************************************************/ + +void test_nuttx_syscall_creat01(FAR void **state) +{ + char filename[50] = ""; + int fd; + int res; + struct tcase + { + int mode; + } + + tcases[] = + { + { + 0644 + }, + + { + 0444 + }, + }; + + sprintf(filename, "Creat01%d", gettid()); + + struct stat buf; + char c; + char w_buf[2] = "A"; + + for (int i = 0; i < 2; i++) + { + fd = creat(filename, tcases[0].mode); + if (fd > 0) + { + res = stat(filename, &buf); + assert_int_equal(res, 0); + assert_int_equal(buf.st_size, 0); + assert_int_equal(write(fd, w_buf, 1), 1); + assert_int_equal(read(fd, &c, 1), -1); + close(fd); + } + } + + res = unlink(filename); + assert_int_equal(res, 0); +} + +/**************************************************************************** + * Name: test_nuttx_syscall_creat02 + ****************************************************************************/ + +void test_nuttx_syscall_creat02(FAR void **state) +{ + char filename[50] = ""; + int fd; + int res; + struct stat statbuf; + + sprintf(filename, "Creat02%d", gettid()); + + fd = creat(filename, 444); + if (fd > 0) + { + res = fstat(fd, &statbuf); + assert_int_equal(res, 0); + assert_int_equal((statbuf.st_mode & S_ISVTX), 0); + + close(fd); + res = unlink(filename); + assert_int_equal(res, 0); + } + else + { + fail_msg("open test file fail !\n"); + } +} diff --git a/testing/testsuites/kernel/syscall/cases/dup2_test.c b/testing/testsuites/kernel/syscall/cases/dup2_test.c new file mode 100644 index 00000000000..7d6a605f80d --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/dup2_test.c @@ -0,0 +1,157 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/dup2_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_dup201 + ****************************************************************************/ + +void test_nuttx_syscall_dup201(FAR void **state) +{ +#ifndef CONFIG_FDSAN + int ret; + int goodfd = 5; + int badfd = -1; + int mystdout = 0; + + struct test_case_t + { + int *ofd; + int *nfd; + int error; + } + + TC[] = + { + /* First fd argument is less than 0 - EBADF */ + + { + NULL, NULL, EBADF + }, + + /* Second fd argument is less than 0 - EBADF */ + + { + NULL, NULL, EBADF + }, + }; + + TC[0].ofd = &badfd; + TC[0].nfd = &goodfd; + + TC[1].ofd = &mystdout; + TC[1].nfd = &badfd; + + for (int i = 0; i < 2; i++) + { + ret = dup2(*TC[i].ofd, *TC[i].nfd); + assert_int_equal(ret, -1); + assert_int_equal(errno, TC[i].error); + } + +#endif +} + +/**************************************************************************** + * Name: test_nuttx_syscall_dup202 + ****************************************************************************/ + +void test_nuttx_syscall_dup202(FAR void **state) +{ + char testfile[64] = ""; + int ret; + int i; + int ofd; + int duprdo = 10; + int dupwro = 20; + int duprdwr = 30; + struct stat oldbuf; + struct stat newbuf; + + struct test_case_t + { + int *nfd; + mode_t mode; + } + + TC[] = + { + { + NULL, (S_IRUSR | S_IRGRP | S_IROTH) + }, + + { + NULL, (S_IWUSR | S_IWGRP | S_IWOTH) + }, + + { + NULL, (S_IRUSR | S_IRGRP | S_IROTH | S_IWUSR | S_IWGRP | S_IWOTH) + }, + }; + + TC[0].nfd = &duprdo; + TC[1].nfd = &dupwro; + TC[2].nfd = &duprdwr; + + sprintf(testfile, "%s_file", __func__); + + for (i = 0; i < 3; i++) + { + ofd = creat(testfile, TC[i].mode); + assert_true(ofd > 0); + + ret = dup2(ofd, *TC[i].nfd); + assert_int_not_equal(ret, -1); + if (ret == -1) + { + continue; + } + + assert_int_equal(fstat(ofd, &oldbuf), 0); + assert_int_equal(fstat(*(TC[i].nfd), &newbuf), 0); + assert_int_equal(oldbuf.st_mode, newbuf.st_mode); + + close(*TC[i].nfd); + close(ofd); + close(ret); + + assert_int_equal(unlink(testfile), 0); + } +} diff --git a/testing/testsuites/kernel/syscall/cases/dup_test.c b/testing/testsuites/kernel/syscall/cases/dup_test.c new file mode 100644 index 00000000000..03fec26e0d4 --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/dup_test.c @@ -0,0 +1,244 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/dup_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_dup01 + ****************************************************************************/ + +void test_nuttx_syscall_dup01(FAR void **state) +{ + char filename[64]; + int fd = -1; + int ret; + + sprintf(filename, "%s_file", __func__); + + fd = open(filename, O_RDWR | O_CREAT, 0700); + if (fd < 0) + { + fail_msg("open test file fail !\n"); + } + + ret = dup(fd); + + assert_true(ret > 0); + if (fd > 0) + { + close(fd); + } + + if (ret > 0) + close(ret); + + assert_int_equal(unlink(filename), 0); +} + +/**************************************************************************** + * Name: test_nuttx_syscall_dup02 + ****************************************************************************/ + +void test_nuttx_syscall_dup02(FAR void **state) +{ +#ifndef CONFIG_FDSAN + int fds[] = + { + -1, 1500 + }; + + int ret; + int nfds; + int ind; + + nfds = sizeof(fds) / sizeof(int); + + for (ind = 0; ind < nfds; ind++) + { + ret = dup(fds[ind]); + assert_int_equal(ret, -1); + if (ret == -1) + { + assert_int_equal(errno, EBADF); + } + } +#endif +} + +/**************************************************************************** + * Name: test_nuttx_syscall_dup03 + ****************************************************************************/ + +void test_nuttx_syscall_dup03(FAR void **state) +{ + int fd[2]; + int ret; + + fd[0] = -1; + pipe(fd); + + ret = dup(fd[0]); + assert_true(ret > 0); + if (ret > 0) + close(ret); + + ret = dup(fd[1]); + assert_true(ret > 0); + if (ret > 0) + close(ret); + + if (fd[0] > 0) + close(fd[0]); + if (fd[1] > 0) + close(fd[1]); +} + +/**************************************************************************** + * Name: test_nuttx_syscall_dup04 + ****************************************************************************/ + +void test_nuttx_syscall_dup04(FAR void **state) +{ + char fname[64]; + int fd = -1; + int ret; + + sprintf(fname, "%s_file", __func__); + + fd = open(fname, O_RDWR | O_CREAT, 0700); + assert_true(fd > 0); + + ret = dup(fd); + assert_true(ret > 0); + + if (fd > 0) + { + close(fd); + } + + if (ret > 0) + close(ret); + + assert_int_equal(unlink(fname), 0); +} + +/**************************************************************************** + * Name: test_nuttx_syscall_dup05 + ****************************************************************************/ + +void test_nuttx_syscall_dup05(FAR void **state) +{ + struct stat retbuf; + struct stat dupbuf; + int rdoret; + int wroret; + int rdwret; + int duprdo; + int dupwro; + int duprdwr; + char testfile[64] = ""; + + sprintf(testfile, "%s_file", __func__); + + rdoret = creat(testfile, 0444); + if (rdoret > 0) + { + duprdo = dup(rdoret); + if (duprdo > 0) + { + assert_int_equal(fstat(rdoret, &retbuf), 0); + assert_int_equal(fstat(duprdo, &dupbuf), 0); + assert_int_equal(retbuf.st_mode, dupbuf.st_mode); + + assert_int_equal(close(duprdo), 0); + assert_int_equal(close(rdoret), 0); + } + } + + else + { + fail_msg("create test fail fail !\n"); + } + + assert_int_equal(unlink(testfile), 0); + + wroret = creat(testfile, 0222); + if (wroret > 0) + { + dupwro = dup(wroret); + if (dupwro) + { + assert_int_equal(fstat(wroret, &retbuf), 0); + assert_int_equal(fstat(dupwro, &dupbuf), 0); + assert_int_equal(retbuf.st_mode, dupbuf.st_mode); + + assert_int_equal(close(dupwro), 0); + assert_int_equal(close(wroret), 0); + } + } + + else + { + fail_msg("create test fail fail !\n"); + } + + assert_int_equal(unlink(testfile), 0); + + rdwret = creat(testfile, 0666); + if (rdwret > 0) + { + duprdwr = dup(rdwret); + if (duprdwr > 0) + { + assert_int_equal(fstat(rdwret, &retbuf), 0); + assert_int_equal(fstat(duprdwr, &dupbuf), 0); + assert_int_equal(retbuf.st_mode, dupbuf.st_mode); + + assert_int_equal(close(duprdwr), 0); + assert_int_equal(close(rdwret), 0); + } + } + + else + { + fail_msg("create test fail fail !\n"); + } + + assert_int_equal(unlink(testfile), 0); +} diff --git a/testing/testsuites/kernel/syscall/cases/fcntl_test.c b/testing/testsuites/kernel/syscall/cases/fcntl_test.c new file mode 100644 index 00000000000..a2b97c489f9 --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/fcntl_test.c @@ -0,0 +1,318 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/fcntl_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_fcntl01 + ****************************************************************************/ + +void test_nuttx_syscall_fcntl01(FAR void **state) +{ + int flags; + int is_pass = 0; + int ret; + char fname[40] = ""; + int fd[10]; + int fd2[10]; + + for (int i = 0; i < 8; i++) + { + sprintf(fname, "Fcntl01%d-%d", gettid(), i); + fd[i] = open(fname, O_WRONLY | O_CREAT, 0666); + if (fd[i] < 0) + { + syslog(LOG_ERR, "open test file fail !\n"); + is_pass = -1; + break; + } + + fd2[i] = fd[i]; + } + + assert_int_equal(is_pass, 0); + close(fd[2]); + close(fd[3]); + close(fd[4]); + close(fd[5]); + + assert_false((fd[2] = fcntl(fd[1], F_DUPFD, 1)) == -1); + + assert_false(fd[2] < fd2[2]); + + assert_false((fd[4] = fcntl(fd[1], F_DUPFD, fd2[3])) < 0); + + assert_false(fd[4] < fd2[3]); + + assert_false((fd[8] = fcntl(fd[1], F_DUPFD, fd2[5])) < 0); + + assert_false(fd[8] != fd2[5]); + + /* //block1: */ + + flags = fcntl(fd[2], F_GETFL, 0); + assert_false((flags & O_WRONLY) == 0); + + /* Check setting of no_delay flag */ + + assert_false(fcntl(fd[2], F_SETFL, O_NDELAY) == -1); + + flags = fcntl(fd[2], F_GETFL, 0); + assert_false((flags & (O_NDELAY | O_WRONLY)) == 0); + + /* Check of setting append flag */ + + assert_false(fcntl(fd[2], F_SETFL, O_APPEND) == -1); + + flags = fcntl(fd[2], F_GETFL, 0); + assert_false((flags & (O_APPEND | O_WRONLY)) == 0); + + /* Check setting flags together */ + + assert_false(fcntl(fd[2], F_SETFL, O_NDELAY | O_APPEND) < 0); + + flags = fcntl(fd[2], F_GETFL, 0); + assert_false((flags & (O_NDELAY | O_APPEND | O_WRONLY)) == 0); + + /* Check that flags are not cummulative */ + + assert_false(fcntl(fd[2], F_SETFL, 0) == -1); + + flags = fcntl(fd[2], F_GETFL, 0); + assert_false((flags & O_WRONLY) == 0); + assert_false((flags = fcntl(fd[2], F_GETFD, 0)) < 0); + assert_false(flags != 0); + assert_false((flags = fcntl(fd[2], F_SETFD, 1)) == -1); + assert_false((flags = fcntl(fd[2], F_GETFD, 0)) == -1); + assert_false(flags != 1); + + for (int j = 0; j < 10; j++) + close(fd[j]); + for (int k = 0; k < 8; k++) + { + sprintf(fname, "Fcntl01%d-%d", gettid(), k); + ret = unlink(fname); + if (ret != 0) + { + syslog(LOG_ERR, "unlink test file(%s) fail !\n", fname); + is_pass = -1; + } + } + + assert_int_equal(is_pass, 0); +} + +/**************************************************************************** + * Name: test_nuttx_syscall_fcntl02 + ****************************************************************************/ + +void test_nuttx_syscall_fcntl02(FAR void **state) +{ + char fname[256] = ""; + int fd; + int min_fd; + int ret = 0; + int min_fds[] = + { + 0, 1, 2, 3, 10, 100 + }; + + sprintf(fname, "Fcntl02_%d", gettid()); + fd = open(fname, O_RDWR | O_CREAT, 0700); + assert_true(fd > 0); + + if (fd > 0) + { + min_fd = min_fds[0]; + ret = fcntl(fd, F_DUPFD, min_fd); + assert_true(ret > min_fd); + } + + if (ret > 0) + close(ret); + if (fd > 0) + close(fd); + ret = unlink(fname); + assert_int_equal(ret, 0); +} + +/**************************************************************************** + * Name: test_nuttx_syscall_fcntl03 + ****************************************************************************/ + +void test_nuttx_syscall_fcntl03(FAR void **state) +{ + int fd; + int ret; + char fname[256] = ""; + sprintf(fname, "fcntl03_%d", gettid()); + fd = open(fname, O_RDWR | O_CREAT, 0700); + assert_true(fd > 0); + + ret = fcntl(fd, F_GETFD, 0); + assert_true(ret != -1); + + close(fd); + ret = unlink(fname); + assert_int_equal(ret, 0); +} + +/**************************************************************************** + * Name: test_nuttx_syscall_fcntl04 + ****************************************************************************/ + +void test_nuttx_syscall_fcntl04(FAR void **state) +{ + int fd; + int ret; + char fname[256] = ""; + sprintf(fname, "fcntl04_%d", gettid()); + + fd = open(fname, O_RDWR | O_CREAT, 0700); + assert_true(fd > 0); + + ret = fcntl(fd, F_GETFL, 0); + assert_int_equal(ret & O_ACCMODE, O_RDWR); + + close(fd); + ret = unlink(fname); + assert_int_equal(ret, 0); +} + +/**************************************************************************** + * Name: test_nuttx_syscall_fcntl05 + ****************************************************************************/ + +void test_nuttx_syscall_fcntl05(FAR void **state) +{ + int file_fd; + int fifo_fd; + int lc; + int ret; + int pipe_fds[2]; + char fname[256] = ""; + struct tcase + { + int *fd; + const char *msg; + } + + tcases[] = + { + { + NULL, "regular file" + }, + + { + NULL, "pipe (write end)" + }, + + { + NULL, "pipe (read end)" + }, + + { + NULL, "fifo" + }, + }; + + sprintf(fname, "fcntl05_%d", gettid()); + + file_fd = open(fname, O_CREAT | O_RDWR, 0666); + assert_true(file_fd > 0); + assert_int_equal(pipe(pipe_fds), 0); + unlink("/fcntl05_fifo"); + assert_int_equal(mkfifo("/fcntl05_fifo", 0777), 0); + + fifo_fd = open("/fcntl05_fifo", O_RDWR); + assert_true(fifo_fd > 0); + + tcases[0].fd = &file_fd; + tcases[1].fd = pipe_fds; + tcases[2].fd = pipe_fds + 1; + tcases[3].fd = &fifo_fd; + + for (lc = 0; lc < 1; lc++) + { + for (int i = 0; i < 4; i++) + { + ret = fcntl(*((tcases + i)->fd), F_SETFD, FD_CLOEXEC); + assert_int_equal(ret, 0); + } + } + + if (file_fd > 0) + assert_int_equal(close(file_fd), 0); + if (pipe_fds[0] > 0) + assert_int_equal(close(pipe_fds[0]), 0); + if (pipe_fds[1] > 0) + assert_int_equal(close(pipe_fds[1]), 0); + if (fifo_fd > 0) + assert_int_equal(close(fifo_fd), 0); + + assert_int_equal(unlink(fname), 0); + assert_int_equal(unlink("/fcntl05_fifo"), 0); +} + +/**************************************************************************** + * Name: test_nuttx_syscall_fcntl06 + ****************************************************************************/ + +void test_nuttx_syscall_fcntl06(FAR void **state) +{ + int fd; + int ret; + int lc; + char fname[256] = ""; + + sprintf(fname, "fcntl06_%d", gettid()); + + fd = open(fname, O_RDWR | O_CREAT); + assert_true(fd > 0); + + for (lc = 0; lc < 10; lc++) + { + ret = fcntl(fd, F_SETFL, O_NDELAY | O_APPEND | O_NONBLOCK); + assert_true(ret != -1); + } + + assert_int_equal(close(fd), 0); + assert_int_equal(unlink(fname), 0); +} diff --git a/testing/testsuites/kernel/syscall/cases/fpathconf_test.c b/testing/testsuites/kernel/syscall/cases/fpathconf_test.c new file mode 100644 index 00000000000..03ea5b0a17d --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/fpathconf_test.c @@ -0,0 +1,103 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/fpathconf_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_fpathconf01 + ****************************************************************************/ + +void test_nuttx_syscall_fpathconf01(FAR void **state) +{ + int fd; + int i; + int ret; + char filename[64] = ""; + + struct pathconf_args + { + char name[16]; + int value; + } + + test_cases[] = + { + { + "_PC_MAX_CANON", _PC_MAX_CANON + }, + + { + "_PC_MAX_INPUT", _PC_MAX_INPUT + }, + + { + "_PC_LINK_MAX", _PC_LINK_MAX + }, + + { + "_PC_NAME_MAX", _PC_NAME_MAX + }, + + { + "_PC_PATH_MAX", _PC_PATH_MAX + }, + + { + "_PC_PIPE_BUF", _PC_PIPE_BUF + }, + }; + + /* setup */ + + sprintf(filename, "%s_file", __func__); + fd = open(filename, O_RDWR | O_CREAT, 0700); + assert_true(fd > 0); + + for (i = 0; i < 6; i++) + { + ret = fpathconf(fd, test_cases[i].value); + assert_int_not_equal(ret, -1); + } + + if (fd > 0) + { + assert_int_equal(close(fd), 0); + } + + assert_int_equal(unlink(filename), 0); +} diff --git a/testing/testsuites/kernel/syscall/cases/fsync_test.c b/testing/testsuites/kernel/syscall/cases/fsync_test.c new file mode 100644 index 00000000000..1d8cf4fa2ae --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/fsync_test.c @@ -0,0 +1,253 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/fsync_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_fsync01 + ****************************************************************************/ + +void test_nuttx_syscall_fsync01(FAR void **state) +{ + char fname[255]; + char buf[8] = "davef"; + int fd; + int ret; + ssize_t w_size; + + sprintf(fname, "Fsync01_%d", gettid()); + + /* creat a test file */ + + fd = open(fname, O_RDWR | O_CREAT, 0700); + assert_true(fd > 0); + + for (int i = 0; i < 10; i++) + { + /* write file */ + + w_size = write(fd, buf, sizeof(buf)); + assert_true(w_size != -1); + + /* do sync */ + + ret = fsync(fd); + assert_int_equal(ret, 0); + } + + assert_int_equal(close(fd), 0); + assert_int_equal(unlink(fname), 0); +} + +/**************************************************************************** + * Name: test_nuttx_syscall_fsync02 + ****************************************************************************/ + +void test_nuttx_syscall_fsync02(FAR void **state) +{ + int fifo_rfd; + int fifo_wfd; + int pipe_fd[2]; +#ifndef CONFIG_FDSAN + int bad_fd = -1; +#endif + int ret; + int test_flag = 0; + + struct tcase + { + int *fd; + int error; + } + + tcases[] = + { + /* EINVAL - fsync() on pipe should not succeed. */ + + { + &pipe_fd[1], EINVAL + }, + + /* EBADF - fd is closed */ + + { + &pipe_fd[0], EBADF + }, + + /* EBADF - fd is invalid (-1) */ + + #ifndef CONFIG_FDSAN + { + &bad_fd, EBADF + }, + #endif + + /* EINVAL - fsync() on fifo should not succeed. */ + + { + &fifo_wfd, EINVAL + }, + }; + + ret = mkfifo("/var/Test_Fifo_SyscallFsync02", 0666); + assert_int_equal(ret, 0); + + ret = pipe(pipe_fd); + assert_int_not_equal(ret, -1); + + fifo_rfd = + open("/var/Test_Fifo_SyscallFsync02", O_RDONLY | O_NONBLOCK); + fifo_wfd = open("/var/Test_Fifo_SyscallFsync02", O_WRONLY); + + close(pipe_fd[0]); + + for (int i = 0; i < sizeof(tcases) / sizeof(tcases[0]); i++) + { + ret = fsync(*(tcases[i].fd)); + if (ret != -1) + { + syslog(LOG_ERR, "fsync() returned unexpected value %d", ret); + test_flag = -1; + } + else if (errno != tcases[i].error) + { + syslog(LOG_ERR, "fsync(): unexpected error. exp=%d errno=%d", + tcases[i].error, errno); + } + else + { + /* test PASS */ + + test_flag = 0; + } + } + + close(fifo_wfd); + close(fifo_rfd); + close(pipe_fd[1]); + unlink("/var/Test_Fifo_SyscallFsync02"); + + assert_int_equal(test_flag, 0); +} + +/**************************************************************************** + * Name: test_nuttx_syscall_fsync03 + ****************************************************************************/ + +void test_nuttx_syscall_fsync03(FAR void **state) +{ + int fd; + int BLOCKSIZE = 8192; + unsigned long MAXBLKS = 65536; + int TIME_LIMIT = 120; + int BUF_SIZE = 2048; + char fname[255]; + struct statvfs stat_buf; + unsigned long f_bavail; + char pbuf[2048]; + + off_t max_blks = 65536; + + sprintf(fname, "Fsync03_%d", getpid()); + fd = open(fname, O_RDWR | O_CREAT | O_TRUNC, 0777); + + if (fstatvfs(fd, &stat_buf) != 0) + { + syslog(LOG_ERR, "FAIL, fstatvfs failed\n"); + } + + f_bavail = (stat_buf.f_bavail * stat_buf.f_bsize) / BLOCKSIZE; + if (f_bavail && (f_bavail < MAXBLKS)) + { + max_blks = f_bavail; + } + + off_t offset; + int i; + int ret; + int max_block = 0; + int data_blocks = 0; + time_t time_start; + time_t time_end; + double time_delta; + long int random_number; + + random_number = rand(); + max_block = random_number % max_blks + 1; + data_blocks = random_number % max_block; + + for (i = 1; i <= data_blocks; i++) + { + offset = i * ((BLOCKSIZE * max_block) / data_blocks); + offset -= BUF_SIZE; + lseek(fd, offset, SEEK_SET); + write(fd, pbuf, BUF_SIZE); + } + + time_start = time(0); + + ret = fsync(fd); + + time_end = time(0); + assert_true(time_end != (time_t)-1); + assert_int_not_equal(ret, -1); + assert_int_equal(ret, 0); + assert_false(time_end < time_start); + assert_false((time_delta = difftime(time_end, time_start)) > + TIME_LIMIT); + + /* SAFE_FTRUNCATE(fd, 0); */ + + ret = ftruncate(fd, 0); + assert_int_equal(ret, 0); + + close(fd); + unlink(fname); +} diff --git a/testing/testsuites/kernel/syscall/cases/ftruncate_test.c b/testing/testsuites/kernel/syscall/cases/ftruncate_test.c new file mode 100644 index 00000000000..a08799ebf9b --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/ftruncate_test.c @@ -0,0 +1,126 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/ftruncate_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: checkandreportftruncatetest + ****************************************************************************/ + +static int checkandreportftruncatetest(int fd, off_t offset, char data, + off_t trunc_len) +{ + int i; + int file_length; + int ret; + char buf[1024]; + struct stat stat_buf; + off_t ret_offset; + ssize_t rval; + + memset(buf, '*', sizeof(buf)); + ret = fstat(fd, &stat_buf); + assert_int_equal(ret, 0); + file_length = stat_buf.st_size; + if (file_length != trunc_len) + { + syslog(LOG_ERR, "FAIL, ftruncate() got incorrected size: %d\n", + file_length); + return -1; + } + + ret_offset = lseek(fd, offset, SEEK_SET); + assert_int_in_range(ret_offset, 0, offset); + rval = read(fd, buf, sizeof(buf)); + assert_int_in_range(rval, 0, 1024); + + for (i = 0; i < 256; i++) + { + if (buf[i] != data) + { + syslog( + LOG_ERR, + "FAIL, ftruncate() got incorrect data %d, expected %d\n", + buf[i], data); + return -1; + } + } + + return 0; +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_ftruncate01 + ****************************************************************************/ + +void test_nuttx_syscall_ftruncate01(FAR void **state) +{ + int fd; + int ret; + char fname[256] = ""; + + sprintf(fname, "Ftruncate01_%d", gettid()); + + assert_int_equal(cmtestfillfile(fname, 'a', 1024, 1), 0); + + fd = open(fname, O_RDWR); + + /* ftruncate to 256 */ + + ret = ftruncate(fd, 256); + assert_int_equal(ret, 0); + + ret = checkandreportftruncatetest(fd, 0, 'a', 256); + assert_int_equal(ret, 0); + + ret = ftruncate(fd, 512); + assert_int_equal(ret, 0); + + ret = checkandreportftruncatetest(fd, 256, 0, 512); + assert_int_equal(ret, 0); + + assert_int_equal(close(fd), 0); + assert_int_equal(unlink(fname), 0); +} diff --git a/testing/testsuites/kernel/syscall/cases/getTimeofday_test.c b/testing/testsuites/kernel/syscall/cases/getTimeofday_test.c new file mode 100644 index 00000000000..992edeba097 --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/getTimeofday_test.c @@ -0,0 +1,94 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/getTimeofday_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +static int done; + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: breakout + ****************************************************************************/ + +static void breakout(int sig) +{ + done = sig; +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_gettimeofday01 + ****************************************************************************/ + +void test_nuttx_syscall_gettimeofday01(FAR void **state) +{ + int rtime = 3; + struct timeval tv1; + struct timeval tv2; + unsigned long long cnt = 0; + + signal(SIGALRM, breakout); + + done = 0; + + alarm(rtime); + + if (gettimeofday(&tv1, NULL)) + fail_msg("FAIL, gettimeofday() failed\n"); + + while (!done) + { + if (gettimeofday(&tv2, NULL)) + fail_msg("FAIL, gettimeofday() failed\n"); + + if (tv2.tv_sec < tv1.tv_sec || + (tv2.tv_sec == tv1.tv_sec && tv2.tv_usec < tv1.tv_usec)) + { + fail_msg("test fail !"); + } + + sleep(1); + tv1 = tv2; + cnt++; + } +} diff --git a/testing/testsuites/kernel/syscall/cases/getcwd_test.c b/testing/testsuites/kernel/syscall/cases/getcwd_test.c new file mode 100644 index 00000000000..49153b45e36 --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/getcwd_test.c @@ -0,0 +1,133 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/getcwd_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_getcwd01 + ****************************************************************************/ + +void test_nuttx_syscall_getcwd01(FAR void **state) +{ + char buffer[5] = "/"; + char *res; + int ret; + struct t_case + { + char *buf; + size_t size; + int exp_err; + } + + tcases[] = + { + { + buffer, 0, EINVAL + }, + + { + buffer, 1, ERANGE + }, + + { + NULL, 1, ERANGE + }, + }; + + for (int i = 0; i < 3; i++) + { + errno = 0; + res = getcwd(tcases[i].buf, tcases[i].size); + assert_null(res); + ret = errno; + assert_int_equal(ret, tcases[i].exp_err); + } +} + +/**************************************************************************** + * Name: test_nuttx_syscall_getcwd02 + ****************************************************************************/ + +void test_nuttx_syscall_getcwd02(FAR void **state) +{ + char *datadir = MOUNT_DIR; + char exp_buf[PATH_MAX] = ""; + char buffer[PATH_MAX] = ""; + char *res = NULL; + + struct t_case + { + char *buf; + size_t size; + } + + tcases[] = + { + { + NULL, 0 + }, + + { + NULL, 0 + }, + + { + NULL, PATH_MAX + }, + }; + + tcases[0].buf = buffer; + tcases[0].size = sizeof(buffer); + + assert_int_equal(chdir(datadir), 0); + assert_non_null(realpath(datadir, exp_buf)); + + for (int i = 0; i < 3; i++) + { + errno = 0; + res = getcwd(tcases[i].buf, tcases[i].size); + + assert_non_null(res); + assert_string_equal(exp_buf, res); + + if (!tcases[i].buf) + free(res); + } +} diff --git a/testing/testsuites/kernel/syscall/cases/getegid_test.c b/testing/testsuites/kernel/syscall/cases/getegid_test.c new file mode 100644 index 00000000000..f8f1edb2fc8 --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/getegid_test.c @@ -0,0 +1,73 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/getegid_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_getegid01 + ****************************************************************************/ + +void test_nuttx_syscall_getegid01(FAR void **state) +{ + int ret; + for (int lc = 0; lc < 5; lc++) + { + ret = getegid(); + assert_int_not_equal(ret, -1); + } +} + +/**************************************************************************** + * Name: test_nuttx_syscall_getegid02 + ****************************************************************************/ + +void test_nuttx_syscall_getegid02(FAR void **state) +{ + int lc; + int ret; + uid_t euid; + struct passwd *pwent; + + for (lc = 0; lc < 5; lc++) + { + ret = getegid(); + euid = geteuid(); + pwent = getpwuid(euid); + assert_non_null(pwent); + assert_int_equal(pwent->pw_gid, ret); + } +} diff --git a/testing/testsuites/kernel/syscall/cases/geteuid_test.c b/testing/testsuites/kernel/syscall/cases/geteuid_test.c new file mode 100644 index 00000000000..4a561db34ac --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/geteuid_test.c @@ -0,0 +1,74 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/geteuid_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_geteuid01 + ****************************************************************************/ + +void test_nuttx_syscall_geteuid01(FAR void **state) +{ + int ret; + for (int lc = 0; lc < 5; lc++) + { + ret = geteuid(); + assert_int_not_equal(ret, -1); + } +} + +/**************************************************************************** + * Name: test_nuttx_syscall_geteuid02 + ****************************************************************************/ + +void test_nuttx_syscall_geteuid02(FAR void **state) +{ + int lc; + int ret; + uid_t euid; + struct passwd *pwent; + + for (lc = 0; lc < 5; lc++) + { + ret = getegid(); + assert_true(ret > 0); + euid = geteuid(); + pwent = getpwuid(euid); + assert_non_null(pwent); + assert_int_equal(pwent->pw_gid, ret); + } +} diff --git a/testing/testsuites/kernel/syscall/cases/getgid_test.c b/testing/testsuites/kernel/syscall/cases/getgid_test.c new file mode 100644 index 00000000000..7fafa385495 --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/getgid_test.c @@ -0,0 +1,74 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/getgid_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_getgid01 + ****************************************************************************/ + +void test_nuttx_syscall_getgid01(FAR void **state) +{ + int lc; + int ret; + for (lc = 0; lc < 5; lc++) + { + ret = getgid(); + assert_int_not_equal(ret, -1); + } +} + +/**************************************************************************** + * Name: test_nuttx_syscall_getgid02 + ****************************************************************************/ + +void test_nuttx_syscall_getgid02(FAR void **state) +{ + int lc; + int ret; + uid_t uid; + struct passwd *pwent; + + for (lc = 0; lc < 5; lc++) + { + ret = getgid(); + uid = getuid(); + pwent = getpwuid(uid); + assert_non_null(pwent); + assert_int_equal(pwent->pw_gid, ret); + } +} diff --git a/testing/testsuites/kernel/syscall/cases/gethostname_test.c b/testing/testsuites/kernel/syscall/cases/gethostname_test.c new file mode 100644 index 00000000000..4b729c629b1 --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/gethostname_test.c @@ -0,0 +1,53 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/gethostname_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_gethostname01 + ****************************************************************************/ + +void test_nuttx_syscall_gethostname01(FAR void **state) +{ + int lc; + int ret; + char hname[100]; /* host name */ + + for (lc = 0; lc < 10; lc++) + { + ret = gethostname(hname, sizeof(hname)); + assert_int_equal(ret, 0); + } +} diff --git a/testing/testsuites/kernel/syscall/cases/getitimer_test.c b/testing/testsuites/kernel/syscall/cases/getitimer_test.c new file mode 100644 index 00000000000..1b43cbcfc5d --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/getitimer_test.c @@ -0,0 +1,139 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/getitimer_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +#define ITIMER_REAL 0 +#define ITIMER_VIRTUAL 1 +#define ITIMER_PROF 2 +#define CLOCK_MONOTONIC_COARSE 6 +#define SEC 100 +#define USEC 10000 +struct timeval tv; +struct itimerval value; +struct timespec time_res; +long jiffy; + +/**************************************************************************** + * Name: TestNuttxAccept01 + ****************************************************************************/ + +void set_settitimer_value(int sec, int usec) +{ + value.it_value.tv_sec = sec; + value.it_value.tv_usec = usec; + value.it_interval.tv_sec = sec; + value.it_interval.tv_usec = usec; +} + +void test_nuttx_syscall_veritygetitimer(int which, char *dec) +{ + if (which == ITIMER_REAL) + { + assert_int_not_equal(gettimeofday(&tv, NULL), -1); + } + + int ret = getitimer(which, &value); + assert_int_equal(ret, 0); + assert_int_equal(value.it_value.tv_sec, 0); + assert_int_equal(value.it_value.tv_usec, 0); + assert_int_equal(value.it_interval.tv_sec, 0); + assert_int_equal(value.it_interval.tv_usec, 0); + set_settitimer_value(SEC, USEC); + int ret2 = setitimer(which, &value, NULL); + assert_int_equal(ret2, 0); + set_settitimer_value(0, 0); + int ret3 = getitimer(which, &value); + assert_int_equal(ret3, 0); + + assert_int_equal(value.it_interval.tv_sec, SEC); + assert_int_equal(value.it_interval.tv_usec, USEC); + + /* syslog(LOG_INFO,"value.it_value.tv_sec=%lld, + * value.it_value.tv_usec=%ld", value.it_value.tv_sec, + * value.it_value.tv_usec); + */ + + long margin = (which == ITIMER_REAL) ? (2 * USEC_PER_TICK) : jiffy; + if (value.it_value.tv_sec == SEC) + { + assert_in_range(value.it_value.tv_usec, 0, USEC + margin); + } + + else + { + assert_in_range(value.it_value.tv_sec, 0, SEC); + } + + /* syslog(LOG_INFO,"timer value is within the expected range"); */ + + if (which == ITIMER_REAL) + { + assert_int_not_equal(gettimeofday(&tv, NULL), -1); + } + + set_settitimer_value(0, 0); + int ret4 = setitimer(which, &value, NULL); + assert_int_equal(ret4, 0); +} + +void test_nuttx_syscall_getitimer01(FAR void **state) +{ + struct tcase + { + int which; + char *des; + } + + tcases[] = + { + { + ITIMER_REAL, "ITIMER_REAL" + }, + + /* {ITIMER_VIRTUAL, "ITIMER_VIRTUAL"}, + * {ITIMER_PROF, "ITIMER_PROF"}, + */ + }; + + clock_getres(CLOCK_MONOTONIC_COARSE, &time_res); + jiffy = (time_res.tv_nsec + 999) / 1000; + + test_nuttx_syscall_veritygetitimer(tcases[0].which, tcases[0].des); +} diff --git a/testing/testsuites/kernel/syscall/cases/getpeername_test.c b/testing/testsuites/kernel/syscall/cases/getpeername_test.c new file mode 100644 index 00000000000..be725e13854 --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/getpeername_test.c @@ -0,0 +1,197 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/getpeername_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#ifndef UCLINUX +#define UCLINUX + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +__attribute__((unused)) static struct sockaddr_in server_addr; +__attribute__((unused)) static struct sockaddr_in fsin1; +__attribute__((unused)) static socklen_t sinlen; + +/* static socklen_t invalid_sinlen = -1; */ + +__attribute__((unused)) static void setup(void); +__attribute__((unused)) static void setup2(int); +__attribute__((unused)) static void setup3(int); + +/* static void setup4(int); */ + +__attribute__((unused)) static void cleanup2(int); + +/* static void cleanup4(int); */ + +__attribute__((unused)) static struct test_case_t +{ + int sockfd; + struct sockaddr *sockaddr; + socklen_t *addrlen; + int expretval; + int experrno; + void (*setup)(int); + void (*cleanup)(int); + char *name; +} + +test_cases[] = +{ + { + -1, (struct sockaddr *)&fsin1, &sinlen, -1, EBADF, NULL, NULL, + "EBADF" + }, + + { + -1, (struct sockaddr *)&fsin1, &sinlen, -1, ENOTSOCK, setup2, + cleanup2, "ENOTSOCK" + }, + + { + -1, (struct sockaddr *)&fsin1, &sinlen, -1, ENOTCONN, setup3, + cleanup2, "ENOTCONN" + }, + + /* { + * -1, (struct sockaddr *)&fsin1, &invalid_sinlen, -1, EINVAL, setup4, + * cleanup4, "EINVAL" + * }, + */ +#if 0 +#ifndef UCLINUX + { + -1, (struct sockaddr *)-1, &sinlen, -1, EFAULT, setup4, cleanup4, + "EFAULT" + }, + + { + -1, (struct sockaddr *)&fsin1, NULL, -1, EFAULT, setup4, + cleanup4, "EFAULT" + }, + + { + -1, (struct sockaddr *)&fsin1, (socklen_t *)1, -1, EFAULT, setup4, + cleanup4, "EFAULT" + }, +#endif +#endif +}; + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_getpeername01 + ****************************************************************************/ + +void test_nuttx_syscall_getpeername01(FAR void **state) +{ +#ifdef CONFIG_NET_TCP + int total = sizeof(test_cases) / sizeof(test_cases[0]); + int ret; + setup(); + for (int i = 0; i < total; ++i) + { + if (test_cases[i].setup != NULL) + test_cases[i].setup(i); + + assert_false(test_cases[i].setup != NULL && + test_cases[i].sockfd <= 0); + ret = getpeername(test_cases[i].sockfd, test_cases[i].sockaddr, + test_cases[i].addrlen); + + assert_false(ret != test_cases[i].expretval || + errno != test_cases[i].experrno); + if (test_cases[i].cleanup != NULL) + test_cases[i].cleanup(i); + } +#endif +} + +__attribute__((unused)) static void setup(void) +{ + server_addr.sin_family = AF_INET; + server_addr.sin_port = 0; + server_addr.sin_addr.s_addr = INADDR_ANY; + sinlen = sizeof(fsin1); +} + +__attribute__((unused)) static void setup2(int i) +{ + int ret; + ret = open("/dev/null", O_WRONLY, 0666); + assert_true(ret >= 0); + test_cases[i].sockfd = ret; +} + +__attribute__((unused)) static void setup3(int i) +{ + test_cases[i].sockfd = socket(PF_INET, SOCK_STREAM, 0); + if (test_cases[i].sockfd < 0) + { + return; + } + + if (safe_bind(test_cases[i].sockfd, (struct sockaddr *)&server_addr, + sizeof(server_addr)) < 0) + { + fail_msg("test fail !"); + } +} + +/* static void setup4(int i) + * { + * if (socketpair(PF_UNIX, SOCK_STREAM, 0, sv) < 0) + * { + * syslog(LOG_ERR, "socketpair failed for getpeername test %d", + * i); faiL_msg("test fail !"); return; + * } + * test_cases[i].sockfd = sv[0]; + * } + */ + +__attribute__((unused)) static void cleanup2(int i) +{ + if (safe_close(test_cases[i].sockfd) < 0) + { + fail_msg("test fail !"); + } +} + +#undef UCLINUX +#endif diff --git a/testing/testsuites/kernel/syscall/cases/getpid_test.c b/testing/testsuites/kernel/syscall/cases/getpid_test.c new file mode 100644 index 00000000000..3dc5915c1de --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/getpid_test.c @@ -0,0 +1,56 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/getpid_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_getpid01 + ****************************************************************************/ + +void test_nuttx_syscall_getpid01(FAR void **state) +{ + int lc; + int ret; + + for (lc = 0; lc < 5; lc++) + { + ret = getpid(); + assert_true(ret > 0); + } +} diff --git a/testing/testsuites/kernel/syscall/cases/getppid_test.c b/testing/testsuites/kernel/syscall/cases/getppid_test.c new file mode 100644 index 00000000000..1f8a91cdaa8 --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/getppid_test.c @@ -0,0 +1,56 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/getppid_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_getppid01 + ****************************************************************************/ + +void test_nuttx_syscall_getppid01(FAR void **state) +{ + int lc; + int ret; + + for (lc = 0; lc < 5; lc++) + { + ret = getppid(); + assert_true(ret > 0); + } +} diff --git a/testing/testsuites/kernel/syscall/cases/getsocketopt_test.c b/testing/testsuites/kernel/syscall/cases/getsocketopt_test.c new file mode 100644 index 00000000000..4674e61d3f4 --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/getsocketopt_test.c @@ -0,0 +1,214 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/getsocketopt_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#ifndef UCLINUX +#define UCLINUX +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +__attribute__((unused)) static int testno; +__attribute__((unused)) static int s; /* socket descriptor */ +__attribute__((unused)) static struct sockaddr_in sin0, fsin1; +__attribute__((unused)) static int sinlen; +__attribute__((unused)) static int optval; +__attribute__((unused)) static socklen_t optlen; + +__attribute__((unused)) static void setup(void); +__attribute__((unused)) static void setup0(void); +__attribute__((unused)) static void setup1(void); +__attribute__((unused)) static void cleanup0(void); +__attribute__((unused)) static void cleanup1(void); + +__attribute__((unused)) static struct test_case_t +{ + int domain; /* PF_INET, PF_UNIX, ... */ + int type; /* SOCK_STREAM, SOCK_DGRAM ... */ + int proto; /* protocol number (usually 0 = default) */ + int level; /* IPPROTO_* */ + int optname; + void *optval; + socklen_t *optlen; + struct sockaddr *sin; + int salen; + int retval; /* syscall return value */ + int experrno; /* expected errno */ + void (*setup)(void); + void (*cleanup)(void); + char *desc; +} + +tdat[] = +{ + { + PF_INET, SOCK_STREAM, 0, SOL_SOCKET, SO_OOBINLINE, &optval, &optlen, + (struct sockaddr *)&fsin1, sizeof(fsin1), -1, EBADF, setup0, + cleanup0, "bad file descriptor" + }, + + { + PF_INET, SOCK_STREAM, 0, SOL_SOCKET, SO_OOBINLINE, &optval, &optlen, + (struct sockaddr *)&fsin1, sizeof(fsin1), -1, ENOTSOCK, setup0, + cleanup0, "bad file descriptor" + }, +#ifndef UCLINUX + { + PF_INET, SOCK_STREAM, 0, SOL_SOCKET, SO_OOBINLINE, 0, &optlen, + (struct sockaddr *)&fsin1, sizeof(fsin1), -1, EFAULT, setup1, + cleanup1, "invalid option buffer" + }, + + { + PF_INET, SOCK_STREAM, 0, SOL_SOCKET, SO_OOBINLINE, &optval, 0, + (struct sockaddr *)&fsin1, sizeof(fsin1), -1, EFAULT, setup1, + cleanup1, "invalid optlen" + }, +#endif /* UCLINUX */ + /* {PF_INET, SOCK_STREAM, 0, 500, SO_OOBINLINE, &optval, &optlen, + * (struct sockaddr *)&fsin1, sizeof(fsin1), -1, + * EOPNOTSUPP, setup1, cleanup1, "invalid level"}, + * {PF_INET, SOCK_STREAM, 0, IPPROTO_UDP, SO_OOBINLINE, &optval, + * &optlen, (struct sockaddr *)&fsin1, sizeof(fsin1), + * -1, EOPNOTSUPP, setup1, cleanup1, "invalid option name"}, + * {PF_INET, SOCK_STREAM, 0, IPPROTO_UDP, SO_OOBINLINE, &optval, + * &optlen, (struct sockaddr *)&fsin1, sizeof(fsin1), + * -1, EOPNOTSUPP, setup1, cleanup1, + * "invalid option name (UDP)"}, + */ + + { + PF_INET, SOCK_STREAM, 0, IPPROTO_IP, -1, &optval, &optlen, + (struct sockaddr *)&fsin1, sizeof(fsin1), -1, ENOPROTOOPT, setup1, + cleanup1, "invalid option name (IP)" + }, + + { + PF_INET, SOCK_STREAM, 0, IPPROTO_TCP, -1, &optval, &optlen, + (struct sockaddr *)&fsin1, sizeof(fsin1), -1, ENOPROTOOPT, setup1, + cleanup1, "invalid option name (TCP)" + }, +}; + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_getsockopt01 + ****************************************************************************/ + +void test_nuttx_syscall_getsockopt01(FAR void **state) +{ +#if defined(CONFIG_NET) && defined(CONFIG_NET_SOCKOPTS) + int ret; + int flag = 1; + setup(); + for (testno = 0; testno < sizeof(tdat) / sizeof(tdat[0]); ++testno) + { + tdat[testno].setup(); + if (s < 0) + continue; + ret = getsockopt(s, tdat[testno].level, tdat[testno].optname, + tdat[testno].optval, tdat[testno].optlen); + if (ret != tdat[testno].retval || errno != tdat[testno].experrno) + { + syslog(LOG_ERR, + "%s ; returned" + " %d (expected %d), errno %d (expected" + " %d)\n", + tdat[testno].desc, ret, tdat[testno].retval, errno, + tdat[testno].experrno); + flag = 0; + } + + tdat[testno].cleanup(); + } + + assert_true(flag); +#endif +} + +__attribute__((unused)) static void setup(void) +{ + /* initialize local sockaddr */ + + sin0.sin_family = AF_INET; + sin0.sin_port = 0; + sin0.sin_addr.s_addr = INADDR_ANY; +} + +__attribute__((unused)) static void setup0(void) +{ + if (tdat[testno].experrno == EBADF) + s = -400; /* anything not an open file */ + else if ((s = open("/dev/null", O_WRONLY)) == -1) + { + syslog(LOG_ERR, + "error opening /dev/null - " + "errno: %s", + strerror(errno)); + fail_msg("test fail !"); + } +} + +__attribute__((unused)) static void cleanup0(void) +{ + if (tdat[testno].experrno != EBADF && s > 0) + (void)close(s); + s = -1; +} + +__attribute__((unused)) static void setup1(void) +{ + s = safe_socket(tdat[testno].domain, tdat[testno].type, + tdat[testno].proto); + if (s < 0) + fail_msg("setup1 fail"); + int ret = safe_bind(s, (struct sockaddr *)&sin0, sizeof(sin0)); + assert_int_not_equal(ret, -1); + sinlen = sizeof(fsin1); + optlen = sizeof(optval); +} + +__attribute__((unused)) static void cleanup1(void) +{ + (void)close(s); + s = -1; +} + +#undef UCLINUX +#endif diff --git a/testing/testsuites/kernel/syscall/cases/getuid_test.c b/testing/testsuites/kernel/syscall/cases/getuid_test.c new file mode 100644 index 00000000000..c2ffc1921a0 --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/getuid_test.c @@ -0,0 +1,74 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/getuid_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_getuid01 + ****************************************************************************/ + +void test_nuttx_syscall_getuid01(FAR void **state) +{ + int ret; + for (int lc = 0; lc < 5; lc++) + { + ret = getuid(); + assert_int_not_equal(ret, -1); + } +} + +/**************************************************************************** + * Name: test_nuttx_syscall_getuid02 + ****************************************************************************/ + +void test_nuttx_syscall_getuid02(FAR void **state) +{ + int lc; + int ret; + uid_t uid; + struct passwd *pwent; + + for (lc = 0; lc < 5; lc++) + { + ret = getuid(); + assert_true(ret > 0); + uid = getuid(); + pwent = getpwuid(uid); + assert_non_null(pwent); + assert_int_equal(pwent->pw_uid, ret); + } +} diff --git a/testing/testsuites/kernel/syscall/cases/listen_test.c b/testing/testsuites/kernel/syscall/cases/listen_test.c new file mode 100644 index 00000000000..a533b523ade --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/listen_test.c @@ -0,0 +1,145 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/listen_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_listen01 + ****************************************************************************/ + +void test_nuttx_syscall_listen01(FAR void **state) +{ +#ifdef CONFIG_NET_TCP + int testno; + int flag = 1; + int s; /* socket descriptor */ + struct test_case_t + { /* test case structure */ + int domain; /* PF_INET, PF_UNIX, ... */ + int type; /* SOCK_STREAM, SOCK_DGRAM ... */ + int proto; /* protocol number (usually 0 = default) */ + int backlog; /* connect's 3rd argument */ + int retval; /* syscall return value */ + int experrno; /* expected errno */ + const char setup[10]; + const char cleanup[10]; + char desc[20]; + } + + tdat[] = + { + { + 0, 0, 0, 0, -1, EBADF, "setup0", "cleanup0", + "bad file descriptor" + }, + + { + 0, 0, 0, 0, -1, ENOTSOCK, "setup0", "cleanup0", "not a socket" + }, + + { + PF_INET, SOCK_DGRAM, 0, 0, -1, EOPNOTSUPP, "setup1", "cleanup1", + "UDP listen" + }, + }; + + const char set[] = "setup0"; + const char clean[] = "cleanup0"; + + for (testno = 0; testno < sizeof(tdat) / sizeof(tdat[0]); ++testno) + { + /* setup0(void) */ + + if (!strcmp(tdat[testno].setup, set)) + { + if (tdat[testno].experrno == EBADF) + s = -400; /* anything not an open file */ + else if ((s = open("/dev/null", O_WRONLY)) == -1) + syslog(LOG_ERR, "error opening /dev/null - errno: %s\n", + strerror(errno)); + } + + else + { + /* setup1(void) */ + + s = safe_socket(tdat[testno].domain, tdat[testno].type, + tdat[testno].proto); + } + + int rec = safe_listen(s, tdat[testno].backlog); + + if (rec != tdat[testno].retval || + (rec < 0 && errno != tdat[testno].experrno)) + { + syslog(LOG_ERR, + "%s ; returned" + " %d (expected %d), errno %d (expected" + " %d)\n", + tdat[testno].desc, rec, tdat[testno].retval, errno, + tdat[testno].experrno); + flag = 0; + } + + else + { + syslog(LOG_INFO, "%s successful\n", tdat[testno].desc); + } + + if (!strcmp(tdat[testno].cleanup, clean)) + { + /* cleanup0(void) */ + + s = -1; + } + + else + { + /* cleanup1(void) */ + + (void)close(s); + s = -1; + } + } + + assert_true(flag); +#endif +} diff --git a/testing/testsuites/kernel/syscall/cases/lseek_test.c b/testing/testsuites/kernel/syscall/cases/lseek_test.c new file mode 100644 index 00000000000..5116d7126ca --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/lseek_test.c @@ -0,0 +1,230 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/lseek_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_lseek01 + ****************************************************************************/ + +void test_nuttx_syscall_lseek01(FAR void **state) +{ + int fd; + char filename[32] = + { + 0 + }; + + ssize_t rval; + char read_buf[64] = + { + 0 + }; + + off_t test_ret; + struct tcase + { + off_t off; + int whence; + char wname[64]; + off_t exp_off; + ssize_t exp_size; + char *exp_data; + } + + tcases[] = + { + { + 4, SEEK_SET, "SEEK_SET", 4, 3, "efg" + }, + + { + -2, SEEK_CUR, "SEEK_CUR", 5, 2, "fg" + }, + + { + -4, SEEK_END, "SEEK_END", 3, 4, "defg" + }, + + { + 0, SEEK_END, "SEEK_END", 7, 0, NULL + }, + }; + + snprintf(filename, sizeof(filename), "%s_file", __func__); + + fd = open(filename, O_RDWR | O_CREAT); + + if (fd > 0) + { + rval = write(fd, "abcdefg", 7); + assert_int_in_range(rval, 0, 7); + } + + else + { + fail_msg("creat test file fail !\n"); + } + + for (int i = 0; i < 4; i++) + { + /* reset the offset to end of file */ + + rval = read(fd, read_buf, sizeof(read_buf)); + assert_int_in_range(rval, 0, 64); + memset(read_buf, 0, sizeof(read_buf)); + test_ret = lseek(fd, tcases[i].off, tcases[i].whence); + if (test_ret == (off_t)-1) + { + syslog(LOG_ERR, "lseek() failed"); + fail_msg("test fail !\n"); + } + + if (test_ret != tcases[i].exp_off) + { + syslog(LOG_ERR, "lseek() returned not expected\n"); + fail_msg("test fail !\n"); + } + + rval = read(fd, read_buf, tcases[i].exp_size); + assert_int_in_range(rval, 0, 64); + + if (tcases[i].exp_data && strcmp(read_buf, tcases[i].exp_data)) + { + syslog(LOG_ERR, "lseek() read incorrect data\n"); + fail_msg("test fail !\n"); + } + } + + if (fd > 0) + { + close(fd); + } + + unlink(filename); +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_lseek07 + ****************************************************************************/ + +void test_nuttx_syscall_lseek07(FAR void **state) +{ + int fd1; + int fd2; + int flag = 1; + int ret; + char read_buf[64] = + { + 0 + }; + + struct tcase + { + int *fd; + char fname[32]; + off_t off; + off_t exp_off; + int exp_size; + char exp_data[16]; + } + + tcases[] = + { + { + NULL, "", 7, 7, 10, "abcdefgijk" + }, + + { + NULL, "", 2, 2, 7, "abijkfg" + }, + }; + + tcases[0].fd = &fd1; + tcases[1].fd = &fd2; + snprintf(tcases[0].fname, sizeof(tcases[0].fname), "%s_file", + __func__); + snprintf(tcases[1].fname, sizeof(tcases[1].fname), "%s_file", + __func__); + + fd1 = open(tcases[0].fname, O_RDWR | O_CREAT, 0644); + fd2 = open(tcases[1].fname, O_RDWR | O_CREAT, 0644); + + write(fd1, "abcdefg", sizeof("abcdefg") - 1); + write(fd2, "abcdefg", sizeof("abcdefg") - 1); + + for (int i = 0; i < 2; i++) + { + memset(read_buf, 0, sizeof(read_buf)); + + ret = lseek(*(tcases[i].fd), tcases[i].off, SEEK_SET); + if (ret == (off_t)-1) + flag = 0; + + if (ret != tcases[i].exp_off) + flag = 0; + + write(*(tcases[i].fd), "ijk", sizeof("ijk") - 1); + + close(*(tcases[i].fd)); + + *(tcases[i].fd) = open(tcases[i].fname, O_RDWR); + + read(*(tcases[i].fd), read_buf, tcases[i].exp_size); + + if (strcmp(read_buf, tcases[i].exp_data)) + { + flag = 0; + syslog(LOG_ERR, "FAIL, lseek() wrote incorrect data\n"); + } + } + + if (fd1 > 0) + close(fd1); + + if (fd2 > 0) + close(fd2); + unlink(tcases[0].fname); + unlink(tcases[1].fname); + assert_true(flag); +} diff --git a/testing/testsuites/kernel/syscall/cases/lstat_test.c b/testing/testsuites/kernel/syscall/cases/lstat_test.c new file mode 100644 index 00000000000..af25f6a0620 --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/lstat_test.c @@ -0,0 +1,80 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/lstat_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_lstat01 + ****************************************************************************/ + +void test_nuttx_syscall_lstat01(FAR void **state) +{ + uid_t user_id; + gid_t group_id; + struct stat stat_buf; + int ret; + + char filename[64] = ""; + char symlink_path[64] = "/Lstat01_tst_syml"; + + sprintf(filename, "%s_file", __func__); + user_id = getuid(); + group_id = getgid(); + + ret = open(filename, O_CREAT | O_WRONLY, 0644); + assert_true(ret > 0); + + ret = close(ret); + assert_int_equal(ret, 0); + + ret = symlink(filename, symlink_path); + assert_int_equal(ret, 0); + + memset(&stat_buf, 0, sizeof(stat_buf)); + + ret = lstat(symlink_path, &stat_buf); + assert_int_equal(ret, 0); + + assert_true(stat_buf.st_gid == group_id); + assert_true(stat_buf.st_uid == user_id); + assert_true((stat_buf.st_mode & S_IFMT) == S_IFLNK); + assert_int_equal(unlink(symlink_path), 0); + assert_int_equal(unlink(filename), 0); +} diff --git a/testing/testsuites/kernel/syscall/cases/memcmp_test.c b/testing/testsuites/kernel/syscall/cases/memcmp_test.c new file mode 100644 index 00000000000..65394738be1 --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/memcmp_test.c @@ -0,0 +1,130 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/memcmp_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ +#define BSIZE 4096 +#define LEN 100 + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: TestNuttxSyscallFill + ****************************************************************************/ + +static void test_nuttx_syscall_lfill(char *str, int len) +{ + int i; + for (i = 0; i < len; i++) + *str++ = 'a'; +} + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_setup + ****************************************************************************/ + +static void test_nuttx_syscall_setup(char *buf) +{ + int i; + for (i = 0; i < BSIZE; i++) + buf[i] = 0; + return; +} + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_verifymemcmp + ****************************************************************************/ + +static void test_nuttx_syscall_verifymemcmp(char *p, char *q, int len) +{ + test_nuttx_syscall_lfill(p, len); + test_nuttx_syscall_lfill(q, len); + + assert_int_equal(memcmp(p, q, len), 0); + + p[len - 1] = 0; + assert_true(memcmp(p, q, len) < 0); + + p[len - 1] = 'a'; + p[0] = 0; + assert_true(memcmp(p, q, len) < 0); + + p[0] = 'a'; + q[len - 1] = 0; + assert_true(memcmp(p, q, len) > 0); + + q[len - 1] = 'a'; + q[0] = 0; + assert_true(memcmp(p, q, len) > 0); + + q[0] = 'a'; + assert_int_equal(memcmp(p, q, len), 0); +} + +/**************************************************************************** + * Pubilc Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_memcmptest01 + ****************************************************************************/ + +void test_nuttx_syscall_memcmptest01(FAR void **state) +{ + char *buf = NULL; + buf = malloc(BSIZE); + assert_non_null(buf); + test_nuttx_syscall_setup(buf); + + test_nuttx_syscall_verifymemcmp(&buf[100], &buf[800], LEN); + test_nuttx_syscall_verifymemcmp(&buf[800], &buf[100], LEN); + + free(buf); +} diff --git a/testing/testsuites/kernel/syscall/cases/memcpy_test.c b/testing/testsuites/kernel/syscall/cases/memcpy_test.c new file mode 100644 index 00000000000..0628b4a0e6a --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/memcpy_test.c @@ -0,0 +1,135 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/memcpy_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ +#define BSIZE 4096 +#define LEN 100 + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_fill + ****************************************************************************/ + +static void test_nuttx_syscall_fill(char *str, int len) +{ + int i; + for (i = 0; i < len; i++) + *str++ = 'a'; +} + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_check + ****************************************************************************/ + +static int test_nuttx_syscall_check(char *str, int len) +{ + int i; + for (i = 0; i < len; i++) + if (*str++ != 'a') + return (-1); + + return 0; +} + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_setup + ****************************************************************************/ + +static void test_nuttx_syscall_setup(char *buf) +{ + int i; + for (i = 0; i < BSIZE; i++) + buf[i] = 0; +} + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_verifymemcpy + ****************************************************************************/ + +static void test_nuttx_syscall_verifymemcpy(char *p, char *q, int len) +{ + test_nuttx_syscall_fill(p, len); + memcpy(q, p, LEN); + + assert_int_equal(test_nuttx_syscall_check(q, len), 0); + + assert_true(*(p - 1) == '\0'); + assert_true(p[LEN] == '\0'); + + assert_true(*(q - 1) == '\0'); + assert_true(q[LEN] == '\0'); +} + +/**************************************************************************** + * Pubilc Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_memcpytest01 + ****************************************************************************/ + +void test_nuttx_syscall_memcpytest01(FAR void **state) +{ + char *buf = NULL; + buf = malloc(BSIZE); + assert_non_null(buf); + test_nuttx_syscall_setup(buf); + + test_nuttx_syscall_verifymemcpy(&buf[100], &buf[800], LEN); + test_nuttx_syscall_verifymemcpy(&buf[800], &buf[100], LEN); + free(buf); +} diff --git a/testing/testsuites/kernel/syscall/cases/memset_test.c b/testing/testsuites/kernel/syscall/cases/memset_test.c new file mode 100644 index 00000000000..9ec1bbf40e9 --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/memset_test.c @@ -0,0 +1,108 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/memset_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ +#define BSIZE 4096 + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_fill + ****************************************************************************/ + +static void test_nuttx_syscall_fill(char *buf) +{ + int i; + for (i = 0; i < BSIZE; i++) + buf[i] = 'a'; +} + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_check + ****************************************************************************/ + +static int test_nuttx_syscall_check(char *str) +{ + int i = 0; + while (!*str++) + i++; + return i; +} + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_memsettest01 + ****************************************************************************/ + +void test_nuttx_syscall_memsettest01(FAR void **state) +{ + char *buf = NULL; + buf = malloc(BSIZE); + assert_non_null(buf); + test_nuttx_syscall_fill(buf); + + int i; + int j; + char *p = &buf[400]; + + for (i = 0; i < 200; i++) + { + test_nuttx_syscall_fill(buf); + memset(p, 0, i); + j = test_nuttx_syscall_check(p); + + assert_true(j == i); + assert_true(*(p - 1) && p[i]); + } + + assert_int_equal(i, 200); + free(buf); +} diff --git a/testing/testsuites/kernel/syscall/cases/mkdir_test.c b/testing/testsuites/kernel/syscall/cases/mkdir_test.c new file mode 100644 index 00000000000..c908e69a1e7 --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/mkdir_test.c @@ -0,0 +1,198 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/mkdir_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_mkdir01 + ****************************************************************************/ + +void test_nuttx_syscall_mkdir01(FAR void **state) +{ + int ret; + int j; + int times = 100; + char tmpdir[40]; + + for (j = 0; j < 5; j += 3) + { + sprintf(tmpdir, "%s_%d_dir", __func__, j); + ret = mkdir(tmpdir, 0777); + if (ret < 0) + { + if (errno != EEXIST) + { + syslog(LOG_ERR, + "Error creating permanent directories, ERRNO = %d", + errno); + fail_msg("test fail !\n"); + goto out; + } + } + } + + while (times--) + { + for (j = 0; j < 5; j += 3) + { + sprintf(tmpdir, "%s_%d_dir", __func__, j); + ret = mkdir(tmpdir, 0777); + if (ret < 0) + { + if (errno != EEXIST) + { + syslog(LOG_ERR, + "MKDIR %s, errno = %d; Wrong error detected.", + tmpdir, errno); + fail_msg("test fail !\n"); + goto out; + } + } + else + { + syslog(LOG_ERR, + "MKDIR %s succeded when it shoud have failed.", + tmpdir); + fail_msg("test fail !\n"); + goto out; + } + } + } + +out: + for (j = 0; j < 5; j += 3) + { + sprintf(tmpdir, "%s_%d_dir", __func__, j); + assert_int_equal(rmdir(tmpdir), 0); + } +} + +/**************************************************************************** + * Name: test_nuttx_syscall_mkdir02 + ****************************************************************************/ + +void test_nuttx_syscall_mkdir02(FAR void **state) +{ + int ret; + int j; + int times = 1000; + char tmpdir[40]; + + while (times--) + { + for (j = 1; j < 5; j += 3) + { + sprintf(tmpdir, "%s_%d_dir", __func__, j); + ret = rmdir(tmpdir); + if (ret < 0) + { + if (errno != ENOENT) + { + syslog(LOG_ERR, + "RMDIR %s, errno = %d; Wrong error detected.", + tmpdir, errno); + fail_msg("test fail !\n"); + } + } + + else + { + syslog(LOG_ERR, + "RMDIR %s succeded when it should have failed.", + tmpdir); + fail_msg("test fail !\n"); + } + } + } +} + +/**************************************************************************** + * Name: test_nuttx_syscall_mkdir03 + ****************************************************************************/ + +void test_nuttx_syscall_mkdir03(FAR void **state) +{ + int ret; + int j; + int times = 1000; + char tmpdir[40]; + + while (times--) + { + for (j = 2; j < 5; j += 3) + { + sprintf(tmpdir, "%s_%d_dir", __func__, j); + ret = mkdir(tmpdir, 0777); + if (ret < 0) + { + syslog(LOG_ERR, + "MKDIR %s, errno = %d; Wrong error detected.", + tmpdir, errno); + goto out; + } + } + + for (j = 2; j < 5; j += 3) + { + sprintf(tmpdir, "%s_%d_dir", __func__, j); + ret = rmdir(tmpdir); + if (ret < 0) + { + syslog(LOG_ERR, + "RMDIR %s, errno = %d; Wrong error detected.", + tmpdir, errno); + goto out; + } + } + } + + goto testpass; + +out: + for (j = 2; j < 5; j += 3) + { + sprintf(tmpdir, "%s/test%d", __func__, j); + rmdir(tmpdir); + } + + assert_true(0); +testpass: + assert_true(1); +} diff --git a/testing/testsuites/kernel/syscall/cases/nansleep_test.c b/testing/testsuites/kernel/syscall/cases/nansleep_test.c new file mode 100644 index 00000000000..44c23403bee --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/nansleep_test.c @@ -0,0 +1,91 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/nansleep_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_nansleep01 + ****************************************************************************/ + +void test_nuttx_syscall_nansleep01(FAR void **state) +{ + time_t ret; + struct timespec t = + { + .tv_sec = 2, .tv_nsec = 9999 + }; + + ret = nanosleep(&t, NULL); + assert_int_equal(ret, 0); +} + +/**************************************************************************** + * Name: test_nuttx_syscall_nansleep02 + ****************************************************************************/ + +void test_nuttx_syscall_nansleep02(FAR void **state) +{ + int ret; + struct timespec tcases[] = + { + {.tv_sec = 0, .tv_nsec = (long)1000000000}, + {.tv_sec = 1, .tv_nsec = (long)-100}, + }; + + int n = 0; + for (n = 0; n < 2; n++) + { + ret = nanosleep(&tcases[n], NULL); + if (ret != -1) + { + syslog(LOG_ERR, + "test no.%d, FAIL, nanosleep() returned %d, expected " + "-1\n", + n + 1, ret); + fail_msg("test fail !\n"); + } + + if (errno != EINVAL) + { + syslog(LOG_ERR, + "test no.%d, FAIL, nanosleep() failed,expected " + "EINVAL, got\n", + n + 1); + fail_msg("test fail !\n"); + } + } +} diff --git a/testing/testsuites/kernel/syscall/cases/pathconf_test.c b/testing/testsuites/kernel/syscall/cases/pathconf_test.c new file mode 100644 index 00000000000..3daa089676a --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/pathconf_test.c @@ -0,0 +1,86 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/pathconf_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_pathconf01 + ****************************************************************************/ + +void test_nuttx_syscall_pathconf01(FAR void **state) +{ + long ret; + char *path; + + struct pathconf_args + { + char define_tag[16]; + int value; + } + + args[] = + { + { + "_PC_LINK_MAX", _PC_LINK_MAX + }, + + { + "_PC_NAME_MAX", _PC_NAME_MAX + }, + + { + "_PC_PATH_MAX", _PC_PATH_MAX + }, + + { + "_PC_PIPE_BUF", _PC_PIPE_BUF + }, + }; + + path = strdup(MOUNT_DIR); + assert_non_null(path); + + for (int i = 0; i < 4; i++) + { + ret = pathconf(path, args[i].value); + assert_int_not_equal(ret, -1); + } + + free(path); +} diff --git a/testing/testsuites/kernel/syscall/cases/pipe_test.c b/testing/testsuites/kernel/syscall/cases/pipe_test.c new file mode 100644 index 00000000000..0edacef0b30 --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/pipe_test.c @@ -0,0 +1,98 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/pipe_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_pipe01 + ****************************************************************************/ + +void test_nuttx_syscall_pipe01(FAR void **state) +{ + int fds[2]; + int ret; + int rd_size; + int wr_size; + char wrbuf[64] = "abcdefghijklmnopqrstuvwxyz"; + char rdbuf[128]; + + memset(rdbuf, 0, sizeof(rdbuf)); + + ret = pipe(fds); + assert_int_not_equal(ret, -1); + + /* write fds[1] */ + + wr_size = write(fds[1], wrbuf, sizeof(wrbuf)); + + /* read fds[0] */ + + rd_size = read(fds[0], rdbuf, sizeof(rdbuf)); + + assert_int_equal(rd_size, wr_size); + assert_int_equal(strncmp(rdbuf, wrbuf, wr_size), 0); + + assert_int_equal(close(fds[0]), 0); + assert_int_equal(close(fds[1]), 0); +} + +/**************************************************************************** + * Name: test_nuttx_syscall_pipe02 + ****************************************************************************/ + +void test_nuttx_syscall_pipe02(FAR void **state) +{ + int fd[2]; + int ret; + char buf[2]; + + ret = pipe(fd); + assert_int_not_equal(ret, -1); + + ret = write(fd[0], "A", 1); + assert_int_equal(ret, -1); + assert_int_equal(errno, EACCES); + + ret = read(fd[1], buf, 1); + assert_int_equal(ret, -1); + assert_int_equal(errno, EACCES); + + assert_int_equal(close(fd[0]), 0); + assert_int_equal(close(fd[1]), 0); +} diff --git a/testing/testsuites/kernel/syscall/cases/pread_test.c b/testing/testsuites/kernel/syscall/cases/pread_test.c new file mode 100644 index 00000000000..dfa9bcd6ffc --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/pread_test.c @@ -0,0 +1,377 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/pread_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#define K1 32 +#define K2 (K1 * 2) +#define K3 (K1 * 3) +#define K4 (K1 * 4) +#define K5 (K1 * 5) + +/**************************************************************************** + * Private data Prototypes + ****************************************************************************/ + +char pread01_filename[64] = ""; +int pread01_fildes; /* file descriptor for tempfile */ +char *pread01_write_buf[4]; /* buffer to hold data to be written */ +char *pread01_read_buf[4]; /* buffer to hold data read from file */ + +/**************************************************************************** + * Private Function Prototypes + ****************************************************************************/ + +void pread01_setup(void); /* Main setup function of test */ +void pread01_cleanup(void); /* cleanup function for the test */ +void pread01_l_seek(int, off_t, int, + off_t); /* function to call lseek() */ +void pread01_init_buffers( + void); /* function to initialize/allocate buffers */ +int pread01_compare_bufers( + void); /* function to compare o/p of pread/pwrite */ + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: pread01_init_buffers + ****************************************************************************/ + +/* init_buffers - allocates both write_buf and read_buf arrays. + * Allocate the read and write buffers. + * Fill the write buffer with the following data like, + * write_buf[0] has 0's, write_buf[1] has 1's, write_buf[2] has 2's + * write_buf[3] has 3's. + */ + +void pread01_init_buffers(void) +{ + int count; /* counter variable for loop */ + + /* Allocate and Initialize read/write buffer */ + + for (count = 0; count < 4; count++) + { + pread01_write_buf[count] = (char *)malloc(K1); + pread01_read_buf[count] = (char *)malloc(K1); + + if ((pread01_write_buf[count] == NULL) || + (pread01_read_buf[count] == NULL)) + { + syslog(LOG_ERR, "malloc() failed on read/write buffers\n"); + } + + memset(pread01_write_buf[count], count, K1); + } +} + +/**************************************************************************** + * Name: pread01_setup + ****************************************************************************/ + +/* setup() - performs all ONE TIME setup for this test. + * + * Initialize/allocate read/write buffers. + * Create a temporary directory and a file under it and + * write know data at different offset positions. + */ + +void pread01_setup(void) +{ + int nwrite = 0; /* no. of bytes written by pwrite() */ + + /* Allocate/Initialize the read/write buffer with know data */ + + pread01_init_buffers(); + + sprintf(pread01_filename, "%s_tstfile", __func__); + + /* Creat a temporary file used for mapping */ + + if ((pread01_fildes = open(pread01_filename, O_RDWR | O_CREAT, 0666)) < + 0) + { + syslog(LOG_ERR, "FAIL, open() on %s failed, errno=%d : %s\n", + pread01_filename, errno, strerror(errno)); + } + + if (pread01_fildes > 0) + { + /* pwrite() K1 of data (0's) at offset 0 of temporary file */ + + if ((nwrite = pwrite(pread01_fildes, pread01_write_buf[0], K1, + 0)) != K1) + { + syslog(LOG_ERR, + "pwrite() failed to write on %s, " + "errno=%d : %s\n", + pread01_filename, errno, strerror(errno)); + } + + /* We should still be at offset 0. */ + + pread01_l_seek(pread01_fildes, 0, SEEK_CUR, 0); + + /* Now, lseek() to a non K boundary, just to be different. */ + + pread01_l_seek(pread01_fildes, K1 / 2, SEEK_SET, K1 / 2); + + /* Again, pwrite() K1 of data (2's) at offset K2 of temporary file + */ + + if ((nwrite = pwrite(pread01_fildes, pread01_write_buf[2], K1, + K2)) != K1) + { + syslog(LOG_ERR, + "FAIL, pwrite() failed to write at %d off. " + "on %s, errno=%d : %s\n", + K2, pread01_filename, errno, strerror(errno)); + } + + /* We should still be at our non K boundary. */ + + pread01_l_seek(pread01_fildes, 0, SEEK_CUR, K1 / 2); + + /* lseek() to an offset of K3. */ + + pread01_l_seek(pread01_fildes, K3, SEEK_SET, K3); + + /* Using write(), write of K1 of data (3's) which should take + * place at an offset of K3, moving the file pointer to K4. + */ + + if ((nwrite = write(pread01_fildes, pread01_write_buf[3], K1)) != + K1) + { + syslog(LOG_ERR, + "write() failed: nwrite=%d, errno=%d " + ": %s\n", + nwrite, errno, strerror(errno)); + } + + /* We should be at offset K4. */ + + pread01_l_seek(pread01_fildes, 0, SEEK_CUR, K4); + + /* Again, pwrite() K1 of data (1's) at offset K1. */ + + if ((nwrite = pwrite(pread01_fildes, pread01_write_buf[1], K1, + K1)) != K1) + { + syslog(LOG_ERR, + "pwrite() failed to write at %d off. " + "on %s, errno=%d : %s\n", + K1, pread01_filename, errno, strerror(errno)); + } + } +} + +/**************************************************************************** + * Name: pread01_l_seek + ****************************************************************************/ + +/* l_seek() - local front end to lseek(). + * + * "checkoff" is the offset at which we believe we should be at. + * Used to validate pread/pwrite don't move the offset. + */ + +void pread01_l_seek(int fdesc, off_t offset, int whence, off_t checkoff) +{ + off_t offloc; /* offset ret. from lseek() */ + + if ((offloc = lseek(fdesc, offset, whence)) != checkoff) + { + syslog(LOG_WARNING, + "return = %" PRId64 " , expected %" PRId64 "\n", + (int64_t)offloc, (int64_t)checkoff); + syslog(LOG_ERR, "lseek() on %s failed\n", pread01_filename); + } +} + +/**************************************************************************** + * Name: pread01_compare_bufers + ****************************************************************************/ + +/* compare_bufers() - Compare the contents of read buffer aganist the + * write buffer contents. + * + * The contents of the index of each buffer should be as follows: + * [0] has 0's, [1] has 1's, [2] has 2's, and [3] has 3's. + * + * This function does memcmp of read/write buffer and display message + * about the functionality of pread(). + */ + +int pread01_compare_bufers(void) +{ + int count; /* index for the loop */ + int err_flg = 0; /* flag to indicate error */ + + for (count = 0; count < 4; count++) + { + if (memcmp(pread01_write_buf[count], pread01_read_buf[count], + K1) != 0) + { + syslog(LOG_ERR, "FAIL, read/write buffer data mismatch\n"); + err_flg++; + } + } + + /* If no erros, Test successful */ + + if (!err_flg) + { + /* syslog(LOG_INFO, "PASS, Functionality of pread() is correct\n"); */ + + return 0; + } + + else + { + return -1; + } +} + +/**************************************************************************** + * Name: pread01_cleanup + ****************************************************************************/ + +void pread01_cleanup(void) +{ + int count; + + /* Free the memory allocated for the read/write buffer */ + + for (count = 0; count < 4; count++) + { + free(pread01_write_buf[count]); + free(pread01_read_buf[count]); + } + + /* Close the temporary file */ + + close(pread01_fildes); + + unlink(pread01_filename); +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_pread01 + ****************************************************************************/ + +void test_nuttx_syscall_pread01(FAR void **state) +{ + int lc; + int nread; /* no. of bytes read by pread() */ + + pread01_setup(); + + for (lc = 0; lc < 1; lc++) + { + /* Call pread() of K1 data (should be 2's) at offset K2. + */ + + nread = pread(pread01_fildes, pread01_read_buf[2], K1, K2); + + /* Check for the return value of pread() */ + + assert_int_equal(nread, K1); + + /* We should still be at offset K4, + * which we were at the end of block 0. + */ + + pread01_l_seek(pread01_fildes, 0, SEEK_CUR, K4); + + /* Now lseek() to offset 0. */ + + pread01_l_seek(pread01_fildes, 0, SEEK_SET, 0); + + /* pread() K1 of data (should be 3's) at offset K3. */ + + nread = pread(pread01_fildes, pread01_read_buf[3], K1, K3); + assert_int_equal(nread, K1); + + /* We should still be at offset 0. */ + + pread01_l_seek(pread01_fildes, 0, SEEK_CUR, 0); + + /* Do a normal read() of K1 data (should be 0's) + * which should take place at offset 0 and move the + * file pointer to an offset of K1. + */ + + nread = read(pread01_fildes, pread01_read_buf[0], K1); + assert_int_equal(nread, K1); + + /* We should now be at an offset of K1. */ + + pread01_l_seek(pread01_fildes, 0, SEEK_CUR, K1); + + /* pread() of K1 data (should be 1's) at offset K1. */ + + nread = pread(pread01_fildes, pread01_read_buf[1], K1, K1); + assert_int_equal(nread, K1); + + /* We should still be at offset K1. */ + + pread01_l_seek(pread01_fildes, 0, SEEK_CUR, K1); + + /* Compare the read buffer data read + * with the data written to write buffer + * in the setup. + */ + + assert_int_equal(pread01_compare_bufers(), 0); + + /* reset our location to offset K4 in case we are looping */ + + pread01_l_seek(pread01_fildes, K4, SEEK_SET, K4); + } + + pread01_cleanup(); +} diff --git a/testing/testsuites/kernel/syscall/cases/pwrite_test.c b/testing/testsuites/kernel/syscall/cases/pwrite_test.c new file mode 100644 index 00000000000..13d452c8905 --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/pwrite_test.c @@ -0,0 +1,322 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/pwrite_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#define K1 32 +#define K2 (K1 * 2) +#define K3 (K1 * 3) +#define K4 (K1 * 4) +#define K5 (K1 * 5) + +/**************************************************************************** + * Private data Prototypes + ****************************************************************************/ + +/**************************************************************************** + * Private Function Prototypes + ****************************************************************************/ + +int pwrite02_init_buffers(char *[]); +int pwrite02_l_seek(int, off_t, int, off_t); + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: pwrite02_init_buffers + ****************************************************************************/ + +int pwrite02_init_buffers(char *wbuf[]) +{ + int i; + + for (i = 0; i < 4; i++) + { + wbuf[i] = (char *)malloc(K1); + if (wbuf[i] == NULL) + { + syslog(LOG_ERR, "ib: malloc failed: errno=%d\n", errno); + return -1; + } + + memset(wbuf[i], i, K1); + } + + return 0; +} + +void pwrite02_free_buffers(char *wbuf[]) +{ + int i; + + for (i = 0; i < 4; i++) + { + if (wbuf[i] != NULL) + { + free(wbuf[i]); + } + } +} + +/**************************************************************************** + * Name: pwrite02_l_seek + ****************************************************************************/ + +/* l_seek() is a local front end to lseek(). + * "checkoff" is the offset at which we believe we should be at. + * Used to validate pwrite doesn't move the offset. + */ + +int pwrite02_l_seek(int fdesc, off_t offset, int whence, off_t checkoff) +{ + off_t offloc; + + if ((offloc = lseek(fdesc, offset, whence)) != checkoff) + { + syslog(LOG_ERR, + "FAIL, (%ld = lseek(%d, %ld, %d)) != %ld) errno = %d\n", + (long int)offloc, fdesc, (long int)offset, whence, + (long int)checkoff, errno); + return -1; + } + + return 0; +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_pwrite01 + ****************************************************************************/ + +void test_nuttx_syscall_pwrite01(FAR void **state) +{ + int fd; + int ret; + char filename[64] = ""; + + sprintf(filename, "%s_file", __func__); + + fd = open(filename, O_RDWR | O_CREAT, 0700); + assert_true(fd > 0); + ret = pwrite(fd, NULL, 0, 0); + assert_int_equal(ret, 0); + + if (fd > 0) + assert_int_equal(close(fd), 0); + + assert_int_equal(unlink(filename), 0); +} + +/**************************************************************************** + * Name: test_nuttx_syscall_pwrite02 + ****************************************************************************/ + +void test_nuttx_syscall_pwrite02(FAR void **state) +{ + char fname[256] = ""; + char *wbuf[4]; + int fd; + int nbytes; + int lc; + struct stat statbuf; + + sprintf(fname, "%s_file", __func__); + + for (lc = 0; lc < 2; lc++) + { + assert_int_equal(pwrite02_init_buffers(wbuf), 0); + + fd = open(fname, O_RDWR | O_CREAT, 0666); + assert_true(fd > 0); + + /* pwrite() K1 of data (0's) at offset 0. + */ + + nbytes = pwrite(fd, wbuf[0], K1, 0); + assert_int_equal(nbytes, K1); + if (nbytes != K1) + { + syslog(LOG_ERR, + "FAIL, pwrite at 0 failed: nbytes=%d, errno=%d\n", + nbytes, errno); + assert_int_equal(unlink(fname), 0); + } + + /* We should still be at offset 0. + */ + + assert_int_equal(pwrite02_l_seek(fd, 0, SEEK_CUR, 0), 0); + + /* lseek() to a non K boundary, just to be different. + */ + + assert_int_equal(pwrite02_l_seek(fd, K1 / 2, SEEK_SET, K1 / 2), 0); + + /* pwrite() K1 of data (2's) at offset K2. + */ + + nbytes = pwrite(fd, wbuf[2], K1, K2); + assert_int_equal(nbytes, K1); + if (nbytes != K1) + { + syslog(LOG_ERR, + "FAIL, pwrite at K2 failed: nbytes=%d, errno=%d\n", + nbytes, errno); + assert_int_equal(unlink(fname), 0); + } + + /* We should still be at our non K boundary. + */ + + assert_int_equal(pwrite02_l_seek(fd, 0, SEEK_CUR, K1 / 2), 0); + + /* lseek() to an offset of K3. + */ + + assert_int_equal(pwrite02_l_seek(fd, K3, SEEK_SET, K3), 0); + + /* This time use a normal write() of K1 of data (3's) which should + * take place at an offset of K3, moving the file pointer to K4. + */ + + nbytes = write(fd, wbuf[3], K1); + assert_int_equal(nbytes, K1); + if (nbytes != K1) + { + syslog(LOG_ERR, "FAIL, write failed: nbytes=%d, errno=%d\n", + nbytes, errno); + assert_int_equal(unlink(fname), 0); + } + + /* We should be at offset K4. + */ + + assert_int_equal(pwrite02_l_seek(fd, 0, SEEK_CUR, K4), 0); + + /* pwrite() K1 of data (1's) at offset K1. + */ + + nbytes = pwrite(fd, wbuf[1], K1, K1); + assert_int_equal(nbytes, K1); + if (nbytes != K1) + { + syslog(LOG_ERR, "FAIL, pwrite failed: nbytes=%d, errno=%d\n", + nbytes, errno); + assert_int_equal(unlink(fname), 0); + } + + /* -------------------------------------------------------------- */ + + /* Now test that O_APPEND takes precedence over any + * offset specified by pwrite(), but that the file + * pointer remains unchanged. First, close then reopen + * the file and ensure it is already K4 in length and + * set the file pointer to it's midpoint, K2. + */ + + close(fd); + fd = open(fname, O_RDWR | O_APPEND, 0666); + assert_true(fd > 0); + if (fd < 0) + { + fail_msg("TEST FAIL !\n"); + syslog(LOG_ERR, "FAIL, open failed: fname = %s, errno = %d\n", + fname, errno); + assert_int_equal(unlink(fname), 0); + } + + if (fstat(fd, &statbuf) == -1) + { + fail_msg("TEST FAIL !\n"); + syslog(LOG_ERR, "FAIl, fstat failed: errno = %d\n", errno); + assert_int_equal(unlink(fname), 0); + } + + if (statbuf.st_size != K4) + { + fail_msg("TEST FAIL !\n"); + syslog(LOG_ERR, "FAIl, file size is %ld != K4\n", + (long int)statbuf.st_size); + assert_int_equal(unlink(fname), 0); + } + + assert_int_equal(pwrite02_l_seek(fd, K2, SEEK_SET, K2), 0); + + /* Finally, pwrite() some K1 of data at offset 0. + * What we should end up with is: + * -The file pointer should still be at K2. + * -The data should have been written to the end + * of the file (O_APPEND) and should be K5 in size. + */ + + if ((nbytes = pwrite(fd, wbuf[0], K1, 0)) != K1) + { + fail_msg("TEST FAIL !\n"); + syslog(LOG_ERR, + "FAIl, pwrite at 0 failed: nbytes=%d, errno=%d\n", + nbytes, errno); + } + + assert_int_equal(pwrite02_l_seek(fd, 0, SEEK_CUR, K2), 0); + if (fstat(fd, &statbuf) == -1) + { + fail_msg("TEST FAIL !\n"); + syslog(LOG_ERR, "FAIl, fstat failed: errno = %d\n", errno); + } + + if (statbuf.st_size != K5) + { + fail_msg("TEST FAIL !\n"); + syslog(LOG_ERR, "FAIl, file size is %ld != K4\n", + (long int)statbuf.st_size); + } + + close(fd); + assert_int_equal(unlink(fname), 0); + pwrite02_free_buffers(wbuf); + } +} diff --git a/testing/testsuites/kernel/syscall/cases/read_test.c b/testing/testsuites/kernel/syscall/cases/read_test.c new file mode 100644 index 00000000000..41b12659acc --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/read_test.c @@ -0,0 +1,201 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/read_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_read01 + ****************************************************************************/ + +void test_nuttx_syscall_read01(FAR void **state) +{ + int fd; + char buf[512]; + char filename[64] = ""; + + memset(buf, '*', 512); + sprintf(filename, "%s_file", __func__); + + fd = open(filename, O_RDWR | O_CREAT, 0700); + assert_true(fd > 0); + assert_int_equal(write(fd, buf, 512), (ssize_t)512); + + lseek(fd, 0, SEEK_SET); + + assert_int_equal(read(fd, buf, 512), (ssize_t)512); + + if (fd > 0) + assert_int_equal(close(fd), 0); + + assert_int_equal(unlink(filename), 0); +} + +/**************************************************************************** + * Name: test_nuttx_syscall_read02 + ****************************************************************************/ + +void test_nuttx_syscall_read02(FAR void **state) +{ +#ifndef CONFIG_FDSAN + + /* Define an invalid file descriptor */ + + int badfd = 99999999; + int ret; + char buf[64]; + size_t count = 1; + + /* Read with an invalid file descriptor */ + + ret = read(badfd, buf, count); + + /* Read fail */ + + assert_int_equal(ret, -1); + + /* Check whether the error code meets the expectation */ + + assert_int_equal(errno, EBADF); +#endif +} + +/**************************************************************************** + * Name: test_nuttx_syscall_read03 + ****************************************************************************/ + +void test_nuttx_syscall_read03(FAR void **state) +{ + char fname[255]; + char palfa[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + int fild; + + int lc; + int ret; + int rfild; + char prbuf[BUFSIZ]; + + sprintf(fname, "%s_tfile", __func__); + + fild = creat(fname, 0777); + if (fild > 0) + { + assert_int_equal(write(fild, palfa, 27), 27); + close(fild); + } + + for (lc = 0; lc < 2; lc++) + { + if ((rfild = open(fname, O_RDONLY)) == -1) + { + syslog(LOG_ERR, "can't open for reading\n"); + continue; + } + + ret = read(rfild, prbuf, BUFSIZ); + + if (ret == -1) + { + fail_msg("test fail !\n"); + syslog(LOG_ERR, "FAIL, call failed unexpectedly\n"); + close(rfild); + continue; + } + + if (ret != 27) + { + fail_msg("test fail !\n"); + syslog(LOG_ERR, + "FAIL, Bad read count - got %d - " + "expected %d\n", + ret, 27); + close(rfild); + continue; + } + + if (memcmp(palfa, prbuf, 27) != 0) + { + fail_msg("test fail !\n"); + syslog(LOG_ERR, + "FAIL, read buffer not equal " + "to write buffer\n"); + close(rfild); + continue; + } + + close(rfild); + } + + assert_int_equal(unlink(fname), 0); +} + +/**************************************************************************** + * Name: test_nuttx_syscall_read04 + ****************************************************************************/ + +void test_nuttx_syscall_read04(FAR void **state) +{ + int ret; + + /* Define an invalid file descriptor */ + + int badfd = -1; + char buf[64]; + size_t count = 1; + + /* Read with an invalid file descriptor */ + + ret = read(badfd, buf, count); + + /* Read succeeded */ + + if (ret != -1) + { + fail_msg("FAIL, read() succeeded unexpectedly"); + } + + /* Check whether the error code meets the expectation */ + + if (errno != EBADF) + { + syslog(LOG_ERR, + "FAIL, read() failed unexpectedly, expected " + "EBADF:%d,actually:%d\n", + EBADF, errno); + fail_msg("read() failed unexpectedly"); + } +} diff --git a/testing/testsuites/kernel/syscall/cases/readdir_test.c b/testing/testsuites/kernel/syscall/cases/readdir_test.c new file mode 100644 index 00000000000..09555c2e9be --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/readdir_test.c @@ -0,0 +1,108 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/readdir_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_setup + ****************************************************************************/ + +static void test_nuttx_syscall_setup(char *prefix, int nfiles) +{ + char fname[255] = + { + 0 + }; + + int i; + int fd; + int ret; + + for (i = 0; i < nfiles; i++) + { + sprintf(fname, "%s_%d", prefix, i); + fd = open(fname, O_RDWR | O_CREAT, 0700); + assert_true(fd > 0); + + ret = write(fd, "hello\n", 6); + assert_int_in_range(ret, 1, 6); + + assert_int_equal(close(fd), 0); + } +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_readdirtest01 + ****************************************************************************/ + +void test_nuttx_syscall_readdirtest01(FAR void **state) +{ + char *prefix = "readdirfile"; + int nfiles = 10; + test_nuttx_syscall_setup(prefix, nfiles); + + int cnt = 0; + DIR *test_dir; + struct dirent *ent; + + char buf[20] = + { + 0 + }; + + getcwd(buf, sizeof(buf)); + test_dir = opendir(buf); + assert_non_null(test_dir); + + while ((ent = readdir(test_dir))) + { + if (!strcmp(ent->d_name, ".") || !strcmp(ent->d_name, "..")) + continue; + if (!strncmp(ent->d_name, prefix, sizeof(prefix) - 1)) + cnt++; + } + + assert_int_equal(cnt, nfiles); + assert_int_equal(closedir(test_dir), 0); +} diff --git a/testing/testsuites/kernel/syscall/cases/recvfrom_test.c b/testing/testsuites/kernel/syscall/cases/recvfrom_test.c new file mode 100644 index 00000000000..fb9d5907d3b --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/recvfrom_test.c @@ -0,0 +1,448 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/recvfrom_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#ifndef UCLINUX +#define UCLINUX +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Private data Prototypes + ****************************************************************************/ + +__attribute__((unused)) static char buf[1024]; +__attribute__((unused)) static int s; /* socket descriptor */ +__attribute__((unused)) static int testno; +__attribute__((unused)) static struct sockaddr_in sin1, from; +__attribute__((unused)) static pthread_t thread; +__attribute__((unused)) static int + sfd; /* shared between do_child and start_server */ +__attribute__((unused)) static socklen_t fromlen; + +/**************************************************************************** + * Private Function Prototypes + ****************************************************************************/ + +__attribute__((unused)) static int setup(void), setup0(void), + setup1(void), setup2(void), cleanup(void), cleanup0(void), + cleanup1(void); +__attribute__((unused)) static void do_child(void); + +__attribute__((unused)) static void *start_server(void *); + +__attribute__((unused)) static struct test_case_t +{ + int domain; /* PF_INET, PF_UNIX, ... */ + int type; /* SOCK_STREAM, SOCK_DGRAM ... */ + int proto; /* protocol number (usually 0 = default) */ + void *buf; /* recv data buffer */ + size_t buflen; /* recv's 3rd argument */ + unsigned flags; /* recv's 4th argument */ + struct sockaddr *from; /* from address */ + socklen_t *salen; /* from address value/result buffer length */ + int retval; /* syscall return value */ + int experrno; /* expected errno */ + int (*setup)(void); + int (*cleanup)(void); + char *desc; +} + +tdat[] = +{ + /* 1 */ + + { + PF_INET, SOCK_STREAM, 0, buf, sizeof(buf), 0, + (struct sockaddr *)&from, &fromlen, -1, EBADF, setup0, cleanup0, + "bad file descriptor" + }, + + /* 2 */ + + { + 0, 0, 0, buf, sizeof(buf), 0, (struct sockaddr *)&from, &fromlen, + -1, ENOTSOCK, setup0, cleanup0, "invalid socket" + }, + + /* 3 */ + + { + PF_INET, SOCK_STREAM, 0, (void *)buf, sizeof(buf), 0, + (struct sockaddr *)-1, &fromlen, 0, ENOTSOCK, setup1, cleanup1, + "invalid socket buffer" + }, + + /* 4 */ + + { + PF_INET, SOCK_STREAM, 0, (void *)buf, sizeof(buf), 0, + (struct sockaddr *)&from, &fromlen, -1, EINVAL, setup2, cleanup1, + "invalid socket addr length" + }, +#ifndef UCLINUX + + /* 5 */ + + { + PF_INET, SOCK_STREAM, 0, (void *)-1, sizeof(buf), 0, + (struct sockaddr *)&from, &fromlen, -1, EFAULT, setup1, cleanup1, + "invalid recv buffer" + }, +#endif + /* 6 */ + +/* { + * PF_INET, SOCK_STREAM, 0, (void *)buf, sizeof(buf), MSG_OOB, + * (struct sockaddr *)&from, &fromlen, + * -1, EINVAL, setup1, cleanup1, "invalid MSG_OOB flag set" + * }, + */ + + /* 7 */ + + { + PF_INET, SOCK_STREAM, 0, (void *)buf, sizeof(buf), + MSG_ERRQUEUE, (struct sockaddr *)&from, &fromlen, -1, EAGAIN, + setup1, cleanup1, "invalid MSG_ERRQUEUE flag set" + }, +}; + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: setup + ****************************************************************************/ + +__attribute__((unused)) static int setup(void) +{ + int r = pthread_create(&thread, NULL, start_server, (void *)&sin1); + if (r < 0) + { + syslog(LOG_ERR, "pthread_create fail, errno %d\n", errno); + return -1; + } + + return 0; +} + +/**************************************************************************** + * Name: cleanup + ****************************************************************************/ + +__attribute__((unused)) static int cleanup(void) +{ + assert_true(pthread_cancel(thread) == 0); + assert_true(pthread_join(thread, NULL) == 0); + return 0; +} + +/**************************************************************************** + * Name: setup0 + ****************************************************************************/ + +__attribute__((unused)) static int setup0(void) +{ + if (tdat[testno].experrno == EBADF) + { + s = 400; /* anything not an open file */ + } + + else if ((s = open("/dev/null", O_WRONLY)) == -1) + { + syslog(LOG_ERR, "open /dev/null fail, errno %d\n", errno); + fail_msg("test fail !"); + return -1; + } + + fromlen = sizeof(from); + return 0; +} + +/**************************************************************************** + * Name: cleanup0 + ****************************************************************************/ + +__attribute__((unused)) static int cleanup0(void) +{ + s = -1; + return 0; +} + +/**************************************************************************** + * Name: setup1 + ****************************************************************************/ + +__attribute__((unused)) static int setup1(void) +{ +#ifdef CONFIG_NET_TCP + fd_set rdfds; + struct timeval timeout; + int n; + + s = safe_socket(tdat[testno].domain, tdat[testno].type, + tdat[testno].proto); + assert_true(s >= 0); + if (tdat[testno].type == SOCK_STREAM && + connect(s, (struct sockaddr *)&sin1, sizeof(sin1)) < 0) + { + syslog(LOG_ERR, "connect failed, errno %d\n", errno); + fail_msg("test fail"); + } + + /* Wait for something to be readable, else we won't detect EFAULT on + * recv + */ + + FD_ZERO(&rdfds); + FD_SET(s, &rdfds); + timeout.tv_sec = 2; + timeout.tv_usec = 0; + n = select(s + 1, &rdfds, 0, 0, &timeout); + if (n != 1 || !FD_ISSET(s, &rdfds)) + { + syslog( + LOG_ERR, + "client setup1 failed - no message ready in 2 sec, errno %d\n", + errno); + fail_msg("test fail"); + } + + fromlen = sizeof(from); +#endif + return s; +} + +/**************************************************************************** + * Name: setup2 + ****************************************************************************/ + +__attribute__((unused)) static int setup2(void) +{ + setup1(); + fromlen = -1; + return 0; +} + +/**************************************************************************** + * Name: cleanup1 + ****************************************************************************/ + +__attribute__((unused)) static int cleanup1(void) +{ + (void)close(s); + s = -1; + return 0; +} + +/**************************************************************************** + * Name: start_server + ****************************************************************************/ + +__attribute__((unused)) static void *start_server(void *arg) +{ + /* 设置取消状态为启用 */ + + pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL); + + /* 设置取消类型为异步取消 */ + + pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL); + + struct sockaddr_in *sin0 = (struct sockaddr_in *)arg; + socklen_t slen = sizeof(*sin0); + + sin0->sin_family = AF_INET; + sin0->sin_port = 0; /* pick random free port */ + sin0->sin_addr.s_addr = INADDR_ANY; + + sfd = socket(PF_INET, SOCK_STREAM, 0); + if (sfd < 0) + { + syslog(LOG_ERR, "server socket failed\n"); + fail_msg("test fail !"); + return NULL; + } + + if (bind(sfd, (struct sockaddr *)sin0, sizeof(*sin0)) < 0) + { + syslog(LOG_ERR, "server bind failed\n"); + close(sfd); + fail_msg("test fail"); + return NULL; + } + + if (listen(sfd, 10) < 0) + { + syslog(LOG_ERR, "server listen failed\n"); + close(sfd); + fail_msg("test fail"); + return NULL; + } + + /* assert_int_not_equal(-1,safe_getsockname(sfd, (struct sockaddr + * *)sin0, &slen)); + */ + + safe_getsockname(sfd, (struct sockaddr *)sin0, &slen); + do_child(); + return NULL; +} + +/**************************************************************************** + * Name: do_child + ****************************************************************************/ + +__attribute__((unused)) static void do_child(void) +{ + struct sockaddr_in fsin; + fd_set afds; + fd_set rfds; + int nfds; + int cc; + int fd; + + FD_ZERO(&afds); + FD_SET(sfd, &afds); + + nfds = sfd + 1; + + /* accept connections until killed */ + + while (1) + { + socklen_t fromlen_s; + memcpy(&rfds, &afds, sizeof(rfds)); + + if (select(nfds, &rfds, NULL, NULL, NULL) < 0) + if (errno != EINTR) + { + syslog(LOG_ERR, "select exit fail\n"); + fail_msg("test fail !"); + return; + } + + if (FD_ISSET(sfd, &rfds)) + { + int newfd; + + fromlen_s = sizeof(fsin); + newfd = accept(sfd, (struct sockaddr *)&fsin, &fromlen_s); + if (newfd >= 0) + { + FD_SET(newfd, &afds); + nfds = (nfds > newfd + 1) ? (nfds) : (newfd + 1); + + /* send something back */ + + (void)write(newfd, "hoser\n", 6); + } + } + + for (fd = 0; fd < nfds; ++fd) + if (fd != sfd && FD_ISSET(fd, &rfds)) + { + cc = read(fd, buf, sizeof(buf)); + if (cc == 0 || (cc < 0 && errno != EINTR)) + { + (void)close(fd); + FD_CLR(fd, &afds); + } + } + + pthread_testcancel(); + } +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_recvfromtest01 + ****************************************************************************/ + +void test_nuttx_syscall_recvfromtest01(FAR void **state) +{ +#ifdef CONFIG_NET_TCP + int ret; + int flag = 1; + setup(); + + for (testno = 0; testno < sizeof(tdat) / sizeof(tdat[0]); ++testno) + { + usleep(100000); + if (tdat[testno].setup() < 0) + { + tdat[testno].cleanup(); + continue; + } + + ret = recvfrom(s, tdat[testno].buf, tdat[testno].buflen, + tdat[testno].flags, tdat[testno].from, + tdat[testno].salen); + if (ret >= 0) + { + ret = 0; /* all nonzero equal here */ + } + + if (ret != tdat[testno].retval || + (ret < 0 && errno != tdat[testno].experrno)) + { + syslog(LOG_ERR, + "test recvfrom01 %s failed; " + "returned %d (expected %d), errno %d " + "(expected %d)\n", + tdat[testno].desc, ret, tdat[testno].retval, errno, + tdat[testno].experrno); + flag = 0; + } + + tdat[testno].cleanup(); + } + + cleanup(); + assert_true(flag); +#endif +} + +#undef UCLINUX +#endif diff --git a/testing/testsuites/kernel/syscall/cases/rmdir_test.c b/testing/testsuites/kernel/syscall/cases/rmdir_test.c new file mode 100644 index 00000000000..063e6b63435 --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/rmdir_test.c @@ -0,0 +1,121 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/rmdir_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_rmdir01 + ****************************************************************************/ + +void test_nuttx_syscall_rmdir01(FAR void **state) +{ + int ret; + struct stat buf; + char testdir[64] = ""; + + sprintf(testdir, "%s_dir", __func__); + + ret = mkdir(testdir, 0777); + assert_int_equal(ret, 0); + + ret = rmdir(testdir); + assert_int_equal(ret, 0); + + assert_int_not_equal(stat(testdir, &buf), 0); +} + +/**************************************************************************** + * Name: test_nuttx_syscall_rmdir02 + ****************************************************************************/ + +void test_nuttx_syscall_rmdir02(FAR void **state) +{ + int ret; + int fd; + + /* Description: + * 1) attempt to rmdir() non-empty directory -> ENOTEMPTY + * 2) attempt to rmdir() non-existing directory -> ENOENT + * 3) attempt to rmdir() a file -> ENOTDIR + */ + + struct testcase + { + char dir[32]; + int exp_errno; + } + + tcases[] = + { + { + "Rmdir02_testdir", ENOTEMPTY + }, + + { + "nosuchdir/testdir2", ENOENT + }, + + { + "Rmdir02_testfile2", ENOTDIR + }, + }; + + ret = mkdir("Rmdir02_testdir", (S_IRWXU | S_IRWXG | S_IRWXO)); + assert_int_equal(ret, 0); + ret = mkdir("Rmdir02_testdir/test1", (S_IRWXU | S_IRWXG | S_IRWXO)); + assert_int_equal(ret, 0); + fd = open("Rmdir02_testfile2", O_CREAT | O_RDWR); + + if (fd > 0) + close(fd); + for (int i = 0; i < 3; i++) + { + ret = rmdir(tcases[i].dir); + assert_int_not_equal(ret, 0); + if (ret != -1) + { + continue; + } + } + + assert_int_equal(rmdir("Rmdir02_testdir/test1"), 0); + assert_int_equal(rmdir("Rmdir02_testdir"), 0); + assert_int_equal(unlink("Rmdir02_testfile2"), 0); +} diff --git a/testing/testsuites/kernel/syscall/cases/sched_test.c b/testing/testsuites/kernel/syscall/cases/sched_test.c new file mode 100644 index 00000000000..9aa5edd62bc --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/sched_test.c @@ -0,0 +1,204 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/sched_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_sched01 + ****************************************************************************/ + +void test_nuttx_syscall_sched01(FAR void **state) +{ + struct test_case_t + { + int prio; + int policy; + } + + TC[] = + { + /* set scheduling policy to SCHED_RR */ + + { + 1, SCHED_RR + }, + + /* set scheduling policy to SCHED_FIFO */ + + { + 1, SCHED_FIFO + } + }; + + int i; + int rec; + struct sched_param param; + + i = 0; +#if CONFIG_RR_INTERVAL > 0 + param.sched_priority = TC[i].prio; + + assert_int_not_equal(sched_setscheduler(0, TC[i].policy, ¶m), -1); + + rec = sched_getscheduler(0); + assert_int_not_equal(rec, -1); + assert_int_equal(rec, TC[i].policy); +#endif + + i = 1; + param.sched_priority = TC[i].prio; + assert_int_not_equal(sched_setscheduler(0, TC[i].policy, ¶m), -1); + + rec = sched_getscheduler(0); + assert_int_not_equal(rec, -1); + assert_int_equal(rec, TC[i].policy); +} + +/**************************************************************************** + * Name: test_nuttx_syscall_sched02 + ****************************************************************************/ + +void test_nuttx_syscall_sched02(FAR void **state) +{ +#if CONFIG_RR_INTERVAL > 0 + int ret; + struct timespec tp; + struct sched_param p = + { + 1 + }; + + /* Change scheduling policy to SCHED_RR */ + + assert_int_not_equal(sched_setscheduler(0, SCHED_RR, &p), -1); + ret = sched_rr_get_interval(0, &tp); + assert_int_equal(ret, 0); +#else + assert_true(1); +#endif +} + +/**************************************************************************** + * Name: test_nuttx_syscall_sched03 + ****************************************************************************/ + +void test_nuttx_syscall_sched03(FAR void **state) +{ + struct timespec tp; + struct sched_param p = + { + 1 + }; + + int ret; + + /* Change scheduling policy to SCHED_FIFO */ + + assert_int_not_equal(sched_setscheduler(0, SCHED_FIFO, &p), -1); + + tp.tv_sec = 99; + tp.tv_nsec = 99; + + ret = sched_rr_get_interval(0, &tp); + + assert_int_equal(ret, 0); + assert_int_equal(tp.tv_sec, 0); + assert_int_equal(tp.tv_nsec, 0); +} + +/**************************************************************************** + * Name: test_nuttx_syscall_sched04 + ****************************************************************************/ + +void test_nuttx_syscall_sched04(FAR void **state) +{ + struct timespec tp; + + static pid_t inval_pid = -1; + + int i; + int ret; + + struct test_cases_t + { + pid_t *pid; + struct timespec *tp; + int exp_errno; + } + + test_cases[] = + { + { + &inval_pid, &tp, EINVAL + } + }; + + int TST_TOTAL = sizeof(test_cases) / sizeof(test_cases[0]); + +#if CONFIG_RR_INTERVAL > 0 + struct sched_param p = + { + 1 + }; + + /* Change scheduling policy to SCHED_RR */ + + assert_int_not_equal(sched_setscheduler(0, SCHED_RR, &p), -1); +#endif + for (i = 0; i < TST_TOTAL; ++i) + { + /* Call sched_rr_get_interval(2) + */ + + ret = + sched_rr_get_interval(*(test_cases[i].pid), test_cases[i].tp); + int ret_error = errno; + + assert_int_equal(ret, -1); + assert_int_equal(ret_error, test_cases[i].exp_errno); + } +} diff --git a/testing/testsuites/kernel/syscall/cases/setsocketopt01_test.c b/testing/testsuites/kernel/syscall/cases/setsocketopt01_test.c new file mode 100644 index 00000000000..8e2bb42efc1 --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/setsocketopt01_test.c @@ -0,0 +1,162 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/setsocketopt01_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_setsockopt01 + ****************************************************************************/ + +void test_nuttx_syscall_setsockopt01(FAR void **state) +{ +#if defined(CONFIG_NET) && defined(CONFIG_NET_SOCKOPTS) + struct sockaddr_in addr; + int optval; + struct test_case + { /* test case structure */ + int domain; /* PF_INET, PF_UNIX, ... */ + int type; /* SOCK_STREAM, SOCK_DGRAM ... */ + int proto; /* protocol number (usually 0 = default) */ + int level; /* IPPROTO_* */ + int optname; + void *optval; + int optlen; + int experrno; /* expected errno */ + char *desc; + } + + testcase_list[] = + { + { + -1, -1, -1, SOL_SOCKET, SO_OOBINLINE, &optval, sizeof(optval), + EBADF, "invalid file descriptor" + }, + + { + -1, -1, -1, SOL_SOCKET, SO_OOBINLINE, &optval, sizeof(optval), + ENOTSOCK, "non-socket file descriptor" + }, + + { + PF_INET, SOCK_STREAM, 0, SOL_SOCKET, SO_OOBINLINE, NULL, + sizeof(optval), EFAULT, "invalid option buffer" + }, + + { + PF_INET, SOCK_STREAM, 0, SOL_SOCKET, SO_OOBINLINE, &optval, 0, + EINVAL, "invalid optlen" + }, + + { + PF_INET, SOCK_STREAM, 0, 500, SO_OOBINLINE, &optval, + sizeof(optval), ENOPROTOOPT, "invalid level" + }, + + { + PF_INET, SOCK_STREAM, 0, IPPROTO_UDP, SO_OOBINLINE, &optval, + sizeof(optval), ENOPROTOOPT, "invalid option name (UDP)" + }, + + { + PF_INET, SOCK_STREAM, 0, IPPROTO_IP, -1, &optval, sizeof(optval), + ENOPROTOOPT, "invalid option name (IP)" + }, + + { + PF_INET, SOCK_STREAM, 0, IPPROTO_TCP, -1, &optval, sizeof(optval), + ENOPROTOOPT, "invalid option name (TCP)" + } + }; + + /* initialize local sockaddr */ + + addr.sin_family = AF_INET; + addr.sin_port = 0; + addr.sin_addr.s_addr = INADDR_ANY; + for (int n = 0; n < sizeof(testcase_list) / sizeof(testcase_list[0]); + n++) + { + int ret; + struct test_case *tc = testcase_list + n; + int tmpfd; + int fd; + if (tc->domain == -1) + { + tmpfd = fd = SAFE_OPEN("/dev/null", O_WRONLY); + if (fd < 0) + continue; + } + + else + { + tmpfd = fd = safe_socket(tc->domain, tc->type, tc->proto); + if (fd < 0) + continue; + if (safe_bind(fd, (struct sockaddr *)&addr, sizeof(addr)) < 0) + continue; + } + + /* Use closed file descriptor rather than -1 */ + + if (tc->experrno == EBADF) + if (safe_close(tmpfd) < 0) + continue; + ret = + setsockopt(fd, tc->level, tc->optname, tc->optval, tc->optlen); + if (tc->experrno != EBADF) + { + safe_close(fd); + fd = -1; + } + + if (ret != -1 || errno != tc->experrno) + { + syslog(LOG_ERR, + "setsockopt %s fail, returned %d (expected -1), " + "errno %d (expected %d)\n", + tc->desc, ret, errno, tc->experrno); + fail_msg("test fail !"); + continue; + } + } + +#endif +} diff --git a/testing/testsuites/kernel/syscall/cases/socket_test.c b/testing/testsuites/kernel/syscall/cases/socket_test.c new file mode 100644 index 00000000000..7bad8a0baea --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/socket_test.c @@ -0,0 +1,208 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/socket_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_verifysocket01 + ****************************************************************************/ + +void test_nuttx_syscall_verifysocket01(int testno, int domain, int type, + int proto, int retval, int experrno) +{ + int fd; + int ret; + errno = 0; + fd = socket(domain, type, proto); + ret = fd; + if (fd > 0) + { + ret = 0; + close(fd); + } + + else + { + ret = -1; + } + + if (errno != experrno || ret != retval) + { + syslog(LOG_WARNING, + "NO.%d do socket() test, ret=%d erron=%d experrno=%d\n", + testno, fd, errno, experrno); + } + + assert_int_equal(ret, retval); +} + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_verifysocket02 + ****************************************************************************/ + +void test_nuttx_syscall_verifysocket02(int type, int flag, int fl_flag) +{ + int fd; + int res; + int tmp; + + fd = socket(PF_INET, type, 0); + assert_int_not_equal(fd, -1); + + res = fcntl(fd, fl_flag); + tmp = (res & flag); + + if (flag != 0) + { + assert_int_not_equal(tmp, 0); + } + + else + { + assert_int_equal(tmp, 0); + } + + assert_int_equal(close(fd), 0); +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_sockettest01 + ****************************************************************************/ + +void test_nuttx_syscall_sockettest01(FAR void **state) +{ + struct test_case_t + { + int domain; + int type; + int proto; + int retval; + int experrno; + } + + tdat[] = + { + { + 0, SOCK_STREAM, 0, -1, EAFNOSUPPORT + }, + + { + PF_INET, 75, 0, -1, EAFNOSUPPORT + }, + + { + PF_INET, SOCK_RAW, 0, -1, EAFNOSUPPORT + }, + + { + PF_INET, SOCK_STREAM, 17, -1, EAFNOSUPPORT + }, + + { + PF_INET, SOCK_DGRAM, 6, -1, EAFNOSUPPORT + }, + + { + PF_INET, SOCK_STREAM, 6, 0, 0 + }, + + { + PF_INET, SOCK_STREAM, 1, -1, EAFNOSUPPORT + } + }; + + for (int i = 0; i < 7; i++) + { + test_nuttx_syscall_verifysocket01(i, tdat[i].domain, tdat[i].type, + tdat[i].proto, tdat[i].retval, + tdat[i].experrno); + } +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_sockettest02 + ****************************************************************************/ + +void test_nuttx_syscall_sockettest02(FAR void **state) +{ + static struct tcase + { + int type; + int flag; + int fl_flag; + } + + tcases[] = + { + { + SOCK_STREAM, 0, F_GETFD + }, + + { + SOCK_STREAM | SOCK_CLOEXEC, FD_CLOEXEC, F_GETFD + }, + + { + SOCK_STREAM, 0, F_GETFL + }, + + { + SOCK_STREAM | SOCK_NONBLOCK, O_NONBLOCK, F_GETFL + } + }; + + for (int i = 0; i < 4; i++) + { + test_nuttx_syscall_verifysocket02(tcases[i].type, tcases[i].flag, + tcases[i].fl_flag); + } +} diff --git a/testing/testsuites/kernel/syscall/cases/socketpair_test.c b/testing/testsuites/kernel/syscall/cases/socketpair_test.c new file mode 100644 index 00000000000..2b4e6209d69 --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/socketpair_test.c @@ -0,0 +1,230 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/socketpair_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#ifndef UCLINUX +#define UCLINUX +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_socketpair01 + ****************************************************************************/ + +void test_nuttx_syscall_socketpair01(FAR void **state) +{ +#ifdef CONFIG_NET_TCP + int fds[2]; + int ret; + struct test_case_t + { + int domain; + int type; + int proto; + int *sv; + int retval; + int experrno; + char *desc; + } + + tdat[] = + { + { + 0, SOCK_STREAM, 0, fds, -1, EAFNOSUPPORT, "invalid domain" + }, + + { + PF_INET, 75, 0, fds, -1, EINVAL, "invalid type" + }, + + { + PF_UNIX, SOCK_DGRAM, 0, fds, 0, 0, "UNIX domain dgram" + }, + + { + PF_INET, SOCK_RAW, 0, fds, -1, EPROTONOSUPPORT, + "raw open as non-root" + }, + + #ifndef UCLINUX + { + PF_UNIX, SOCK_STREAM, 0, 0, -1, EFAULT, "bad aligned pointer" + }, + + { + PF_UNIX, SOCK_STREAM, 0, (int *)7, -1, EFAULT, + "bad unaligned pointer" + }, + + #endif + /* {PF_INET, SOCK_DGRAM, 17, fds, -1, EOPNOTSUPP, "UDP socket"}, */ + + { + PF_INET, SOCK_DGRAM, 6, fds, -1, EPROTONOSUPPORT, "TCP dgram" + }, + + /* {PF_INET, SOCK_STREAM, 6, fds, -1, EOPNOTSUPP, "TCP socket"}, */ + + { + PF_INET, SOCK_STREAM, 1, fds, -1, EPROTONOSUPPORT, + "ICMP stream" + } + }; + + for (int n = 0; n < sizeof(tdat) / sizeof(tdat[0]); n++) + { + struct test_case_t *tc = &tdat[n]; + ret = socketpair(tc->domain, tc->type, tc->proto, tc->sv); + if (ret == 0) + { + SAFE_CLOSE(fds[0]); + SAFE_CLOSE(fds[1]); + } + + if (ret != tc->retval || errno != tc->experrno) + { + syslog(LOG_ERR, + "test socketpair01 %s failed; " + "returned %d (expected %d), errno %d " + "(expected %d)\n", + tc->desc, ret, tc->retval, errno, tc->experrno); + assert_true(0); + } + } + +#endif +} + +/**************************************************************************** + * Name: test_nuttx_syscall_socketpair02 + ****************************************************************************/ + +void test_nuttx_syscall_socketpair02(FAR void **state) +{ +#ifdef CONFIG_NET_TCP + int fds[2]; + int ret; + int flag = 1; + struct tcase + { + int type; + int flag; + int fl_flag; + char *des; + } + + tcases[] = + { + { + SOCK_STREAM, 0, F_GETFD, "no close-on-exec" + }, + + { + SOCK_STREAM | SOCK_CLOEXEC, FD_CLOEXEC, F_GETFD, "close-on-exec" + }, + + { + SOCK_STREAM, 0, F_GETFL, "no non-blocking" + }, + + { + SOCK_STREAM | SOCK_NONBLOCK, O_NONBLOCK, F_GETFL, + "non-blocking" + } + }; + + for (int n = 0; n < sizeof(tcases) / sizeof(tcases[0]); n++) + { + int res; + struct tcase *tc = &tcases[n]; + ret = socketpair(PF_UNIX, tc->type, 0, fds); + if (ret == -1) + { + flag = 0; + syslog(LOG_ERR, + "test socketpair02 %s failed; " + "returned -1, errno %d\n", + tc->des, errno); + continue; + } + + for (int i = 0; i < 2; i++) + { + res = SAFE_FCNTL(fds[i], tc->fl_flag); + + if (tc->flag != 0 && (res & tc->flag) == 0) + { + flag = 0; + syslog(LOG_ERR, + "socketpair() failed to set %s flag for fds[%d]\n", + tc->des, i); + break; + } + + if (tc->flag == 0 && (res & tc->flag) != 0) + { + flag = 0; + syslog(LOG_ERR, + "socketpair() failed to set %s flag for fds[%d]\n", + tc->des, i); + break; + } + } + + SAFE_CLOSE(fds[0]); + SAFE_CLOSE(fds[1]); + } + + if (fds[0] > 0) + { + SAFE_CLOSE(fds[0]); + } + + if (fds[1] > 0) + { + SAFE_CLOSE(fds[1]); + } + + assert_true(flag); +#endif +} + +#undef UCLINUX +#endif \ No newline at end of file diff --git a/testing/testsuites/kernel/syscall/cases/symlink_test.c b/testing/testsuites/kernel/syscall/cases/symlink_test.c new file mode 100644 index 00000000000..40f653c1f38 --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/symlink_test.c @@ -0,0 +1,132 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/symlink_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_symlink01 + ****************************************************************************/ + +void test_nuttx_syscall_symlink01(FAR void **state) +{ + char fname[255]; + char symlnk[255]; + int fd; + int ret; + + sprintf(fname, "%s_tfile", __func__); + fd = open(fname, O_RDWR | O_CREAT, 0700); + assert_true(fd > 0); + if (fd > 0) + close(fd); + sprintf(symlnk, "/%s_t_%d", __func__, gettid()); + ret = symlink(fname, symlnk); + if (fd > 0) + close(fd); + assert_int_equal(ret, OK); + + assert_int_equal(unlink(fname), 0); + assert_int_equal(unlink(symlnk), 0); +} + +/**************************************************************************** + * Name: test_nuttx_syscall_symlink02 + ****************************************************************************/ + +void test_nuttx_syscall_symlink02(FAR void **state) +{ + int fd; + int ret; + struct stat stat_buf; + char testfile[128] = + { + 0 + }; + + snprintf(testfile, sizeof(testfile), "%s_file", __func__); + + /* creat/open a testfile */ + + fd = open(testfile, O_RDWR | O_CREAT, + S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); + if (fd < 0) + { + syslog(LOG_ERR, "open test file fail !\n"); + fail_msg("test fail !"); + } + + /* Close the temporary file created above */ + + assert_int_equal(close(fd), 0); + + ret = symlink(testfile, "/Symlink02_file"); + if (ret == -1) + { + syslog(LOG_ERR, "symlink testfile to symfile Failed, errno=%d \n", + errno); + fail_msg("test fail!"); + } + else + { + /* Get the symlink file status information + * using lstat(2). + */ + + if (lstat("/Symlink02_file", &stat_buf) < 0) + { + syslog(LOG_ERR, "lstat(2) of symfile failed, error:%d \n", + errno); + fail_msg("test fail!"); + } + + /* Check if the st_mode contains a link */ + + if (!S_ISLNK(stat_buf.st_mode)) + { + syslog(LOG_ERR, "symlink of testfile doesn't exist \n"); + fail_msg("test fail!"); + } + } + + assert_int_equal(unlink(testfile), 0); + assert_int_equal(unlink("/Symlink02_file"), 0); +} diff --git a/testing/testsuites/kernel/syscall/cases/time_test.c b/testing/testsuites/kernel/syscall/cases/time_test.c new file mode 100644 index 00000000000..9a17d3572e5 --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/time_test.c @@ -0,0 +1,84 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/time_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_time01 + ****************************************************************************/ + +void test_nuttx_syscall_time01(FAR void **state) +{ + int lc; + time_t ret; + + for (lc = 0; lc < 5; lc++) + { + /* Call time() + */ + + ret = time(NULL); + + /* check return code */ + + assert_int_not_equal(ret, (time_t)-1); + } +} + +/**************************************************************************** + * Name: test_nuttx_syscall_time02 + ****************************************************************************/ + +void test_nuttx_syscall_time02(FAR void **state) +{ + int lc; + time_t tloc; + time_t ret; /* time_t variables for time(2) */ + + for (lc = 0; lc < 5; lc++) + { + /* Call time() to get the time in seconds$ + * since Epoch. + */ + + ret = time(&tloc); + + /* Check return code from time(2) */ + + assert_int_equal(tloc, ret); + } +} diff --git a/testing/testsuites/kernel/syscall/cases/timer_create_test.c b/testing/testsuites/kernel/syscall/cases/timer_create_test.c new file mode 100644 index 00000000000..ac3bf7abef7 --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/timer_create_test.c @@ -0,0 +1,62 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/timer_create_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_timercreate01 + ****************************************************************************/ + +void test_nuttx_syscall_timercreate01(FAR void **state) +{ + int ret; + struct sigevent evp; + clock_t clock = CLOCK_MONOTONIC; + timer_t created_timer_id; + + memset(&evp, 0, sizeof(evp)); + + evp.sigev_signo = SIGALRM; + evp.sigev_notify = SIGEV_SIGNAL; + + ret = timer_create(clock, &evp, &created_timer_id); + assert_int_equal(ret, 0); + + ret = timer_delete(created_timer_id); + assert_int_equal(ret, 0); +} diff --git a/testing/testsuites/kernel/syscall/cases/timer_delete_test.c b/testing/testsuites/kernel/syscall/cases/timer_delete_test.c new file mode 100644 index 00000000000..d8bf5ae1ea1 --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/timer_delete_test.c @@ -0,0 +1,64 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/timer_delete_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_timerdelete01 + ****************************************************************************/ + +void test_nuttx_syscall_timerdelete01(FAR void **state) +{ + int ret; + timer_t timer_id; + clock_t clock_list[] = + { + CLOCK_REALTIME, + CLOCK_MONOTONIC, + CLOCK_BOOTTIME, + }; + + for (int i = 0; i < 3; i++) + { + ret = timer_create(clock_list[i], NULL, &timer_id); + assert_int_equal(ret, 0); + + ret = timer_delete(timer_id); + assert_int_equal(ret, 0); + } +} diff --git a/testing/testsuites/kernel/syscall/cases/timer_gettime_test.c b/testing/testsuites/kernel/syscall/cases/timer_gettime_test.c new file mode 100644 index 00000000000..772678956fa --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/timer_gettime_test.c @@ -0,0 +1,69 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/timer_gettime_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_timergettime01 + ****************************************************************************/ + +void test_nuttx_syscall_timergettime01(FAR void **state) +{ + int lc; + int ret; + struct sigevent ev; + struct itimerspec spec; + timer_t timer; + + ev.sigev_value = (union sigval)0; + ev.sigev_signo = SIGALRM; + ev.sigev_notify = SIGEV_SIGNAL; + + ret = timer_create(CLOCK_REALTIME, &ev, &timer); + assert_int_equal(ret, 0); + + for (lc = 0; lc < 1; ++lc) + { + ret = timer_gettime(timer, &spec); + assert_int_equal(ret, 0); + + ret = timer_gettime(timer, NULL); + assert_int_equal(ret, -1); + assert_int_equal(errno, EINVAL); + } +} diff --git a/testing/testsuites/kernel/syscall/cases/truncate_test.c b/testing/testsuites/kernel/syscall/cases/truncate_test.c new file mode 100644 index 00000000000..6589cd51ad3 --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/truncate_test.c @@ -0,0 +1,150 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/truncate_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_truncate01 + ****************************************************************************/ + +void test_nuttx_syscall_truncate01(FAR void **state) +{ + int BUF_SIZE = 256; /* buffer size */ + int FILE_SIZE = 1024; /* test file size */ + int TRUNC_LEN = 256; /* truncation length */ + struct stat stat_buf; /* stat(2) struct contents */ + int lc; + int ret; + off_t file_length; /* test file length */ + char truncate01_fileneme[128] = ""; + + /* setup */ + + int fd; + int i; /* file handler for testfile */ + int c; + int c_total = 0; /* no. bytes to be written to file */ + char tst_buff[BUF_SIZE]; /* buffer to hold data */ + + snprintf(truncate01_fileneme, sizeof(truncate01_fileneme), "%s_file", + __func__); + + /* Fill the test buffer with the known data */ + + for (i = 0; i < BUF_SIZE; i++) + { + tst_buff[i] = 'a'; + } + + /* Creat a testfile under temporary directory */ + + fd = open(truncate01_fileneme, O_RDWR | O_CREAT, + S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); + if (fd < 0) + { + syslog(LOG_ERR, "open test file fail !\n"); + fail_msg("test fail !"); + } + + /* Write to the file 1k data from the buffer */ + + while (c_total < FILE_SIZE) + { + c = write(fd, tst_buff, sizeof(tst_buff)); + if (c > 0) + { + c_total += c; + } + } + + /* Close the testfile after writing data into it */ + + close(fd); + + /* do test */ + + for (lc = 0; lc < 2; lc++) + { + ret = truncate(truncate01_fileneme, TRUNC_LEN); + + if (ret == -1) + { + syslog(LOG_ERR, + "FAIL, truncate(%s, %d) Failed, errno=%d : %s\n", + truncate01_fileneme, TRUNC_LEN, errno, strerror(errno)); + fail_msg("test fail !"); + } + else + { + /* Get the testfile information using + * stat(2). + */ + + if (stat(truncate01_fileneme, &stat_buf) < 0) + { + syslog(LOG_ERR, + "FAIL, stat(2) of " + "%s failed, error:%d\n", + truncate01_fileneme, errno); + fail_msg("test fail !"); + } + + stat_buf.st_mode &= ~S_IFREG; + file_length = stat_buf.st_size; + + /* Check for expected size of testfile after + * truncate(2) on it. + */ + + if (file_length != TRUNC_LEN) + { + syslog(LOG_ERR, + "FAIL, %s: Incorrect file " + "size %" PRId64 " , Expected %d\n", + truncate01_fileneme, (int64_t)file_length, + TRUNC_LEN); + fail_msg("test fail !"); + } + } + } + + assert_int_equal(unlink(truncate01_fileneme), 0); +} diff --git a/testing/testsuites/kernel/syscall/cases/unlink_test.c b/testing/testsuites/kernel/syscall/cases/unlink_test.c new file mode 100644 index 00000000000..78b3e6f579c --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/unlink_test.c @@ -0,0 +1,78 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/unlink_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_unlink01 + ****************************************************************************/ + +void test_nuttx_syscall_unlink01(FAR void **state) +{ + char fname[64] = + { + 0 + }; + + int fd; + int ret; + + sprintf(fname, "%s_file", __func__); + + fd = open(fname, O_RDWR | O_CREAT); + if (fd > 0) + { + close(fd); + } + + else + { + syslog(LOG_ERR, "open test file fail !\n"); + fail_msg("test fail"); + } + + ret = unlink(fname); + assert_int_equal(ret, 0); + + if (!access(fname, F_OK)) + { + fail_msg("test fail !\n"); + syslog(LOG_ERR, + "FAIL, unlink(%s) succeeded, but %s still existed\n", fname, + fname); + } +} diff --git a/testing/testsuites/kernel/syscall/cases/write_test.c b/testing/testsuites/kernel/syscall/cases/write_test.c new file mode 100644 index 00000000000..dcd10cc362d --- /dev/null +++ b/testing/testsuites/kernel/syscall/cases/write_test.c @@ -0,0 +1,177 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cases/write_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_write01 + ****************************************************************************/ + +void test_nuttx_syscall_write01(FAR void **state) +{ + ssize_t ret; + char filename[64]; + int fd; + int i; + int badcount = 0; + char buf[BUFSIZ]; + + sprintf(filename, "%s_file", __func__); + + /* setup */ + + fd = open(filename, O_RDWR | O_CREAT, 0700); + assert_true(fd > 0); + + /* do test */ + + assert_non_null(memset(buf, 'w', BUFSIZ)); + + assert_int_equal(lseek(fd, 0, SEEK_SET), 0); + + for (i = BUFSIZ; i > 0; i--) + { + ret = write(fd, buf, i); + if (ret == -1) + { + fail_msg("FAIL, write failed !\n"); + break; + } + + if (ret != i) + { + badcount++; + syslog(LOG_INFO, + "INFO, write() returned %" PRId64 ", expected %d\n", + (int64_t)ret, i); + } + } + + if (badcount != 0) + { + fail_msg("FAIL, write() failed to return proper count\n"); + } + + if (fd > 0) + { + assert_int_equal(close(fd), 0); + } + + assert_int_equal(unlink(filename), 0); +} + +/**************************************************************************** + * Name: test_nuttx_syscall_write02 + ****************************************************************************/ + +void test_nuttx_syscall_write02(FAR void **state) +{ + int fd; + int ret; + char filename[64]; + sprintf(filename, "%s_file", __func__); + fd = open(filename, O_RDWR | O_CREAT, 0700); + assert_true(fd > 0); + + ret = write(fd, NULL, 3); + assert_true(ret < 0); + + if (fd > 0) + { + assert_int_equal(close(fd), 0); + } + + assert_int_equal(unlink(filename), 0); +} + +/**************************************************************************** + * Name: test_nuttx_syscall_write03 + ****************************************************************************/ + +void test_nuttx_syscall_write03(FAR void **state) +{ + int fd; + ssize_t ret; + char filename[64]; + int i; + int badcount = 0; + char buf[100]; + + sprintf(filename, "%s_file.wav", __func__); + + /* setup */ + + fd = open(filename, O_RDWR | O_CREAT, 0700); + assert_true(fd > 0); + + /* do test */ + + assert_non_null(memset(buf, 'w', 100)); + + assert_int_equal(lseek(fd, 0, SEEK_SET), 0); + + for (i = 100; i > 0; i--) + { + ret = write(fd, buf, i); + if (ret == -1) + { + fail_msg("FAIL, write failed !\n"); + break; + } + + if (ret != i) + { + badcount++; + syslog(LOG_INFO, + "INFO, write() returned %" PRId64 ", expected %d\n", + (int64_t)ret, i); + } + } + + if (badcount != 0) + { + fail_msg("FAIL, write() failed to return proper count\n"); + } + + if (fd > 0) + { + assert_int_equal(close(fd), 0); + } + + assert_int_equal(unlink(filename), 0); +} diff --git a/testing/testsuites/kernel/syscall/cmocka_syscall_test.c b/testing/testsuites/kernel/syscall/cmocka_syscall_test.c new file mode 100644 index 00000000000..3fa4c101c9b --- /dev/null +++ b/testing/testsuites/kernel/syscall/cmocka_syscall_test.c @@ -0,0 +1,458 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/cmocka_syscall_test.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" +#include + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: cmocka_sched_test_main + ****************************************************************************/ + +int main(int argc, char *argv[]) +{ + /* Add Test Cases */ + + const struct CMUnitTest nuttx_syscall_test_suites[] = + { + /* cmocka_unit_test_setup_teardown(test_nuttx_syscall_bind01, + * test_nuttx_syscall_test_group_setup, + * test_nuttx_syscall_test_group_teardown), + */ + + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_chdir01, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_chdir02, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + + /* cmocka_unit_test_setup_teardown(test_nuttx_syscall_accept01, + * test_nuttx_syscall_test_group_setup, + * test_nuttx_syscall_test_group_teardown), + */ + + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_getitimer01, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_clockgettime01, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_clocknanosleep01, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_clocksettime01, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_close01, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_close02, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_close03, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_creat01, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_creat02, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + + /* cmocka_unit_test_setup_teardown(test_nuttx_syscall_fcntl01, + * NULL, NULL), + */ + + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_fcntl02, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_fcntl03, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_fcntl04, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + + /* cmocka_unit_test_setup_teardown(test_nuttx_syscall_fcntl05, NULL, + * NULL), + */ + +#ifndef CONFIG_ARCH_SIM + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_fcntl06, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), +#endif + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_fstatfs01, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_fsync01, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), +#ifdef CONFIG_NET + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_fsync02, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_fsync03, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_getpeername01, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_getsockopt01, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + + /* cmocka_unit_test_setup_teardown(test_nuttx_syscall_recvfromtest01, + * test_nuttx_syscall_test_group_setup, + * test_nuttx_syscall_test_group_teardown), + */ + + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_setsockopt01, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_listen01, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + + /* cmocka_unit_test_setup_teardown(test_nuttx_syscall_socketpair01, + * test_nuttx_syscall_test_group_setup, + * test_nuttx_syscall_test_group_teardown), + */ + +#ifdef CONFIG_NET_LOCAL_DGRAM + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_socketpair02, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), +#endif +#endif + + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_ftruncate01, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_getcwd01, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_getcwd02, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_getpid01, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_getppid01, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_gethostname01, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_gettimeofday01, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_lseek01, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_lseek07, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_lstat01, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_dup01, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_dup02, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_dup03, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_dup04, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_dup05, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_dup201, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_dup202, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_fpathconf01, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_getegid01, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_getegid02, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_geteuid01, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + + /* not implement + * cmocka_unit_test_setup_teardown(test_nuttx_syscall_geteuid02, + * estnuttxsyscalltestgroupsetup, + * test_nuttx_syscall_test_group_teardown), + */ + + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_getgid01, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_getgid02, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_getuid01, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + + /* not implement + * cmocka_unit_test_setup_teardown(test_nuttx_syscall_getuid02, + * test_nuttx_syscall_test_group_setup, + * test_nuttx_syscall_test_group_teardown), + */ + + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_pathconf01, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_pipe01, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_pipe02, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_pread01, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_pwrite01, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_pwrite02, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_rmdir01, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_rmdir02, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_truncate01, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_unlink01, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_nansleep01, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_nansleep02, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_time01, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_time02, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_timercreate01, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_timerdelete01, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_timergettime01, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_mkdir01, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_mkdir02, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_mkdir03, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_sched01, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_sched02, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_sched03, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_sched04, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_write01, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_write02, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_write03, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_read01, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_read02, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_read03, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_read04, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_symlink01, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_symlink02, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + + /* cmocka_unit_test_setup_teardown(test_nuttx_syscall_connect01, + * test_nuttx_syscall_test_group_setup, + * test_nuttx_syscall_test_group_teardown), + */ + +#if !defined(CONFIG_ARCH_SIM) && defined(CONFIG_NET_IPv4) + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_sockettest01, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), + cmocka_unit_test_setup_teardown( + test_nuttx_syscall_sockettest02, + test_nuttx_syscall_test_group_setup, + test_nuttx_syscall_test_group_teardown), +#endif + }; + + /* Run Test cases */ + + cmocka_run_group_tests(nuttx_syscall_test_suites, NULL, NULL); + return 0; +} diff --git a/testing/testsuites/kernel/syscall/common/test_syscall_common.c b/testing/testsuites/kernel/syscall/common/test_syscall_common.c new file mode 100644 index 00000000000..def66d1b6fe --- /dev/null +++ b/testing/testsuites/kernel/syscall/common/test_syscall_common.c @@ -0,0 +1,767 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/common/test_syscall_common.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SyscallTest.h" + +#define CM_SYSCALL_TESTDIR "CM_syscall_testdir" +#define PATH_SIZE 128 + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +static int rm_recursive(FAR char *path) +{ + struct dirent *d; + struct stat stat; + size_t len; + int ret; + DIR *dp; + + ret = lstat(path, &stat); + if (ret < 0) + { + return ret; + } + + if (!S_ISDIR(stat.st_mode)) + { + return unlink(path); + } + + dp = opendir(path); + if (dp == NULL) + { + return -1; + } + + len = strlen(path); + if (len > 0 && path[len - 1] == '/') + { + path[--len] = '\0'; + } + + while ((d = readdir(dp)) != NULL) + { + if (strcmp(d->d_name, ".") == 0 || strcmp(d->d_name, "..") == 0) + { + continue; + } + + snprintf(&path[len], PATH_MAX - len, "/%s", d->d_name); + ret = rm_recursive(path); + if (ret < 0) + { + closedir(dp); + return ret; + } + } + + ret = closedir(dp); + if (ret >= 0) + { + path[len] = '\0'; + ret = rmdir(path); + } + + return ret; +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_nuttx_syscall_testgroupsetup + ****************************************************************************/ + +int test_nuttx_syscall_test_group_setup(void **state) +{ + int res; + struct stat buf; + + res = chdir(MOUNT_DIR); + if (res != 0) + { + syslog(LOG_INFO, "ERROR: Failed to switch the mount dir\n"); + exit(1); + } + + res = stat(CM_SYSCALL_TESTDIR, &buf); + if (res == 0 && buf.st_mode == S_IFDIR) + { + res = chdir(CM_SYSCALL_TESTDIR); + return res; + } + + else + { + char testdir[PATH_MAX] = + { + 0 + }; + + sprintf(testdir, "%s/%s", MOUNT_DIR, CM_SYSCALL_TESTDIR); + + /* Delete the existing test directory */ + + rm_recursive(testdir); + res = mkdir(CM_SYSCALL_TESTDIR, 0777); + if (res != 0) + { + syslog(LOG_ERR, "ERROR: Failed to creat the test directory\n"); + exit(1); + } + + res = chdir(CM_SYSCALL_TESTDIR); + } + + return res; +} + +/**************************************************************************** + * Name: test_nuttx_syscall_test_group_teardown + ****************************************************************************/ + +int test_nuttx_syscall_test_group_teardown(void **state) +{ + int res; + char testdir[PATH_MAX] = + { + 0 + }; + + sprintf(testdir, "%s", CM_SYSCALL_TESTDIR); + + res = chdir(MOUNT_DIR); + if (res != 0) + { + syslog(LOG_INFO, "ERROR: Failed to switch the mount dir\n"); + exit(1); + } + + /* call the recursive delete interface */ + + rm_recursive(testdir); + + return 0; +} + +/**************************************************************************** + * Name: cmtestfillfilewithfd + ****************************************************************************/ + +static int cmtestfillfilewithfd(int fd, char pattern, size_t bs, + size_t bcount) +{ + size_t i; + char *buf; + + /* Filling a memory buffer with provided pattern */ + + buf = (char *)malloc(bs); + if (buf == NULL) + return -1; + + for (i = 0; i < bs; i++) + buf[i] = pattern; + + /* Filling the file */ + + for (i = 0; i < bcount; i++) + { + if (write(fd, buf, bs) != (ssize_t)bs) + { + free(buf); + return -1; + } + } + + free(buf); + + return 0; +} + +/**************************************************************************** + * Name: cmtestfillfile + ****************************************************************************/ + +int cmtestfillfile(const char *path, char pattern, size_t bs, + size_t bcount) +{ + int fd; + + fd = open(path, O_CREAT | O_WRONLY | O_TRUNC, S_IRUSR | S_IWUSR); + if (fd < 0) + return -1; + + if (cmtestfillfilewithfd(fd, pattern, bs, bcount)) + { + close(fd); + unlink(path); + return -1; + } + + if (close(fd) < 0) + { + unlink(path); + + return -1; + } + + return 0; +} + +/**************************************************************************** + * Name: checknames + ****************************************************************************/ + +int checknames(char *pfilnames, DIR *ddir) +{ + struct dirent *dir; + while ((dir = readdir(ddir)) != NULL) + { + /* cout << "file name=" << dir->d_name << endl; */ + + if (strcmp(pfilnames, dir->d_name) == 0) + return 0; + } + + return -1; +} + +/**************************************************************************** + * Name: check_and_report_ftruncatetest + ****************************************************************************/ + +int check_and_report_ftruncatetest(int fd, off_t offset, char data, + off_t trunc_len) +{ + int i; + int file_length; + char buf[1024]; + struct stat stat_buf; + + memset(buf, '*', sizeof(buf)); + + fstat(fd, &stat_buf); + file_length = stat_buf.st_size; + + if (file_length != trunc_len) + { + syslog(LOG_ERR, "FAIL, ftruncate() got incorrected size: %d\n", + file_length); + return -1; + } + + lseek(fd, offset, SEEK_SET); + read(fd, buf, sizeof(buf)); + + for (i = 0; i < 256; i++) + { + if (buf[i] != data) + { + syslog( + LOG_ERR, + "FAIL, ftruncate() got incorrect data %i, expected %i\n", + buf[i], data); + return -1; + } + } + + return 0; +} + +/**************************************************************************** + * Name: tst_fill_fd + ****************************************************************************/ + +int tst_fill_fd(int fd, char pattern, size_t bs, size_t bcount) +{ + size_t i; + char *buf; + + /* Filling a memory buffer with provided pattern */ + + buf = (char *)malloc(bs); + if (buf == NULL) + return -1; + + for (i = 0; i < bs; i++) + buf[i] = pattern; + + /* Filling the file */ + + for (i = 0; i < bcount; i++) + { + if (write(fd, buf, bs) != (ssize_t)bs) + { + free(buf); + return -1; + } + } + + free(buf); + + return 0; +} + +/**************************************************************************** + * Name: tst_fill_file + ****************************************************************************/ + +int tst_fill_file(const char *path, char pattern, size_t bs, + size_t bcount) +{ + int fd; + + fd = open(path, O_CREAT | O_WRONLY | O_TRUNC, S_IRUSR | S_IWUSR); + if (fd < 0) + return -1; + + if (tst_fill_fd(fd, pattern, bs, bcount)) + { + close(fd); + unlink(path); + return -1; + } + + if (close(fd) < 0) + { + unlink(path); + + return -1; + } + + return 0; +} + +/**************************************************************************** + * Name: safe_open + ****************************************************************************/ + +int safe_open(const char *pathname, int oflags, ...) +{ + va_list ap; + int rval; + mode_t mode; + + va_start(ap, oflags); + mode = va_arg(ap, int); + va_end(ap); + + rval = open(pathname, oflags, mode); + if (rval == -1) + { + syslog(LOG_ERR, "open(%s,%d,0%o) failed\n", pathname, oflags, + mode); + fail_msg("test fail !"); + } + + return rval; +} + +/**************************************************************************** + * Name: safe_write + ****************************************************************************/ + +ssize_t safe_write(int fildes, const void *buf, size_t nbyte) +{ + ssize_t rval; + + rval = write(fildes, buf, nbyte); + if (rval == -1 || ((size_t)rval != nbyte)) + { + syslog(LOG_ERR, "write(%d,%p,%zu) failed\n", fildes, buf, rval); + } + + return rval; +} + +/**************************************************************************** + * Name: safe_lseek + ****************************************************************************/ + +off_t safe_lseek(int fd, off_t offset, int whence) +{ + off_t rval; + + rval = lseek(fd, offset, whence); + + if (rval == (off_t)-1) + { + syslog(LOG_ERR, "lseek(%d, %ld, %d) failed\n", fd, + (long int)offset, whence); + } + + return rval; +} + +/**************************************************************************** + * Name: safe_close + ****************************************************************************/ + +int safe_close(int fildes) +{ + int rval; + + rval = close(fildes); + if (rval == -1) + { + syslog(LOG_ERR, "close(%d) failed, errno %d\n", fildes, errno); + fail_msg("test fail !"); + } + + return rval; +} + +/**************************************************************************** + * Function Name: safe_touch + * + * Description: + * This Function is used to touch a file. + * + * Input Parameters: + * file + * lineno + * pathname - name of the file to be created + * mode - mode + ****************************************************************************/ + +void safe_touch(const char *file, const int lineno, const char *pathname, + mode_t mode) +{ + int ret; + + /* Open the file */ + + ret = open(pathname, O_CREAT | O_WRONLY, mode); + + /* Open file fail */ + + if (ret == -1) + { + syslog(LOG_ERR, "Failed to open file '%s' at %s:%d \n", pathname, + file, lineno); + return; + } + + /* Close the file */ + + ret = close(ret); + + /* Close file fail */ + + if (ret == -1) + { + syslog(LOG_ERR, "Failed to close file '%s' at %s:%d \n", pathname, + file, lineno); + return; + } +} + +#ifdef CONFIG_NET + +/**************************************************************************** + * Name: sock_addr + ****************************************************************************/ + +char *sock_addr(const struct sockaddr *sa, socklen_t salen, char *res, + size_t len) +{ + char portstr[8]; + + switch (sa->sa_family) + { + case AF_INET: + { + struct sockaddr_in *sin = (struct sockaddr_in *)sa; + + if (!inet_ntop(AF_INET, &sin->sin_addr, res, len)) + return NULL; + + if (ntohs(sin->sin_port) != 0) + { + snprintf(portstr, sizeof(portstr), ":%d", + ntohs(sin->sin_port)); + strcat(res, portstr); + } + + return res; + } + + case AF_INET6: + { + struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa; + + res[0] = '['; + if (!inet_ntop(AF_INET6, &sin6->sin6_addr, res + 1, len - 1)) + return NULL; + + if (ntohs(sin6->sin6_port) != 0) + { + snprintf(portstr, sizeof(portstr), "]:%d", + ntohs(sin6->sin6_port)); + strcat(res, portstr); + return res; + } + + return res + 1; + } + + case AF_UNIX: + { + struct sockaddr_un *unp = (struct sockaddr_un *)sa; + + if (unp->sun_path[0] == '\0') + strcpy(res, "(no pathname bound)"); + else + snprintf(res, len, "%s", unp->sun_path); + + return res; + } + + default: + { + snprintf(res, len, "sock_ntop: unknown AF_xxx: %d, len: %d\n", + sa->sa_family, salen); + + return res; + } + } +} + +/**************************************************************************** + * Name: get_unused_port + * * + * Description: + * return port in network byte order. + ****************************************************************************/ + +unsigned short get_unused_port(void(cleanup_fn)(void), + unsigned short family, int type) +{ + int sock; + socklen_t slen; + struct sockaddr_storage _addr; + struct sockaddr *addr = (struct sockaddr *)&_addr; + struct sockaddr_in *addr4 = (struct sockaddr_in *)addr; + struct sockaddr_in6 *addr6 = (struct sockaddr_in6 *)addr; + + switch (family) + { + case AF_INET: + addr4->sin_family = AF_INET; + addr4->sin_port = 0; + addr4->sin_addr.s_addr = INADDR_ANY; + slen = sizeof(*addr4); + break; + + case AF_INET6: + addr6->sin6_family = AF_INET6; + addr6->sin6_port = 0; + addr6->sin6_addr = in6addr_any; + slen = sizeof(*addr6); + break; + + default: + syslog(LOG_ERR, "nknown family\n"); + fail_msg("test fail !"); + return -1; + } + + sock = socket(addr->sa_family, type, 0); + if (sock < 0) + { + syslog(LOG_ERR, "socket failed\n"); + fail_msg("test fail !"); + return -1; + } + + if (bind(sock, addr, slen) < 0) + { + syslog(LOG_ERR, "bind failed\n"); + fail_msg("test fail !"); + return -1; + } + + if (getsockname(sock, addr, &slen) == -1) + { + syslog(LOG_ERR, "getsockname failed\n"); + fail_msg("test fail !"); + return -1; + } + + if (close(sock) == -1) + { + syslog(LOG_ERR, "close failed\n"); + fail_msg("test fail !"); + return -1; + } + + switch (family) + { + case AF_INET: + return addr4->sin_port; + case AF_INET6: + return addr6->sin6_port; + default: + return -1; + } +} + +/**************************************************************************** + * Name: safe_socket + ****************************************************************************/ + +int safe_socket(int domain, int type, int protocol) +{ + int rval; + + rval = socket(domain, type, protocol); + + if (rval < 0) + { + syslog(LOG_ERR, "socket(%d, %d, %d) failed\n", domain, type, + protocol); + fail_msg("test fail !"); + } + + return rval; +} + +/**************************************************************************** + * Name: safe_connect + ****************************************************************************/ + +int safe_connect(int sockfd, const struct sockaddr *addr, + socklen_t addrlen) +{ + int rval; + char buf[128]; + + rval = connect(sockfd, addr, addrlen); + + if (rval < 0) + { + syslog(LOG_ERR, "connect(%d, %s, %d) failed, errno %d\n", sockfd, + sock_addr(addr, addrlen, buf, sizeof(buf)), addrlen, errno); + fail_msg("test fail !"); + } + + return rval; +} + +/**************************************************************************** + * Name: safe_getsockname + ****************************************************************************/ + +int safe_getsockname(int sockfd, struct sockaddr *addr, + socklen_t *addrlen) +{ + int rval; + char buf[128]; + + rval = getsockname(sockfd, addr, addrlen); + + if (rval < 0) + { + syslog(LOG_ERR, "getsockname(%d, %s, %d) failed\n", sockfd, + sock_addr(addr, *addrlen, buf, sizeof(buf)), *addrlen); + } + + return rval; +} + +/**************************************************************************** + * Name: safe_bind + ****************************************************************************/ + +int safe_bind(int socket, const struct sockaddr *address, + socklen_t address_len) +{ + int i; + char buf[128]; + + for (i = 0; i < 120; i++) + { + if (!bind(socket, address, address_len)) + return 0; + + if (errno != EADDRINUSE) + { + syslog(LOG_ERR, "bind(%d, %s, %d) failed\n", socket, + sock_addr(address, address_len, buf, sizeof(buf)), + address_len); + fail_msg("test fail !"); + return -1; + } + + if ((i + 1) % 10 == 0) + { + syslog(LOG_INFO, "address is in use, waited %3i sec\n", i + 1); + } + + sleep(1); + } + + syslog(LOG_ERR, "Failed to bind(%d, %s, %d) after 120 retries\n", + socket, sock_addr(address, address_len, buf, sizeof(buf)), + address_len); + fail_msg("test fail !"); + return -1; +} + +/**************************************************************************** + * Name: safe_listen + ****************************************************************************/ + +int safe_listen(int socket, int backlog) +{ + int rval; + + rval = listen(socket, backlog); + + if (rval < 0) + { + syslog(LOG_ERR, "listen(%d, %d) failed\n", socket, backlog); + } + + return rval; +} + +#endif \ No newline at end of file diff --git a/testing/testsuites/kernel/syscall/include/SyscallTest.h b/testing/testsuites/kernel/syscall/include/SyscallTest.h new file mode 100644 index 00000000000..786aea21a1d --- /dev/null +++ b/testing/testsuites/kernel/syscall/include/SyscallTest.h @@ -0,0 +1,457 @@ +/**************************************************************************** + * apps/testing/testsuites/kernel/syscall/include/SyscallTest.h + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ + +#ifndef __SYSCALLTEST_H +#define __SYSCALLTEST_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* Functions to help test */ + +int checknames(char *pfilnames, DIR *ddir); +int check_and_report_ftruncatetest(int fd, off_t offset, char data, + off_t trunc_len); +int tst_fill_file(const char *path, char pattern, size_t bs, + size_t bcount); + +char *sock_addr(const struct sockaddr *sa, socklen_t salen, char *res, + size_t len); + +/* @return port in network byte order. + */ + +unsigned short get_unused_port(void(cleanup_fn)(void), + unsigned short family, int type); + +int safe_close(int fildes); + +int safe_socket(int domain, int type, int protocol); + +int safe_connect(int sockfd, const struct sockaddr *addr, + socklen_t addrlen); + +int safe_getsockname(int sockfd, struct sockaddr *addr, + socklen_t *addrlen); + +int safe_bind(int socket, const struct sockaddr *address, + socklen_t address_len); + +int safe_listen(int socket, int backlog); + +int safe_open(const char *pathname, int oflags, ...); + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* The test files generated during the 'syscall-test' are stored in this + * directory + */ + +#define SYSCALL_TEST_DIR "syscall_test_dir" + +#define MOUNT_DIR CONFIG_TESTS_TESTSUITES_MOUNT_DIR + +#define SAFE_OPEN(pathname, oflags, ...) \ + safe_open((pathname), (oflags), ##__VA_ARGS__) + +#define SAFE_FCNTL(fd, cmd, ...) \ + ({ \ + int tst_ret_ = fcntl(fd, cmd, ##__VA_ARGS__); \ + if (tst_ret_ == -1) \ + { \ + syslog(LOG_ERR, "fcntl(%i,%s,...) failed", fd, #cmd); \ + fail_msg("test fail !"); \ + } \ + tst_ret_ == -1 ? 0 : tst_ret_; \ + }) + +#define SAFE_CLOSE(fd) \ + do \ + { \ + safe_close((fd)); \ + fd = -1; \ + } while (0) + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +/* quickly fill a test file */ + +int cmtestfillfile(const char *path, char pattern, size_t bs, + size_t bcount); + +/* setup function */ + +int test_nuttx_syscall_test_group_setup(void **state); + +/* teardown function */ + +int test_nuttx_syscall_test_group_teardown(void **state); + +/* tools */ + +int checknames(char *pfilnames, DIR *ddir); +int check_and_report_ftruncatetest(int fd, off_t offset, char data, + off_t trunc_len); +int tst_fill_fd(int fd, char pattern, size_t bs, size_t bcount); +int tst_fill_file(const char *path, char pattern, size_t bs, + size_t bcount); +int safe_open(const char *pathname, int oflags, ...); +ssize_t safe_write(int fildes, const void *buf, size_t nbyte); +off_t safe_lseek(int fd, off_t offset, int whence); +int safe_close(int fildes); +void safe_touch(const char *file, const int lineno, const char *pathname, + mode_t mode); +#ifdef CONFIG_NET +char *sock_addr(const struct sockaddr *sa, socklen_t salen, char *res, + size_t len); +unsigned short get_unused_port(void(cleanup_fn)(void), + unsigned short family, int type); +int safe_socket(int domain, int type, int protocol); +int safe_connect(int sockfd, const struct sockaddr *addr, + socklen_t addrlen); +int safe_getsockname(int sockfd, struct sockaddr *addr, + socklen_t *addrlen); +int safe_bind(int socket, const struct sockaddr *address, + socklen_t address_len); +int safe_listen(int socket, int backlog); +#endif + +/* test case function */ + +/* cases/chdir_test.c + * ***********************************************/ + +void test_nuttx_syscall_chdir01(FAR void **state); +void test_nuttx_syscall_chdir02(FAR void **state); + +/* cases/accept_test.c + * ***********************************************/ + +void test_nuttx_syscall_accept01(FAR void **state); + +/* cases/getitimer_test.c + * ***********************************************/ + +void test_nuttx_syscall_getitimer01(FAR void **state); + +/* cases/clock_gettime_test.c + * ****************************************/ + +void test_nuttx_syscall_clockgettime01(FAR void **state); + +/* cases/clock_nanosleep_test.c + * **************************************/ + +void test_nuttx_syscall_clocknanosleep01(FAR void **state); +void test_nuttx_syscall_clocknanosleep02(FAR void **state); + +/* cases/clock_settime_test.c + * ****************************************/ + +void test_nuttx_syscall_clocksettime01(FAR void **state); + +/* cases/close_test.c + * ************************************************/ + +void test_nuttx_syscall_close01(FAR void **state); +void test_nuttx_syscall_close02(FAR void **state); +void test_nuttx_syscall_close03(FAR void **state); + +/* cases/creat_test.c + * ************************************************/ + +void test_nuttx_syscall_creat01(FAR void **state); +void test_nuttx_syscall_creat02(FAR void **state); + +/* cases/fcntl_test.c + * ************************************************/ + +void test_nuttx_syscall_fcntl01(FAR void **state); +void test_nuttx_syscall_fcntl02(FAR void **state); +void test_nuttx_syscall_fcntl03(FAR void **state); +void test_nuttx_syscall_fcntl04(FAR void **state); +void test_nuttx_syscall_fcntl05(FAR void **state); +void test_nuttx_syscall_fcntl06(FAR void **state); + +/* cases/fsatfs_test.c + * ***********************************************/ + +void test_nuttx_syscall_fstatfs01(FAR void **state); + +/* cases/fsync_test.c + * ************************************************/ + +void test_nuttx_syscall_fsync01(FAR void **state); +void test_nuttx_syscall_fsync02(FAR void **state); +void test_nuttx_syscall_fsync03(FAR void **state); + +/* cases/ftruncate_test.c + * ********************************************/ + +void test_nuttx_syscall_ftruncate01(FAR void **state); + +/* cases/getcwd_test.c + * ***********************************************/ + +void test_nuttx_syscall_getcwd01(FAR void **state); +void test_nuttx_syscall_getcwd02(FAR void **state); + +/* cases/getpid_test.c + * ***********************************************/ + +void test_nuttx_syscall_getpid01(FAR void **state); + +/* cases/getppid_test.c + * **********************************************/ + +void test_nuttx_syscall_getppid01(FAR void **state); + +/* cases/gethostname_test.c + * ******************************************/ + +void test_nuttx_syscall_gethostname01(FAR void **state); + +/* cases/getTimeofday_test.c + * *****************************************/ + +void test_nuttx_syscall_gettimeofday01(FAR void **state); + +/* cases/lseek_test.c + * ************************************************/ + +void test_nuttx_syscall_lseek01(FAR void **state); +void test_nuttx_syscall_lseek07(FAR void **state); + +/* cases/lstat_test.c + * ************************************************/ + +void test_nuttx_syscall_lstat01(FAR void **state); + +/* cases/dup_test.c + * **************************************************/ + +void test_nuttx_syscall_dup01(FAR void **state); +void test_nuttx_syscall_dup02(FAR void **state); +void test_nuttx_syscall_dup03(FAR void **state); +void test_nuttx_syscall_dup04(FAR void **state); +void test_nuttx_syscall_dup05(FAR void **state); + +/* cases/dup2_test.c + * **************************************************/ + +void test_nuttx_syscall_dup201(FAR void **state); +void test_nuttx_syscall_dup202(FAR void **state); + +/* cases/fpathconf_test.c + * *********************************************/ + +void test_nuttx_syscall_fpathconf01(FAR void **state); + +/* cases/getegid_test.c + * ***********************************************/ + +void test_nuttx_syscall_getegid01(FAR void **state); +void test_nuttx_syscall_getegid02(FAR void **state); + +/* cases/geteuid_test.c + * ***********************************************/ + +void test_nuttx_syscall_geteuid01(FAR void **state); +void test_nuttx_syscall_geteuid02(FAR void **state); + +/* cases/getgid_test.c + * ***********************************************/ + +void test_nuttx_syscall_getgid01(FAR void **state); +void test_nuttx_syscall_getgid02(FAR void **state); + +/* cases/getuid_test.c + * ***********************************************/ + +void test_nuttx_syscall_getuid01(FAR void **state); +void test_nuttx_syscall_getuid02(FAR void **state); + +/* cases/pathconf_test.c + * *********************************************/ + +void test_nuttx_syscall_pathconf01(FAR void **state); + +/* cases/pipe_test.c + * *************************************************/ + +void test_nuttx_syscall_pipe01(FAR void **state); +void test_nuttx_syscall_pipe02(FAR void **state); + +/* cases/pread_test.c + * ************************************************/ + +void test_nuttx_syscall_pread01(FAR void **state); + +/* cases/pwrite_test.c + * ***********************************************/ + +void test_nuttx_syscall_pwrite01(FAR void **state); +void test_nuttx_syscall_pwrite02(FAR void **state); + +/* cases/rmdir_test.c + * ************************************************/ + +void test_nuttx_syscall_rmdir01(FAR void **state); +void test_nuttx_syscall_rmdir02(FAR void **state); + +/* ases/syscall_truncate_test.c + * **********************************************/ + +void test_nuttx_syscall_truncate01(FAR void **state); + +/* cases/unlink_test.c + * ***********************************************/ + +void test_nuttx_syscall_unlink01(FAR void **state); + +/* cases/nansleep_test.c + * *********************************************/ + +void test_nuttx_syscall_nansleep01(FAR void **state); +void test_nuttx_syscall_nansleep02(FAR void **state); + +/* cases/time_test.c + * *************************************************/ + +void test_nuttx_syscall_time01(FAR void **state); +void test_nuttx_syscall_time02(FAR void **state); + +/* cases/timer_create_test.c + * *****************************************/ + +void test_nuttx_syscall_timercreate01(FAR void **state); + +/* cases/timer_delete_test.c + * *****************************************/ + +void test_nuttx_syscall_timerdelete01(FAR void **state); + +/* cases/timer_gettime_test.c + * ****************************************/ + +void test_nuttx_syscall_timergettime01(FAR void **state); + +/* cases/mkdir_test.c + * ************************************************/ + +void test_nuttx_syscall_mkdir01(FAR void **state); +void test_nuttx_syscall_mkdir02(FAR void **state); +void test_nuttx_syscall_mkdir03(FAR void **state); + +/* cases/syscall_sched_test.c + * ***********************************************/ + +void test_nuttx_syscall_sched01(FAR void **state); +void test_nuttx_syscall_sched02(FAR void **state); +void test_nuttx_syscall_sched03(FAR void **state); +void test_nuttx_syscall_sched04(FAR void **state); + +/* cases/write_test.c + * ************************************************/ + +void test_nuttx_syscall_write01(FAR void **state); +void test_nuttx_syscall_write02(FAR void **state); +void test_nuttx_syscall_write03(FAR void **state); + +/* cases/read_test.c + * *************************************************/ + +void test_nuttx_syscall_read01(FAR void **state); +void test_nuttx_syscall_read02(FAR void **state); +void test_nuttx_syscall_read03(FAR void **state); +void test_nuttx_syscall_read04(FAR void **state); + +/* cases/symlink_test.c + * **********************************************/ + +void test_nuttx_syscall_symlink01(FAR void **state); +void test_nuttx_syscall_symlink02(FAR void **state); + +/* cases/socket_test.c + * **********************************************/ + +void test_nuttx_syscall_sockettest01(FAR void **state); +void test_nuttx_syscall_sockettest02(FAR void **state); + +/* cases/getpeername_test.c + * **********************************************/ + +void test_nuttx_syscall_connect01(FAR void **state); + +/* cases/getpeername_test.c + * **********************************************/ + +void test_nuttx_syscall_getpeername01(FAR void **state); + +/* cases/getsocketopt_test.c + * **********************************************/ + +void test_nuttx_syscall_getsockopt01(FAR void **state); + +/* cases/recvfrom_test.c + * **********************************************/ + +void test_nuttx_syscall_recvfromtest01(FAR void **state); + +/* cases/setsocketopt01_test.c + * **********************************************/ + +void test_nuttx_syscall_setsockopt01(FAR void **state); + +/* cases/listen_test.c + * **********************************************/ + +void test_nuttx_syscall_listen01(FAR void **state); + +/* cases/socketpair_test.c + * **********************************************/ + +void test_nuttx_syscall_socketpair01(FAR void **state); +void test_nuttx_syscall_socketpair02(FAR void **state); + +/* cases/bind_test.c + * **********************************************/ + +void test_nuttx_syscall_bind01(FAR void **state); + +#endif diff --git a/testing/testsuites/kernel/time/cases/clock_test_clock01.c b/testing/testsuites/kernel/time/cases/clock_test_clock01.c index e2570a6b72a..a0cedb89166 100644 --- a/testing/testsuites/kernel/time/cases/clock_test_clock01.c +++ b/testing/testsuites/kernel/time/cases/clock_test_clock01.c @@ -3,25 +3,24 @@ * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -65,9 +64,11 @@ void test_nuttx_clock_test_clock01(FAR void **state) assert_int_equal(ret, 0); syslog(LOG_INFO, "sleep 2 seconds\n"); - sleep(2); /* 2, seconds. */ + sleep(2); + + /* 2, use for testing clock setting */ - tp.tv_sec = oldtp.tv_sec + 2; /* 2, use for testing clock setting */ + tp.tv_sec = oldtp.tv_sec + 2; tp.tv_nsec = oldtp.tv_nsec; /* set real time */ @@ -83,15 +84,12 @@ void test_nuttx_clock_test_clock01(FAR void **state) ret = clock_gettime(clk, &tp); syslog(LOG_INFO, - "Obtaining the current time after setting:" - " sec = %lld, nsec = %ld\n", - (long long)tp.tv_sec, - tp.tv_nsec); - - /* 2, use for testing clock setting */ - - passflag = (tp.tv_sec >= 2 + oldtp.tv_sec) - && (tp.tv_sec <= 2 + oldtp.tv_sec + 1); + "Obtaining the current time after setting: sec = %lld, nsec = " + "%ld\n", + (long long)tp.tv_sec, tp.tv_nsec); + passflag = (tp.tv_sec >= 2 + oldtp.tv_sec) && + (tp.tv_sec <= + 2 + oldtp.tv_sec + 1); /* 2, use for testing clock setting */ assert_int_equal(ret, 0); assert_int_equal(passflag, 1); diff --git a/testing/testsuites/kernel/time/cases/clock_test_clock02.c b/testing/testsuites/kernel/time/cases/clock_test_clock02.c index c3b05ebba84..ebf35522723 100644 --- a/testing/testsuites/kernel/time/cases/clock_test_clock02.c +++ b/testing/testsuites/kernel/time/cases/clock_test_clock02.c @@ -3,25 +3,24 @@ * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include diff --git a/testing/testsuites/kernel/time/cases/clock_test_smoke.c b/testing/testsuites/kernel/time/cases/clock_test_smoke.c index 595c1a48c7f..7de690d7237 100644 --- a/testing/testsuites/kernel/time/cases/clock_test_smoke.c +++ b/testing/testsuites/kernel/time/cases/clock_test_smoke.c @@ -1,40 +1,26 @@ /**************************************************************************** * apps/testing/testsuites/kernel/time/cases/clock_test_smoke.c - * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * http://www.apache.org/licenses/LICENSE-2.0 * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. * - * 3. Neither the name of the copyright holder nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ + ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -59,24 +45,24 @@ void test_nuttx_clock_test_smoke01(FAR void **state) { clockid_t clk = CLOCK_REALTIME; - struct timespec res = { - 0, - 0, + struct timespec res = + { + 0, 0 }; - struct timespec setts = { - 0, - 0, + struct timespec setts = + { + 0, 0 }; - struct timespec oldtp = { - 0, - 0 + struct timespec oldtp = + { + 0, 0 }; - struct timespec ts = { - 0, - 0, + struct timespec ts = + { + 0, 0 }; int ret; @@ -90,7 +76,8 @@ void test_nuttx_clock_test_smoke01(FAR void **state) /* get clock realtime */ ret = clock_gettime(clk, &oldtp); - syslog(LOG_INFO, "the clock current time: %lld second, %ld nanosecond\n", + syslog(LOG_INFO, + "the clock current time: %lld second, %ld nanosecond\n", (long long)oldtp.tv_sec, oldtp.tv_nsec); assert_int_equal(ret, 0); @@ -98,21 +85,22 @@ void test_nuttx_clock_test_smoke01(FAR void **state) setts.tv_sec = oldtp.tv_sec + 1; setts.tv_nsec = oldtp.tv_nsec; - syslog(LOG_INFO, "the clock setting time: %lld second, %ld nanosecond\n", + syslog(LOG_INFO, + "the clock setting time: %lld second, %ld nanosecond\n", (long long)setts.tv_sec, setts.tv_nsec); ret = clock_settime(CLOCK_REALTIME, &setts); assert_int_equal(ret, 0); ret = clock_gettime(clk, &ts); syslog(LOG_INFO, - "obtaining the current time after " - "setting: %lld second, %ld nanosecond\n", - (long long)ts.tv_sec, - ts.tv_nsec); - - /* 1, means obtaining time's errno is 1 second. */ - - passflag = (ts.tv_sec >= setts.tv_sec) && (ts.tv_sec <= setts.tv_sec + 1); + "obtaining the current time after setting: %lld second, %ld " + "nanosecond\n", + (long long)ts.tv_sec, ts.tv_nsec); + + passflag = + (ts.tv_sec >= setts.tv_sec) && + (ts.tv_sec <= + setts.tv_sec + 1); /* 1, means obtaining time's errno is 1 second. */ assert_int_equal(ret, 0); assert_int_equal(passflag, 1); } diff --git a/testing/testsuites/kernel/time/cases/clock_test_timer01.c b/testing/testsuites/kernel/time/cases/clock_test_timer01.c index e2f1920b026..5146db37251 100644 --- a/testing/testsuites/kernel/time/cases/clock_test_timer01.c +++ b/testing/testsuites/kernel/time/cases/clock_test_timer01.c @@ -3,25 +3,24 @@ * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -49,21 +48,21 @@ * Private Data ****************************************************************************/ -static int test_timer01_g_sig_hdl_cnt = 0; +static int test_timer01_g_sighdlcnt = 0; /**************************************************************************** * Private Functions ****************************************************************************/ /**************************************************************************** - * Name: sig_handler01 + * Name: sighandler01 ****************************************************************************/ -static void sig_handler01(int sig) +static void sighandler01(int sig) { - test_timer01_g_sig_hdl_cnt++; - syslog(LOG_INFO, "signo = %d test_timer01_g_sig_hdl_cnt = %d\n", - sig, test_timer01_g_sig_hdl_cnt); + test_timer01_g_sighdlcnt++; + syslog(LOG_INFO, "signo = %d test_timer01_g_sighdlcnt = %d\n", sig, + test_timer01_g_sighdlcnt); } /**************************************************************************** @@ -86,7 +85,7 @@ void test_nuttx_clock_test_timer01(FAR void **state) int ret; sa.sa_flags = 0; - sa.sa_handler = sig_handler01; + sa.sa_handler = sighandler01; sigemptyset(&sa.sa_mask); ret = sigaction(SIG, &sa, NULL); syslog(LOG_INFO, "sigaction %d: %d", SIG, ret); @@ -141,7 +140,9 @@ void test_nuttx_clock_test_timer01(FAR void **state) syslog(LOG_INFO, "sleep %ds", interval); - /* timer signal is blocked, this sleep should not be interrupted */ + /* timer signal is blocked, + * this sleep should not be interrupted + */ sleep(interval); @@ -162,13 +163,13 @@ void test_nuttx_clock_test_timer01(FAR void **state) interval = 1; syslog(LOG_INFO, "sleep another %ds", interval); sleep(interval); /* this sleep may be interrupted by the timer */ - syslog(LOG_INFO, "sleep time over, test_timer01_g_sig_hdl_cnt = %d", - test_timer01_g_sig_hdl_cnt); + syslog(LOG_INFO, "sleep time over, test_timer01_g_sighdlcnt = %d", + test_timer01_g_sighdlcnt); syslog(LOG_INFO, "sleep another %ds", interval); sleep(interval); /* this sleep may be interrupted by the timer */ - syslog(LOG_INFO, "sleep time over, test_timer01_g_sig_hdl_cnt = %d", - test_timer01_g_sig_hdl_cnt); + syslog(LOG_INFO, "sleep time over, test_timer01_g_sighdlcnt = %d", + test_timer01_g_sighdlcnt); ret = timer_delete(timerid01); syslog(LOG_INFO, "timer_delete %p %d", timerid01, ret); @@ -178,5 +179,5 @@ void test_nuttx_clock_test_timer01(FAR void **state) syslog(LOG_INFO, "timer_delete %p %d", timerid02, ret); assert_int_equal(ret, 0); - assert_int_not_equal(test_timer01_g_sig_hdl_cnt, 0); + assert_int_not_equal(test_timer01_g_sighdlcnt, 0); } diff --git a/testing/testsuites/kernel/time/cases/clock_test_timer03.c b/testing/testsuites/kernel/time/cases/clock_test_timer03.c index c23093dd5b8..54228d4ecb4 100644 --- a/testing/testsuites/kernel/time/cases/clock_test_timer03.c +++ b/testing/testsuites/kernel/time/cases/clock_test_timer03.c @@ -3,25 +3,24 @@ * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -61,7 +60,7 @@ void test_nuttx_clock_test_timer03(FAR void **state) int failed = 0; timer_t timerid; sigset_t set; - sigset_t old_set; + sigset_t oldset; struct sigevent sev; ret = sigemptyset(&set); @@ -70,7 +69,7 @@ void test_nuttx_clock_test_timer03(FAR void **state) ret = sigaddset(&set, SIG); assert_int_equal(ret, 0); - ret = sigprocmask(SIG_BLOCK, &set, &old_set); + ret = sigprocmask(SIG_BLOCK, &set, &oldset); assert_int_equal(ret, 0); /* Create the timer */ @@ -82,24 +81,24 @@ void test_nuttx_clock_test_timer03(FAR void **state) syslog(LOG_INFO, "timer_create %p: %d", timerid, ret); assert_int_equal(ret, 0); - struct timespec testcases[] = { - {0, 30000000}, - {1, 0}, - {1, 5000}, - }; + struct timespec testcases[] = + { + {0, 30000000}, + {1, 0}, + {1, 5000}, + }; - struct timespec zero = { - 0, - 0, - }; + struct timespec zero = + { + 0, 0 + }; for (int i = 0; i < sizeof(testcases) / sizeof(testcases[0]); ++i) { struct timespec start; struct timespec end; struct itimerspec its; - int64_t expected; - int64_t escaped; + int64_t expected, escaped; its.it_interval = zero; its.it_value = testcases[i]; @@ -116,22 +115,21 @@ void test_nuttx_clock_test_timer03(FAR void **state) ret = clock_gettime(CLOCKID, &end); assert_int_equal(ret, 0); - expected = its.it_value.tv_sec * (int64_t)(1e9) + its.it_value.tv_nsec; + expected = + its.it_value.tv_sec * (int64_t)(1e9) + its.it_value.tv_nsec; escaped = end.tv_sec * (int64_t)(1e9) + end.tv_nsec - start.tv_sec * (int64_t)(1e9) - start.tv_nsec; - /* 20000000, 2 ticks. */ - - failed += (escaped < expected || (escaped - expected) >= 20000000); - syslog(LOG_INFO, - "expected = %" PRId64 " escaped = %" PRId64 " failed = %d", - expected, escaped, failed); + failed += (escaped < expected || + (escaped - expected) >= 20000000); /* 20000000, 2 ticks. */ + syslog(LOG_INFO, "expected = %" PRId64 " escaped = %" PRId64 + "failed = %d", expected, escaped, failed); } ret = timer_delete(timerid); assert_int_equal(ret, 0); - ret = sigprocmask(SIG_SETMASK, &old_set, NULL); + ret = sigprocmask(SIG_SETMASK, &oldset, NULL); assert_int_equal(ret, 0); assert_int_equal(failed, 0); diff --git a/testing/testsuites/kernel/time/cases/clock_test_timer04.c b/testing/testsuites/kernel/time/cases/clock_test_timer04.c index 972aa5c212e..a93202ea949 100644 --- a/testing/testsuites/kernel/time/cases/clock_test_timer04.c +++ b/testing/testsuites/kernel/time/cases/clock_test_timer04.c @@ -3,25 +3,24 @@ * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. * ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -43,8 +42,8 @@ * Pre-processor Definitions ****************************************************************************/ -/* signo should be in the range SIGRTMIN to - * SIGRTMAX when SA_SIGINFO flag is set. +/* signo should be in the range SIGRTMIN to SIGRTMAX when SA_SIGINFO flag + * is set. */ #define SIG SIGRTMIN @@ -54,17 +53,17 @@ * Private Data ****************************************************************************/ -static int test_timer04_g_handler_flag; +static int test_timer04_g_handlerflag; /**************************************************************************** * Private Functions ****************************************************************************/ /**************************************************************************** - * Name: sig_handler + * Name: sighandler ****************************************************************************/ -static void sig_handler(int sig, siginfo_t *si, void *uc) +static void sighandler(int sig, siginfo_t *si, void *uc) { if (si == NULL) { @@ -72,7 +71,7 @@ static void sig_handler(int sig, siginfo_t *si, void *uc) return; } - test_timer04_g_handler_flag++; + test_timer04_g_handlerflag++; syslog(LOG_INFO, "sig %d, si %p, uc %p\n", sig, si, uc); } @@ -97,7 +96,7 @@ void test_nuttx_clock_test_timer04(FAR void **state) /* Install handler for timer signal. */ sa.sa_flags = SA_SIGINFO; - sa.sa_sigaction = sig_handler; + sa.sa_sigaction = sighandler; sigemptyset(&sa.sa_mask); ret = sigaction(SIG, &sa, NULL); syslog(LOG_INFO, "sigaction %d: %d", SIG, ret); @@ -150,12 +149,12 @@ void test_nuttx_clock_test_timer04(FAR void **state) syslog(LOG_INFO, "sleep another %ds", interval); sleep(interval); /* should be interrupted */ - syslog(LOG_INFO, "sleep time over, g_handlerFlag = %d", - test_timer04_g_handler_flag); + syslog(LOG_INFO, "sleep time over, g_handlerflag = %d", + test_timer04_g_handlerflag); ret = timer_delete(timerid); syslog(LOG_INFO, "timer_delete %p %d", timerid, ret); assert_int_equal(ret, 0); - assert_int_not_equal(test_timer04_g_handler_flag, 0); + assert_int_not_equal(test_timer04_g_handlerflag, 0); } diff --git a/testing/testsuites/kernel/time/cases/clock_test_timer05.c b/testing/testsuites/kernel/time/cases/clock_test_timer05.c index 4c0528d3cff..a0754a26cff 100644 --- a/testing/testsuites/kernel/time/cases/clock_test_timer05.c +++ b/testing/testsuites/kernel/time/cases/clock_test_timer05.c @@ -1,40 +1,26 @@ /**************************************************************************** * apps/testing/testsuites/kernel/time/cases/clock_test_timer05.c - * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * http://www.apache.org/licenses/LICENSE-2.0 * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. * - * 3. Neither the name of the copyright holder nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ + ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -56,20 +42,20 @@ * Private Data ****************************************************************************/ -static int test_timer05_g_sig_hdl_cnt01; -static int test_timer05_g_sig_hdl_cnt02; +static int test_timer05_g_sighdlcnt01; +static int test_timer05_g_sighdlcnt02; /**************************************************************************** * Private Functions ****************************************************************************/ /**************************************************************************** - * Name: temp_sig_handler + * Name: tempsighandler ****************************************************************************/ -static void temp_sig_handler(union sigval v) +static void tempsighandler(union sigval v) { - syslog(LOG_INFO, "This is temp_sig_handler ...\r\n"); + syslog(LOG_INFO, "This is tempsighandler ...\r\n"); (*(void (*)(void))(v.sival_ptr))(); } @@ -78,12 +64,12 @@ static void temp_sig_handler(union sigval v) ****************************************************************************/ /**************************************************************************** - * Name: temp_sig_handler01 + * Name: tempsighandler01 ****************************************************************************/ -static void temp_sig_handler01(void) +static void tempsighandler01(void) { - test_timer05_g_sig_hdl_cnt01++; + test_timer05_g_sighdlcnt01++; } /**************************************************************************** @@ -91,12 +77,12 @@ static void temp_sig_handler01(void) ****************************************************************************/ /**************************************************************************** - * Name: temp_sig_handler02 + * Name: tempsighandler02 ****************************************************************************/ -static void temp_sig_handler02(void) +static void tempsighandler02(void) { - test_timer05_g_sig_hdl_cnt02++; + test_timer05_g_sighdlcnt02++; } /**************************************************************************** @@ -119,8 +105,8 @@ void test_nuttx_clock_test_timer05(FAR void **state) p = memset(&sev, 0, sizeof(struct sigevent)); assert_non_null(p); sev.sigev_notify = SIGEV_THREAD; - sev.sigev_notify_function = temp_sig_handler; - sev.sigev_value.sival_ptr = (void *)temp_sig_handler01; + sev.sigev_notify_function = tempsighandler; + sev.sigev_value.sival_ptr = (void *)tempsighandler01; /* Start the timer */ @@ -141,7 +127,7 @@ void test_nuttx_clock_test_timer05(FAR void **state) its.it_interval.tv_sec = its.it_value.tv_sec; its.it_interval.tv_nsec = its.it_value.tv_nsec; - sev.sigev_value.sival_ptr = (void *)temp_sig_handler02; + sev.sigev_value.sival_ptr = (void *)tempsighandler02; ret = timer_create(CLOCK_REALTIME, &sev, &timerid02); syslog(LOG_INFO, "timer_settime %p: %d", timerid02, ret); assert_int_equal(ret, 0); @@ -164,6 +150,6 @@ void test_nuttx_clock_test_timer05(FAR void **state) syslog(LOG_INFO, "timer_delete %p %d", timerid02, ret); assert_int_equal(ret, 0); - assert_int_not_equal(test_timer05_g_sig_hdl_cnt01, 0); - assert_int_not_equal(test_timer05_g_sig_hdl_cnt02, 0); + assert_int_not_equal(test_timer05_g_sighdlcnt01, 0); + assert_int_not_equal(test_timer05_g_sighdlcnt02, 0); } diff --git a/testing/testsuites/kernel/time/cmocka_time_test.c b/testing/testsuites/kernel/time/cmocka_time_test.c index f3fe1d06fd1..4d36dcd76f4 100644 --- a/testing/testsuites/kernel/time/cmocka_time_test.c +++ b/testing/testsuites/kernel/time/cmocka_time_test.c @@ -1,24 +1,26 @@ /**************************************************************************** * apps/testing/testsuites/kernel/time/cmocka_time_test.c - * Copyright (C) 2020 Xiaomi Corporation * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + *The ASF licenses this file to you under the Apache License, Version 2.0 + *(the "License"); you may not use this file except in compliance with + *the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ + *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + *implied. See the License for the specific language governing + *permissions and limitations under the License. + * + ****************************************************************************/ /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include @@ -29,18 +31,19 @@ #include /**************************************************************************** - * Public Functions + * Name: cmocka_time_test_main ****************************************************************************/ /**************************************************************************** - * Name: cmocka_time_test_main + * Private Functions ****************************************************************************/ int main(int argc, char *argv[]) { /* Add Test Cases */ - const struct CMUnitTest nuttx_time_testsuites[] = { + const struct CMUnitTest nuttx_time_test_suites[] = + { cmocka_unit_test(test_nuttx_clock_test_smoke01), cmocka_unit_test(test_nuttx_clock_test_timer01), cmocka_unit_test(test_nuttx_clock_test_timer03), @@ -52,6 +55,6 @@ int main(int argc, char *argv[]) /* Run Test cases */ - cmocka_run_group_tests(nuttx_time_testsuites, NULL, NULL); + cmocka_run_group_tests(nuttx_time_test_suites, NULL, NULL); return 0; } diff --git a/testing/testsuites/kernel/time/include/TimeTest.h b/testing/testsuites/kernel/time/include/TimeTest.h index 31d24d6f47e..79d25937589 100644 --- a/testing/testsuites/kernel/time/include/TimeTest.h +++ b/testing/testsuites/kernel/time/include/TimeTest.h @@ -1,43 +1,28 @@ /**************************************************************************** * apps/testing/testsuites/kernel/time/include/TimeTest.h - * Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved. - * Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. + * http://www.apache.org/licenses/LICENSE-2.0 * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * - * 3. Neither the name of the copyright holder nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ + ****************************************************************************/ #ifndef TIME_CLOCK_LT_CLOCK_TEST_H_ #define TIME_CLOCK_LT_CLOCK_TEST_H_ - /**************************************************************************** * Included Files ****************************************************************************/ - #include #include #include From d8faa9b18e4c77a6347dc357774f3f60da649b0d Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Wed, 18 Dec 2024 10:47:08 +0900 Subject: [PATCH 051/391] interpreters/luamodules/luv: use "depends on" instead of "select" --- interpreters/luamodules/luv/Kconfig | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/interpreters/luamodules/luv/Kconfig b/interpreters/luamodules/luv/Kconfig index 88b2bcb14f4..490f83adfc2 100644 --- a/interpreters/luamodules/luv/Kconfig +++ b/interpreters/luamodules/luv/Kconfig @@ -7,15 +7,15 @@ config LUA_LUV_MODULE bool "Lua Luv module" default n depends on INTERPRETERS_LUA && LIBUV - select LIBC_EXECFUNCS - select LIBC_NETDB - select NET - select NETDEV_IFINDEX - select NET_SOCKOPTS - select NET_TCP - select NET_UDP - select PSEUDOFS_SOFTLINKS - select SCHED_HAVE_PARENT + depends on LIBC_EXECFUNCS + depends on LIBC_NETDB + depends on NET + depends on NETDEV_IFINDEX + depends on NET_SOCKOPTS + depends on NET_TCP + depends on NET_UDP + depends on PSEUDOFS_SOFTLINKS + depends on SCHED_HAVE_PARENT ---help--- Bare libuv bindings for Lua From 3efbed1f27374a65b88a3715d549cf411c4bd386 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Tue, 17 Dec 2024 14:00:44 +0900 Subject: [PATCH 052/391] system/libuv/Kconfig: depends on CONFIG_PIPES libuv unconditionally uses pipe(). Fixes: https://github.com/apache/nuttx/issues/14773 --- system/libuv/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/system/libuv/Kconfig b/system/libuv/Kconfig index da6187a2ed2..6b2caf7eff9 100644 --- a/system/libuv/Kconfig +++ b/system/libuv/Kconfig @@ -6,6 +6,7 @@ config LIBUV bool "libuv asynchronous I/O Library" default n + depends on PIPES ---help--- Enable build for libuv asynchronous I/O Library From c4fa5684574f10fa1a8810145930e714724458a7 Mon Sep 17 00:00:00 2001 From: wangmingrong1 Date: Wed, 11 Dec 2024 21:18:36 +0800 Subject: [PATCH 053/391] gcov: Add a signature end statement to test statement matching Signed-off-by: wangmingrong1 --- system/gcov/gcov.c | 1 + 1 file changed, 1 insertion(+) diff --git a/system/gcov/gcov.c b/system/gcov/gcov.c index d96cf6f9ca1..1feec7d0a8a 100644 --- a/system/gcov/gcov.c +++ b/system/gcov/gcov.c @@ -200,5 +200,6 @@ int main(int argc, FAR char *argv[]) gcov_dump(path, strip); } + printf("Gcov dump complete\n"); return 0; } From 231827e84e300a8fccde12c5ee5404ba9ac7fc44 Mon Sep 17 00:00:00 2001 From: Tiago Medicci Date: Mon, 16 Dec 2024 15:28:55 -0300 Subject: [PATCH 054/391] ostest: Add test for GCC's tls (CONFIG_SCHED_THREAD_LOCAL) Enables testing the GCC thread local storage (tls) and the __thread keyword within ostest. --- testing/ostest/Makefile | 4 + testing/ostest/ostest.h | 4 + testing/ostest/ostest_main.c | 8 + testing/ostest/sched_thread_local.c | 230 ++++++++++++++++++++++++++++ 4 files changed, 246 insertions(+) create mode 100644 testing/ostest/sched_thread_local.c diff --git a/testing/ostest/Makefile b/testing/ostest/Makefile index fcd04665d5f..18fc1c19d80 100644 --- a/testing/ostest/Makefile +++ b/testing/ostest/Makefile @@ -58,6 +58,10 @@ ifneq ($(CONFIG_TLS_NELEM),0) CSRCS += tls.c endif +ifeq ($(CONFIG_SCHED_THREAD_LOCAL),y) +CSRCS += sched_thread_local.c +endif + ifeq ($(CONFIG_TESTING_OSTEST_AIO),y) CSRCS += aio.c endif diff --git a/testing/ostest/ostest.h b/testing/ostest/ostest.h index f369319c2f4..02ed90c7b16 100644 --- a/testing/ostest/ostest.h +++ b/testing/ostest/ostest.h @@ -234,6 +234,10 @@ void sporadic2_test(void); void tls_test(void); +/* sched_thread_local.c *****************************************************/ + +void sched_thread_local_test(void); + /* pthread_rwlock.c *********************************************************/ void pthread_rwlock_test(void); diff --git a/testing/ostest/ostest_main.c b/testing/ostest/ostest_main.c index c0f37dbc951..4a3902c8b55 100644 --- a/testing/ostest/ostest_main.c +++ b/testing/ostest/ostest_main.c @@ -313,6 +313,14 @@ static int user_main(int argc, char *argv[]) check_test_memory_usage(); #endif +#ifdef CONFIG_SCHED_THREAD_LOCAL + /* Test __thread/thread_local keyword */ + + printf("\nuser_main: sched_thread_local test\n"); + sched_thread_local_test(); + check_test_memory_usage(); +#endif + /* Top of test loop */ #if CONFIG_TESTING_OSTEST_LOOPS > 1 diff --git a/testing/ostest/sched_thread_local.c b/testing/ostest/sched_thread_local.c new file mode 100644 index 00000000000..d2fc08a3104 --- /dev/null +++ b/testing/ostest/sched_thread_local.c @@ -0,0 +1,230 @@ +/**************************************************************************** + * apps/testing/ostest/sched_thread_local.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include + +#include +#include +#include +#include +#include + +#include "ostest.h" + +#ifdef CONFIG_SCHED_THREAD_LOCAL + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#define INIT_VALUE 6 +#define TEST_THREADS 3 + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +__thread short g_tls_short = INIT_VALUE; +__thread int g_tls_int = INIT_VALUE; +__thread long long g_tls_lld = -INIT_VALUE; + +long long g_tls_variables[TEST_THREADS][3]; + +static pthread_barrier_t g_barrier; + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +static void *thread_func(void *parameter) +{ + int id = (int)((intptr_t)parameter); + short value_short = g_tls_short; + int value_int = g_tls_int; + long long value_lld = g_tls_lld; + int status; + + /* Wait at the g_barrier until all threads are synchronized. */ + + status = pthread_barrier_wait(&g_barrier); + if (status != 0 && status != PTHREAD_BARRIER_SERIAL_THREAD) + { + printf("sched_thread_local_test: ERROR thread %d pthread_barrier_wait " + "failed\n", id); + ASSERT(false); + } + + printf("thread_func[%d]: Thread Started\n", id); + + printf("thread_func[%d]: g_tls_short (at 0x%p) initial value = %d\n", + id, &g_tls_short, value_short); + printf("thread_func[%d]: g_tls_int (at 0x%p) initial value = %d\n", + id, &g_tls_int, value_int); + printf("thread_func[%d]: g_tls_lld (at 0x%p) initial value = %lld\n", + id, &g_tls_lld, value_lld); + + if (value_short != INIT_VALUE) + { + printf("thread_func[%d]: " + "ERROR value_short value for this thread is different than the " + "expected initial value (%d): %d\n", + id, INIT_VALUE, value_short); + ASSERT(false); + } + + if (value_int != INIT_VALUE) + { + printf("thread_func[%d]: " + "ERROR value_int value for this thread is different than the " + "expected initial value (%d): %d\n", + id, INIT_VALUE, value_int); + ASSERT(false); + } + + if (value_lld != -INIT_VALUE) + { + printf("thread_func[%d]: " + "ERROR value_lld value for this thread is different than the " + "expected initial value (%d): %lld\n", + id, -INIT_VALUE, value_lld); + ASSERT(false); + } + + printf("thread_func[%d]: setting value_short (at 0x%p) to %d\n", + id, &g_tls_short, value_short + id); + + g_tls_short = value_short + id; + g_tls_variables[id][0] = g_tls_short; + + printf("thread_func[%d]: setting value_int (at 0x%p) to %d\n", + id, &g_tls_int, value_int + id); + + g_tls_int = value_int + id; + g_tls_variables[id][1] = g_tls_int; + + printf("thread_func[%d]: setting value_lld (at 0x%p) to %lld\n", + id, &g_tls_lld, value_lld - id); + + g_tls_lld = value_lld - id; + g_tls_variables[id][2] = g_tls_lld; + + printf("thread_func[%d]: Thread done\n", id); + return NULL; +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +void sched_thread_local_test(void) +{ + pthread_t thread[TEST_THREADS] = + { + 0 + }; + + int i; + int status; + + printf("sched_thread_local_test: g_tls_int value is: %d\n", g_tls_int); + + /* Create the g_barrier */ + + status = pthread_barrier_init(&g_barrier, NULL, TEST_THREADS); + if (status != OK) + { + printf("sched_thread_local_test: pthread_barrier_init failed, " + "status=%d\n", status); + } + + for (i = 0; i < TEST_THREADS; i++) + { + /* Start three thread instances */ + + printf("sched_thread_local_test: Starting waiter thread %d\n", i); + + status = pthread_create(&thread[i], NULL, + thread_func, (pthread_addr_t)(intptr_t)i); + if (status != 0) + { + printf("sched_thread_local_test: ERROR: " + "Thread %d creation failed: %d\n", i, status); + ASSERT(false); + } + } + + for (i = 0; i < TEST_THREADS; i++) + { + if (thread[i] != (pthread_t)0) + { + pthread_join(thread[i], NULL); + } + } + + for (i = 0; i < TEST_THREADS; i++) + { + printf("sched_thread_local_test: " + "g_tls_variables[thread_%d][g_tls_short] = %lld\n", + i, g_tls_variables[i][0]); + if (g_tls_variables[i][0] != INIT_VALUE + i) + { + printf("sched_thread_local_test: ERROR: " + "g_tls_variables[thread_%d][g_tls_short] = %lld\n", + i, g_tls_variables[i][0]); + ASSERT(false); + } + + printf("sched_thread_local_test: " + "g_tls_variables[thread_%d][g_tls_int] = %lld\n", + i, g_tls_variables[i][1]); + if (g_tls_variables[i][1] != INIT_VALUE + i) + { + printf("sched_thread_local_test: ERROR: " + "g_tls_variables[thread_%d][g_tls_int] = %lld\n", + i, g_tls_variables[i][1]); + ASSERT(false); + } + + printf("sched_thread_local_test: " + "g_tls_variables[thread_%d][g_tls_lld] = %lld\n", + i, g_tls_variables[i][2]); + if (g_tls_variables[i][2] != -INIT_VALUE - i) + { + printf("sched_thread_local_test: ERROR: " + "g_tls_variables[thread_%d][g_tls_lld] = %lld\n", + i, g_tls_variables[i][2]); + ASSERT(false); + } + } + + status = pthread_barrier_destroy(&g_barrier); + if (status != OK) + { + printf("sched_thread_local_test: pthread_barrier_destroy failed, " + "status=%d\n", status); + } +} + +#endif /* CONFIG_SCHED_THREAD_LOCAL */ From d6f6f5ce1135d24b241e723a34d6f35ffdc90390 Mon Sep 17 00:00:00 2001 From: chao an Date: Thu, 19 Dec 2024 00:12:36 +0800 Subject: [PATCH 055/391] mlearning/tflite-micro: fix build break if enable cmsis-nn and neon Signed-off-by: chao an --- mlearning/tflite-micro/CMakeLists.txt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mlearning/tflite-micro/CMakeLists.txt b/mlearning/tflite-micro/CMakeLists.txt index eb5221ec4ef..0c072a88a07 100644 --- a/mlearning/tflite-micro/CMakeLists.txt +++ b/mlearning/tflite-micro/CMakeLists.txt @@ -136,10 +136,10 @@ if(CONFIG_TFLITEMICRO) list( APPEND TFLITE_MICRO_SRCS - ${TFLITE_MICRO_DIR}/operators/neon/arm_convolve_s8.c - ${TFLITE_MICRO_DIR}/operators/neon/arm_nn_mat_mult_kernel_s8_s16.c - ${TFLITE_MICRO_DIR}/operators/neon/arm_q7_to_q15_with_offset.c - ${TFLITE_MICRO_DIR}/operators/neon/arm_elementwise_add_s8.c) + ${CMAKE_CURRENT_LIST_DIR}/operators/neon/arm_convolve_s8.c + ${CMAKE_CURRENT_LIST_DIR}/operators/neon/arm_nn_mat_mult_kernel_s8_s16.c + ${CMAKE_CURRENT_LIST_DIR}/operators/neon/arm_q7_to_q15_with_offset.c + ${CMAKE_CURRENT_LIST_DIR}/operators/neon/arm_elementwise_add_s8.c) endif() endif() @@ -157,6 +157,7 @@ if(CONFIG_TFLITEMICRO) if(CONFIG_MLEARNING_CMSIS_NN) list(APPEND INCDIR ${NUTTX_APPS_DIR}/mlearning/cmsis-nn/cmsis-nn) + list(APPEND INCDIR ${NUTTX_APPS_DIR}/mlearning/cmsis-nn/cmsis-nn/Include) endif() # ############################################################################ From cebd77c61499b333d6a49b7f192192c171e7f87f Mon Sep 17 00:00:00 2001 From: zhangshoukui Date: Wed, 18 Dec 2024 10:26:26 +0800 Subject: [PATCH 056/391] fs cases: fix compile error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit kernel/fs/cases/fs_stream_test.c:279:70: error: format ‘%zi’ expects argument of type ‘signed size_t’, but argument 4 has type ‘int’ [-Werror=format=] 279 | syslog(LOG_ERR, "len = %zi != return value from fwrite = %zi", | ~~^ | | | long int | %i 280 | len, ret); | ~~~ | | | int kernel/fs/cases/fs_stream_test.c:311:69: error: format ‘%zi’ expects argument of type ‘signed size_t’, but argument 4 has type ‘int’ [-Werror=format=] 311 | syslog(LOG_ERR, "len = %zi != return value from fread = %zi", | ~~^ | | | long int | %i 312 | len, ret); | ~~~ | | | int Signed-off-by: zhangshoukui --- testing/testsuites/kernel/fs/cases/fs_stream_test.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/testing/testsuites/kernel/fs/cases/fs_stream_test.c b/testing/testsuites/kernel/fs/cases/fs_stream_test.c index 6074a7b6f89..2505668cbe7 100644 --- a/testing/testsuites/kernel/fs/cases/fs_stream_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_stream_test.c @@ -257,7 +257,7 @@ void test_nuttx_fs_stream03(FAR void **state) char *junk = "abcdefghijklmnopqrstuvwxyz"; size_t len = strlen(junk); char *inbuf = NULL; - int ret; + ssize_t ret; int lc; for (lc = 0; lc < 10; lc++) { @@ -274,9 +274,9 @@ void test_nuttx_fs_stream03(FAR void **state) assert_true(1 == 0); } - if ((size_t)ret != len) + if (ret != len) { - syslog(LOG_ERR, "len = %zu != return value from fwrite = %d", + syslog(LOG_ERR, "len = %zu != return value from fwrite = %zd", len, ret); fclose(stream); assert_true(1 == 0); @@ -306,9 +306,9 @@ void test_nuttx_fs_stream03(FAR void **state) assert_true(1 == 0); } - if ((size_t)ret != len) + if (ret != len) { - syslog(LOG_ERR, "len = %zu != return value from fread = %d", + syslog(LOG_ERR, "len = %zu != return value from fread = %zd", len, ret); free(inbuf); fclose(stream); From adb4c3b5556cd6512b99a2c355c1956323d3a281 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Thu, 19 Dec 2024 01:12:55 +0800 Subject: [PATCH 057/391] testing/testsuites: Fix format '%llu' expects argument of type 'long long unsigned int', but argument 3 has type 'size_t' Signed-off-by: Xiang Xiao --- testing/testsuites/kernel/fs/cases/fs_fsync_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testing/testsuites/kernel/fs/cases/fs_fsync_test.c b/testing/testsuites/kernel/fs/cases/fs_fsync_test.c index 2518da2b737..5ea5fbe7ee8 100644 --- a/testing/testsuites/kernel/fs/cases/fs_fsync_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_fsync_test.c @@ -137,8 +137,8 @@ void test_nuttx_fs_fsync02(FAR void **state) } #endif - syslog(LOG_INFO, "the fbsize = %"PRIu64",buffer size=%d\n", - statfsbuf.f_bsize, bufsize); + syslog(LOG_INFO, "the fbsize = %zu,buffer size=%d\n", + statfsbuf.f_bsize, bufsize); /* malloc memory */ From f1212a60656c51ffe68038aaf68f9111412230de Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Wed, 18 Dec 2024 17:26:03 +0800 Subject: [PATCH 058/391] nshlib/nsh_parse: Closing fds opened for redirection if necessary Coverity Log CID 1612743: (#1 of 1): Resource leak (RESOURCE_LEAK) 12. leaked_handle: The handle variable fd_out goes out of scope and leaks the handle. Signed-off-by: wangjianyu3 --- nshlib/nsh_parse.c | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/nshlib/nsh_parse.c b/nshlib/nsh_parse.c index 96de181e32c..e75b7937e86 100644 --- a/nshlib/nsh_parse.c +++ b/nshlib/nsh_parse.c @@ -500,6 +500,8 @@ static int nsh_execute(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char *argv[], FAR const struct nsh_param_s *param) { + int fd_out = STDOUT_FILENO; + int fd_in = STDIN_FILENO; int ret; /* DO NOT CHANGE THE ORDERING OF THE FOLLOWING STEPS @@ -635,9 +637,6 @@ static int nsh_execute(FAR struct nsh_vtbl_s *vtbl, { uint8_t save[SAVE_SIZE]; - int fd_in = STDIN_FILENO; - int fd_out = STDOUT_FILENO; - /* Redirected output? */ if (vtbl->np.np_redir_out) @@ -655,7 +654,8 @@ static int nsh_execute(FAR struct nsh_vtbl_s *vtbl, { nsh_error(vtbl, g_fmtcmdfailed, argv[0], "open", NSH_ERRNO); - return nsh_saveresult(vtbl, true); + ret = errno; + goto close_redir; } } else @@ -681,7 +681,8 @@ static int nsh_execute(FAR struct nsh_vtbl_s *vtbl, { nsh_error(vtbl, g_fmtcmdfailed, argv[0], "open", NSH_ERRNO); - return nsh_saveresult(vtbl, true); + ret = errno; + goto close_redir; } } else @@ -714,22 +715,27 @@ static int nsh_execute(FAR struct nsh_vtbl_s *vtbl, { nsh_undirect(vtbl, save); } + } - /* Mark errors so that it is possible to test for non-zero return - * values in nsh scripts. - */ +close_redir: - if (ret < 0) - { - return nsh_saveresult(vtbl, true); - } + /* Closing fds opened for redirection if necessary */ + + if (fd_out > STDOUT_FILENO) + { + close(fd_out); + } + + if (fd_in > STDIN_FILENO) + { + close(fd_in); } /* Return success if the command succeeded (or at least, starting of the * command task succeeded). */ - return nsh_saveresult(vtbl, false); + return nsh_saveresult(vtbl, ret != OK); } /**************************************************************************** From 39bd365787d2a3666173c3b6fcf129ccfdc3ad01 Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Wed, 18 Dec 2024 17:32:06 +0800 Subject: [PATCH 059/391] nshlib/nsh_parse: Removing unnecessary value assigning about redirection Coverity Log CID 1612757: (#1 of 1): UNUSED_VALUE assigned_value: The value -1 is assigned to param.fd_in here, but the stored value is overwritten before it can be used. Signed-off-by: wangjianyu3 --- nshlib/nsh_parse.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/nshlib/nsh_parse.c b/nshlib/nsh_parse.c index e75b7937e86..f6bff1b29c9 100644 --- a/nshlib/nsh_parse.c +++ b/nshlib/nsh_parse.c @@ -2739,16 +2739,12 @@ static int nsh_parse_command(FAR struct nsh_vtbl_s *vtbl, FAR char *cmdline) if (param.fd_in != -1) { close(param.fd_in); - param.fd_in = -1; vtbl->np.np_redir_in = redirect_in_save; } - if (param.fd_out != -1) - { - close(param.fd_out); - param.fd_out = -1; - vtbl->np.np_redir_out = redirect_out_save; - } + close(param.fd_out); + param.fd_out = -1; + vtbl->np.np_redir_out = redirect_out_save; redirect_in_save = vtbl->np.np_redir_in; vtbl->np.np_redir_in = true; From 7e9cf0237dcd31ba48d116e5b053fae25dfe7f99 Mon Sep 17 00:00:00 2001 From: Alin Jerpelea Date: Tue, 17 Dec 2024 07:27:52 +0100 Subject: [PATCH 060/391] audioutils: migrate to SPDX identifier Most tools used for compliance and SBOM generation use SPDX identifiers This change brings us a step closer to an easy SBOM generation. Signed-off-by: Alin Jerpelea --- audioutils/CMakeLists.txt | 2 ++ audioutils/Make.defs | 2 ++ audioutils/Makefile | 2 ++ audioutils/fmsynth/CMakeLists.txt | 2 ++ audioutils/fmsynth/Make.defs | 2 ++ audioutils/fmsynth/Makefile | 2 ++ audioutils/fmsynth/fmsynth.c | 2 ++ audioutils/fmsynth/fmsynth_eg.c | 2 ++ audioutils/fmsynth/fmsynth_op.c | 2 ++ audioutils/fmsynth/test/Makefile | 2 ++ audioutils/fmsynth/test/fmsynth_alsa_test.c | 2 ++ audioutils/fmsynth/test/fmsynth_eg_test.c | 2 ++ audioutils/fmsynth/test/fmsynth_op_test.c | 2 ++ audioutils/fmsynth/test/fmsynth_test.c | 2 ++ audioutils/fmsynth/test/opfunc_test.c | 2 ++ audioutils/lame/CMakeLists.txt | 2 ++ audioutils/lame/Make.defs | 2 ++ audioutils/lame/Makefile | 2 ++ audioutils/libmad/CMakeLists.txt | 2 ++ audioutils/libmad/Make.defs | 2 ++ audioutils/libmad/Makefile | 2 ++ audioutils/mml_parser/CMakeLists.txt | 2 ++ audioutils/mml_parser/Make.defs | 2 ++ audioutils/mml_parser/Makefile | 2 ++ audioutils/mml_parser/mml_parser.c | 2 ++ audioutils/nxaudio/CMakeLists.txt | 2 ++ audioutils/nxaudio/Make.defs | 2 ++ audioutils/nxaudio/Makefile | 2 ++ audioutils/nxaudio/nxaudio.c | 2 ++ 29 files changed, 58 insertions(+) diff --git a/audioutils/CMakeLists.txt b/audioutils/CMakeLists.txt index 2342e72200a..06428bfbbf5 100644 --- a/audioutils/CMakeLists.txt +++ b/audioutils/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/audioutils/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/audioutils/Make.defs b/audioutils/Make.defs index 67f1a303378..c6130229751 100644 --- a/audioutils/Make.defs +++ b/audioutils/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/audioutils/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/audioutils/Makefile b/audioutils/Makefile index 7b4abe0e9f9..698b58c20ae 100644 --- a/audioutils/Makefile +++ b/audioutils/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/audioutils/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/audioutils/fmsynth/CMakeLists.txt b/audioutils/fmsynth/CMakeLists.txt index be63c3afb46..839793f3e53 100644 --- a/audioutils/fmsynth/CMakeLists.txt +++ b/audioutils/fmsynth/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/audioutils/fmsynth/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/audioutils/fmsynth/Make.defs b/audioutils/fmsynth/Make.defs index 55226287fe6..e53b368875a 100644 --- a/audioutils/fmsynth/Make.defs +++ b/audioutils/fmsynth/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/audioutils/fmsynth/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/audioutils/fmsynth/Makefile b/audioutils/fmsynth/Makefile index f291a74b12d..2ce05433181 100644 --- a/audioutils/fmsynth/Makefile +++ b/audioutils/fmsynth/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/audioutils/fmsynth/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/audioutils/fmsynth/fmsynth.c b/audioutils/fmsynth/fmsynth.c index 21b43bcf0eb..883ad4680b4 100644 --- a/audioutils/fmsynth/fmsynth.c +++ b/audioutils/fmsynth/fmsynth.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/audioutils/fmsynth/fmsynth.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/audioutils/fmsynth/fmsynth_eg.c b/audioutils/fmsynth/fmsynth_eg.c index a2b97adedd7..849e35a5d08 100644 --- a/audioutils/fmsynth/fmsynth_eg.c +++ b/audioutils/fmsynth/fmsynth_eg.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/audioutils/fmsynth/fmsynth_eg.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/audioutils/fmsynth/fmsynth_op.c b/audioutils/fmsynth/fmsynth_op.c index bb07f12f745..a86e7402e30 100644 --- a/audioutils/fmsynth/fmsynth_op.c +++ b/audioutils/fmsynth/fmsynth_op.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/audioutils/fmsynth/fmsynth_op.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/audioutils/fmsynth/test/Makefile b/audioutils/fmsynth/test/Makefile index 65bdf923d0e..74118d9189e 100644 --- a/audioutils/fmsynth/test/Makefile +++ b/audioutils/fmsynth/test/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/audioutils/fmsynth/test/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/audioutils/fmsynth/test/fmsynth_alsa_test.c b/audioutils/fmsynth/test/fmsynth_alsa_test.c index 73e0b22dc26..4644ce1b022 100644 --- a/audioutils/fmsynth/test/fmsynth_alsa_test.c +++ b/audioutils/fmsynth/test/fmsynth_alsa_test.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/audioutils/fmsynth/test/fmsynth_alsa_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/audioutils/fmsynth/test/fmsynth_eg_test.c b/audioutils/fmsynth/test/fmsynth_eg_test.c index 1be811cf253..1a0641231bd 100644 --- a/audioutils/fmsynth/test/fmsynth_eg_test.c +++ b/audioutils/fmsynth/test/fmsynth_eg_test.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/audioutils/fmsynth/test/fmsynth_eg_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/audioutils/fmsynth/test/fmsynth_op_test.c b/audioutils/fmsynth/test/fmsynth_op_test.c index 581eb03a83d..cf1eff42bb9 100644 --- a/audioutils/fmsynth/test/fmsynth_op_test.c +++ b/audioutils/fmsynth/test/fmsynth_op_test.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/audioutils/fmsynth/test/fmsynth_op_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/audioutils/fmsynth/test/fmsynth_test.c b/audioutils/fmsynth/test/fmsynth_test.c index 72bb4e9fad3..ae03f2e6c6f 100644 --- a/audioutils/fmsynth/test/fmsynth_test.c +++ b/audioutils/fmsynth/test/fmsynth_test.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/audioutils/fmsynth/test/fmsynth_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/audioutils/fmsynth/test/opfunc_test.c b/audioutils/fmsynth/test/opfunc_test.c index 9b928c05447..d972bf290dc 100644 --- a/audioutils/fmsynth/test/opfunc_test.c +++ b/audioutils/fmsynth/test/opfunc_test.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/audioutils/fmsynth/test/opfunc_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/audioutils/lame/CMakeLists.txt b/audioutils/lame/CMakeLists.txt index 8b1c13250fb..26899b98655 100644 --- a/audioutils/lame/CMakeLists.txt +++ b/audioutils/lame/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/audioutils/lame/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/audioutils/lame/Make.defs b/audioutils/lame/Make.defs index 632d2a95e64..e1f47123f18 100644 --- a/audioutils/lame/Make.defs +++ b/audioutils/lame/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/audioutils/lame/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/audioutils/lame/Makefile b/audioutils/lame/Makefile index e941b8bd8c4..99526d63b50 100644 --- a/audioutils/lame/Makefile +++ b/audioutils/lame/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/audioutils/lame/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/audioutils/libmad/CMakeLists.txt b/audioutils/libmad/CMakeLists.txt index eea7c972b93..354f4281855 100644 --- a/audioutils/libmad/CMakeLists.txt +++ b/audioutils/libmad/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/audioutils/libmad/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/audioutils/libmad/Make.defs b/audioutils/libmad/Make.defs index b4f54edda2c..b3ff2747440 100644 --- a/audioutils/libmad/Make.defs +++ b/audioutils/libmad/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/audioutils/libmad/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/audioutils/libmad/Makefile b/audioutils/libmad/Makefile index 78910724601..ea7fce751c4 100644 --- a/audioutils/libmad/Makefile +++ b/audioutils/libmad/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/audioutils/libmad/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/audioutils/mml_parser/CMakeLists.txt b/audioutils/mml_parser/CMakeLists.txt index 36c083a36a8..72d2f8cfb72 100644 --- a/audioutils/mml_parser/CMakeLists.txt +++ b/audioutils/mml_parser/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/audioutils/mml_parser/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/audioutils/mml_parser/Make.defs b/audioutils/mml_parser/Make.defs index 880f0a2e5af..39bad301973 100644 --- a/audioutils/mml_parser/Make.defs +++ b/audioutils/mml_parser/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/audioutils/mml_parser/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/audioutils/mml_parser/Makefile b/audioutils/mml_parser/Makefile index 361369c8ce7..aab7d65776a 100644 --- a/audioutils/mml_parser/Makefile +++ b/audioutils/mml_parser/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/audioutils/mml_parser/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/audioutils/mml_parser/mml_parser.c b/audioutils/mml_parser/mml_parser.c index 207ec203b2b..de7450f7181 100644 --- a/audioutils/mml_parser/mml_parser.c +++ b/audioutils/mml_parser/mml_parser.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/audioutils/mml_parser/mml_parser.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/audioutils/nxaudio/CMakeLists.txt b/audioutils/nxaudio/CMakeLists.txt index f6c35241b61..cd7c017ca6e 100644 --- a/audioutils/nxaudio/CMakeLists.txt +++ b/audioutils/nxaudio/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/audioutils/nxaudio/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/audioutils/nxaudio/Make.defs b/audioutils/nxaudio/Make.defs index ad6f5bf2397..2677f926e9c 100644 --- a/audioutils/nxaudio/Make.defs +++ b/audioutils/nxaudio/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/audioutils/nxaudio/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/audioutils/nxaudio/Makefile b/audioutils/nxaudio/Makefile index 482ee57ae59..561cecc896a 100644 --- a/audioutils/nxaudio/Makefile +++ b/audioutils/nxaudio/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/audioutils/nxaudio/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/audioutils/nxaudio/nxaudio.c b/audioutils/nxaudio/nxaudio.c index e6101fff88f..3871a1a93dd 100644 --- a/audioutils/nxaudio/nxaudio.c +++ b/audioutils/nxaudio/nxaudio.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/audioutils/nxaudio/nxaudio.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The From 41e51e68a2d8fb4fa454aeeb9671c1e56e38d1b5 Mon Sep 17 00:00:00 2001 From: Alin Jerpelea Date: Wed, 18 Dec 2024 07:13:55 +0100 Subject: [PATCH 061/391] benchmarks: migrate to SPDX identifier Most tools used for compliance and SBOM generation use SPDX identifiers This change brings us a step closer to an easy SBOM generation. Signed-off-by: Alin Jerpelea --- benchmarks/CMakeLists.txt | 2 ++ benchmarks/Make.defs | 2 ++ benchmarks/Makefile | 2 ++ benchmarks/cachespeed/CMakeLists.txt | 2 ++ benchmarks/cachespeed/Make.defs | 2 ++ benchmarks/cachespeed/Makefile | 2 ++ benchmarks/cachespeed/cachespeed_main.c | 2 ++ benchmarks/coremark-pro/CMakeLists.txt | 2 ++ benchmarks/coremark-pro/Make.defs | 2 ++ benchmarks/coremark-pro/Makefile | 2 ++ benchmarks/coremark/CMakeLists.txt | 2 ++ benchmarks/coremark/Make.defs | 2 ++ benchmarks/coremark/Makefile | 2 ++ benchmarks/dhrystone/CMakeLists.txt | 2 ++ benchmarks/dhrystone/Make.defs | 2 ++ benchmarks/dhrystone/Makefile | 2 ++ benchmarks/fio/CMakeLists.txt | 2 ++ benchmarks/fio/Make.defs | 2 ++ benchmarks/fio/Makefile | 2 ++ benchmarks/iozone/CMakeLists.txt | 2 ++ benchmarks/iozone/Make.defs | 2 ++ benchmarks/iozone/Makefile | 2 ++ benchmarks/osperf/CMakeLists.txt | 2 ++ benchmarks/osperf/Make.defs | 2 ++ benchmarks/osperf/Makefile | 2 ++ benchmarks/osperf/osperf.c | 2 ++ benchmarks/ramspeed/Make.defs | 2 ++ benchmarks/ramspeed/Makefile | 2 ++ benchmarks/ramspeed/ramspeed_main.c | 2 ++ benchmarks/rt-tests/numa.h | 2 ++ benchmarks/spinlock_bench/CMakeLists.txt | 2 ++ benchmarks/spinlock_bench/Make.defs | 2 ++ benchmarks/spinlock_bench/Makefile | 2 ++ benchmarks/spinlock_bench/spinlock_bench.c | 2 ++ benchmarks/superpi/CMakeLists.txt | 2 ++ benchmarks/superpi/Make.defs | 2 ++ benchmarks/superpi/Makefile | 2 ++ 37 files changed, 74 insertions(+) diff --git a/benchmarks/CMakeLists.txt b/benchmarks/CMakeLists.txt index 3954bb7c1fc..9f3c66bf5d1 100644 --- a/benchmarks/CMakeLists.txt +++ b/benchmarks/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/benchmarks/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/benchmarks/Make.defs b/benchmarks/Make.defs index 73c1413b6ea..cfe7377d949 100644 --- a/benchmarks/Make.defs +++ b/benchmarks/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/benchmarks/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/benchmarks/Makefile b/benchmarks/Makefile index 905ea11dd7a..389f6c5a711 100644 --- a/benchmarks/Makefile +++ b/benchmarks/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/benchmarks/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/benchmarks/cachespeed/CMakeLists.txt b/benchmarks/cachespeed/CMakeLists.txt index f41b75a2f43..18a2a39d415 100644 --- a/benchmarks/cachespeed/CMakeLists.txt +++ b/benchmarks/cachespeed/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/benchmarks/cachespeed/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/benchmarks/cachespeed/Make.defs b/benchmarks/cachespeed/Make.defs index 721bda7ca8c..5a26c893818 100644 --- a/benchmarks/cachespeed/Make.defs +++ b/benchmarks/cachespeed/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/benchmarks/cachespeed/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/benchmarks/cachespeed/Makefile b/benchmarks/cachespeed/Makefile index 76407f77c64..4491b514c20 100644 --- a/benchmarks/cachespeed/Makefile +++ b/benchmarks/cachespeed/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/benchmarks/cachespeed/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/benchmarks/cachespeed/cachespeed_main.c b/benchmarks/cachespeed/cachespeed_main.c index 30bd06eef9c..c895c3b8fb6 100644 --- a/benchmarks/cachespeed/cachespeed_main.c +++ b/benchmarks/cachespeed/cachespeed_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/benchmarks/cachespeed/cachespeed_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/benchmarks/coremark-pro/CMakeLists.txt b/benchmarks/coremark-pro/CMakeLists.txt index ab954f87a3c..5cd19227bd4 100644 --- a/benchmarks/coremark-pro/CMakeLists.txt +++ b/benchmarks/coremark-pro/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/benchmarks/coremark-pro/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/benchmarks/coremark-pro/Make.defs b/benchmarks/coremark-pro/Make.defs index 2a195adaf33..144f4ce3d1a 100644 --- a/benchmarks/coremark-pro/Make.defs +++ b/benchmarks/coremark-pro/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/benchmarks/coremark-pro/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/benchmarks/coremark-pro/Makefile b/benchmarks/coremark-pro/Makefile index 0fa3a0986ff..ccc6d5bbb77 100644 --- a/benchmarks/coremark-pro/Makefile +++ b/benchmarks/coremark-pro/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/benchmarks/coremark-pro/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/benchmarks/coremark/CMakeLists.txt b/benchmarks/coremark/CMakeLists.txt index aa6bfa3622f..3aef2967ad9 100644 --- a/benchmarks/coremark/CMakeLists.txt +++ b/benchmarks/coremark/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/benchmarks/coremark/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/benchmarks/coremark/Make.defs b/benchmarks/coremark/Make.defs index aa7a92c567a..971b261df24 100644 --- a/benchmarks/coremark/Make.defs +++ b/benchmarks/coremark/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/benchmarks/coremark/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/benchmarks/coremark/Makefile b/benchmarks/coremark/Makefile index e5526cd57ac..c1b02e5f02a 100644 --- a/benchmarks/coremark/Makefile +++ b/benchmarks/coremark/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/benchmarks/coremark/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/benchmarks/dhrystone/CMakeLists.txt b/benchmarks/dhrystone/CMakeLists.txt index dd503077ab6..166692d364e 100644 --- a/benchmarks/dhrystone/CMakeLists.txt +++ b/benchmarks/dhrystone/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/benchmarks/dhrystone/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/benchmarks/dhrystone/Make.defs b/benchmarks/dhrystone/Make.defs index 1c8666c5acf..2662abde051 100644 --- a/benchmarks/dhrystone/Make.defs +++ b/benchmarks/dhrystone/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/benchmarks/dhrystone/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/benchmarks/dhrystone/Makefile b/benchmarks/dhrystone/Makefile index 17f0912d4e1..6e175ac15d6 100644 --- a/benchmarks/dhrystone/Makefile +++ b/benchmarks/dhrystone/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/benchmarks/dhrystone/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/benchmarks/fio/CMakeLists.txt b/benchmarks/fio/CMakeLists.txt index f279bcadcc5..5dae3f20d21 100644 --- a/benchmarks/fio/CMakeLists.txt +++ b/benchmarks/fio/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/benchmarks/fio/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/benchmarks/fio/Make.defs b/benchmarks/fio/Make.defs index c9d6941932d..27c568349f0 100644 --- a/benchmarks/fio/Make.defs +++ b/benchmarks/fio/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/benchmarks/fio/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/benchmarks/fio/Makefile b/benchmarks/fio/Makefile index 34c80c9347c..c7950873de8 100644 --- a/benchmarks/fio/Makefile +++ b/benchmarks/fio/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/benchmarks/fio/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/benchmarks/iozone/CMakeLists.txt b/benchmarks/iozone/CMakeLists.txt index 843fa53ac03..0559ad63ed8 100644 --- a/benchmarks/iozone/CMakeLists.txt +++ b/benchmarks/iozone/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/benchmarks/iozone/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/benchmarks/iozone/Make.defs b/benchmarks/iozone/Make.defs index 09ed336e1af..b3712058a08 100644 --- a/benchmarks/iozone/Make.defs +++ b/benchmarks/iozone/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/benchmarks/iozone/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/benchmarks/iozone/Makefile b/benchmarks/iozone/Makefile index 3f11b2cccb4..22985764ccd 100644 --- a/benchmarks/iozone/Makefile +++ b/benchmarks/iozone/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/benchmarks/iozone/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/benchmarks/osperf/CMakeLists.txt b/benchmarks/osperf/CMakeLists.txt index dbf29d29e63..e47386d09d9 100644 --- a/benchmarks/osperf/CMakeLists.txt +++ b/benchmarks/osperf/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/benchmarks/osperf/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/benchmarks/osperf/Make.defs b/benchmarks/osperf/Make.defs index 29888f7aec5..1efa6904468 100644 --- a/benchmarks/osperf/Make.defs +++ b/benchmarks/osperf/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/benchmarks/osperf/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/benchmarks/osperf/Makefile b/benchmarks/osperf/Makefile index 29e94f2f182..a72e1f18e4a 100644 --- a/benchmarks/osperf/Makefile +++ b/benchmarks/osperf/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/benchmarks/osperf/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/benchmarks/osperf/osperf.c b/benchmarks/osperf/osperf.c index 66d24ac3f16..36c1f4914e9 100644 --- a/benchmarks/osperf/osperf.c +++ b/benchmarks/osperf/osperf.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/benchmarks/osperf/osperf.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/benchmarks/ramspeed/Make.defs b/benchmarks/ramspeed/Make.defs index fd3c6673e23..b78ae67fbef 100644 --- a/benchmarks/ramspeed/Make.defs +++ b/benchmarks/ramspeed/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/benchmarks/ramspeed/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/benchmarks/ramspeed/Makefile b/benchmarks/ramspeed/Makefile index f9376a9d590..c11a67ff272 100644 --- a/benchmarks/ramspeed/Makefile +++ b/benchmarks/ramspeed/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/benchmarks/ramspeed/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/benchmarks/ramspeed/ramspeed_main.c b/benchmarks/ramspeed/ramspeed_main.c index 6eb4bfe678d..b5bd4ab0075 100644 --- a/benchmarks/ramspeed/ramspeed_main.c +++ b/benchmarks/ramspeed/ramspeed_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/benchmarks/ramspeed/ramspeed_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/benchmarks/rt-tests/numa.h b/benchmarks/rt-tests/numa.h index de3a01fade1..6938e9eb9b6 100644 --- a/benchmarks/rt-tests/numa.h +++ b/benchmarks/rt-tests/numa.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/benchmarks/rt-tests/numa.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/benchmarks/spinlock_bench/CMakeLists.txt b/benchmarks/spinlock_bench/CMakeLists.txt index 2707c223a88..80ed3afe0e6 100644 --- a/benchmarks/spinlock_bench/CMakeLists.txt +++ b/benchmarks/spinlock_bench/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/benchmarks/spinlock_bench/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/benchmarks/spinlock_bench/Make.defs b/benchmarks/spinlock_bench/Make.defs index e8217776001..6031b9eff15 100644 --- a/benchmarks/spinlock_bench/Make.defs +++ b/benchmarks/spinlock_bench/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/benchmarks/spinlock_bench/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/benchmarks/spinlock_bench/Makefile b/benchmarks/spinlock_bench/Makefile index fada2fb61c5..e1a3f86c6ca 100644 --- a/benchmarks/spinlock_bench/Makefile +++ b/benchmarks/spinlock_bench/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/benchmarks/spinlock_bench/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/benchmarks/spinlock_bench/spinlock_bench.c b/benchmarks/spinlock_bench/spinlock_bench.c index a6014ca9a14..bc8c8b5ed5e 100644 --- a/benchmarks/spinlock_bench/spinlock_bench.c +++ b/benchmarks/spinlock_bench/spinlock_bench.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/benchmarks/spinlock_bench/spinlock_bench.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/benchmarks/superpi/CMakeLists.txt b/benchmarks/superpi/CMakeLists.txt index aec5016d820..c15a98ff033 100644 --- a/benchmarks/superpi/CMakeLists.txt +++ b/benchmarks/superpi/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/benchmarks/superpi/CMakeList.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/benchmarks/superpi/Make.defs b/benchmarks/superpi/Make.defs index 570daccde69..a5c1095d4ab 100644 --- a/benchmarks/superpi/Make.defs +++ b/benchmarks/superpi/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/benchmarks/superpi/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/benchmarks/superpi/Makefile b/benchmarks/superpi/Makefile index 74e9b2b4dcf..fbdb445d399 100644 --- a/benchmarks/superpi/Makefile +++ b/benchmarks/superpi/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/benchmarks/superpi/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The From 69b6c936d116f9a65d7b6df09d31228501a5efda Mon Sep 17 00:00:00 2001 From: Alin Jerpelea Date: Wed, 18 Dec 2024 07:30:17 +0100 Subject: [PATCH 062/391] benchmarks: migrate license to ASF Xiaomi has submitted the SGA and we can migrate the licese to ASF Signed-off-by: Alin Jerpelea --- benchmarks/rt-tests/CMakeLists.txt | 22 ++++++++++------ benchmarks/rt-tests/Kconfig | 16 +++--------- benchmarks/rt-tests/Make.defs | 24 +++++++++++------- benchmarks/rt-tests/Makefile | 24 +++++++++++------- benchmarks/superpi/Kconfig | 5 ++++ benchmarks/tacle-bench/CMakeLists.txt | 22 ++++++++++------ benchmarks/tacle-bench/Kconfig | 16 +++--------- benchmarks/tacle-bench/Make.defs | 24 +++++++++++------- benchmarks/tacle-bench/Makefile | 24 +++++++++++------- .../tacle-bench/generate_taclebench_c.sh | 25 +++++++++++-------- benchmarks/test-tlb/CMakeLists.txt | 23 ++++++++++------- benchmarks/test-tlb/Kconfig | 15 ++--------- benchmarks/test-tlb/Make.defs | 24 +++++++++++------- benchmarks/test-tlb/Makefile | 24 +++++++++++------- benchmarks/tinymembench/CMakeLists.txt | 22 ++++++++++------ benchmarks/tinymembench/Kconfig | 15 ++--------- benchmarks/tinymembench/Make.defs | 24 +++++++++++------- benchmarks/tinymembench/Makefile | 24 +++++++++++------- 18 files changed, 206 insertions(+), 167 deletions(-) diff --git a/benchmarks/rt-tests/CMakeLists.txt b/benchmarks/rt-tests/CMakeLists.txt index 0d94abc14fb..9d7e9213f2f 100644 --- a/benchmarks/rt-tests/CMakeLists.txt +++ b/benchmarks/rt-tests/CMakeLists.txt @@ -1,18 +1,24 @@ +############################################################################ +# apps/benchmarks/rt-tests/CMakeLists.txt # -# Copyright (C) 2024 Xiaomi Corporation +# SPDX-License-Identifier: Apache-2.0 # -# Licensed under the Apache License, Version 2.0 (the "License"); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. # +############################################################################ if(CONFIG_BENCHMARK_RTTESTS) diff --git a/benchmarks/rt-tests/Kconfig b/benchmarks/rt-tests/Kconfig index e1773e58388..40650deb025 100644 --- a/benchmarks/rt-tests/Kconfig +++ b/benchmarks/rt-tests/Kconfig @@ -1,18 +1,8 @@ # -# Copyright (C) 2024 Xiaomi Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# For a description of the syntax of this configuration file, +# see the file kconfig-language.txt in the NuttX tools repository. # + config BENCHMARK_RTTESTS tristate "RT-Tests" default n diff --git a/benchmarks/rt-tests/Make.defs b/benchmarks/rt-tests/Make.defs index 309c01fcb25..7c9c5849c9b 100644 --- a/benchmarks/rt-tests/Make.defs +++ b/benchmarks/rt-tests/Make.defs @@ -1,18 +1,24 @@ +############################################################################ +# apps/benchmarks/rt-tests/Make.defs # -# Copyright (C) 2024 Xiaomi Corporation +# SPDX-License-Identifier: Apache-2.0 # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. # +############################################################################ ifneq ($(CONFIG_BENCHMARK_RTTESTS),) CONFIGURED_APPS += $(APPDIR)/benchmarks/rt-tests diff --git a/benchmarks/rt-tests/Makefile b/benchmarks/rt-tests/Makefile index 70712fd99ba..5497d732e94 100644 --- a/benchmarks/rt-tests/Makefile +++ b/benchmarks/rt-tests/Makefile @@ -1,18 +1,24 @@ +############################################################################ +# apps/benchmarks/rt-tests/Makefile # -# Copyright (C) 2024 Xiaomi Corporation +# SPDX-License-Identifier: Apache-2.0 # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. # +############################################################################ ############################################################################ # Targets diff --git a/benchmarks/superpi/Kconfig b/benchmarks/superpi/Kconfig index b9a97255cbe..124f334f7e8 100644 --- a/benchmarks/superpi/Kconfig +++ b/benchmarks/superpi/Kconfig @@ -1,3 +1,8 @@ +# +# For a description of the syntax of this configuration file, +# see the file kconfig-language.txt in the NuttX tools repository. +# + config BENCHMARK_SUPERPI tristate "SuperPI test" default n diff --git a/benchmarks/tacle-bench/CMakeLists.txt b/benchmarks/tacle-bench/CMakeLists.txt index b04816e939a..f443d45cd32 100644 --- a/benchmarks/tacle-bench/CMakeLists.txt +++ b/benchmarks/tacle-bench/CMakeLists.txt @@ -1,18 +1,24 @@ +############################################################################ +# apps/benchmarks/tacle-bench/CMakeLists.txt # -# Copyright (C) 2024 Xiaomi Corporation +# SPDX-License-Identifier: Apache-2.0 # -# Licensed under the Apache License, Version 2.0 (the "License"); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. # +############################################################################ if(CONFIG_BENCHMARK_TACLEBENCH) diff --git a/benchmarks/tacle-bench/Kconfig b/benchmarks/tacle-bench/Kconfig index a3573456501..5ac56bb3f1d 100644 --- a/benchmarks/tacle-bench/Kconfig +++ b/benchmarks/tacle-bench/Kconfig @@ -1,18 +1,8 @@ # -# Copyright (C) 2024 Xiaomi Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# For a description of the syntax of this configuration file, +# see the file kconfig-language.txt in the NuttX tools repository. # + config BENCHMARK_TACLEBENCH tristate "TacleBench" default n diff --git a/benchmarks/tacle-bench/Make.defs b/benchmarks/tacle-bench/Make.defs index 3783c38e9d8..db0d4f7772f 100644 --- a/benchmarks/tacle-bench/Make.defs +++ b/benchmarks/tacle-bench/Make.defs @@ -1,18 +1,24 @@ +############################################################################ +# apps/benchmarks/tacle-bench/Make.defs # -# Copyright (C) 2024 Xiaomi Corporation +# SPDX-License-Identifier: Apache-2.0 # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. # +############################################################################ ifneq ($(CONFIG_BENCHMARK_TACLEBENCH),) CONFIGURED_APPS += $(APPDIR)/benchmarks/tacle-bench diff --git a/benchmarks/tacle-bench/Makefile b/benchmarks/tacle-bench/Makefile index 091c370fc2d..b574c0f5940 100644 --- a/benchmarks/tacle-bench/Makefile +++ b/benchmarks/tacle-bench/Makefile @@ -1,18 +1,24 @@ +############################################################################ +# apps/benchmarks/tacle-bench/Makefile # -# Copyright (C) 2024 Xiaomi Corporation +# SPDX-License-Identifier: Apache-2.0 # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. # +############################################################################ ############################################################################ # Targets diff --git a/benchmarks/tacle-bench/generate_taclebench_c.sh b/benchmarks/tacle-bench/generate_taclebench_c.sh index 6c5bbe24824..c6b69e0bccc 100755 --- a/benchmarks/tacle-bench/generate_taclebench_c.sh +++ b/benchmarks/tacle-bench/generate_taclebench_c.sh @@ -1,20 +1,25 @@ #!/bin/bash - +############################################################################ +# apps/benchmarks/tacle-bench/generate_taclebench_c.sh # -# Copyright (C) 2024 Xiaomi Corporation +# SPDX-License-Identifier: Apache-2.0 # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. # +############################################################################ MAIN_C=tacle-bench/taclebench.c BENCH_PATH=tacle-bench/bench diff --git a/benchmarks/test-tlb/CMakeLists.txt b/benchmarks/test-tlb/CMakeLists.txt index dfaa23c261b..866583e694a 100644 --- a/benchmarks/test-tlb/CMakeLists.txt +++ b/benchmarks/test-tlb/CMakeLists.txt @@ -1,19 +1,24 @@ +############################################################################ +# apps/benchmarks/test-tlb/CMakeLists.txt # -# Copyright (C) 2024 Xiaomi Corporation +# SPDX-License-Identifier: Apache-2.0 # -# Licensed under the Apache License, Version 2.0 (the "License"); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. # - +############################################################################ if(CONFIG_BENCHMARK_TESTTLB) set(SRCS test-tlb/test-tlb.c) diff --git a/benchmarks/test-tlb/Kconfig b/benchmarks/test-tlb/Kconfig index 806ca486511..111c5a9a5d0 100644 --- a/benchmarks/test-tlb/Kconfig +++ b/benchmarks/test-tlb/Kconfig @@ -1,17 +1,6 @@ # -# Copyright (C) 2024 Xiaomi Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# For a description of the syntax of this configuration file, +# see the file kconfig-language.txt in the NuttX tools repository. # config BENCHMARK_TESTTLB diff --git a/benchmarks/test-tlb/Make.defs b/benchmarks/test-tlb/Make.defs index 7a946c56869..e7f275ef029 100644 --- a/benchmarks/test-tlb/Make.defs +++ b/benchmarks/test-tlb/Make.defs @@ -1,18 +1,24 @@ +############################################################################ +# apps/benchmarks/test-tlb/Make.defs # -# Copyright (C) 2024 Xiaomi Corporation +# SPDX-License-Identifier: Apache-2.0 # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. # +############################################################################ ifneq ($(CONFIG_BENCHMARK_TESTTLB),) CONFIGURED_APPS += $(APPDIR)/benchmarks/test-tlb diff --git a/benchmarks/test-tlb/Makefile b/benchmarks/test-tlb/Makefile index 10ef391e877..ca0b5f1adb1 100644 --- a/benchmarks/test-tlb/Makefile +++ b/benchmarks/test-tlb/Makefile @@ -1,18 +1,24 @@ +############################################################################ +# apps/benchmarks/test-tlb/Makefile # -# Copyright (C) 2024 Xiaomi Corporation +# SPDX-License-Identifier: Apache-2.0 # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. # +############################################################################ include $(APPDIR)/Make.defs diff --git a/benchmarks/tinymembench/CMakeLists.txt b/benchmarks/tinymembench/CMakeLists.txt index ae78eb44bc2..1bbcf96abc0 100644 --- a/benchmarks/tinymembench/CMakeLists.txt +++ b/benchmarks/tinymembench/CMakeLists.txt @@ -1,18 +1,24 @@ +############################################################################ +# apps/benchmarks/tinymembench/CMakeLists.txt # -# Copyright (C) 2024 Xiaomi Corporation +# SPDX-License-Identifier: Apache-2.0 # -# Licensed under the Apache License, Version 2.0 (the "License"); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. # +############################################################################ if(CONFIG_BENCHMARK_TINY_MEMBENCH) diff --git a/benchmarks/tinymembench/Kconfig b/benchmarks/tinymembench/Kconfig index 5a080598203..7a6521dabc0 100644 --- a/benchmarks/tinymembench/Kconfig +++ b/benchmarks/tinymembench/Kconfig @@ -1,17 +1,6 @@ # -# Copyright (C) 2024 Xiaomi Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# For a description of the syntax of this configuration file, +# see the file kconfig-language.txt in the NuttX tools repository. # config BENCHMARK_TINY_MEMBENCH diff --git a/benchmarks/tinymembench/Make.defs b/benchmarks/tinymembench/Make.defs index 456ce2a78b9..d32e7385f5f 100644 --- a/benchmarks/tinymembench/Make.defs +++ b/benchmarks/tinymembench/Make.defs @@ -1,18 +1,24 @@ +############################################################################ +# apps/benchmarks/tinymembench/Make.defs # -# Copyright (C) 2024 Xiaomi Corporation +# SPDX-License-Identifier: Apache-2.0 # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. # +############################################################################ ifneq ($(CONFIG_BENCHMARK_TINY_MEMBENCH),) CONFIGURED_APPS += $(APPDIR)/benchmarks/tinymembench diff --git a/benchmarks/tinymembench/Makefile b/benchmarks/tinymembench/Makefile index 85dfb05b6a4..37b61675360 100644 --- a/benchmarks/tinymembench/Makefile +++ b/benchmarks/tinymembench/Makefile @@ -1,18 +1,24 @@ +############################################################################ +# apps/benchmarks/tinymembench/Makefile # -# Copyright (C) 2024 Xiaomi Corporation +# SPDX-License-Identifier: Apache-2.0 # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. # +############################################################################ include $(APPDIR)/Make.defs From dc4bf4a5fb4ad14208889c0a8f8ce69d63e84771 Mon Sep 17 00:00:00 2001 From: Alin Jerpelea Date: Wed, 18 Dec 2024 07:37:06 +0100 Subject: [PATCH 063/391] boot: migrate to SPDX identifier Most tools used for compliance and SBOM generation use SPDX identifiers This change brings us a step closer to an easy SBOM generation. Signed-off-by: Alin Jerpelea --- boot/CMakeLists.txt | 2 ++ boot/Make.defs | 2 ++ boot/Makefile | 2 ++ boot/mcuboot/CMakeLists.txt | 2 ++ boot/mcuboot/Make.defs | 2 ++ boot/mcuboot/Makefile | 2 ++ boot/miniboot/CMakeLists.txt | 2 ++ boot/miniboot/Make.defs | 2 ++ boot/miniboot/Makefile | 2 ++ boot/miniboot/miniboot_main.c | 2 ++ boot/nxboot/CMakeLists.txt | 2 ++ boot/nxboot/Make.defs | 2 ++ boot/nxboot/Makefile | 2 ++ boot/nxboot/include/nxboot.h | 2 ++ boot/nxboot/loader/boot.c | 2 ++ boot/nxboot/loader/flash.c | 2 ++ boot/nxboot/loader/flash.h | 2 ++ boot/nxboot/nxboot_main.c | 2 ++ boot/nxboot/tools/nximage.py | 22 ++++++++++++++++++++++ 19 files changed, 58 insertions(+) diff --git a/boot/CMakeLists.txt b/boot/CMakeLists.txt index 50b7ba7c4f4..4a418db7c91 100644 --- a/boot/CMakeLists.txt +++ b/boot/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/boot/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/boot/Make.defs b/boot/Make.defs index b0e6794f66b..78765dbdb1a 100644 --- a/boot/Make.defs +++ b/boot/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/boot/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/boot/Makefile b/boot/Makefile index e20a7c4a3c2..3bbae87654b 100644 --- a/boot/Makefile +++ b/boot/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/boot/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/boot/mcuboot/CMakeLists.txt b/boot/mcuboot/CMakeLists.txt index 23418960f0d..28fe0d13b7a 100644 --- a/boot/mcuboot/CMakeLists.txt +++ b/boot/mcuboot/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/boot/mcuboot/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/boot/mcuboot/Make.defs b/boot/mcuboot/Make.defs index f567438110a..446a785e211 100644 --- a/boot/mcuboot/Make.defs +++ b/boot/mcuboot/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/boot/mcuboot/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/boot/mcuboot/Makefile b/boot/mcuboot/Makefile index 64157bf093a..e6851be9310 100644 --- a/boot/mcuboot/Makefile +++ b/boot/mcuboot/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/boot/mcuboot/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/boot/miniboot/CMakeLists.txt b/boot/miniboot/CMakeLists.txt index e23c6ddaa4d..2c488cec741 100644 --- a/boot/miniboot/CMakeLists.txt +++ b/boot/miniboot/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/boot/miniboot/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/boot/miniboot/Make.defs b/boot/miniboot/Make.defs index 88b33ade76f..0f082485df9 100644 --- a/boot/miniboot/Make.defs +++ b/boot/miniboot/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/boot/miniboot/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/boot/miniboot/Makefile b/boot/miniboot/Makefile index 0bf17a3aa62..c5c4de3406f 100644 --- a/boot/miniboot/Makefile +++ b/boot/miniboot/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/boot/miniboot/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/boot/miniboot/miniboot_main.c b/boot/miniboot/miniboot_main.c index 9d280c326c6..63f47465c62 100644 --- a/boot/miniboot/miniboot_main.c +++ b/boot/miniboot/miniboot_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/boot/miniboot/miniboot_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/boot/nxboot/CMakeLists.txt b/boot/nxboot/CMakeLists.txt index fb405627780..1ea82b7a867 100644 --- a/boot/nxboot/CMakeLists.txt +++ b/boot/nxboot/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/boot/nxboot/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/boot/nxboot/Make.defs b/boot/nxboot/Make.defs index 6e7660c45cc..4a472724d77 100644 --- a/boot/nxboot/Make.defs +++ b/boot/nxboot/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/boot/nxboot/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/boot/nxboot/Makefile b/boot/nxboot/Makefile index f9666c7aa0d..9596bf88f79 100644 --- a/boot/nxboot/Makefile +++ b/boot/nxboot/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/boot/nxboot/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/boot/nxboot/include/nxboot.h b/boot/nxboot/include/nxboot.h index 7047cf6e1df..2ecf961c766 100644 --- a/boot/nxboot/include/nxboot.h +++ b/boot/nxboot/include/nxboot.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/boot/nxboot/include/nxboot.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/boot/nxboot/loader/boot.c b/boot/nxboot/loader/boot.c index 6bd9a2dcb1d..ec1ec3c659d 100644 --- a/boot/nxboot/loader/boot.c +++ b/boot/nxboot/loader/boot.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/boot/nxboot/loader/boot.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/boot/nxboot/loader/flash.c b/boot/nxboot/loader/flash.c index fdeaf77f28e..4c32a8831be 100644 --- a/boot/nxboot/loader/flash.c +++ b/boot/nxboot/loader/flash.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/boot/nxboot/loader/flash.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/boot/nxboot/loader/flash.h b/boot/nxboot/loader/flash.h index 1fb4be56d3e..653c4c8b974 100644 --- a/boot/nxboot/loader/flash.h +++ b/boot/nxboot/loader/flash.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/boot/nxboot/loader/flash.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/boot/nxboot/nxboot_main.c b/boot/nxboot/nxboot_main.c index 81ae2f40cdf..09e556b2b1b 100644 --- a/boot/nxboot/nxboot_main.c +++ b/boot/nxboot/nxboot_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/boot/nxboot/nxboot_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/boot/nxboot/tools/nximage.py b/boot/nxboot/tools/nximage.py index 92c0b391108..1a9d68a1f16 100644 --- a/boot/nxboot/tools/nximage.py +++ b/boot/nxboot/tools/nximage.py @@ -1,3 +1,25 @@ +#!/usr/bin/env python3 +############################################################################ +# apps/boot/nxboot/tools/nximage.py +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ """Python script that prepares the NuttX image to be used with NX bootloader""" import argparse From 7fe01f1c521884a9ca3ca65ee8b288bee89b5d80 Mon Sep 17 00:00:00 2001 From: Alin Jerpelea Date: Wed, 18 Dec 2024 07:44:44 +0100 Subject: [PATCH 064/391] cmake: migrate to SPDX identifier Most tools used for compliance and SBOM generation use SPDX identifiers This change brings us a step closer to an easy SBOM generation. Signed-off-by: Alin Jerpelea --- cmake/nuttx_add_luamod.cmake | 2 ++ cmake/nuttx_add_wamrmod.cmake | 2 ++ 2 files changed, 4 insertions(+) diff --git a/cmake/nuttx_add_luamod.cmake b/cmake/nuttx_add_luamod.cmake index 0744f593502..93fefd628db 100644 --- a/cmake/nuttx_add_luamod.cmake +++ b/cmake/nuttx_add_luamod.cmake @@ -1,6 +1,8 @@ # ############################################################################## # cmake/nuttx_add_luamod.cmake # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/cmake/nuttx_add_wamrmod.cmake b/cmake/nuttx_add_wamrmod.cmake index 231c64d9c46..65f27c91caf 100644 --- a/cmake/nuttx_add_wamrmod.cmake +++ b/cmake/nuttx_add_wamrmod.cmake @@ -1,6 +1,8 @@ # ############################################################################## # cmake/nuttx_add_wamrmod.cmake # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this From 087cac44715d486724ceae5b5556f125562d8683 Mon Sep 17 00:00:00 2001 From: Alin Jerpelea Date: Wed, 18 Dec 2024 07:46:00 +0100 Subject: [PATCH 065/391] database: migrate to SPDX identifier Most tools used for compliance and SBOM generation use SPDX identifiers This change brings us a step closer to an easy SBOM generation. Signed-off-by: Alin Jerpelea --- database/Make.defs | 2 ++ database/Makefile | 2 ++ database/sqlite/Make.defs | 2 ++ database/sqlite/Makefile | 2 ++ 4 files changed, 8 insertions(+) diff --git a/database/Make.defs b/database/Make.defs index 5774079902e..c6529b97ed1 100644 --- a/database/Make.defs +++ b/database/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/database/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/database/Makefile b/database/Makefile index 3cf46e8e333..4ee15a7769f 100644 --- a/database/Makefile +++ b/database/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/database/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/database/sqlite/Make.defs b/database/sqlite/Make.defs index 2b9ff26ce49..3d14dbe0187 100644 --- a/database/sqlite/Make.defs +++ b/database/sqlite/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/database/sqlite/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/database/sqlite/Makefile b/database/sqlite/Makefile index f178a65a374..cc1e6b4602b 100644 --- a/database/sqlite/Makefile +++ b/database/sqlite/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/database/sqlite/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The From e41ef499955504a9acc29c607f6ea002085d38c5 Mon Sep 17 00:00:00 2001 From: Alin Jerpelea Date: Wed, 18 Dec 2024 07:43:47 +0100 Subject: [PATCH 066/391] builtin: migrate to SPDX identifier Most tools used for compliance and SBOM generation use SPDX identifiers This change brings us a step closer to an easy SBOM generation. Signed-off-by: Alin Jerpelea --- builtin/CMakeLists.txt | 2 ++ builtin/Make.defs | 2 ++ builtin/Makefile | 2 ++ builtin/builtin_list.c | 6 ++++-- builtin/exec_builtin.c | 2 ++ 5 files changed, 12 insertions(+), 2 deletions(-) diff --git a/builtin/CMakeLists.txt b/builtin/CMakeLists.txt index e8be798e733..5447ff06749 100644 --- a/builtin/CMakeLists.txt +++ b/builtin/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/builtin/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/builtin/Make.defs b/builtin/Make.defs index dad098de19e..47d1bf96004 100644 --- a/builtin/Make.defs +++ b/builtin/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/builtin/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/builtin/Makefile b/builtin/Makefile index a26e107e189..a5de31f6c5e 100644 --- a/builtin/Makefile +++ b/builtin/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/builtin/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/builtin/builtin_list.c b/builtin/builtin_list.c index dcc10e10b6a..9605b097c7b 100644 --- a/builtin/builtin_list.c +++ b/builtin/builtin_list.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/builtin/builtin_list.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The @@ -29,6 +31,8 @@ #include +#include "builtin_proto.h" + /**************************************************************************** * Private Types ****************************************************************************/ @@ -41,8 +45,6 @@ * Public Data ****************************************************************************/ -#include "builtin_proto.h" - const struct builtin_s g_builtins[] = { # include "builtin_list.h" diff --git a/builtin/exec_builtin.c b/builtin/exec_builtin.c index 2bf28b8f404..325d594cf5c 100644 --- a/builtin/exec_builtin.c +++ b/builtin/exec_builtin.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/builtin/exec_builtin.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The From 440d69a310055727b4b0ee72fa24caa93ebbac85 Mon Sep 17 00:00:00 2001 From: Alin Jerpelea Date: Wed, 18 Dec 2024 08:04:11 +0100 Subject: [PATCH 067/391] canutils: migrate to SPDX identifier Most tools used for compliance and SBOM generation use SPDX identifiers This change brings us a step closer to an easy SBOM generation. Signed-off-by: Alin Jerpelea --- canutils/CMakeLists.txt | 2 ++ canutils/Make.defs | 2 ++ canutils/Makefile | 2 ++ canutils/candump/CMakeLists.txt | 2 ++ canutils/candump/Make.defs | 3 ++- canutils/candump/Makefile | 2 ++ canutils/candump/candump.c | 23 +++++++++++++++++------ canutils/canlib/CMakeLists.txt | 2 ++ canutils/canlib/Make.defs | 2 ++ canutils/canlib/Makefile | 2 ++ canutils/canlib/canlib_getbaud.c | 2 ++ canutils/canlib/canlib_getloopback.c | 2 ++ canutils/canlib/canlib_getsilent.c | 2 ++ canutils/canlib/canlib_setbaud.c | 2 ++ canutils/canlib/canlib_setloopback.c | 2 ++ canutils/canlib/canlib_setsilent.c | 2 ++ canutils/cansend/CMakeLists.txt | 2 ++ canutils/cansend/Make.defs | 3 ++- canutils/cansend/Makefile | 2 ++ canutils/cansend/cansend.c | 26 ++------------------------ canutils/lely-canopen/CMakeLists.txt | 2 ++ canutils/lely-canopen/Make.defs | 2 ++ canutils/lely-canopen/Makefile | 2 ++ canutils/libcanutils/CMakeLists.txt | 2 ++ canutils/libcanutils/Make.defs | 2 ++ canutils/libcanutils/Makefile | 2 ++ canutils/libcanutils/lib.c | 10 ++++------ canutils/libcanutils/lib.h | 10 ++++------ canutils/libcanutils/terminal.h | 10 +++++----- canutils/libdronecan/CMakeLists.txt | 2 ++ canutils/libdronecan/Make.defs | 2 ++ canutils/libdronecan/Makefile | 2 ++ canutils/libobd2/CMakeLists.txt | 2 ++ canutils/libobd2/Make.defs | 2 ++ canutils/libobd2/Makefile | 2 ++ canutils/libobd2/obd2.c | 2 ++ canutils/libobd2/obd_decodepid.c | 2 ++ canutils/libobd2/obd_sendrequest.c | 2 ++ canutils/libobd2/obd_waitresponse.c | 2 ++ canutils/libopencyphal/CMakeLists.txt | 2 ++ canutils/libopencyphal/Make.defs | 2 ++ canutils/libopencyphal/Makefile | 2 ++ canutils/slcan/CMakeLists.txt | 2 ++ canutils/slcan/Make.defs | 3 ++- canutils/slcan/Makefile | 2 ++ canutils/slcan/slcan.c | 2 ++ canutils/slcan/slcan.h | 2 ++ 47 files changed, 116 insertions(+), 50 deletions(-) diff --git a/canutils/CMakeLists.txt b/canutils/CMakeLists.txt index 238b40af209..aa4a02ed9e1 100644 --- a/canutils/CMakeLists.txt +++ b/canutils/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/canutils/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/canutils/Make.defs b/canutils/Make.defs index 77a6c4d3a97..b68638da843 100644 --- a/canutils/Make.defs +++ b/canutils/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/canutils/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/canutils/Makefile b/canutils/Makefile index d8d9f1ddd36..68a1d93b280 100644 --- a/canutils/Makefile +++ b/canutils/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/canutils/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/canutils/candump/CMakeLists.txt b/canutils/candump/CMakeLists.txt index 590f7897bd9..be4f27f0b8b 100644 --- a/canutils/candump/CMakeLists.txt +++ b/canutils/candump/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/canutils/candump/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/canutils/candump/Make.defs b/canutils/candump/Make.defs index bf15862feca..d781a87b513 100644 --- a/canutils/candump/Make.defs +++ b/canutils/candump/Make.defs @@ -1,6 +1,7 @@ ############################################################################ # apps/canutils/candump/Make.defs -# Adds selected applications to apps/ build +# +# SPDX-License-Identifier: Apache-2.0 # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with diff --git a/canutils/candump/Makefile b/canutils/candump/Makefile index 080ca6436e8..d8861496f9e 100644 --- a/canutils/candump/Makefile +++ b/canutils/candump/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/canutils/candump/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/canutils/candump/candump.c b/canutils/candump/candump.c index 66887fb61f7..58958a46f01 100644 --- a/canutils/candump/candump.c +++ b/canutils/candump/candump.c @@ -1,9 +1,8 @@ -/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */ -/* - * candump.c +/**************************************************************************** + * apps/canutils/candump/candump.c * - * Copyright (c) 2002-2009 Volkswagen Group Electronic Research - * All rights reserved. + * SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) + * SPDX-FileCopyrightText: 2002-2007 Volkswagen Group Electronic Research * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -40,7 +39,11 @@ * * Send feedback to * - */ + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ #include #include @@ -66,6 +69,10 @@ #include "terminal.h" #include "lib.h" +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + /* for hardware timestamps - since Linux 2.6.30 */ #ifndef SO_TIMESTAMPING #define SO_TIMESTAMPING 37 @@ -98,6 +105,10 @@ const char col_on [MAXCOL][19] = {BLUE, RED, GREEN, BOLD, MAGENTA, CYAN}; const char col_off [] = ATTRESET; +/**************************************************************************** + * Public Functions + ****************************************************************************/ + static __u32 dropcnt[MAXSOCK]; static __u32 last_dropcnt[MAXSOCK]; static char devname[MAXIFNAMES][IFNAMSIZ+1]; diff --git a/canutils/canlib/CMakeLists.txt b/canutils/canlib/CMakeLists.txt index 9cdfb312881..9f8af63e1aa 100644 --- a/canutils/canlib/CMakeLists.txt +++ b/canutils/canlib/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/canutils/canlib/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/canutils/canlib/Make.defs b/canutils/canlib/Make.defs index fd712bee817..61e591c18d7 100644 --- a/canutils/canlib/Make.defs +++ b/canutils/canlib/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/canutils/canlib/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/canutils/canlib/Makefile b/canutils/canlib/Makefile index 54fc23f66c4..64ecdb0a343 100644 --- a/canutils/canlib/Makefile +++ b/canutils/canlib/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/canutils/canlib/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/canutils/canlib/canlib_getbaud.c b/canutils/canlib/canlib_getbaud.c index 23965e70eac..af123edeac5 100644 --- a/canutils/canlib/canlib_getbaud.c +++ b/canutils/canlib/canlib_getbaud.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/canutils/canlib/canlib_getbaud.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/canutils/canlib/canlib_getloopback.c b/canutils/canlib/canlib_getloopback.c index f9ba5fdf33a..443161e960f 100644 --- a/canutils/canlib/canlib_getloopback.c +++ b/canutils/canlib/canlib_getloopback.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/canutils/canlib/canlib_getloopback.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/canutils/canlib/canlib_getsilent.c b/canutils/canlib/canlib_getsilent.c index ffb4abfed63..868072eb1ee 100644 --- a/canutils/canlib/canlib_getsilent.c +++ b/canutils/canlib/canlib_getsilent.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/canutils/canlib/canlib_getsilent.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/canutils/canlib/canlib_setbaud.c b/canutils/canlib/canlib_setbaud.c index 0b4fa322a1e..b3ee68f265d 100644 --- a/canutils/canlib/canlib_setbaud.c +++ b/canutils/canlib/canlib_setbaud.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/canutils/canlib/canlib_setbaud.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/canutils/canlib/canlib_setloopback.c b/canutils/canlib/canlib_setloopback.c index bc88956c818..7e78b1a342d 100644 --- a/canutils/canlib/canlib_setloopback.c +++ b/canutils/canlib/canlib_setloopback.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/canutils/canlib/canlib_setloopback.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/canutils/canlib/canlib_setsilent.c b/canutils/canlib/canlib_setsilent.c index da05f01b102..0900f926143 100644 --- a/canutils/canlib/canlib_setsilent.c +++ b/canutils/canlib/canlib_setsilent.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/canutils/canlib/canlib_setsilent.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/canutils/cansend/CMakeLists.txt b/canutils/cansend/CMakeLists.txt index 207911f6576..31191666641 100644 --- a/canutils/cansend/CMakeLists.txt +++ b/canutils/cansend/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/canutils/cansend/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/canutils/cansend/Make.defs b/canutils/cansend/Make.defs index 2361a59bcd1..13ddf36f48a 100644 --- a/canutils/cansend/Make.defs +++ b/canutils/cansend/Make.defs @@ -1,6 +1,7 @@ ############################################################################ # apps/canutils/cansend/Make.defs -# Adds selected applications to apps/ build +# +# SPDX-License-Identifier: Apache-2.0 # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with diff --git a/canutils/cansend/Makefile b/canutils/cansend/Makefile index 52d17f3f82e..ae0e2cc1c6c 100644 --- a/canutils/cansend/Makefile +++ b/canutils/cansend/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/canutils/cansend/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/canutils/cansend/cansend.c b/canutils/cansend/cansend.c index f630addf76d..42fcffc79cc 100644 --- a/canutils/cansend/cansend.c +++ b/canutils/cansend/cansend.c @@ -1,30 +1,8 @@ /**************************************************************************** * apps/canutils/cansend/cansend.c * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -/**************************************************************************** - * SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) * - * - * cansend.c - send CAN-frames via CAN_RAW sockets - * - * Copyright (c) 2002-2007 Volkswagen Group Electronic Research - * All rights reserved. + * SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) + * SPDX-FileCopyrightText: 2002-2007 Volkswagen Group Electronic Research * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/canutils/lely-canopen/CMakeLists.txt b/canutils/lely-canopen/CMakeLists.txt index 380bd4909df..1211500d7aa 100644 --- a/canutils/lely-canopen/CMakeLists.txt +++ b/canutils/lely-canopen/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/canutils/lely-canopen/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/canutils/lely-canopen/Make.defs b/canutils/lely-canopen/Make.defs index 1230d307c32..09f0c06cdea 100644 --- a/canutils/lely-canopen/Make.defs +++ b/canutils/lely-canopen/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/canutils/lely-canopen/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/canutils/lely-canopen/Makefile b/canutils/lely-canopen/Makefile index c85733013dc..1985016c471 100644 --- a/canutils/lely-canopen/Makefile +++ b/canutils/lely-canopen/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/canutils/lely-canopen/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/canutils/libcanutils/CMakeLists.txt b/canutils/libcanutils/CMakeLists.txt index 62943e924cf..1ceb042e5b1 100644 --- a/canutils/libcanutils/CMakeLists.txt +++ b/canutils/libcanutils/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/canutils/libcanutils/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/canutils/libcanutils/Make.defs b/canutils/libcanutils/Make.defs index 70e0418d523..4c40e4cdfe0 100644 --- a/canutils/libcanutils/Make.defs +++ b/canutils/libcanutils/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/canutils/libcanutils/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/canutils/libcanutils/Makefile b/canutils/libcanutils/Makefile index cb790c8539f..d7eb68785a0 100644 --- a/canutils/libcanutils/Makefile +++ b/canutils/libcanutils/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/canutils/libcanutils/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/canutils/libcanutils/lib.c b/canutils/libcanutils/lib.c index 12580521a1f..749761d6160 100644 --- a/canutils/libcanutils/lib.c +++ b/canutils/libcanutils/lib.c @@ -1,9 +1,7 @@ -/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */ -/* - * lib.c - library for command line tools +/**************************************************************************** * - * Copyright (c) 2002-2007 Volkswagen Group Electronic Research - * All rights reserved. + * SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) + * SPDX-FileCopyrightText: 2002-2007 Volkswagen Group Electronic Research * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -40,7 +38,7 @@ * * Send feedback to * - */ + ****************************************************************************/ #include #include diff --git a/canutils/libcanutils/lib.h b/canutils/libcanutils/lib.h index 97db405df5e..ebabb6a4d85 100644 --- a/canutils/libcanutils/lib.h +++ b/canutils/libcanutils/lib.h @@ -1,9 +1,7 @@ -/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */ -/* - * lib.h - library include for command line tools +/**************************************************************************** * - * Copyright (c) 2002-2007 Volkswagen Group Electronic Research - * All rights reserved. + * SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) + * SPDX-FileCopyrightText: 2002-2007 Volkswagen Group Electronic Research * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -40,7 +38,7 @@ * * Send feedback to * - */ + ****************************************************************************/ #ifndef CAN_UTILS_LIB_H #define CAN_UTILS_LIB_H diff --git a/canutils/libcanutils/terminal.h b/canutils/libcanutils/terminal.h index 198b48ec0df..1b25e9ad37f 100644 --- a/canutils/libcanutils/terminal.h +++ b/canutils/libcanutils/terminal.h @@ -1,7 +1,7 @@ -/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */ -/* - * Copyright (c) 2002-2007 Volkswagen Group Electronic Research - * All rights reserved. +/**************************************************************************** + * + * SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) + * SPDX-FileCopyrightText: 2002-2007 Volkswagen Group Electronic Research * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -38,7 +38,7 @@ * * Send feedback to * - */ + ****************************************************************************/ #ifndef TERMINAL_H #define TERMINAL_H diff --git a/canutils/libdronecan/CMakeLists.txt b/canutils/libdronecan/CMakeLists.txt index feb29e35426..c8f7af9b27f 100644 --- a/canutils/libdronecan/CMakeLists.txt +++ b/canutils/libdronecan/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/canutils/libdronecan/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/canutils/libdronecan/Make.defs b/canutils/libdronecan/Make.defs index ad0ea54bb83..1a694e878ed 100644 --- a/canutils/libdronecan/Make.defs +++ b/canutils/libdronecan/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/canutils/libdronecan/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/canutils/libdronecan/Makefile b/canutils/libdronecan/Makefile index 7606ac4a3c0..0ad1d2dd4ba 100644 --- a/canutils/libdronecan/Makefile +++ b/canutils/libdronecan/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/canutils/libdronecan/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/canutils/libobd2/CMakeLists.txt b/canutils/libobd2/CMakeLists.txt index ee9515a8acf..f0dd564973f 100644 --- a/canutils/libobd2/CMakeLists.txt +++ b/canutils/libobd2/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/canutils/libobd2/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/canutils/libobd2/Make.defs b/canutils/libobd2/Make.defs index 09709305956..9e619d04da2 100644 --- a/canutils/libobd2/Make.defs +++ b/canutils/libobd2/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/canutils/libobd2/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/canutils/libobd2/Makefile b/canutils/libobd2/Makefile index 495f1c06920..2a1daebb04d 100644 --- a/canutils/libobd2/Makefile +++ b/canutils/libobd2/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/canutils/libobd2/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/canutils/libobd2/obd2.c b/canutils/libobd2/obd2.c index fcf007b2a0b..723b2f37ccb 100644 --- a/canutils/libobd2/obd2.c +++ b/canutils/libobd2/obd2.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/canutils/libobd2/obd2.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/canutils/libobd2/obd_decodepid.c b/canutils/libobd2/obd_decodepid.c index 3a3439a7485..0198d09bbde 100644 --- a/canutils/libobd2/obd_decodepid.c +++ b/canutils/libobd2/obd_decodepid.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/canutils/libobd2/obd_decodepid.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/canutils/libobd2/obd_sendrequest.c b/canutils/libobd2/obd_sendrequest.c index 2fb4c7d5777..3dc7243bde6 100644 --- a/canutils/libobd2/obd_sendrequest.c +++ b/canutils/libobd2/obd_sendrequest.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/canutils/libobd2/obd_sendrequest.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/canutils/libobd2/obd_waitresponse.c b/canutils/libobd2/obd_waitresponse.c index d000a5a1945..12c8a13e0d8 100644 --- a/canutils/libobd2/obd_waitresponse.c +++ b/canutils/libobd2/obd_waitresponse.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/canutils/libobd2/obd_waitresponse.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/canutils/libopencyphal/CMakeLists.txt b/canutils/libopencyphal/CMakeLists.txt index d79becba030..3f0efee73f5 100644 --- a/canutils/libopencyphal/CMakeLists.txt +++ b/canutils/libopencyphal/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/canutils/libopencyphal/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/canutils/libopencyphal/Make.defs b/canutils/libopencyphal/Make.defs index 5fdf13abf44..483bfbcabfb 100644 --- a/canutils/libopencyphal/Make.defs +++ b/canutils/libopencyphal/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/canutils/libopencyphal/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/canutils/libopencyphal/Makefile b/canutils/libopencyphal/Makefile index 5d580dd08b3..52f4e90c343 100644 --- a/canutils/libopencyphal/Makefile +++ b/canutils/libopencyphal/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/canutils/libopencyphal/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/canutils/slcan/CMakeLists.txt b/canutils/slcan/CMakeLists.txt index 3dd7ddeacd8..5feb5c28d93 100644 --- a/canutils/slcan/CMakeLists.txt +++ b/canutils/slcan/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/canutils/slcan/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/canutils/slcan/Make.defs b/canutils/slcan/Make.defs index dd6f6db5309..4f5ec3b6acc 100644 --- a/canutils/slcan/Make.defs +++ b/canutils/slcan/Make.defs @@ -1,6 +1,7 @@ ############################################################################ # apps/canutils/slcan/Make.defs -# Adds selected applications to apps/ build +# +# SPDX-License-Identifier: Apache-2.0 # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with diff --git a/canutils/slcan/Makefile b/canutils/slcan/Makefile index 5ff4ce64f7c..5b2f12a1786 100644 --- a/canutils/slcan/Makefile +++ b/canutils/slcan/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/canutils/slcan/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/canutils/slcan/slcan.c b/canutils/slcan/slcan.c index 6190e2ea249..c2657781406 100644 --- a/canutils/slcan/slcan.c +++ b/canutils/slcan/slcan.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/canutils/slcan/slcan.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/canutils/slcan/slcan.h b/canutils/slcan/slcan.h index cc6bedce0f8..229069ccf87 100644 --- a/canutils/slcan/slcan.h +++ b/canutils/slcan/slcan.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/canutils/slcan/slcan.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The From 5b68158154a73cd4fc3dbd973511428911f455f9 Mon Sep 17 00:00:00 2001 From: Alin Jerpelea Date: Thu, 19 Dec 2024 02:54:39 +0100 Subject: [PATCH 068/391] crypto: migrate to SPDX identifier Most tools used for compliance and SBOM generation use SPDX identifiers This change brings us a step closer to an easy SBOM generation. Signed-off-by: Alin Jerpelea --- crypto/CMakeLists.txt | 2 ++ crypto/controlse/CMakeLists.txt | 2 ++ crypto/controlse/Make.defs | 2 ++ crypto/controlse/Makefile | 2 ++ crypto/controlse/ccertificate.cxx | 2 ++ crypto/controlse/ccsr.cxx | 2 ++ crypto/controlse/chex_util.cxx | 2 ++ crypto/controlse/cmbedtls_se05x_extension.hxx | 2 ++ crypto/controlse/controlse_main.cxx | 2 ++ crypto/controlse/cpublic_key.cxx | 2 ++ crypto/controlse/csan_builder.cxx | 2 ++ crypto/controlse/csecure_element.cxx | 2 ++ crypto/controlse/cserial_number.cxx | 2 ++ crypto/controlse/cstring.cxx | 2 ++ crypto/libsodium/CMakeLists.txt | 2 ++ crypto/libsodium/Make.defs | 2 ++ crypto/libsodium/Makefile | 2 ++ crypto/libtomcrypt/CMakeLists.txt | 2 ++ crypto/libtomcrypt/Make.defs | 2 ++ crypto/libtomcrypt/Makefile | 2 ++ crypto/mbedtls/CMakeLists.txt | 2 ++ crypto/mbedtls/Make.defs | 2 ++ crypto/mbedtls/Makefile | 2 ++ crypto/mbedtls/include/aes_alt.h | 2 ++ crypto/mbedtls/include/cmac_alt.h | 2 ++ crypto/mbedtls/include/dev_alt.h | 2 ++ .../mbedtls/include/mbedtls/mbedtls_config.h | 2 +- crypto/mbedtls/include/md5_alt.h | 2 ++ crypto/mbedtls/include/poly1305_alt.h | 2 ++ crypto/mbedtls/include/ripemd160_alt.h | 2 ++ crypto/mbedtls/include/sha1_alt.h | 2 ++ crypto/mbedtls/include/sha256_alt.h | 2 ++ crypto/mbedtls/include/sha512_alt.h | 2 ++ crypto/mbedtls/source/aes_alt.c | 2 ++ crypto/mbedtls/source/bignum_alt.c | 2 ++ crypto/mbedtls/source/cmac_alt.c | 2 ++ crypto/mbedtls/source/dev_alt.c | 2 ++ crypto/mbedtls/source/entropy_alt.c | 2 ++ crypto/mbedtls/source/md5_alt.c | 2 ++ crypto/mbedtls/source/poly1305_alt.c | 2 ++ crypto/mbedtls/source/ripemd160_alt.c | 2 ++ crypto/mbedtls/source/sha1_alt.c | 2 ++ crypto/mbedtls/source/sha256_alt.c | 2 ++ crypto/mbedtls/source/sha512_alt.c | 2 ++ crypto/openssl_mbedtls_wrapper/CMakeLists.txt | 2 ++ crypto/openssl_mbedtls_wrapper/Make.defs | 2 ++ crypto/openssl_mbedtls_wrapper/Makefile | 2 ++ .../include/openssl/aes.h | 2 ++ .../include/openssl/asn1.h | 2 ++ .../include/openssl/base.h | 2 ++ .../include/openssl/bio.h | 2 ++ .../include/openssl/bn.h | 2 ++ .../include/openssl/bytestring.h | 2 ++ .../include/openssl/cipher.h | 2 ++ .../include/openssl/curve25519.h | 2 ++ .../include/openssl/des.h | 2 ++ .../include/openssl/digest.h | 2 ++ .../include/openssl/ec.h | 2 ++ .../include/openssl/ec_key.h | 2 ++ .../include/openssl/ecdsa.h | 2 ++ .../include/openssl/engine.h | 2 ++ .../include/openssl/err.h | 2 ++ .../include/openssl/evp.h | 2 ++ .../include/openssl/ex_data.h | 2 ++ .../include/openssl/hkdf.h | 2 ++ .../include/openssl/hmac.h | 2 ++ .../include/openssl/md5.h | 2 ++ .../include/openssl/mem.h | 2 ++ .../include/openssl/nid.h | 2 ++ .../include/openssl/obj.h | 2 ++ .../include/openssl/pem.h | 2 ++ .../include/openssl/rand.h | 2 ++ .../include/openssl/rsa.h | 2 ++ .../include/openssl/sha.h | 2 ++ .../include/openssl/ssl.h | 3 ++- .../include/openssl/ssl3.h | 3 ++- .../include/openssl/ssl_dbg.h | 3 ++- .../include/openssl/ssl_local.h | 3 ++- .../include/openssl/stack.h | 2 ++ .../include/openssl/statem.h | 2 ++ .../include/openssl/tls1.h | 3 ++- .../include/openssl/types.h | 3 ++- .../include/openssl/x509.h | 2 ++ .../include/openssl/x509_local.h | 3 ++- .../include/openssl/x509_vfy.h | 3 ++- .../include/openssl/x509v3.h | 2 ++ crypto/openssl_mbedtls_wrapper/mbedtls/aes.c | 2 ++ crypto/openssl_mbedtls_wrapper/mbedtls/asn1.c | 2 ++ crypto/openssl_mbedtls_wrapper/mbedtls/bn.c | 2 ++ .../mbedtls/bytestring.c | 2 ++ .../openssl_mbedtls_wrapper/mbedtls/cipher.c | 2 ++ .../mbedtls/curve25519.c | 2 ++ .../openssl_mbedtls_wrapper/mbedtls/digest.c | 2 ++ crypto/openssl_mbedtls_wrapper/mbedtls/ec.c | 2 ++ .../openssl_mbedtls_wrapper/mbedtls/ec_key.c | 2 ++ .../openssl_mbedtls_wrapper/mbedtls/ecdsa.c | 2 ++ .../openssl_mbedtls_wrapper/mbedtls/engine.c | 2 ++ crypto/openssl_mbedtls_wrapper/mbedtls/err.c | 2 ++ crypto/openssl_mbedtls_wrapper/mbedtls/evp.c | 2 ++ crypto/openssl_mbedtls_wrapper/mbedtls/hkdf.c | 2 ++ crypto/openssl_mbedtls_wrapper/mbedtls/hmac.c | 2 ++ crypto/openssl_mbedtls_wrapper/mbedtls/md5.c | 2 ++ crypto/openssl_mbedtls_wrapper/mbedtls/mem.c | 2 ++ crypto/openssl_mbedtls_wrapper/mbedtls/obj.c | 2 ++ .../openssl_mbedtls_wrapper/mbedtls/pbkdf.c | 2 ++ crypto/openssl_mbedtls_wrapper/mbedtls/rand.c | 2 ++ crypto/openssl_mbedtls_wrapper/mbedtls/rsa.c | 2 ++ crypto/openssl_mbedtls_wrapper/mbedtls/sha.c | 2 ++ .../mbedtls/ssl_cert.c | 3 ++- .../openssl_mbedtls_wrapper/mbedtls/ssl_lib.c | 3 ++- .../mbedtls/ssl_methods.c | 3 ++- .../mbedtls/ssl_methods.h | 3 ++- .../openssl_mbedtls_wrapper/mbedtls/ssl_pm.c | 3 ++- .../openssl_mbedtls_wrapper/mbedtls/ssl_pm.h | 3 ++- .../mbedtls/ssl_port.c | 3 ++- .../mbedtls/ssl_port.h | 3 ++- .../openssl_mbedtls_wrapper/mbedtls/ssl_rsa.c | 3 ++- .../openssl_mbedtls_wrapper/mbedtls/stack.c | 3 ++- .../openssl_mbedtls_wrapper/mbedtls/statem.c | 3 ++- crypto/openssl_mbedtls_wrapper/mbedtls/x509.c | 2 ++ .../mbedtls/x509_vpm.c | 3 ++- crypto/tinycrypt/CMakeLists.txt | 2 ++ crypto/tinycrypt/Make.defs | 2 ++ crypto/tinycrypt/Makefile | 2 ++ crypto/tinydtls/CMakeLists.txt | 2 ++ crypto/wolfssl/Make.defs | 22 +++++++++++++++++++ crypto/wolfssl/Makefile | 22 +++++++++++++++++++ crypto/wolfssl/user_settings.h | 21 ++++++++++++++++++ 128 files changed, 314 insertions(+), 21 deletions(-) diff --git a/crypto/CMakeLists.txt b/crypto/CMakeLists.txt index bd180bdb534..5f093c33cd2 100644 --- a/crypto/CMakeLists.txt +++ b/crypto/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/crypto/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/crypto/controlse/CMakeLists.txt b/crypto/controlse/CMakeLists.txt index 72fb36e0176..5ffa43cfdec 100644 --- a/crypto/controlse/CMakeLists.txt +++ b/crypto/controlse/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/crypto/controlse/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/crypto/controlse/Make.defs b/crypto/controlse/Make.defs index 0e1fad585df..45536c46836 100644 --- a/crypto/controlse/Make.defs +++ b/crypto/controlse/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/crypto/controlse/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/crypto/controlse/Makefile b/crypto/controlse/Makefile index c338507d1e4..f4ba03a4029 100644 --- a/crypto/controlse/Makefile +++ b/crypto/controlse/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/crypto/controlse/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/crypto/controlse/ccertificate.cxx b/crypto/controlse/ccertificate.cxx index 5731c4ddd0b..4d663ea7538 100644 --- a/crypto/controlse/ccertificate.cxx +++ b/crypto/controlse/ccertificate.cxx @@ -1,6 +1,8 @@ //*************************************************************************** // apps/crypto/controlse/ccertificate.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/crypto/controlse/ccsr.cxx b/crypto/controlse/ccsr.cxx index e57f7b0d115..9c3326468ea 100644 --- a/crypto/controlse/ccsr.cxx +++ b/crypto/controlse/ccsr.cxx @@ -1,6 +1,8 @@ //*************************************************************************** // apps/crypto/controlse/ccsr.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/crypto/controlse/chex_util.cxx b/crypto/controlse/chex_util.cxx index e2aebae7651..1e0f7e12a5c 100644 --- a/crypto/controlse/chex_util.cxx +++ b/crypto/controlse/chex_util.cxx @@ -1,6 +1,8 @@ //*************************************************************************** // apps/crypto/controlse/chex_util.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/crypto/controlse/cmbedtls_se05x_extension.hxx b/crypto/controlse/cmbedtls_se05x_extension.hxx index 4e8fda7703d..8289b124c71 100644 --- a/crypto/controlse/cmbedtls_se05x_extension.hxx +++ b/crypto/controlse/cmbedtls_se05x_extension.hxx @@ -1,6 +1,8 @@ //*************************************************************************** // apps/crypto/controlse/cmbedtls_se05x_extensions.hxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/crypto/controlse/controlse_main.cxx b/crypto/controlse/controlse_main.cxx index 238a85233db..8c0f07cbcb4 100644 --- a/crypto/controlse/controlse_main.cxx +++ b/crypto/controlse/controlse_main.cxx @@ -1,6 +1,8 @@ //*************************************************************************** // apps/crypto/controlse/controlse_main.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/crypto/controlse/cpublic_key.cxx b/crypto/controlse/cpublic_key.cxx index 10a7aad91d9..097ef32709b 100644 --- a/crypto/controlse/cpublic_key.cxx +++ b/crypto/controlse/cpublic_key.cxx @@ -1,6 +1,8 @@ //*************************************************************************** // apps/crypto/controlse/cpublic_key.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/crypto/controlse/csan_builder.cxx b/crypto/controlse/csan_builder.cxx index 60a9040aea2..b25a4e5d2d4 100644 --- a/crypto/controlse/csan_builder.cxx +++ b/crypto/controlse/csan_builder.cxx @@ -1,6 +1,8 @@ //*************************************************************************** // apps/crypto/controlse/csan_builder.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/crypto/controlse/csecure_element.cxx b/crypto/controlse/csecure_element.cxx index e6c11d8941a..cacdd0edd42 100644 --- a/crypto/controlse/csecure_element.cxx +++ b/crypto/controlse/csecure_element.cxx @@ -1,6 +1,8 @@ //*************************************************************************** // apps/crypto/controlse/csecure_element.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/crypto/controlse/cserial_number.cxx b/crypto/controlse/cserial_number.cxx index 517d1b2296e..219689dab2a 100644 --- a/crypto/controlse/cserial_number.cxx +++ b/crypto/controlse/cserial_number.cxx @@ -1,6 +1,8 @@ //*************************************************************************** // apps/crypto/controlse/cserial_number.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/crypto/controlse/cstring.cxx b/crypto/controlse/cstring.cxx index ff7637005d2..dc2e9000c53 100644 --- a/crypto/controlse/cstring.cxx +++ b/crypto/controlse/cstring.cxx @@ -1,6 +1,8 @@ //*************************************************************************** // apps/crypto/controlse/cstring.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/crypto/libsodium/CMakeLists.txt b/crypto/libsodium/CMakeLists.txt index 1d1f9a004c8..daf7b326be6 100644 --- a/crypto/libsodium/CMakeLists.txt +++ b/crypto/libsodium/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/crypto/libsodium/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/crypto/libsodium/Make.defs b/crypto/libsodium/Make.defs index 156cc2fbd88..acae50f130d 100644 --- a/crypto/libsodium/Make.defs +++ b/crypto/libsodium/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/crypto/libsodium/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/crypto/libsodium/Makefile b/crypto/libsodium/Makefile index dfee8165114..68318a7175f 100644 --- a/crypto/libsodium/Makefile +++ b/crypto/libsodium/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/crypto/libsodium/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/crypto/libtomcrypt/CMakeLists.txt b/crypto/libtomcrypt/CMakeLists.txt index 0811bf1d549..d3fb2a5dcd0 100644 --- a/crypto/libtomcrypt/CMakeLists.txt +++ b/crypto/libtomcrypt/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/crypto/libtomcrypt/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/crypto/libtomcrypt/Make.defs b/crypto/libtomcrypt/Make.defs index a31d953f1a6..0fac308ff98 100644 --- a/crypto/libtomcrypt/Make.defs +++ b/crypto/libtomcrypt/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/crypto/libtomcrypt/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/crypto/libtomcrypt/Makefile b/crypto/libtomcrypt/Makefile index 6911fe503e7..68219a8cf89 100644 --- a/crypto/libtomcrypt/Makefile +++ b/crypto/libtomcrypt/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/crypto/libtomcrypt/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/crypto/mbedtls/CMakeLists.txt b/crypto/mbedtls/CMakeLists.txt index 1c93dc89491..9a80ffab92c 100644 --- a/crypto/mbedtls/CMakeLists.txt +++ b/crypto/mbedtls/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/crypto/mbedtls/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/crypto/mbedtls/Make.defs b/crypto/mbedtls/Make.defs index 3cb722d5227..a7c9a21ffbb 100644 --- a/crypto/mbedtls/Make.defs +++ b/crypto/mbedtls/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/crypto/mbedtls/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/crypto/mbedtls/Makefile b/crypto/mbedtls/Makefile index 574f297b893..3428aa0e9b1 100644 --- a/crypto/mbedtls/Makefile +++ b/crypto/mbedtls/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/crypto/mbedtls/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/crypto/mbedtls/include/aes_alt.h b/crypto/mbedtls/include/aes_alt.h index 59077382935..0ba13cc419d 100644 --- a/crypto/mbedtls/include/aes_alt.h +++ b/crypto/mbedtls/include/aes_alt.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/mbedtls/include/aes_alt.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/mbedtls/include/cmac_alt.h b/crypto/mbedtls/include/cmac_alt.h index 4d3d73b673c..a6068aabcb2 100644 --- a/crypto/mbedtls/include/cmac_alt.h +++ b/crypto/mbedtls/include/cmac_alt.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/mbedtls/include/cmac_alt.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/mbedtls/include/dev_alt.h b/crypto/mbedtls/include/dev_alt.h index cc5b581d5e1..caed8b9ebbe 100644 --- a/crypto/mbedtls/include/dev_alt.h +++ b/crypto/mbedtls/include/dev_alt.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/mbedtls/include/dev_alt.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/mbedtls/include/mbedtls/mbedtls_config.h b/crypto/mbedtls/include/mbedtls/mbedtls_config.h index bf8c7b72fca..f61cb60c0b8 100644 --- a/crypto/mbedtls/include/mbedtls/mbedtls_config.h +++ b/crypto/mbedtls/include/mbedtls/mbedtls_config.h @@ -1,8 +1,8 @@ /**************************************************************************** * apps/crypto/mbedtls/include/mbedtls/mbedtls_config.h * - * Copyright The Mbed TLS Contributors * SPDX-License-Identifier: Apache-2.0 + * SPDX-FileCopyrightText: Copyright The Mbed TLS Contributors * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with diff --git a/crypto/mbedtls/include/md5_alt.h b/crypto/mbedtls/include/md5_alt.h index 5c1b93b9a1b..4c0fdb292a2 100644 --- a/crypto/mbedtls/include/md5_alt.h +++ b/crypto/mbedtls/include/md5_alt.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/mbedtls/include/md5_alt.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/mbedtls/include/poly1305_alt.h b/crypto/mbedtls/include/poly1305_alt.h index fa6e29a41b0..7f55f707328 100644 --- a/crypto/mbedtls/include/poly1305_alt.h +++ b/crypto/mbedtls/include/poly1305_alt.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/mbedtls/include/poly1305_alt.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/mbedtls/include/ripemd160_alt.h b/crypto/mbedtls/include/ripemd160_alt.h index 03ba2a4b0ea..8911d919f7c 100644 --- a/crypto/mbedtls/include/ripemd160_alt.h +++ b/crypto/mbedtls/include/ripemd160_alt.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/mbedtls/include/ripemd160_alt.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/mbedtls/include/sha1_alt.h b/crypto/mbedtls/include/sha1_alt.h index 429ebee65de..dede5176214 100644 --- a/crypto/mbedtls/include/sha1_alt.h +++ b/crypto/mbedtls/include/sha1_alt.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/mbedtls/include/sha1_alt.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/mbedtls/include/sha256_alt.h b/crypto/mbedtls/include/sha256_alt.h index 9e75530f083..bfbf135e89c 100644 --- a/crypto/mbedtls/include/sha256_alt.h +++ b/crypto/mbedtls/include/sha256_alt.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/mbedtls/include/sha256_alt.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/mbedtls/include/sha512_alt.h b/crypto/mbedtls/include/sha512_alt.h index 663e755b692..b12adeee4f0 100644 --- a/crypto/mbedtls/include/sha512_alt.h +++ b/crypto/mbedtls/include/sha512_alt.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/mbedtls/include/sha512_alt.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/mbedtls/source/aes_alt.c b/crypto/mbedtls/source/aes_alt.c index f3e8b6e1ca9..23baa195970 100644 --- a/crypto/mbedtls/source/aes_alt.c +++ b/crypto/mbedtls/source/aes_alt.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/mbedtls/source/aes_alt.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/mbedtls/source/bignum_alt.c b/crypto/mbedtls/source/bignum_alt.c index fe0fe8d51d5..4cdddc25f61 100644 --- a/crypto/mbedtls/source/bignum_alt.c +++ b/crypto/mbedtls/source/bignum_alt.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/mbedtls/source/bignum_alt.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/mbedtls/source/cmac_alt.c b/crypto/mbedtls/source/cmac_alt.c index 0b7ed61e973..a72ef94b02b 100644 --- a/crypto/mbedtls/source/cmac_alt.c +++ b/crypto/mbedtls/source/cmac_alt.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/mbedtls/source/cmac_alt.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/mbedtls/source/dev_alt.c b/crypto/mbedtls/source/dev_alt.c index 9f9206445ef..1c5c290afb3 100644 --- a/crypto/mbedtls/source/dev_alt.c +++ b/crypto/mbedtls/source/dev_alt.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/mbedtls/source/dev_alt.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/mbedtls/source/entropy_alt.c b/crypto/mbedtls/source/entropy_alt.c index 950d78dbd5c..08323e76c50 100644 --- a/crypto/mbedtls/source/entropy_alt.c +++ b/crypto/mbedtls/source/entropy_alt.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/mbedtls/source/entropy_alt.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/mbedtls/source/md5_alt.c b/crypto/mbedtls/source/md5_alt.c index 7518305e9bb..0a9886a7bb9 100644 --- a/crypto/mbedtls/source/md5_alt.c +++ b/crypto/mbedtls/source/md5_alt.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/mbedtls/source/md5_alt.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/mbedtls/source/poly1305_alt.c b/crypto/mbedtls/source/poly1305_alt.c index b956fc395f7..7c0e8110f66 100644 --- a/crypto/mbedtls/source/poly1305_alt.c +++ b/crypto/mbedtls/source/poly1305_alt.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/mbedtls/source/poly1305_alt.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/mbedtls/source/ripemd160_alt.c b/crypto/mbedtls/source/ripemd160_alt.c index 46db7474b38..2107a63d1be 100644 --- a/crypto/mbedtls/source/ripemd160_alt.c +++ b/crypto/mbedtls/source/ripemd160_alt.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/mbedtls/source/ripemd160_alt.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/mbedtls/source/sha1_alt.c b/crypto/mbedtls/source/sha1_alt.c index 4d548e4c127..8c3e6b353db 100644 --- a/crypto/mbedtls/source/sha1_alt.c +++ b/crypto/mbedtls/source/sha1_alt.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/mbedtls/source/sha1_alt.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/mbedtls/source/sha256_alt.c b/crypto/mbedtls/source/sha256_alt.c index 8d154cae579..7b716acb869 100644 --- a/crypto/mbedtls/source/sha256_alt.c +++ b/crypto/mbedtls/source/sha256_alt.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/mbedtls/source/sha256_alt.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/mbedtls/source/sha512_alt.c b/crypto/mbedtls/source/sha512_alt.c index 6c75fff5f94..2793b8426c1 100644 --- a/crypto/mbedtls/source/sha512_alt.c +++ b/crypto/mbedtls/source/sha512_alt.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/mbedtls/source/sha512_alt.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/CMakeLists.txt b/crypto/openssl_mbedtls_wrapper/CMakeLists.txt index d993711b36c..d16c5c6a1b7 100644 --- a/crypto/openssl_mbedtls_wrapper/CMakeLists.txt +++ b/crypto/openssl_mbedtls_wrapper/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/crypto/openssl_mbedtls_wrapper/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/crypto/openssl_mbedtls_wrapper/Make.defs b/crypto/openssl_mbedtls_wrapper/Make.defs index 611dc7321e6..21f0e1cfb6b 100644 --- a/crypto/openssl_mbedtls_wrapper/Make.defs +++ b/crypto/openssl_mbedtls_wrapper/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/crypto/openssl_mbedtls_wrapper/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/Makefile b/crypto/openssl_mbedtls_wrapper/Makefile index b8fb81b4859..25f79c63ecb 100644 --- a/crypto/openssl_mbedtls_wrapper/Makefile +++ b/crypto/openssl_mbedtls_wrapper/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/crypto/openssl_mbedtls_wrapper/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/include/openssl/aes.h b/crypto/openssl_mbedtls_wrapper/include/openssl/aes.h index a76646aaba9..4dd165d3819 100644 --- a/crypto/openssl_mbedtls_wrapper/include/openssl/aes.h +++ b/crypto/openssl_mbedtls_wrapper/include/openssl/aes.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/include/openssl/aes.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/include/openssl/asn1.h b/crypto/openssl_mbedtls_wrapper/include/openssl/asn1.h index 3c0284bc9ac..4bacafd4095 100644 --- a/crypto/openssl_mbedtls_wrapper/include/openssl/asn1.h +++ b/crypto/openssl_mbedtls_wrapper/include/openssl/asn1.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/include/openssl/asn1.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/include/openssl/base.h b/crypto/openssl_mbedtls_wrapper/include/openssl/base.h index b621aabe89d..93ec89a5503 100644 --- a/crypto/openssl_mbedtls_wrapper/include/openssl/base.h +++ b/crypto/openssl_mbedtls_wrapper/include/openssl/base.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/include/openssl/base.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/include/openssl/bio.h b/crypto/openssl_mbedtls_wrapper/include/openssl/bio.h index b2a55b3fbd3..be8acf1987a 100644 --- a/crypto/openssl_mbedtls_wrapper/include/openssl/bio.h +++ b/crypto/openssl_mbedtls_wrapper/include/openssl/bio.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/include/openssl/bio.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/include/openssl/bn.h b/crypto/openssl_mbedtls_wrapper/include/openssl/bn.h index 0080c0f021f..25b2bcda853 100644 --- a/crypto/openssl_mbedtls_wrapper/include/openssl/bn.h +++ b/crypto/openssl_mbedtls_wrapper/include/openssl/bn.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/include/openssl/bn.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/include/openssl/bytestring.h b/crypto/openssl_mbedtls_wrapper/include/openssl/bytestring.h index 76f1272c445..b0fc679522e 100644 --- a/crypto/openssl_mbedtls_wrapper/include/openssl/bytestring.h +++ b/crypto/openssl_mbedtls_wrapper/include/openssl/bytestring.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/include/openssl/bytestring.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/include/openssl/cipher.h b/crypto/openssl_mbedtls_wrapper/include/openssl/cipher.h index d057adb53ba..f7ad5c1539e 100644 --- a/crypto/openssl_mbedtls_wrapper/include/openssl/cipher.h +++ b/crypto/openssl_mbedtls_wrapper/include/openssl/cipher.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/include/openssl/cipher.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/include/openssl/curve25519.h b/crypto/openssl_mbedtls_wrapper/include/openssl/curve25519.h index e339a2a76b5..3c9847c67fe 100644 --- a/crypto/openssl_mbedtls_wrapper/include/openssl/curve25519.h +++ b/crypto/openssl_mbedtls_wrapper/include/openssl/curve25519.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/include/openssl/curve25519.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/include/openssl/des.h b/crypto/openssl_mbedtls_wrapper/include/openssl/des.h index 46c2f62ceed..2c26a25bc9b 100644 --- a/crypto/openssl_mbedtls_wrapper/include/openssl/des.h +++ b/crypto/openssl_mbedtls_wrapper/include/openssl/des.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/include/openssl/des.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/include/openssl/digest.h b/crypto/openssl_mbedtls_wrapper/include/openssl/digest.h index 19d86a411de..8dab5d380dd 100644 --- a/crypto/openssl_mbedtls_wrapper/include/openssl/digest.h +++ b/crypto/openssl_mbedtls_wrapper/include/openssl/digest.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/include/openssl/digest.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/include/openssl/ec.h b/crypto/openssl_mbedtls_wrapper/include/openssl/ec.h index 80fb6644a34..fd906035e88 100644 --- a/crypto/openssl_mbedtls_wrapper/include/openssl/ec.h +++ b/crypto/openssl_mbedtls_wrapper/include/openssl/ec.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/include/openssl/ec.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/include/openssl/ec_key.h b/crypto/openssl_mbedtls_wrapper/include/openssl/ec_key.h index dcb4042aadb..2fbd13709c0 100644 --- a/crypto/openssl_mbedtls_wrapper/include/openssl/ec_key.h +++ b/crypto/openssl_mbedtls_wrapper/include/openssl/ec_key.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/include/openssl/ec_key.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/include/openssl/ecdsa.h b/crypto/openssl_mbedtls_wrapper/include/openssl/ecdsa.h index e053bb33794..426680bb3d7 100644 --- a/crypto/openssl_mbedtls_wrapper/include/openssl/ecdsa.h +++ b/crypto/openssl_mbedtls_wrapper/include/openssl/ecdsa.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/include/openssl/ecdsa.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/include/openssl/engine.h b/crypto/openssl_mbedtls_wrapper/include/openssl/engine.h index dea3f35da92..7972fbee7cd 100644 --- a/crypto/openssl_mbedtls_wrapper/include/openssl/engine.h +++ b/crypto/openssl_mbedtls_wrapper/include/openssl/engine.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/include/openssl/engine.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/include/openssl/err.h b/crypto/openssl_mbedtls_wrapper/include/openssl/err.h index e406d13647a..f6637eca423 100644 --- a/crypto/openssl_mbedtls_wrapper/include/openssl/err.h +++ b/crypto/openssl_mbedtls_wrapper/include/openssl/err.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/include/openssl/err.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/include/openssl/evp.h b/crypto/openssl_mbedtls_wrapper/include/openssl/evp.h index ae5fae9cf08..f65a51d88d3 100644 --- a/crypto/openssl_mbedtls_wrapper/include/openssl/evp.h +++ b/crypto/openssl_mbedtls_wrapper/include/openssl/evp.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/include/openssl/evp.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/include/openssl/ex_data.h b/crypto/openssl_mbedtls_wrapper/include/openssl/ex_data.h index a00d0b9f80b..b77ba49b85a 100644 --- a/crypto/openssl_mbedtls_wrapper/include/openssl/ex_data.h +++ b/crypto/openssl_mbedtls_wrapper/include/openssl/ex_data.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/include/openssl/ex_data.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/include/openssl/hkdf.h b/crypto/openssl_mbedtls_wrapper/include/openssl/hkdf.h index 988cff53ab4..1b59993580c 100644 --- a/crypto/openssl_mbedtls_wrapper/include/openssl/hkdf.h +++ b/crypto/openssl_mbedtls_wrapper/include/openssl/hkdf.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/include/openssl/hkdf.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/include/openssl/hmac.h b/crypto/openssl_mbedtls_wrapper/include/openssl/hmac.h index 9e3aead63d4..b44e3626a92 100644 --- a/crypto/openssl_mbedtls_wrapper/include/openssl/hmac.h +++ b/crypto/openssl_mbedtls_wrapper/include/openssl/hmac.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/include/openssl/hmac.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/include/openssl/md5.h b/crypto/openssl_mbedtls_wrapper/include/openssl/md5.h index 492d9a3bb52..b77faf9bc26 100644 --- a/crypto/openssl_mbedtls_wrapper/include/openssl/md5.h +++ b/crypto/openssl_mbedtls_wrapper/include/openssl/md5.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/include/openssl/md5.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/include/openssl/mem.h b/crypto/openssl_mbedtls_wrapper/include/openssl/mem.h index f1c001c5721..f657068f54f 100644 --- a/crypto/openssl_mbedtls_wrapper/include/openssl/mem.h +++ b/crypto/openssl_mbedtls_wrapper/include/openssl/mem.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/include/openssl/mem.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/include/openssl/nid.h b/crypto/openssl_mbedtls_wrapper/include/openssl/nid.h index 2aa36b077de..975af6f7abb 100644 --- a/crypto/openssl_mbedtls_wrapper/include/openssl/nid.h +++ b/crypto/openssl_mbedtls_wrapper/include/openssl/nid.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/include/openssl/nid.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/include/openssl/obj.h b/crypto/openssl_mbedtls_wrapper/include/openssl/obj.h index 2e011a486aa..4351c5113c8 100644 --- a/crypto/openssl_mbedtls_wrapper/include/openssl/obj.h +++ b/crypto/openssl_mbedtls_wrapper/include/openssl/obj.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/include/openssl/obj.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/include/openssl/pem.h b/crypto/openssl_mbedtls_wrapper/include/openssl/pem.h index b14a6c979f4..0af64792f1a 100644 --- a/crypto/openssl_mbedtls_wrapper/include/openssl/pem.h +++ b/crypto/openssl_mbedtls_wrapper/include/openssl/pem.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/include/openssl/pem.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/include/openssl/rand.h b/crypto/openssl_mbedtls_wrapper/include/openssl/rand.h index 3f14f94a24c..51dc428aec4 100644 --- a/crypto/openssl_mbedtls_wrapper/include/openssl/rand.h +++ b/crypto/openssl_mbedtls_wrapper/include/openssl/rand.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/include/openssl/rand.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/include/openssl/rsa.h b/crypto/openssl_mbedtls_wrapper/include/openssl/rsa.h index 0337b4ff9ab..4c5655deb68 100644 --- a/crypto/openssl_mbedtls_wrapper/include/openssl/rsa.h +++ b/crypto/openssl_mbedtls_wrapper/include/openssl/rsa.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/include/openssl/rsa.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/include/openssl/sha.h b/crypto/openssl_mbedtls_wrapper/include/openssl/sha.h index 423d2b33590..c2577319f47 100644 --- a/crypto/openssl_mbedtls_wrapper/include/openssl/sha.h +++ b/crypto/openssl_mbedtls_wrapper/include/openssl/sha.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/include/openssl/sha.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/include/openssl/ssl.h b/crypto/openssl_mbedtls_wrapper/include/openssl/ssl.h index c8d29788e98..937c1ab95df 100644 --- a/crypto/openssl_mbedtls_wrapper/include/openssl/ssl.h +++ b/crypto/openssl_mbedtls_wrapper/include/openssl/ssl.h @@ -1,7 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/include/openssl/ssl.h * - * Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD + * SPDX-License-Identifier: Apache-2.0 + * SPDX-FileCopyrightText: 2015-2016 Espressif Systems (Shanghai) PTE LTD * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/crypto/openssl_mbedtls_wrapper/include/openssl/ssl3.h b/crypto/openssl_mbedtls_wrapper/include/openssl/ssl3.h index 43a809a3b8f..8e280637926 100644 --- a/crypto/openssl_mbedtls_wrapper/include/openssl/ssl3.h +++ b/crypto/openssl_mbedtls_wrapper/include/openssl/ssl3.h @@ -1,7 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/include/openssl/ssl3.h * - * Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD + * SPDX-License-Identifier: Apache-2.0 + * SPDX-FileCopyrightText: 2015-2016 Espressif Systems (Shanghai) PTE LTD * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/crypto/openssl_mbedtls_wrapper/include/openssl/ssl_dbg.h b/crypto/openssl_mbedtls_wrapper/include/openssl/ssl_dbg.h index 1d433e44a0f..84fc7ac629e 100644 --- a/crypto/openssl_mbedtls_wrapper/include/openssl/ssl_dbg.h +++ b/crypto/openssl_mbedtls_wrapper/include/openssl/ssl_dbg.h @@ -1,7 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/include/openssl/ssl_dbg.h * - * Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD + * SPDX-License-Identifier: Apache-2.0 + * SPDX-FileCopyrightText: 2015-2016 Espressif Systems (Shanghai) PTE LTD * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/crypto/openssl_mbedtls_wrapper/include/openssl/ssl_local.h b/crypto/openssl_mbedtls_wrapper/include/openssl/ssl_local.h index 082be2bcc8e..b9295d1c96d 100644 --- a/crypto/openssl_mbedtls_wrapper/include/openssl/ssl_local.h +++ b/crypto/openssl_mbedtls_wrapper/include/openssl/ssl_local.h @@ -1,7 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/include/openssl/ssl_local.h * - * Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD + * SPDX-License-Identifier: Apache-2.0 + * SPDX-FileCopyrightText: 2015-2016 Espressif Systems (Shanghai) PTE LTD * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/crypto/openssl_mbedtls_wrapper/include/openssl/stack.h b/crypto/openssl_mbedtls_wrapper/include/openssl/stack.h index 9419b22db20..b92138ee0b4 100644 --- a/crypto/openssl_mbedtls_wrapper/include/openssl/stack.h +++ b/crypto/openssl_mbedtls_wrapper/include/openssl/stack.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/include/openssl/stack.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/include/openssl/statem.h b/crypto/openssl_mbedtls_wrapper/include/openssl/statem.h index bdd6dd281fa..c3f1e940620 100644 --- a/crypto/openssl_mbedtls_wrapper/include/openssl/statem.h +++ b/crypto/openssl_mbedtls_wrapper/include/openssl/statem.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/include/openssl/statem.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/include/openssl/tls1.h b/crypto/openssl_mbedtls_wrapper/include/openssl/tls1.h index 3b04682217b..57fd4fa269d 100644 --- a/crypto/openssl_mbedtls_wrapper/include/openssl/tls1.h +++ b/crypto/openssl_mbedtls_wrapper/include/openssl/tls1.h @@ -1,7 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/include/openssl/tls1.h * - * Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD + * SPDX-License-Identifier: Apache-2.0 + * SPDX-FileCopyrightText: 2015-2016 Espressif Systems (Shanghai) PTE LTD * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/crypto/openssl_mbedtls_wrapper/include/openssl/types.h b/crypto/openssl_mbedtls_wrapper/include/openssl/types.h index b66b2c6b7bc..679fb94c591 100644 --- a/crypto/openssl_mbedtls_wrapper/include/openssl/types.h +++ b/crypto/openssl_mbedtls_wrapper/include/openssl/types.h @@ -1,7 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/include/openssl/types.h * - * Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD + * SPDX-License-Identifier: Apache-2.0 + * SPDX-FileCopyrightText: 2015-2016 Espressif Systems (Shanghai) PTE LTD * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/crypto/openssl_mbedtls_wrapper/include/openssl/x509.h b/crypto/openssl_mbedtls_wrapper/include/openssl/x509.h index d7d83847eaa..847aaa4bc33 100644 --- a/crypto/openssl_mbedtls_wrapper/include/openssl/x509.h +++ b/crypto/openssl_mbedtls_wrapper/include/openssl/x509.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/include/openssl/x509.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/include/openssl/x509_local.h b/crypto/openssl_mbedtls_wrapper/include/openssl/x509_local.h index ddecc62092a..83799e9b7ba 100644 --- a/crypto/openssl_mbedtls_wrapper/include/openssl/x509_local.h +++ b/crypto/openssl_mbedtls_wrapper/include/openssl/x509_local.h @@ -1,7 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/include/openssl/x509_local.h * - * Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD + * SPDX-License-Identifier: Apache-2.0 + * SPDX-FileCopyrightText: 2015-2016 Espressif Systems (Shanghai) PTE LTD * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/crypto/openssl_mbedtls_wrapper/include/openssl/x509_vfy.h b/crypto/openssl_mbedtls_wrapper/include/openssl/x509_vfy.h index 1cda9abd723..9ecf4fc273f 100644 --- a/crypto/openssl_mbedtls_wrapper/include/openssl/x509_vfy.h +++ b/crypto/openssl_mbedtls_wrapper/include/openssl/x509_vfy.h @@ -1,7 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/include/openssl/x509_vfy.h * - * Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD + * SPDX-License-Identifier: Apache-2.0 + * SPDX-FileCopyrightText: 2015-2016 Espressif Systems (Shanghai) PTE LTD * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/crypto/openssl_mbedtls_wrapper/include/openssl/x509v3.h b/crypto/openssl_mbedtls_wrapper/include/openssl/x509v3.h index e82e0231acf..9f39a729aaf 100644 --- a/crypto/openssl_mbedtls_wrapper/include/openssl/x509v3.h +++ b/crypto/openssl_mbedtls_wrapper/include/openssl/x509v3.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/include/openssl/x509v3.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/mbedtls/aes.c b/crypto/openssl_mbedtls_wrapper/mbedtls/aes.c index 7cc64b63429..988fec80a2a 100644 --- a/crypto/openssl_mbedtls_wrapper/mbedtls/aes.c +++ b/crypto/openssl_mbedtls_wrapper/mbedtls/aes.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/mbedtls/aes.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/mbedtls/asn1.c b/crypto/openssl_mbedtls_wrapper/mbedtls/asn1.c index 7d33fd6800d..343ccc965ff 100644 --- a/crypto/openssl_mbedtls_wrapper/mbedtls/asn1.c +++ b/crypto/openssl_mbedtls_wrapper/mbedtls/asn1.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/mbedtls/asn1.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/mbedtls/bn.c b/crypto/openssl_mbedtls_wrapper/mbedtls/bn.c index 3a8dfdc73cf..a066c0b1978 100644 --- a/crypto/openssl_mbedtls_wrapper/mbedtls/bn.c +++ b/crypto/openssl_mbedtls_wrapper/mbedtls/bn.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/mbedtls/bn.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/mbedtls/bytestring.c b/crypto/openssl_mbedtls_wrapper/mbedtls/bytestring.c index c6866bafeec..68dfc5e0614 100644 --- a/crypto/openssl_mbedtls_wrapper/mbedtls/bytestring.c +++ b/crypto/openssl_mbedtls_wrapper/mbedtls/bytestring.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/mbedtls/bytestring.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/mbedtls/cipher.c b/crypto/openssl_mbedtls_wrapper/mbedtls/cipher.c index 8b4a202c15d..3cbb25cc634 100644 --- a/crypto/openssl_mbedtls_wrapper/mbedtls/cipher.c +++ b/crypto/openssl_mbedtls_wrapper/mbedtls/cipher.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/mbedtls/cipher.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/mbedtls/curve25519.c b/crypto/openssl_mbedtls_wrapper/mbedtls/curve25519.c index db80f0bfe16..eaa105a5216 100644 --- a/crypto/openssl_mbedtls_wrapper/mbedtls/curve25519.c +++ b/crypto/openssl_mbedtls_wrapper/mbedtls/curve25519.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/mbedtls/curve25519.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/mbedtls/digest.c b/crypto/openssl_mbedtls_wrapper/mbedtls/digest.c index 14e85b53324..41412d396c1 100644 --- a/crypto/openssl_mbedtls_wrapper/mbedtls/digest.c +++ b/crypto/openssl_mbedtls_wrapper/mbedtls/digest.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/mbedtls/digest.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/mbedtls/ec.c b/crypto/openssl_mbedtls_wrapper/mbedtls/ec.c index 9e07cea95a2..410cb2a313d 100644 --- a/crypto/openssl_mbedtls_wrapper/mbedtls/ec.c +++ b/crypto/openssl_mbedtls_wrapper/mbedtls/ec.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/mbedtls/ec.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/mbedtls/ec_key.c b/crypto/openssl_mbedtls_wrapper/mbedtls/ec_key.c index c5e26b2f28b..0fe4287c5ee 100644 --- a/crypto/openssl_mbedtls_wrapper/mbedtls/ec_key.c +++ b/crypto/openssl_mbedtls_wrapper/mbedtls/ec_key.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/mbedtls/ec_key.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/mbedtls/ecdsa.c b/crypto/openssl_mbedtls_wrapper/mbedtls/ecdsa.c index 76b1352d5db..b289a41e269 100644 --- a/crypto/openssl_mbedtls_wrapper/mbedtls/ecdsa.c +++ b/crypto/openssl_mbedtls_wrapper/mbedtls/ecdsa.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/mbedtls/ecdsa.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/mbedtls/engine.c b/crypto/openssl_mbedtls_wrapper/mbedtls/engine.c index 81d73664081..3d6a398684e 100644 --- a/crypto/openssl_mbedtls_wrapper/mbedtls/engine.c +++ b/crypto/openssl_mbedtls_wrapper/mbedtls/engine.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/mbedtls/engine.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/mbedtls/err.c b/crypto/openssl_mbedtls_wrapper/mbedtls/err.c index 0332253d4d7..34dad8dc598 100644 --- a/crypto/openssl_mbedtls_wrapper/mbedtls/err.c +++ b/crypto/openssl_mbedtls_wrapper/mbedtls/err.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/mbedtls/err.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/mbedtls/evp.c b/crypto/openssl_mbedtls_wrapper/mbedtls/evp.c index 1f2b8af6caa..3045c495a67 100644 --- a/crypto/openssl_mbedtls_wrapper/mbedtls/evp.c +++ b/crypto/openssl_mbedtls_wrapper/mbedtls/evp.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/mbedtls/evp.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/mbedtls/hkdf.c b/crypto/openssl_mbedtls_wrapper/mbedtls/hkdf.c index 305e1a1c461..066442858ed 100644 --- a/crypto/openssl_mbedtls_wrapper/mbedtls/hkdf.c +++ b/crypto/openssl_mbedtls_wrapper/mbedtls/hkdf.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/mbedtls/hkdf.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/mbedtls/hmac.c b/crypto/openssl_mbedtls_wrapper/mbedtls/hmac.c index 1e962d1b5dc..2e21de016a0 100644 --- a/crypto/openssl_mbedtls_wrapper/mbedtls/hmac.c +++ b/crypto/openssl_mbedtls_wrapper/mbedtls/hmac.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/mbedtls/hmac.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/mbedtls/md5.c b/crypto/openssl_mbedtls_wrapper/mbedtls/md5.c index 7f32322ff70..0d993e06ab8 100644 --- a/crypto/openssl_mbedtls_wrapper/mbedtls/md5.c +++ b/crypto/openssl_mbedtls_wrapper/mbedtls/md5.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/mbedtls/md5.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/mbedtls/mem.c b/crypto/openssl_mbedtls_wrapper/mbedtls/mem.c index 3d8776105b9..38fd65cfe9d 100644 --- a/crypto/openssl_mbedtls_wrapper/mbedtls/mem.c +++ b/crypto/openssl_mbedtls_wrapper/mbedtls/mem.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/mbedtls/mem.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/mbedtls/obj.c b/crypto/openssl_mbedtls_wrapper/mbedtls/obj.c index 11b7e2d8acc..c529efa3df4 100644 --- a/crypto/openssl_mbedtls_wrapper/mbedtls/obj.c +++ b/crypto/openssl_mbedtls_wrapper/mbedtls/obj.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/mbedtls/obj.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/mbedtls/pbkdf.c b/crypto/openssl_mbedtls_wrapper/mbedtls/pbkdf.c index b36e58a6527..8cc890b7960 100644 --- a/crypto/openssl_mbedtls_wrapper/mbedtls/pbkdf.c +++ b/crypto/openssl_mbedtls_wrapper/mbedtls/pbkdf.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/mbedtls/pbkdf.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/mbedtls/rand.c b/crypto/openssl_mbedtls_wrapper/mbedtls/rand.c index 7266ef7e0a3..213ce5eee17 100644 --- a/crypto/openssl_mbedtls_wrapper/mbedtls/rand.c +++ b/crypto/openssl_mbedtls_wrapper/mbedtls/rand.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/mbedtls/rand.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/mbedtls/rsa.c b/crypto/openssl_mbedtls_wrapper/mbedtls/rsa.c index 8b9741e5093..2e713d09cfd 100644 --- a/crypto/openssl_mbedtls_wrapper/mbedtls/rsa.c +++ b/crypto/openssl_mbedtls_wrapper/mbedtls/rsa.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/mbedtls/rsa.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/mbedtls/sha.c b/crypto/openssl_mbedtls_wrapper/mbedtls/sha.c index 4541332fb52..dba8936cb18 100644 --- a/crypto/openssl_mbedtls_wrapper/mbedtls/sha.c +++ b/crypto/openssl_mbedtls_wrapper/mbedtls/sha.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/mbedtls/sha.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/mbedtls/ssl_cert.c b/crypto/openssl_mbedtls_wrapper/mbedtls/ssl_cert.c index 49f05b5da23..0ac5f281c92 100644 --- a/crypto/openssl_mbedtls_wrapper/mbedtls/ssl_cert.c +++ b/crypto/openssl_mbedtls_wrapper/mbedtls/ssl_cert.c @@ -1,7 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/mbedtls/ssl_cert.c * - * Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD + * SPDX-License-Identifier: Apache-2.0 + * SPDX-FileCopyrightText: 2015-2016 Espressif Systems (Shanghai) PTE LTD * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/crypto/openssl_mbedtls_wrapper/mbedtls/ssl_lib.c b/crypto/openssl_mbedtls_wrapper/mbedtls/ssl_lib.c index 7f289247d24..a4f0eea4074 100644 --- a/crypto/openssl_mbedtls_wrapper/mbedtls/ssl_lib.c +++ b/crypto/openssl_mbedtls_wrapper/mbedtls/ssl_lib.c @@ -1,7 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/mbedtls/ssl_lib.c * - * Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD + * SPDX-License-Identifier: Apache-2.0 + * SPDX-FileCopyrightText: 2015-2016 Espressif Systems (Shanghai) PTE LTD * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/crypto/openssl_mbedtls_wrapper/mbedtls/ssl_methods.c b/crypto/openssl_mbedtls_wrapper/mbedtls/ssl_methods.c index 981a205351b..7abddee9fd4 100644 --- a/crypto/openssl_mbedtls_wrapper/mbedtls/ssl_methods.c +++ b/crypto/openssl_mbedtls_wrapper/mbedtls/ssl_methods.c @@ -1,7 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/mbedtls/ssl_methods.c * - * Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD + * SPDX-License-Identifier: Apache-2.0 + * SPDX-FileCopyrightText: 2015-2016 Espressif Systems (Shanghai) PTE LTD * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/crypto/openssl_mbedtls_wrapper/mbedtls/ssl_methods.h b/crypto/openssl_mbedtls_wrapper/mbedtls/ssl_methods.h index 4b090f509a1..3c26478149b 100644 --- a/crypto/openssl_mbedtls_wrapper/mbedtls/ssl_methods.h +++ b/crypto/openssl_mbedtls_wrapper/mbedtls/ssl_methods.h @@ -1,7 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/mbedtls/ssl_methods.h * - * Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD + * SPDX-License-Identifier: Apache-2.0 + * SPDX-FileCopyrightText: 2015-2016 Espressif Systems (Shanghai) PTE LTD * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/crypto/openssl_mbedtls_wrapper/mbedtls/ssl_pm.c b/crypto/openssl_mbedtls_wrapper/mbedtls/ssl_pm.c index 39cdabb12aa..95bec900ec5 100644 --- a/crypto/openssl_mbedtls_wrapper/mbedtls/ssl_pm.c +++ b/crypto/openssl_mbedtls_wrapper/mbedtls/ssl_pm.c @@ -1,7 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/mbedtls/ssl_pm.c * - * Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD + * SPDX-License-Identifier: Apache-2.0 + * SPDX-FileCopyrightText: 2015-2016 Espressif Systems (Shanghai) PTE LTD * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/crypto/openssl_mbedtls_wrapper/mbedtls/ssl_pm.h b/crypto/openssl_mbedtls_wrapper/mbedtls/ssl_pm.h index 6d1b0f629fc..22e6eda4a44 100644 --- a/crypto/openssl_mbedtls_wrapper/mbedtls/ssl_pm.h +++ b/crypto/openssl_mbedtls_wrapper/mbedtls/ssl_pm.h @@ -1,7 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/mbedtls/ssl_pm.h * - * Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD + * SPDX-License-Identifier: Apache-2.0 + * SPDX-FileCopyrightText: 2015-2016 Espressif Systems (Shanghai) PTE LTD * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/crypto/openssl_mbedtls_wrapper/mbedtls/ssl_port.c b/crypto/openssl_mbedtls_wrapper/mbedtls/ssl_port.c index b1ff4ee8b7c..b21d4fb3a72 100644 --- a/crypto/openssl_mbedtls_wrapper/mbedtls/ssl_port.c +++ b/crypto/openssl_mbedtls_wrapper/mbedtls/ssl_port.c @@ -1,7 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/mbedtls/ssl_port.c * - * Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD + * SPDX-License-Identifier: Apache-2.0 + * SPDX-FileCopyrightText: 2015-2016 Espressif Systems (Shanghai) PTE LTD * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/crypto/openssl_mbedtls_wrapper/mbedtls/ssl_port.h b/crypto/openssl_mbedtls_wrapper/mbedtls/ssl_port.h index 2ff053253ca..90bec6a6abc 100644 --- a/crypto/openssl_mbedtls_wrapper/mbedtls/ssl_port.h +++ b/crypto/openssl_mbedtls_wrapper/mbedtls/ssl_port.h @@ -1,7 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/mbedtls/ssl_port.h * - * Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD + * SPDX-License-Identifier: Apache-2.0 + * SPDX-FileCopyrightText: 2015-2016 Espressif Systems (Shanghai) PTE LTD * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/crypto/openssl_mbedtls_wrapper/mbedtls/ssl_rsa.c b/crypto/openssl_mbedtls_wrapper/mbedtls/ssl_rsa.c index 8c0e584cd9d..0a754317df7 100644 --- a/crypto/openssl_mbedtls_wrapper/mbedtls/ssl_rsa.c +++ b/crypto/openssl_mbedtls_wrapper/mbedtls/ssl_rsa.c @@ -1,7 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/mbedtls/ssl_rsa.c * - * Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD + * SPDX-License-Identifier: Apache-2.0 + * SPDX-FileCopyrightText: 2015-2016 Espressif Systems (Shanghai) PTE LTD * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/crypto/openssl_mbedtls_wrapper/mbedtls/stack.c b/crypto/openssl_mbedtls_wrapper/mbedtls/stack.c index 0ab5e2956c7..aed407f8a2a 100644 --- a/crypto/openssl_mbedtls_wrapper/mbedtls/stack.c +++ b/crypto/openssl_mbedtls_wrapper/mbedtls/stack.c @@ -1,7 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/mbedtls/stack.c * - * Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD + * SPDX-License-Identifier: Apache-2.0 + * SPDX-FileCopyrightText: 2015-2016 Espressif Systems (Shanghai) PTE LTD * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/crypto/openssl_mbedtls_wrapper/mbedtls/statem.c b/crypto/openssl_mbedtls_wrapper/mbedtls/statem.c index d7b13b2e473..f7dd4ed998d 100644 --- a/crypto/openssl_mbedtls_wrapper/mbedtls/statem.c +++ b/crypto/openssl_mbedtls_wrapper/mbedtls/statem.c @@ -1,7 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/mbedtls/statem.c * - * Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD + * SPDX-License-Identifier: Apache-2.0 + * SPDX-FileCopyrightText: 2015-2016 Espressif Systems (Shanghai) PTE LTD * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/crypto/openssl_mbedtls_wrapper/mbedtls/x509.c b/crypto/openssl_mbedtls_wrapper/mbedtls/x509.c index 787c0af7c99..27f5abb1d7d 100644 --- a/crypto/openssl_mbedtls_wrapper/mbedtls/x509.c +++ b/crypto/openssl_mbedtls_wrapper/mbedtls/x509.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/mbedtls/x509.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/crypto/openssl_mbedtls_wrapper/mbedtls/x509_vpm.c b/crypto/openssl_mbedtls_wrapper/mbedtls/x509_vpm.c index dfe9e7fab36..5bc660d0970 100644 --- a/crypto/openssl_mbedtls_wrapper/mbedtls/x509_vpm.c +++ b/crypto/openssl_mbedtls_wrapper/mbedtls/x509_vpm.c @@ -1,7 +1,8 @@ /**************************************************************************** * apps/crypto/openssl_mbedtls_wrapper/mbedtls/x509_vpm.c * - * Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD + * SPDX-License-Identifier: Apache-2.0 + * SPDX-FileCopyrightText: 2015-2016 Espressif Systems (Shanghai) PTE LTD * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/crypto/tinycrypt/CMakeLists.txt b/crypto/tinycrypt/CMakeLists.txt index 88c33b976d7..a44ed6234d3 100644 --- a/crypto/tinycrypt/CMakeLists.txt +++ b/crypto/tinycrypt/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/crypto/tinycrypt/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/crypto/tinycrypt/Make.defs b/crypto/tinycrypt/Make.defs index d9349c9b24c..a743cda439e 100644 --- a/crypto/tinycrypt/Make.defs +++ b/crypto/tinycrypt/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/crypto/tinycrypt/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/crypto/tinycrypt/Makefile b/crypto/tinycrypt/Makefile index 2faba8219c3..6b3930a910c 100644 --- a/crypto/tinycrypt/Makefile +++ b/crypto/tinycrypt/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/crypto/tinycrypt/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/crypto/tinydtls/CMakeLists.txt b/crypto/tinydtls/CMakeLists.txt index 129f3750f75..c0fd7000737 100644 --- a/crypto/tinydtls/CMakeLists.txt +++ b/crypto/tinydtls/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/crypto/tinydtls/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/crypto/wolfssl/Make.defs b/crypto/wolfssl/Make.defs index 594fbd38d33..889778a18c8 100644 --- a/crypto/wolfssl/Make.defs +++ b/crypto/wolfssl/Make.defs @@ -1,3 +1,25 @@ +# ############################################################################## +# apps/crypto/wolfssl/Make.defs +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + ifeq ($(CONFIG_CRYPTO_WOLFSSL),y) CONFIGURED_APPS += $(APPDIR)/crypto/wolfssl diff --git a/crypto/wolfssl/Makefile b/crypto/wolfssl/Makefile index f2adbb20967..77bc546a520 100644 --- a/crypto/wolfssl/Makefile +++ b/crypto/wolfssl/Makefile @@ -1,3 +1,25 @@ +# ############################################################################## +# apps/crypto/wolfssl/Makefile +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + include $(APPDIR)/Make.defs # wolfSSL SSL/TLS crypto library diff --git a/crypto/wolfssl/user_settings.h b/crypto/wolfssl/user_settings.h index d2aa76f1f3a..66427efdd97 100644 --- a/crypto/wolfssl/user_settings.h +++ b/crypto/wolfssl/user_settings.h @@ -1,3 +1,24 @@ +/**************************************************************************** + * apps/crypto/wolfssl/user_settings.h + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + ****************************************************************************/ + #include /* Library */ From cdb6d76f0a4ace7784e2d2cd0758b63c8b9ab964 Mon Sep 17 00:00:00 2001 From: Alin Jerpelea Date: Thu, 19 Dec 2024 03:14:26 +0100 Subject: [PATCH 069/391] fsutils: migrate to SPDX identifier Most tools used for compliance and SBOM generation use SPDX identifiers This change brings us a step closer to an easy SBOM generation. Signed-off-by: Alin Jerpelea --- fsutils/CMakeLists.txt | 2 ++ fsutils/Make.defs | 2 ++ fsutils/Makefile | 2 ++ fsutils/flash_eraseall/CMakeLists.txt | 2 ++ fsutils/flash_eraseall/Make.defs | 2 ++ fsutils/flash_eraseall/Makefile | 2 ++ fsutils/flash_eraseall/flash_eraseall.c | 2 ++ fsutils/inifile/CMakeLists.txt | 2 ++ fsutils/inifile/Make.defs | 2 ++ fsutils/inifile/Makefile | 2 ++ fsutils/inifile/inifile.c | 2 ++ fsutils/inih/CMakeLists.txt | 2 ++ fsutils/inih/Make.defs | 2 ++ fsutils/inih/Makefile | 2 ++ fsutils/ipcfg/CMakeLists.txt | 2 ++ fsutils/ipcfg/Make.defs | 2 ++ fsutils/ipcfg/Makefile | 2 ++ fsutils/ipcfg/ipcfg.c | 2 ++ fsutils/ipcfg/ipcfg.h | 2 ++ fsutils/ipcfg/ipcfg_binary.c | 2 ++ fsutils/ipcfg/ipcfg_text.c | 2 ++ fsutils/libtinycbor/CMakeLists.txt | 2 ++ fsutils/libtinycbor/Make.defs | 2 ++ fsutils/libtinycbor/Makefile | 2 ++ fsutils/mkfatfs/CMakeLists.txt | 2 ++ fsutils/mkfatfs/Make.defs | 2 ++ fsutils/mkfatfs/Makefile | 2 ++ fsutils/mkfatfs/configfat.c | 2 ++ fsutils/mkfatfs/fat32.h | 2 ++ fsutils/mkfatfs/mkfatfs.c | 2 ++ fsutils/mkfatfs/mkfatfs.h | 2 ++ fsutils/mkfatfs/writefat.c | 2 ++ fsutils/mkgpt/CMakeLists.txt | 2 ++ fsutils/mkgpt/Make.defs | 2 ++ fsutils/mkgpt/Makefile | 2 ++ fsutils/mkgpt/mkgpt.c | 2 ++ fsutils/mkmbr/CMakeLists.txt | 2 ++ fsutils/mkmbr/Make.defs | 2 ++ fsutils/mkmbr/Makefile | 2 ++ fsutils/mkmbr/mkmbr.c | 2 ++ fsutils/mksmartfs/CMakeLists.txt | 2 ++ fsutils/mksmartfs/Make.defs | 2 ++ fsutils/mksmartfs/Makefile | 2 ++ fsutils/mksmartfs/mksmartfs.c | 2 ++ fsutils/passwd/CMakeLists.txt | 2 ++ fsutils/passwd/Make.defs | 2 ++ fsutils/passwd/Makefile | 2 ++ fsutils/passwd/passwd.h | 2 ++ fsutils/passwd/passwd_adduser.c | 2 ++ fsutils/passwd/passwd_append.c | 2 ++ fsutils/passwd/passwd_delete.c | 2 ++ fsutils/passwd/passwd_deluser.c | 2 ++ fsutils/passwd/passwd_encrypt.c | 2 ++ fsutils/passwd/passwd_find.c | 2 ++ fsutils/passwd/passwd_lock.c | 2 ++ fsutils/passwd/passwd_update.c | 2 ++ fsutils/passwd/passwd_verify.c | 2 ++ 57 files changed, 114 insertions(+) diff --git a/fsutils/CMakeLists.txt b/fsutils/CMakeLists.txt index 1377e9f4e74..0215201de44 100644 --- a/fsutils/CMakeLists.txt +++ b/fsutils/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/fsutils/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/fsutils/Make.defs b/fsutils/Make.defs index 93c71c38e04..2a6a4b82562 100644 --- a/fsutils/Make.defs +++ b/fsutils/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/fsutils/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/fsutils/Makefile b/fsutils/Makefile index a31d2e0e2bb..b2d19cf1bc9 100644 --- a/fsutils/Makefile +++ b/fsutils/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/fsutils/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/fsutils/flash_eraseall/CMakeLists.txt b/fsutils/flash_eraseall/CMakeLists.txt index 16c2f4b7b63..0a7086f4be2 100644 --- a/fsutils/flash_eraseall/CMakeLists.txt +++ b/fsutils/flash_eraseall/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/fsutils/flash_eraseall/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/fsutils/flash_eraseall/Make.defs b/fsutils/flash_eraseall/Make.defs index a93f903d49b..217a1d947db 100644 --- a/fsutils/flash_eraseall/Make.defs +++ b/fsutils/flash_eraseall/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/fsutils/flash_eraseall/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/fsutils/flash_eraseall/Makefile b/fsutils/flash_eraseall/Makefile index 8c1ff75b0a5..b620ec031fb 100644 --- a/fsutils/flash_eraseall/Makefile +++ b/fsutils/flash_eraseall/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/fsutils/flash_eraseall/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/fsutils/flash_eraseall/flash_eraseall.c b/fsutils/flash_eraseall/flash_eraseall.c index 36a4cbd1ccd..2dde3a1eeaf 100644 --- a/fsutils/flash_eraseall/flash_eraseall.c +++ b/fsutils/flash_eraseall/flash_eraseall.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/fsutils/flash_eraseall/flash_eraseall.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/fsutils/inifile/CMakeLists.txt b/fsutils/inifile/CMakeLists.txt index f8378a22e84..652fbb536ed 100644 --- a/fsutils/inifile/CMakeLists.txt +++ b/fsutils/inifile/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/fsutils/inifile/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/fsutils/inifile/Make.defs b/fsutils/inifile/Make.defs index c3484a87679..4568f378fbf 100644 --- a/fsutils/inifile/Make.defs +++ b/fsutils/inifile/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/fsutils/inifile/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/fsutils/inifile/Makefile b/fsutils/inifile/Makefile index a70f219e52c..257e982d78c 100644 --- a/fsutils/inifile/Makefile +++ b/fsutils/inifile/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/fsutils/inifile/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/fsutils/inifile/inifile.c b/fsutils/inifile/inifile.c index 9bd90318526..16c9da6aff9 100644 --- a/fsutils/inifile/inifile.c +++ b/fsutils/inifile/inifile.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/fsutils/inifile/inifile.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/fsutils/inih/CMakeLists.txt b/fsutils/inih/CMakeLists.txt index ddf779bd533..7f81966238d 100644 --- a/fsutils/inih/CMakeLists.txt +++ b/fsutils/inih/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/fsutils/inih/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/fsutils/inih/Make.defs b/fsutils/inih/Make.defs index a9a79dd9c2d..c965b32732d 100644 --- a/fsutils/inih/Make.defs +++ b/fsutils/inih/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/fsutils/inih/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/fsutils/inih/Makefile b/fsutils/inih/Makefile index b4c3b045418..f89ea726982 100644 --- a/fsutils/inih/Makefile +++ b/fsutils/inih/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/fsutils/inih/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/fsutils/ipcfg/CMakeLists.txt b/fsutils/ipcfg/CMakeLists.txt index 33dea8d47e2..66accd4829a 100644 --- a/fsutils/ipcfg/CMakeLists.txt +++ b/fsutils/ipcfg/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/fsutils/ipcfg/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/fsutils/ipcfg/Make.defs b/fsutils/ipcfg/Make.defs index 3762aac5da8..399b334c14f 100644 --- a/fsutils/ipcfg/Make.defs +++ b/fsutils/ipcfg/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/fsutils/ipcfg/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/fsutils/ipcfg/Makefile b/fsutils/ipcfg/Makefile index 7b63d6e022f..757070628af 100644 --- a/fsutils/ipcfg/Makefile +++ b/fsutils/ipcfg/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/fsutils/ipcfg/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/fsutils/ipcfg/ipcfg.c b/fsutils/ipcfg/ipcfg.c index ae73608edc9..c1d4f9f9d72 100644 --- a/fsutils/ipcfg/ipcfg.c +++ b/fsutils/ipcfg/ipcfg.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/fsutils/ipcfg/ipcfg.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/fsutils/ipcfg/ipcfg.h b/fsutils/ipcfg/ipcfg.h index ebc473aa96c..6f5ae1f4922 100644 --- a/fsutils/ipcfg/ipcfg.h +++ b/fsutils/ipcfg/ipcfg.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/fsutils/ipcfg/ipcfg.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/fsutils/ipcfg/ipcfg_binary.c b/fsutils/ipcfg/ipcfg_binary.c index 6b7bb968c77..0247a4e8821 100644 --- a/fsutils/ipcfg/ipcfg_binary.c +++ b/fsutils/ipcfg/ipcfg_binary.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/fsutils/ipcfg/ipcfg_binary.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/fsutils/ipcfg/ipcfg_text.c b/fsutils/ipcfg/ipcfg_text.c index ab9f9d0da3f..738bde088ef 100644 --- a/fsutils/ipcfg/ipcfg_text.c +++ b/fsutils/ipcfg/ipcfg_text.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/fsutils/ipcfg/ipcfg_text.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/fsutils/libtinycbor/CMakeLists.txt b/fsutils/libtinycbor/CMakeLists.txt index e18b5657795..dd8ddfca5a6 100644 --- a/fsutils/libtinycbor/CMakeLists.txt +++ b/fsutils/libtinycbor/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/fsutils/libtinycbor/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/fsutils/libtinycbor/Make.defs b/fsutils/libtinycbor/Make.defs index 2fb9975e4d6..4465760a3a4 100644 --- a/fsutils/libtinycbor/Make.defs +++ b/fsutils/libtinycbor/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/fsutils/libtinycbor/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/fsutils/libtinycbor/Makefile b/fsutils/libtinycbor/Makefile index 14a3d2f0fde..552df22cfd9 100644 --- a/fsutils/libtinycbor/Makefile +++ b/fsutils/libtinycbor/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/fsutils/libtinycbor/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/fsutils/mkfatfs/CMakeLists.txt b/fsutils/mkfatfs/CMakeLists.txt index b910f77978a..1c891d0bc17 100644 --- a/fsutils/mkfatfs/CMakeLists.txt +++ b/fsutils/mkfatfs/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/fsutils/mkfatfs/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/fsutils/mkfatfs/Make.defs b/fsutils/mkfatfs/Make.defs index e77a1783fce..bdcae96a223 100644 --- a/fsutils/mkfatfs/Make.defs +++ b/fsutils/mkfatfs/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/fsutils/mkfatfs/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/fsutils/mkfatfs/Makefile b/fsutils/mkfatfs/Makefile index 4a140de8921..3c5c7d0ae46 100644 --- a/fsutils/mkfatfs/Makefile +++ b/fsutils/mkfatfs/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/fsutils/mkfatfs/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/fsutils/mkfatfs/configfat.c b/fsutils/mkfatfs/configfat.c index c6d8d3dced6..cb6d41da48a 100644 --- a/fsutils/mkfatfs/configfat.c +++ b/fsutils/mkfatfs/configfat.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/fsutils/mkfatfs/configfat.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/fsutils/mkfatfs/fat32.h b/fsutils/mkfatfs/fat32.h index c017c93bfb1..133e6f08b5b 100644 --- a/fsutils/mkfatfs/fat32.h +++ b/fsutils/mkfatfs/fat32.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/fsutils/mkfatfs/fat32.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/fsutils/mkfatfs/mkfatfs.c b/fsutils/mkfatfs/mkfatfs.c index 1523636a352..2bf7e56b82f 100644 --- a/fsutils/mkfatfs/mkfatfs.c +++ b/fsutils/mkfatfs/mkfatfs.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/fsutils/mkfatfs/mkfatfs.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/fsutils/mkfatfs/mkfatfs.h b/fsutils/mkfatfs/mkfatfs.h index bd82188f1e7..e12e162cfb0 100644 --- a/fsutils/mkfatfs/mkfatfs.h +++ b/fsutils/mkfatfs/mkfatfs.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/fsutils/mkfatfs/mkfatfs.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/fsutils/mkfatfs/writefat.c b/fsutils/mkfatfs/writefat.c index cc303cc3c2d..d88e0bbb74f 100644 --- a/fsutils/mkfatfs/writefat.c +++ b/fsutils/mkfatfs/writefat.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/fsutils/mkfatfs/writefat.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/fsutils/mkgpt/CMakeLists.txt b/fsutils/mkgpt/CMakeLists.txt index 369080386ee..a4e580279ab 100644 --- a/fsutils/mkgpt/CMakeLists.txt +++ b/fsutils/mkgpt/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/fsutils/mkgpt/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/fsutils/mkgpt/Make.defs b/fsutils/mkgpt/Make.defs index 9f92d81cf04..b003bdabc29 100644 --- a/fsutils/mkgpt/Make.defs +++ b/fsutils/mkgpt/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/fsutils/mkgpt/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/fsutils/mkgpt/Makefile b/fsutils/mkgpt/Makefile index 39daffe1534..71deb540d6c 100644 --- a/fsutils/mkgpt/Makefile +++ b/fsutils/mkgpt/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/fsutils/mkgpt/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/fsutils/mkgpt/mkgpt.c b/fsutils/mkgpt/mkgpt.c index 0757dec26d6..e7621fab0dc 100644 --- a/fsutils/mkgpt/mkgpt.c +++ b/fsutils/mkgpt/mkgpt.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/fsutils/mkgpt/mkgpt.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/fsutils/mkmbr/CMakeLists.txt b/fsutils/mkmbr/CMakeLists.txt index 5f22c400865..e7d16ae66dd 100644 --- a/fsutils/mkmbr/CMakeLists.txt +++ b/fsutils/mkmbr/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/fsutils/mkmbr/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/fsutils/mkmbr/Make.defs b/fsutils/mkmbr/Make.defs index 89de722ccd8..efa3c5bb8c4 100644 --- a/fsutils/mkmbr/Make.defs +++ b/fsutils/mkmbr/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/fsutils/mkmbr/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/fsutils/mkmbr/Makefile b/fsutils/mkmbr/Makefile index 569136461e2..7da62a0c9ff 100644 --- a/fsutils/mkmbr/Makefile +++ b/fsutils/mkmbr/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/fsutils/mkmbr/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/fsutils/mkmbr/mkmbr.c b/fsutils/mkmbr/mkmbr.c index 4c468c5cf28..233e7ac89fc 100644 --- a/fsutils/mkmbr/mkmbr.c +++ b/fsutils/mkmbr/mkmbr.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/fsutils/mkmbr/mkmbr.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/fsutils/mksmartfs/CMakeLists.txt b/fsutils/mksmartfs/CMakeLists.txt index d592c15934b..822704e6838 100644 --- a/fsutils/mksmartfs/CMakeLists.txt +++ b/fsutils/mksmartfs/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/fsutils/mksmartfs/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/fsutils/mksmartfs/Make.defs b/fsutils/mksmartfs/Make.defs index 4058a4adbb8..5430e44e031 100644 --- a/fsutils/mksmartfs/Make.defs +++ b/fsutils/mksmartfs/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/fsutils/mksmartfs/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/fsutils/mksmartfs/Makefile b/fsutils/mksmartfs/Makefile index a6da40b04f5..a54bb4db3d5 100644 --- a/fsutils/mksmartfs/Makefile +++ b/fsutils/mksmartfs/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/fsutils/mksmartfs/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/fsutils/mksmartfs/mksmartfs.c b/fsutils/mksmartfs/mksmartfs.c index 46f17ef2ae4..9e16840cfe9 100644 --- a/fsutils/mksmartfs/mksmartfs.c +++ b/fsutils/mksmartfs/mksmartfs.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/fsutils/mksmartfs/mksmartfs.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/fsutils/passwd/CMakeLists.txt b/fsutils/passwd/CMakeLists.txt index 8622499eed2..e2e0ebce488 100644 --- a/fsutils/passwd/CMakeLists.txt +++ b/fsutils/passwd/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/fsutils/passwd/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/fsutils/passwd/Make.defs b/fsutils/passwd/Make.defs index ab0a52d6bcc..021b4d62c2d 100644 --- a/fsutils/passwd/Make.defs +++ b/fsutils/passwd/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/fsutils/passwd/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/fsutils/passwd/Makefile b/fsutils/passwd/Makefile index 0efe36ce31e..b11148ffd6d 100644 --- a/fsutils/passwd/Makefile +++ b/fsutils/passwd/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/fsutils/passwd/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/fsutils/passwd/passwd.h b/fsutils/passwd/passwd.h index 2169ce988db..6dd1785e385 100644 --- a/fsutils/passwd/passwd.h +++ b/fsutils/passwd/passwd.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/fsutils/passwd/passwd.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/fsutils/passwd/passwd_adduser.c b/fsutils/passwd/passwd_adduser.c index 9dd6d8d3bd9..3a14ac8124a 100644 --- a/fsutils/passwd/passwd_adduser.c +++ b/fsutils/passwd/passwd_adduser.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/fsutils/passwd/passwd_adduser.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/fsutils/passwd/passwd_append.c b/fsutils/passwd/passwd_append.c index ed8f87a2689..be77c9aed65 100644 --- a/fsutils/passwd/passwd_append.c +++ b/fsutils/passwd/passwd_append.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/fsutils/passwd/passwd_append.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/fsutils/passwd/passwd_delete.c b/fsutils/passwd/passwd_delete.c index 5ac12be9425..cb9562c4e0d 100644 --- a/fsutils/passwd/passwd_delete.c +++ b/fsutils/passwd/passwd_delete.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/fsutils/passwd/passwd_delete.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/fsutils/passwd/passwd_deluser.c b/fsutils/passwd/passwd_deluser.c index 1e0f4626e1d..0c4b0774670 100644 --- a/fsutils/passwd/passwd_deluser.c +++ b/fsutils/passwd/passwd_deluser.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/fsutils/passwd/passwd_deluser.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/fsutils/passwd/passwd_encrypt.c b/fsutils/passwd/passwd_encrypt.c index ea88f477b08..50e516f77c2 100644 --- a/fsutils/passwd/passwd_encrypt.c +++ b/fsutils/passwd/passwd_encrypt.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/fsutils/passwd/passwd_encrypt.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/fsutils/passwd/passwd_find.c b/fsutils/passwd/passwd_find.c index 53eefda1abb..d12d7fbef21 100644 --- a/fsutils/passwd/passwd_find.c +++ b/fsutils/passwd/passwd_find.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/fsutils/passwd/passwd_find.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/fsutils/passwd/passwd_lock.c b/fsutils/passwd/passwd_lock.c index 1ed64d62e7d..4cfd3809496 100644 --- a/fsutils/passwd/passwd_lock.c +++ b/fsutils/passwd/passwd_lock.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/fsutils/passwd/passwd_lock.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/fsutils/passwd/passwd_update.c b/fsutils/passwd/passwd_update.c index 6914d59c75f..3066dbb5d74 100644 --- a/fsutils/passwd/passwd_update.c +++ b/fsutils/passwd/passwd_update.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/fsutils/passwd/passwd_update.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/fsutils/passwd/passwd_verify.c b/fsutils/passwd/passwd_verify.c index 08b96989d38..2c63f37591d 100644 --- a/fsutils/passwd/passwd_verify.c +++ b/fsutils/passwd/passwd_verify.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/fsutils/passwd/passwd_verify.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The From f59c5da9154140e308969e2432a6bb64ea743e41 Mon Sep 17 00:00:00 2001 From: Alin Jerpelea Date: Thu, 19 Dec 2024 03:18:29 +0100 Subject: [PATCH 070/391] games: migrate to SPDX identifier Most tools used for compliance and SBOM generation use SPDX identifiers This change brings us a step closer to an easy SBOM generation. Signed-off-by: Alin Jerpelea --- games/CMakeLists.txt | 2 ++ games/Make.defs | 2 ++ games/Makefile | 2 ++ games/brickmatch/Make.defs | 2 ++ games/brickmatch/Makefile | 2 ++ games/brickmatch/bm_input_console.h | 2 ++ games/brickmatch/bm_input_gesture.h | 2 ++ games/brickmatch/bm_input_joystick.h | 2 ++ games/brickmatch/bm_inputs.h | 2 ++ games/brickmatch/bm_main.c | 2 ++ 10 files changed, 20 insertions(+) diff --git a/games/CMakeLists.txt b/games/CMakeLists.txt index 90ee40fd3c9..4931fc4604a 100644 --- a/games/CMakeLists.txt +++ b/games/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/games/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/games/Make.defs b/games/Make.defs index 7152bd5c6c8..608a947258f 100644 --- a/games/Make.defs +++ b/games/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/games/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/games/Makefile b/games/Makefile index 736c18fda40..480a6fc944f 100644 --- a/games/Makefile +++ b/games/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/games/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/games/brickmatch/Make.defs b/games/brickmatch/Make.defs index 659bcf05266..274ee477deb 100644 --- a/games/brickmatch/Make.defs +++ b/games/brickmatch/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/games/brickmatch/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/games/brickmatch/Makefile b/games/brickmatch/Makefile index b327e1b3631..2d228b5fc66 100644 --- a/games/brickmatch/Makefile +++ b/games/brickmatch/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/games/brickmatch/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/games/brickmatch/bm_input_console.h b/games/brickmatch/bm_input_console.h index cb5e45b0a58..1d638f87493 100644 --- a/games/brickmatch/bm_input_console.h +++ b/games/brickmatch/bm_input_console.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/games/brickmatch/bm_input_console.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/games/brickmatch/bm_input_gesture.h b/games/brickmatch/bm_input_gesture.h index eaf74ca3a8e..4ae8ef9f093 100644 --- a/games/brickmatch/bm_input_gesture.h +++ b/games/brickmatch/bm_input_gesture.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/games/brickmatch/bm_input_gesture.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/games/brickmatch/bm_input_joystick.h b/games/brickmatch/bm_input_joystick.h index ef5146cac43..890fd3e4127 100644 --- a/games/brickmatch/bm_input_joystick.h +++ b/games/brickmatch/bm_input_joystick.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/games/brickmatch/bm_input_joystick.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/games/brickmatch/bm_inputs.h b/games/brickmatch/bm_inputs.h index a78f03601b4..0426677705e 100644 --- a/games/brickmatch/bm_inputs.h +++ b/games/brickmatch/bm_inputs.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/games/brickmatch/bm_inputs.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/games/brickmatch/bm_main.c b/games/brickmatch/bm_main.c index 187ce268392..b9155c7a734 100644 --- a/games/brickmatch/bm_main.c +++ b/games/brickmatch/bm_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/games/brickmatch/bm_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The From 96d3cb60e54777dc31071ad377b380ffeb35a1f1 Mon Sep 17 00:00:00 2001 From: Alin Jerpelea Date: Thu, 19 Dec 2024 03:19:25 +0100 Subject: [PATCH 071/391] import: migrate to SPDX identifier Most tools used for compliance and SBOM generation use SPDX identifiers This change brings us a step closer to an easy SBOM generation. Signed-off-by: Alin Jerpelea --- import/Make.defs | 2 ++ import/Makefile | 2 ++ 2 files changed, 4 insertions(+) diff --git a/import/Make.defs b/import/Make.defs index 050a5d3e14e..d6f99cf5051 100644 --- a/import/Make.defs +++ b/import/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/import/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/import/Makefile b/import/Makefile index be5c4dc8e17..577708cacdc 100644 --- a/import/Makefile +++ b/import/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/import/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The From c8ec20fe4dcafc29890984e5f4b0842bffcc70ad Mon Sep 17 00:00:00 2001 From: Alin Jerpelea Date: Thu, 19 Dec 2024 04:23:30 +0100 Subject: [PATCH 072/391] graphics: migrate to SPDX identifier Most tools used for compliance and SBOM generation use SPDX identifiers This change brings us a step closer to an easy SBOM generation. Signed-off-by: Alin Jerpelea --- graphics/CMakeLists.txt | 2 ++ graphics/Make.defs | 2 ++ graphics/Makefile | 2 ++ graphics/ft80x/Make.defs | 2 ++ graphics/ft80x/Makefile | 2 ++ graphics/ft80x/ft80x.h | 2 ++ graphics/ft80x/ft80x_audio.c | 2 ++ graphics/ft80x/ft80x_backlight.c | 2 ++ graphics/ft80x/ft80x_coproc.c | 2 ++ graphics/ft80x/ft80x_dl.c | 2 ++ graphics/ft80x/ft80x_gpio.c | 2 ++ graphics/ft80x/ft80x_ramcmd.c | 2 ++ graphics/ft80x/ft80x_ramdl.c | 2 ++ graphics/ft80x/ft80x_ramg.c | 2 ++ graphics/ft80x/ft80x_regs.c | 2 ++ graphics/ft80x/ft80x_touch.c | 2 ++ graphics/libjpeg/Make.defs | 2 ++ graphics/libjpeg/Makefile | 2 ++ graphics/libyuv/CMakeLists.txt | 2 ++ graphics/libyuv/Make.defs | 2 ++ graphics/libyuv/Makefile | 2 ++ graphics/lvgl/CMakeLists.txt | 2 ++ graphics/lvgl/Make.defs | 2 ++ graphics/lvgl/Makefile | 2 ++ graphics/nxglyphs/Make.defs | 2 ++ graphics/nxglyphs/Makefile | 2 ++ graphics/nxglyphs/include/cursor-arrow1-16x16.h | 2 ++ graphics/nxglyphs/include/cursor-arrow1-30x30.h | 2 ++ graphics/nxglyphs/include/cursor-arrow2-16x16.h | 2 ++ graphics/nxglyphs/include/cursor-arrow2-30x30.h | 2 ++ graphics/nxglyphs/include/cursor-grab-14x16.h | 2 ++ graphics/nxglyphs/include/cursor-grab-25x30.h | 2 ++ graphics/nxglyphs/include/cursor-resize-16x16.h | 2 ++ graphics/nxglyphs/include/cursor-resize-30x30.h | 2 ++ graphics/nxglyphs/include/cursor-resize-61x62.h | 2 ++ graphics/nxglyphs/include/cursor-wait-13x16.h | 2 ++ graphics/nxglyphs/include/cursor-wait-23x30.h | 2 ++ graphics/nxglyphs/include/cursor-zoomin-16x16.h | 2 ++ graphics/nxglyphs/include/cursor-zoomin-30x30.h | 2 ++ graphics/nxglyphs/include/cursor-zoomout-16x16.h | 2 ++ graphics/nxglyphs/include/cursor-zoomout-30x30.h | 2 ++ graphics/nxglyphs/include/mkcursor.c | 2 ++ graphics/nxglyphs/include/mkcursor.sh | 2 ++ graphics/nxglyphs/src/glpyh_menu2-21x21.cxx | 2 ++ graphics/nxglyphs/src/glpyh_menu2-42x42.cxx | 2 ++ graphics/nxglyphs/src/glpyh_minimize2-21x21.cxx | 2 ++ graphics/nxglyphs/src/glpyh_minimize2-42x42.cxx | 2 ++ graphics/nxglyphs/src/glpyh_resize2-21x21.cxx | 2 ++ graphics/nxglyphs/src/glpyh_resize2-42x42.cxx | 2 ++ graphics/nxglyphs/src/glpyh_stop2-21x21.cxx | 2 ++ graphics/nxglyphs/src/glyph_arrowdown.cxx | 2 ++ graphics/nxglyphs/src/glyph_arrowleft.cxx | 2 ++ graphics/nxglyphs/src/glyph_arrowright.cxx | 2 ++ graphics/nxglyphs/src/glyph_arrowup.cxx | 2 ++ graphics/nxglyphs/src/glyph_backspace.cxx | 2 ++ graphics/nxglyphs/src/glyph_calculator24x25.cxx | 2 ++ graphics/nxglyphs/src/glyph_calculator47x49.cxx | 2 ++ graphics/nxglyphs/src/glyph_calibration24x21.cxx | 2 ++ graphics/nxglyphs/src/glyph_calibration48x42.cxx | 2 ++ graphics/nxglyphs/src/glyph_capslock.cxx | 2 ++ graphics/nxglyphs/src/glyph_checkboxmu.cxx | 2 ++ graphics/nxglyphs/src/glyph_checkboxoff.cxx | 2 ++ graphics/nxglyphs/src/glyph_checkboxon.cxx | 2 ++ graphics/nxglyphs/src/glyph_cmd25x22.cxx | 2 ++ graphics/nxglyphs/src/glyph_cmd49x43.cxx | 2 ++ graphics/nxglyphs/src/glyph_control.cxx | 2 ++ graphics/nxglyphs/src/glyph_cycle.cxx | 2 ++ graphics/nxglyphs/src/glyph_lcdclock102x48.cxx | 2 ++ graphics/nxglyphs/src/glyph_lcdclock136x64.cxx | 2 ++ graphics/nxglyphs/src/glyph_lcdclock51x24.cxx | 2 ++ graphics/nxglyphs/src/glyph_mediagrip60x30.cxx | 2 ++ graphics/nxglyphs/src/glyph_mediaplayer24x24.cxx | 2 ++ graphics/nxglyphs/src/glyph_mediaplayer44x50.cxx | 2 ++ graphics/nxglyphs/src/glyph_menu21x21.cxx | 2 ++ graphics/nxglyphs/src/glyph_menu42x42.cxx | 2 ++ graphics/nxglyphs/src/glyph_minimize21x21.cxx | 2 ++ graphics/nxglyphs/src/glyph_minimize42x42.cxx | 2 ++ graphics/nxglyphs/src/glyph_mplayer_controls32x32.cxx | 2 ++ graphics/nxglyphs/src/glyph_mplayer_controls43x41.cxx | 2 ++ graphics/nxglyphs/src/glyph_nxicon21x21.cxx | 2 ++ graphics/nxglyphs/src/glyph_nxicon42x42.cxx | 2 ++ graphics/nxglyphs/src/glyph_nxlogo160x160.cxx | 2 ++ graphics/nxglyphs/src/glyph_nxlogo320x320.cxx | 2 ++ graphics/nxglyphs/src/glyph_play24x24.cxx | 2 ++ graphics/nxglyphs/src/glyph_play48x48.cxx | 2 ++ graphics/nxglyphs/src/glyph_radiobuttonmu.cxx | 2 ++ graphics/nxglyphs/src/glyph_radiobuttonoff.cxx | 2 ++ graphics/nxglyphs/src/glyph_radiobuttonon.cxx | 2 ++ graphics/nxglyphs/src/glyph_resize21x21.cxx | 2 ++ graphics/nxglyphs/src/glyph_resize42x42.cxx | 2 ++ graphics/nxglyphs/src/glyph_return.cxx | 2 ++ graphics/nxglyphs/src/glyph_screendepthdown.cxx | 2 ++ graphics/nxglyphs/src/glyph_screendepthup.cxx | 2 ++ graphics/nxglyphs/src/glyph_screenflipdown.cxx | 2 ++ graphics/nxglyphs/src/glyph_screenflipup.cxx | 2 ++ graphics/nxglyphs/src/glyph_shift.cxx | 2 ++ graphics/nxglyphs/src/glyph_stop2-42x42.cxx | 2 ++ graphics/nxglyphs/src/glyph_stop21x21.cxx | 2 ++ graphics/nxglyphs/src/glyph_stop42x42.cxx | 2 ++ graphics/nxglyphs/src/glyph_windowclose.cxx | 2 ++ graphics/nxglyphs/src/glyph_windowdepthdown.cxx | 2 ++ graphics/nxglyphs/src/glyph_windowdepthup.cxx | 2 ++ graphics/nxglyphs/src/mksrle.c | 2 ++ graphics/nxglyphs/src/mksrle.sh | 2 ++ graphics/nxwidgets/Doxygen/gendoc.sh | 2 ++ graphics/nxwidgets/Make.defs | 2 ++ graphics/nxwidgets/Makefile | 2 ++ graphics/nxwidgets/UnitTests/CButton/Make.defs | 2 ++ graphics/nxwidgets/UnitTests/CButton/Makefile | 2 ++ graphics/nxwidgets/UnitTests/CButton/cbutton_main.cxx | 2 ++ graphics/nxwidgets/UnitTests/CButton/cbuttontest.cxx | 2 ++ graphics/nxwidgets/UnitTests/CButton/cbuttontest.hxx | 2 ++ graphics/nxwidgets/UnitTests/CButtonArray/Make.defs | 2 ++ graphics/nxwidgets/UnitTests/CButtonArray/Makefile | 2 ++ .../nxwidgets/UnitTests/CButtonArray/cbuttonarray_main.cxx | 2 ++ graphics/nxwidgets/UnitTests/CButtonArray/cbuttonarraytest.cxx | 2 ++ graphics/nxwidgets/UnitTests/CButtonArray/cbuttonarraytest.hxx | 2 ++ graphics/nxwidgets/UnitTests/CCheckBox/Make.defs | 2 ++ graphics/nxwidgets/UnitTests/CCheckBox/Makefile | 2 ++ graphics/nxwidgets/UnitTests/CCheckBox/ccheckbox_main.cxx | 2 ++ graphics/nxwidgets/UnitTests/CCheckBox/ccheckboxtest.cxx | 2 ++ graphics/nxwidgets/UnitTests/CCheckBox/ccheckboxtest.hxx | 2 ++ graphics/nxwidgets/UnitTests/CGlyphButton/Make.defs | 2 ++ graphics/nxwidgets/UnitTests/CGlyphButton/Makefile | 2 ++ .../nxwidgets/UnitTests/CGlyphButton/cglyphbutton_main.cxx | 2 ++ graphics/nxwidgets/UnitTests/CGlyphButton/cglyphbuttontest.cxx | 2 ++ graphics/nxwidgets/UnitTests/CGlyphButton/cglyphbuttontest.hxx | 2 ++ graphics/nxwidgets/UnitTests/CGlyphSliderHorizontal/Make.defs | 2 ++ graphics/nxwidgets/UnitTests/CGlyphSliderHorizontal/Makefile | 2 ++ .../CGlyphSliderHorizontal/cglyphsliderhorizontal_main.cxx | 2 ++ .../CGlyphSliderHorizontal/cglyphsliderhorizontaltest.cxx | 2 ++ .../CGlyphSliderHorizontal/cglyphsliderhorizontaltest.hxx | 2 ++ graphics/nxwidgets/UnitTests/CImage/Make.defs | 2 ++ graphics/nxwidgets/UnitTests/CImage/Makefile | 2 ++ graphics/nxwidgets/UnitTests/CImage/cimage_main.cxx | 2 ++ graphics/nxwidgets/UnitTests/CImage/cimagetest.cxx | 2 ++ graphics/nxwidgets/UnitTests/CImage/cimagetest.hxx | 2 ++ graphics/nxwidgets/UnitTests/CKeypad/Make.defs | 2 ++ graphics/nxwidgets/UnitTests/CKeypad/Makefile | 2 ++ graphics/nxwidgets/UnitTests/CKeypad/ckeypad_main.cxx | 2 ++ graphics/nxwidgets/UnitTests/CKeypad/ckeypadtest.cxx | 2 ++ graphics/nxwidgets/UnitTests/CKeypad/ckeypadtest.hxx | 2 ++ graphics/nxwidgets/UnitTests/CLabel/Make.defs | 2 ++ graphics/nxwidgets/UnitTests/CLabel/Makefile | 2 ++ graphics/nxwidgets/UnitTests/CLabel/clabel_main.cxx | 2 ++ graphics/nxwidgets/UnitTests/CLabel/clabeltest.cxx | 2 ++ graphics/nxwidgets/UnitTests/CLabel/clabeltest.hxx | 2 ++ graphics/nxwidgets/UnitTests/CLatchButton/Make.defs | 2 ++ graphics/nxwidgets/UnitTests/CLatchButton/Makefile | 2 ++ .../nxwidgets/UnitTests/CLatchButton/clatchbutton_main.cxx | 2 ++ graphics/nxwidgets/UnitTests/CLatchButton/clatchbuttontest.cxx | 2 ++ graphics/nxwidgets/UnitTests/CLatchButton/clatchbuttontest.hxx | 2 ++ graphics/nxwidgets/UnitTests/CLatchButtonArray/Make.defs | 2 ++ graphics/nxwidgets/UnitTests/CLatchButtonArray/Makefile | 2 ++ .../UnitTests/CLatchButtonArray/clatchbuttonarray_main.cxx | 2 ++ .../UnitTests/CLatchButtonArray/clatchbuttonarraytest.cxx | 2 ++ .../UnitTests/CLatchButtonArray/clatchbuttonarraytest.hxx | 2 ++ graphics/nxwidgets/UnitTests/CListBox/Make.defs | 2 ++ graphics/nxwidgets/UnitTests/CListBox/Makefile | 2 ++ graphics/nxwidgets/UnitTests/CListBox/clistbox_main.cxx | 2 ++ graphics/nxwidgets/UnitTests/CListBox/clistboxtest.cxx | 2 ++ graphics/nxwidgets/UnitTests/CListBox/clistboxtest.hxx | 2 ++ graphics/nxwidgets/UnitTests/CProgressBar/Make.defs | 2 ++ graphics/nxwidgets/UnitTests/CProgressBar/Makefile | 2 ++ .../nxwidgets/UnitTests/CProgressBar/cprogressbar_main.cxx | 2 ++ graphics/nxwidgets/UnitTests/CProgressBar/cprogressbartest.cxx | 2 ++ graphics/nxwidgets/UnitTests/CProgressBar/cprogressbartest.hxx | 2 ++ graphics/nxwidgets/UnitTests/CRadioButton/Make.defs | 2 ++ graphics/nxwidgets/UnitTests/CRadioButton/Makefile | 2 ++ .../nxwidgets/UnitTests/CRadioButton/cradiobutton_main.cxx | 2 ++ graphics/nxwidgets/UnitTests/CRadioButton/cradiobuttontest.cxx | 2 ++ graphics/nxwidgets/UnitTests/CRadioButton/cradiobuttontest.hxx | 2 ++ graphics/nxwidgets/UnitTests/CScrollbarHorizontal/Make.defs | 2 ++ graphics/nxwidgets/UnitTests/CScrollbarHorizontal/Makefile | 2 ++ .../CScrollbarHorizontal/cscrollbarhorizontal_main.cxx | 2 ++ .../CScrollbarHorizontal/cscrollbarhorizontaltest.cxx | 2 ++ .../CScrollbarHorizontal/cscrollbarhorizontaltest.hxx | 2 ++ graphics/nxwidgets/UnitTests/CScrollbarVertical/Make.defs | 2 ++ graphics/nxwidgets/UnitTests/CScrollbarVertical/Makefile | 2 ++ .../UnitTests/CScrollbarVertical/cscrollbarvertical_main.cxx | 2 ++ .../UnitTests/CScrollbarVertical/cscrollbarverticaltest.cxx | 2 ++ .../UnitTests/CScrollbarVertical/cscrollbarverticaltest.hxx | 2 ++ graphics/nxwidgets/UnitTests/CSliderHorizonal/Make.defs | 2 ++ graphics/nxwidgets/UnitTests/CSliderHorizonal/Makefile | 2 ++ .../UnitTests/CSliderHorizonal/csliderhorizontal_main.cxx | 2 ++ .../UnitTests/CSliderHorizonal/csliderhorizontaltest.cxx | 2 ++ .../UnitTests/CSliderHorizonal/csliderhorizontaltest.hxx | 2 ++ graphics/nxwidgets/UnitTests/CSliderVertical/Make.defs | 2 ++ graphics/nxwidgets/UnitTests/CSliderVertical/Makefile | 2 ++ .../UnitTests/CSliderVertical/cslidervertical_main.cxx | 2 ++ .../UnitTests/CSliderVertical/csliderverticaltest.cxx | 2 ++ .../UnitTests/CSliderVertical/csliderverticaltest.hxx | 2 ++ graphics/nxwidgets/UnitTests/CTextBox/Make.defs | 2 ++ graphics/nxwidgets/UnitTests/CTextBox/Makefile | 2 ++ graphics/nxwidgets/UnitTests/CTextBox/ctextbox_main.cxx | 2 ++ graphics/nxwidgets/UnitTests/CTextBox/ctextboxtest.cxx | 2 ++ graphics/nxwidgets/UnitTests/CTextBox/ctextboxtest.hxx | 2 ++ graphics/nxwidgets/UnitTests/Make.defs | 2 ++ graphics/nxwidgets/UnitTests/Makefile | 2 ++ graphics/nxwidgets/src/cbgwindow.cxx | 2 ++ graphics/nxwidgets/src/cbitmap.cxx | 2 ++ graphics/nxwidgets/src/cbutton.cxx | 2 ++ graphics/nxwidgets/src/cbuttonarray.cxx | 2 ++ graphics/nxwidgets/src/ccallback.cxx | 2 ++ graphics/nxwidgets/src/ccheckbox.cxx | 2 ++ graphics/nxwidgets/src/ccyclebutton.cxx | 2 ++ graphics/nxwidgets/src/cglyphbutton.cxx | 2 ++ graphics/nxwidgets/src/cglyphsliderhorizontal.cxx | 2 ++ graphics/nxwidgets/src/cglyphsliderhorizontalgrip.cxx | 2 ++ graphics/nxwidgets/src/cgraphicsport.cxx | 2 ++ graphics/nxwidgets/src/cimage.cxx | 2 ++ graphics/nxwidgets/src/ckeypad.cxx | 2 ++ graphics/nxwidgets/src/clabel.cxx | 2 ++ graphics/nxwidgets/src/clabelgrid.cxx | 2 ++ graphics/nxwidgets/src/clatchbutton.cxx | 2 ++ graphics/nxwidgets/src/clatchbuttonarray.cxx | 2 ++ graphics/nxwidgets/src/clistbox.cxx | 2 ++ graphics/nxwidgets/src/clistboxdataitem.cxx | 2 ++ graphics/nxwidgets/src/clistdata.cxx | 2 ++ graphics/nxwidgets/src/clistdataitem.cxx | 2 ++ graphics/nxwidgets/src/cmultilinetextbox.cxx | 2 ++ graphics/nxwidgets/src/cnumericedit.cxx | 2 ++ graphics/nxwidgets/src/cnxfont.cxx | 2 ++ graphics/nxwidgets/src/cnxserver.cxx | 2 ++ graphics/nxwidgets/src/cnxstring.cxx | 2 ++ graphics/nxwidgets/src/cnxtimer.cxx | 2 ++ graphics/nxwidgets/src/cnxtkwindow.cxx | 2 ++ graphics/nxwidgets/src/cnxtoolbar.cxx | 2 ++ graphics/nxwidgets/src/cnxwidget.cxx | 2 ++ graphics/nxwidgets/src/cnxwindow.cxx | 2 ++ graphics/nxwidgets/src/cprogressbar.cxx | 2 ++ graphics/nxwidgets/src/cradiobutton.cxx | 2 ++ graphics/nxwidgets/src/cradiobuttongroup.cxx | 2 ++ graphics/nxwidgets/src/crect.cxx | 2 ++ graphics/nxwidgets/src/crlepalettebitmap.cxx | 2 ++ graphics/nxwidgets/src/cscaledbitmap.cxx | 2 ++ graphics/nxwidgets/src/cscrollbarhorizontal.cxx | 2 ++ graphics/nxwidgets/src/cscrollbarpanel.cxx | 2 ++ graphics/nxwidgets/src/cscrollbarvertical.cxx | 2 ++ graphics/nxwidgets/src/cscrollinglistbox.cxx | 2 ++ graphics/nxwidgets/src/cscrollingpanel.cxx | 2 ++ graphics/nxwidgets/src/cscrollingtextbox.cxx | 2 ++ graphics/nxwidgets/src/csliderhorizontal.cxx | 2 ++ graphics/nxwidgets/src/csliderhorizontalgrip.cxx | 2 ++ graphics/nxwidgets/src/cslidervertical.cxx | 2 ++ graphics/nxwidgets/src/csliderverticalgrip.cxx | 2 ++ graphics/nxwidgets/src/cstickybutton.cxx | 2 ++ graphics/nxwidgets/src/cstickybuttonarray.cxx | 2 ++ graphics/nxwidgets/src/cstickyimage.cxx | 2 ++ graphics/nxwidgets/src/cstringiterator.cxx | 2 ++ graphics/nxwidgets/src/ctabpanel.cxx | 2 ++ graphics/nxwidgets/src/ctext.cxx | 2 ++ graphics/nxwidgets/src/ctextbox.cxx | 2 ++ graphics/nxwidgets/src/cwidgetcontrol.cxx | 2 ++ graphics/nxwidgets/src/cwidgeteventhandlerlist.cxx | 2 ++ graphics/nxwidgets/src/cwindoweventhandlerlist.cxx | 2 ++ graphics/nxwidgets/src/singletons.cxx | 2 ++ graphics/nxwm/Doxygen/gendoc.sh | 2 ++ graphics/nxwm/Make.defs | 2 ++ graphics/nxwm/Makefile | 2 ++ graphics/nxwm/src/capplicationwindow.cxx | 2 ++ graphics/nxwm/src/ccalibration.cxx | 2 ++ graphics/nxwm/src/cfullscreenwindow.cxx | 2 ++ graphics/nxwm/src/chexcalculator.cxx | 2 ++ graphics/nxwm/src/ckeyboard.cxx | 2 ++ graphics/nxwm/src/cmediaplayer.cxx | 2 ++ graphics/nxwm/src/cnxterm.cxx | 2 ++ graphics/nxwm/src/cstartwindow.cxx | 2 ++ graphics/nxwm/src/ctaskbar.cxx | 2 ++ graphics/nxwm/src/ctouchscreen.cxx | 2 ++ graphics/nxwm/src/cwindowmessenger.cxx | 2 ++ graphics/nxwm/src/nxwm_main.cxx | 2 ++ graphics/pdcurs34/Make.defs | 2 ++ graphics/pdcurs34/Makefile | 2 ++ graphics/pdcurs34/include/curspriv.h | 2 ++ graphics/pdcurs34/include/term.h | 2 ++ graphics/pdcurs34/nuttx/Make.defs | 2 ++ graphics/pdcurs34/nuttx/pdcclip.c | 2 ++ graphics/pdcurs34/nuttx/pdcdisp.c | 2 ++ graphics/pdcurs34/nuttx/pdcgetsc.c | 2 ++ graphics/pdcurs34/nuttx/pdckbd.c | 2 ++ graphics/pdcurs34/nuttx/pdcnuttx.h | 2 ++ graphics/pdcurs34/nuttx/pdcscrn.c | 2 ++ graphics/pdcurs34/nuttx/pdcsetsc.c | 2 ++ graphics/pdcurs34/nuttx/pdcthread.c | 2 ++ graphics/pdcurs34/nuttx/pdcutil.c | 2 ++ graphics/pdcurs34/pdcurses/Make.defs | 2 ++ graphics/pdcurs34/pdcurses/pdc_addch.c | 2 ++ graphics/pdcurs34/pdcurses/pdc_addchstr.c | 2 ++ graphics/pdcurs34/pdcurses/pdc_addstr.c | 2 ++ graphics/pdcurs34/pdcurses/pdc_attr.c | 2 ++ graphics/pdcurs34/pdcurses/pdc_beep.c | 2 ++ graphics/pdcurs34/pdcurses/pdc_bkgd.c | 2 ++ graphics/pdcurs34/pdcurses/pdc_border.c | 2 ++ graphics/pdcurs34/pdcurses/pdc_clear.c | 2 ++ graphics/pdcurs34/pdcurses/pdc_color.c | 2 ++ graphics/pdcurs34/pdcurses/pdc_debug.c | 2 ++ graphics/pdcurs34/pdcurses/pdc_delch.c | 2 ++ graphics/pdcurs34/pdcurses/pdc_deleteln.c | 2 ++ graphics/pdcurs34/pdcurses/pdc_getch.c | 2 ++ graphics/pdcurs34/pdcurses/pdc_getstr.c | 2 ++ graphics/pdcurs34/pdcurses/pdc_getyx.c | 2 ++ graphics/pdcurs34/pdcurses/pdc_inch.c | 2 ++ graphics/pdcurs34/pdcurses/pdc_inchstr.c | 2 ++ graphics/pdcurs34/pdcurses/pdc_initscr.c | 2 ++ graphics/pdcurs34/pdcurses/pdc_inopts.c | 2 ++ graphics/pdcurs34/pdcurses/pdc_insch.c | 2 ++ graphics/pdcurs34/pdcurses/pdc_insstr.c | 2 ++ graphics/pdcurs34/pdcurses/pdc_instr.c | 2 ++ graphics/pdcurs34/pdcurses/pdc_kernel.c | 2 ++ graphics/pdcurs34/pdcurses/pdc_keyname.c | 2 ++ graphics/pdcurs34/pdcurses/pdc_mouse.c | 2 ++ graphics/pdcurs34/pdcurses/pdc_move.c | 2 ++ graphics/pdcurs34/pdcurses/pdc_outopts.c | 2 ++ graphics/pdcurs34/pdcurses/pdc_overlay.c | 2 ++ graphics/pdcurs34/pdcurses/pdc_pad.c | 2 ++ graphics/pdcurs34/pdcurses/pdc_panel.c | 2 ++ graphics/pdcurs34/pdcurses/pdc_printw.c | 2 ++ graphics/pdcurs34/pdcurses/pdc_refresh.c | 2 ++ graphics/pdcurs34/pdcurses/pdc_scanw.c | 2 ++ graphics/pdcurs34/pdcurses/pdc_scrdump.c | 2 ++ graphics/pdcurs34/pdcurses/pdc_scroll.c | 2 ++ graphics/pdcurs34/pdcurses/pdc_slk.c | 2 ++ graphics/pdcurs34/pdcurses/pdc_termattr.c | 2 ++ graphics/pdcurs34/pdcurses/pdc_terminfo.c | 2 ++ graphics/pdcurs34/pdcurses/pdc_touch.c | 2 ++ graphics/pdcurs34/pdcurses/pdc_util.c | 3 ++- graphics/pdcurs34/pdcurses/pdc_window.c | 2 ++ graphics/screenshot/Make.defs | 2 ++ graphics/screenshot/Makefile | 2 ++ graphics/screenshot/screenshot_main.c | 2 ++ graphics/slcd/Make.defs | 2 ++ graphics/slcd/Makefile | 2 ++ graphics/slcd/cslcd.cxx | 2 ++ graphics/slcd/slcd.hxx | 2 ++ graphics/slcd/slcd_mapping.cxx | 2 ++ graphics/slcd/slcd_trapezoids.cxx | 2 ++ graphics/tiff/Make.defs | 2 ++ graphics/tiff/Makefile | 2 ++ graphics/tiff/tiff_addstrip.c | 2 ++ graphics/tiff/tiff_finalize.c | 2 ++ graphics/tiff/tiff_initialize.c | 2 ++ graphics/tiff/tiff_internal.h | 2 ++ graphics/tiff/tiff_utils.c | 2 ++ graphics/twm4nx/Make.defs | 2 ++ graphics/twm4nx/Makefile | 2 ++ graphics/twm4nx/apps/ccalibration.cxx | 2 ++ graphics/twm4nx/apps/cclock.cxx | 2 ++ graphics/twm4nx/apps/cnxterm.cxx | 2 ++ graphics/twm4nx/src/cbackground.cxx | 2 ++ graphics/twm4nx/src/cfonts.cxx | 2 ++ graphics/twm4nx/src/ciconmgr.cxx | 2 ++ graphics/twm4nx/src/ciconwidget.cxx | 2 ++ graphics/twm4nx/src/cinput.cxx | 2 ++ graphics/twm4nx/src/cmainmenu.cxx | 2 ++ graphics/twm4nx/src/cmenus.cxx | 2 ++ graphics/twm4nx/src/cresize.cxx | 2 ++ graphics/twm4nx/src/ctwm4nx.cxx | 2 ++ graphics/twm4nx/src/cwindow.cxx | 2 ++ graphics/twm4nx/src/cwindowevent.cxx | 2 ++ graphics/twm4nx/src/cwindowfactory.cxx | 2 ++ graphics/twm4nx/src/twm4nx_cursor.cxx | 2 ++ graphics/twm4nx/src/twm4nx_main.cxx | 2 ++ 363 files changed, 726 insertions(+), 1 deletion(-) diff --git a/graphics/CMakeLists.txt b/graphics/CMakeLists.txt index 442324b7e47..15e14c6959b 100644 --- a/graphics/CMakeLists.txt +++ b/graphics/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/graphics/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/graphics/Make.defs b/graphics/Make.defs index 2630b6d7cfe..43d73c06812 100644 --- a/graphics/Make.defs +++ b/graphics/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/graphics/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/Makefile b/graphics/Makefile index f9b719cf67f..0e11d2d839e 100644 --- a/graphics/Makefile +++ b/graphics/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/graphics/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/ft80x/Make.defs b/graphics/ft80x/Make.defs index 6e8f37c24c3..3c78e6a1181 100644 --- a/graphics/ft80x/Make.defs +++ b/graphics/ft80x/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/graphics/ft80x/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/ft80x/Makefile b/graphics/ft80x/Makefile index 6da02b4de8e..c0a5622f226 100644 --- a/graphics/ft80x/Makefile +++ b/graphics/ft80x/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/graphics/ft80x/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/ft80x/ft80x.h b/graphics/ft80x/ft80x.h index d29978f9470..6462f1ce162 100644 --- a/graphics/ft80x/ft80x.h +++ b/graphics/ft80x/ft80x.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/ft80x/ft80x.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/ft80x/ft80x_audio.c b/graphics/ft80x/ft80x_audio.c index 2cb3427935f..455cc13f5a5 100644 --- a/graphics/ft80x/ft80x_audio.c +++ b/graphics/ft80x/ft80x_audio.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/ft80x/ft80x_audio.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/ft80x/ft80x_backlight.c b/graphics/ft80x/ft80x_backlight.c index 973f159cab7..c2f07196a18 100644 --- a/graphics/ft80x/ft80x_backlight.c +++ b/graphics/ft80x/ft80x_backlight.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/ft80x/ft80x_backlight.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/ft80x/ft80x_coproc.c b/graphics/ft80x/ft80x_coproc.c index 8958eb08c58..cde264331e9 100644 --- a/graphics/ft80x/ft80x_coproc.c +++ b/graphics/ft80x/ft80x_coproc.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/ft80x/ft80x_coproc.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/ft80x/ft80x_dl.c b/graphics/ft80x/ft80x_dl.c index 34b924c2da5..60624b4ca98 100644 --- a/graphics/ft80x/ft80x_dl.c +++ b/graphics/ft80x/ft80x_dl.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/ft80x/ft80x_dl.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/ft80x/ft80x_gpio.c b/graphics/ft80x/ft80x_gpio.c index b0407222264..de5a6bbbf6e 100644 --- a/graphics/ft80x/ft80x_gpio.c +++ b/graphics/ft80x/ft80x_gpio.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/ft80x/ft80x_gpio.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/ft80x/ft80x_ramcmd.c b/graphics/ft80x/ft80x_ramcmd.c index c65afae764f..69c13f7e315 100644 --- a/graphics/ft80x/ft80x_ramcmd.c +++ b/graphics/ft80x/ft80x_ramcmd.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/ft80x/ft80x_ramcmd.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/ft80x/ft80x_ramdl.c b/graphics/ft80x/ft80x_ramdl.c index 5d10550f62c..c2fc201b426 100644 --- a/graphics/ft80x/ft80x_ramdl.c +++ b/graphics/ft80x/ft80x_ramdl.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/ft80x/ft80x_ramdl.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/ft80x/ft80x_ramg.c b/graphics/ft80x/ft80x_ramg.c index 891c40b14dd..3505c8eb00a 100644 --- a/graphics/ft80x/ft80x_ramg.c +++ b/graphics/ft80x/ft80x_ramg.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/ft80x/ft80x_ramg.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/ft80x/ft80x_regs.c b/graphics/ft80x/ft80x_regs.c index 1e78e9ea3fe..bb3f68fa042 100644 --- a/graphics/ft80x/ft80x_regs.c +++ b/graphics/ft80x/ft80x_regs.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/ft80x/ft80x_regs.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/ft80x/ft80x_touch.c b/graphics/ft80x/ft80x_touch.c index b3ca8c670b6..fac5d20131b 100644 --- a/graphics/ft80x/ft80x_touch.c +++ b/graphics/ft80x/ft80x_touch.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/ft80x/ft80x_touch.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/libjpeg/Make.defs b/graphics/libjpeg/Make.defs index 52c1f45d5f3..57ac030767b 100644 --- a/graphics/libjpeg/Make.defs +++ b/graphics/libjpeg/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/graphics/libjpeg/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/libjpeg/Makefile b/graphics/libjpeg/Makefile index 3f8dbb71669..4512c34a5e0 100644 --- a/graphics/libjpeg/Makefile +++ b/graphics/libjpeg/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/graphics/libjpeg/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/libyuv/CMakeLists.txt b/graphics/libyuv/CMakeLists.txt index 8b56d510858..6060e4f34fa 100644 --- a/graphics/libyuv/CMakeLists.txt +++ b/graphics/libyuv/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/graphics/libyuv/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/graphics/libyuv/Make.defs b/graphics/libyuv/Make.defs index d22f2ab1146..37bacb44346 100644 --- a/graphics/libyuv/Make.defs +++ b/graphics/libyuv/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/graphics/libyuv/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/libyuv/Makefile b/graphics/libyuv/Makefile index 2076cdb3e0d..d15033fd14f 100644 --- a/graphics/libyuv/Makefile +++ b/graphics/libyuv/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/graphics/libyuv/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/lvgl/CMakeLists.txt b/graphics/lvgl/CMakeLists.txt index a6f4ce43ade..a1d1c5123d6 100644 --- a/graphics/lvgl/CMakeLists.txt +++ b/graphics/lvgl/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/graphics/lvgl/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/graphics/lvgl/Make.defs b/graphics/lvgl/Make.defs index 0caf681f33a..041bcf61e9b 100644 --- a/graphics/lvgl/Make.defs +++ b/graphics/lvgl/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/graphics/lvgl/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/lvgl/Makefile b/graphics/lvgl/Makefile index 9102f28efca..a81fac1ebe6 100644 --- a/graphics/lvgl/Makefile +++ b/graphics/lvgl/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/graphics/lvgl/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/Make.defs b/graphics/nxglyphs/Make.defs index 0a6af2dbd66..12404e5c6e9 100644 --- a/graphics/nxglyphs/Make.defs +++ b/graphics/nxglyphs/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/graphics/nxglyphs/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/Makefile b/graphics/nxglyphs/Makefile index 7d6de1dc5a6..7b0d5e68849 100644 --- a/graphics/nxglyphs/Makefile +++ b/graphics/nxglyphs/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/graphics/nxglyphs/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/include/cursor-arrow1-16x16.h b/graphics/nxglyphs/include/cursor-arrow1-16x16.h index 480cb971c67..5cffe5e7bc9 100644 --- a/graphics/nxglyphs/include/cursor-arrow1-16x16.h +++ b/graphics/nxglyphs/include/cursor-arrow1-16x16.h @@ -1,6 +1,8 @@ /*************************************************************************** * apps/graphics/nxglyphs/include/cursor-arrow1-16x16.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/include/cursor-arrow1-30x30.h b/graphics/nxglyphs/include/cursor-arrow1-30x30.h index 65f2e6df0ed..4de8ba1dd38 100644 --- a/graphics/nxglyphs/include/cursor-arrow1-30x30.h +++ b/graphics/nxglyphs/include/cursor-arrow1-30x30.h @@ -1,6 +1,8 @@ /*************************************************************************** * apps/graphics/nxglyphs/include/cursor-arrow1-30x30.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/include/cursor-arrow2-16x16.h b/graphics/nxglyphs/include/cursor-arrow2-16x16.h index 773cc293868..25f15748649 100644 --- a/graphics/nxglyphs/include/cursor-arrow2-16x16.h +++ b/graphics/nxglyphs/include/cursor-arrow2-16x16.h @@ -1,6 +1,8 @@ /*************************************************************************** * apps/graphics/nxglyphs/include/cursor-arrow2-16x16.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/include/cursor-arrow2-30x30.h b/graphics/nxglyphs/include/cursor-arrow2-30x30.h index 7cbf62371e7..94057fb45b0 100644 --- a/graphics/nxglyphs/include/cursor-arrow2-30x30.h +++ b/graphics/nxglyphs/include/cursor-arrow2-30x30.h @@ -1,6 +1,8 @@ /*************************************************************************** * apps/graphics/nxglyphs/include/cursor-arrow2-30x30.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/include/cursor-grab-14x16.h b/graphics/nxglyphs/include/cursor-grab-14x16.h index e3dc2e21604..cf588bb5c37 100644 --- a/graphics/nxglyphs/include/cursor-grab-14x16.h +++ b/graphics/nxglyphs/include/cursor-grab-14x16.h @@ -1,6 +1,8 @@ /*************************************************************************** * apps/graphics/nxglyphs/include/cursor-grab-14x16.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/include/cursor-grab-25x30.h b/graphics/nxglyphs/include/cursor-grab-25x30.h index 6c7e4140262..944b8a0f53d 100644 --- a/graphics/nxglyphs/include/cursor-grab-25x30.h +++ b/graphics/nxglyphs/include/cursor-grab-25x30.h @@ -1,6 +1,8 @@ /*************************************************************************** * apps/graphics/nxglyphs/include/cursor-grab-25x30.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/include/cursor-resize-16x16.h b/graphics/nxglyphs/include/cursor-resize-16x16.h index 54b8e750e06..1acf8e187e9 100644 --- a/graphics/nxglyphs/include/cursor-resize-16x16.h +++ b/graphics/nxglyphs/include/cursor-resize-16x16.h @@ -1,6 +1,8 @@ /*************************************************************************** * apps/graphics/nxglyphs/include/cursor-resize-16x16.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/include/cursor-resize-30x30.h b/graphics/nxglyphs/include/cursor-resize-30x30.h index 4795bffd853..5a214cd5ea7 100644 --- a/graphics/nxglyphs/include/cursor-resize-30x30.h +++ b/graphics/nxglyphs/include/cursor-resize-30x30.h @@ -1,6 +1,8 @@ /*************************************************************************** * apps/graphics/nxglyphs/include/cursor-resize-30x30.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/include/cursor-resize-61x62.h b/graphics/nxglyphs/include/cursor-resize-61x62.h index 048c05339f1..e78dbfc9527 100644 --- a/graphics/nxglyphs/include/cursor-resize-61x62.h +++ b/graphics/nxglyphs/include/cursor-resize-61x62.h @@ -1,6 +1,8 @@ /*************************************************************************** * apps/graphics/nxglyphs/include/cursor-resize-61x62.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/include/cursor-wait-13x16.h b/graphics/nxglyphs/include/cursor-wait-13x16.h index bafdf8ec948..062d278d480 100644 --- a/graphics/nxglyphs/include/cursor-wait-13x16.h +++ b/graphics/nxglyphs/include/cursor-wait-13x16.h @@ -1,6 +1,8 @@ /*************************************************************************** * apps/graphics/nxglyphs/include/cursor-wait-13x16.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/include/cursor-wait-23x30.h b/graphics/nxglyphs/include/cursor-wait-23x30.h index f705dcdfa50..fcf1f30810e 100644 --- a/graphics/nxglyphs/include/cursor-wait-23x30.h +++ b/graphics/nxglyphs/include/cursor-wait-23x30.h @@ -1,6 +1,8 @@ /*************************************************************************** * apps/graphics/nxglyphs/include/cursor-wait-23x30.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/include/cursor-zoomin-16x16.h b/graphics/nxglyphs/include/cursor-zoomin-16x16.h index ca3e028262f..ec3fa8a3123 100644 --- a/graphics/nxglyphs/include/cursor-zoomin-16x16.h +++ b/graphics/nxglyphs/include/cursor-zoomin-16x16.h @@ -1,6 +1,8 @@ /*************************************************************************** * apps/graphics/nxglyphs/include/cursor-zoomin-16x16.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/include/cursor-zoomin-30x30.h b/graphics/nxglyphs/include/cursor-zoomin-30x30.h index d4bc25c9271..c92e3c2658a 100644 --- a/graphics/nxglyphs/include/cursor-zoomin-30x30.h +++ b/graphics/nxglyphs/include/cursor-zoomin-30x30.h @@ -1,6 +1,8 @@ /*************************************************************************** * apps/graphics/nxglyphs/include/cursor-zoomin-30x30.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/include/cursor-zoomout-16x16.h b/graphics/nxglyphs/include/cursor-zoomout-16x16.h index d75709c87a2..97fb72dae6f 100644 --- a/graphics/nxglyphs/include/cursor-zoomout-16x16.h +++ b/graphics/nxglyphs/include/cursor-zoomout-16x16.h @@ -1,6 +1,8 @@ /*************************************************************************** * apps/graphics/nxglyphs/include/cursor-zoomout-16x16.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/include/cursor-zoomout-30x30.h b/graphics/nxglyphs/include/cursor-zoomout-30x30.h index 6217946dfd3..9a21f61ab39 100644 --- a/graphics/nxglyphs/include/cursor-zoomout-30x30.h +++ b/graphics/nxglyphs/include/cursor-zoomout-30x30.h @@ -1,6 +1,8 @@ /*************************************************************************** * apps/graphics/nxglyphs/include/cursor-zoomout-30x30.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/include/mkcursor.c b/graphics/nxglyphs/include/mkcursor.c index 4e8b3b105aa..b7d8fa8f0cf 100644 --- a/graphics/nxglyphs/include/mkcursor.c +++ b/graphics/nxglyphs/include/mkcursor.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxglyphs/include/mkcursor.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/include/mkcursor.sh b/graphics/nxglyphs/include/mkcursor.sh index 277855d0ed3..cb7594a5917 100644 --- a/graphics/nxglyphs/include/mkcursor.sh +++ b/graphics/nxglyphs/include/mkcursor.sh @@ -1,6 +1,8 @@ #!/usr/bin/env bash # apps/graphics/nxglyphs/inlclude/mkcursor.sh # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glpyh_menu2-21x21.cxx b/graphics/nxglyphs/src/glpyh_menu2-21x21.cxx index 2ea077a5ad8..6adf09c3f6d 100644 --- a/graphics/nxglyphs/src/glpyh_menu2-21x21.cxx +++ b/graphics/nxglyphs/src/glpyh_menu2-21x21.cxx @@ -1,6 +1,8 @@ /******************************************************************************************** * apps/graphics/nxglyphs/src/glyph_xxxxxx.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glpyh_menu2-42x42.cxx b/graphics/nxglyphs/src/glpyh_menu2-42x42.cxx index fa57ab1cb79..947bef69246 100644 --- a/graphics/nxglyphs/src/glpyh_menu2-42x42.cxx +++ b/graphics/nxglyphs/src/glpyh_menu2-42x42.cxx @@ -1,6 +1,8 @@ /******************************************************************************************** * apps/graphics/nxglyphs/src/glyph_xxxxxx.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glpyh_minimize2-21x21.cxx b/graphics/nxglyphs/src/glpyh_minimize2-21x21.cxx index 36f2b0d11a2..7f891c91323 100644 --- a/graphics/nxglyphs/src/glpyh_minimize2-21x21.cxx +++ b/graphics/nxglyphs/src/glpyh_minimize2-21x21.cxx @@ -1,6 +1,8 @@ /******************************************************************************************** * apps/graphics/nxglyphs/src/glyph_xxxxxx.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glpyh_minimize2-42x42.cxx b/graphics/nxglyphs/src/glpyh_minimize2-42x42.cxx index 1f729cc0140..582d86fd4e5 100644 --- a/graphics/nxglyphs/src/glpyh_minimize2-42x42.cxx +++ b/graphics/nxglyphs/src/glpyh_minimize2-42x42.cxx @@ -1,6 +1,8 @@ /******************************************************************************************** * apps/graphics/nxglyphs/src/glyph_xxxxxx.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glpyh_resize2-21x21.cxx b/graphics/nxglyphs/src/glpyh_resize2-21x21.cxx index 3d32b446439..1e05ce18db1 100644 --- a/graphics/nxglyphs/src/glpyh_resize2-21x21.cxx +++ b/graphics/nxglyphs/src/glpyh_resize2-21x21.cxx @@ -1,6 +1,8 @@ /******************************************************************************************** * apps/graphics/nxglyphs/src/glyph_xxxxxx.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glpyh_resize2-42x42.cxx b/graphics/nxglyphs/src/glpyh_resize2-42x42.cxx index e138226dcb9..c733a08ba6e 100644 --- a/graphics/nxglyphs/src/glpyh_resize2-42x42.cxx +++ b/graphics/nxglyphs/src/glpyh_resize2-42x42.cxx @@ -1,6 +1,8 @@ /******************************************************************************************** * apps/graphics/nxglyphs/src/glyph_xxxxxx.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glpyh_stop2-21x21.cxx b/graphics/nxglyphs/src/glpyh_stop2-21x21.cxx index 511c750f102..d1da539dc74 100644 --- a/graphics/nxglyphs/src/glpyh_stop2-21x21.cxx +++ b/graphics/nxglyphs/src/glpyh_stop2-21x21.cxx @@ -1,6 +1,8 @@ /******************************************************************************************** * apps/graphics/nxglyphs/src/glyph_xxxxxx.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_arrowdown.cxx b/graphics/nxglyphs/src/glyph_arrowdown.cxx index 71745731e4f..84bdf55aa6a 100644 --- a/graphics/nxglyphs/src/glyph_arrowdown.cxx +++ b/graphics/nxglyphs/src/glyph_arrowdown.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxglyphs/src/glyph_arrowdown.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_arrowleft.cxx b/graphics/nxglyphs/src/glyph_arrowleft.cxx index 3cc0067a034..a493713cd90 100644 --- a/graphics/nxglyphs/src/glyph_arrowleft.cxx +++ b/graphics/nxglyphs/src/glyph_arrowleft.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxglyphs/src/glyph_glypharrowleft.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_arrowright.cxx b/graphics/nxglyphs/src/glyph_arrowright.cxx index 6662af8e1b1..f7bacc7d269 100644 --- a/graphics/nxglyphs/src/glyph_arrowright.cxx +++ b/graphics/nxglyphs/src/glyph_arrowright.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxglyphs/src/glyph_arrowright.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_arrowup.cxx b/graphics/nxglyphs/src/glyph_arrowup.cxx index 9d367dec17a..75455b88dce 100644 --- a/graphics/nxglyphs/src/glyph_arrowup.cxx +++ b/graphics/nxglyphs/src/glyph_arrowup.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxglyphs/src/glyph_arrowup.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_backspace.cxx b/graphics/nxglyphs/src/glyph_backspace.cxx index 5512008fa0e..66acf1d786f 100644 --- a/graphics/nxglyphs/src/glyph_backspace.cxx +++ b/graphics/nxglyphs/src/glyph_backspace.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxglyphs/src/glyph_backspace.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_calculator24x25.cxx b/graphics/nxglyphs/src/glyph_calculator24x25.cxx index 105f9ae7c76..640e630921d 100644 --- a/graphics/nxglyphs/src/glyph_calculator24x25.cxx +++ b/graphics/nxglyphs/src/glyph_calculator24x25.cxx @@ -1,6 +1,8 @@ /******************************************************************************************** * apps/graphics/nxglyphs/src/glyph_calculator24x25.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_calculator47x49.cxx b/graphics/nxglyphs/src/glyph_calculator47x49.cxx index 6ea5fb550d5..ddafba86d24 100644 --- a/graphics/nxglyphs/src/glyph_calculator47x49.cxx +++ b/graphics/nxglyphs/src/glyph_calculator47x49.cxx @@ -1,6 +1,8 @@ /******************************************************************************************** * apps/graphics/nxglyphs/src/glyph_calculator47x47.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_calibration24x21.cxx b/graphics/nxglyphs/src/glyph_calibration24x21.cxx index cc510d4f360..4f3bbad00a0 100644 --- a/graphics/nxglyphs/src/glyph_calibration24x21.cxx +++ b/graphics/nxglyphs/src/glyph_calibration24x21.cxx @@ -1,6 +1,8 @@ /******************************************************************************************** * apps/graphics/nxglyphs/src/glyph_calibration24x21.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_calibration48x42.cxx b/graphics/nxglyphs/src/glyph_calibration48x42.cxx index 10af4f128fe..a7518c1879c 100644 --- a/graphics/nxglyphs/src/glyph_calibration48x42.cxx +++ b/graphics/nxglyphs/src/glyph_calibration48x42.cxx @@ -1,6 +1,8 @@ /******************************************************************************************** * apps/graphics/nxglyphs/src/glyph_calibration48x42.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_capslock.cxx b/graphics/nxglyphs/src/glyph_capslock.cxx index c62bfa435b5..fcb55123bb5 100644 --- a/graphics/nxglyphs/src/glyph_capslock.cxx +++ b/graphics/nxglyphs/src/glyph_capslock.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxglyphs/src/glyph_capslock.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_checkboxmu.cxx b/graphics/nxglyphs/src/glyph_checkboxmu.cxx index 33bf8020c36..50aeb0cb679 100644 --- a/graphics/nxglyphs/src/glyph_checkboxmu.cxx +++ b/graphics/nxglyphs/src/glyph_checkboxmu.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxglyphs/src/glyph_checkboxmu.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_checkboxoff.cxx b/graphics/nxglyphs/src/glyph_checkboxoff.cxx index f16471bee00..6f6525fbcd4 100644 --- a/graphics/nxglyphs/src/glyph_checkboxoff.cxx +++ b/graphics/nxglyphs/src/glyph_checkboxoff.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxglyphs/src/glyph_checkboxoff.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_checkboxon.cxx b/graphics/nxglyphs/src/glyph_checkboxon.cxx index 18d87c08394..444ea592699 100644 --- a/graphics/nxglyphs/src/glyph_checkboxon.cxx +++ b/graphics/nxglyphs/src/glyph_checkboxon.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxglyphs/src/glyph_checkboxon.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_cmd25x22.cxx b/graphics/nxglyphs/src/glyph_cmd25x22.cxx index 8e75c8893a4..7f676f5fa25 100644 --- a/graphics/nxglyphs/src/glyph_cmd25x22.cxx +++ b/graphics/nxglyphs/src/glyph_cmd25x22.cxx @@ -1,6 +1,8 @@ /******************************************************************************************** * apps/graphics/nxglyphs/src/glyph_cmd24x22.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_cmd49x43.cxx b/graphics/nxglyphs/src/glyph_cmd49x43.cxx index 25a5049e999..62c1a038aae 100644 --- a/graphics/nxglyphs/src/glyph_cmd49x43.cxx +++ b/graphics/nxglyphs/src/glyph_cmd49x43.cxx @@ -1,6 +1,8 @@ /******************************************************************************************** * apps/graphics/nxglyphs/src/glyph_cmd49x43.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_control.cxx b/graphics/nxglyphs/src/glyph_control.cxx index 7abb17c1f26..53ce6670715 100644 --- a/graphics/nxglyphs/src/glyph_control.cxx +++ b/graphics/nxglyphs/src/glyph_control.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxglyphs/src/glyph_control.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_cycle.cxx b/graphics/nxglyphs/src/glyph_cycle.cxx index ef93caebfb2..fe861d591b7 100644 --- a/graphics/nxglyphs/src/glyph_cycle.cxx +++ b/graphics/nxglyphs/src/glyph_cycle.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxglyphs/src/glyph_cycle.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_lcdclock102x48.cxx b/graphics/nxglyphs/src/glyph_lcdclock102x48.cxx index d3a05ee4aa9..02557fe83ca 100644 --- a/graphics/nxglyphs/src/glyph_lcdclock102x48.cxx +++ b/graphics/nxglyphs/src/glyph_lcdclock102x48.cxx @@ -1,6 +1,8 @@ /******************************************************************************************** * apps/graphics/nxglyphs/src/glyph_lcdclock102x48.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_lcdclock136x64.cxx b/graphics/nxglyphs/src/glyph_lcdclock136x64.cxx index dd5a90801ec..9aa371329de 100644 --- a/graphics/nxglyphs/src/glyph_lcdclock136x64.cxx +++ b/graphics/nxglyphs/src/glyph_lcdclock136x64.cxx @@ -1,6 +1,8 @@ /******************************************************************************************** * apps/graphics/nxglyphs/src/glyph_lcdclock136x64.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_lcdclock51x24.cxx b/graphics/nxglyphs/src/glyph_lcdclock51x24.cxx index 673bf5cc046..aac6c329a25 100644 --- a/graphics/nxglyphs/src/glyph_lcdclock51x24.cxx +++ b/graphics/nxglyphs/src/glyph_lcdclock51x24.cxx @@ -1,6 +1,8 @@ /******************************************************************************************** * apps/graphics/nxglyphs/src/glyph_lcdclock51x24.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_mediagrip60x30.cxx b/graphics/nxglyphs/src/glyph_mediagrip60x30.cxx index feb05141293..8ba1d5c7e21 100644 --- a/graphics/nxglyphs/src/glyph_mediagrip60x30.cxx +++ b/graphics/nxglyphs/src/glyph_mediagrip60x30.cxx @@ -1,6 +1,8 @@ /******************************************************************************************** * apps/graphics/nxglyphs/src/mediagrip60x30.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_mediaplayer24x24.cxx b/graphics/nxglyphs/src/glyph_mediaplayer24x24.cxx index eb76a40951f..aa2ed236af9 100644 --- a/graphics/nxglyphs/src/glyph_mediaplayer24x24.cxx +++ b/graphics/nxglyphs/src/glyph_mediaplayer24x24.cxx @@ -1,6 +1,8 @@ /******************************************************************************************** * apps/graphics/nxglyphs/src/glyph_mediaplayer24x24.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_mediaplayer44x50.cxx b/graphics/nxglyphs/src/glyph_mediaplayer44x50.cxx index 52a705b14c2..d5784d34277 100644 --- a/graphics/nxglyphs/src/glyph_mediaplayer44x50.cxx +++ b/graphics/nxglyphs/src/glyph_mediaplayer44x50.cxx @@ -1,6 +1,8 @@ /******************************************************************************************** * apps/graphics/nxglyphs/src/glyph_mediaplayer44x50.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_menu21x21.cxx b/graphics/nxglyphs/src/glyph_menu21x21.cxx index 4141387b3e4..0e8d99b2a9e 100644 --- a/graphics/nxglyphs/src/glyph_menu21x21.cxx +++ b/graphics/nxglyphs/src/glyph_menu21x21.cxx @@ -1,6 +1,8 @@ /******************************************************************************************** * apps/graphics/nxglyphs/src/glyph_menu21x21.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_menu42x42.cxx b/graphics/nxglyphs/src/glyph_menu42x42.cxx index 0371c7ba2bf..314229519ed 100644 --- a/graphics/nxglyphs/src/glyph_menu42x42.cxx +++ b/graphics/nxglyphs/src/glyph_menu42x42.cxx @@ -1,6 +1,8 @@ /******************************************************************************************** * apps/graphics/nxglyphs/src/glyph_men42x42.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_minimize21x21.cxx b/graphics/nxglyphs/src/glyph_minimize21x21.cxx index 18e3b27dab3..534fd4096e6 100644 --- a/graphics/nxglyphs/src/glyph_minimize21x21.cxx +++ b/graphics/nxglyphs/src/glyph_minimize21x21.cxx @@ -1,6 +1,8 @@ /******************************************************************************************** * apps/graphics/nxglyphs/src/glyph_minimize21x21.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_minimize42x42.cxx b/graphics/nxglyphs/src/glyph_minimize42x42.cxx index 454266364fb..d0d9065ff1c 100644 --- a/graphics/nxglyphs/src/glyph_minimize42x42.cxx +++ b/graphics/nxglyphs/src/glyph_minimize42x42.cxx @@ -1,6 +1,8 @@ /******************************************************************************************** * apps/graphics/nxglyphs/src/glyph_minimize42x42.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_mplayer_controls32x32.cxx b/graphics/nxglyphs/src/glyph_mplayer_controls32x32.cxx index 12c9b447665..1c4cb747973 100644 --- a/graphics/nxglyphs/src/glyph_mplayer_controls32x32.cxx +++ b/graphics/nxglyphs/src/glyph_mplayer_controls32x32.cxx @@ -1,6 +1,8 @@ /******************************************************************************************** * apps/graphics/nxglyphs/src/glyph_mediaplayer32x32.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_mplayer_controls43x41.cxx b/graphics/nxglyphs/src/glyph_mplayer_controls43x41.cxx index 256415d699b..b3728340460 100644 --- a/graphics/nxglyphs/src/glyph_mplayer_controls43x41.cxx +++ b/graphics/nxglyphs/src/glyph_mplayer_controls43x41.cxx @@ -1,6 +1,8 @@ /******************************************************************************************** * apps/graphics/nxglyphs/src/glyph_mediaplayer43x41.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_nxicon21x21.cxx b/graphics/nxglyphs/src/glyph_nxicon21x21.cxx index 605ee81ee28..721d03bdb0e 100644 --- a/graphics/nxglyphs/src/glyph_nxicon21x21.cxx +++ b/graphics/nxglyphs/src/glyph_nxicon21x21.cxx @@ -1,6 +1,8 @@ /******************************************************************************************** * apps/graphics/nxglyphs/src/glyph_nxicon21x21.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_nxicon42x42.cxx b/graphics/nxglyphs/src/glyph_nxicon42x42.cxx index 0b0f9589ee6..e36e0650d77 100644 --- a/graphics/nxglyphs/src/glyph_nxicon42x42.cxx +++ b/graphics/nxglyphs/src/glyph_nxicon42x42.cxx @@ -1,6 +1,8 @@ /******************************************************************************************** * apps/graphics/nxglyphs/src/glyph_nxicon42x42.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_nxlogo160x160.cxx b/graphics/nxglyphs/src/glyph_nxlogo160x160.cxx index 2f67d2f2cec..f2b2f94ab9d 100644 --- a/graphics/nxglyphs/src/glyph_nxlogo160x160.cxx +++ b/graphics/nxglyphs/src/glyph_nxlogo160x160.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxglyphs/src/glyph_nxlogo160x160.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_nxlogo320x320.cxx b/graphics/nxglyphs/src/glyph_nxlogo320x320.cxx index 95e335943f8..8d13da52f72 100644 --- a/graphics/nxglyphs/src/glyph_nxlogo320x320.cxx +++ b/graphics/nxglyphs/src/glyph_nxlogo320x320.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxglyphs/src/glyph_nxlogo320x320.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_play24x24.cxx b/graphics/nxglyphs/src/glyph_play24x24.cxx index 37f74e93764..406f619a233 100644 --- a/graphics/nxglyphs/src/glyph_play24x24.cxx +++ b/graphics/nxglyphs/src/glyph_play24x24.cxx @@ -1,6 +1,8 @@ /******************************************************************************************** * apps/graphics/nxglyphs/src/glyph_play24x24.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_play48x48.cxx b/graphics/nxglyphs/src/glyph_play48x48.cxx index 45d7bdf0949..13edfe0beb3 100644 --- a/graphics/nxglyphs/src/glyph_play48x48.cxx +++ b/graphics/nxglyphs/src/glyph_play48x48.cxx @@ -1,6 +1,8 @@ /******************************************************************************************** * apps/graphics/nxglyphs/src/glyph_play24x24.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_radiobuttonmu.cxx b/graphics/nxglyphs/src/glyph_radiobuttonmu.cxx index ac0230af94a..beb97dc6cea 100644 --- a/graphics/nxglyphs/src/glyph_radiobuttonmu.cxx +++ b/graphics/nxglyphs/src/glyph_radiobuttonmu.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxglyphs/src/glyph_radiobuttonmu.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_radiobuttonoff.cxx b/graphics/nxglyphs/src/glyph_radiobuttonoff.cxx index aaa761a0c9d..ef523b7d792 100644 --- a/graphics/nxglyphs/src/glyph_radiobuttonoff.cxx +++ b/graphics/nxglyphs/src/glyph_radiobuttonoff.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxglyphs/src/glyph_radiobuttonoff.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_radiobuttonon.cxx b/graphics/nxglyphs/src/glyph_radiobuttonon.cxx index 5d5a68b7e70..3e16968e56b 100644 --- a/graphics/nxglyphs/src/glyph_radiobuttonon.cxx +++ b/graphics/nxglyphs/src/glyph_radiobuttonon.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxglyphs/src/glyph_radiobuttonon.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_resize21x21.cxx b/graphics/nxglyphs/src/glyph_resize21x21.cxx index 72def4dcfd8..ac36adf0474 100644 --- a/graphics/nxglyphs/src/glyph_resize21x21.cxx +++ b/graphics/nxglyphs/src/glyph_resize21x21.cxx @@ -1,6 +1,8 @@ /******************************************************************************************** * apps/graphics/nxglyphs/src/glyph_resize21x21.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_resize42x42.cxx b/graphics/nxglyphs/src/glyph_resize42x42.cxx index 1984993a39f..e040eaf4949 100644 --- a/graphics/nxglyphs/src/glyph_resize42x42.cxx +++ b/graphics/nxglyphs/src/glyph_resize42x42.cxx @@ -1,6 +1,8 @@ /******************************************************************************************** * apps/graphics/nxglyphs/src/glyph_resize42x42.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_return.cxx b/graphics/nxglyphs/src/glyph_return.cxx index 7021fccc59b..ce3da683e1e 100644 --- a/graphics/nxglyphs/src/glyph_return.cxx +++ b/graphics/nxglyphs/src/glyph_return.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxglyphs/src/glyph_return.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_screendepthdown.cxx b/graphics/nxglyphs/src/glyph_screendepthdown.cxx index 566ec480039..f945a68870b 100644 --- a/graphics/nxglyphs/src/glyph_screendepthdown.cxx +++ b/graphics/nxglyphs/src/glyph_screendepthdown.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxglyphs/src/glyph_screendepthdown.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_screendepthup.cxx b/graphics/nxglyphs/src/glyph_screendepthup.cxx index a07fb7ba84b..b4c1c005566 100644 --- a/graphics/nxglyphs/src/glyph_screendepthup.cxx +++ b/graphics/nxglyphs/src/glyph_screendepthup.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxglyphs/src/glyph_screendepthup.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_screenflipdown.cxx b/graphics/nxglyphs/src/glyph_screenflipdown.cxx index 5efa1e234df..db8913fe1ff 100644 --- a/graphics/nxglyphs/src/glyph_screenflipdown.cxx +++ b/graphics/nxglyphs/src/glyph_screenflipdown.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxglyphs/src/glyph_screenflipdown.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_screenflipup.cxx b/graphics/nxglyphs/src/glyph_screenflipup.cxx index 00b1dc1594e..7e7d05375ff 100644 --- a/graphics/nxglyphs/src/glyph_screenflipup.cxx +++ b/graphics/nxglyphs/src/glyph_screenflipup.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxglyphs/src/glyph_screenflipup.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_shift.cxx b/graphics/nxglyphs/src/glyph_shift.cxx index 3dae7ba81a8..2ac26cbecda 100644 --- a/graphics/nxglyphs/src/glyph_shift.cxx +++ b/graphics/nxglyphs/src/glyph_shift.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxglyphs/src/glyph_shift.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_stop2-42x42.cxx b/graphics/nxglyphs/src/glyph_stop2-42x42.cxx index 540cea78f64..bca0789fa7a 100644 --- a/graphics/nxglyphs/src/glyph_stop2-42x42.cxx +++ b/graphics/nxglyphs/src/glyph_stop2-42x42.cxx @@ -1,6 +1,8 @@ /******************************************************************************************** * apps/graphics/nxglyphs/src/glyph_xxxxxx.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_stop21x21.cxx b/graphics/nxglyphs/src/glyph_stop21x21.cxx index 459ab9fe6f3..24253f741e1 100644 --- a/graphics/nxglyphs/src/glyph_stop21x21.cxx +++ b/graphics/nxglyphs/src/glyph_stop21x21.cxx @@ -1,6 +1,8 @@ /******************************************************************************************** * apps/graphics/nxglyphs/src/glyph_stop21x21.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_stop42x42.cxx b/graphics/nxglyphs/src/glyph_stop42x42.cxx index 39ea5b9596f..df00f324eae 100644 --- a/graphics/nxglyphs/src/glyph_stop42x42.cxx +++ b/graphics/nxglyphs/src/glyph_stop42x42.cxx @@ -1,6 +1,8 @@ /******************************************************************************************** * apps/graphics/nxglyphs/src/glyph_stop42x42.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_windowclose.cxx b/graphics/nxglyphs/src/glyph_windowclose.cxx index a15a86dbc47..ed5aae68ad8 100644 --- a/graphics/nxglyphs/src/glyph_windowclose.cxx +++ b/graphics/nxglyphs/src/glyph_windowclose.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxglyphs/src/glyph_windowclose.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_windowdepthdown.cxx b/graphics/nxglyphs/src/glyph_windowdepthdown.cxx index 3caab7a28ca..57a7fa0b5da 100644 --- a/graphics/nxglyphs/src/glyph_windowdepthdown.cxx +++ b/graphics/nxglyphs/src/glyph_windowdepthdown.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxglyphs/src/glyph_windowdepthdown.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/glyph_windowdepthup.cxx b/graphics/nxglyphs/src/glyph_windowdepthup.cxx index 0da66903e0b..85982122ced 100644 --- a/graphics/nxglyphs/src/glyph_windowdepthup.cxx +++ b/graphics/nxglyphs/src/glyph_windowdepthup.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxglyphs/src/glyph_windowdepthup.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/mksrle.c b/graphics/nxglyphs/src/mksrle.c index 14000fdbd40..7c3cc849e77 100644 --- a/graphics/nxglyphs/src/mksrle.c +++ b/graphics/nxglyphs/src/mksrle.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxglyphs/src/mksrle.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxglyphs/src/mksrle.sh b/graphics/nxglyphs/src/mksrle.sh index e0f5abd57db..0394a742156 100644 --- a/graphics/nxglyphs/src/mksrle.sh +++ b/graphics/nxglyphs/src/mksrle.sh @@ -1,6 +1,8 @@ #!/usr/bin/env bash # apps/graphics/nxglyphs/src/mksrle.sh # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/Doxygen/gendoc.sh b/graphics/nxwidgets/Doxygen/gendoc.sh index b5264994346..91583365026 100755 --- a/graphics/nxwidgets/Doxygen/gendoc.sh +++ b/graphics/nxwidgets/Doxygen/gendoc.sh @@ -2,6 +2,8 @@ ################################################################################# # apps/graphics/nxwidgets/Doxygen/gendoc.sh # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/Make.defs b/graphics/nxwidgets/Make.defs index 3f131c59b8c..68977c4e2ca 100644 --- a/graphics/nxwidgets/Make.defs +++ b/graphics/nxwidgets/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/graphics/nxwidgets/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/Makefile b/graphics/nxwidgets/Makefile index 1b9a1112d4c..26ab16c426b 100644 --- a/graphics/nxwidgets/Makefile +++ b/graphics/nxwidgets/Makefile @@ -1,6 +1,8 @@ ################################################################################# # apps/graphics/nxwidgets/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CButton/Make.defs b/graphics/nxwidgets/UnitTests/CButton/Make.defs index a3dfda9080e..1c288558478 100644 --- a/graphics/nxwidgets/UnitTests/CButton/Make.defs +++ b/graphics/nxwidgets/UnitTests/CButton/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/graphics/nxwidgets/UnitTests/CButton/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CButton/Makefile b/graphics/nxwidgets/UnitTests/CButton/Makefile index 54695133efb..6db8eb923c2 100644 --- a/graphics/nxwidgets/UnitTests/CButton/Makefile +++ b/graphics/nxwidgets/UnitTests/CButton/Makefile @@ -1,6 +1,8 @@ ################################################################################# # apps/graphics/nxwidgets/UnitTests/CButton/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CButton/cbutton_main.cxx b/graphics/nxwidgets/UnitTests/CButton/cbutton_main.cxx index cf14ec96987..472348ba5d9 100644 --- a/graphics/nxwidgets/UnitTests/CButton/cbutton_main.cxx +++ b/graphics/nxwidgets/UnitTests/CButton/cbutton_main.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CButton/cbutton_main.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CButton/cbuttontest.cxx b/graphics/nxwidgets/UnitTests/CButton/cbuttontest.cxx index a7bf092ad11..773f0435e47 100644 --- a/graphics/nxwidgets/UnitTests/CButton/cbuttontest.cxx +++ b/graphics/nxwidgets/UnitTests/CButton/cbuttontest.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CButton/cbuttontest.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CButton/cbuttontest.hxx b/graphics/nxwidgets/UnitTests/CButton/cbuttontest.hxx index 214274df279..8b1749d888f 100644 --- a/graphics/nxwidgets/UnitTests/CButton/cbuttontest.hxx +++ b/graphics/nxwidgets/UnitTests/CButton/cbuttontest.hxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CButton/cbuttontest.hxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CButtonArray/Make.defs b/graphics/nxwidgets/UnitTests/CButtonArray/Make.defs index c1d6130aedc..a08aa28423a 100644 --- a/graphics/nxwidgets/UnitTests/CButtonArray/Make.defs +++ b/graphics/nxwidgets/UnitTests/CButtonArray/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/graphics/nxwidgets/UnitTests/CButtonArray/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CButtonArray/Makefile b/graphics/nxwidgets/UnitTests/CButtonArray/Makefile index 1fe25c65632..b8870c51faa 100644 --- a/graphics/nxwidgets/UnitTests/CButtonArray/Makefile +++ b/graphics/nxwidgets/UnitTests/CButtonArray/Makefile @@ -1,6 +1,8 @@ ################################################################################# # apps/graphics/nxwidgets/UnitTests/CButtonArray/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CButtonArray/cbuttonarray_main.cxx b/graphics/nxwidgets/UnitTests/CButtonArray/cbuttonarray_main.cxx index 13692fa7002..8af3de7d1ce 100644 --- a/graphics/nxwidgets/UnitTests/CButtonArray/cbuttonarray_main.cxx +++ b/graphics/nxwidgets/UnitTests/CButtonArray/cbuttonarray_main.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CButtonArray/cbuttonarray_main.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CButtonArray/cbuttonarraytest.cxx b/graphics/nxwidgets/UnitTests/CButtonArray/cbuttonarraytest.cxx index 4de68ade07b..a19c6f8803b 100644 --- a/graphics/nxwidgets/UnitTests/CButtonArray/cbuttonarraytest.cxx +++ b/graphics/nxwidgets/UnitTests/CButtonArray/cbuttonarraytest.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CButtonArray/cbuttonarraytest.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CButtonArray/cbuttonarraytest.hxx b/graphics/nxwidgets/UnitTests/CButtonArray/cbuttonarraytest.hxx index ccd02775557..a13783bd5ea 100644 --- a/graphics/nxwidgets/UnitTests/CButtonArray/cbuttonarraytest.hxx +++ b/graphics/nxwidgets/UnitTests/CButtonArray/cbuttonarraytest.hxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CButtonArray/cbuttonarraytest.hxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CCheckBox/Make.defs b/graphics/nxwidgets/UnitTests/CCheckBox/Make.defs index f79a8e1989e..be552f0a780 100644 --- a/graphics/nxwidgets/UnitTests/CCheckBox/Make.defs +++ b/graphics/nxwidgets/UnitTests/CCheckBox/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/graphics/nxwidgets/UnitTests/CCheckBox/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CCheckBox/Makefile b/graphics/nxwidgets/UnitTests/CCheckBox/Makefile index 0c244e7be44..bbc55255ef6 100644 --- a/graphics/nxwidgets/UnitTests/CCheckBox/Makefile +++ b/graphics/nxwidgets/UnitTests/CCheckBox/Makefile @@ -1,6 +1,8 @@ ################################################################################# # apps/graphics/nxwidgets/UnitTests/CCheckBox/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CCheckBox/ccheckbox_main.cxx b/graphics/nxwidgets/UnitTests/CCheckBox/ccheckbox_main.cxx index a4dd417c418..8719611baf0 100644 --- a/graphics/nxwidgets/UnitTests/CCheckBox/ccheckbox_main.cxx +++ b/graphics/nxwidgets/UnitTests/CCheckBox/ccheckbox_main.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CCheckBox/ccheckbox_main.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CCheckBox/ccheckboxtest.cxx b/graphics/nxwidgets/UnitTests/CCheckBox/ccheckboxtest.cxx index 7fa2371a360..1ff5a0a534d 100644 --- a/graphics/nxwidgets/UnitTests/CCheckBox/ccheckboxtest.cxx +++ b/graphics/nxwidgets/UnitTests/CCheckBox/ccheckboxtest.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CCheckBox/ccheckboxtest.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CCheckBox/ccheckboxtest.hxx b/graphics/nxwidgets/UnitTests/CCheckBox/ccheckboxtest.hxx index eb708b372bd..1bd72dba53e 100644 --- a/graphics/nxwidgets/UnitTests/CCheckBox/ccheckboxtest.hxx +++ b/graphics/nxwidgets/UnitTests/CCheckBox/ccheckboxtest.hxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CCheckBox/ccheckboxtest.hxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CGlyphButton/Make.defs b/graphics/nxwidgets/UnitTests/CGlyphButton/Make.defs index 09d2c858389..bbc695233ad 100644 --- a/graphics/nxwidgets/UnitTests/CGlyphButton/Make.defs +++ b/graphics/nxwidgets/UnitTests/CGlyphButton/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/graphics/nxwidgets/UnitTests/CGlyphButton/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CGlyphButton/Makefile b/graphics/nxwidgets/UnitTests/CGlyphButton/Makefile index d1668f163ad..409fdff79d5 100644 --- a/graphics/nxwidgets/UnitTests/CGlyphButton/Makefile +++ b/graphics/nxwidgets/UnitTests/CGlyphButton/Makefile @@ -1,6 +1,8 @@ ################################################################################# # apps/graphics/nxwidgets/UnitTests/CGlyphButton/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CGlyphButton/cglyphbutton_main.cxx b/graphics/nxwidgets/UnitTests/CGlyphButton/cglyphbutton_main.cxx index f08da13e0ef..ec673c5f2f2 100644 --- a/graphics/nxwidgets/UnitTests/CGlyphButton/cglyphbutton_main.cxx +++ b/graphics/nxwidgets/UnitTests/CGlyphButton/cglyphbutton_main.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CGlyphButton/cglyphbutton_main.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CGlyphButton/cglyphbuttontest.cxx b/graphics/nxwidgets/UnitTests/CGlyphButton/cglyphbuttontest.cxx index b46d4de47ab..f46468626c3 100644 --- a/graphics/nxwidgets/UnitTests/CGlyphButton/cglyphbuttontest.cxx +++ b/graphics/nxwidgets/UnitTests/CGlyphButton/cglyphbuttontest.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CGlyphButton/cglyphbuttontest.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CGlyphButton/cglyphbuttontest.hxx b/graphics/nxwidgets/UnitTests/CGlyphButton/cglyphbuttontest.hxx index 9960277e40d..d7593734feb 100644 --- a/graphics/nxwidgets/UnitTests/CGlyphButton/cglyphbuttontest.hxx +++ b/graphics/nxwidgets/UnitTests/CGlyphButton/cglyphbuttontest.hxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CGlyphButton/cglyphbuttontest.hxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CGlyphSliderHorizontal/Make.defs b/graphics/nxwidgets/UnitTests/CGlyphSliderHorizontal/Make.defs index a9bf1b3e959..36bdeb7b2f2 100644 --- a/graphics/nxwidgets/UnitTests/CGlyphSliderHorizontal/Make.defs +++ b/graphics/nxwidgets/UnitTests/CGlyphSliderHorizontal/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/graphics/nxwidgets/UnitTests/CGlyphSliderHorizontal/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CGlyphSliderHorizontal/Makefile b/graphics/nxwidgets/UnitTests/CGlyphSliderHorizontal/Makefile index 349e18d5d8b..19426bb0256 100644 --- a/graphics/nxwidgets/UnitTests/CGlyphSliderHorizontal/Makefile +++ b/graphics/nxwidgets/UnitTests/CGlyphSliderHorizontal/Makefile @@ -1,6 +1,8 @@ ################################################################################# # apps/graphics/nxwidgets/UnitTests/CGlyphSliderHorizontal/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CGlyphSliderHorizontal/cglyphsliderhorizontal_main.cxx b/graphics/nxwidgets/UnitTests/CGlyphSliderHorizontal/cglyphsliderhorizontal_main.cxx index c3bfa04c97c..e40c78be79c 100644 --- a/graphics/nxwidgets/UnitTests/CGlyphSliderHorizontal/cglyphsliderhorizontal_main.cxx +++ b/graphics/nxwidgets/UnitTests/CGlyphSliderHorizontal/cglyphsliderhorizontal_main.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CGlyphSliderHorizontal/cglyphsliderhorizontal_main.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CGlyphSliderHorizontal/cglyphsliderhorizontaltest.cxx b/graphics/nxwidgets/UnitTests/CGlyphSliderHorizontal/cglyphsliderhorizontaltest.cxx index 6687923cf7c..2809bfb261d 100644 --- a/graphics/nxwidgets/UnitTests/CGlyphSliderHorizontal/cglyphsliderhorizontaltest.cxx +++ b/graphics/nxwidgets/UnitTests/CGlyphSliderHorizontal/cglyphsliderhorizontaltest.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CGlyphSliderHorizontal/cglyphsliderhorizontaltest.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CGlyphSliderHorizontal/cglyphsliderhorizontaltest.hxx b/graphics/nxwidgets/UnitTests/CGlyphSliderHorizontal/cglyphsliderhorizontaltest.hxx index 30e1afb4934..c3fd43eccec 100644 --- a/graphics/nxwidgets/UnitTests/CGlyphSliderHorizontal/cglyphsliderhorizontaltest.hxx +++ b/graphics/nxwidgets/UnitTests/CGlyphSliderHorizontal/cglyphsliderhorizontaltest.hxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CGlyphSliderHorizontal/cglyphsliderhorizontaltest.hxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CImage/Make.defs b/graphics/nxwidgets/UnitTests/CImage/Make.defs index 44488e48fe1..a17112fab06 100644 --- a/graphics/nxwidgets/UnitTests/CImage/Make.defs +++ b/graphics/nxwidgets/UnitTests/CImage/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/graphics/nxwidgets/UnitTests/CImage/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CImage/Makefile b/graphics/nxwidgets/UnitTests/CImage/Makefile index 2f4ee9fe71e..af2250543bc 100644 --- a/graphics/nxwidgets/UnitTests/CImage/Makefile +++ b/graphics/nxwidgets/UnitTests/CImage/Makefile @@ -1,6 +1,8 @@ ################################################################################# # apps/graphics/nxwidgets/UnitTests/CImage/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CImage/cimage_main.cxx b/graphics/nxwidgets/UnitTests/CImage/cimage_main.cxx index fc5e29b15fe..3423d6e742b 100644 --- a/graphics/nxwidgets/UnitTests/CImage/cimage_main.cxx +++ b/graphics/nxwidgets/UnitTests/CImage/cimage_main.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CImage/cimage_main.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CImage/cimagetest.cxx b/graphics/nxwidgets/UnitTests/CImage/cimagetest.cxx index a4a315f1257..2472f19f25a 100644 --- a/graphics/nxwidgets/UnitTests/CImage/cimagetest.cxx +++ b/graphics/nxwidgets/UnitTests/CImage/cimagetest.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CImage/cimagetest.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CImage/cimagetest.hxx b/graphics/nxwidgets/UnitTests/CImage/cimagetest.hxx index d76abe4a946..34568a5f4ae 100644 --- a/graphics/nxwidgets/UnitTests/CImage/cimagetest.hxx +++ b/graphics/nxwidgets/UnitTests/CImage/cimagetest.hxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CImage/cimagetest.hxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CKeypad/Make.defs b/graphics/nxwidgets/UnitTests/CKeypad/Make.defs index 3896547c6cc..fa01753197c 100644 --- a/graphics/nxwidgets/UnitTests/CKeypad/Make.defs +++ b/graphics/nxwidgets/UnitTests/CKeypad/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/graphics/nxwidgets/UnitTests/CKeypad/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CKeypad/Makefile b/graphics/nxwidgets/UnitTests/CKeypad/Makefile index df283728f74..44796a4c332 100644 --- a/graphics/nxwidgets/UnitTests/CKeypad/Makefile +++ b/graphics/nxwidgets/UnitTests/CKeypad/Makefile @@ -1,6 +1,8 @@ ################################################################################# # apps/graphics/nxwidgets/UnitTests/CKeypad/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CKeypad/ckeypad_main.cxx b/graphics/nxwidgets/UnitTests/CKeypad/ckeypad_main.cxx index a20fca6946e..bfd5dfd2c3b 100644 --- a/graphics/nxwidgets/UnitTests/CKeypad/ckeypad_main.cxx +++ b/graphics/nxwidgets/UnitTests/CKeypad/ckeypad_main.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CKeypad/ckeypad_main.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CKeypad/ckeypadtest.cxx b/graphics/nxwidgets/UnitTests/CKeypad/ckeypadtest.cxx index 2d6d6ff806f..64cf7c36652 100644 --- a/graphics/nxwidgets/UnitTests/CKeypad/ckeypadtest.cxx +++ b/graphics/nxwidgets/UnitTests/CKeypad/ckeypadtest.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CKeypad/ckeypadtest.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CKeypad/ckeypadtest.hxx b/graphics/nxwidgets/UnitTests/CKeypad/ckeypadtest.hxx index 97504a59e35..f566d8bcd01 100644 --- a/graphics/nxwidgets/UnitTests/CKeypad/ckeypadtest.hxx +++ b/graphics/nxwidgets/UnitTests/CKeypad/ckeypadtest.hxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CKeypad/ckeypadtest.hxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CLabel/Make.defs b/graphics/nxwidgets/UnitTests/CLabel/Make.defs index e0c348020d7..be0a9e9c658 100644 --- a/graphics/nxwidgets/UnitTests/CLabel/Make.defs +++ b/graphics/nxwidgets/UnitTests/CLabel/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/graphics/nxwidgets/UnitTests/CLabel/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CLabel/Makefile b/graphics/nxwidgets/UnitTests/CLabel/Makefile index 377744eaa15..3e9dd9111bb 100644 --- a/graphics/nxwidgets/UnitTests/CLabel/Makefile +++ b/graphics/nxwidgets/UnitTests/CLabel/Makefile @@ -1,6 +1,8 @@ ################################################################################# # apps/graphics/nxwidgets/UnitTests/CLabel/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CLabel/clabel_main.cxx b/graphics/nxwidgets/UnitTests/CLabel/clabel_main.cxx index 833eae15410..bed815541c4 100644 --- a/graphics/nxwidgets/UnitTests/CLabel/clabel_main.cxx +++ b/graphics/nxwidgets/UnitTests/CLabel/clabel_main.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CLabel/clabel_main.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CLabel/clabeltest.cxx b/graphics/nxwidgets/UnitTests/CLabel/clabeltest.cxx index d4658d8d6a7..1851674ade1 100644 --- a/graphics/nxwidgets/UnitTests/CLabel/clabeltest.cxx +++ b/graphics/nxwidgets/UnitTests/CLabel/clabeltest.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CLabel/clabeltest.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CLabel/clabeltest.hxx b/graphics/nxwidgets/UnitTests/CLabel/clabeltest.hxx index 9d4b55d76bd..57ccc1f0d72 100644 --- a/graphics/nxwidgets/UnitTests/CLabel/clabeltest.hxx +++ b/graphics/nxwidgets/UnitTests/CLabel/clabeltest.hxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CLabel/clabeltest.hxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CLatchButton/Make.defs b/graphics/nxwidgets/UnitTests/CLatchButton/Make.defs index 727e095759f..a7a89422898 100644 --- a/graphics/nxwidgets/UnitTests/CLatchButton/Make.defs +++ b/graphics/nxwidgets/UnitTests/CLatchButton/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/graphics/nxwidgets/UnitTests/CLatchButton/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CLatchButton/Makefile b/graphics/nxwidgets/UnitTests/CLatchButton/Makefile index 1022ce33b57..be605df194f 100644 --- a/graphics/nxwidgets/UnitTests/CLatchButton/Makefile +++ b/graphics/nxwidgets/UnitTests/CLatchButton/Makefile @@ -1,6 +1,8 @@ ################################################################################# # apps/graphics/nxwidgets/UnitTests/CLatchButton/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CLatchButton/clatchbutton_main.cxx b/graphics/nxwidgets/UnitTests/CLatchButton/clatchbutton_main.cxx index 80401c6dce1..ca0310ae238 100644 --- a/graphics/nxwidgets/UnitTests/CLatchButton/clatchbutton_main.cxx +++ b/graphics/nxwidgets/UnitTests/CLatchButton/clatchbutton_main.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CLatchButton/clatchbutton_main.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CLatchButton/clatchbuttontest.cxx b/graphics/nxwidgets/UnitTests/CLatchButton/clatchbuttontest.cxx index f87004d3bc1..58fe9b6a1b7 100644 --- a/graphics/nxwidgets/UnitTests/CLatchButton/clatchbuttontest.cxx +++ b/graphics/nxwidgets/UnitTests/CLatchButton/clatchbuttontest.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CLatchButton/clatchbuttontest.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CLatchButton/clatchbuttontest.hxx b/graphics/nxwidgets/UnitTests/CLatchButton/clatchbuttontest.hxx index 5faac6afebc..71946d32510 100644 --- a/graphics/nxwidgets/UnitTests/CLatchButton/clatchbuttontest.hxx +++ b/graphics/nxwidgets/UnitTests/CLatchButton/clatchbuttontest.hxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CLatchButton/clatchbuttontest.hxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CLatchButtonArray/Make.defs b/graphics/nxwidgets/UnitTests/CLatchButtonArray/Make.defs index 9fdb923f649..7e6705dc213 100644 --- a/graphics/nxwidgets/UnitTests/CLatchButtonArray/Make.defs +++ b/graphics/nxwidgets/UnitTests/CLatchButtonArray/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/graphics/nxwidgets/UnitTests/CLatchButtonArray/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CLatchButtonArray/Makefile b/graphics/nxwidgets/UnitTests/CLatchButtonArray/Makefile index 12b896268c3..2909a9e2a15 100644 --- a/graphics/nxwidgets/UnitTests/CLatchButtonArray/Makefile +++ b/graphics/nxwidgets/UnitTests/CLatchButtonArray/Makefile @@ -1,6 +1,8 @@ ################################################################################# # apps/graphics/nxwidgets/UnitTests/CLatchButtonArray/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CLatchButtonArray/clatchbuttonarray_main.cxx b/graphics/nxwidgets/UnitTests/CLatchButtonArray/clatchbuttonarray_main.cxx index 209b6cd09cd..fd6dcbeb0e0 100644 --- a/graphics/nxwidgets/UnitTests/CLatchButtonArray/clatchbuttonarray_main.cxx +++ b/graphics/nxwidgets/UnitTests/CLatchButtonArray/clatchbuttonarray_main.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CLatchButtonArray/clatchbuttonarry_main.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CLatchButtonArray/clatchbuttonarraytest.cxx b/graphics/nxwidgets/UnitTests/CLatchButtonArray/clatchbuttonarraytest.cxx index c6141cdb83e..3da02db9984 100644 --- a/graphics/nxwidgets/UnitTests/CLatchButtonArray/clatchbuttonarraytest.cxx +++ b/graphics/nxwidgets/UnitTests/CLatchButtonArray/clatchbuttonarraytest.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CLatchButtonArray/clatchbuttonarraytest.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CLatchButtonArray/clatchbuttonarraytest.hxx b/graphics/nxwidgets/UnitTests/CLatchButtonArray/clatchbuttonarraytest.hxx index e142769e17b..212d512a730 100644 --- a/graphics/nxwidgets/UnitTests/CLatchButtonArray/clatchbuttonarraytest.hxx +++ b/graphics/nxwidgets/UnitTests/CLatchButtonArray/clatchbuttonarraytest.hxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CLatchButtonArray/clatchbuttonarraytest.hxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CListBox/Make.defs b/graphics/nxwidgets/UnitTests/CListBox/Make.defs index 7288cc08af5..d17218d000e 100644 --- a/graphics/nxwidgets/UnitTests/CListBox/Make.defs +++ b/graphics/nxwidgets/UnitTests/CListBox/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/graphics/nxwidgets/UnitTests/CListBox/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CListBox/Makefile b/graphics/nxwidgets/UnitTests/CListBox/Makefile index 56e5e0ea039..961ec066e49 100644 --- a/graphics/nxwidgets/UnitTests/CListBox/Makefile +++ b/graphics/nxwidgets/UnitTests/CListBox/Makefile @@ -1,6 +1,8 @@ ################################################################################# # apps/graphics/nxwidgets/UnitTests/CListBox/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CListBox/clistbox_main.cxx b/graphics/nxwidgets/UnitTests/CListBox/clistbox_main.cxx index 07a67312a9a..45864f1e511 100644 --- a/graphics/nxwidgets/UnitTests/CListBox/clistbox_main.cxx +++ b/graphics/nxwidgets/UnitTests/CListBox/clistbox_main.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CListBox/clistbox_main.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CListBox/clistboxtest.cxx b/graphics/nxwidgets/UnitTests/CListBox/clistboxtest.cxx index cfd184f8dc0..7bd3836de63 100644 --- a/graphics/nxwidgets/UnitTests/CListBox/clistboxtest.cxx +++ b/graphics/nxwidgets/UnitTests/CListBox/clistboxtest.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CListBox/clistboxtest.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CListBox/clistboxtest.hxx b/graphics/nxwidgets/UnitTests/CListBox/clistboxtest.hxx index 8f7e1134956..452240dc9f6 100644 --- a/graphics/nxwidgets/UnitTests/CListBox/clistboxtest.hxx +++ b/graphics/nxwidgets/UnitTests/CListBox/clistboxtest.hxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CListBox/clistboxtest.hxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CProgressBar/Make.defs b/graphics/nxwidgets/UnitTests/CProgressBar/Make.defs index 1b15c62d5fb..e77ec2ceb46 100644 --- a/graphics/nxwidgets/UnitTests/CProgressBar/Make.defs +++ b/graphics/nxwidgets/UnitTests/CProgressBar/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/graphics/nxwidgets/UnitTests/CProgressBar/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CProgressBar/Makefile b/graphics/nxwidgets/UnitTests/CProgressBar/Makefile index 21cd0199a34..3697e365f74 100644 --- a/graphics/nxwidgets/UnitTests/CProgressBar/Makefile +++ b/graphics/nxwidgets/UnitTests/CProgressBar/Makefile @@ -1,6 +1,8 @@ ################################################################################# # apps/graphics/nxwidgets/UnitTests/CProgressBar/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CProgressBar/cprogressbar_main.cxx b/graphics/nxwidgets/UnitTests/CProgressBar/cprogressbar_main.cxx index 74ab8b91c51..d5c5d4b9fd6 100644 --- a/graphics/nxwidgets/UnitTests/CProgressBar/cprogressbar_main.cxx +++ b/graphics/nxwidgets/UnitTests/CProgressBar/cprogressbar_main.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CProgressBar/cprogressbar_main.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CProgressBar/cprogressbartest.cxx b/graphics/nxwidgets/UnitTests/CProgressBar/cprogressbartest.cxx index 5044866416d..11ad6bb077b 100644 --- a/graphics/nxwidgets/UnitTests/CProgressBar/cprogressbartest.cxx +++ b/graphics/nxwidgets/UnitTests/CProgressBar/cprogressbartest.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/ProgressBar/cprogressbartest.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CProgressBar/cprogressbartest.hxx b/graphics/nxwidgets/UnitTests/CProgressBar/cprogressbartest.hxx index 2cc0f457121..dd8dcf10323 100644 --- a/graphics/nxwidgets/UnitTests/CProgressBar/cprogressbartest.hxx +++ b/graphics/nxwidgets/UnitTests/CProgressBar/cprogressbartest.hxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CProgressBar/cprogressbartest.hxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CRadioButton/Make.defs b/graphics/nxwidgets/UnitTests/CRadioButton/Make.defs index b98084d709d..dbcd4e55940 100644 --- a/graphics/nxwidgets/UnitTests/CRadioButton/Make.defs +++ b/graphics/nxwidgets/UnitTests/CRadioButton/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/graphics/nxwidgets/UnitTests/CRadioButton/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CRadioButton/Makefile b/graphics/nxwidgets/UnitTests/CRadioButton/Makefile index 683c940b8ed..af324f188ce 100644 --- a/graphics/nxwidgets/UnitTests/CRadioButton/Makefile +++ b/graphics/nxwidgets/UnitTests/CRadioButton/Makefile @@ -1,6 +1,8 @@ ################################################################################# # apps/graphics/nxwidgets/UnitTests/CRadioButton/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CRadioButton/cradiobutton_main.cxx b/graphics/nxwidgets/UnitTests/CRadioButton/cradiobutton_main.cxx index 0953e34411c..fd0c13b4071 100644 --- a/graphics/nxwidgets/UnitTests/CRadioButton/cradiobutton_main.cxx +++ b/graphics/nxwidgets/UnitTests/CRadioButton/cradiobutton_main.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CRadioButton/cradiobutton_main.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CRadioButton/cradiobuttontest.cxx b/graphics/nxwidgets/UnitTests/CRadioButton/cradiobuttontest.cxx index e42ec761fe9..683dc02dc6d 100644 --- a/graphics/nxwidgets/UnitTests/CRadioButton/cradiobuttontest.cxx +++ b/graphics/nxwidgets/UnitTests/CRadioButton/cradiobuttontest.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CRadioButton/cradiobuttontest.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CRadioButton/cradiobuttontest.hxx b/graphics/nxwidgets/UnitTests/CRadioButton/cradiobuttontest.hxx index 577b8a1e731..fc8d7ee2901 100644 --- a/graphics/nxwidgets/UnitTests/CRadioButton/cradiobuttontest.hxx +++ b/graphics/nxwidgets/UnitTests/CRadioButton/cradiobuttontest.hxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CRadioButton/cradiobuttontest.hxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CScrollbarHorizontal/Make.defs b/graphics/nxwidgets/UnitTests/CScrollbarHorizontal/Make.defs index 0fca7b68ad2..68fb2e45dbc 100644 --- a/graphics/nxwidgets/UnitTests/CScrollbarHorizontal/Make.defs +++ b/graphics/nxwidgets/UnitTests/CScrollbarHorizontal/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/graphics/nxwidgets/UnitTests/CScrollbarHorizontal/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CScrollbarHorizontal/Makefile b/graphics/nxwidgets/UnitTests/CScrollbarHorizontal/Makefile index 03bb8149019..8a1b989b1a5 100644 --- a/graphics/nxwidgets/UnitTests/CScrollbarHorizontal/Makefile +++ b/graphics/nxwidgets/UnitTests/CScrollbarHorizontal/Makefile @@ -1,6 +1,8 @@ ################################################################################# # apps/graphics/nxwidgets/UnitTests/CScrollbarHorizontal/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CScrollbarHorizontal/cscrollbarhorizontal_main.cxx b/graphics/nxwidgets/UnitTests/CScrollbarHorizontal/cscrollbarhorizontal_main.cxx index 344e84cca76..51ea0e6e2ea 100644 --- a/graphics/nxwidgets/UnitTests/CScrollbarHorizontal/cscrollbarhorizontal_main.cxx +++ b/graphics/nxwidgets/UnitTests/CScrollbarHorizontal/cscrollbarhorizontal_main.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CScrollbarHorizontal/cscrollbarhorizontal_main.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CScrollbarHorizontal/cscrollbarhorizontaltest.cxx b/graphics/nxwidgets/UnitTests/CScrollbarHorizontal/cscrollbarhorizontaltest.cxx index 4fb7505ccdd..e59f0fe3b2d 100644 --- a/graphics/nxwidgets/UnitTests/CScrollbarHorizontal/cscrollbarhorizontaltest.cxx +++ b/graphics/nxwidgets/UnitTests/CScrollbarHorizontal/cscrollbarhorizontaltest.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CScrollbarHorizontal/cscrollbarhorizontaltest.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CScrollbarHorizontal/cscrollbarhorizontaltest.hxx b/graphics/nxwidgets/UnitTests/CScrollbarHorizontal/cscrollbarhorizontaltest.hxx index 190d6243c6a..c8b31b3926e 100644 --- a/graphics/nxwidgets/UnitTests/CScrollbarHorizontal/cscrollbarhorizontaltest.hxx +++ b/graphics/nxwidgets/UnitTests/CScrollbarHorizontal/cscrollbarhorizontaltest.hxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CScrollbarHorizontal/cscrollbarhorizontaltest.hxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CScrollbarVertical/Make.defs b/graphics/nxwidgets/UnitTests/CScrollbarVertical/Make.defs index 051a7d49bb3..f5c251149be 100644 --- a/graphics/nxwidgets/UnitTests/CScrollbarVertical/Make.defs +++ b/graphics/nxwidgets/UnitTests/CScrollbarVertical/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/graphics/nxwidgets/UnitTests/CScrollbarVertical/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CScrollbarVertical/Makefile b/graphics/nxwidgets/UnitTests/CScrollbarVertical/Makefile index fb63717ae1a..43967552062 100644 --- a/graphics/nxwidgets/UnitTests/CScrollbarVertical/Makefile +++ b/graphics/nxwidgets/UnitTests/CScrollbarVertical/Makefile @@ -1,6 +1,8 @@ ################################################################################# # apps/graphics/nxwidgets/UnitTests/CScrollbarVertical/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CScrollbarVertical/cscrollbarvertical_main.cxx b/graphics/nxwidgets/UnitTests/CScrollbarVertical/cscrollbarvertical_main.cxx index 01b957a201e..04664b08be6 100644 --- a/graphics/nxwidgets/UnitTests/CScrollbarVertical/cscrollbarvertical_main.cxx +++ b/graphics/nxwidgets/UnitTests/CScrollbarVertical/cscrollbarvertical_main.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CScrollbarVertical/cscrollbarvertical_main.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CScrollbarVertical/cscrollbarverticaltest.cxx b/graphics/nxwidgets/UnitTests/CScrollbarVertical/cscrollbarverticaltest.cxx index 58db0398855..bbf21f2c2a9 100644 --- a/graphics/nxwidgets/UnitTests/CScrollbarVertical/cscrollbarverticaltest.cxx +++ b/graphics/nxwidgets/UnitTests/CScrollbarVertical/cscrollbarverticaltest.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CScrollbarVertical/cscrollbarverticaltest.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CScrollbarVertical/cscrollbarverticaltest.hxx b/graphics/nxwidgets/UnitTests/CScrollbarVertical/cscrollbarverticaltest.hxx index 78dca2edb0d..159fb3bf2f2 100644 --- a/graphics/nxwidgets/UnitTests/CScrollbarVertical/cscrollbarverticaltest.hxx +++ b/graphics/nxwidgets/UnitTests/CScrollbarVertical/cscrollbarverticaltest.hxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CScrollbarVertical/cscrollbarverticaltest.hxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CSliderHorizonal/Make.defs b/graphics/nxwidgets/UnitTests/CSliderHorizonal/Make.defs index a7c3afe4275..1a5144f3c5c 100644 --- a/graphics/nxwidgets/UnitTests/CSliderHorizonal/Make.defs +++ b/graphics/nxwidgets/UnitTests/CSliderHorizonal/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/graphics/nxwidgets/UnitTests/CSliderHorizonal/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CSliderHorizonal/Makefile b/graphics/nxwidgets/UnitTests/CSliderHorizonal/Makefile index 6d5ba91e4ea..893f1942ce6 100644 --- a/graphics/nxwidgets/UnitTests/CSliderHorizonal/Makefile +++ b/graphics/nxwidgets/UnitTests/CSliderHorizonal/Makefile @@ -1,6 +1,8 @@ ################################################################################# # apps/graphics/nxwidgets/UnitTests/CSliderHorizontal/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CSliderHorizonal/csliderhorizontal_main.cxx b/graphics/nxwidgets/UnitTests/CSliderHorizonal/csliderhorizontal_main.cxx index 33c19c66849..9b8f21b547b 100644 --- a/graphics/nxwidgets/UnitTests/CSliderHorizonal/csliderhorizontal_main.cxx +++ b/graphics/nxwidgets/UnitTests/CSliderHorizonal/csliderhorizontal_main.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CSliderHorizontal/csliderhorizontal_main.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CSliderHorizonal/csliderhorizontaltest.cxx b/graphics/nxwidgets/UnitTests/CSliderHorizonal/csliderhorizontaltest.cxx index de7f875b0ed..8a9e194968e 100644 --- a/graphics/nxwidgets/UnitTests/CSliderHorizonal/csliderhorizontaltest.cxx +++ b/graphics/nxwidgets/UnitTests/CSliderHorizonal/csliderhorizontaltest.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CSliderHorizontal/csliderhorizontaltest.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CSliderHorizonal/csliderhorizontaltest.hxx b/graphics/nxwidgets/UnitTests/CSliderHorizonal/csliderhorizontaltest.hxx index 3eb6ee7ff79..538af2daf21 100644 --- a/graphics/nxwidgets/UnitTests/CSliderHorizonal/csliderhorizontaltest.hxx +++ b/graphics/nxwidgets/UnitTests/CSliderHorizonal/csliderhorizontaltest.hxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CSliderHorizontal/csliderhorizontaltest.hxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CSliderVertical/Make.defs b/graphics/nxwidgets/UnitTests/CSliderVertical/Make.defs index 7cd8c5fb0b7..ef0a92bccde 100644 --- a/graphics/nxwidgets/UnitTests/CSliderVertical/Make.defs +++ b/graphics/nxwidgets/UnitTests/CSliderVertical/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/graphics/nxwidgets/UnitTests/CSliderVertical/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CSliderVertical/Makefile b/graphics/nxwidgets/UnitTests/CSliderVertical/Makefile index d989b56c215..d4a9725250d 100644 --- a/graphics/nxwidgets/UnitTests/CSliderVertical/Makefile +++ b/graphics/nxwidgets/UnitTests/CSliderVertical/Makefile @@ -1,6 +1,8 @@ ################################################################################# # apps/graphics/nxwidgets/UnitTests/CSliderVertical/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CSliderVertical/cslidervertical_main.cxx b/graphics/nxwidgets/UnitTests/CSliderVertical/cslidervertical_main.cxx index 621c3073956..40872745c2e 100644 --- a/graphics/nxwidgets/UnitTests/CSliderVertical/cslidervertical_main.cxx +++ b/graphics/nxwidgets/UnitTests/CSliderVertical/cslidervertical_main.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CSliderVertical/cslidervertical_main.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CSliderVertical/csliderverticaltest.cxx b/graphics/nxwidgets/UnitTests/CSliderVertical/csliderverticaltest.cxx index adacb99628f..efad3275e94 100644 --- a/graphics/nxwidgets/UnitTests/CSliderVertical/csliderverticaltest.cxx +++ b/graphics/nxwidgets/UnitTests/CSliderVertical/csliderverticaltest.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CSliderVertical/csliderverticaltest.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CSliderVertical/csliderverticaltest.hxx b/graphics/nxwidgets/UnitTests/CSliderVertical/csliderverticaltest.hxx index cc2bc5d8f90..7bad5e81db0 100644 --- a/graphics/nxwidgets/UnitTests/CSliderVertical/csliderverticaltest.hxx +++ b/graphics/nxwidgets/UnitTests/CSliderVertical/csliderverticaltest.hxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CSliderVertical/csliderverticaltest.hxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CTextBox/Make.defs b/graphics/nxwidgets/UnitTests/CTextBox/Make.defs index 9f262f68ee0..e98f713ffbd 100644 --- a/graphics/nxwidgets/UnitTests/CTextBox/Make.defs +++ b/graphics/nxwidgets/UnitTests/CTextBox/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/graphics/nxwidgets/UnitTests/CTextBox/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CTextBox/Makefile b/graphics/nxwidgets/UnitTests/CTextBox/Makefile index acdc88def37..9144e1bd4e9 100644 --- a/graphics/nxwidgets/UnitTests/CTextBox/Makefile +++ b/graphics/nxwidgets/UnitTests/CTextBox/Makefile @@ -1,6 +1,8 @@ ################################################################################# # apps/graphics/nxwidgets/UnitTests/CTextBox/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CTextBox/ctextbox_main.cxx b/graphics/nxwidgets/UnitTests/CTextBox/ctextbox_main.cxx index 33a8d48e139..92de3dd85ee 100644 --- a/graphics/nxwidgets/UnitTests/CTextBox/ctextbox_main.cxx +++ b/graphics/nxwidgets/UnitTests/CTextBox/ctextbox_main.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CTextBox/ctextbox_main.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CTextBox/ctextboxtest.cxx b/graphics/nxwidgets/UnitTests/CTextBox/ctextboxtest.cxx index d18955f028e..4d0fad790bd 100644 --- a/graphics/nxwidgets/UnitTests/CTextBox/ctextboxtest.cxx +++ b/graphics/nxwidgets/UnitTests/CTextBox/ctextboxtest.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CTextBox/ctextboxtest.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/CTextBox/ctextboxtest.hxx b/graphics/nxwidgets/UnitTests/CTextBox/ctextboxtest.hxx index 4dd0cbac1ea..42782442212 100644 --- a/graphics/nxwidgets/UnitTests/CTextBox/ctextboxtest.hxx +++ b/graphics/nxwidgets/UnitTests/CTextBox/ctextboxtest.hxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwidgets/UnitTests/CTextBox/ctextboxtest.hxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/Make.defs b/graphics/nxwidgets/UnitTests/Make.defs index bbb563433e7..9eaef136944 100644 --- a/graphics/nxwidgets/UnitTests/Make.defs +++ b/graphics/nxwidgets/UnitTests/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/graphics/nxwidgets/UnitTests/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/UnitTests/Makefile b/graphics/nxwidgets/UnitTests/Makefile index 85e6e2e82f3..1a2d49f262a 100644 --- a/graphics/nxwidgets/UnitTests/Makefile +++ b/graphics/nxwidgets/UnitTests/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/graphics/nxwidgets/UnitTests/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/cbgwindow.cxx b/graphics/nxwidgets/src/cbgwindow.cxx index 90da9cf6e9b..a18dfa2b2b4 100644 --- a/graphics/nxwidgets/src/cbgwindow.cxx +++ b/graphics/nxwidgets/src/cbgwindow.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/src/cbgwindow.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/cbitmap.cxx b/graphics/nxwidgets/src/cbitmap.cxx index f8178f71173..542e505b9b2 100644 --- a/graphics/nxwidgets/src/cbitmap.cxx +++ b/graphics/nxwidgets/src/cbitmap.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/src/cbitmap.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/cbutton.cxx b/graphics/nxwidgets/src/cbutton.cxx index 192cc5fed1d..4c3f1e8427d 100644 --- a/graphics/nxwidgets/src/cbutton.cxx +++ b/graphics/nxwidgets/src/cbutton.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/src/cbutton.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/cbuttonarray.cxx b/graphics/nxwidgets/src/cbuttonarray.cxx index c5072efc0e4..3de7bf1650c 100644 --- a/graphics/nxwidgets/src/cbuttonarray.cxx +++ b/graphics/nxwidgets/src/cbuttonarray.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/include/cbuttonarray.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/ccallback.cxx b/graphics/nxwidgets/src/ccallback.cxx index a04d8868735..510f55161df 100644 --- a/graphics/nxwidgets/src/ccallback.cxx +++ b/graphics/nxwidgets/src/ccallback.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/src/ccallback.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/ccheckbox.cxx b/graphics/nxwidgets/src/ccheckbox.cxx index 3e4bb298d81..ada8430da08 100644 --- a/graphics/nxwidgets/src/ccheckbox.cxx +++ b/graphics/nxwidgets/src/ccheckbox.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/src/ccheckbox.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/ccyclebutton.cxx b/graphics/nxwidgets/src/ccyclebutton.cxx index ac47ce23446..15f139c5568 100644 --- a/graphics/nxwidgets/src/ccyclebutton.cxx +++ b/graphics/nxwidgets/src/ccyclebutton.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/src/ccyclebutton.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/cglyphbutton.cxx b/graphics/nxwidgets/src/cglyphbutton.cxx index 9cda22933b8..4d1107a4e58 100644 --- a/graphics/nxwidgets/src/cglyphbutton.cxx +++ b/graphics/nxwidgets/src/cglyphbutton.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/src/cglyphbutton.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/cglyphsliderhorizontal.cxx b/graphics/nxwidgets/src/cglyphsliderhorizontal.cxx index ff60f01e6f5..d6d2567e3b5 100644 --- a/graphics/nxwidgets/src/cglyphsliderhorizontal.cxx +++ b/graphics/nxwidgets/src/cglyphsliderhorizontal.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/src/cglyphsliderhorizontal.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/cglyphsliderhorizontalgrip.cxx b/graphics/nxwidgets/src/cglyphsliderhorizontalgrip.cxx index 2be7e6d71bb..11540c6545b 100644 --- a/graphics/nxwidgets/src/cglyphsliderhorizontalgrip.cxx +++ b/graphics/nxwidgets/src/cglyphsliderhorizontalgrip.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/src/cglyphsliderhorizontalgrip.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/cgraphicsport.cxx b/graphics/nxwidgets/src/cgraphicsport.cxx index 0b72d0f61e2..2e299162db7 100644 --- a/graphics/nxwidgets/src/cgraphicsport.cxx +++ b/graphics/nxwidgets/src/cgraphicsport.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/src/cgraphicsport.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/cimage.cxx b/graphics/nxwidgets/src/cimage.cxx index 4b02a8bd940..a500c3b4ec7 100644 --- a/graphics/nxwidgets/src/cimage.cxx +++ b/graphics/nxwidgets/src/cimage.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/include/cimage.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/ckeypad.cxx b/graphics/nxwidgets/src/ckeypad.cxx index 5b9a3ab8eb0..460c9540bed 100644 --- a/graphics/nxwidgets/src/ckeypad.cxx +++ b/graphics/nxwidgets/src/ckeypad.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/src/ckeypad.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/clabel.cxx b/graphics/nxwidgets/src/clabel.cxx index f07a69b7b8f..88fbba917ce 100644 --- a/graphics/nxwidgets/src/clabel.cxx +++ b/graphics/nxwidgets/src/clabel.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/src/clabel.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/clabelgrid.cxx b/graphics/nxwidgets/src/clabelgrid.cxx index efd19e71e5d..6302f4c6ac3 100644 --- a/graphics/nxwidgets/src/clabelgrid.cxx +++ b/graphics/nxwidgets/src/clabelgrid.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/NxWkidgets/nwidgets/src/clabelgrid.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/clatchbutton.cxx b/graphics/nxwidgets/src/clatchbutton.cxx index d9fa235dfc8..37dc6b0351f 100644 --- a/graphics/nxwidgets/src/clatchbutton.cxx +++ b/graphics/nxwidgets/src/clatchbutton.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/src/clatchbutton.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/clatchbuttonarray.cxx b/graphics/nxwidgets/src/clatchbuttonarray.cxx index 02ae3c84d4b..7de83e2a89c 100644 --- a/graphics/nxwidgets/src/clatchbuttonarray.cxx +++ b/graphics/nxwidgets/src/clatchbuttonarray.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/src/clatchbuttonarray.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/clistbox.cxx b/graphics/nxwidgets/src/clistbox.cxx index 058f9507509..8647d4aa9c3 100644 --- a/graphics/nxwidgets/src/clistbox.cxx +++ b/graphics/nxwidgets/src/clistbox.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/src/clistbox.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/clistboxdataitem.cxx b/graphics/nxwidgets/src/clistboxdataitem.cxx index 6f65e0d0e08..571ad507ea6 100644 --- a/graphics/nxwidgets/src/clistboxdataitem.cxx +++ b/graphics/nxwidgets/src/clistboxdataitem.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/src/clistboxdataitem.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/clistdata.cxx b/graphics/nxwidgets/src/clistdata.cxx index c6aa24ce6f4..272b20eb2f1 100644 --- a/graphics/nxwidgets/src/clistdata.cxx +++ b/graphics/nxwidgets/src/clistdata.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/src/clistdata.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/clistdataitem.cxx b/graphics/nxwidgets/src/clistdataitem.cxx index 9cca7c6f7da..bfe19682dbe 100644 --- a/graphics/nxwidgets/src/clistdataitem.cxx +++ b/graphics/nxwidgets/src/clistdataitem.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/src/clistdataitem.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/cmultilinetextbox.cxx b/graphics/nxwidgets/src/cmultilinetextbox.cxx index 6668db64542..3253db274f8 100644 --- a/graphics/nxwidgets/src/cmultilinetextbox.cxx +++ b/graphics/nxwidgets/src/cmultilinetextbox.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/src/cmultilinetextbox.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/cnumericedit.cxx b/graphics/nxwidgets/src/cnumericedit.cxx index 8d4169db6bc..770f727c764 100644 --- a/graphics/nxwidgets/src/cnumericedit.cxx +++ b/graphics/nxwidgets/src/cnumericedit.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/include/cnumericedit.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/cnxfont.cxx b/graphics/nxwidgets/src/cnxfont.cxx index d7a12267626..639de608fab 100644 --- a/graphics/nxwidgets/src/cnxfont.cxx +++ b/graphics/nxwidgets/src/cnxfont.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/src/cnxfont.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/cnxserver.cxx b/graphics/nxwidgets/src/cnxserver.cxx index 7296fe620cf..67ad933325b 100644 --- a/graphics/nxwidgets/src/cnxserver.cxx +++ b/graphics/nxwidgets/src/cnxserver.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/src/cnxserver.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/cnxstring.cxx b/graphics/nxwidgets/src/cnxstring.cxx index c9da1f896de..6cd7ac13e31 100644 --- a/graphics/nxwidgets/src/cnxstring.cxx +++ b/graphics/nxwidgets/src/cnxstring.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/src/cnxstring.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/cnxtimer.cxx b/graphics/nxwidgets/src/cnxtimer.cxx index d826e3ebe54..81ba0da64ee 100644 --- a/graphics/nxwidgets/src/cnxtimer.cxx +++ b/graphics/nxwidgets/src/cnxtimer.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/src/cnxtimer.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/cnxtkwindow.cxx b/graphics/nxwidgets/src/cnxtkwindow.cxx index 6b819f3f0a9..5f56f07af78 100644 --- a/graphics/nxwidgets/src/cnxtkwindow.cxx +++ b/graphics/nxwidgets/src/cnxtkwindow.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/src/cnxtkwindow.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/cnxtoolbar.cxx b/graphics/nxwidgets/src/cnxtoolbar.cxx index dc876032f17..8ae26490d5b 100644 --- a/graphics/nxwidgets/src/cnxtoolbar.cxx +++ b/graphics/nxwidgets/src/cnxtoolbar.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/src/cnxtoolbar.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/cnxwidget.cxx b/graphics/nxwidgets/src/cnxwidget.cxx index 58272a3af4e..e6b93863cf4 100644 --- a/graphics/nxwidgets/src/cnxwidget.cxx +++ b/graphics/nxwidgets/src/cnxwidget.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/src/cnxwidget.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/cnxwindow.cxx b/graphics/nxwidgets/src/cnxwindow.cxx index ee7d40e91fe..cceef579432 100644 --- a/graphics/nxwidgets/src/cnxwindow.cxx +++ b/graphics/nxwidgets/src/cnxwindow.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/src/cnxwindow.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/cprogressbar.cxx b/graphics/nxwidgets/src/cprogressbar.cxx index 74079366393..88543daee5d 100644 --- a/graphics/nxwidgets/src/cprogressbar.cxx +++ b/graphics/nxwidgets/src/cprogressbar.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/src/cprogressbar.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/cradiobutton.cxx b/graphics/nxwidgets/src/cradiobutton.cxx index c41cc6e2fca..8fde8c58fcb 100644 --- a/graphics/nxwidgets/src/cradiobutton.cxx +++ b/graphics/nxwidgets/src/cradiobutton.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/src/cradiobutton.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/cradiobuttongroup.cxx b/graphics/nxwidgets/src/cradiobuttongroup.cxx index 35c9ebb3b9a..72b024bd359 100644 --- a/graphics/nxwidgets/src/cradiobuttongroup.cxx +++ b/graphics/nxwidgets/src/cradiobuttongroup.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/src/cradiobutton.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/crect.cxx b/graphics/nxwidgets/src/crect.cxx index afd64311ff0..2883dda3009 100644 --- a/graphics/nxwidgets/src/crect.cxx +++ b/graphics/nxwidgets/src/crect.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/src/cbgwindow.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/crlepalettebitmap.cxx b/graphics/nxwidgets/src/crlepalettebitmap.cxx index 4e4aee3cd46..752faf01185 100644 --- a/graphics/nxwidgets/src/crlepalettebitmap.cxx +++ b/graphics/nxwidgets/src/crlepalettebitmap.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/src/crlepalettebitmap.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/cscaledbitmap.cxx b/graphics/nxwidgets/src/cscaledbitmap.cxx index 35157584363..ec46ca5c4b2 100644 --- a/graphics/nxwidgets/src/cscaledbitmap.cxx +++ b/graphics/nxwidgets/src/cscaledbitmap.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/src/cscaledbitmap.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/cscrollbarhorizontal.cxx b/graphics/nxwidgets/src/cscrollbarhorizontal.cxx index 05cf642a9bf..0a546af4680 100644 --- a/graphics/nxwidgets/src/cscrollbarhorizontal.cxx +++ b/graphics/nxwidgets/src/cscrollbarhorizontal.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/include/cscrollbarhorizontal.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/cscrollbarpanel.cxx b/graphics/nxwidgets/src/cscrollbarpanel.cxx index 7ad8a14d1a7..b90d55cbf7f 100644 --- a/graphics/nxwidgets/src/cscrollbarpanel.cxx +++ b/graphics/nxwidgets/src/cscrollbarpanel.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/src/cscrollbarpanel.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/cscrollbarvertical.cxx b/graphics/nxwidgets/src/cscrollbarvertical.cxx index 0ff40ad0b29..5b6670ba734 100644 --- a/graphics/nxwidgets/src/cscrollbarvertical.cxx +++ b/graphics/nxwidgets/src/cscrollbarvertical.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/include/cscrollbarhorizontal.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/cscrollinglistbox.cxx b/graphics/nxwidgets/src/cscrollinglistbox.cxx index 710dbb2868d..2667b8fc9e2 100644 --- a/graphics/nxwidgets/src/cscrollinglistbox.cxx +++ b/graphics/nxwidgets/src/cscrollinglistbox.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/src/cscrollinglistbox.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/cscrollingpanel.cxx b/graphics/nxwidgets/src/cscrollingpanel.cxx index e470e0233a8..d369d42fc83 100644 --- a/graphics/nxwidgets/src/cscrollingpanel.cxx +++ b/graphics/nxwidgets/src/cscrollingpanel.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/src/cscrollingpanel.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/cscrollingtextbox.cxx b/graphics/nxwidgets/src/cscrollingtextbox.cxx index 658831b16a7..3ea6a51d43d 100644 --- a/graphics/nxwidgets/src/cscrollingtextbox.cxx +++ b/graphics/nxwidgets/src/cscrollingtextbox.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/src/cscrollingtextbox.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/csliderhorizontal.cxx b/graphics/nxwidgets/src/csliderhorizontal.cxx index 377887088c8..f2072493a2f 100644 --- a/graphics/nxwidgets/src/csliderhorizontal.cxx +++ b/graphics/nxwidgets/src/csliderhorizontal.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/src/csliderhorizontal.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/csliderhorizontalgrip.cxx b/graphics/nxwidgets/src/csliderhorizontalgrip.cxx index 4bfa8f4bc8c..28fd1276aa3 100644 --- a/graphics/nxwidgets/src/csliderhorizontalgrip.cxx +++ b/graphics/nxwidgets/src/csliderhorizontalgrip.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/src/csliderhorizontalgrip.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/cslidervertical.cxx b/graphics/nxwidgets/src/cslidervertical.cxx index c3666fc53a9..4dee4274bd7 100644 --- a/graphics/nxwidgets/src/cslidervertical.cxx +++ b/graphics/nxwidgets/src/cslidervertical.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/src/cslidervertical.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/csliderverticalgrip.cxx b/graphics/nxwidgets/src/csliderverticalgrip.cxx index 11967d76b6d..6fda9d8fdbe 100644 --- a/graphics/nxwidgets/src/csliderverticalgrip.cxx +++ b/graphics/nxwidgets/src/csliderverticalgrip.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/src/cslidervertical.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/cstickybutton.cxx b/graphics/nxwidgets/src/cstickybutton.cxx index 5a96690b0cf..2509c1db8f1 100644 --- a/graphics/nxwidgets/src/cstickybutton.cxx +++ b/graphics/nxwidgets/src/cstickybutton.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/src/cstickybutton.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/cstickybuttonarray.cxx b/graphics/nxwidgets/src/cstickybuttonarray.cxx index 1799153fda1..b52c2bf94ba 100644 --- a/graphics/nxwidgets/src/cstickybuttonarray.cxx +++ b/graphics/nxwidgets/src/cstickybuttonarray.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/include/cstickybuttonarray.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/cstickyimage.cxx b/graphics/nxwidgets/src/cstickyimage.cxx index b1edb59d76a..346694c8c9e 100644 --- a/graphics/nxwidgets/src/cstickyimage.cxx +++ b/graphics/nxwidgets/src/cstickyimage.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/src/cstickyimage.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/cstringiterator.cxx b/graphics/nxwidgets/src/cstringiterator.cxx index 98831419ba8..301b3966deb 100644 --- a/graphics/nxwidgets/src/cstringiterator.cxx +++ b/graphics/nxwidgets/src/cstringiterator.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/src/cgraphicsport.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/ctabpanel.cxx b/graphics/nxwidgets/src/ctabpanel.cxx index 5c698425eb9..ea0b943a064 100644 --- a/graphics/nxwidgets/src/ctabpanel.cxx +++ b/graphics/nxwidgets/src/ctabpanel.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/src/ctabpanel.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/ctext.cxx b/graphics/nxwidgets/src/ctext.cxx index e68e9da21fe..0da00793d0f 100644 --- a/graphics/nxwidgets/src/ctext.cxx +++ b/graphics/nxwidgets/src/ctext.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/src/ctext.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/ctextbox.cxx b/graphics/nxwidgets/src/ctextbox.cxx index a8ede069a75..9e04650cc34 100644 --- a/graphics/nxwidgets/src/ctextbox.cxx +++ b/graphics/nxwidgets/src/ctextbox.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/src/ctextbox.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/cwidgetcontrol.cxx b/graphics/nxwidgets/src/cwidgetcontrol.cxx index 13f8a94df7a..921b0541261 100644 --- a/graphics/nxwidgets/src/cwidgetcontrol.cxx +++ b/graphics/nxwidgets/src/cwidgetcontrol.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/src/cwidgetcontrol.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/cwidgeteventhandlerlist.cxx b/graphics/nxwidgets/src/cwidgeteventhandlerlist.cxx index 293872c553e..c96d7d28faf 100644 --- a/graphics/nxwidgets/src/cwidgeteventhandlerlist.cxx +++ b/graphics/nxwidgets/src/cwidgeteventhandlerlist.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/src/cwidgeteventhandlerlist.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/cwindoweventhandlerlist.cxx b/graphics/nxwidgets/src/cwindoweventhandlerlist.cxx index 1286c6b40db..253f08f3a6c 100644 --- a/graphics/nxwidgets/src/cwindoweventhandlerlist.cxx +++ b/graphics/nxwidgets/src/cwindoweventhandlerlist.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/src/cwindoweventhandlerlist.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwidgets/src/singletons.cxx b/graphics/nxwidgets/src/singletons.cxx index fc4f3689f34..e6c4da73edc 100644 --- a/graphics/nxwidgets/src/singletons.cxx +++ b/graphics/nxwidgets/src/singletons.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwidgets/src/singletons.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwm/Doxygen/gendoc.sh b/graphics/nxwm/Doxygen/gendoc.sh index e3dcdb7e8e3..5fe931e9143 100644 --- a/graphics/nxwm/Doxygen/gendoc.sh +++ b/graphics/nxwm/Doxygen/gendoc.sh @@ -2,6 +2,8 @@ ################################################################################# # apps/graphics/nxwm/Doxygen/gendoc.sh # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwm/Make.defs b/graphics/nxwm/Make.defs index 68e492a23c7..6161418d094 100644 --- a/graphics/nxwm/Make.defs +++ b/graphics/nxwm/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/graphics/nxwm/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwm/Makefile b/graphics/nxwm/Makefile index b643ee02ab0..4b1028c2e2c 100644 --- a/graphics/nxwm/Makefile +++ b/graphics/nxwm/Makefile @@ -1,6 +1,8 @@ ################################################################################# # apps/graphics/nxwm/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwm/src/capplicationwindow.cxx b/graphics/nxwm/src/capplicationwindow.cxx index d3b5ba1314b..659db97ad05 100644 --- a/graphics/nxwm/src/capplicationwindow.cxx +++ b/graphics/nxwm/src/capplicationwindow.cxx @@ -1,6 +1,8 @@ /******************************************************************************************** * apps/graphics/nxwm/src/capplicationwindow.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwm/src/ccalibration.cxx b/graphics/nxwm/src/ccalibration.cxx index 1c8f5cd8d69..21adb218348 100644 --- a/graphics/nxwm/src/ccalibration.cxx +++ b/graphics/nxwm/src/ccalibration.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nxwm/src/ccalibration.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwm/src/cfullscreenwindow.cxx b/graphics/nxwm/src/cfullscreenwindow.cxx index 4873d633f2d..ccaf6300d27 100644 --- a/graphics/nxwm/src/cfullscreenwindow.cxx +++ b/graphics/nxwm/src/cfullscreenwindow.cxx @@ -1,6 +1,8 @@ /******************************************************************************************** * apps/graphics/nxwm/src/cfullscreenwindow.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwm/src/chexcalculator.cxx b/graphics/nxwm/src/chexcalculator.cxx index ed410599127..e5ab0d9e8bb 100644 --- a/graphics/nxwm/src/chexcalculator.cxx +++ b/graphics/nxwm/src/chexcalculator.cxx @@ -1,6 +1,8 @@ /******************************************************************************************** * apps/graphics/nxwm/src/chexcalculator.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwm/src/ckeyboard.cxx b/graphics/nxwm/src/ckeyboard.cxx index 826ed9b1ed3..20dcc44cc4e 100644 --- a/graphics/nxwm/src/ckeyboard.cxx +++ b/graphics/nxwm/src/ckeyboard.cxx @@ -1,6 +1,8 @@ /******************************************************************************************** * apps/graphics/nxwm/src/ckeyboard.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwm/src/cmediaplayer.cxx b/graphics/nxwm/src/cmediaplayer.cxx index 72c1895cc58..bcfb95718f2 100644 --- a/graphics/nxwm/src/cmediaplayer.cxx +++ b/graphics/nxwm/src/cmediaplayer.cxx @@ -1,6 +1,8 @@ /******************************************************************************************** * apps/graphics/nxwm/src/cmediaplayer.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwm/src/cnxterm.cxx b/graphics/nxwm/src/cnxterm.cxx index 2df27c36e36..0c4d2045597 100644 --- a/graphics/nxwm/src/cnxterm.cxx +++ b/graphics/nxwm/src/cnxterm.cxx @@ -1,6 +1,8 @@ /******************************************************************************************** * apps/graphics/nxwm/src/cnxterm.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwm/src/cstartwindow.cxx b/graphics/nxwm/src/cstartwindow.cxx index b19a7ae58b0..8ee409e27e1 100644 --- a/graphics/nxwm/src/cstartwindow.cxx +++ b/graphics/nxwm/src/cstartwindow.cxx @@ -1,6 +1,8 @@ /******************************************************************************************** * apps/graphics/nxwm/src/cstartwindow.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwm/src/ctaskbar.cxx b/graphics/nxwm/src/ctaskbar.cxx index f30c8758df7..d66d36850a1 100644 --- a/graphics/nxwm/src/ctaskbar.cxx +++ b/graphics/nxwm/src/ctaskbar.cxx @@ -1,6 +1,8 @@ /******************************************************************************************** * apps/graphics/nxwm/src/ctaskbar.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwm/src/ctouchscreen.cxx b/graphics/nxwm/src/ctouchscreen.cxx index fbb7517004c..bbebc0f7a05 100644 --- a/graphics/nxwm/src/ctouchscreen.cxx +++ b/graphics/nxwm/src/ctouchscreen.cxx @@ -1,6 +1,8 @@ /******************************************************************************************** * apps/graphics/nxwm/src/ctouchscreen.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwm/src/cwindowmessenger.cxx b/graphics/nxwm/src/cwindowmessenger.cxx index 9a33086b388..8761e4799b5 100644 --- a/graphics/nxwm/src/cwindowmessenger.cxx +++ b/graphics/nxwm/src/cwindowmessenger.cxx @@ -1,6 +1,8 @@ /******************************************************************************************** * apps/graphics/nxwm/src/cwindowmessenger.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/nxwm/src/nxwm_main.cxx b/graphics/nxwm/src/nxwm_main.cxx index f1255729bca..98feabbf6eb 100644 --- a/graphics/nxwm/src/nxwm_main.cxx +++ b/graphics/nxwm/src/nxwm_main.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/nxwm/src/nxwm_main.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/Make.defs b/graphics/pdcurs34/Make.defs index 43fa97847f8..6db199357e4 100644 --- a/graphics/pdcurs34/Make.defs +++ b/graphics/pdcurs34/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/graphics/pdcurs34/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/Makefile b/graphics/pdcurs34/Makefile index a97e0049979..e07f2fc1ec2 100644 --- a/graphics/pdcurs34/Makefile +++ b/graphics/pdcurs34/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/graphics/pdcurs34/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/include/curspriv.h b/graphics/pdcurs34/include/curspriv.h index 2b6a49bd65c..68e702bf491 100644 --- a/graphics/pdcurs34/include/curspriv.h +++ b/graphics/pdcurs34/include/curspriv.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/pdcurses/curspriv.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/include/term.h b/graphics/pdcurs34/include/term.h index 2298f1def68..06230d368a1 100644 --- a/graphics/pdcurs34/include/term.h +++ b/graphics/pdcurs34/include/term.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/pdcurses/term.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/nuttx/Make.defs b/graphics/pdcurs34/nuttx/Make.defs index e079be2d3a8..5ed3728beb8 100644 --- a/graphics/pdcurs34/nuttx/Make.defs +++ b/graphics/pdcurs34/nuttx/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/graphics/pdcurs34/nuttx/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/nuttx/pdcclip.c b/graphics/pdcurs34/nuttx/pdcclip.c index 476db525dfa..a938d7c6397 100644 --- a/graphics/pdcurs34/nuttx/pdcclip.c +++ b/graphics/pdcurs34/nuttx/pdcclip.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nuttx/pdclip.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/nuttx/pdcdisp.c b/graphics/pdcurs34/nuttx/pdcdisp.c index 8a91c11c936..428d24b70e3 100644 --- a/graphics/pdcurs34/nuttx/pdcdisp.c +++ b/graphics/pdcurs34/nuttx/pdcdisp.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/pdcurs34/nuttx/pdcdisp.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/nuttx/pdcgetsc.c b/graphics/pdcurs34/nuttx/pdcgetsc.c index ce7ad1d8889..8bbda588548 100644 --- a/graphics/pdcurs34/nuttx/pdcgetsc.c +++ b/graphics/pdcurs34/nuttx/pdcgetsc.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nuttx/pdcgetsc.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/nuttx/pdckbd.c b/graphics/pdcurs34/nuttx/pdckbd.c index f11280fe0fe..eeac7245f94 100644 --- a/graphics/pdcurs34/nuttx/pdckbd.c +++ b/graphics/pdcurs34/nuttx/pdckbd.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nuttx/pdckbd.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/nuttx/pdcnuttx.h b/graphics/pdcurs34/nuttx/pdcnuttx.h index 00760278e96..40c08584898 100644 --- a/graphics/pdcurs34/nuttx/pdcnuttx.h +++ b/graphics/pdcurs34/nuttx/pdcnuttx.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nuttx/pdcnuttx.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/nuttx/pdcscrn.c b/graphics/pdcurs34/nuttx/pdcscrn.c index 0082dca7cfd..7620412438e 100644 --- a/graphics/pdcurs34/nuttx/pdcscrn.c +++ b/graphics/pdcurs34/nuttx/pdcscrn.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/pdcurs34/nuttx/pdcscrn.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/nuttx/pdcsetsc.c b/graphics/pdcurs34/nuttx/pdcsetsc.c index 3e5cd99cb01..af413f32cda 100644 --- a/graphics/pdcurs34/nuttx/pdcsetsc.c +++ b/graphics/pdcurs34/nuttx/pdcsetsc.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nuttx/pdcsetsc.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/nuttx/pdcthread.c b/graphics/pdcurs34/nuttx/pdcthread.c index e1295f04a91..ca19d7f76c7 100644 --- a/graphics/pdcurs34/nuttx/pdcthread.c +++ b/graphics/pdcurs34/nuttx/pdcthread.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/pdcurs34/nuttx/pdcthread.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/nuttx/pdcutil.c b/graphics/pdcurs34/nuttx/pdcutil.c index 21957eb62d0..c22b88ad940 100644 --- a/graphics/pdcurs34/nuttx/pdcutil.c +++ b/graphics/pdcurs34/nuttx/pdcutil.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/nuttx/pdcutil.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/pdcurses/Make.defs b/graphics/pdcurs34/pdcurses/Make.defs index 5d6a8ccf51c..0632a550f0e 100644 --- a/graphics/pdcurs34/pdcurses/Make.defs +++ b/graphics/pdcurs34/pdcurses/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/graphics/pdcurs34/pdcurses/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/pdcurses/pdc_addch.c b/graphics/pdcurs34/pdcurses/pdc_addch.c index dc0e332ce5a..b070b15edf4 100644 --- a/graphics/pdcurs34/pdcurses/pdc_addch.c +++ b/graphics/pdcurs34/pdcurses/pdc_addch.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/pdcurses/pdc_addch.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/pdcurses/pdc_addchstr.c b/graphics/pdcurs34/pdcurses/pdc_addchstr.c index 90cb5917443..9287d7cc5f1 100644 --- a/graphics/pdcurs34/pdcurses/pdc_addchstr.c +++ b/graphics/pdcurs34/pdcurses/pdc_addchstr.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/pdcurses/pdc_addchstr.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/pdcurses/pdc_addstr.c b/graphics/pdcurs34/pdcurses/pdc_addstr.c index 2073427c7dd..458e8a3c98b 100644 --- a/graphics/pdcurs34/pdcurses/pdc_addstr.c +++ b/graphics/pdcurs34/pdcurses/pdc_addstr.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/pdcurses/pdc_addstr.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/pdcurses/pdc_attr.c b/graphics/pdcurs34/pdcurses/pdc_attr.c index efbd7aaab58..87256b00cd6 100644 --- a/graphics/pdcurs34/pdcurses/pdc_attr.c +++ b/graphics/pdcurs34/pdcurses/pdc_attr.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/pdcurses/pdc_attr.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/pdcurses/pdc_beep.c b/graphics/pdcurs34/pdcurses/pdc_beep.c index 787db6840de..a318d0d824f 100644 --- a/graphics/pdcurs34/pdcurses/pdc_beep.c +++ b/graphics/pdcurs34/pdcurses/pdc_beep.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/pdcurses/pdc_beep.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/pdcurses/pdc_bkgd.c b/graphics/pdcurs34/pdcurses/pdc_bkgd.c index 89cfc25b55d..48bc8b415d4 100644 --- a/graphics/pdcurs34/pdcurses/pdc_bkgd.c +++ b/graphics/pdcurs34/pdcurses/pdc_bkgd.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/pdcurses/pdc_bkgd.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/pdcurses/pdc_border.c b/graphics/pdcurs34/pdcurses/pdc_border.c index cd7c2520c15..5bb5462ff34 100644 --- a/graphics/pdcurs34/pdcurses/pdc_border.c +++ b/graphics/pdcurs34/pdcurses/pdc_border.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/pdcurs34/pdcurses/pdc_border.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/pdcurses/pdc_clear.c b/graphics/pdcurs34/pdcurses/pdc_clear.c index 2ac20b6b065..ff8ff04c09f 100644 --- a/graphics/pdcurs34/pdcurses/pdc_clear.c +++ b/graphics/pdcurs34/pdcurses/pdc_clear.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/pdcurses/pdc_clear.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/pdcurses/pdc_color.c b/graphics/pdcurs34/pdcurses/pdc_color.c index fc9ddf59c61..bebb19f7f94 100644 --- a/graphics/pdcurs34/pdcurses/pdc_color.c +++ b/graphics/pdcurs34/pdcurses/pdc_color.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/pdcurses/pdc_color.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/pdcurses/pdc_debug.c b/graphics/pdcurs34/pdcurses/pdc_debug.c index 08edd540ffe..e7431c25e27 100644 --- a/graphics/pdcurs34/pdcurses/pdc_debug.c +++ b/graphics/pdcurs34/pdcurses/pdc_debug.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/pdcurses/pdc_debug.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/pdcurses/pdc_delch.c b/graphics/pdcurs34/pdcurses/pdc_delch.c index 63aa82b76d8..d9969d3138d 100644 --- a/graphics/pdcurs34/pdcurses/pdc_delch.c +++ b/graphics/pdcurs34/pdcurses/pdc_delch.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/pdcurses/pdc_delch.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/pdcurses/pdc_deleteln.c b/graphics/pdcurs34/pdcurses/pdc_deleteln.c index 962a01c5967..7af909f24fa 100644 --- a/graphics/pdcurs34/pdcurses/pdc_deleteln.c +++ b/graphics/pdcurs34/pdcurses/pdc_deleteln.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/pdcurses/pdc_deleteln.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/pdcurses/pdc_getch.c b/graphics/pdcurs34/pdcurses/pdc_getch.c index bfdb6aaad45..f787e14f6d0 100644 --- a/graphics/pdcurs34/pdcurses/pdc_getch.c +++ b/graphics/pdcurs34/pdcurses/pdc_getch.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/pdcurses/pdc_getch.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/pdcurses/pdc_getstr.c b/graphics/pdcurs34/pdcurses/pdc_getstr.c index 8cd24178e86..17bed774b70 100644 --- a/graphics/pdcurs34/pdcurses/pdc_getstr.c +++ b/graphics/pdcurs34/pdcurses/pdc_getstr.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/pdcurses/pdc_getstr.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/pdcurses/pdc_getyx.c b/graphics/pdcurs34/pdcurses/pdc_getyx.c index d6c5358aded..b205984f404 100644 --- a/graphics/pdcurs34/pdcurses/pdc_getyx.c +++ b/graphics/pdcurs34/pdcurses/pdc_getyx.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/pdcurses/pdc_getyx.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/pdcurses/pdc_inch.c b/graphics/pdcurs34/pdcurses/pdc_inch.c index cda749729e6..29e00ae9183 100644 --- a/graphics/pdcurs34/pdcurses/pdc_inch.c +++ b/graphics/pdcurs34/pdcurses/pdc_inch.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/pdcurses/pdc_inch.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/pdcurses/pdc_inchstr.c b/graphics/pdcurs34/pdcurses/pdc_inchstr.c index 9bc595a3646..8c7620394bf 100644 --- a/graphics/pdcurs34/pdcurses/pdc_inchstr.c +++ b/graphics/pdcurs34/pdcurses/pdc_inchstr.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/pdcurses/pdc_inchstr.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/pdcurses/pdc_initscr.c b/graphics/pdcurs34/pdcurses/pdc_initscr.c index 52a6852503b..f643526ff5d 100644 --- a/graphics/pdcurs34/pdcurses/pdc_initscr.c +++ b/graphics/pdcurs34/pdcurses/pdc_initscr.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/pdcurs34/pdcurses/pdc_initscr.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/pdcurses/pdc_inopts.c b/graphics/pdcurs34/pdcurses/pdc_inopts.c index d4fd5a5ad6c..089100c804a 100644 --- a/graphics/pdcurs34/pdcurses/pdc_inopts.c +++ b/graphics/pdcurs34/pdcurses/pdc_inopts.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/pdcurses/pdc_inopts.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/pdcurses/pdc_insch.c b/graphics/pdcurs34/pdcurses/pdc_insch.c index deb9f74c283..cc351edde4d 100644 --- a/graphics/pdcurs34/pdcurses/pdc_insch.c +++ b/graphics/pdcurs34/pdcurses/pdc_insch.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/pdcurses/pdc_insch.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/pdcurses/pdc_insstr.c b/graphics/pdcurs34/pdcurses/pdc_insstr.c index c62e507810f..d945226e5ba 100644 --- a/graphics/pdcurs34/pdcurses/pdc_insstr.c +++ b/graphics/pdcurs34/pdcurses/pdc_insstr.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/pdcurses/pdc_insstr.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/pdcurses/pdc_instr.c b/graphics/pdcurs34/pdcurses/pdc_instr.c index ac5b0a18bb7..a32e4801359 100644 --- a/graphics/pdcurs34/pdcurses/pdc_instr.c +++ b/graphics/pdcurs34/pdcurses/pdc_instr.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/pdcurses/pdc_instr.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/pdcurses/pdc_kernel.c b/graphics/pdcurs34/pdcurses/pdc_kernel.c index ec706e865e7..0e3bf42eff0 100644 --- a/graphics/pdcurs34/pdcurses/pdc_kernel.c +++ b/graphics/pdcurs34/pdcurses/pdc_kernel.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/pdcurses/pdc_kernel.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/pdcurses/pdc_keyname.c b/graphics/pdcurs34/pdcurses/pdc_keyname.c index c5a4921735a..8a23ddb46f3 100644 --- a/graphics/pdcurs34/pdcurses/pdc_keyname.c +++ b/graphics/pdcurs34/pdcurses/pdc_keyname.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/pdcurs34/pdcurses/pdc_keyname.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/pdcurses/pdc_mouse.c b/graphics/pdcurs34/pdcurses/pdc_mouse.c index 54bdc66c715..62f47dc2de9 100644 --- a/graphics/pdcurs34/pdcurses/pdc_mouse.c +++ b/graphics/pdcurs34/pdcurses/pdc_mouse.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/pdcurses/pdc_mouse.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/pdcurses/pdc_move.c b/graphics/pdcurs34/pdcurses/pdc_move.c index f1729ed290e..87268fd2abc 100644 --- a/graphics/pdcurs34/pdcurses/pdc_move.c +++ b/graphics/pdcurs34/pdcurses/pdc_move.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/pdcurses/pdc_move.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/pdcurses/pdc_outopts.c b/graphics/pdcurs34/pdcurses/pdc_outopts.c index 81c1eaf9f43..0f980895276 100644 --- a/graphics/pdcurs34/pdcurses/pdc_outopts.c +++ b/graphics/pdcurs34/pdcurses/pdc_outopts.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/pdcurses/pdc_outopts.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/pdcurses/pdc_overlay.c b/graphics/pdcurs34/pdcurses/pdc_overlay.c index d692851df1c..e5fea025c8f 100644 --- a/graphics/pdcurs34/pdcurses/pdc_overlay.c +++ b/graphics/pdcurs34/pdcurses/pdc_overlay.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/pdcurses/pdc_overlay.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/pdcurses/pdc_pad.c b/graphics/pdcurs34/pdcurses/pdc_pad.c index fbc8ba3c272..6d250829fa2 100644 --- a/graphics/pdcurs34/pdcurses/pdc_pad.c +++ b/graphics/pdcurs34/pdcurses/pdc_pad.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/pdcurs34/pdcurses/pdc_pad.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/pdcurses/pdc_panel.c b/graphics/pdcurs34/pdcurses/pdc_panel.c index e8648368d5a..28f191765f9 100644 --- a/graphics/pdcurs34/pdcurses/pdc_panel.c +++ b/graphics/pdcurs34/pdcurses/pdc_panel.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/pdcurs34/pdcurses/pdc_panel.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/pdcurses/pdc_printw.c b/graphics/pdcurs34/pdcurses/pdc_printw.c index 09ccacdf7ef..6864ddbab0f 100644 --- a/graphics/pdcurs34/pdcurses/pdc_printw.c +++ b/graphics/pdcurs34/pdcurses/pdc_printw.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/pdcurses/pdc_printw.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/pdcurses/pdc_refresh.c b/graphics/pdcurs34/pdcurses/pdc_refresh.c index dc69552c7b4..33a82d256a1 100644 --- a/graphics/pdcurs34/pdcurses/pdc_refresh.c +++ b/graphics/pdcurs34/pdcurses/pdc_refresh.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/pdcurses/pdc_refresh.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/pdcurses/pdc_scanw.c b/graphics/pdcurs34/pdcurses/pdc_scanw.c index 5a6e6c6d9b1..0f9e94652c3 100644 --- a/graphics/pdcurs34/pdcurses/pdc_scanw.c +++ b/graphics/pdcurs34/pdcurses/pdc_scanw.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/pdcurses/pdc_scanw.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/pdcurses/pdc_scrdump.c b/graphics/pdcurs34/pdcurses/pdc_scrdump.c index cf7737bc2d5..e06b3c4635c 100644 --- a/graphics/pdcurs34/pdcurses/pdc_scrdump.c +++ b/graphics/pdcurs34/pdcurses/pdc_scrdump.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/pdcurs34/pdcurses/pdc_scrdump.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/pdcurses/pdc_scroll.c b/graphics/pdcurs34/pdcurses/pdc_scroll.c index 835fd7463d9..1b87471e19e 100644 --- a/graphics/pdcurs34/pdcurses/pdc_scroll.c +++ b/graphics/pdcurs34/pdcurses/pdc_scroll.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/pdcurses/pdc_scroll.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/pdcurses/pdc_slk.c b/graphics/pdcurs34/pdcurses/pdc_slk.c index 3d02a005eec..b53d530e179 100644 --- a/graphics/pdcurs34/pdcurses/pdc_slk.c +++ b/graphics/pdcurs34/pdcurses/pdc_slk.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/pdcurs34/pdcurses/pdc_slk.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/pdcurses/pdc_termattr.c b/graphics/pdcurs34/pdcurses/pdc_termattr.c index a95e8b75b46..9c25f7b3b9d 100644 --- a/graphics/pdcurs34/pdcurses/pdc_termattr.c +++ b/graphics/pdcurs34/pdcurses/pdc_termattr.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/pdcurses/pdc_termattr.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/pdcurses/pdc_terminfo.c b/graphics/pdcurs34/pdcurses/pdc_terminfo.c index 099314b4a31..e6511260472 100644 --- a/graphics/pdcurs34/pdcurses/pdc_terminfo.c +++ b/graphics/pdcurs34/pdcurses/pdc_terminfo.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/pdcurs34/pdcurses/pdc_terminfo.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/pdcurses/pdc_touch.c b/graphics/pdcurs34/pdcurses/pdc_touch.c index 5eda71905e7..5562df1a64d 100644 --- a/graphics/pdcurs34/pdcurses/pdc_touch.c +++ b/graphics/pdcurs34/pdcurses/pdc_touch.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/pdcurs34/pdcurses/pdc_touch.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/pdcurses/pdc_util.c b/graphics/pdcurs34/pdcurses/pdc_util.c index 4b4b369f86e..979543efd5f 100644 --- a/graphics/pdcurs34/pdcurses/pdc_util.c +++ b/graphics/pdcurs34/pdcurses/pdc_util.c @@ -1,7 +1,8 @@ - /**************************************************************************** * apps/graphics/pdcurses/util.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/pdcurs34/pdcurses/pdc_window.c b/graphics/pdcurs34/pdcurses/pdc_window.c index 47ce25a459d..0a0ef7e7ed2 100644 --- a/graphics/pdcurs34/pdcurses/pdc_window.c +++ b/graphics/pdcurs34/pdcurses/pdc_window.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/pdcurs34/pdcurses/pdc_window.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/screenshot/Make.defs b/graphics/screenshot/Make.defs index 5901dcc4adf..28f0d1fa108 100644 --- a/graphics/screenshot/Make.defs +++ b/graphics/screenshot/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/graphics/screenshot/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/screenshot/Makefile b/graphics/screenshot/Makefile index 9847dd22f23..0a315fc5681 100644 --- a/graphics/screenshot/Makefile +++ b/graphics/screenshot/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/graphics/screenshot/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/screenshot/screenshot_main.c b/graphics/screenshot/screenshot_main.c index 7ed5809321d..5025c67d80a 100644 --- a/graphics/screenshot/screenshot_main.c +++ b/graphics/screenshot/screenshot_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/screenshot/screenshot_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/slcd/Make.defs b/graphics/slcd/Make.defs index 781348ec4d6..4378ff13270 100644 --- a/graphics/slcd/Make.defs +++ b/graphics/slcd/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/graphics/slcd/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/slcd/Makefile b/graphics/slcd/Makefile index d45edf7e556..bc1c151e359 100644 --- a/graphics/slcd/Makefile +++ b/graphics/slcd/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/graphics/slcd/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/slcd/cslcd.cxx b/graphics/slcd/cslcd.cxx index bba30faf588..8f7320e1ed3 100644 --- a/graphics/slcd/cslcd.cxx +++ b/graphics/slcd/cslcd.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/slcd/cslcd.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/slcd/slcd.hxx b/graphics/slcd/slcd.hxx index 97619f8ab21..a28279440eb 100644 --- a/graphics/slcd/slcd.hxx +++ b/graphics/slcd/slcd.hxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/slcd/slcd.hxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/slcd/slcd_mapping.cxx b/graphics/slcd/slcd_mapping.cxx index b5d7315e418..086145f7e8d 100644 --- a/graphics/slcd/slcd_mapping.cxx +++ b/graphics/slcd/slcd_mapping.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/slcd/slcd_mapping.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/slcd/slcd_trapezoids.cxx b/graphics/slcd/slcd_trapezoids.cxx index 51cfabb7526..5c9689e4a84 100644 --- a/graphics/slcd/slcd_trapezoids.cxx +++ b/graphics/slcd/slcd_trapezoids.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/slcd/slcd_trapezoids.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/tiff/Make.defs b/graphics/tiff/Make.defs index 9ea1e6d00d6..a376e36a9b0 100644 --- a/graphics/tiff/Make.defs +++ b/graphics/tiff/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/graphics/tiff/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/tiff/Makefile b/graphics/tiff/Makefile index 54237674939..10c51fc8889 100644 --- a/graphics/tiff/Makefile +++ b/graphics/tiff/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/graphics/tiff/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/tiff/tiff_addstrip.c b/graphics/tiff/tiff_addstrip.c index e0a4bdfe0a7..ff4a9d59860 100644 --- a/graphics/tiff/tiff_addstrip.c +++ b/graphics/tiff/tiff_addstrip.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/tiff/tiff_addstrip.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/tiff/tiff_finalize.c b/graphics/tiff/tiff_finalize.c index 7c8d5d6dd4f..2ad01a06e03 100644 --- a/graphics/tiff/tiff_finalize.c +++ b/graphics/tiff/tiff_finalize.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/tiff/tiff_finalize.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/tiff/tiff_initialize.c b/graphics/tiff/tiff_initialize.c index 8198333ef0f..b6de8408d97 100644 --- a/graphics/tiff/tiff_initialize.c +++ b/graphics/tiff/tiff_initialize.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/tiff/tiff_initialize.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/tiff/tiff_internal.h b/graphics/tiff/tiff_internal.h index 00bc6515b6f..b7661514503 100644 --- a/graphics/tiff/tiff_internal.h +++ b/graphics/tiff/tiff_internal.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/tiff/tiff_internal.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/tiff/tiff_utils.c b/graphics/tiff/tiff_utils.c index 70de9292579..c16f7b3e300 100644 --- a/graphics/tiff/tiff_utils.c +++ b/graphics/tiff/tiff_utils.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/tiff/tiff_utils.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/twm4nx/Make.defs b/graphics/twm4nx/Make.defs index e724004e79c..6d992ec5fa4 100644 --- a/graphics/twm4nx/Make.defs +++ b/graphics/twm4nx/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/graphics/twm4nx/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/twm4nx/Makefile b/graphics/twm4nx/Makefile index 0ec2f883a0c..6156b2da2a2 100644 --- a/graphics/twm4nx/Makefile +++ b/graphics/twm4nx/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/graphics/twm4nx/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/graphics/twm4nx/apps/ccalibration.cxx b/graphics/twm4nx/apps/ccalibration.cxx index 336b64777e2..7eab8067a81 100644 --- a/graphics/twm4nx/apps/ccalibration.cxx +++ b/graphics/twm4nx/apps/ccalibration.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/twm4nx/src/ccalibration.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/twm4nx/apps/cclock.cxx b/graphics/twm4nx/apps/cclock.cxx index a5559577db9..55c6c3e34f9 100644 --- a/graphics/twm4nx/apps/cclock.cxx +++ b/graphics/twm4nx/apps/cclock.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/twm4nx/src/cnxterm.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/twm4nx/apps/cnxterm.cxx b/graphics/twm4nx/apps/cnxterm.cxx index 67a964c4393..1918775a830 100644 --- a/graphics/twm4nx/apps/cnxterm.cxx +++ b/graphics/twm4nx/apps/cnxterm.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/twm4nx/src/cnxterm.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/twm4nx/src/cbackground.cxx b/graphics/twm4nx/src/cbackground.cxx index ef1f0ae312e..664913e0024 100644 --- a/graphics/twm4nx/src/cbackground.cxx +++ b/graphics/twm4nx/src/cbackground.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/twm4nx/include/cbackground.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/twm4nx/src/cfonts.cxx b/graphics/twm4nx/src/cfonts.cxx index b46baafbda6..03fcbee5712 100644 --- a/graphics/twm4nx/src/cfonts.cxx +++ b/graphics/twm4nx/src/cfonts.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/twm4nx/src/cfonts.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/twm4nx/src/ciconmgr.cxx b/graphics/twm4nx/src/ciconmgr.cxx index 72c7c56fea4..24150a70109 100644 --- a/graphics/twm4nx/src/ciconmgr.cxx +++ b/graphics/twm4nx/src/ciconmgr.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/twm4nx/src/ciconmgr.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/twm4nx/src/ciconwidget.cxx b/graphics/twm4nx/src/ciconwidget.cxx index ec4e66d38ae..0f215303087 100644 --- a/graphics/twm4nx/src/ciconwidget.cxx +++ b/graphics/twm4nx/src/ciconwidget.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/twm4nx/src/ciconwidget.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/twm4nx/src/cinput.cxx b/graphics/twm4nx/src/cinput.cxx index 47a8dbb30e4..a6486de0761 100644 --- a/graphics/twm4nx/src/cinput.cxx +++ b/graphics/twm4nx/src/cinput.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/graphics/NxWidgets/nxwm/src/cinput.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/graphics/twm4nx/src/cmainmenu.cxx b/graphics/twm4nx/src/cmainmenu.cxx index 6282a9e7f25..2c2034f3bf8 100644 --- a/graphics/twm4nx/src/cmainmenu.cxx +++ b/graphics/twm4nx/src/cmainmenu.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/twm4nx/include/cmainmenu.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/twm4nx/src/cmenus.cxx b/graphics/twm4nx/src/cmenus.cxx index 9c6d1f3bda9..701fc1a7940 100644 --- a/graphics/twm4nx/src/cmenus.cxx +++ b/graphics/twm4nx/src/cmenus.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/twm4nx/src/cmenus.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/twm4nx/src/cresize.cxx b/graphics/twm4nx/src/cresize.cxx index 9558f5d6c16..0e39cea53b6 100644 --- a/graphics/twm4nx/src/cresize.cxx +++ b/graphics/twm4nx/src/cresize.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/twm4nx/src/cresize.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/twm4nx/src/ctwm4nx.cxx b/graphics/twm4nx/src/ctwm4nx.cxx index 8b9e9ca323e..eaa07bc1aef 100644 --- a/graphics/twm4nx/src/ctwm4nx.cxx +++ b/graphics/twm4nx/src/ctwm4nx.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/twm4nx/src/ctwm4nx.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/twm4nx/src/cwindow.cxx b/graphics/twm4nx/src/cwindow.cxx index 172d5fde5c0..5d71d799061 100644 --- a/graphics/twm4nx/src/cwindow.cxx +++ b/graphics/twm4nx/src/cwindow.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/twm4nx/src/cwindow.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/twm4nx/src/cwindowevent.cxx b/graphics/twm4nx/src/cwindowevent.cxx index 4ec9e301352..b29268b849d 100644 --- a/graphics/twm4nx/src/cwindowevent.cxx +++ b/graphics/twm4nx/src/cwindowevent.cxx @@ -1,5 +1,7 @@ // apps/graphics/twm4nx/src/cwindowevent.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/twm4nx/src/cwindowfactory.cxx b/graphics/twm4nx/src/cwindowfactory.cxx index 35a7373e14c..bfda3f2c62f 100644 --- a/graphics/twm4nx/src/cwindowfactory.cxx +++ b/graphics/twm4nx/src/cwindowfactory.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/twm4nx/src/cwindowfactory.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/twm4nx/src/twm4nx_cursor.cxx b/graphics/twm4nx/src/twm4nx_cursor.cxx index efea39c47bf..f9778d06e5a 100644 --- a/graphics/twm4nx/src/twm4nx_cursor.cxx +++ b/graphics/twm4nx/src/twm4nx_cursor.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/twm4nx/src/twm4nx_cursor.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/graphics/twm4nx/src/twm4nx_main.cxx b/graphics/twm4nx/src/twm4nx_main.cxx index c3de5e23ae4..30185ad07d2 100644 --- a/graphics/twm4nx/src/twm4nx_main.cxx +++ b/graphics/twm4nx/src/twm4nx_main.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/twm4nx/src/twm4nx_main.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The From 064c6e16f776cee6b355c5f151f54f4f78e34d97 Mon Sep 17 00:00:00 2001 From: Alin Jerpelea Date: Thu, 19 Dec 2024 04:54:28 +0100 Subject: [PATCH 073/391] include: migrate to SPDX identifier Most tools used for compliance and SBOM generation use SPDX identifiers This change brings us a step closer to an easy SBOM generation. Signed-off-by: Alin Jerpelea --- include/audioutils/fmsynth.h | 2 + include/audioutils/fmsynth_eg.h | 2 + include/audioutils/fmsynth_op.h | 2 + include/audioutils/mml_parser.h | 2 + include/audioutils/nxaudio.h | 2 + include/builtin/builtin.h | 2 + include/canutils/canlib.h | 2 + include/canutils/lely/config.h | 2 + include/canutils/obd.h | 2 + include/canutils/obd_frame.h | 2 + include/canutils/obd_pid.h | 2 + include/crypto/controlse/ccertificate.hxx | 5 +- include/crypto/controlse/ccsr.hxx | 5 +- include/crypto/controlse/chex_util.hxx | 5 +- include/crypto/controlse/cpublic_key.hxx | 5 +- include/crypto/controlse/csan_builder.hxx | 5 +- include/crypto/controlse/csecure_element.hxx | 5 +- include/crypto/controlse/cserial_number.hxx | 5 +- include/crypto/controlse/cstring.hxx | 5 +- include/crypto/controlse/isecure_element.hxx | 5 +- .../controlse/isecure_element_object.hxx | 5 +- include/fsutils/flash_eraseall.h | 2 + include/fsutils/inifile.h | 2 + include/fsutils/ipcfg.h | 2 + include/fsutils/mkfatfs.h | 2 + include/fsutils/mksmartfs.h | 2 + include/fsutils/passwd.h | 2 + include/graphics/curses.h | 2 + include/graphics/ft80x.h | 2 + include/graphics/nxglyphs.hxx | 2 + include/graphics/nxwidgets/cbgwindow.hxx | 2 + include/graphics/nxwidgets/cbitmap.hxx | 2 + include/graphics/nxwidgets/cbutton.hxx | 2 + include/graphics/nxwidgets/cbuttonarray.hxx | 2 + include/graphics/nxwidgets/ccallback.hxx | 2 + include/graphics/nxwidgets/ccheckbox.hxx | 2 + include/graphics/nxwidgets/ccyclebutton.hxx | 2 + include/graphics/nxwidgets/cglyphbutton.hxx | 2 + .../nxwidgets/cglyphsliderhorizontal.hxx | 2 + .../nxwidgets/cglyphsliderhorizontalgrip.hxx | 2 + include/graphics/nxwidgets/cgraphicsport.hxx | 2 + include/graphics/nxwidgets/cimage.hxx | 2 + include/graphics/nxwidgets/ckeypad.hxx | 2 + include/graphics/nxwidgets/clabel.hxx | 2 + include/graphics/nxwidgets/clabelgrid.hxx | 2 + include/graphics/nxwidgets/clatchbutton.hxx | 2 + .../graphics/nxwidgets/clatchbuttonarray.hxx | 2 + include/graphics/nxwidgets/clistbox.hxx | 2 + .../graphics/nxwidgets/clistboxdataitem.hxx | 2 + include/graphics/nxwidgets/clistdata.hxx | 2 + .../graphics/nxwidgets/clistdataeventargs.hxx | 2 + include/graphics/nxwidgets/clistdataitem.hxx | 2 + .../graphics/nxwidgets/cmultilinetextbox.hxx | 2 + include/graphics/nxwidgets/cnumericedit.hxx | 2 + include/graphics/nxwidgets/cnxfont.hxx | 2 + include/graphics/nxwidgets/cnxserver.hxx | 2 + include/graphics/nxwidgets/cnxstring.hxx | 2 + include/graphics/nxwidgets/cnxtimer.hxx | 2 + include/graphics/nxwidgets/cnxtkwindow.hxx | 2 + include/graphics/nxwidgets/cnxtoolbar.hxx | 2 + include/graphics/nxwidgets/cnxwidget.hxx | 2 + include/graphics/nxwidgets/cnxwindow.hxx | 2 + include/graphics/nxwidgets/cprogressbar.hxx | 2 + include/graphics/nxwidgets/cradiobutton.hxx | 2 + .../graphics/nxwidgets/cradiobuttongroup.hxx | 2 + include/graphics/nxwidgets/crect.hxx | 2 + .../graphics/nxwidgets/crlepalettebitmap.hxx | 2 + include/graphics/nxwidgets/cscaledbitmap.hxx | 2 + .../nxwidgets/cscrollbarhorizontal.hxx | 2 + .../graphics/nxwidgets/cscrollbarpanel.hxx | 2 + .../graphics/nxwidgets/cscrollbarvertical.hxx | 2 + .../graphics/nxwidgets/cscrollinglistbox.hxx | 2 + .../graphics/nxwidgets/cscrollingpanel.hxx | 2 + .../graphics/nxwidgets/cscrollingtextbox.hxx | 2 + .../graphics/nxwidgets/csliderhorizontal.hxx | 2 + .../nxwidgets/csliderhorizontalgrip.hxx | 2 + .../graphics/nxwidgets/cslidervertical.hxx | 2 + .../nxwidgets/csliderverticalgrip.hxx | 2 + include/graphics/nxwidgets/cstickybutton.hxx | 2 + .../graphics/nxwidgets/cstickybuttonarray.hxx | 2 + include/graphics/nxwidgets/cstickyimage.hxx | 2 + .../graphics/nxwidgets/cstringiterator.hxx | 2 + include/graphics/nxwidgets/ctabpanel.hxx | 2 + include/graphics/nxwidgets/ctext.hxx | 2 + include/graphics/nxwidgets/ctextbox.hxx | 2 + include/graphics/nxwidgets/cwidgetcontrol.hxx | 2 + .../graphics/nxwidgets/cwidgeteventargs.hxx | 2 + .../nxwidgets/cwidgeteventhandler.hxx | 2 + .../nxwidgets/cwidgeteventhandlerlist.hxx | 2 + include/graphics/nxwidgets/cwidgetstyle.hxx | 2 + .../nxwidgets/cwindoweventhandler.hxx | 2 + .../nxwidgets/cwindoweventhandlerlist.hxx | 2 + include/graphics/nxwidgets/ibitmap.hxx | 2 + include/graphics/nxwidgets/ilistbox.hxx | 2 + .../nxwidgets/ilistdataeventhandler.hxx | 2 + include/graphics/nxwidgets/inxwindow.hxx | 2 + include/graphics/nxwidgets/iscrollable.hxx | 2 + include/graphics/nxwidgets/islider.hxx | 2 + include/graphics/nxwidgets/itextbox.hxx | 2 + include/graphics/nxwidgets/nxconfig.hxx | 2 + include/graphics/nxwidgets/singletons.hxx | 2 + include/graphics/nxwidgets/teventargs.hxx | 2 + include/graphics/nxwidgets/tnxarray.hxx | 2 + include/graphics/nxwm/capplicationwindow.hxx | 2 + include/graphics/nxwm/ccalibration.hxx | 2 + include/graphics/nxwm/cfullscreenwindow.hxx | 2 + include/graphics/nxwm/chexcalculator.hxx | 2 + include/graphics/nxwm/ckeyboard.hxx | 2 + include/graphics/nxwm/cmediaplayer.hxx | 2 + include/graphics/nxwm/cnxterm.hxx | 2 + include/graphics/nxwm/cstartwindow.hxx | 2 + include/graphics/nxwm/ctaskbar.hxx | 2 + include/graphics/nxwm/ctouchscreen.hxx | 2 + include/graphics/nxwm/cwindowmessenger.hxx | 2 + include/graphics/nxwm/iapplication.hxx | 2 + include/graphics/nxwm/iapplicationwindow.hxx | 2 + include/graphics/nxwm/nxwmconfig.hxx | 2 + include/graphics/panel.h | 2 + include/graphics/slcd.hxx | 2 + include/graphics/tiff.h | 2 + include/graphics/twm4nx/apps/calib_config.hxx | 2 + include/graphics/twm4nx/apps/ccalibration.hxx | 2 + include/graphics/twm4nx/apps/cclock.hxx | 2 + include/graphics/twm4nx/apps/clock_config.hxx | 2 + include/graphics/twm4nx/apps/cnxterm.hxx | 2 + .../graphics/twm4nx/apps/nxterm_config.hxx | 2 + include/graphics/twm4nx/cbackground.hxx | 2 + include/graphics/twm4nx/cfonts.hxx | 2 + include/graphics/twm4nx/ciconmgr.hxx | 2 + include/graphics/twm4nx/ciconwidget.hxx | 2 + include/graphics/twm4nx/cinput.hxx | 2 + include/graphics/twm4nx/cmainmenu.hxx | 2 + include/graphics/twm4nx/cmenus.hxx | 2 + include/graphics/twm4nx/cresize.hxx | 2 + include/graphics/twm4nx/ctwm4nx.hxx | 2 + include/graphics/twm4nx/ctwm4nxevent.hxx | 2 + include/graphics/twm4nx/cwindow.hxx | 2 + include/graphics/twm4nx/cwindowevent.hxx | 2 + include/graphics/twm4nx/cwindowfactory.hxx | 2 + include/graphics/twm4nx/iapplication.hxx | 2 + include/graphics/twm4nx/twm4nx_config.hxx | 2 + include/graphics/twm4nx/twm4nx_cursor.hxx | 2 + include/graphics/twm4nx/twm4nx_events.hxx | 2 + include/industry/abnt_codi.h | 2 + include/industry/foc/fixed16/foc_align.h | 2 + include/industry/foc/fixed16/foc_angle.h | 2 + include/industry/foc/fixed16/foc_cordic.h | 2 + .../industry/foc/fixed16/foc_feedforward.h | 2 + include/industry/foc/fixed16/foc_handler.h | 2 + include/industry/foc/fixed16/foc_ident.h | 2 + include/industry/foc/fixed16/foc_model.h | 2 + include/industry/foc/fixed16/foc_ramp.h | 2 + include/industry/foc/fixed16/foc_routine.h | 2 + include/industry/foc/fixed16/foc_velocity.h | 2 + include/industry/foc/float/foc_align.h | 2 + include/industry/foc/float/foc_angle.h | 2 + include/industry/foc/float/foc_cordic.h | 2 + include/industry/foc/float/foc_feedforward.h | 2 + include/industry/foc/float/foc_handler.h | 2 + include/industry/foc/float/foc_ident.h | 2 + include/industry/foc/float/foc_model.h | 2 + include/industry/foc/float/foc_ramp.h | 2 + include/industry/foc/float/foc_routine.h | 2 + include/industry/foc/float/foc_velocity.h | 2 + include/industry/foc/foc_common.h | 2 + include/industry/foc/foc_log.h | 2 + include/industry/foc/foc_utils.h | 2 + include/interpreters/minibasic.h | 49 +++++-------- include/logging/nxscope/nxscope.h | 2 + include/logging/nxscope/nxscope_chan.h | 2 + include/logging/nxscope/nxscope_intf.h | 2 + include/logging/nxscope/nxscope_proto.h | 2 + include/lte/lapi.h | 2 + include/lte/lte_api.h | 2 + include/lte/lte_fw_def.h | 2 + include/lte/lte_fwupdate.h | 2 + include/lte/lte_log.h | 2 + include/lte/lte_lwm2m.h | 2 + include/modbus/mb.h | 5 +- include/modbus/mb_m.h | 5 +- include/modbus/mbframe.h | 5 +- include/modbus/mbfunc.h | 5 +- include/modbus/mbport.h | 5 +- include/modbus/mbproto.h | 5 +- include/modbus/mbutils.h | 5 +- include/netutils/base64.h | 13 +--- include/netutils/chat.h | 5 +- include/netutils/curl4nx.h | 2 + include/netutils/dhcp6c.h | 2 + include/netutils/dhcpc.h | 11 +-- include/netutils/dhcpd.h | 11 +-- include/netutils/discover.h | 2 + include/netutils/esp8266.h | 2 + include/netutils/ftpc.h | 2 + include/netutils/ftpd.h | 2 + include/netutils/httpd.h | 14 ++-- include/netutils/icmp_ping.h | 2 + include/netutils/icmpv6_ping.h | 2 + include/netutils/ipmsfilter.h | 2 + include/netutils/md5.h | 73 +++++++------------ include/netutils/netinit.h | 2 + include/netutils/netlib.h | 16 ++-- include/netutils/ntpclient.h | 2 + include/netutils/pppd.h | 2 + include/netutils/ptpd.h | 2 + include/netutils/smtp.h | 14 ++-- include/netutils/telnetc.h | 2 + include/netutils/telnetd.h | 2 + include/netutils/tftp.h | 2 + include/netutils/thttpd.h | 2 + include/netutils/urldecode.h | 2 + include/netutils/webclient.h | 14 ++-- include/netutils/xmlrpc.h | 18 +++-- include/netutils/xtables.h | 2 + include/nshlib/nshlib.h | 2 + include/platform/configdata.h | 2 + include/system/cle.h | 2 + include/system/nxcamera.h | 2 + include/system/nxlooper.h | 2 + include/system/nxplayer.h | 2 + include/system/nxrecorder.h | 2 + include/system/readline.h | 2 + include/system/settings.h | 2 + include/system/termcurses.h | 2 + include/system/zmodem.h | 2 + include/testing/unity_config.h | 2 + include/wasm/math.h | 2 + include/wireless/ieee802154.h | 2 + include/wireless/iwpan.h | 2 + include/wireless/wapi.h | 21 ++---- 230 files changed, 541 insertions(+), 205 deletions(-) diff --git a/include/audioutils/fmsynth.h b/include/audioutils/fmsynth.h index b5676a358d1..f38bc1cc626 100644 --- a/include/audioutils/fmsynth.h +++ b/include/audioutils/fmsynth.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/audioutils/fmsynth.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/audioutils/fmsynth_eg.h b/include/audioutils/fmsynth_eg.h index f69b42e4957..9d21c688d37 100644 --- a/include/audioutils/fmsynth_eg.h +++ b/include/audioutils/fmsynth_eg.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/audioutils/fmsynth_eg.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/audioutils/fmsynth_op.h b/include/audioutils/fmsynth_op.h index ec54ccf1ef3..38a24172d2d 100644 --- a/include/audioutils/fmsynth_op.h +++ b/include/audioutils/fmsynth_op.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/audioutils/fmsynth_op.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/audioutils/mml_parser.h b/include/audioutils/mml_parser.h index 2fd8912b265..ac9496f723e 100644 --- a/include/audioutils/mml_parser.h +++ b/include/audioutils/mml_parser.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/audioutils/mml_parser.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/audioutils/nxaudio.h b/include/audioutils/nxaudio.h index b17d464c497..eec0ea486a2 100644 --- a/include/audioutils/nxaudio.h +++ b/include/audioutils/nxaudio.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/audioutils/nxaudio.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/builtin/builtin.h b/include/builtin/builtin.h index 8b4ae492586..b0e0f4866a2 100644 --- a/include/builtin/builtin.h +++ b/include/builtin/builtin.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/builtin/builtin.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/canutils/canlib.h b/include/canutils/canlib.h index 844107a3e58..4f280549dbe 100644 --- a/include/canutils/canlib.h +++ b/include/canutils/canlib.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/canutils/canlib.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/canutils/lely/config.h b/include/canutils/lely/config.h index 339a953ee4a..9e9d82d6d1f 100644 --- a/include/canutils/lely/config.h +++ b/include/canutils/lely/config.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/canutils/lely/config.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/canutils/obd.h b/include/canutils/obd.h index 6d9b294d858..bc6667285a5 100644 --- a/include/canutils/obd.h +++ b/include/canutils/obd.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/canutils/obd.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/canutils/obd_frame.h b/include/canutils/obd_frame.h index 6e06b6bc376..0d54a50b73d 100644 --- a/include/canutils/obd_frame.h +++ b/include/canutils/obd_frame.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/canutils/obd_frame.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/canutils/obd_pid.h b/include/canutils/obd_pid.h index 2a009511171..dfd46c0bf8c 100644 --- a/include/canutils/obd_pid.h +++ b/include/canutils/obd_pid.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/canutils/obd_pid.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/crypto/controlse/ccertificate.hxx b/include/crypto/controlse/ccertificate.hxx index 72bc45ac7d8..332fd030377 100644 --- a/include/crypto/controlse/ccertificate.hxx +++ b/include/crypto/controlse/ccertificate.hxx @@ -1,6 +1,9 @@ //*************************************************************************** // apps/include/crypto/controlse/ccertificate.hxx // +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2024 NXP +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The @@ -18,8 +21,6 @@ // //*************************************************************************** -// Copyright 2024 NXP - #pragma once //*************************************************************************** diff --git a/include/crypto/controlse/ccsr.hxx b/include/crypto/controlse/ccsr.hxx index 67286605092..fd3eb38bd38 100644 --- a/include/crypto/controlse/ccsr.hxx +++ b/include/crypto/controlse/ccsr.hxx @@ -1,6 +1,9 @@ //*************************************************************************** // apps/include/crypto/controlse/ccsr.hxx // +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2024 NXP +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The @@ -18,8 +21,6 @@ // //************************************************************************** -// Copyright 2024 NXP - #pragma once //*************************************************************************** diff --git a/include/crypto/controlse/chex_util.hxx b/include/crypto/controlse/chex_util.hxx index 446518148f4..c40f232277d 100644 --- a/include/crypto/controlse/chex_util.hxx +++ b/include/crypto/controlse/chex_util.hxx @@ -1,6 +1,9 @@ //*************************************************************************** // apps/include/crypto/controlse/chex_util.hxx // +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2024 NXP +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The @@ -18,8 +21,6 @@ // //************************************************************************** -// Copyright 2024 NXP - #pragma once //*************************************************************************** diff --git a/include/crypto/controlse/cpublic_key.hxx b/include/crypto/controlse/cpublic_key.hxx index eed61ca1560..c0678b2743a 100644 --- a/include/crypto/controlse/cpublic_key.hxx +++ b/include/crypto/controlse/cpublic_key.hxx @@ -1,6 +1,9 @@ //*************************************************************************** // apps/include/crypto/controlse/cpublic_key.hxx // +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2024 NXP +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The @@ -18,8 +21,6 @@ // //************************************************************************** -// Copyright 2024 NXP - #pragma once //*************************************************************************** diff --git a/include/crypto/controlse/csan_builder.hxx b/include/crypto/controlse/csan_builder.hxx index c992e94c042..b6b05cd0345 100644 --- a/include/crypto/controlse/csan_builder.hxx +++ b/include/crypto/controlse/csan_builder.hxx @@ -1,6 +1,9 @@ //*************************************************************************** // apps/include/crypto/controlse/csan_builder.hxx // +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2024 NXP +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The @@ -18,8 +21,6 @@ // //************************************************************************** -// Copyright 2024 NXP - #pragma once //*************************************************************************** diff --git a/include/crypto/controlse/csecure_element.hxx b/include/crypto/controlse/csecure_element.hxx index ac79bad1002..5632b3ca2d0 100644 --- a/include/crypto/controlse/csecure_element.hxx +++ b/include/crypto/controlse/csecure_element.hxx @@ -1,6 +1,9 @@ //*************************************************************************** // apps/include/crypto/controlse/csecure_element.hxx // +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2024 NXP +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The @@ -18,8 +21,6 @@ // //************************************************************************** -// Copyright 2024 NXP - #pragma once //*************************************************************************** diff --git a/include/crypto/controlse/cserial_number.hxx b/include/crypto/controlse/cserial_number.hxx index d8dde8df832..0cdeb459ec9 100644 --- a/include/crypto/controlse/cserial_number.hxx +++ b/include/crypto/controlse/cserial_number.hxx @@ -1,6 +1,9 @@ //*************************************************************************** // apps/include/crypto/controlse/cserial_number.hxx // +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2024 NXP +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The @@ -18,8 +21,6 @@ // //************************************************************************** -// Copyright 2024 NXP - #pragma once //*************************************************************************** diff --git a/include/crypto/controlse/cstring.hxx b/include/crypto/controlse/cstring.hxx index 4e744f9d464..7ae868cb350 100644 --- a/include/crypto/controlse/cstring.hxx +++ b/include/crypto/controlse/cstring.hxx @@ -1,6 +1,9 @@ //*************************************************************************** // apps/include/crypto/controlse/cstring.hxx // +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2024 NXP +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The @@ -18,8 +21,6 @@ // //************************************************************************** -// Copyright 2024 NXP - #pragma once //*************************************************************************** diff --git a/include/crypto/controlse/isecure_element.hxx b/include/crypto/controlse/isecure_element.hxx index ad559f96ed7..dc957bdf468 100644 --- a/include/crypto/controlse/isecure_element.hxx +++ b/include/crypto/controlse/isecure_element.hxx @@ -1,6 +1,9 @@ //*************************************************************************** // apps/include/crypto/controlse/isecure_element.hxx // +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2024 NXP +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The @@ -18,8 +21,6 @@ // //************************************************************************** -// Copyright 2024 NXP - //*************************************************************************** // Included Files //*************************************************************************** diff --git a/include/crypto/controlse/isecure_element_object.hxx b/include/crypto/controlse/isecure_element_object.hxx index ecff5901519..f73a262ffb8 100644 --- a/include/crypto/controlse/isecure_element_object.hxx +++ b/include/crypto/controlse/isecure_element_object.hxx @@ -1,6 +1,9 @@ //*************************************************************************** // apps/include/crypto/controlse/isecure_element_object.hxx // +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2024 NXP +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The @@ -18,8 +21,6 @@ // //************************************************************************** -// Copyright 2024 NXP - #pragma once //*************************************************************************** diff --git a/include/fsutils/flash_eraseall.h b/include/fsutils/flash_eraseall.h index d02baaef7d1..d3fb47c73de 100644 --- a/include/fsutils/flash_eraseall.h +++ b/include/fsutils/flash_eraseall.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/fsutils/flash_eraseall.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/fsutils/inifile.h b/include/fsutils/inifile.h index d943887fc59..ad9a7ffdf61 100644 --- a/include/fsutils/inifile.h +++ b/include/fsutils/inifile.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/fsutils/inifile.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/fsutils/ipcfg.h b/include/fsutils/ipcfg.h index 344b240ae38..a2aa1153170 100644 --- a/include/fsutils/ipcfg.h +++ b/include/fsutils/ipcfg.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/fsutils/ipcfg.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/fsutils/mkfatfs.h b/include/fsutils/mkfatfs.h index 09334b9e698..f2bc4ff9ec4 100644 --- a/include/fsutils/mkfatfs.h +++ b/include/fsutils/mkfatfs.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/fsutils/mkfatfs.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/fsutils/mksmartfs.h b/include/fsutils/mksmartfs.h index 4929598b441..38c6dea64af 100644 --- a/include/fsutils/mksmartfs.h +++ b/include/fsutils/mksmartfs.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/fsutils/mksmartfs.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/fsutils/passwd.h b/include/fsutils/passwd.h index 2b8234301a0..996bcf5097f 100644 --- a/include/fsutils/passwd.h +++ b/include/fsutils/passwd.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/fsutils/passwd.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/curses.h b/include/graphics/curses.h index cc833b6c64d..d66e19ce96e 100644 --- a/include/graphics/curses.h +++ b/include/graphics/curses.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/curses.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/ft80x.h b/include/graphics/ft80x.h index 27b81b240ce..20da36b44c4 100644 --- a/include/graphics/ft80x.h +++ b/include/graphics/ft80x.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/ft80x.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxglyphs.hxx b/include/graphics/nxglyphs.hxx index 73fcf2f85d4..807817f974b 100644 --- a/include/graphics/nxglyphs.hxx +++ b/include/graphics/nxglyphs.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/nxglyphs.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/cbgwindow.hxx b/include/graphics/nxwidgets/cbgwindow.hxx index c0e1e5c2166..d79d15f6558 100644 --- a/include/graphics/nxwidgets/cbgwindow.hxx +++ b/include/graphics/nxwidgets/cbgwindow.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/cbgwindow.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/cbitmap.hxx b/include/graphics/nxwidgets/cbitmap.hxx index 4d29d49854d..01f5196f71d 100644 --- a/include/graphics/nxwidgets/cbitmap.hxx +++ b/include/graphics/nxwidgets/cbitmap.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/cbitmap.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/cbutton.hxx b/include/graphics/nxwidgets/cbutton.hxx index 0f6a62277eb..ad64d1bc184 100644 --- a/include/graphics/nxwidgets/cbutton.hxx +++ b/include/graphics/nxwidgets/cbutton.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/cbutton.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/cbuttonarray.hxx b/include/graphics/nxwidgets/cbuttonarray.hxx index 0a622e550d4..8c4798f3239 100644 --- a/include/graphics/nxwidgets/cbuttonarray.hxx +++ b/include/graphics/nxwidgets/cbuttonarray.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/cbuttonarray.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/ccallback.hxx b/include/graphics/nxwidgets/ccallback.hxx index b0cadbb54d3..96e5ca89307 100644 --- a/include/graphics/nxwidgets/ccallback.hxx +++ b/include/graphics/nxwidgets/ccallback.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/ccallback.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/ccheckbox.hxx b/include/graphics/nxwidgets/ccheckbox.hxx index 8fdfdd9c120..e97b62fe0de 100644 --- a/include/graphics/nxwidgets/ccheckbox.hxx +++ b/include/graphics/nxwidgets/ccheckbox.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/ccheckbox.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/ccyclebutton.hxx b/include/graphics/nxwidgets/ccyclebutton.hxx index b2f9a1c2063..441b4bb0ee1 100644 --- a/include/graphics/nxwidgets/ccyclebutton.hxx +++ b/include/graphics/nxwidgets/ccyclebutton.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/ccyclebutton.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/cglyphbutton.hxx b/include/graphics/nxwidgets/cglyphbutton.hxx index 68aec3648b5..c0c75992416 100644 --- a/include/graphics/nxwidgets/cglyphbutton.hxx +++ b/include/graphics/nxwidgets/cglyphbutton.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/cbutton.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/cglyphsliderhorizontal.hxx b/include/graphics/nxwidgets/cglyphsliderhorizontal.hxx index daf6bb97153..8d1cacafc1c 100644 --- a/include/graphics/nxwidgets/cglyphsliderhorizontal.hxx +++ b/include/graphics/nxwidgets/cglyphsliderhorizontal.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/cglyphsliderhorizontal.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/cglyphsliderhorizontalgrip.hxx b/include/graphics/nxwidgets/cglyphsliderhorizontalgrip.hxx index e4f61401c45..b3e4b8b9caf 100644 --- a/include/graphics/nxwidgets/cglyphsliderhorizontalgrip.hxx +++ b/include/graphics/nxwidgets/cglyphsliderhorizontalgrip.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/cglyphsliderhorizontalgrip.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/cgraphicsport.hxx b/include/graphics/nxwidgets/cgraphicsport.hxx index c5a0529952e..e715e201495 100644 --- a/include/graphics/nxwidgets/cgraphicsport.hxx +++ b/include/graphics/nxwidgets/cgraphicsport.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/cgraphicsport.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/cimage.hxx b/include/graphics/nxwidgets/cimage.hxx index 8402be3f63e..1698c5511a2 100644 --- a/include/graphics/nxwidgets/cimage.hxx +++ b/include/graphics/nxwidgets/cimage.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/cimage.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/ckeypad.hxx b/include/graphics/nxwidgets/ckeypad.hxx index ca78c3e1f2e..c3ecaae53b0 100644 --- a/include/graphics/nxwidgets/ckeypad.hxx +++ b/include/graphics/nxwidgets/ckeypad.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/ckeypad.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/clabel.hxx b/include/graphics/nxwidgets/clabel.hxx index d5cc5da3628..a94907869fa 100644 --- a/include/graphics/nxwidgets/clabel.hxx +++ b/include/graphics/nxwidgets/clabel.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/clabel.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/clabelgrid.hxx b/include/graphics/nxwidgets/clabelgrid.hxx index fe6f521f29b..da518f9bc1b 100644 --- a/include/graphics/nxwidgets/clabelgrid.hxx +++ b/include/graphics/nxwidgets/clabelgrid.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/nxwidgets/include/clabelgrid.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/clatchbutton.hxx b/include/graphics/nxwidgets/clatchbutton.hxx index 6f2227a922b..c6f3b4ed9fd 100644 --- a/include/graphics/nxwidgets/clatchbutton.hxx +++ b/include/graphics/nxwidgets/clatchbutton.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/clatchbutton.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/clatchbuttonarray.hxx b/include/graphics/nxwidgets/clatchbuttonarray.hxx index 08162cc7f2c..10c48ca812c 100644 --- a/include/graphics/nxwidgets/clatchbuttonarray.hxx +++ b/include/graphics/nxwidgets/clatchbuttonarray.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/clatchbuttonarray.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/clistbox.hxx b/include/graphics/nxwidgets/clistbox.hxx index ef1b4970449..0f1a7c8e57d 100644 --- a/include/graphics/nxwidgets/clistbox.hxx +++ b/include/graphics/nxwidgets/clistbox.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/clistbox.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/clistboxdataitem.hxx b/include/graphics/nxwidgets/clistboxdataitem.hxx index 4d88c13453f..33ff883991a 100644 --- a/include/graphics/nxwidgets/clistboxdataitem.hxx +++ b/include/graphics/nxwidgets/clistboxdataitem.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/clistboxdataitem.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/clistdata.hxx b/include/graphics/nxwidgets/clistdata.hxx index e9fc290c416..32317da0b2e 100644 --- a/include/graphics/nxwidgets/clistdata.hxx +++ b/include/graphics/nxwidgets/clistdata.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/clistdata.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/clistdataeventargs.hxx b/include/graphics/nxwidgets/clistdataeventargs.hxx index 18649d9ad04..3d48cbefb5a 100644 --- a/include/graphics/nxwidgets/clistdataeventargs.hxx +++ b/include/graphics/nxwidgets/clistdataeventargs.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/clistdataeventargs.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/clistdataitem.hxx b/include/graphics/nxwidgets/clistdataitem.hxx index 9eb48bcd60c..43b68d2ccfa 100644 --- a/include/graphics/nxwidgets/clistdataitem.hxx +++ b/include/graphics/nxwidgets/clistdataitem.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/clistdataitem.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/cmultilinetextbox.hxx b/include/graphics/nxwidgets/cmultilinetextbox.hxx index ff876c8fb7c..f98a405eae6 100644 --- a/include/graphics/nxwidgets/cmultilinetextbox.hxx +++ b/include/graphics/nxwidgets/cmultilinetextbox.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/cmultilinetextbox.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/cnumericedit.hxx b/include/graphics/nxwidgets/cnumericedit.hxx index 9fa7c2dd055..18bc2b5cd1d 100644 --- a/include/graphics/nxwidgets/cnumericedit.hxx +++ b/include/graphics/nxwidgets/cnumericedit.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/cnumericedit.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/cnxfont.hxx b/include/graphics/nxwidgets/cnxfont.hxx index 873430e434d..a894e1e5165 100644 --- a/include/graphics/nxwidgets/cnxfont.hxx +++ b/include/graphics/nxwidgets/cnxfont.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/cnxfont.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/cnxserver.hxx b/include/graphics/nxwidgets/cnxserver.hxx index 5683506eb44..55b730a3db3 100644 --- a/include/graphics/nxwidgets/cnxserver.hxx +++ b/include/graphics/nxwidgets/cnxserver.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/cnxserver.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/cnxstring.hxx b/include/graphics/nxwidgets/cnxstring.hxx index 056bbd759ce..6f5d8198e16 100644 --- a/include/graphics/nxwidgets/cnxstring.hxx +++ b/include/graphics/nxwidgets/cnxstring.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/cnxtring.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/cnxtimer.hxx b/include/graphics/nxwidgets/cnxtimer.hxx index 1ee40371ee0..f17f74fd31c 100644 --- a/include/graphics/nxwidgets/cnxtimer.hxx +++ b/include/graphics/nxwidgets/cnxtimer.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/cnxtimer.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/cnxtkwindow.hxx b/include/graphics/nxwidgets/cnxtkwindow.hxx index 1efdda2a188..b8b4fa99971 100644 --- a/include/graphics/nxwidgets/cnxtkwindow.hxx +++ b/include/graphics/nxwidgets/cnxtkwindow.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/cnxtkwindow.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/cnxtoolbar.hxx b/include/graphics/nxwidgets/cnxtoolbar.hxx index 8bfdd64ad7a..a70014bda24 100644 --- a/include/graphics/nxwidgets/cnxtoolbar.hxx +++ b/include/graphics/nxwidgets/cnxtoolbar.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/cnxtoolbar.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/cnxwidget.hxx b/include/graphics/nxwidgets/cnxwidget.hxx index c0806f9d7a1..eb1414dc858 100644 --- a/include/graphics/nxwidgets/cnxwidget.hxx +++ b/include/graphics/nxwidgets/cnxwidget.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/cnxwidget.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/cnxwindow.hxx b/include/graphics/nxwidgets/cnxwindow.hxx index c8b5535be66..c75145a64a6 100644 --- a/include/graphics/nxwidgets/cnxwindow.hxx +++ b/include/graphics/nxwidgets/cnxwindow.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/cnxwindow.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/cprogressbar.hxx b/include/graphics/nxwidgets/cprogressbar.hxx index 6a33a67ecf2..a4f2162a3ec 100644 --- a/include/graphics/nxwidgets/cprogressbar.hxx +++ b/include/graphics/nxwidgets/cprogressbar.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/cprogressbar.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/cradiobutton.hxx b/include/graphics/nxwidgets/cradiobutton.hxx index 951acdae39c..b293d6b2dc2 100644 --- a/include/graphics/nxwidgets/cradiobutton.hxx +++ b/include/graphics/nxwidgets/cradiobutton.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/cradiobutton.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/cradiobuttongroup.hxx b/include/graphics/nxwidgets/cradiobuttongroup.hxx index 5aa084d8c22..427dfdfbb50 100644 --- a/include/graphics/nxwidgets/cradiobuttongroup.hxx +++ b/include/graphics/nxwidgets/cradiobuttongroup.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/cradiobuttongroup.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/crect.hxx b/include/graphics/nxwidgets/crect.hxx index 02a8874ae55..864a46be460 100644 --- a/include/graphics/nxwidgets/crect.hxx +++ b/include/graphics/nxwidgets/crect.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/cbgwindow.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/crlepalettebitmap.hxx b/include/graphics/nxwidgets/crlepalettebitmap.hxx index 627f565e1f9..395c8c4d727 100644 --- a/include/graphics/nxwidgets/crlepalettebitmap.hxx +++ b/include/graphics/nxwidgets/crlepalettebitmap.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/crlepalettebitmap.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/cscaledbitmap.hxx b/include/graphics/nxwidgets/cscaledbitmap.hxx index 7fc3538d60d..b2cc5f5773c 100644 --- a/include/graphics/nxwidgets/cscaledbitmap.hxx +++ b/include/graphics/nxwidgets/cscaledbitmap.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/cscaledbitmap.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/cscrollbarhorizontal.hxx b/include/graphics/nxwidgets/cscrollbarhorizontal.hxx index 453cccfb6c6..0280516b42b 100644 --- a/include/graphics/nxwidgets/cscrollbarhorizontal.hxx +++ b/include/graphics/nxwidgets/cscrollbarhorizontal.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/cscrollbarhorizontal.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/cscrollbarpanel.hxx b/include/graphics/nxwidgets/cscrollbarpanel.hxx index 965d728f0e8..0f1fcaa073f 100644 --- a/include/graphics/nxwidgets/cscrollbarpanel.hxx +++ b/include/graphics/nxwidgets/cscrollbarpanel.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/cscrollbarpanel.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/cscrollbarvertical.hxx b/include/graphics/nxwidgets/cscrollbarvertical.hxx index 63ac3ae50ec..e6d13796c02 100644 --- a/include/graphics/nxwidgets/cscrollbarvertical.hxx +++ b/include/graphics/nxwidgets/cscrollbarvertical.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/cscrollbarvertical.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/cscrollinglistbox.hxx b/include/graphics/nxwidgets/cscrollinglistbox.hxx index dd7e9c4c488..662682dbcd8 100644 --- a/include/graphics/nxwidgets/cscrollinglistbox.hxx +++ b/include/graphics/nxwidgets/cscrollinglistbox.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/cscrollinglistbox.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/cscrollingpanel.hxx b/include/graphics/nxwidgets/cscrollingpanel.hxx index 6c12169df0c..17e48f108c1 100644 --- a/include/graphics/nxwidgets/cscrollingpanel.hxx +++ b/include/graphics/nxwidgets/cscrollingpanel.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/cscrollingpanel.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/cscrollingtextbox.hxx b/include/graphics/nxwidgets/cscrollingtextbox.hxx index b800f47d2b9..65bc4757068 100644 --- a/include/graphics/nxwidgets/cscrollingtextbox.hxx +++ b/include/graphics/nxwidgets/cscrollingtextbox.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/cscrollingtextbox.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/csliderhorizontal.hxx b/include/graphics/nxwidgets/csliderhorizontal.hxx index f87f52ac0a2..ea797eaaf20 100644 --- a/include/graphics/nxwidgets/csliderhorizontal.hxx +++ b/include/graphics/nxwidgets/csliderhorizontal.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/csliderhorizontal.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/csliderhorizontalgrip.hxx b/include/graphics/nxwidgets/csliderhorizontalgrip.hxx index e45fcb2046f..5b18d916a12 100644 --- a/include/graphics/nxwidgets/csliderhorizontalgrip.hxx +++ b/include/graphics/nxwidgets/csliderhorizontalgrip.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/csliderhorizontalgrip.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/cslidervertical.hxx b/include/graphics/nxwidgets/cslidervertical.hxx index 8f6f3dd3d7d..7a2ca5c64be 100644 --- a/include/graphics/nxwidgets/cslidervertical.hxx +++ b/include/graphics/nxwidgets/cslidervertical.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/cslidervertical.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/csliderverticalgrip.hxx b/include/graphics/nxwidgets/csliderverticalgrip.hxx index eca56a6da2d..c3ccb13b759 100644 --- a/include/graphics/nxwidgets/csliderverticalgrip.hxx +++ b/include/graphics/nxwidgets/csliderverticalgrip.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/cslidervertical.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/cstickybutton.hxx b/include/graphics/nxwidgets/cstickybutton.hxx index 3a9220741f6..279fad095f9 100644 --- a/include/graphics/nxwidgets/cstickybutton.hxx +++ b/include/graphics/nxwidgets/cstickybutton.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/cstickybutton.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/cstickybuttonarray.hxx b/include/graphics/nxwidgets/cstickybuttonarray.hxx index 41a97c24e26..4d6bb7afebd 100644 --- a/include/graphics/nxwidgets/cstickybuttonarray.hxx +++ b/include/graphics/nxwidgets/cstickybuttonarray.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/cstickybuttonarray.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/cstickyimage.hxx b/include/graphics/nxwidgets/cstickyimage.hxx index bb3fc22f707..4ca29e6db84 100644 --- a/include/graphics/nxwidgets/cstickyimage.hxx +++ b/include/graphics/nxwidgets/cstickyimage.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/cstickyimage.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/cstringiterator.hxx b/include/graphics/nxwidgets/cstringiterator.hxx index e20b1ec1316..09c88324373 100644 --- a/include/graphics/nxwidgets/cstringiterator.hxx +++ b/include/graphics/nxwidgets/cstringiterator.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/cstringiterator.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/ctabpanel.hxx b/include/graphics/nxwidgets/ctabpanel.hxx index 39d9dc2c163..75937628f5a 100644 --- a/include/graphics/nxwidgets/ctabpanel.hxx +++ b/include/graphics/nxwidgets/ctabpanel.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/ctabpanel.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/ctext.hxx b/include/graphics/nxwidgets/ctext.hxx index 19aa01d0988..b5ce62157ba 100644 --- a/include/graphics/nxwidgets/ctext.hxx +++ b/include/graphics/nxwidgets/ctext.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/ctext.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/ctextbox.hxx b/include/graphics/nxwidgets/ctextbox.hxx index 55a65c22527..ffc6d8d1ea8 100644 --- a/include/graphics/nxwidgets/ctextbox.hxx +++ b/include/graphics/nxwidgets/ctextbox.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/ctextbox.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/cwidgetcontrol.hxx b/include/graphics/nxwidgets/cwidgetcontrol.hxx index b2a4c03596c..504aab616f2 100644 --- a/include/graphics/nxwidgets/cwidgetcontrol.hxx +++ b/include/graphics/nxwidgets/cwidgetcontrol.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/cwidgetcontrol.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/cwidgeteventargs.hxx b/include/graphics/nxwidgets/cwidgeteventargs.hxx index 143f3b02faf..42ea5ed5f19 100644 --- a/include/graphics/nxwidgets/cwidgeteventargs.hxx +++ b/include/graphics/nxwidgets/cwidgeteventargs.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/cwidgeteventargs.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/cwidgeteventhandler.hxx b/include/graphics/nxwidgets/cwidgeteventhandler.hxx index 3df10531cad..823dac9d061 100644 --- a/include/graphics/nxwidgets/cwidgeteventhandler.hxx +++ b/include/graphics/nxwidgets/cwidgeteventhandler.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/cwidgeteventhandler.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/cwidgeteventhandlerlist.hxx b/include/graphics/nxwidgets/cwidgeteventhandlerlist.hxx index 846f765055d..24b11ce80fa 100644 --- a/include/graphics/nxwidgets/cwidgeteventhandlerlist.hxx +++ b/include/graphics/nxwidgets/cwidgeteventhandlerlist.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/cwidgeteventhandlerlist.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/cwidgetstyle.hxx b/include/graphics/nxwidgets/cwidgetstyle.hxx index b1d25aeacaa..01e333ea1ee 100644 --- a/include/graphics/nxwidgets/cwidgetstyle.hxx +++ b/include/graphics/nxwidgets/cwidgetstyle.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/cwidgetstyle.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/cwindoweventhandler.hxx b/include/graphics/nxwidgets/cwindoweventhandler.hxx index c4729e1284a..5979c254e2b 100644 --- a/include/graphics/nxwidgets/cwindoweventhandler.hxx +++ b/include/graphics/nxwidgets/cwindoweventhandler.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/cwindoweventhandler.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/cwindoweventhandlerlist.hxx b/include/graphics/nxwidgets/cwindoweventhandlerlist.hxx index be494c87941..f59af9c5db8 100644 --- a/include/graphics/nxwidgets/cwindoweventhandlerlist.hxx +++ b/include/graphics/nxwidgets/cwindoweventhandlerlist.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/cwindoweventhandlerlist.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/ibitmap.hxx b/include/graphics/nxwidgets/ibitmap.hxx index d2abbb964e0..208e91bf725 100644 --- a/include/graphics/nxwidgets/ibitmap.hxx +++ b/include/graphics/nxwidgets/ibitmap.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/ibitmap.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/ilistbox.hxx b/include/graphics/nxwidgets/ilistbox.hxx index 89003b70bbe..32a77bec897 100644 --- a/include/graphics/nxwidgets/ilistbox.hxx +++ b/include/graphics/nxwidgets/ilistbox.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/ilistbox.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/ilistdataeventhandler.hxx b/include/graphics/nxwidgets/ilistdataeventhandler.hxx index 6aa2cd4849a..2ca274d4314 100644 --- a/include/graphics/nxwidgets/ilistdataeventhandler.hxx +++ b/include/graphics/nxwidgets/ilistdataeventhandler.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/ilistdataeventhandler.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/inxwindow.hxx b/include/graphics/nxwidgets/inxwindow.hxx index 28aabd0a6a4..0236192ef5e 100644 --- a/include/graphics/nxwidgets/inxwindow.hxx +++ b/include/graphics/nxwidgets/inxwindow.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/inxwindow.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/iscrollable.hxx b/include/graphics/nxwidgets/iscrollable.hxx index baaf2e4659c..53fdcecdd1f 100644 --- a/include/graphics/nxwidgets/iscrollable.hxx +++ b/include/graphics/nxwidgets/iscrollable.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/iscrollable.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/islider.hxx b/include/graphics/nxwidgets/islider.hxx index 4c5b787dded..d50e60dc34e 100644 --- a/include/graphics/nxwidgets/islider.hxx +++ b/include/graphics/nxwidgets/islider.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/islider.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/itextbox.hxx b/include/graphics/nxwidgets/itextbox.hxx index 99216f19c80..006ade8a536 100644 --- a/include/graphics/nxwidgets/itextbox.hxx +++ b/include/graphics/nxwidgets/itextbox.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/itextbox.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/nxconfig.hxx b/include/graphics/nxwidgets/nxconfig.hxx index 097af19e07f..4a8e1ebf782 100644 --- a/include/graphics/nxwidgets/nxconfig.hxx +++ b/include/graphics/nxwidgets/nxconfig.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/nxconfig.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/singletons.hxx b/include/graphics/nxwidgets/singletons.hxx index d3ef88c7274..588af556005 100644 --- a/include/graphics/nxwidgets/singletons.hxx +++ b/include/graphics/nxwidgets/singletons.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/singletons.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/teventargs.hxx b/include/graphics/nxwidgets/teventargs.hxx index c7d78429ff4..15df705d40e 100644 --- a/include/graphics/nxwidgets/teventargs.hxx +++ b/include/graphics/nxwidgets/teventargs.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/teventargs.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwidgets/tnxarray.hxx b/include/graphics/nxwidgets/tnxarray.hxx index e27f25b8fd5..9c28c9211b9 100644 --- a/include/graphics/nxwidgets/tnxarray.hxx +++ b/include/graphics/nxwidgets/tnxarray.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwidgets/tnxarray.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwm/capplicationwindow.hxx b/include/graphics/nxwm/capplicationwindow.hxx index 5362a3fe910..51365d1b212 100644 --- a/include/graphics/nxwm/capplicationwindow.hxx +++ b/include/graphics/nxwm/capplicationwindow.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwm/capplicationwindow.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwm/ccalibration.hxx b/include/graphics/nxwm/ccalibration.hxx index 2417f7fe0ad..e8035414968 100644 --- a/include/graphics/nxwm/ccalibration.hxx +++ b/include/graphics/nxwm/ccalibration.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwm/ccalibration.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwm/cfullscreenwindow.hxx b/include/graphics/nxwm/cfullscreenwindow.hxx index b0379848263..3054e6f8e9f 100644 --- a/include/graphics/nxwm/cfullscreenwindow.hxx +++ b/include/graphics/nxwm/cfullscreenwindow.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwm/cfullscreenwindow.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwm/chexcalculator.hxx b/include/graphics/nxwm/chexcalculator.hxx index 146c8810bbb..2780a104746 100644 --- a/include/graphics/nxwm/chexcalculator.hxx +++ b/include/graphics/nxwm/chexcalculator.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwm/chexcalculator.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwm/ckeyboard.hxx b/include/graphics/nxwm/ckeyboard.hxx index f810f6a974d..64535dafb13 100644 --- a/include/graphics/nxwm/ckeyboard.hxx +++ b/include/graphics/nxwm/ckeyboard.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwm/keyboard.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwm/cmediaplayer.hxx b/include/graphics/nxwm/cmediaplayer.hxx index 20e454ca2b9..fd1745dc517 100644 --- a/include/graphics/nxwm/cmediaplayer.hxx +++ b/include/graphics/nxwm/cmediaplayer.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwm/cmediaplayer.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwm/cnxterm.hxx b/include/graphics/nxwm/cnxterm.hxx index 4f78fd3ce33..5afbac76c9a 100644 --- a/include/graphics/nxwm/cnxterm.hxx +++ b/include/graphics/nxwm/cnxterm.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwm/cnxterm.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwm/cstartwindow.hxx b/include/graphics/nxwm/cstartwindow.hxx index a3a6c87ff57..fb4fb2acb97 100644 --- a/include/graphics/nxwm/cstartwindow.hxx +++ b/include/graphics/nxwm/cstartwindow.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwm/cnxstart.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwm/ctaskbar.hxx b/include/graphics/nxwm/ctaskbar.hxx index 295a173ae63..fd312b3f14a 100644 --- a/include/graphics/nxwm/ctaskbar.hxx +++ b/include/graphics/nxwm/ctaskbar.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwm/cnxtaskbar.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwm/ctouchscreen.hxx b/include/graphics/nxwm/ctouchscreen.hxx index 0e215b7a0cc..7808f21ba96 100644 --- a/include/graphics/nxwm/ctouchscreen.hxx +++ b/include/graphics/nxwm/ctouchscreen.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwm/ctouchscreen.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwm/cwindowmessenger.hxx b/include/graphics/nxwm/cwindowmessenger.hxx index 264db80d578..535b7aeb587 100644 --- a/include/graphics/nxwm/cwindowmessenger.hxx +++ b/include/graphics/nxwm/cwindowmessenger.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwm/cwindowmessenger.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwm/iapplication.hxx b/include/graphics/nxwm/iapplication.hxx index e671304ed14..26b3ff6944d 100644 --- a/include/graphics/nxwm/iapplication.hxx +++ b/include/graphics/nxwm/iapplication.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwm/iapplication.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwm/iapplicationwindow.hxx b/include/graphics/nxwm/iapplicationwindow.hxx index d702869b52f..72addbcd68e 100644 --- a/include/graphics/nxwm/iapplicationwindow.hxx +++ b/include/graphics/nxwm/iapplicationwindow.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwm/iapplicationwindow.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/nxwm/nxwmconfig.hxx b/include/graphics/nxwm/nxwmconfig.hxx index c5fa07f728d..06eb6853064 100644 --- a/include/graphics/nxwm/nxwmconfig.hxx +++ b/include/graphics/nxwm/nxwmconfig.hxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/nxwm/nxwmconfig.hxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/panel.h b/include/graphics/panel.h index 9eb9daefdf7..22a25f21259 100644 --- a/include/graphics/panel.h +++ b/include/graphics/panel.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/panel.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/slcd.hxx b/include/graphics/slcd.hxx index e1b1bb7491d..23d940844da 100644 --- a/include/graphics/slcd.hxx +++ b/include/graphics/slcd.hxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/include/graphics/slcd.hxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/include/graphics/tiff.h b/include/graphics/tiff.h index f4c21148c2c..2239ead286d 100644 --- a/include/graphics/tiff.h +++ b/include/graphics/tiff.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/graphics/tiff.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/graphics/twm4nx/apps/calib_config.hxx b/include/graphics/twm4nx/apps/calib_config.hxx index 14f795fe8a4..85abc746a76 100644 --- a/include/graphics/twm4nx/apps/calib_config.hxx +++ b/include/graphics/twm4nx/apps/calib_config.hxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/include/graphics/twm4nx/apps/calib_config.hxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/include/graphics/twm4nx/apps/ccalibration.hxx b/include/graphics/twm4nx/apps/ccalibration.hxx index 9b610918a29..39b60b0cfc9 100644 --- a/include/graphics/twm4nx/apps/ccalibration.hxx +++ b/include/graphics/twm4nx/apps/ccalibration.hxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/include/graphics/twm4nx/apps/ccalibration.hxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/include/graphics/twm4nx/apps/cclock.hxx b/include/graphics/twm4nx/apps/cclock.hxx index c03de3336ed..351381a692d 100644 --- a/include/graphics/twm4nx/apps/cclock.hxx +++ b/include/graphics/twm4nx/apps/cclock.hxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/include/graphics/twm4nx/apps/cclock.hxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/include/graphics/twm4nx/apps/clock_config.hxx b/include/graphics/twm4nx/apps/clock_config.hxx index fa5584f1a65..b6c05906075 100644 --- a/include/graphics/twm4nx/apps/clock_config.hxx +++ b/include/graphics/twm4nx/apps/clock_config.hxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/include/graphics/twm4nx/apps/clock_config.hxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/include/graphics/twm4nx/apps/cnxterm.hxx b/include/graphics/twm4nx/apps/cnxterm.hxx index d697f72f95b..e7bfcecc271 100644 --- a/include/graphics/twm4nx/apps/cnxterm.hxx +++ b/include/graphics/twm4nx/apps/cnxterm.hxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/include/graphics/twm4nx/apps/cnxterm.hxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/include/graphics/twm4nx/apps/nxterm_config.hxx b/include/graphics/twm4nx/apps/nxterm_config.hxx index 88d4b10c8da..e90be9b9047 100644 --- a/include/graphics/twm4nx/apps/nxterm_config.hxx +++ b/include/graphics/twm4nx/apps/nxterm_config.hxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/include/graphics/twm4nx/apps/nxterm_config.hxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/include/graphics/twm4nx/cbackground.hxx b/include/graphics/twm4nx/cbackground.hxx index 75e985f4e49..bca79302961 100644 --- a/include/graphics/twm4nx/cbackground.hxx +++ b/include/graphics/twm4nx/cbackground.hxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/include/graphics/twm4nx/cbackground.hxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/include/graphics/twm4nx/cfonts.hxx b/include/graphics/twm4nx/cfonts.hxx index 532e37b3984..479eaa727d7 100644 --- a/include/graphics/twm4nx/cfonts.hxx +++ b/include/graphics/twm4nx/cfonts.hxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/include/graphics/twm4nx/cfonts.hxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/include/graphics/twm4nx/ciconmgr.hxx b/include/graphics/twm4nx/ciconmgr.hxx index 766f29c0a77..4b2104b07da 100644 --- a/include/graphics/twm4nx/ciconmgr.hxx +++ b/include/graphics/twm4nx/ciconmgr.hxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/include/graphics/twm4nx/ciconmgr.hxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/include/graphics/twm4nx/ciconwidget.hxx b/include/graphics/twm4nx/ciconwidget.hxx index f76082869b1..e96b69ca892 100644 --- a/include/graphics/twm4nx/ciconwidget.hxx +++ b/include/graphics/twm4nx/ciconwidget.hxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/include/graphics/twm4nx/ciconwidget.hxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/include/graphics/twm4nx/cinput.hxx b/include/graphics/twm4nx/cinput.hxx index c7ee7da6ebb..eb576dd5503 100644 --- a/include/graphics/twm4nx/cinput.hxx +++ b/include/graphics/twm4nx/cinput.hxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/include/graphics/twm4nx/cinput.hxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/include/graphics/twm4nx/cmainmenu.hxx b/include/graphics/twm4nx/cmainmenu.hxx index 6fe1f72da69..f88af86e1cd 100644 --- a/include/graphics/twm4nx/cmainmenu.hxx +++ b/include/graphics/twm4nx/cmainmenu.hxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/include/graphics/twm4nx/cmainmenu.hxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/include/graphics/twm4nx/cmenus.hxx b/include/graphics/twm4nx/cmenus.hxx index ecbda590747..e7abee1ab5a 100644 --- a/include/graphics/twm4nx/cmenus.hxx +++ b/include/graphics/twm4nx/cmenus.hxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/include/graphics/twm4nx/Cmenus.hxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/include/graphics/twm4nx/cresize.hxx b/include/graphics/twm4nx/cresize.hxx index fd4b503b1f6..0c6a52733e9 100644 --- a/include/graphics/twm4nx/cresize.hxx +++ b/include/graphics/twm4nx/cresize.hxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/include/graphics/twm4nx/cresize.hxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/include/graphics/twm4nx/ctwm4nx.hxx b/include/graphics/twm4nx/ctwm4nx.hxx index 8f3cc5b42e2..655bb9214c0 100644 --- a/include/graphics/twm4nx/ctwm4nx.hxx +++ b/include/graphics/twm4nx/ctwm4nx.hxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/include/graphics/twm4nx/ctwm4nx.hxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/include/graphics/twm4nx/ctwm4nxevent.hxx b/include/graphics/twm4nx/ctwm4nxevent.hxx index fef00821637..8d0d3b9cc10 100644 --- a/include/graphics/twm4nx/ctwm4nxevent.hxx +++ b/include/graphics/twm4nx/ctwm4nxevent.hxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/include/graphics/twm4nx/ctwmnxevent.hxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/include/graphics/twm4nx/cwindow.hxx b/include/graphics/twm4nx/cwindow.hxx index b1bdd0656e2..2b0508593f5 100644 --- a/include/graphics/twm4nx/cwindow.hxx +++ b/include/graphics/twm4nx/cwindow.hxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/include/graphics/twm4nx/cwindow.hxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/include/graphics/twm4nx/cwindowevent.hxx b/include/graphics/twm4nx/cwindowevent.hxx index 61c975a0597..86755790b24 100644 --- a/include/graphics/twm4nx/cwindowevent.hxx +++ b/include/graphics/twm4nx/cwindowevent.hxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/graphics/twm4nx/src/cwindowevent.hxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/include/graphics/twm4nx/cwindowfactory.hxx b/include/graphics/twm4nx/cwindowfactory.hxx index 1ae7be4ebff..c59fe710f8d 100644 --- a/include/graphics/twm4nx/cwindowfactory.hxx +++ b/include/graphics/twm4nx/cwindowfactory.hxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/include/graphics/twm4nx/cwindowfactory.hxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/include/graphics/twm4nx/iapplication.hxx b/include/graphics/twm4nx/iapplication.hxx index b3962e0cbbe..5a71013bd6c 100644 --- a/include/graphics/twm4nx/iapplication.hxx +++ b/include/graphics/twm4nx/iapplication.hxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/include/graphics/twm4nx/iapplication.hxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/include/graphics/twm4nx/twm4nx_config.hxx b/include/graphics/twm4nx/twm4nx_config.hxx index 2d1849592da..679cc887eaf 100644 --- a/include/graphics/twm4nx/twm4nx_config.hxx +++ b/include/graphics/twm4nx/twm4nx_config.hxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/include/graphics/twm4nx/twm4nx_config.hxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/include/graphics/twm4nx/twm4nx_cursor.hxx b/include/graphics/twm4nx/twm4nx_cursor.hxx index 9f86a5b0ada..f6761e34277 100644 --- a/include/graphics/twm4nx/twm4nx_cursor.hxx +++ b/include/graphics/twm4nx/twm4nx_cursor.hxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/include/graphics/twm4nx/twm4nx_cursor.hxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/include/graphics/twm4nx/twm4nx_events.hxx b/include/graphics/twm4nx/twm4nx_events.hxx index 9058d40ece2..64a2ea5daed 100644 --- a/include/graphics/twm4nx/twm4nx_events.hxx +++ b/include/graphics/twm4nx/twm4nx_events.hxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/include/graphics/twm4nx/twm4nx_events.hxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/include/industry/abnt_codi.h b/include/industry/abnt_codi.h index c84aee45f97..049a7b29fe4 100644 --- a/include/industry/abnt_codi.h +++ b/include/industry/abnt_codi.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/industry/abnt_codi.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/industry/foc/fixed16/foc_align.h b/include/industry/foc/fixed16/foc_align.h index 27403df5795..9a840799b8f 100644 --- a/include/industry/foc/fixed16/foc_align.h +++ b/include/industry/foc/fixed16/foc_align.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/industry/foc/fixed16/foc_align.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/industry/foc/fixed16/foc_angle.h b/include/industry/foc/fixed16/foc_angle.h index ba6cd22ff07..1834ec6f8ab 100644 --- a/include/industry/foc/fixed16/foc_angle.h +++ b/include/industry/foc/fixed16/foc_angle.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/industry/foc/fixed16/foc_angle.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/industry/foc/fixed16/foc_cordic.h b/include/industry/foc/fixed16/foc_cordic.h index 81dd52ddc77..94bd09564b5 100644 --- a/include/industry/foc/fixed16/foc_cordic.h +++ b/include/industry/foc/fixed16/foc_cordic.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/industry/foc/fixed16/foc_cordic.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/industry/foc/fixed16/foc_feedforward.h b/include/industry/foc/fixed16/foc_feedforward.h index 742537a1804..f84430ca449 100644 --- a/include/industry/foc/fixed16/foc_feedforward.h +++ b/include/industry/foc/fixed16/foc_feedforward.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/industry/foc/fixed16/foc_feedforward.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/industry/foc/fixed16/foc_handler.h b/include/industry/foc/fixed16/foc_handler.h index 8e1601f41b6..718713fc181 100644 --- a/include/industry/foc/fixed16/foc_handler.h +++ b/include/industry/foc/fixed16/foc_handler.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/industry/foc/fixed16/foc_handler.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/industry/foc/fixed16/foc_ident.h b/include/industry/foc/fixed16/foc_ident.h index d7360e19b9d..74e97f0819f 100644 --- a/include/industry/foc/fixed16/foc_ident.h +++ b/include/industry/foc/fixed16/foc_ident.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/industry/foc/fixed16/foc_ident.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/industry/foc/fixed16/foc_model.h b/include/industry/foc/fixed16/foc_model.h index ce0c8c8e460..7afe2129c6c 100644 --- a/include/industry/foc/fixed16/foc_model.h +++ b/include/industry/foc/fixed16/foc_model.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/industry/foc/fixed16/foc_model.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/industry/foc/fixed16/foc_ramp.h b/include/industry/foc/fixed16/foc_ramp.h index 1c2a1547ad3..5577f427a72 100644 --- a/include/industry/foc/fixed16/foc_ramp.h +++ b/include/industry/foc/fixed16/foc_ramp.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/industry/foc/fixed16/foc_ramp.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/industry/foc/fixed16/foc_routine.h b/include/industry/foc/fixed16/foc_routine.h index 320d8a8f0c7..8dae9639bab 100644 --- a/include/industry/foc/fixed16/foc_routine.h +++ b/include/industry/foc/fixed16/foc_routine.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/industry/foc/fixed16/foc_routine.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/industry/foc/fixed16/foc_velocity.h b/include/industry/foc/fixed16/foc_velocity.h index 14119e968b4..eef5c73ce7c 100644 --- a/include/industry/foc/fixed16/foc_velocity.h +++ b/include/industry/foc/fixed16/foc_velocity.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/industry/foc/fixed16/foc_velocity.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/industry/foc/float/foc_align.h b/include/industry/foc/float/foc_align.h index f0e3035ebd3..31bce11c81d 100644 --- a/include/industry/foc/float/foc_align.h +++ b/include/industry/foc/float/foc_align.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/industry/foc/float/foc_align.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/industry/foc/float/foc_angle.h b/include/industry/foc/float/foc_angle.h index b258b46b8a6..42009846353 100644 --- a/include/industry/foc/float/foc_angle.h +++ b/include/industry/foc/float/foc_angle.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/industry/foc/float/foc_angle.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/industry/foc/float/foc_cordic.h b/include/industry/foc/float/foc_cordic.h index f68fbec9ba5..77620d65314 100644 --- a/include/industry/foc/float/foc_cordic.h +++ b/include/industry/foc/float/foc_cordic.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/industry/foc/float/foc_cordic.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/industry/foc/float/foc_feedforward.h b/include/industry/foc/float/foc_feedforward.h index 6be81336cae..96b33dbf834 100644 --- a/include/industry/foc/float/foc_feedforward.h +++ b/include/industry/foc/float/foc_feedforward.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/industry/foc/float/foc_feedforward.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/industry/foc/float/foc_handler.h b/include/industry/foc/float/foc_handler.h index 662491be092..09e38e98ad3 100644 --- a/include/industry/foc/float/foc_handler.h +++ b/include/industry/foc/float/foc_handler.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/industry/foc/float/foc_handler.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/industry/foc/float/foc_ident.h b/include/industry/foc/float/foc_ident.h index 66da973a4eb..fcbb94b6d59 100644 --- a/include/industry/foc/float/foc_ident.h +++ b/include/industry/foc/float/foc_ident.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/industry/foc/float/foc_ident.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/industry/foc/float/foc_model.h b/include/industry/foc/float/foc_model.h index da26eec0ce8..95a7ed1b3c5 100644 --- a/include/industry/foc/float/foc_model.h +++ b/include/industry/foc/float/foc_model.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/industry/foc/float/foc_model.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/industry/foc/float/foc_ramp.h b/include/industry/foc/float/foc_ramp.h index ea75700b0f4..ca41eef3796 100644 --- a/include/industry/foc/float/foc_ramp.h +++ b/include/industry/foc/float/foc_ramp.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/industry/foc/float/foc_ramp.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/industry/foc/float/foc_routine.h b/include/industry/foc/float/foc_routine.h index fc3d68640c6..bcfe3e1b983 100644 --- a/include/industry/foc/float/foc_routine.h +++ b/include/industry/foc/float/foc_routine.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/industry/foc/float/foc_routine.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/industry/foc/float/foc_velocity.h b/include/industry/foc/float/foc_velocity.h index 971a9e9abda..309a4512a11 100644 --- a/include/industry/foc/float/foc_velocity.h +++ b/include/industry/foc/float/foc_velocity.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/industry/foc/float/foc_velocity.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/industry/foc/foc_common.h b/include/industry/foc/foc_common.h index 4530647cac4..6993a6a3742 100644 --- a/include/industry/foc/foc_common.h +++ b/include/industry/foc/foc_common.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/industry/foc/foc_common.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/industry/foc/foc_log.h b/include/industry/foc/foc_log.h index bc8b1c43f2a..62a9950bb0f 100644 --- a/include/industry/foc/foc_log.h +++ b/include/industry/foc/foc_log.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/industry/foc/foc_log.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/industry/foc/foc_utils.h b/include/industry/foc/foc_utils.h index 65406ce7db6..b76931846a0 100644 --- a/include/industry/foc/foc_utils.h +++ b/include/industry/foc/foc_utils.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/industry/foc/foc_utils.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/interpreters/minibasic.h b/include/interpreters/minibasic.h index 1520f30d6d2..b315445b0ff 100644 --- a/include/interpreters/minibasic.h +++ b/include/interpreters/minibasic.h @@ -1,42 +1,31 @@ /**************************************************************************** * apps/include/interpreters/minibasic.h * - * Copyright (C) 2016 Gregory Nutt. All rights reserved. + * SPDX-License-Identifier: Apache-2.0 * - * This file was taken from Mini Basic, versino 1.0 developed by Malcolm - * McLean, Leeds University. Mini Basic version 1.0 was released the - * Creative Commons Attribution license which, from my reading, appears to - * be compatible with the NuttX BSD-style license: - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. + * http://www.apache.org/licenses/LICENSE-2.0 * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ +/* This file was taken from Mini Basic, versino 1.0 developed by Malcolm + * McLean, Leeds University. Mini Basic version 1.0 was released the + * Creative Commons Attribution license which, from my reading, appears to + * be compatible with the NuttX BSD-style license: + */ + #ifndef __APPS_INCLUDE_INTERPRETERS_MINIBASIC_H #define __APPS_INCLUDE_INTERPRETERS_MINIBASIC_H diff --git a/include/logging/nxscope/nxscope.h b/include/logging/nxscope/nxscope.h index bf1344857a9..bbbd145d27f 100644 --- a/include/logging/nxscope/nxscope.h +++ b/include/logging/nxscope/nxscope.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/logging/nxscope/nxscope.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/logging/nxscope/nxscope_chan.h b/include/logging/nxscope/nxscope_chan.h index 15e16f13986..5dfbf557210 100644 --- a/include/logging/nxscope/nxscope_chan.h +++ b/include/logging/nxscope/nxscope_chan.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/logging/nxscope/nxscope_chan.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/logging/nxscope/nxscope_intf.h b/include/logging/nxscope/nxscope_intf.h index 61f7e709992..b493c9d0d82 100644 --- a/include/logging/nxscope/nxscope_intf.h +++ b/include/logging/nxscope/nxscope_intf.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/logging/nxscope/nxscope_intf.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/logging/nxscope/nxscope_proto.h b/include/logging/nxscope/nxscope_proto.h index 283b74d55d9..d666bed9ca9 100644 --- a/include/logging/nxscope/nxscope_proto.h +++ b/include/logging/nxscope/nxscope_proto.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/logging/nxscope/nxscope_proto.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/lte/lapi.h b/include/lte/lapi.h index bf131057825..4159d0e6d93 100644 --- a/include/lte/lapi.h +++ b/include/lte/lapi.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/lte/lapi.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/lte/lte_api.h b/include/lte/lte_api.h index e016970d2f7..f7c17c5d52f 100644 --- a/include/lte/lte_api.h +++ b/include/lte/lte_api.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/lte/lte_api.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/lte/lte_fw_def.h b/include/lte/lte_fw_def.h index a737e424513..4b7a787344e 100644 --- a/include/lte/lte_fw_def.h +++ b/include/lte/lte_fw_def.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/lte/lte_fw_def.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/lte/lte_fwupdate.h b/include/lte/lte_fwupdate.h index 0d6af8e69fc..eff7499090f 100644 --- a/include/lte/lte_fwupdate.h +++ b/include/lte/lte_fwupdate.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/lte/lte_fwupdate.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/lte/lte_log.h b/include/lte/lte_log.h index 35fd01c4281..41ce2b9500a 100644 --- a/include/lte/lte_log.h +++ b/include/lte/lte_log.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/lte/lte_log.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/lte/lte_lwm2m.h b/include/lte/lte_lwm2m.h index c9fc564a1e6..b9e1abd062b 100644 --- a/include/lte/lte_lwm2m.h +++ b/include/lte/lte_lwm2m.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/lte/lte_lwm2m.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/modbus/mb.h b/include/modbus/mb.h index 617f33c59e9..bbbf26b6ce2 100644 --- a/include/modbus/mb.h +++ b/include/modbus/mb.h @@ -1,9 +1,8 @@ /**************************************************************************** * apps/include/modbus/mb.h * - * FreeModbus Library: A portable Modbus implementation for Modbus ASCII/RTU. - * Copyright (c) 2006 Christian Walter - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2006 Christian Walter * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/include/modbus/mb_m.h b/include/modbus/mb_m.h index 7390320a221..03ffe07d2dc 100644 --- a/include/modbus/mb_m.h +++ b/include/modbus/mb_m.h @@ -1,9 +1,8 @@ /**************************************************************************** * apps/include/modbus/mb_m.h * - * FreeModbus Library: A portable Modbus implementation for Modbus ASCII/RTU. - * Copyright (C) 2013 Armink - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2013 Armink * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/include/modbus/mbframe.h b/include/modbus/mbframe.h index 40312ff51de..999fdc4e3e1 100644 --- a/include/modbus/mbframe.h +++ b/include/modbus/mbframe.h @@ -1,9 +1,8 @@ /**************************************************************************** * apps/include/modbus/mbframe.h * - * FreeModbus Library: A portable Modbus implementation for Modbus ASCII/RTU. - * Copyright (c) 2006 Christian Walter - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2006 Christian Walter * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/include/modbus/mbfunc.h b/include/modbus/mbfunc.h index 82f4ee8cc60..d61fed4b619 100644 --- a/include/modbus/mbfunc.h +++ b/include/modbus/mbfunc.h @@ -1,9 +1,8 @@ /**************************************************************************** * apps/include/modbus/mbfunc.h * - * FreeModbus Library: A portable Modbus implementation for Modbus ASCII/RTU. - * Copyright (c) 2006 Christian Walter - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2006 Christian Walter * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/include/modbus/mbport.h b/include/modbus/mbport.h index eabf230724b..45019dfeeb7 100644 --- a/include/modbus/mbport.h +++ b/include/modbus/mbport.h @@ -1,9 +1,8 @@ /**************************************************************************** * apps/include/modbus/mbport.h * - * FreeModbus Library: A portable Modbus implementation for Modbus ASCII/RTU. - * Copyright (c) 2006 Christian Walter - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2006 Christian Walter * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/include/modbus/mbproto.h b/include/modbus/mbproto.h index e42e7a28467..dded90df030 100644 --- a/include/modbus/mbproto.h +++ b/include/modbus/mbproto.h @@ -1,9 +1,8 @@ /**************************************************************************** * apps/include/modbus/mbproto.h * - * FreeModbus Library: A portable Modbus implementation for Modbus ASCII/RTU. - * Copyright (c) 2006 Christian Walter - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2006 Christian Walter * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/include/modbus/mbutils.h b/include/modbus/mbutils.h index 1bb33c53c45..0da5434378b 100644 --- a/include/modbus/mbutils.h +++ b/include/modbus/mbutils.h @@ -1,9 +1,8 @@ /**************************************************************************** * apps/include/modbus/mbutils.h * - * FreeModbus Library: A portable Modbus implementation for Modbus ASCII/RTU. - * Copyright (c) 2006 Christian Walter - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2006 Christian Walter * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/include/netutils/base64.h b/include/netutils/base64.h index d44600333b7..e5869d8ac09 100644 --- a/include/netutils/base64.h +++ b/include/netutils/base64.h @@ -1,15 +1,10 @@ /**************************************************************************** * apps/include/netutils/base64.h * - * This file is part of the NuttX RTOS: - * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. - * Author: Darcy Gong - * - * Reference: - * - * Base64 encoding/decoding (RFC1341) - * Copyright (c) 2005, Jouni Malinen + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2012 Gregory Nutt + * SPDX-FileCopyrightText: 2005 Jouni Malinen + * SPDX-FileContributor: Darcy Gong * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as diff --git a/include/netutils/chat.h b/include/netutils/chat.h index b1ff0a5c30d..fabd3f8cd44 100644 --- a/include/netutils/chat.h +++ b/include/netutils/chat.h @@ -1,8 +1,9 @@ /**************************************************************************** * apps/include/netutils/chat.h * - * Copyright (C) 2016 Vladimir Komendantskiy. All rights reserved. - * Author: Vladimir Komendantskiy + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2016 Vladimir Komendantskiy. All rights reserved. + * SPDX-FileContributor: Vladimir Komendantskiy * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/include/netutils/curl4nx.h b/include/netutils/curl4nx.h index cb5d25e3268..8e10144b3f9 100644 --- a/include/netutils/curl4nx.h +++ b/include/netutils/curl4nx.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/netutils/curl4nx.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/netutils/dhcp6c.h b/include/netutils/dhcp6c.h index b798274c01f..4d184417e6d 100644 --- a/include/netutils/dhcp6c.h +++ b/include/netutils/dhcp6c.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/netutils/dhcp6c.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/netutils/dhcpc.h b/include/netutils/dhcpc.h index 8ec670723b5..541c0196163 100644 --- a/include/netutils/dhcpc.h +++ b/include/netutils/dhcpc.h @@ -1,13 +1,10 @@ /**************************************************************************** * apps/include/netutils/dhcpc.h * - * Copyright (C) 2007, 2009-2011, 2015 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * This logic was leveraged from uIP which also has a BSD-style license: - * - * Copyright (c) 2005, Swedish Institute of Computer Science - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2007, 2009-2011, 2015 Gregory Nutt + * SPDX-FileCopyrightText: 2005 Swedish Institute of Computer Science + * SPDX-FileContributor: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/include/netutils/dhcpd.h b/include/netutils/dhcpd.h index 847305197de..b1061b8a47d 100644 --- a/include/netutils/dhcpd.h +++ b/include/netutils/dhcpd.h @@ -1,13 +1,10 @@ /**************************************************************************** * apps/include/netutils/dhcpd.h * - * Copyright (C) 2007, 2009, 2011, 2015 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * This logic was leveraged from uIP which also has a BSD-style license: - * - * Copyright (c) 2005, Swedish Institute of Computer Science - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2007, 2009-2011, 2015 Gregory Nutt + * SPDX-FileCopyrightText: 2005 Swedish Institute of Computer Science + * SPDX-FileContributor: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/include/netutils/discover.h b/include/netutils/discover.h index 535ba810153..b7423197d84 100644 --- a/include/netutils/discover.h +++ b/include/netutils/discover.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/netutils/discover.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/netutils/esp8266.h b/include/netutils/esp8266.h index c6d2c2c425e..2c8fccd8062 100644 --- a/include/netutils/esp8266.h +++ b/include/netutils/esp8266.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/netutils/esp8266.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/netutils/ftpc.h b/include/netutils/ftpc.h index fe1be978d5e..0216b5faf31 100644 --- a/include/netutils/ftpc.h +++ b/include/netutils/ftpc.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/netutils/ftpc.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/netutils/ftpd.h b/include/netutils/ftpd.h index 31b3ffd1c17..30f18cd323a 100644 --- a/include/netutils/ftpd.h +++ b/include/netutils/ftpd.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/netutils/ftpd.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/netutils/httpd.h b/include/netutils/httpd.h index d0933d356b8..e9dc61f7564 100644 --- a/include/netutils/httpd.h +++ b/include/netutils/httpd.h @@ -1,15 +1,11 @@ /**************************************************************************** * apps/include/netutils/httpd.h * - * Copyright (C) 2007, 2009, 2011-2012, 2014, 2018 Gregory Nutt. All - * rights reserved. - * Author: Gregory Nutt - * - * Based on uIP which also has a BSD style license: - * - * Author: Adam Dunkels - * Copyright (c) 2001-2005, Adam Dunkels. - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2007, 2009-2011, 2014, 2018 Gregory Nutt + * SPDX-FileCopyrightText: 2001-2005, Adam Dunkels. + * SPDX-FileContributor: Gregory Nutt + * SPDX-FileContributor: Adam Dunkels * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/include/netutils/icmp_ping.h b/include/netutils/icmp_ping.h index 02979929b79..eec500de965 100644 --- a/include/netutils/icmp_ping.h +++ b/include/netutils/icmp_ping.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/netutils/icmp_ping.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/netutils/icmpv6_ping.h b/include/netutils/icmpv6_ping.h index e7ff07c116f..3f793f74166 100644 --- a/include/netutils/icmpv6_ping.h +++ b/include/netutils/icmpv6_ping.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/netutils/icmpv6_ping.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/netutils/ipmsfilter.h b/include/netutils/ipmsfilter.h index a96c7f0f681..edab65fe2f2 100644 --- a/include/netutils/ipmsfilter.h +++ b/include/netutils/ipmsfilter.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/netutils/ipmsfilter.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/netutils/md5.h b/include/netutils/md5.h index 5e5ab6620ca..f64173bfae8 100644 --- a/include/netutils/md5.h +++ b/include/netutils/md5.h @@ -1,57 +1,34 @@ /**************************************************************************** * apps/include/netutils/md5.h * - * This file is part of the NuttX RTOS: + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2012 Gregory Nutt + * SPDX-FileContributor: Darcy Gong * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. - * Author: Darcy Gong + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: * - * Reference: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Institute nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. * - * This code implements the MD5 message-digest algorithm. - * The algorithm is due to Ron Rivest. This code was - * written by Colin Plumb in 1993, no copyright is claimed. - * - * This code is in the public domain; do with it what you wish. - * - * Equivalent code is available from RSA Data Security, Inc. - * This code has been tested against that, and is equivalent, - * except that you don't need to include two pages of legalese - * with every copy. - * - * To compute the message digest of a chunk of bytes, declare an - * md5_context_s structure, pass it to md5_init, call md5_update as - * needed on buffers full of bytes, and then call md5_final, which - * will fill a supplied 16-byte array with the digest. - * - * See README and COPYING for more details. - * - * And is re-released under the NuttX modified BSD license: - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************/ diff --git a/include/netutils/netinit.h b/include/netutils/netinit.h index b733ab3c0f0..3c3c85d505f 100644 --- a/include/netutils/netinit.h +++ b/include/netutils/netinit.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/netutils/netinit.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/netutils/netlib.h b/include/netutils/netlib.h index b92c9569660..2e816441f27 100644 --- a/include/netutils/netlib.h +++ b/include/netutils/netlib.h @@ -1,17 +1,11 @@ /**************************************************************************** * apps/include/netutils/netlib.h - * Various non-standard APIs to support netutils. All non-standard and - * intended only for internal use. * - * Copyright (C) 2007, 2009, 2011, 2015, 2017 Gregory Nutt. All rights - * reserved. - * Author: Gregory Nutt - * - * Some of these APIs derive from uIP. uIP also has a BSD style license: - * - * Author: Adam Dunkels - * Copyright (c) 2002, Adam Dunkels. - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2007, 2009, 2011, 2015, 2017 Gregory Nutt. + * SPDX-FileCopyrightText: 2002 Adam Dunkels. + * SPDX-FileContributor: Gregory Nutt + * SPDX-FileContributor: Adam Dunkels * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/include/netutils/ntpclient.h b/include/netutils/ntpclient.h index b330dfec714..78045f5ee0a 100644 --- a/include/netutils/ntpclient.h +++ b/include/netutils/ntpclient.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/netutils/ntpclient.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/netutils/pppd.h b/include/netutils/pppd.h index 4e24e3f94e3..690f10b0b13 100644 --- a/include/netutils/pppd.h +++ b/include/netutils/pppd.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/netutils/pppd.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/netutils/ptpd.h b/include/netutils/ptpd.h index ab01b803c5a..8e5a3c50850 100644 --- a/include/netutils/ptpd.h +++ b/include/netutils/ptpd.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/netutils/ptpd.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/netutils/smtp.h b/include/netutils/smtp.h index 5d4c612aef7..e278d1a17f4 100644 --- a/include/netutils/smtp.h +++ b/include/netutils/smtp.h @@ -1,15 +1,11 @@ /**************************************************************************** * apps/include/netutils/smtp.h - * SMTP header file * - * Copyright (C) 2007, 2009, 2011, 2015 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Heavily leveraged from uIP 1.0 which also has a BSD-like license: - * - * Author: Adam Dunkels - * Copyright (c) 2002, Adam Dunkels. - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2007, 2009, 2011, 2015 Gregory Nutt. + * SPDX-FileCopyrightText: 2002 Adam Dunkels. + * SPDX-FileContributor: Gregory Nutt + * SPDX-FileContributor: Adam Dunkels * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/include/netutils/telnetc.h b/include/netutils/telnetc.h index 5a3b00f82da..85d653d80c6 100644 --- a/include/netutils/telnetc.h +++ b/include/netutils/telnetc.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/netutils/telnetc.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/netutils/telnetd.h b/include/netutils/telnetd.h index 1183d4ffc24..f428e937d7b 100644 --- a/include/netutils/telnetd.h +++ b/include/netutils/telnetd.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/netutils/telnetd.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/netutils/tftp.h b/include/netutils/tftp.h index ae2eee8cb3f..ad0432c45de 100644 --- a/include/netutils/tftp.h +++ b/include/netutils/tftp.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/netutils/tftp.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/netutils/thttpd.h b/include/netutils/thttpd.h index 1f34764e6e4..a0df9e0b792 100644 --- a/include/netutils/thttpd.h +++ b/include/netutils/thttpd.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/netutils/thttpd.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/netutils/urldecode.h b/include/netutils/urldecode.h index 60b098add8f..07a4c39db82 100644 --- a/include/netutils/urldecode.h +++ b/include/netutils/urldecode.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/netutils/urldecode.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/netutils/webclient.h b/include/netutils/webclient.h index 0c765a34075..58188c941ec 100644 --- a/include/netutils/webclient.h +++ b/include/netutils/webclient.h @@ -1,15 +1,11 @@ /**************************************************************************** * apps/include/netutils/webclient.h - * Header file for the HTTP client * - * Copyright (C) 2007, 2009, 2011, 2015 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Based remotely on the uIP webclient which also has a BSD style license: - * - * Author: Adam Dunkels - * Copyright (c) 2002, Adam Dunkels. - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2007, 2009, 2011, 2015 Gregory Nutt. + * SPDX-FileCopyrightText: 2002 Adam Dunkels. + * SPDX-FileContributor: Gregory Nutt + * SPDX-FileContributor: Adam Dunkels * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/include/netutils/xmlrpc.h b/include/netutils/xmlrpc.h index edf5d1684c2..53ee6f91941 100644 --- a/include/netutils/xmlrpc.h +++ b/include/netutils/xmlrpc.h @@ -1,14 +1,10 @@ /**************************************************************************** * apps/include/netutils/xmlrpc.h * - * Copyright (C) 2012 Max Holtzberg. All rights reserved. - * Author: Max Holtzberg - * - * Based on the embeddable lightweight XML-RPC server code discussed - * in the article at: http://www.drdobbs.com/web-development/\ - * an-embeddable-lightweight-xml-rpc-server/184405364 - * - * Copyright (c) 2002 Cogito LLC. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2012 Max Holtzberg. All rights reserved. + * SPDX-FileCopyrightText: 2002 Cogito LLC. All rights reserved. + * SPDX-FileContributor: Max Holtzberg * * Redistribution and use in source and binary forms, with or * without modification, is hereby granted without fee provided @@ -40,6 +36,12 @@ * POSSIBILITY OF SUCH DAMAGE. ****************************************************************************/ +/* + * Based on the embeddable lightweight XML-RPC server code discussed + * in the article at: http://www.drdobbs.com/web-development/\ + * an-embeddable-lightweight-xml-rpc-server/184405364 + */ + /* Lightweight Embedded XML-RPC Server Types and Definitions * * mtj@cogitollc.com diff --git a/include/netutils/xtables.h b/include/netutils/xtables.h index d2370e8041a..12c116b534a 100644 --- a/include/netutils/xtables.h +++ b/include/netutils/xtables.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/netutils/xtables.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/nshlib/nshlib.h b/include/nshlib/nshlib.h index b8f8bbbe45d..f9565894a12 100644 --- a/include/nshlib/nshlib.h +++ b/include/nshlib/nshlib.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/nshlib/nshlib.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/platform/configdata.h b/include/platform/configdata.h index 98ea14c61c1..94df8682107 100644 --- a/include/platform/configdata.h +++ b/include/platform/configdata.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/platform/configdata.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/system/cle.h b/include/system/cle.h index 3e316352281..c1204864f88 100644 --- a/include/system/cle.h +++ b/include/system/cle.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/system/cle.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/system/nxcamera.h b/include/system/nxcamera.h index a1d26229187..6c4707e42cf 100644 --- a/include/system/nxcamera.h +++ b/include/system/nxcamera.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/system/nxcamera.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/system/nxlooper.h b/include/system/nxlooper.h index 2335c3d5ec6..7218b0f2003 100644 --- a/include/system/nxlooper.h +++ b/include/system/nxlooper.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/system/nxlooper.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/system/nxplayer.h b/include/system/nxplayer.h index 74f4856f409..f70a9d55c1e 100644 --- a/include/system/nxplayer.h +++ b/include/system/nxplayer.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/system/nxplayer.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/system/nxrecorder.h b/include/system/nxrecorder.h index 4b2c2ac9680..c80d2ee1522 100644 --- a/include/system/nxrecorder.h +++ b/include/system/nxrecorder.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/system/nxrecorder.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/system/readline.h b/include/system/readline.h index ad0872a82c3..5ab963879f9 100644 --- a/include/system/readline.h +++ b/include/system/readline.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/system/readline.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/system/settings.h b/include/system/settings.h index e4f7eddb6f0..943be7add37 100644 --- a/include/system/settings.h +++ b/include/system/settings.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/system/settings.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/system/termcurses.h b/include/system/termcurses.h index 852258de768..458526102a6 100644 --- a/include/system/termcurses.h +++ b/include/system/termcurses.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/system/termcurses.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/system/zmodem.h b/include/system/zmodem.h index 1c13742bcf9..3a7eddea9d7 100644 --- a/include/system/zmodem.h +++ b/include/system/zmodem.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/system/zmodem.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/testing/unity_config.h b/include/testing/unity_config.h index 4cfe157ac16..993399e0174 100644 --- a/include/testing/unity_config.h +++ b/include/testing/unity_config.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/testing/unity_config.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/wasm/math.h b/include/wasm/math.h index b7918c3bd8d..bd0b887fe49 100644 --- a/include/wasm/math.h +++ b/include/wasm/math.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/wasm/math.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/wireless/ieee802154.h b/include/wireless/ieee802154.h index 4049cf8854c..95e8543761a 100644 --- a/include/wireless/ieee802154.h +++ b/include/wireless/ieee802154.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/wireless/ieee802154.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/wireless/iwpan.h b/include/wireless/iwpan.h index a6561b67367..3e0efc35030 100644 --- a/include/wireless/iwpan.h +++ b/include/wireless/iwpan.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/include/wireless/iwpan.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/include/wireless/wapi.h b/include/wireless/wapi.h index dae250ba59c..8663b338b4e 100644 --- a/include/wireless/wapi.h +++ b/include/wireless/wapi.h @@ -1,21 +1,12 @@ /**************************************************************************** * apps/include/wireless/wapi.h * - * Copyright (C) 2017, 2019 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Adapted for NuttX from WAPI: - * - * Copyright (c) 2010, Volkan YAZICI - * All rights reserved. - * - * And includes WPA supplicant logic contributed by: - * - * Author: Simon Piriou - * - * Which was adapted to NuttX from driver_ext.h - * - * Copyright (c) 2003-2005, Jouni Malinen + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2017,2019 Gregory Nutt + * SPDX-FileCopyrightText: 2010, Volkan YAZICI + * SPDX-FileCopyrightText: 2003-2005, Jouni Malinen + * SPDX-FileContributor: Gregory Nutt + * SPDX-FileContributor: Simon Piriou * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions From cc345c785d25f9df28f26c02606ac91ddea69fea Mon Sep 17 00:00:00 2001 From: Alin Jerpelea Date: Thu, 19 Dec 2024 06:04:56 +0100 Subject: [PATCH 074/391] industry: migrate to SPDX identifier Most tools used for compliance and SBOM generation use SPDX identifiers This change brings us a step closer to an easy SBOM generation. Signed-off-by: Alin Jerpelea --- industry/CMakeLists.txt | 2 ++ industry/Make.defs | 2 ++ industry/Makefile | 2 ++ industry/abnt_codi/Make.defs | 2 ++ industry/abnt_codi/Makefile | 2 ++ industry/abnt_codi/abnt_codi.c | 2 ++ industry/foc/CMakeLists.txt | 2 ++ industry/foc/Make.defs | 3 ++- industry/foc/Makefile | 2 ++ industry/foc/fixed16/foc_align.c | 3 ++- industry/foc/fixed16/foc_ang_hall.c | 2 ++ industry/foc/fixed16/foc_ang_onfo.c | 2 ++ industry/foc/fixed16/foc_ang_openloop.c | 2 ++ industry/foc/fixed16/foc_ang_osmo.c | 2 ++ industry/foc/fixed16/foc_ang_qenco.c | 2 ++ industry/foc/fixed16/foc_angle.c | 2 ++ industry/foc/fixed16/foc_cordic.c | 2 ++ industry/foc/fixed16/foc_feedforward.c | 2 ++ industry/foc/fixed16/foc_handler.c | 2 ++ industry/foc/fixed16/foc_ident.c | 3 ++- industry/foc/fixed16/foc_model.c | 2 ++ industry/foc/fixed16/foc_model_pmsm.c | 3 ++- industry/foc/fixed16/foc_picontrol.c | 3 ++- industry/foc/fixed16/foc_ramp.c | 3 ++- industry/foc/fixed16/foc_routine.c | 2 ++ industry/foc/fixed16/foc_svm3.c | 3 ++- industry/foc/fixed16/foc_vel_odiv.c | 2 ++ industry/foc/fixed16/foc_vel_opll.c | 2 ++ industry/foc/fixed16/foc_velocity.c | 2 ++ industry/foc/float/foc_align.c | 3 ++- industry/foc/float/foc_ang_hall.c | 2 ++ industry/foc/float/foc_ang_onfo.c | 2 ++ industry/foc/float/foc_ang_openloop.c | 2 ++ industry/foc/float/foc_ang_osmo.c | 2 ++ industry/foc/float/foc_ang_qenco.c | 2 ++ industry/foc/float/foc_angle.c | 2 ++ industry/foc/float/foc_cordic.c | 2 ++ industry/foc/float/foc_feedforward.c | 2 ++ industry/foc/float/foc_handler.c | 2 ++ industry/foc/float/foc_ident.c | 3 ++- industry/foc/float/foc_model.c | 2 ++ industry/foc/float/foc_model_pmsm.c | 3 ++- industry/foc/float/foc_picontrol.c | 3 ++- industry/foc/float/foc_ramp.c | 3 ++- industry/foc/float/foc_routine.c | 2 ++ industry/foc/float/foc_svm3.c | 3 ++- industry/foc/float/foc_vel_odiv.c | 2 ++ industry/foc/float/foc_vel_opll.c | 2 ++ industry/foc/float/foc_velocity.c | 2 ++ industry/foc/foc_utils.c | 2 ++ industry/scpi/Make.defs | 2 ++ industry/scpi/Makefile | 2 ++ 52 files changed, 104 insertions(+), 13 deletions(-) diff --git a/industry/CMakeLists.txt b/industry/CMakeLists.txt index 6d64c327289..0869d77d982 100644 --- a/industry/CMakeLists.txt +++ b/industry/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/industry/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/industry/Make.defs b/industry/Make.defs index 5b68b9ef839..5d2de761826 100644 --- a/industry/Make.defs +++ b/industry/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/industry/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/industry/Makefile b/industry/Makefile index 9f4937e182a..42ed16d6b6e 100644 --- a/industry/Makefile +++ b/industry/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/industry/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/industry/abnt_codi/Make.defs b/industry/abnt_codi/Make.defs index ab30734232b..b220cf63cf1 100644 --- a/industry/abnt_codi/Make.defs +++ b/industry/abnt_codi/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/industry/abnt_codi/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/industry/abnt_codi/Makefile b/industry/abnt_codi/Makefile index 037a87de071..f3b9ee9d93f 100644 --- a/industry/abnt_codi/Makefile +++ b/industry/abnt_codi/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/industry/abnt_codi/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/industry/abnt_codi/abnt_codi.c b/industry/abnt_codi/abnt_codi.c index 260b08e823c..911d8ae29e0 100644 --- a/industry/abnt_codi/abnt_codi.c +++ b/industry/abnt_codi/abnt_codi.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/industry/abnt_codi/abnt_codi.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/industry/foc/CMakeLists.txt b/industry/foc/CMakeLists.txt index e0f1d259243..7331644cd5f 100644 --- a/industry/foc/CMakeLists.txt +++ b/industry/foc/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/industry/foc/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/industry/foc/Make.defs b/industry/foc/Make.defs index 1cf85b299ba..ed25e84f462 100644 --- a/industry/foc/Make.defs +++ b/industry/foc/Make.defs @@ -1,6 +1,7 @@ ############################################################################ # apps/industry/foc/Make.defs -# Adds selected applications to apps/ build +# +# SPDX-License-Identifier: Apache-2.0 # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with diff --git a/industry/foc/Makefile b/industry/foc/Makefile index bdc0efaf850..1c337543501 100644 --- a/industry/foc/Makefile +++ b/industry/foc/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/industry/foc/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/industry/foc/fixed16/foc_align.c b/industry/foc/fixed16/foc_align.c index ab8d9b74efb..d0ad6f8e74e 100644 --- a/industry/foc/fixed16/foc_align.c +++ b/industry/foc/fixed16/foc_align.c @@ -1,6 +1,7 @@ /**************************************************************************** * apps/industry/foc/fixed16/foc_align.c - * This file implements angle sensor alignment routine for fixed16 + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with diff --git a/industry/foc/fixed16/foc_ang_hall.c b/industry/foc/fixed16/foc_ang_hall.c index 27834ff706c..0e2eae9bfd9 100644 --- a/industry/foc/fixed16/foc_ang_hall.c +++ b/industry/foc/fixed16/foc_ang_hall.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/industry/foc/fixed16/foc_ang_hall.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/industry/foc/fixed16/foc_ang_onfo.c b/industry/foc/fixed16/foc_ang_onfo.c index af1d7565fcd..1396846713a 100644 --- a/industry/foc/fixed16/foc_ang_onfo.c +++ b/industry/foc/fixed16/foc_ang_onfo.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/industry/foc/fixed16/foc_ang_onfo.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/industry/foc/fixed16/foc_ang_openloop.c b/industry/foc/fixed16/foc_ang_openloop.c index 8744f2da5a6..9cbb59466b2 100644 --- a/industry/foc/fixed16/foc_ang_openloop.c +++ b/industry/foc/fixed16/foc_ang_openloop.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/industry/foc/fixed16/foc_ang_openloop.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/industry/foc/fixed16/foc_ang_osmo.c b/industry/foc/fixed16/foc_ang_osmo.c index d4c6d3152b4..3a48beb6c38 100644 --- a/industry/foc/fixed16/foc_ang_osmo.c +++ b/industry/foc/fixed16/foc_ang_osmo.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/industry/foc/fixed16/foc_ang_osmo.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/industry/foc/fixed16/foc_ang_qenco.c b/industry/foc/fixed16/foc_ang_qenco.c index 769d242bb8b..bb53a8c42a8 100644 --- a/industry/foc/fixed16/foc_ang_qenco.c +++ b/industry/foc/fixed16/foc_ang_qenco.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/industry/foc/fixed16/foc_ang_qenco.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/industry/foc/fixed16/foc_angle.c b/industry/foc/fixed16/foc_angle.c index d6428acfc8b..0820d47d05f 100644 --- a/industry/foc/fixed16/foc_angle.c +++ b/industry/foc/fixed16/foc_angle.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/industry/foc/fixed16/foc_angle.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/industry/foc/fixed16/foc_cordic.c b/industry/foc/fixed16/foc_cordic.c index 4c08e8212c8..fdd4cc0595b 100644 --- a/industry/foc/fixed16/foc_cordic.c +++ b/industry/foc/fixed16/foc_cordic.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/industry/foc/fixed16/foc_cordic.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/industry/foc/fixed16/foc_feedforward.c b/industry/foc/fixed16/foc_feedforward.c index e45511e52fa..0a3e2fe740e 100644 --- a/industry/foc/fixed16/foc_feedforward.c +++ b/industry/foc/fixed16/foc_feedforward.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/industry/foc/fixed16/foc_feedforward.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/industry/foc/fixed16/foc_handler.c b/industry/foc/fixed16/foc_handler.c index bd338587dcc..12ef7aa5b6b 100644 --- a/industry/foc/fixed16/foc_handler.c +++ b/industry/foc/fixed16/foc_handler.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/industry/foc/fixed16/foc_handler.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/industry/foc/fixed16/foc_ident.c b/industry/foc/fixed16/foc_ident.c index 0ac5bb26b1b..a7b2098a2c3 100644 --- a/industry/foc/fixed16/foc_ident.c +++ b/industry/foc/fixed16/foc_ident.c @@ -1,6 +1,7 @@ /**************************************************************************** * apps/industry/foc/fixed16/foc_ident.c - * This file implements motor ident routine for fixed16 + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with diff --git a/industry/foc/fixed16/foc_model.c b/industry/foc/fixed16/foc_model.c index 2351e0b75b9..6ed52f2b105 100644 --- a/industry/foc/fixed16/foc_model.c +++ b/industry/foc/fixed16/foc_model.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/industry/foc/fixed16/foc_model.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/industry/foc/fixed16/foc_model_pmsm.c b/industry/foc/fixed16/foc_model_pmsm.c index 403093e99bd..0c4c80036be 100644 --- a/industry/foc/fixed16/foc_model_pmsm.c +++ b/industry/foc/fixed16/foc_model_pmsm.c @@ -1,6 +1,7 @@ /**************************************************************************** * apps/industry/foc/fixed16/foc_model_pmsm.c - * This file implements PMSM model for fixed16 + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with diff --git a/industry/foc/fixed16/foc_picontrol.c b/industry/foc/fixed16/foc_picontrol.c index 66ee2652428..97d1c7f3de4 100644 --- a/industry/foc/fixed16/foc_picontrol.c +++ b/industry/foc/fixed16/foc_picontrol.c @@ -1,6 +1,7 @@ /**************************************************************************** * apps/industry/foc/fixed16/foc_picontrol.c - * This file implements classical FOC PI current controller for fixed16 + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with diff --git a/industry/foc/fixed16/foc_ramp.c b/industry/foc/fixed16/foc_ramp.c index 443f021fe5a..282c051a011 100644 --- a/industry/foc/fixed16/foc_ramp.c +++ b/industry/foc/fixed16/foc_ramp.c @@ -1,6 +1,7 @@ /**************************************************************************** * apps/industry/foc/fixed16/foc_ramp.c - * This file implements ramp for fixed16 + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with diff --git a/industry/foc/fixed16/foc_routine.c b/industry/foc/fixed16/foc_routine.c index 0a41e2760c7..faa57fb6912 100644 --- a/industry/foc/fixed16/foc_routine.c +++ b/industry/foc/fixed16/foc_routine.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/industry/foc/fixed16/foc_routine.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/industry/foc/fixed16/foc_svm3.c b/industry/foc/fixed16/foc_svm3.c index 649ea241964..1521b30a813 100644 --- a/industry/foc/fixed16/foc_svm3.c +++ b/industry/foc/fixed16/foc_svm3.c @@ -1,6 +1,7 @@ /**************************************************************************** * apps/industry/foc/fixed16/foc_svm3.c - * This file implements 3-phase space vector modulation for fixed16 + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with diff --git a/industry/foc/fixed16/foc_vel_odiv.c b/industry/foc/fixed16/foc_vel_odiv.c index a5460fa1d3f..4cdf13d559c 100644 --- a/industry/foc/fixed16/foc_vel_odiv.c +++ b/industry/foc/fixed16/foc_vel_odiv.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/industry/foc/fixed16/foc_vel_odiv.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/industry/foc/fixed16/foc_vel_opll.c b/industry/foc/fixed16/foc_vel_opll.c index 36abdd56a86..eecbe40d8bf 100644 --- a/industry/foc/fixed16/foc_vel_opll.c +++ b/industry/foc/fixed16/foc_vel_opll.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/industry/foc/fixed16/foc_vel_opll.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/industry/foc/fixed16/foc_velocity.c b/industry/foc/fixed16/foc_velocity.c index 74d34454cd2..c6f4af8a267 100644 --- a/industry/foc/fixed16/foc_velocity.c +++ b/industry/foc/fixed16/foc_velocity.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/industry/foc/fixed16/foc_velocity.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/industry/foc/float/foc_align.c b/industry/foc/float/foc_align.c index ffd6a7bb5ed..957e0083fb9 100644 --- a/industry/foc/float/foc_align.c +++ b/industry/foc/float/foc_align.c @@ -1,6 +1,7 @@ /**************************************************************************** * apps/industry/foc/float/foc_align.c - * This file implements angle sensor alignment routine for float32 + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with diff --git a/industry/foc/float/foc_ang_hall.c b/industry/foc/float/foc_ang_hall.c index b69023a13cf..130a77f95e7 100644 --- a/industry/foc/float/foc_ang_hall.c +++ b/industry/foc/float/foc_ang_hall.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/industry/foc/float/foc_ang_hall.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/industry/foc/float/foc_ang_onfo.c b/industry/foc/float/foc_ang_onfo.c index 665eba8320e..c00c826f6b0 100644 --- a/industry/foc/float/foc_ang_onfo.c +++ b/industry/foc/float/foc_ang_onfo.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/industry/foc/float/foc_ang_onfo.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/industry/foc/float/foc_ang_openloop.c b/industry/foc/float/foc_ang_openloop.c index d33f3016967..a8815319c79 100644 --- a/industry/foc/float/foc_ang_openloop.c +++ b/industry/foc/float/foc_ang_openloop.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/industry/foc/float/foc_ang_openloop.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/industry/foc/float/foc_ang_osmo.c b/industry/foc/float/foc_ang_osmo.c index 4d31a399cf5..e509c12e979 100644 --- a/industry/foc/float/foc_ang_osmo.c +++ b/industry/foc/float/foc_ang_osmo.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/industry/foc/float/foc_ang_osmo.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/industry/foc/float/foc_ang_qenco.c b/industry/foc/float/foc_ang_qenco.c index 9b6b436d285..44395dfd2bd 100644 --- a/industry/foc/float/foc_ang_qenco.c +++ b/industry/foc/float/foc_ang_qenco.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/industry/foc/float/foc_ang_qenco.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/industry/foc/float/foc_angle.c b/industry/foc/float/foc_angle.c index 05f4db16ff7..78bde639ab3 100644 --- a/industry/foc/float/foc_angle.c +++ b/industry/foc/float/foc_angle.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/industry/foc/float/foc_angle.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/industry/foc/float/foc_cordic.c b/industry/foc/float/foc_cordic.c index d66e6bc7b1c..f53c056744f 100644 --- a/industry/foc/float/foc_cordic.c +++ b/industry/foc/float/foc_cordic.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/industry/foc/float/foc_cordic.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/industry/foc/float/foc_feedforward.c b/industry/foc/float/foc_feedforward.c index d6da4c53b95..922696fdd5d 100644 --- a/industry/foc/float/foc_feedforward.c +++ b/industry/foc/float/foc_feedforward.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/industry/foc/float/foc_feedforward.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/industry/foc/float/foc_handler.c b/industry/foc/float/foc_handler.c index 6c3da8330be..c4496943970 100644 --- a/industry/foc/float/foc_handler.c +++ b/industry/foc/float/foc_handler.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/industry/foc/float/foc_handler.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/industry/foc/float/foc_ident.c b/industry/foc/float/foc_ident.c index 53f5b7b06df..3713e8d44d2 100644 --- a/industry/foc/float/foc_ident.c +++ b/industry/foc/float/foc_ident.c @@ -1,6 +1,7 @@ /**************************************************************************** * apps/industry/foc/float/foc_ident.c - * This file implements motor ident routine for float32 + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with diff --git a/industry/foc/float/foc_model.c b/industry/foc/float/foc_model.c index 97e0b2a865a..3587b969926 100644 --- a/industry/foc/float/foc_model.c +++ b/industry/foc/float/foc_model.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/industry/foc/float/foc_model.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/industry/foc/float/foc_model_pmsm.c b/industry/foc/float/foc_model_pmsm.c index 072180da54e..a4eee53775e 100644 --- a/industry/foc/float/foc_model_pmsm.c +++ b/industry/foc/float/foc_model_pmsm.c @@ -1,6 +1,7 @@ /**************************************************************************** * apps/industry/foc/float/foc_model_pmsm.c - * This file implements PMSM model for fixed16 + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with diff --git a/industry/foc/float/foc_picontrol.c b/industry/foc/float/foc_picontrol.c index b99a8e741e6..ee7964654a1 100644 --- a/industry/foc/float/foc_picontrol.c +++ b/industry/foc/float/foc_picontrol.c @@ -1,6 +1,7 @@ /**************************************************************************** * apps/industry/foc/float/foc_picontrol.c - * This file implements classical FOC PI current controller for float32 + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with diff --git a/industry/foc/float/foc_ramp.c b/industry/foc/float/foc_ramp.c index ead70275210..e65d0696360 100644 --- a/industry/foc/float/foc_ramp.c +++ b/industry/foc/float/foc_ramp.c @@ -1,6 +1,7 @@ /**************************************************************************** * apps/industry/foc/float/foc_ramp.c - * This file implements ramp for float32 + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with diff --git a/industry/foc/float/foc_routine.c b/industry/foc/float/foc_routine.c index 2e608137918..0f604e4fdf7 100644 --- a/industry/foc/float/foc_routine.c +++ b/industry/foc/float/foc_routine.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/industry/foc/float/foc_routine.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/industry/foc/float/foc_svm3.c b/industry/foc/float/foc_svm3.c index 9c812e73488..5ba84116674 100644 --- a/industry/foc/float/foc_svm3.c +++ b/industry/foc/float/foc_svm3.c @@ -1,6 +1,7 @@ /**************************************************************************** * apps/industry/foc/float/foc_svm3.c - * This file implements 3-phase space vector modulation for float32 + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with diff --git a/industry/foc/float/foc_vel_odiv.c b/industry/foc/float/foc_vel_odiv.c index dfb8d820f5a..3ba70cbf101 100644 --- a/industry/foc/float/foc_vel_odiv.c +++ b/industry/foc/float/foc_vel_odiv.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/industry/foc/float/foc_vel_odiv.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/industry/foc/float/foc_vel_opll.c b/industry/foc/float/foc_vel_opll.c index a18b6675c4c..b15ffcb359e 100644 --- a/industry/foc/float/foc_vel_opll.c +++ b/industry/foc/float/foc_vel_opll.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/industry/foc/float/foc_vel_opll.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/industry/foc/float/foc_velocity.c b/industry/foc/float/foc_velocity.c index 0ffad5c5435..ba81a5e8ab5 100644 --- a/industry/foc/float/foc_velocity.c +++ b/industry/foc/float/foc_velocity.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/industry/foc/float/foc_velocity.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/industry/foc/foc_utils.c b/industry/foc/foc_utils.c index 27838f8e602..7e650577ace 100644 --- a/industry/foc/foc_utils.c +++ b/industry/foc/foc_utils.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/industry/foc/foc_utils.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/industry/scpi/Make.defs b/industry/scpi/Make.defs index 6ddfe132f57..f7e67a8469b 100644 --- a/industry/scpi/Make.defs +++ b/industry/scpi/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/industry/scpi/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/industry/scpi/Makefile b/industry/scpi/Makefile index 730bc28c7b3..c86267297ec 100644 --- a/industry/scpi/Makefile +++ b/industry/scpi/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/industry/scpi/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The From 9500938d44e4291d3cdcfd8902696505e347c764 Mon Sep 17 00:00:00 2001 From: Alan Carvalho de Assis Date: Thu, 19 Dec 2024 13:22:03 -0300 Subject: [PATCH 075/391] testing/sensortest: Add support to Speed Sensors Signed-off-by: Alan C. Assis --- testing/sensortest/sensortest.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/testing/sensortest/sensortest.c b/testing/sensortest/sensortest.c index ca309aa19e8..fb97108f375 100644 --- a/testing/sensortest/sensortest.c +++ b/testing/sensortest/sensortest.c @@ -68,6 +68,7 @@ static void print_valb(FAR const char *buffer, FAR const char *name); static void print_vali2(FAR const char *buffer, FAR const char *name); static void print_ecg(FAR const char *buffer, FAR const char *name); static void print_force(FAR const char *buffer, FAR const char *name); +static void print_velocity(FAR const char *buffer, FAR const char *name); static void print_ppgd(FAR const char *buffer, FAR const char *name); static void print_ppgq(FAR const char *buffer, FAR const char *name); static void print_cap(FAR const char *buffer, FAR const char *name); @@ -113,6 +114,8 @@ static const struct sensor_info g_sensor_info[] = {print_ppgq, sizeof(struct sensor_ppgq), "ppgq"}, {print_valf, sizeof(struct sensor_prox), "prox"}, {print_valf3, sizeof(struct sensor_rgb), "rgb"}, + {print_velocity, + sizeof(struct sensor_velocity), "velocity"}, {print_valf, sizeof(struct sensor_temp), "temp"}, {print_valf, sizeof(struct sensor_tvoc), "tvoc"}, {print_valf, sizeof(struct sensor_uv), "uv"} @@ -237,6 +240,15 @@ static void print_gnss_satellite(FAR const char *buffer, name, event->timestamp, event->count, event->satellites); } +static void print_velocity(const char *buffer, const char *name) +{ + FAR struct sensor_velocity *event = + (FAR struct sensor_velocity *)buffer; + + printf("%s: timestamp:%" PRIu64 " value:%.2f\n", + name, event->timestamp, event->velocity); +} + static void usage(void) { printf("sensortest [arguments...] \n"); From ba0a8fbcb2f6d17c3c2afa78c760e25898e1c753 Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Mon, 16 Dec 2024 21:39:06 +0800 Subject: [PATCH 076/391] uORB/sensor: Add carrier frequency for GNSS Satellite The `struct sensor_gnss_satellite.cf` may be parsed from `GSV.signal_id`(e.g. NMEA 0183 v4.11) and `struct sensor_gnss_satellite.constellation` Signed-off-by: wangjianyu3 --- system/uorb/sensor/gnss.c | 1 + 1 file changed, 1 insertion(+) diff --git a/system/uorb/sensor/gnss.c b/system/uorb/sensor/gnss.c index d3ba1f4a54a..df97b77b645 100644 --- a/system/uorb/sensor/gnss.c +++ b/system/uorb/sensor/gnss.c @@ -69,6 +69,7 @@ static const char sensor_gnss_measurement_format[] = static const char sensor_gnss_satellite_format[] = "timestamp:%" PRIu64 ",count:%" PRIu32 ",satellites:%" PRIu32 "," "constellation:%" PRIu32 "" + ",cf:%hf" SENSOR_GNSS_SATELLITE_INFO_FORMAT(0) SENSOR_GNSS_SATELLITE_INFO_FORMAT(1) SENSOR_GNSS_SATELLITE_INFO_FORMAT(2) From d02b05328a7c16dbc97dc01fefd8d5f24b4cbc97 Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Mon, 16 Dec 2024 21:45:18 +0800 Subject: [PATCH 077/391] uORB/sensor: Update macro of sensor_gnss format string Make it easier to extend the format of struct member Signed-off-by: wangjianyu3 --- system/uorb/sensor/gnss.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/system/uorb/sensor/gnss.c b/system/uorb/sensor/gnss.c index df97b77b645..00ffcd33911 100644 --- a/system/uorb/sensor/gnss.c +++ b/system/uorb/sensor/gnss.c @@ -29,10 +29,21 @@ ****************************************************************************/ #ifdef CONFIG_DEBUG_UORB -#define UORB_DEBUG_FORMAT_SENSOR_GNSS \ - "timestamp:%" PRIu64 ",time_utc:%" PRIu64 ",latitude:%hf,longitude:%hf," \ - "altitude:%hf,altitude_ellipsoid:%hf,eph:%hf,epv:%hf,hdop:%hf,pdop:%hf," \ - "vdop:%hf,ground_speed:%hf,course:%hf,satellites_used:%" PRIu32 "" +#define UORB_DEBUG_FORMAT_SENSOR_GNSS \ + "timestamp:%" PRIu64 \ + ",time_utc:%" PRIu64 \ + ",latitude:%hf" \ + ",longitude:%hf" \ + ",altitude:%hf" \ + ",altitude_ellipsoid:%hf" \ + ",eph:%hf" \ + ",epv:%hf" \ + ",hdop:%hf" \ + ",pdop:%hf" \ + ",vdop:%hf" \ + ",ground_speed:%hf" \ + ",course:%hf" \ + ",satellites_used:%" PRIu32 "" #define SENSOR_GNSS_SATELLITE_INFO_FORMAT(idx) \ ",svid" #idx ":%" PRIu32 \ From a0479c86fba16915e7c6e82ab64427c0dc647ad6 Mon Sep 17 00:00:00 2001 From: Eren Terzioglu Date: Tue, 17 Dec 2024 13:35:00 +0100 Subject: [PATCH 078/391] tools: Add debug_info target to diagnostic system --- tools/parse_sysinfo.py | 135 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 tools/parse_sysinfo.py diff --git a/tools/parse_sysinfo.py b/tools/parse_sysinfo.py new file mode 100644 index 00000000000..428c1ac095e --- /dev/null +++ b/tools/parse_sysinfo.py @@ -0,0 +1,135 @@ +#!/usr/bin/env python3 + +import argparse +import os +import re +import sys + + +def parse_information_from_header(file_path): + """ + Parses the file that contains information about the host system + and NuttX configuration(sysinfo.h). + + Args: + file_path (str): Path of the file to parse. + + Returns: + dict: The contents parsed from file_path (sysinfo.h) header file. + """ + + VARIABLE_NAMES_REGEX = r"static\s+const\s+char\s+\**([A-Za-z0-9_]+)\s*" + VARIABLE_VALUES_REGEX = r'"([^"]*)"|{([^}]+)};' + result = {} + var_name_to_print_dict = { + "NUTTX_CFLAGS": "NuttX CFLAGS", + "NUTTX_CXXFLAGS": "NuttX CXXFLAGS", + "NUTTX_LDFLAGS": "NuttX LDFLAGS", + "NUTTX_CONFIG": "NuttX configuration options", + "SYSTEM_PATH": "Host system PATH", + "OS_VERSION": "Host system OS", + "INSTALLED_PACKAGES": "Host system installed packages", + "PYTHON_MODULES": "Host system installed python modules", + "ESPRESSIF_BOOTLOADER": "Espressif specific information:\n\nToolchain version", + "ESPRESSIF_TOOLCHAIN": "Toolchain version", + "ESPRESSIF_ESPTOOL": "Esptool version", + "ESPRESSIF_HAL": "HAL version", + "ESPRESSIF_CHIP_ID": "CHIP ID", + "ESPRESSIF_FLASH_ID": "Flash ID", + "ESPRESSIF_SECURITY_INFO": "Security information", + "ESPRESSIF_FLASH_STAT": "Flash status", + "ESPRESSIF_MAC_ADDR": "MAC address", + } + + # Regular expression pattern to match array definition + + keys_pattern = re.compile(VARIABLE_NAMES_REGEX, re.DOTALL) + values_pattern = re.compile(VARIABLE_VALUES_REGEX, re.DOTALL) + + with open(file_path, "r") as file: + content = file.read() + + # Match array definition using the regex + + keys_array = keys_pattern.findall(content) + values_array = values_pattern.findall(content) + + # Process values to print it prettier + + for i in range(len(values_array)): + tmp_list = [] + for y in range(len(values_array[i])): + tmp_str = values_array[i][y] + tmp_str = tmp_str.replace('"', "") + tmp_str = tmp_str.replace("\n ", "", 1) + tmp_str = tmp_str.replace(",", "") + + if tmp_str != "": + tmp_list.append(tmp_str) + + values_array[i] = tuple(tmp_list) + + keys_values_to_return = [var_name_to_print_dict[x] for x in keys_array] + result = dict(zip(keys_values_to_return, values_array)) + + return result + + +# Main # + + +if __name__ == "__main__": + """ + Main function for the script. This function is called when the script is + executed directly. It prints the output generated to stdout. + + Required arguments: + nuttx_path: The path to the NuttX source directory. + + Optional arguments: + The command line arguments. The available arguments are: + -h, --help: + Show the help message and exit. + -f, --file : + Provide the diagnostic file output(sysinfo.h). + """ + + # Generic arguments + + parser = argparse.ArgumentParser(add_help=False) + parser.add_argument("nuttx_path", help="NuttX source directory path.") + parser.add_argument( + "-h", + "--help", + action="help", + default=argparse.SUPPRESS, + help="Show this help message and exit.", + ) + parser.add_argument( + "-f", + "--file", + default="", + metavar=("SYSINFO_FILE"), + help="Provide the diagnostic file output(sysinfo.h).", + ) + # Parse arguments + + if len(sys.argv) == 1: + parser.print_help() + sys.exit(1) + + args = parser.parse_args() + os.chdir(args.nuttx_path) + + parsed_data = parse_information_from_header(args.file) + + # Print the extracted name and values + + if parsed_data: + for each_key in parsed_data.keys(): + print("{}:".format(each_key)) + for each_value in parsed_data[each_key]: + print(" {}".format(each_value)) + print("") + else: + print("No matching array found.") From 82ee1ffbd63230fdec0f3e24c7410fc22eeaf0f7 Mon Sep 17 00:00:00 2001 From: Eren Terzioglu Date: Thu, 19 Dec 2024 09:20:26 +0100 Subject: [PATCH 079/391] system/nxdiag: Make espressif specific option appear when espressif devices selected --- system/nxdiag/Kconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/system/nxdiag/Kconfig b/system/nxdiag/Kconfig index e9d16d425fa..22f17e5736d 100644 --- a/system/nxdiag/Kconfig +++ b/system/nxdiag/Kconfig @@ -70,12 +70,14 @@ comment "Vendor specific information" config SYSTEM_NXDIAG_ESPRESSIF bool "Espressif" + depends on ARCH_CHIP_ESP32 || ARCH_CHIP_ESP32S2 || ARCH_CHIP_ESP32S3 || ARCH_CHIP_ESP32C3 || ARCH_CHIP_ESP32C6 || ARCH_CHIP_ESP32H2 default n ---help--- Enable Espressif-specific information and checks. config SYSTEM_NXDIAG_ESPRESSIF_CHIP bool "Espressif Chip" + depends on ARCH_CHIP_ESP32 || ARCH_CHIP_ESP32S2 || ARCH_CHIP_ESP32S3 || ARCH_CHIP_ESP32C3 || ARCH_CHIP_ESP32C6 || ARCH_CHIP_ESP32H2 default n ---help--- Enable Espressif-specific information about chip. Chip must be connected during build process. From be38e77de373062dcdf49bc422243fff3ced7fdf Mon Sep 17 00:00:00 2001 From: Alin Jerpelea Date: Fri, 20 Dec 2024 02:49:33 +0100 Subject: [PATCH 080/391] inertial: migrate to SPDX identifier Most tools used for compliance and SBOM generation use SPDX identifiers This change brings us a step closer to an easy SBOM generation. Signed-off-by: Alin Jerpelea --- inertial/CMakeLists.txt | 2 ++ inertial/Make.defs | 2 ++ inertial/Makefile | 2 ++ inertial/madgwick/Make.defs | 2 ++ inertial/madgwick/Makefile | 2 ++ 5 files changed, 10 insertions(+) diff --git a/inertial/CMakeLists.txt b/inertial/CMakeLists.txt index fb213b9eebc..66cfc9e2738 100644 --- a/inertial/CMakeLists.txt +++ b/inertial/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/inertial/CMakeLists.txt # +# SPDX-License-Identifier: BSD-3-Clause +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/inertial/Make.defs b/inertial/Make.defs index 03113ac85de..d19af339753 100644 --- a/inertial/Make.defs +++ b/inertial/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/inertial/Make.defs # +# SPDX-License-Identifier: BSD-3-Clause +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/inertial/Makefile b/inertial/Makefile index e05b10cd28d..e12c1d62347 100644 --- a/inertial/Makefile +++ b/inertial/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/inertial/Makefile # +# SPDX-License-Identifier: BSD-3-Clause +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/inertial/madgwick/Make.defs b/inertial/madgwick/Make.defs index 814fb83af50..e16d25d84eb 100644 --- a/inertial/madgwick/Make.defs +++ b/inertial/madgwick/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/inertial/madgwick/Make.defs # +# SPDX-License-Identifier: BSD-3-Clause +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/inertial/madgwick/Makefile b/inertial/madgwick/Makefile index 936d28219f8..38dac5227b1 100644 --- a/inertial/madgwick/Makefile +++ b/inertial/madgwick/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/inertial/madgwick/Makefile # +# SPDX-License-Identifier: BSD-3-Clause +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The From d3102f0dcef047a760e22202d042d17fc3082845 Mon Sep 17 00:00:00 2001 From: Alin Jerpelea Date: Fri, 20 Dec 2024 03:49:25 +0100 Subject: [PATCH 081/391] interpreters: migrate to SPDX identifier Most tools used for compliance and SBOM generation use SPDX identifiers This change brings us a step closer to an easy SBOM generation. Signed-off-by: Alin Jerpelea --- interpreters/CMakeLists.txt | 2 + interpreters/Make.defs | 2 + interpreters/Makefile | 2 + interpreters/bas/CMakeLists.txt | 2 + interpreters/bas/Make.defs | 2 + interpreters/bas/Makefile | 2 + interpreters/bas/bas.c | 3 +- interpreters/bas/bas.h | 3 +- interpreters/bas/bas_auto.c | 4 +- interpreters/bas/bas_auto.h | 3 +- interpreters/bas/bas_autotypes.h | 3 +- interpreters/bas/bas_error.h | 3 +- interpreters/bas/bas_fs.c | 4 +- interpreters/bas/bas_fs.h | 3 +- interpreters/bas/bas_global.c | 4 +- interpreters/bas/bas_global.h | 3 +- interpreters/bas/bas_main.c | 3 +- interpreters/bas/bas_program.c | 4 +- interpreters/bas/bas_program.h | 3 +- interpreters/bas/bas_programtypes.h | 3 +- interpreters/bas/bas_statement.c | 3 +- interpreters/bas/bas_statement.h | 3 +- interpreters/bas/bas_str.c | 4 +- interpreters/bas/bas_str.h | 3 +- interpreters/bas/bas_token.c | 21 ++++++++ interpreters/bas/bas_token.h | 3 +- interpreters/bas/bas_token.l | 22 ++++++++ interpreters/bas/bas_value.c | 3 +- interpreters/bas/bas_value.h | 3 +- interpreters/bas/bas_var.c | 3 +- interpreters/bas/bas_var.h | 3 +- interpreters/bas/bas_vt100.c | 2 + interpreters/bas/bas_vt100.h | 2 + interpreters/duktape/Make.defs | 2 + interpreters/duktape/Makefile | 2 + interpreters/ficl/Make.defs | 2 + interpreters/ficl/Makefile | 2 + interpreters/ficl/configure.sh | 22 ++++++++ interpreters/ficl/src/nuttx.c | 50 ++++++++----------- interpreters/ficl/src/nuttx.h | 2 + interpreters/lua/CMakeLists.txt | 2 + interpreters/lua/Make.defs | 2 + interpreters/lua/Makefile | 2 + interpreters/lua/Module.mk | 2 + interpreters/lua/nuttx_linit.c | 2 + .../luajit/0001-luajit-armv7m-nuttx.patch | 6 +-- interpreters/luajit/Make.defs | 2 + interpreters/luajit/Makefile | 2 + interpreters/luamodules/CMakeLists.txt | 2 + interpreters/luamodules/Make.defs | 2 + interpreters/luamodules/Makefile | 2 + interpreters/luamodules/cjson/Make.defs | 2 + interpreters/luamodules/cjson/Makefile | 2 + interpreters/luamodules/lfs/Make.defs | 2 + interpreters/luamodules/lfs/Makefile | 2 + .../luamodules/luasyslog/CMakeLists.txt | 2 + interpreters/luamodules/luasyslog/Make.defs | 2 + interpreters/luamodules/luasyslog/Makefile | 2 + interpreters/luamodules/luv/Make.defs | 2 + interpreters/luamodules/luv/Makefile | 2 + interpreters/minibasic/CMakeLists.txt | 2 + interpreters/minibasic/Make.defs | 2 + interpreters/minibasic/Makefile | 2 + interpreters/minibasic/basic.c | 50 ++++++++----------- interpreters/minibasic/script.c | 49 ++++++++---------- interpreters/python/Make.defs | 2 + interpreters/python/Makefile | 2 + interpreters/python/mount_modules.c | 2 + interpreters/quickjs/CMakeLists.txt | 2 + interpreters/quickjs/Make.defs | 2 + interpreters/quickjs/Makefile | 2 + interpreters/quickjs/qjsmini.c | 2 + interpreters/toywasm/Make.defs | 2 + interpreters/toywasm/Makefile | 2 + interpreters/toywasm/include/toywasm_config.h | 2 + .../toywasm/include/toywasm_version.h | 2 + interpreters/toywasm/regen.sh | 21 ++++++++ interpreters/toywasm/src/toywasm_config.c | 2 + interpreters/toywasm/tmpl/c-sections.in | 20 ++++++++ interpreters/toywasm/tmpl/license.in | 2 +- interpreters/wamr/CMakeLists.txt | 2 + interpreters/wamr/Make.defs | 2 + interpreters/wamr/Makefile | 2 + interpreters/wamr/Module.mk | 2 + interpreters/wamr/Toolchain.defs | 2 + interpreters/wamr/wamr_custom_init.c | 2 + interpreters/wasm3/Make.defs | 2 + interpreters/wasm3/Makefile | 2 + 88 files changed, 328 insertions(+), 119 deletions(-) diff --git a/interpreters/CMakeLists.txt b/interpreters/CMakeLists.txt index 3141c68123f..94592ab058a 100644 --- a/interpreters/CMakeLists.txt +++ b/interpreters/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/interpreters/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/interpreters/Make.defs b/interpreters/Make.defs index 0ead58c3b37..64c220bbd47 100644 --- a/interpreters/Make.defs +++ b/interpreters/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/interpreters/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/interpreters/Makefile b/interpreters/Makefile index ec2e50c1cfb..63f027808ca 100644 --- a/interpreters/Makefile +++ b/interpreters/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/interpreters/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/interpreters/bas/CMakeLists.txt b/interpreters/bas/CMakeLists.txt index 18aa8cfc259..86219418a90 100644 --- a/interpreters/bas/CMakeLists.txt +++ b/interpreters/bas/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/interpreters/bas/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/interpreters/bas/Make.defs b/interpreters/bas/Make.defs index 6cf5db783c4..e17fec9a6c3 100644 --- a/interpreters/bas/Make.defs +++ b/interpreters/bas/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/interpreters/bas/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/interpreters/bas/Makefile b/interpreters/bas/Makefile index 55edb4d70d7..332cb17dfde 100644 --- a/interpreters/bas/Makefile +++ b/interpreters/bas/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/interpreters/bas/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/interpreters/bas/bas.c b/interpreters/bas/bas.c index 46a5c85df61..3ccaea3b9d8 100644 --- a/interpreters/bas/bas.c +++ b/interpreters/bas/bas.c @@ -1,7 +1,8 @@ /**************************************************************************** * apps/interpreters/bas/bas.c * - * Copyright (c) 1999-2014 Michael Haardt + * SPDX-License-Identifier: MIT + * SPDX-FileCopyrightText: 1999-2014 Michael Haardt * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), diff --git a/interpreters/bas/bas.h b/interpreters/bas/bas.h index 4373ad7ad66..eb4890d5066 100644 --- a/interpreters/bas/bas.h +++ b/interpreters/bas/bas.h @@ -1,7 +1,8 @@ /**************************************************************************** * apps/interpreters/bas/bas.h * - * Copyright (c) 1999-2014 Michael Haardt + * SPDX-License-Identifier: MIT + * SPDX-FileCopyrightText: 1999-2014 Michael Haardt * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), diff --git a/interpreters/bas/bas_auto.c b/interpreters/bas/bas_auto.c index 13f4222a088..25d14a6cd92 100644 --- a/interpreters/bas/bas_auto.c +++ b/interpreters/bas/bas_auto.c @@ -1,8 +1,8 @@ /**************************************************************************** * apps/interpreters/bas/bas_auto.c - * BASIC file system interface. * - * Copyright (c) 1999-2014 Michael Haardt + * SPDX-License-Identifier: MIT + * SPDX-FileCopyrightText: 1999-2014 Michael Haardt * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), diff --git a/interpreters/bas/bas_auto.h b/interpreters/bas/bas_auto.h index d608a575fb1..4aaa6878b55 100644 --- a/interpreters/bas/bas_auto.h +++ b/interpreters/bas/bas_auto.h @@ -1,7 +1,8 @@ /**************************************************************************** * apps/interpreters/bas/bas_auto.h * - * Copyright (c) 1999-2014 Michael Haardt + * SPDX-License-Identifier: MIT + * SPDX-FileCopyrightText: 1999-2014 Michael Haardt * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), diff --git a/interpreters/bas/bas_autotypes.h b/interpreters/bas/bas_autotypes.h index ac08d144fc9..b1dd547b910 100644 --- a/interpreters/bas/bas_autotypes.h +++ b/interpreters/bas/bas_autotypes.h @@ -1,7 +1,8 @@ /**************************************************************************** * apps/interpreters/bas/bas_autotypes.h * - * Copyright (c) 1999-2014 Michael Haardt + * SPDX-License-Identifier: MIT + * SPDX-FileCopyrightText: 1999-2014 Michael Haardt * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), diff --git a/interpreters/bas/bas_error.h b/interpreters/bas/bas_error.h index 0d2697aeb46..58fe4dd2ddd 100644 --- a/interpreters/bas/bas_error.h +++ b/interpreters/bas/bas_error.h @@ -1,7 +1,8 @@ /**************************************************************************** * apps/interpreters/bas/bas_error.h * - * Copyright (c) 1999-2014 Michael Haardt + * SPDX-License-Identifier: MIT + * SPDX-FileCopyrightText: 1999-2014 Michael Haardt * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), diff --git a/interpreters/bas/bas_fs.c b/interpreters/bas/bas_fs.c index 1d0863bbe9e..199f41bb94d 100644 --- a/interpreters/bas/bas_fs.c +++ b/interpreters/bas/bas_fs.c @@ -1,8 +1,8 @@ /**************************************************************************** * apps/interpreters/bas/bas_fs.c - * BASIC file system interface. * - * Copyright (c) 1999-2014 Michael Haardt + * SPDX-License-Identifier: MIT + * SPDX-FileCopyrightText: 1999-2014 Michael Haardt * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), diff --git a/interpreters/bas/bas_fs.h b/interpreters/bas/bas_fs.h index 54ffb22e5db..38ddb155305 100644 --- a/interpreters/bas/bas_fs.h +++ b/interpreters/bas/bas_fs.h @@ -1,7 +1,8 @@ /**************************************************************************** * apps/interpreters/bas/bas_fs.h * - * Copyright (c) 1999-2014 Michael Haardt + * SPDX-License-Identifier: MIT + * SPDX-FileCopyrightText: 1999-2014 Michael Haardt * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), diff --git a/interpreters/bas/bas_global.c b/interpreters/bas/bas_global.c index ef5b682cd29..480ac47db52 100644 --- a/interpreters/bas/bas_global.c +++ b/interpreters/bas/bas_global.c @@ -1,8 +1,8 @@ /**************************************************************************** * apps/interpreters/bas/bas_global.c - * Global variables and functions. * - * Copyright (c) 1999-2014 Michael Haardt + * SPDX-License-Identifier: MIT + * SPDX-FileCopyrightText: 1999-2014 Michael Haardt * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), diff --git a/interpreters/bas/bas_global.h b/interpreters/bas/bas_global.h index 197c51bc6f5..f51aae78dd9 100644 --- a/interpreters/bas/bas_global.h +++ b/interpreters/bas/bas_global.h @@ -1,7 +1,8 @@ /**************************************************************************** * apps/interpreters/bas/bas_global.h * - * Copyright (c) 1999-2014 Michael Haardt + * SPDX-License-Identifier: MIT + * SPDX-FileCopyrightText: 1999-2014 Michael Haardt * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), diff --git a/interpreters/bas/bas_main.c b/interpreters/bas/bas_main.c index 986ac1d2f33..4bb2d0f12de 100644 --- a/interpreters/bas/bas_main.c +++ b/interpreters/bas/bas_main.c @@ -1,7 +1,8 @@ /**************************************************************************** * apps/interpreters/bas/bas_main.c * - * Copyright (c) 1999-2014 Michael Haardt + * SPDX-License-Identifier: MIT + * SPDX-FileCopyrightText: 1999-2014 Michael Haardt * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), diff --git a/interpreters/bas/bas_program.c b/interpreters/bas/bas_program.c index 51fda65bd1c..4d281da630b 100644 --- a/interpreters/bas/bas_program.c +++ b/interpreters/bas/bas_program.c @@ -1,8 +1,8 @@ /**************************************************************************** * apps/interpreters/bas/bas_program.c - * Program storage. * - * Copyright (c) 1999-2014 Michael Haardt + * SPDX-License-Identifier: MIT + * SPDX-FileCopyrightText: 1999-2014 Michael Haardt * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), diff --git a/interpreters/bas/bas_program.h b/interpreters/bas/bas_program.h index 3243e1023b4..712918af927 100644 --- a/interpreters/bas/bas_program.h +++ b/interpreters/bas/bas_program.h @@ -1,7 +1,8 @@ /**************************************************************************** * apps/interpreters/bas/bas_program.h * - * Copyright (c) 1999-2014 Michael Haardt + * SPDX-License-Identifier: MIT + * SPDX-FileCopyrightText: 1999-2014 Michael Haardt * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), diff --git a/interpreters/bas/bas_programtypes.h b/interpreters/bas/bas_programtypes.h index 9174f6595ed..d328f58193e 100644 --- a/interpreters/bas/bas_programtypes.h +++ b/interpreters/bas/bas_programtypes.h @@ -1,7 +1,8 @@ /**************************************************************************** * apps/interpreters/bas/bas_programtypes.h * - * Copyright (c) 1999-2014 Michael Haardt + * SPDX-License-Identifier: MIT + * SPDX-FileCopyrightText: 1999-2014 Michael Haardt * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), diff --git a/interpreters/bas/bas_statement.c b/interpreters/bas/bas_statement.c index 5172bdfb3ab..b95a38a3c08 100644 --- a/interpreters/bas/bas_statement.c +++ b/interpreters/bas/bas_statement.c @@ -1,7 +1,8 @@ /**************************************************************************** * apps/interpreters/bas/bas_statement.c * - * Copyright (c) 1999-2014 Michael Haardt + * SPDX-License-Identifier: MIT + * SPDX-FileCopyrightText: 1999-2014 Michael Haardt * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), diff --git a/interpreters/bas/bas_statement.h b/interpreters/bas/bas_statement.h index 3421aab14c3..5b1fe9fcd48 100644 --- a/interpreters/bas/bas_statement.h +++ b/interpreters/bas/bas_statement.h @@ -1,7 +1,8 @@ /**************************************************************************** * apps/interpreters/bas/statement.h * - * Copyright (c) 1999-2014 Michael Haardt + * SPDX-License-Identifier: MIT + * SPDX-FileCopyrightText: 1999-2014 Michael Haardt * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), diff --git a/interpreters/bas/bas_str.c b/interpreters/bas/bas_str.c index 421a10e7989..1c68982dd0a 100644 --- a/interpreters/bas/bas_str.c +++ b/interpreters/bas/bas_str.c @@ -1,8 +1,8 @@ /**************************************************************************** * apps/interpreters/bas/bas_str.c - * Dynamic strings. * - * Copyright (c) 1999-2014 Michael Haardt + * SPDX-License-Identifier: MIT + * SPDX-FileCopyrightText: 1999-2014 Michael Haardt * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), diff --git a/interpreters/bas/bas_str.h b/interpreters/bas/bas_str.h index c9a49395a09..e70fe8711b0 100644 --- a/interpreters/bas/bas_str.h +++ b/interpreters/bas/bas_str.h @@ -1,7 +1,8 @@ /**************************************************************************** * apps/interpreters/bas/bas_str.h * - * Copyright (c) 1999-2014 Michael Haardt + * SPDX-License-Identifier: MIT + * SPDX-FileCopyrightText: 1999-2014 Michael Haardt * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), diff --git a/interpreters/bas/bas_token.c b/interpreters/bas/bas_token.c index 51448a01845..f4c2fbd2663 100644 --- a/interpreters/bas/bas_token.c +++ b/interpreters/bas/bas_token.c @@ -1,3 +1,24 @@ +/**************************************************************************** + * apps/interpreters/bas/bas_token.c + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ #line 3 "" diff --git a/interpreters/bas/bas_token.h b/interpreters/bas/bas_token.h index ffe3fc4cd3b..7cb15d3a3f9 100644 --- a/interpreters/bas/bas_token.h +++ b/interpreters/bas/bas_token.h @@ -1,7 +1,8 @@ /**************************************************************************** * apps/interpreters/bas/bas_token.h * - * Copyright (c) 1999-2014 Michael Haardt + * SPDX-License-Identifier: MIT + * SPDX-FileCopyrightText: 1999-2014 Michael Haardt * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), diff --git a/interpreters/bas/bas_token.l b/interpreters/bas/bas_token.l index d68fb900a1e..131544262e0 100644 --- a/interpreters/bas/bas_token.l +++ b/interpreters/bas/bas_token.l @@ -1,3 +1,25 @@ +/**************************************************************************** + * apps/interpreters/bas/bas_token.l + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + /* Tokens and token sequence arrays. */ %{ #include diff --git a/interpreters/bas/bas_value.c b/interpreters/bas/bas_value.c index 901eb55beab..3c99281d029 100644 --- a/interpreters/bas/bas_value.c +++ b/interpreters/bas/bas_value.c @@ -1,7 +1,8 @@ /**************************************************************************** * apps/interpreters/bas/bas_value.c * - * Copyright (c) 1999-2014 Michael Haardt + * SPDX-License-Identifier: MIT + * SPDX-FileCopyrightText: 1999-2014 Michael Haardt * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), diff --git a/interpreters/bas/bas_value.h b/interpreters/bas/bas_value.h index c60037c09a7..5a428bd5d21 100644 --- a/interpreters/bas/bas_value.h +++ b/interpreters/bas/bas_value.h @@ -1,7 +1,8 @@ /**************************************************************************** * apps/interpreters/bas/bas_value.h * - * Copyright (c) 1999-2014 Michael Haardt + * SPDX-License-Identifier: MIT + * SPDX-FileCopyrightText: 1999-2014 Michael Haardt * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), diff --git a/interpreters/bas/bas_var.c b/interpreters/bas/bas_var.c index a5cf9fe0f8e..1e26dca222f 100644 --- a/interpreters/bas/bas_var.c +++ b/interpreters/bas/bas_var.c @@ -1,7 +1,8 @@ /**************************************************************************** * apps/interpreters/bas/bas_var.c * - * Copyright (c) 1999-2014 Michael Haardt + * SPDX-License-Identifier: MIT + * SPDX-FileCopyrightText: 1999-2014 Michael Haardt * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), diff --git a/interpreters/bas/bas_var.h b/interpreters/bas/bas_var.h index 022d1422b85..1f5f0444bb5 100644 --- a/interpreters/bas/bas_var.h +++ b/interpreters/bas/bas_var.h @@ -1,7 +1,8 @@ /**************************************************************************** * apps/interpreters/bas/bas_var.h * - * Copyright (c) 1999-2014 Michael Haardt + * SPDX-License-Identifier: MIT + * SPDX-FileCopyrightText: 1999-2014 Michael Haardt * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), diff --git a/interpreters/bas/bas_vt100.c b/interpreters/bas/bas_vt100.c index ebdd60b54f4..84410232d68 100644 --- a/interpreters/bas/bas_vt100.c +++ b/interpreters/bas/bas_vt100.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/interpreters/bas/bas_vt100.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/interpreters/bas/bas_vt100.h b/interpreters/bas/bas_vt100.h index 45ade3d26b4..fc7b5d2c56e 100644 --- a/interpreters/bas/bas_vt100.h +++ b/interpreters/bas/bas_vt100.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/interpreters/bas/bas_vt100.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/interpreters/duktape/Make.defs b/interpreters/duktape/Make.defs index b9d4fbfd623..e0627acf7b5 100644 --- a/interpreters/duktape/Make.defs +++ b/interpreters/duktape/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/interpreters/duktape/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/interpreters/duktape/Makefile b/interpreters/duktape/Makefile index 37dacaaa4b5..c6a0a621e8d 100644 --- a/interpreters/duktape/Makefile +++ b/interpreters/duktape/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/interpreters/duktape/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/interpreters/ficl/Make.defs b/interpreters/ficl/Make.defs index fb76bd5a47c..95cbe50b95a 100644 --- a/interpreters/ficl/Make.defs +++ b/interpreters/ficl/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/interpreters/ficl/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/interpreters/ficl/Makefile b/interpreters/ficl/Makefile index 6b3308c6fbc..46d058e1346 100644 --- a/interpreters/ficl/Makefile +++ b/interpreters/ficl/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/interpreters/ficl/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/interpreters/ficl/configure.sh b/interpreters/ficl/configure.sh index d84e0d4fc21..d7e232d3abc 100755 --- a/interpreters/ficl/configure.sh +++ b/interpreters/ficl/configure.sh @@ -1,4 +1,26 @@ #!/usr/bin/env bash +############################################################################ +# apps/interpreters/ficl/configure.sh +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + USAGE="$0 " diff --git a/interpreters/ficl/src/nuttx.c b/interpreters/ficl/src/nuttx.c index 5d01b8c8427..86cc1712b49 100644 --- a/interpreters/ficl/src/nuttx.c +++ b/interpreters/ficl/src/nuttx.c @@ -1,39 +1,31 @@ /**************************************************************************** * apps/interpreters/ficl/src/nuttx.c * - * Copyright (C) 2016 Gregory Nutt. All rights reserved. + * SPDX-License-Identifier: Apache-2.0 * - * This file was taken from Mini Basic, versino 1.0 developed by Malcolm - * McLean, Leeds University. Mini Basic version 1.0 was released the - * Creative Commons Attribution license which, from my reading, appears to - * be compatible with the NuttX BSD-style license: + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * http://www.apache.org/licenses/LICENSE-2.0 * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + ***************************************************************************/ + +/**************************************************************************** + * + * This file was taken from Mini Basic, versino 1.0 developed by Malcolm + * McLean, Leeds University. Mini Basic version 1.0 was released the + * Creative Commons Attribution license which, from my reading, appears to + * be compatible with the NuttX license. * ****************************************************************************/ diff --git a/interpreters/ficl/src/nuttx.h b/interpreters/ficl/src/nuttx.h index 87887e757d3..d1b94a17021 100644 --- a/interpreters/ficl/src/nuttx.h +++ b/interpreters/ficl/src/nuttx.h @@ -1,6 +1,8 @@ /*************************************************************************** * apps/interpreters/ficl/src/nuttx.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/interpreters/lua/CMakeLists.txt b/interpreters/lua/CMakeLists.txt index ace2c604b8c..8083a605d8a 100644 --- a/interpreters/lua/CMakeLists.txt +++ b/interpreters/lua/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/interpreters/lua/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/interpreters/lua/Make.defs b/interpreters/lua/Make.defs index 52f0b68df5e..a0cf323abbd 100644 --- a/interpreters/lua/Make.defs +++ b/interpreters/lua/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/interpreters/lua/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/interpreters/lua/Makefile b/interpreters/lua/Makefile index 6f9dbfceead..86e446667e7 100644 --- a/interpreters/lua/Makefile +++ b/interpreters/lua/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/interpreters/lua/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/interpreters/lua/Module.mk b/interpreters/lua/Module.mk index 675ef51bd4d..52e9023c0db 100644 --- a/interpreters/lua/Module.mk +++ b/interpreters/lua/Module.mk @@ -1,6 +1,8 @@ ############################################################################ # apps/interpreters/lua/Module.mk # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/interpreters/lua/nuttx_linit.c b/interpreters/lua/nuttx_linit.c index c15b1ab8c15..3e47a9c9992 100644 --- a/interpreters/lua/nuttx_linit.c +++ b/interpreters/lua/nuttx_linit.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/interpreters/lua/nuttx_linit.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/interpreters/luajit/0001-luajit-armv7m-nuttx.patch b/interpreters/luajit/0001-luajit-armv7m-nuttx.patch index fda4d75059b..d6c20879ef1 100644 --- a/interpreters/luajit/0001-luajit-armv7m-nuttx.patch +++ b/interpreters/luajit/0001-luajit-armv7m-nuttx.patch @@ -18,9 +18,9 @@ index 00000000..8f94ba40 +++ b/dynasm/dasm_armv7m.h @@ -0,0 +1,563 @@ +/* -+** DynASM ARM encoding engine. -+** Copyright (C) 2018 Jernej Turnsek. All rights reserved. -+** Copyright (C) 2005-2017 Mike Pall. All rights reserved. ++** SPDX-License-Identifier: MIT ++** SPDX-FileCopyrightText: 2018 Jernej Turnsek. All rights reserved. ++** SPDX-FileCopyrightText: 2005-2017 Mike Pall. All rights reserved. +** Released under the MIT license. See dynasm.lua for full copyright notice. +*/ + diff --git a/interpreters/luajit/Make.defs b/interpreters/luajit/Make.defs index 066d3922fff..c9957001c65 100644 --- a/interpreters/luajit/Make.defs +++ b/interpreters/luajit/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/interpreters/luajit/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/interpreters/luajit/Makefile b/interpreters/luajit/Makefile index 778d0ed4a44..1d7f2dfb4f5 100644 --- a/interpreters/luajit/Makefile +++ b/interpreters/luajit/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/interpreters/luajit/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/interpreters/luamodules/CMakeLists.txt b/interpreters/luamodules/CMakeLists.txt index 92f6b8d5f21..9ac42149c8d 100644 --- a/interpreters/luamodules/CMakeLists.txt +++ b/interpreters/luamodules/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/interpreters/luamodules/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/interpreters/luamodules/Make.defs b/interpreters/luamodules/Make.defs index 224a325c5f7..1dd614d1334 100644 --- a/interpreters/luamodules/Make.defs +++ b/interpreters/luamodules/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/interpreters/luamodules/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/interpreters/luamodules/Makefile b/interpreters/luamodules/Makefile index 2943f21ea22..b18df0fb3b8 100644 --- a/interpreters/luamodules/Makefile +++ b/interpreters/luamodules/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/interpreters/luamodules/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/interpreters/luamodules/cjson/Make.defs b/interpreters/luamodules/cjson/Make.defs index ef9e639c22a..863ba0ba418 100644 --- a/interpreters/luamodules/cjson/Make.defs +++ b/interpreters/luamodules/cjson/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/interpreters/luamodules/cjson/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/interpreters/luamodules/cjson/Makefile b/interpreters/luamodules/cjson/Makefile index 2fd7411574e..f9986df4d35 100644 --- a/interpreters/luamodules/cjson/Makefile +++ b/interpreters/luamodules/cjson/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/interpreters/luamodules/cjson/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/interpreters/luamodules/lfs/Make.defs b/interpreters/luamodules/lfs/Make.defs index 868d80cdd56..0ce0cadffc4 100644 --- a/interpreters/luamodules/lfs/Make.defs +++ b/interpreters/luamodules/lfs/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/interpreters/luamodules/lfs/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/interpreters/luamodules/lfs/Makefile b/interpreters/luamodules/lfs/Makefile index 2987ff3c244..f41313aac29 100644 --- a/interpreters/luamodules/lfs/Makefile +++ b/interpreters/luamodules/lfs/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/interpreters/luamodules/lfs/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/interpreters/luamodules/luasyslog/CMakeLists.txt b/interpreters/luamodules/luasyslog/CMakeLists.txt index 9f6bf0b0ad3..6f1fc2e1186 100644 --- a/interpreters/luamodules/luasyslog/CMakeLists.txt +++ b/interpreters/luamodules/luasyslog/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/interpreters/luamodules/luasyslog/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/interpreters/luamodules/luasyslog/Make.defs b/interpreters/luamodules/luasyslog/Make.defs index 6b1d990788b..7861da2e2bc 100644 --- a/interpreters/luamodules/luasyslog/Make.defs +++ b/interpreters/luamodules/luasyslog/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/interpreters/luamodules/luasyslog/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/interpreters/luamodules/luasyslog/Makefile b/interpreters/luamodules/luasyslog/Makefile index 52f188d3520..2421472f81d 100644 --- a/interpreters/luamodules/luasyslog/Makefile +++ b/interpreters/luamodules/luasyslog/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/interpreters/luamodules/luasyslog/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/interpreters/luamodules/luv/Make.defs b/interpreters/luamodules/luv/Make.defs index c1af97de20d..2f1a4ae5015 100644 --- a/interpreters/luamodules/luv/Make.defs +++ b/interpreters/luamodules/luv/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/interpreters/luamodules/luv/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/interpreters/luamodules/luv/Makefile b/interpreters/luamodules/luv/Makefile index 9eb0111639d..8f4c2535706 100644 --- a/interpreters/luamodules/luv/Makefile +++ b/interpreters/luamodules/luv/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/interpreters/luamodules/luv/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/interpreters/minibasic/CMakeLists.txt b/interpreters/minibasic/CMakeLists.txt index cead0f358c1..7c1e1401dff 100644 --- a/interpreters/minibasic/CMakeLists.txt +++ b/interpreters/minibasic/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/interpreters/minibasic/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/interpreters/minibasic/Make.defs b/interpreters/minibasic/Make.defs index da9cb2bfe3c..518bfb561ea 100644 --- a/interpreters/minibasic/Make.defs +++ b/interpreters/minibasic/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/interpreters/minibasic/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/interpreters/minibasic/Makefile b/interpreters/minibasic/Makefile index ced37e10055..40f59775013 100644 --- a/interpreters/minibasic/Makefile +++ b/interpreters/minibasic/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/interpreters/minibasic/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/interpreters/minibasic/basic.c b/interpreters/minibasic/basic.c index 8a3a404a4e4..791463a304f 100644 --- a/interpreters/minibasic/basic.c +++ b/interpreters/minibasic/basic.c @@ -1,39 +1,31 @@ /**************************************************************************** * apps/interpreters/minibasic/basic.c * - * Copyright (C) 2016 Gregory Nutt. All rights reserved. + * SPDX-License-Identifier: Apache-2.0 * - * This file was taken from Mini Basic, versino 1.0 developed by Malcolm - * McLean, Leeds University. Mini Basic version 1.0 was released the - * Creative Commons Attribution license which, from my reading, appears to - * be compatible with the NuttX BSD-style license: + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * http://www.apache.org/licenses/LICENSE-2.0 * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * This file was taken from Mini Basic, versino 1.0 developed by Malcolm + * McLean, Leeds University. Mini Basic version 1.0 was released the + * Creative Commons Attribution license which, from my reading, appears to + * be compatible with the NuttX license: * ****************************************************************************/ diff --git a/interpreters/minibasic/script.c b/interpreters/minibasic/script.c index 1710433b670..af3b668f935 100644 --- a/interpreters/minibasic/script.c +++ b/interpreters/minibasic/script.c @@ -1,41 +1,32 @@ /**************************************************************************** * apps/interpreters/minibasic/script.c - * Driver file for MiniBasic. * - * Copyright (C) 2016 Gregory Nutt. All rights reserved. + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** * * This file was taken from Mini Basic, versino 1.0 developed by Malcolm * McLean, Leeds University. Mini Basic version 1.0 was released the * Creative Commons Attribution license which, from my reading, appears to * be compatible with the NuttX BSD-style license: * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * ****************************************************************************/ /**************************************************************************** diff --git a/interpreters/python/Make.defs b/interpreters/python/Make.defs index a1aecbdb4bc..39472e7a1c5 100644 --- a/interpreters/python/Make.defs +++ b/interpreters/python/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/interpreters/python/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/interpreters/python/Makefile b/interpreters/python/Makefile index e3cda75dfef..4b6c42eac39 100644 --- a/interpreters/python/Makefile +++ b/interpreters/python/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/interpreters/python/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/interpreters/python/mount_modules.c b/interpreters/python/mount_modules.c index 89a7bc377a5..681031579c4 100644 --- a/interpreters/python/mount_modules.c +++ b/interpreters/python/mount_modules.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/interpreters/python/mount_modules.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/interpreters/quickjs/CMakeLists.txt b/interpreters/quickjs/CMakeLists.txt index eae0b3763bc..38c4b26e8f4 100644 --- a/interpreters/quickjs/CMakeLists.txt +++ b/interpreters/quickjs/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/interpreters/quickjs/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/interpreters/quickjs/Make.defs b/interpreters/quickjs/Make.defs index d08b683fadb..8a39b85239b 100644 --- a/interpreters/quickjs/Make.defs +++ b/interpreters/quickjs/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/interpreters/quickjs/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/interpreters/quickjs/Makefile b/interpreters/quickjs/Makefile index 52d38c5c752..fb522ebcbf0 100644 --- a/interpreters/quickjs/Makefile +++ b/interpreters/quickjs/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/interpreters/quickjs/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/interpreters/quickjs/qjsmini.c b/interpreters/quickjs/qjsmini.c index 18957f93954..d7932b81cb1 100644 --- a/interpreters/quickjs/qjsmini.c +++ b/interpreters/quickjs/qjsmini.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/interpreters/quickjs/qjsmini.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/interpreters/toywasm/Make.defs b/interpreters/toywasm/Make.defs index 70dcf9673ad..08f1857c56f 100644 --- a/interpreters/toywasm/Make.defs +++ b/interpreters/toywasm/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/interpreters/toywasm/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/interpreters/toywasm/Makefile b/interpreters/toywasm/Makefile index 4ed98d4c666..6a012b808be 100644 --- a/interpreters/toywasm/Makefile +++ b/interpreters/toywasm/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/interpreters/toywasm/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/interpreters/toywasm/include/toywasm_config.h b/interpreters/toywasm/include/toywasm_config.h index 26db93dabe2..022a0fa588e 100644 --- a/interpreters/toywasm/include/toywasm_config.h +++ b/interpreters/toywasm/include/toywasm_config.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/interpreters/toywasm/include/toywasm_config.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/interpreters/toywasm/include/toywasm_version.h b/interpreters/toywasm/include/toywasm_version.h index d3d3025927b..903f6778fe4 100644 --- a/interpreters/toywasm/include/toywasm_version.h +++ b/interpreters/toywasm/include/toywasm_version.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/interpreters/toywasm/include/toywasm_version.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/interpreters/toywasm/regen.sh b/interpreters/toywasm/regen.sh index 091484cd087..927666be6ee 100755 --- a/interpreters/toywasm/regen.sh +++ b/interpreters/toywasm/regen.sh @@ -1,4 +1,25 @@ #! /bin/sh +############################################################################ +# apps/interpreters/toywasm/regen.sh +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ # A script to generate a few files for nuttx-apps build. diff --git a/interpreters/toywasm/src/toywasm_config.c b/interpreters/toywasm/src/toywasm_config.c index 0f89af96470..2877e824cbe 100644 --- a/interpreters/toywasm/src/toywasm_config.c +++ b/interpreters/toywasm/src/toywasm_config.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/interpreters/toywasm/src/toywasm_config.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/interpreters/toywasm/tmpl/c-sections.in b/interpreters/toywasm/tmpl/c-sections.in index 46a3315126d..723a3f7b4a6 100644 --- a/interpreters/toywasm/tmpl/c-sections.in +++ b/interpreters/toywasm/tmpl/c-sections.in @@ -1,3 +1,23 @@ +/**************************************************************************** + * apps/interpreters/toywasm/tmpl/c-sections.in + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + /**************************************************************************** * Private Functions ****************************************************************************/ diff --git a/interpreters/toywasm/tmpl/license.in b/interpreters/toywasm/tmpl/license.in index 90da07e105a..97d002a8452 100644 --- a/interpreters/toywasm/tmpl/license.in +++ b/interpreters/toywasm/tmpl/license.in @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/interpreters/toywasm/FILENAME + * apps/interpreters/toywasm/tmpl/license.in * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with diff --git a/interpreters/wamr/CMakeLists.txt b/interpreters/wamr/CMakeLists.txt index 827f13af0ff..f155e61bfc0 100644 --- a/interpreters/wamr/CMakeLists.txt +++ b/interpreters/wamr/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/interpreters/wamr/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/interpreters/wamr/Make.defs b/interpreters/wamr/Make.defs index 0c53a3614e0..a7e45544b73 100644 --- a/interpreters/wamr/Make.defs +++ b/interpreters/wamr/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/interpreters/wamr/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/interpreters/wamr/Makefile b/interpreters/wamr/Makefile index f52d5adaaf9..4e78fa7bdfa 100644 --- a/interpreters/wamr/Makefile +++ b/interpreters/wamr/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/interpreters/wamr/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/interpreters/wamr/Module.mk b/interpreters/wamr/Module.mk index b30eb6c8775..4e7de6334d6 100644 --- a/interpreters/wamr/Module.mk +++ b/interpreters/wamr/Module.mk @@ -1,6 +1,8 @@ ############################################################################ # apps/interpreters/wamr/Module.mk # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/interpreters/wamr/Toolchain.defs b/interpreters/wamr/Toolchain.defs index 98a84861898..c0a6c5b362f 100644 --- a/interpreters/wamr/Toolchain.defs +++ b/interpreters/wamr/Toolchain.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/interpreters/wamr/Toolchain.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/interpreters/wamr/wamr_custom_init.c b/interpreters/wamr/wamr_custom_init.c index 1c4dd430368..9c895e0a227 100644 --- a/interpreters/wamr/wamr_custom_init.c +++ b/interpreters/wamr/wamr_custom_init.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/interpreters/wamr/wamr_custom_init.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/interpreters/wasm3/Make.defs b/interpreters/wasm3/Make.defs index db0e96c8cfb..a78510e7a45 100644 --- a/interpreters/wasm3/Make.defs +++ b/interpreters/wasm3/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/interpreters/wasm3/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/interpreters/wasm3/Makefile b/interpreters/wasm3/Makefile index eeb9aa3d404..2c87f998889 100644 --- a/interpreters/wasm3/Makefile +++ b/interpreters/wasm3/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/interpreters/wasm3/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The From 905e79a69dbde7a7262169b60a4869cfe223713e Mon Sep 17 00:00:00 2001 From: Alin Jerpelea Date: Fri, 20 Dec 2024 04:11:06 +0100 Subject: [PATCH 082/391] logging: migrate to SPDX identifier Most tools used for compliance and SBOM generation use SPDX identifiers This change brings us a step closer to an easy SBOM generation. Signed-off-by: Alin Jerpelea --- logging/CMakeLists.txt | 2 ++ logging/Make.defs | 2 ++ logging/Makefile | 2 ++ logging/embedlog/CMakeLists.txt | 2 ++ logging/embedlog/Make.defs | 2 ++ logging/embedlog/Makefile | 2 ++ logging/nxscope/CMakeLists.txt | 2 ++ logging/nxscope/Make.defs | 2 ++ logging/nxscope/Makefile | 2 ++ logging/nxscope/nxscope.c | 2 ++ logging/nxscope/nxscope_chan.c | 2 ++ logging/nxscope/nxscope_idummy.c | 2 ++ logging/nxscope/nxscope_internals.c | 2 ++ logging/nxscope/nxscope_internals.h | 2 ++ logging/nxscope/nxscope_iser.c | 2 ++ logging/nxscope/nxscope_pser.c | 2 ++ 16 files changed, 32 insertions(+) diff --git a/logging/CMakeLists.txt b/logging/CMakeLists.txt index 4591b75c4f3..99615502ab2 100644 --- a/logging/CMakeLists.txt +++ b/logging/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/logging/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/logging/Make.defs b/logging/Make.defs index 458180da9ca..ebfb6482939 100644 --- a/logging/Make.defs +++ b/logging/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/logging/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/logging/Makefile b/logging/Makefile index e838062546d..f7971ba9598 100644 --- a/logging/Makefile +++ b/logging/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/logging/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/logging/embedlog/CMakeLists.txt b/logging/embedlog/CMakeLists.txt index edef25f1290..f9684075e28 100644 --- a/logging/embedlog/CMakeLists.txt +++ b/logging/embedlog/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/logging/embedlog/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/logging/embedlog/Make.defs b/logging/embedlog/Make.defs index 4d3d4f7a98c..1b59e6ef3f5 100644 --- a/logging/embedlog/Make.defs +++ b/logging/embedlog/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/logging/embedlog/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/logging/embedlog/Makefile b/logging/embedlog/Makefile index 747b7ec5cbc..e4e6f2b4c38 100644 --- a/logging/embedlog/Makefile +++ b/logging/embedlog/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/logging/embedlog/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/logging/nxscope/CMakeLists.txt b/logging/nxscope/CMakeLists.txt index 7a277e6a8b1..378ebefd565 100644 --- a/logging/nxscope/CMakeLists.txt +++ b/logging/nxscope/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/logging/nxscope/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/logging/nxscope/Make.defs b/logging/nxscope/Make.defs index 1007faa7e37..92db87b7979 100644 --- a/logging/nxscope/Make.defs +++ b/logging/nxscope/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/logging/nxscope/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/logging/nxscope/Makefile b/logging/nxscope/Makefile index d089adfd863..3e45148fc4a 100644 --- a/logging/nxscope/Makefile +++ b/logging/nxscope/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/logging/nxscope/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/logging/nxscope/nxscope.c b/logging/nxscope/nxscope.c index 011aa93c2a5..123ff047e3b 100644 --- a/logging/nxscope/nxscope.c +++ b/logging/nxscope/nxscope.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/logging/nxscope/nxscope.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/logging/nxscope/nxscope_chan.c b/logging/nxscope/nxscope_chan.c index eac54897c43..3af048c60d4 100644 --- a/logging/nxscope/nxscope_chan.c +++ b/logging/nxscope/nxscope_chan.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/logging/nxscope/nxscope_chan.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/logging/nxscope/nxscope_idummy.c b/logging/nxscope/nxscope_idummy.c index 650dbb3b8d0..83206e9e70e 100644 --- a/logging/nxscope/nxscope_idummy.c +++ b/logging/nxscope/nxscope_idummy.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/logging/nxscope/nxscope_idummy.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/logging/nxscope/nxscope_internals.c b/logging/nxscope/nxscope_internals.c index 0c25895df4d..43ffdd610e3 100644 --- a/logging/nxscope/nxscope_internals.c +++ b/logging/nxscope/nxscope_internals.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/logging/nxscope/nxscope_internals.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/logging/nxscope/nxscope_internals.h b/logging/nxscope/nxscope_internals.h index cfb921baba9..622268b67ab 100644 --- a/logging/nxscope/nxscope_internals.h +++ b/logging/nxscope/nxscope_internals.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/logging/nxscope/nxscope_internals.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/logging/nxscope/nxscope_iser.c b/logging/nxscope/nxscope_iser.c index d91cf61d52d..c36d6e3504e 100644 --- a/logging/nxscope/nxscope_iser.c +++ b/logging/nxscope/nxscope_iser.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/logging/nxscope/nxscope_iser.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/logging/nxscope/nxscope_pser.c b/logging/nxscope/nxscope_pser.c index ca0648fead8..95bbb60d883 100644 --- a/logging/nxscope/nxscope_pser.c +++ b/logging/nxscope/nxscope_pser.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/logging/nxscope/nxscope_pser.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The From 2a89ee6cb73fcdcf7f8c03e24f1caa9dd09b8115 Mon Sep 17 00:00:00 2001 From: Alin Jerpelea Date: Fri, 20 Dec 2024 04:22:12 +0100 Subject: [PATCH 083/391] lte: migrate to SPDX identifier Most tools used for compliance and SBOM generation use SPDX identifiers This change brings us a step closer to an easy SBOM generation. Signed-off-by: Alin Jerpelea --- lte/CMakeLists.txt | 2 + lte/Make.defs | 41 +++++++------------ lte/Makefile | 41 +++++++------------ lte/alt1250/CMakeLists.txt | 2 + lte/alt1250/Make.defs | 2 + lte/alt1250/Makefile | 2 + lte/alt1250/alt1250_atcmd.c | 2 + lte/alt1250/alt1250_atcmd.h | 2 + lte/alt1250/alt1250_container.c | 2 + lte/alt1250/alt1250_container.h | 2 + lte/alt1250/alt1250_daemon.h | 2 + lte/alt1250/alt1250_dbg.h | 2 + lte/alt1250/alt1250_devevent.c | 2 + lte/alt1250/alt1250_devevent.h | 2 + lte/alt1250/alt1250_devif.c | 2 + lte/alt1250/alt1250_devif.h | 2 + lte/alt1250/alt1250_main.c | 2 + lte/alt1250/alt1250_netdev.c | 2 + lte/alt1250/alt1250_netdev.h | 2 + lte/alt1250/alt1250_postproc.h | 2 + lte/alt1250/alt1250_reset_seq.c | 2 + lte/alt1250/alt1250_reset_seq.h | 2 + lte/alt1250/alt1250_select.c | 2 + lte/alt1250/alt1250_select.h | 2 + lte/alt1250/alt1250_socket.c | 2 + lte/alt1250/alt1250_socket.h | 2 + lte/alt1250/alt1250_usockevent.c | 2 + lte/alt1250/alt1250_usockevent.h | 2 + lte/alt1250/alt1250_usockif.c | 2 + lte/alt1250/alt1250_usockif.h | 2 + lte/alt1250/alt1250_util.c | 2 + lte/alt1250/alt1250_util.h | 2 + lte/alt1250/callback_handlers/alt1250_evt.c | 2 + lte/alt1250/callback_handlers/alt1250_evt.h | 2 + .../usock_handlers/alt1250_accepthdlr.c | 2 + lte/alt1250/usock_handlers/alt1250_bindhdlr.c | 2 + .../usock_handlers/alt1250_closehdlr.c | 2 + .../usock_handlers/alt1250_connecthdlr.c | 2 + lte/alt1250/usock_handlers/alt1250_fwupdate.h | 2 + .../usock_handlers/alt1250_getpeernamehdlr.c | 2 + .../usock_handlers/alt1250_getsocknamehdlr.c | 2 + .../usock_handlers/alt1250_getsockopthdlr.c | 2 + .../alt1250_ioctl_denyinetsock.c | 2 + .../usock_handlers/alt1250_ioctl_event.c | 2 + .../usock_handlers/alt1250_ioctl_fwupdate.c | 2 + .../usock_handlers/alt1250_ioctl_ifreq.c | 2 + .../usock_handlers/alt1250_ioctl_ltecmd.c | 2 + .../usock_handlers/alt1250_ioctl_lwm2m.c | 2 + .../usock_handlers/alt1250_ioctl_normal.c | 2 + .../usock_handlers/alt1250_ioctl_other.c | 2 + .../usock_handlers/alt1250_ioctl_power.c | 2 + .../usock_handlers/alt1250_ioctl_subhdlr.h | 2 + .../usock_handlers/alt1250_ioctlhdlr.c | 2 + .../usock_handlers/alt1250_listenhdlr.c | 2 + .../usock_handlers/alt1250_recvfromhdlr.c | 2 + .../usock_handlers/alt1250_sendtohdlr.c | 2 + .../usock_handlers/alt1250_setsockopthdlr.c | 2 + .../usock_handlers/alt1250_shutdownhdlr.c | 2 + lte/alt1250/usock_handlers/alt1250_sms.c | 2 + lte/alt1250/usock_handlers/alt1250_sms.h | 2 + .../usock_handlers/alt1250_sockethdlr.c | 2 + .../usock_handlers/alt1250_usrsock_hdlr.h | 2 + lte/lapi/CMakeLists.txt | 2 + lte/lapi/Make.defs | 2 + lte/lapi/Makefile | 2 + lte/lapi/src/Make.defs | 2 + lte/lapi/src/lapi_dbg.h | 2 + lte/lapi/src/lapi_evt.c | 2 + lte/lapi/src/lapi_firmware.c | 2 + lte/lapi/src/lapi_log.c | 2 + lte/lapi/src/lapi_lwm2m.c | 2 + lte/lapi/src/lapi_net.c | 2 + lte/lapi/src/lapi_other.c | 2 + lte/lapi/src/lapi_pdn.c | 2 + lte/lapi/src/lapi_pin.c | 2 + lte/lapi/src/lapi_power.c | 2 + lte/lapi/src/lapi_psave.c | 2 + lte/lapi/src/lapi_radio.c | 2 + lte/lapi/src/lapi_sim.c | 2 + 79 files changed, 182 insertions(+), 54 deletions(-) diff --git a/lte/CMakeLists.txt b/lte/CMakeLists.txt index 01e72ea15bd..44b08a29240 100644 --- a/lte/CMakeLists.txt +++ b/lte/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/lte/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/lte/Make.defs b/lte/Make.defs index 89c366ca2fa..70956ea219a 100644 --- a/lte/Make.defs +++ b/lte/Make.defs @@ -1,36 +1,23 @@ ############################################################################ # apps/lte/Make.defs # -# Copyright 2021 Sony Semiconductor Solutions Corporation +# SPDX-License-Identifier: Apache-2.0 # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at # -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# 3. Neither the name of Sony Semiconductor Solutions Corporation nor -# the names of its contributors may be used to endorse or promote -# products derived from this software without specific prior written -# permission. +# http://www.apache.org/licenses/LICENSE-2.0 # -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. # -############################################################################ +# ############################################################################## include $(wildcard lte/*/Make.defs) diff --git a/lte/Makefile b/lte/Makefile index 79ab0d8fbba..4fe43e7e942 100644 --- a/lte/Makefile +++ b/lte/Makefile @@ -1,37 +1,24 @@ ############################################################################ # apps/lte/Makefile # -# Copyright 2021 Sony Semiconductor Solutions Corporation +# SPDX-License-Identifier: Apache-2.0 # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at # -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in -# the documentation and/or other materials provided with the -# distribution. -# 3. Neither the name of Sony Semiconductor Solutions Corporation nor -# the names of its contributors may be used to endorse or promote -# products derived from this software without specific prior written -# permission. +# http://www.apache.org/licenses/LICENSE-2.0 # -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED -# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN -# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGE. +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. # -############################################################################ +# ############################################################################## MENUDESC = "LTE Libraries and NSH Add-Ons" diff --git a/lte/alt1250/CMakeLists.txt b/lte/alt1250/CMakeLists.txt index 9ed2f85ec36..c54f8e1e072 100644 --- a/lte/alt1250/CMakeLists.txt +++ b/lte/alt1250/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/lte/alt1250/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/lte/alt1250/Make.defs b/lte/alt1250/Make.defs index e5b7a3f9298..4b0fbab09f9 100644 --- a/lte/alt1250/Make.defs +++ b/lte/alt1250/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/lte/alt1250/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/Makefile b/lte/alt1250/Makefile index 138b2bed4b5..7f1ee1e2c24 100644 --- a/lte/alt1250/Makefile +++ b/lte/alt1250/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/lte/alt1250/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/alt1250_atcmd.c b/lte/alt1250/alt1250_atcmd.c index bdd7e285351..2b45585181b 100644 --- a/lte/alt1250/alt1250_atcmd.c +++ b/lte/alt1250/alt1250_atcmd.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/alt1250_atcmd.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/alt1250_atcmd.h b/lte/alt1250/alt1250_atcmd.h index d732a331384..4a9e275e636 100644 --- a/lte/alt1250/alt1250_atcmd.h +++ b/lte/alt1250/alt1250_atcmd.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/alt1250_atcmd.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/alt1250_container.c b/lte/alt1250/alt1250_container.c index 5c285011023..21ec1b31a29 100644 --- a/lte/alt1250/alt1250_container.c +++ b/lte/alt1250/alt1250_container.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/alt1250_container.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/alt1250_container.h b/lte/alt1250/alt1250_container.h index 894ff5aa472..2e45e12ce95 100644 --- a/lte/alt1250/alt1250_container.h +++ b/lte/alt1250/alt1250_container.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/alt1250_container.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/alt1250_daemon.h b/lte/alt1250/alt1250_daemon.h index c385d23ce75..45d8a923b8c 100644 --- a/lte/alt1250/alt1250_daemon.h +++ b/lte/alt1250/alt1250_daemon.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/alt1250_daemon.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/alt1250_dbg.h b/lte/alt1250/alt1250_dbg.h index edffed181cb..82b9bb27af6 100644 --- a/lte/alt1250/alt1250_dbg.h +++ b/lte/alt1250/alt1250_dbg.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/alt1250_dbg.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/alt1250_devevent.c b/lte/alt1250/alt1250_devevent.c index f58fe71708a..cdd2da524d4 100644 --- a/lte/alt1250/alt1250_devevent.c +++ b/lte/alt1250/alt1250_devevent.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/alt1250_devevent.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/alt1250_devevent.h b/lte/alt1250/alt1250_devevent.h index 03667fe0bcc..c4e27aa229c 100644 --- a/lte/alt1250/alt1250_devevent.h +++ b/lte/alt1250/alt1250_devevent.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/alt1250_devevent.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/alt1250_devif.c b/lte/alt1250/alt1250_devif.c index d58f3c75ffc..a742938fbf7 100644 --- a/lte/alt1250/alt1250_devif.c +++ b/lte/alt1250/alt1250_devif.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/alt1250_devif.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/alt1250_devif.h b/lte/alt1250/alt1250_devif.h index 5a01b647df7..c537754df19 100644 --- a/lte/alt1250/alt1250_devif.h +++ b/lte/alt1250/alt1250_devif.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/alt1250_devif.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/alt1250_main.c b/lte/alt1250/alt1250_main.c index d78adacc402..db40a6bf92c 100644 --- a/lte/alt1250/alt1250_main.c +++ b/lte/alt1250/alt1250_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/alt1250_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/alt1250_netdev.c b/lte/alt1250/alt1250_netdev.c index 8e40afd92b0..f0e8719fa7f 100644 --- a/lte/alt1250/alt1250_netdev.c +++ b/lte/alt1250/alt1250_netdev.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/alt1250_netdev.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/alt1250_netdev.h b/lte/alt1250/alt1250_netdev.h index a6931e37e7c..3d9c67f4295 100644 --- a/lte/alt1250/alt1250_netdev.h +++ b/lte/alt1250/alt1250_netdev.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/alt1250_netdev.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/alt1250_postproc.h b/lte/alt1250/alt1250_postproc.h index 25cd32a2e05..4e4b819fe11 100644 --- a/lte/alt1250/alt1250_postproc.h +++ b/lte/alt1250/alt1250_postproc.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/alt1250_postproc.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/alt1250_reset_seq.c b/lte/alt1250/alt1250_reset_seq.c index 3dc836803c5..f6080887c49 100644 --- a/lte/alt1250/alt1250_reset_seq.c +++ b/lte/alt1250/alt1250_reset_seq.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/alt1250_reset_seq.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/alt1250_reset_seq.h b/lte/alt1250/alt1250_reset_seq.h index 720a948adba..d5769522fd3 100644 --- a/lte/alt1250/alt1250_reset_seq.h +++ b/lte/alt1250/alt1250_reset_seq.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/alt1250_reset_seq.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/alt1250_select.c b/lte/alt1250/alt1250_select.c index e608e3532cf..dd44d38f243 100644 --- a/lte/alt1250/alt1250_select.c +++ b/lte/alt1250/alt1250_select.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/alt1250_select.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/alt1250_select.h b/lte/alt1250/alt1250_select.h index 4336e5f66a8..c386255343a 100644 --- a/lte/alt1250/alt1250_select.h +++ b/lte/alt1250/alt1250_select.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/alt1250_select.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/alt1250_socket.c b/lte/alt1250/alt1250_socket.c index 94af4bff5a4..d6eccf7104a 100644 --- a/lte/alt1250/alt1250_socket.c +++ b/lte/alt1250/alt1250_socket.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/alt1250_socket.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/alt1250_socket.h b/lte/alt1250/alt1250_socket.h index 64409e96c98..77b8286ae40 100644 --- a/lte/alt1250/alt1250_socket.h +++ b/lte/alt1250/alt1250_socket.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/alt1250_socket.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/alt1250_usockevent.c b/lte/alt1250/alt1250_usockevent.c index 9c4b637a5aa..5bc76555bd7 100644 --- a/lte/alt1250/alt1250_usockevent.c +++ b/lte/alt1250/alt1250_usockevent.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/alt1250_usockevent.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/alt1250_usockevent.h b/lte/alt1250/alt1250_usockevent.h index 6309ee85bb8..922f0b3a436 100644 --- a/lte/alt1250/alt1250_usockevent.h +++ b/lte/alt1250/alt1250_usockevent.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/alt1250_usockevent.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/alt1250_usockif.c b/lte/alt1250/alt1250_usockif.c index f85d05a6186..ec188775ceb 100644 --- a/lte/alt1250/alt1250_usockif.c +++ b/lte/alt1250/alt1250_usockif.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/alt1250_usockif.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/alt1250_usockif.h b/lte/alt1250/alt1250_usockif.h index df33f4cc73d..2ffcc02e46a 100644 --- a/lte/alt1250/alt1250_usockif.h +++ b/lte/alt1250/alt1250_usockif.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/alt1250_usockif.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/alt1250_util.c b/lte/alt1250/alt1250_util.c index 9346a6f4214..75fc00a3d33 100644 --- a/lte/alt1250/alt1250_util.c +++ b/lte/alt1250/alt1250_util.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/alt1250_util.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/alt1250_util.h b/lte/alt1250/alt1250_util.h index 85be0c992e1..ac60e05aa5c 100644 --- a/lte/alt1250/alt1250_util.h +++ b/lte/alt1250/alt1250_util.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/alt1250_util.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/callback_handlers/alt1250_evt.c b/lte/alt1250/callback_handlers/alt1250_evt.c index 73bf1a840c2..59cfe0bed95 100644 --- a/lte/alt1250/callback_handlers/alt1250_evt.c +++ b/lte/alt1250/callback_handlers/alt1250_evt.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/callback_handlers/alt1250_evt.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/callback_handlers/alt1250_evt.h b/lte/alt1250/callback_handlers/alt1250_evt.h index b87a4fcc884..9df097fe83b 100644 --- a/lte/alt1250/callback_handlers/alt1250_evt.h +++ b/lte/alt1250/callback_handlers/alt1250_evt.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/callback_handlers/alt1250_evt.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/usock_handlers/alt1250_accepthdlr.c b/lte/alt1250/usock_handlers/alt1250_accepthdlr.c index 9b2bf1d526d..4151425d802 100644 --- a/lte/alt1250/usock_handlers/alt1250_accepthdlr.c +++ b/lte/alt1250/usock_handlers/alt1250_accepthdlr.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/usock_handlers/alt1250_accepthdlr.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/usock_handlers/alt1250_bindhdlr.c b/lte/alt1250/usock_handlers/alt1250_bindhdlr.c index b79ea10cb65..85a12b0ee34 100644 --- a/lte/alt1250/usock_handlers/alt1250_bindhdlr.c +++ b/lte/alt1250/usock_handlers/alt1250_bindhdlr.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/usock_handlers/alt1250_bindhdlr.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/usock_handlers/alt1250_closehdlr.c b/lte/alt1250/usock_handlers/alt1250_closehdlr.c index c2c25dd1a48..6391046df67 100644 --- a/lte/alt1250/usock_handlers/alt1250_closehdlr.c +++ b/lte/alt1250/usock_handlers/alt1250_closehdlr.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/usock_handlers/alt1250_closehdlr.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/usock_handlers/alt1250_connecthdlr.c b/lte/alt1250/usock_handlers/alt1250_connecthdlr.c index 7df629b846f..cad728ab392 100644 --- a/lte/alt1250/usock_handlers/alt1250_connecthdlr.c +++ b/lte/alt1250/usock_handlers/alt1250_connecthdlr.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/usock_handlers/alt1250_connecthdlr.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/usock_handlers/alt1250_fwupdate.h b/lte/alt1250/usock_handlers/alt1250_fwupdate.h index 23b23266819..38281cdc01c 100644 --- a/lte/alt1250/usock_handlers/alt1250_fwupdate.h +++ b/lte/alt1250/usock_handlers/alt1250_fwupdate.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/usock_handlers/alt1250_fwupdate.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/usock_handlers/alt1250_getpeernamehdlr.c b/lte/alt1250/usock_handlers/alt1250_getpeernamehdlr.c index aa42593255d..5374b06c81e 100644 --- a/lte/alt1250/usock_handlers/alt1250_getpeernamehdlr.c +++ b/lte/alt1250/usock_handlers/alt1250_getpeernamehdlr.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/usock_handlers/alt1250_getpeernamehdlr.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/usock_handlers/alt1250_getsocknamehdlr.c b/lte/alt1250/usock_handlers/alt1250_getsocknamehdlr.c index b6df948874f..23350cf1ab2 100644 --- a/lte/alt1250/usock_handlers/alt1250_getsocknamehdlr.c +++ b/lte/alt1250/usock_handlers/alt1250_getsocknamehdlr.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/usock_handlers/alt1250_getsocknamehdlr.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/usock_handlers/alt1250_getsockopthdlr.c b/lte/alt1250/usock_handlers/alt1250_getsockopthdlr.c index 28174fce83f..2805cd57472 100644 --- a/lte/alt1250/usock_handlers/alt1250_getsockopthdlr.c +++ b/lte/alt1250/usock_handlers/alt1250_getsockopthdlr.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/usock_handlers/alt1250_getsockopthdlr.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/usock_handlers/alt1250_ioctl_denyinetsock.c b/lte/alt1250/usock_handlers/alt1250_ioctl_denyinetsock.c index 8de3ff1423c..d85ca7ac054 100644 --- a/lte/alt1250/usock_handlers/alt1250_ioctl_denyinetsock.c +++ b/lte/alt1250/usock_handlers/alt1250_ioctl_denyinetsock.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/usock_handlers/alt1250_ioctl_denyinetsock.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/usock_handlers/alt1250_ioctl_event.c b/lte/alt1250/usock_handlers/alt1250_ioctl_event.c index 913f456d4e7..cf7ee532aff 100644 --- a/lte/alt1250/usock_handlers/alt1250_ioctl_event.c +++ b/lte/alt1250/usock_handlers/alt1250_ioctl_event.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/usock_handlers/alt1250_ioctl_event.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/usock_handlers/alt1250_ioctl_fwupdate.c b/lte/alt1250/usock_handlers/alt1250_ioctl_fwupdate.c index 7fa67e29871..dfd6c41ae91 100644 --- a/lte/alt1250/usock_handlers/alt1250_ioctl_fwupdate.c +++ b/lte/alt1250/usock_handlers/alt1250_ioctl_fwupdate.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/usock_handlers/alt1250_ioctl_fwupdate.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/usock_handlers/alt1250_ioctl_ifreq.c b/lte/alt1250/usock_handlers/alt1250_ioctl_ifreq.c index 875361681b2..6a948c653ae 100644 --- a/lte/alt1250/usock_handlers/alt1250_ioctl_ifreq.c +++ b/lte/alt1250/usock_handlers/alt1250_ioctl_ifreq.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/usock_handlers/alt1250_ioctl_ifreq.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/usock_handlers/alt1250_ioctl_ltecmd.c b/lte/alt1250/usock_handlers/alt1250_ioctl_ltecmd.c index 82e211f6f62..889f9b41f2d 100644 --- a/lte/alt1250/usock_handlers/alt1250_ioctl_ltecmd.c +++ b/lte/alt1250/usock_handlers/alt1250_ioctl_ltecmd.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/usock_handlers/alt1250_ioctl_ltecmd.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/usock_handlers/alt1250_ioctl_lwm2m.c b/lte/alt1250/usock_handlers/alt1250_ioctl_lwm2m.c index ea82ad92b8f..e68704a8723 100644 --- a/lte/alt1250/usock_handlers/alt1250_ioctl_lwm2m.c +++ b/lte/alt1250/usock_handlers/alt1250_ioctl_lwm2m.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/usock_handlers/alt1250_ioctl_lwm2m.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/usock_handlers/alt1250_ioctl_normal.c b/lte/alt1250/usock_handlers/alt1250_ioctl_normal.c index 8c116833ae6..90b3a678f12 100644 --- a/lte/alt1250/usock_handlers/alt1250_ioctl_normal.c +++ b/lte/alt1250/usock_handlers/alt1250_ioctl_normal.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/usock_handlers/alt1250_ioctl_normal.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/usock_handlers/alt1250_ioctl_other.c b/lte/alt1250/usock_handlers/alt1250_ioctl_other.c index 5010c84d5b8..057553a5cd6 100644 --- a/lte/alt1250/usock_handlers/alt1250_ioctl_other.c +++ b/lte/alt1250/usock_handlers/alt1250_ioctl_other.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/usock_handlers/alt1250_ioctl_other.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/usock_handlers/alt1250_ioctl_power.c b/lte/alt1250/usock_handlers/alt1250_ioctl_power.c index 21e62462ddf..c910060c168 100644 --- a/lte/alt1250/usock_handlers/alt1250_ioctl_power.c +++ b/lte/alt1250/usock_handlers/alt1250_ioctl_power.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/usock_handlers/alt1250_ioctl_power.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/usock_handlers/alt1250_ioctl_subhdlr.h b/lte/alt1250/usock_handlers/alt1250_ioctl_subhdlr.h index 6ce7a1b74e7..fcd3b00f8ee 100644 --- a/lte/alt1250/usock_handlers/alt1250_ioctl_subhdlr.h +++ b/lte/alt1250/usock_handlers/alt1250_ioctl_subhdlr.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/usock_handlers/alt1250_ioctl_subhdlr.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/usock_handlers/alt1250_ioctlhdlr.c b/lte/alt1250/usock_handlers/alt1250_ioctlhdlr.c index 568d199282d..43d638024e7 100644 --- a/lte/alt1250/usock_handlers/alt1250_ioctlhdlr.c +++ b/lte/alt1250/usock_handlers/alt1250_ioctlhdlr.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/usock_handlers/alt1250_ioctlhdlr.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/usock_handlers/alt1250_listenhdlr.c b/lte/alt1250/usock_handlers/alt1250_listenhdlr.c index a3c3bed263a..4c66beeafe3 100644 --- a/lte/alt1250/usock_handlers/alt1250_listenhdlr.c +++ b/lte/alt1250/usock_handlers/alt1250_listenhdlr.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/usock_handlers/alt1250_listenhdlr.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/usock_handlers/alt1250_recvfromhdlr.c b/lte/alt1250/usock_handlers/alt1250_recvfromhdlr.c index 906a0b9bb81..b2c45f1391b 100644 --- a/lte/alt1250/usock_handlers/alt1250_recvfromhdlr.c +++ b/lte/alt1250/usock_handlers/alt1250_recvfromhdlr.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/usock_handlers/alt1250_recvfromhdlr.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/usock_handlers/alt1250_sendtohdlr.c b/lte/alt1250/usock_handlers/alt1250_sendtohdlr.c index e47b26d9f5d..2894354f23c 100644 --- a/lte/alt1250/usock_handlers/alt1250_sendtohdlr.c +++ b/lte/alt1250/usock_handlers/alt1250_sendtohdlr.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/usock_handlers/alt1250_sendtohdlr.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/usock_handlers/alt1250_setsockopthdlr.c b/lte/alt1250/usock_handlers/alt1250_setsockopthdlr.c index f4c5106b116..247053bedf4 100644 --- a/lte/alt1250/usock_handlers/alt1250_setsockopthdlr.c +++ b/lte/alt1250/usock_handlers/alt1250_setsockopthdlr.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/usock_handlers/alt1250_setsockopthdlr.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/usock_handlers/alt1250_shutdownhdlr.c b/lte/alt1250/usock_handlers/alt1250_shutdownhdlr.c index 0c8a9765b00..30a507c52f3 100644 --- a/lte/alt1250/usock_handlers/alt1250_shutdownhdlr.c +++ b/lte/alt1250/usock_handlers/alt1250_shutdownhdlr.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/usock_handlers/alt1250_shutdownhdlr.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/usock_handlers/alt1250_sms.c b/lte/alt1250/usock_handlers/alt1250_sms.c index 610669cfc5e..5f70beff846 100644 --- a/lte/alt1250/usock_handlers/alt1250_sms.c +++ b/lte/alt1250/usock_handlers/alt1250_sms.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/usock_handlers/alt1250_sms.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/usock_handlers/alt1250_sms.h b/lte/alt1250/usock_handlers/alt1250_sms.h index 8f0707a80b8..11f9b4dce36 100644 --- a/lte/alt1250/usock_handlers/alt1250_sms.h +++ b/lte/alt1250/usock_handlers/alt1250_sms.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/usock_handlers/alt1250_sms.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/usock_handlers/alt1250_sockethdlr.c b/lte/alt1250/usock_handlers/alt1250_sockethdlr.c index 8d632187950..e6046f36e4c 100644 --- a/lte/alt1250/usock_handlers/alt1250_sockethdlr.c +++ b/lte/alt1250/usock_handlers/alt1250_sockethdlr.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/usock_handlers/alt1250_sockethdlr.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/alt1250/usock_handlers/alt1250_usrsock_hdlr.h b/lte/alt1250/usock_handlers/alt1250_usrsock_hdlr.h index 7bd85b2ae8e..5142389fc18 100644 --- a/lte/alt1250/usock_handlers/alt1250_usrsock_hdlr.h +++ b/lte/alt1250/usock_handlers/alt1250_usrsock_hdlr.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/alt1250/usock_handlers/alt1250_usrsock_hdlr.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/lapi/CMakeLists.txt b/lte/lapi/CMakeLists.txt index 53ea4de4a44..45c0d852d22 100644 --- a/lte/lapi/CMakeLists.txt +++ b/lte/lapi/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/lte/lapi/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/lte/lapi/Make.defs b/lte/lapi/Make.defs index 77996b20e17..9fd239fc243 100644 --- a/lte/lapi/Make.defs +++ b/lte/lapi/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/lte/lapi/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/lte/lapi/Makefile b/lte/lapi/Makefile index 55d9362f7cc..936206501f4 100644 --- a/lte/lapi/Makefile +++ b/lte/lapi/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/lte/lapi/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/lte/lapi/src/Make.defs b/lte/lapi/src/Make.defs index daa28436505..4a6816e8644 100644 --- a/lte/lapi/src/Make.defs +++ b/lte/lapi/src/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/lte/lapi/src/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/lte/lapi/src/lapi_dbg.h b/lte/lapi/src/lapi_dbg.h index 092e13f88d1..403847653af 100644 --- a/lte/lapi/src/lapi_dbg.h +++ b/lte/lapi/src/lapi_dbg.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/lapi/src/lapi_dbg.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/lapi/src/lapi_evt.c b/lte/lapi/src/lapi_evt.c index cc047584b17..3826a5073bc 100644 --- a/lte/lapi/src/lapi_evt.c +++ b/lte/lapi/src/lapi_evt.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/lapi/src/lapi_evt.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/lapi/src/lapi_firmware.c b/lte/lapi/src/lapi_firmware.c index a02113f0a53..203c4afb7ff 100644 --- a/lte/lapi/src/lapi_firmware.c +++ b/lte/lapi/src/lapi_firmware.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/lapi/src/lapi_firmware.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/lapi/src/lapi_log.c b/lte/lapi/src/lapi_log.c index 547b1b1fd95..1ddf2e4f2c8 100644 --- a/lte/lapi/src/lapi_log.c +++ b/lte/lapi/src/lapi_log.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/lapi/src/lapi_log.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/lapi/src/lapi_lwm2m.c b/lte/lapi/src/lapi_lwm2m.c index 8542f680763..47a5d9f59c5 100644 --- a/lte/lapi/src/lapi_lwm2m.c +++ b/lte/lapi/src/lapi_lwm2m.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/lapi/src/lapi_lwm2m.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/lapi/src/lapi_net.c b/lte/lapi/src/lapi_net.c index e68583b3523..9eaae54afb4 100644 --- a/lte/lapi/src/lapi_net.c +++ b/lte/lapi/src/lapi_net.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/lapi/src/lapi_net.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/lapi/src/lapi_other.c b/lte/lapi/src/lapi_other.c index 4897bed85b0..b7d6a2b64b6 100644 --- a/lte/lapi/src/lapi_other.c +++ b/lte/lapi/src/lapi_other.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/lapi/src/lapi_other.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/lapi/src/lapi_pdn.c b/lte/lapi/src/lapi_pdn.c index 5fc0451b0c4..def048d70fe 100644 --- a/lte/lapi/src/lapi_pdn.c +++ b/lte/lapi/src/lapi_pdn.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/lapi/src/lapi_pdn.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/lapi/src/lapi_pin.c b/lte/lapi/src/lapi_pin.c index 31135b7fa56..0a0496fa7c4 100644 --- a/lte/lapi/src/lapi_pin.c +++ b/lte/lapi/src/lapi_pin.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/lapi/src/lapi_pin.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/lapi/src/lapi_power.c b/lte/lapi/src/lapi_power.c index c37e45474fe..31ae86df08b 100644 --- a/lte/lapi/src/lapi_power.c +++ b/lte/lapi/src/lapi_power.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/lapi/src/lapi_power.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/lapi/src/lapi_psave.c b/lte/lapi/src/lapi_psave.c index 10defd44c30..8bc3aab0281 100644 --- a/lte/lapi/src/lapi_psave.c +++ b/lte/lapi/src/lapi_psave.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/lapi/src/lapi_psave.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/lapi/src/lapi_radio.c b/lte/lapi/src/lapi_radio.c index 0ba12362f62..09ce0aa0585 100644 --- a/lte/lapi/src/lapi_radio.c +++ b/lte/lapi/src/lapi_radio.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/lapi/src/lapi_radio.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/lte/lapi/src/lapi_sim.c b/lte/lapi/src/lapi_sim.c index dcf7efc1bc3..7de40441767 100644 --- a/lte/lapi/src/lapi_sim.c +++ b/lte/lapi/src/lapi_sim.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/lte/lapi/src/lapi_sim.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The From efefa6d87d83e4bfbacadb098bd85ef8d0c164f7 Mon Sep 17 00:00:00 2001 From: Alin Jerpelea Date: Fri, 20 Dec 2024 05:33:23 +0100 Subject: [PATCH 084/391] math: migrate to SPDX identifier Most tools used for compliance and SBOM generation use SPDX identifiers This change brings us a step closer to an easy SBOM generation. Signed-off-by: Alin Jerpelea --- math/CMakeLists.txt | 2 ++ math/Make.defs | 2 ++ math/Makefile | 2 ++ math/gemmlowp/CMakeLists.txt | 2 ++ math/gemmlowp/Make.defs | 2 ++ math/gemmlowp/Makefile | 2 ++ math/kissfft/CMakeLists.txt | 2 ++ math/kissfft/Make.defs | 2 ++ math/kissfft/Makefile | 2 ++ math/libtommath/CMakeLists.txt | 2 ++ math/libtommath/Make.defs | 2 ++ math/libtommath/Makefile | 2 ++ math/ruy/CMakeLists.txt | 2 ++ math/ruy/Make.defs | 2 ++ math/ruy/Makefile | 4 +++- 15 files changed, 31 insertions(+), 1 deletion(-) diff --git a/math/CMakeLists.txt b/math/CMakeLists.txt index a6f7d9ccc57..1b9defeae0f 100644 --- a/math/CMakeLists.txt +++ b/math/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/math/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/math/Make.defs b/math/Make.defs index 36941e940a0..33017a5a22f 100644 --- a/math/Make.defs +++ b/math/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/math/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/math/Makefile b/math/Makefile index de43fcc1908..e90cc1048b3 100644 --- a/math/Makefile +++ b/math/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/math/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/math/gemmlowp/CMakeLists.txt b/math/gemmlowp/CMakeLists.txt index acff6f11304..b13b1279485 100644 --- a/math/gemmlowp/CMakeLists.txt +++ b/math/gemmlowp/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/math/gemmlowp/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/math/gemmlowp/Make.defs b/math/gemmlowp/Make.defs index ecd7abd03fd..a89b55ebb29 100644 --- a/math/gemmlowp/Make.defs +++ b/math/gemmlowp/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/math/gemmlowp/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/math/gemmlowp/Makefile b/math/gemmlowp/Makefile index 3f5b76456ac..cceda46d5b5 100644 --- a/math/gemmlowp/Makefile +++ b/math/gemmlowp/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/math/gemmlowp/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/math/kissfft/CMakeLists.txt b/math/kissfft/CMakeLists.txt index 86841307542..7273f0e091b 100644 --- a/math/kissfft/CMakeLists.txt +++ b/math/kissfft/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/math/kissfft/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/math/kissfft/Make.defs b/math/kissfft/Make.defs index 3da1486c9b2..847608309e7 100644 --- a/math/kissfft/Make.defs +++ b/math/kissfft/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/math/kissfft/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/math/kissfft/Makefile b/math/kissfft/Makefile index 3a3b2e824c9..ff4fe9ee3bc 100644 --- a/math/kissfft/Makefile +++ b/math/kissfft/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/math/kissfft/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/math/libtommath/CMakeLists.txt b/math/libtommath/CMakeLists.txt index b6c5c6f0a21..211c755e198 100644 --- a/math/libtommath/CMakeLists.txt +++ b/math/libtommath/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/math/libtommath/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/math/libtommath/Make.defs b/math/libtommath/Make.defs index 6531ad3ae33..61dcb1f655b 100644 --- a/math/libtommath/Make.defs +++ b/math/libtommath/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/math/libtommath/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/math/libtommath/Makefile b/math/libtommath/Makefile index 4c54d99edb4..91b47d46376 100644 --- a/math/libtommath/Makefile +++ b/math/libtommath/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/math/libtommath/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/math/ruy/CMakeLists.txt b/math/ruy/CMakeLists.txt index b31f497f271..79ac2ac2b0d 100644 --- a/math/ruy/CMakeLists.txt +++ b/math/ruy/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/math/ruy/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/math/ruy/Make.defs b/math/ruy/Make.defs index bdba60a4857..bd91a3663ec 100644 --- a/math/ruy/Make.defs +++ b/math/ruy/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/math/ruy/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/math/ruy/Makefile b/math/ruy/Makefile index aa9b2be5e7b..188b81fff93 100644 --- a/math/ruy/Makefile +++ b/math/ruy/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/math/ruy/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The @@ -39,4 +41,4 @@ endif CFLAGS += ${INCDIR_PREFIX}$(APPDIR)/math/ruy/ruy CXXFLAGS += ${INCDIR_PREFIX}$(APPDIR)/math/ruy/ruy -include $(APPDIR)/Application.mk \ No newline at end of file +include $(APPDIR)/Application.mk From 7220a3bf48cbfc4a1d4d4b940849a7149d29af93 Mon Sep 17 00:00:00 2001 From: Alin Jerpelea Date: Fri, 20 Dec 2024 05:44:24 +0100 Subject: [PATCH 085/391] mlearning: migrate to SPDX identifier Most tools used for compliance and SBOM generation use SPDX identifiers This change brings us a step closer to an easy SBOM generation. Signed-off-by: Alin Jerpelea --- mlearning/CMakeLists.txt | 2 ++ mlearning/Make.defs | 2 ++ mlearning/Makefile | 2 ++ mlearning/cmsis-nn/CMakeLists.txt | 2 ++ mlearning/cmsis-nn/Make.defs | 2 ++ mlearning/cmsis-nn/Makefile | 2 ++ mlearning/cmsis/Make.defs | 2 ++ mlearning/cmsis/Makefile | 2 ++ mlearning/cmsis/cmsis-nn-support_nnabla.patch | 20 +++++++++---------- mlearning/cmsis/libcmsisdsp/Make.defs | 2 ++ mlearning/cmsis/libcmsisdsp/Makefile | 2 ++ mlearning/cmsis/libcmsisnn/Make.defs | 2 ++ mlearning/cmsis/libcmsisnn/Makefile | 2 ++ mlearning/darknet/Make.defs | 2 ++ mlearning/darknet/Makefile | 2 ++ mlearning/libnnablart/Make.defs | 2 ++ mlearning/libnnablart/Makefile | 2 ++ mlearning/tflite-micro/CMakeLists.txt | 2 ++ mlearning/tflite-micro/Make.defs | 2 ++ mlearning/tflite-micro/Makefile | 2 ++ .../operators/neon/arm_convolve_s8.c | 5 ++--- .../operators/neon/arm_elementwise_add_s8.c | 5 ++--- .../neon/arm_nn_mat_mult_kernel_s8_s16.c | 5 ++--- .../neon/arm_q7_to_q15_with_offset.c | 5 ++--- mlearning/tflite-micro/tflm_syslog.cc | 2 ++ mlearning/tflite-micro/tflm_tool.cc | 2 ++ 26 files changed, 60 insertions(+), 22 deletions(-) diff --git a/mlearning/CMakeLists.txt b/mlearning/CMakeLists.txt index c4b8742ba35..78ba1da4ae3 100644 --- a/mlearning/CMakeLists.txt +++ b/mlearning/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/mlearning/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/mlearning/Make.defs b/mlearning/Make.defs index 5ad683160eb..6b5d35fe887 100644 --- a/mlearning/Make.defs +++ b/mlearning/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/mlearning/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/mlearning/Makefile b/mlearning/Makefile index bf7d539bba0..435024a1151 100644 --- a/mlearning/Makefile +++ b/mlearning/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/mlearning/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/mlearning/cmsis-nn/CMakeLists.txt b/mlearning/cmsis-nn/CMakeLists.txt index 43cbcfe8941..e5997cb35b4 100644 --- a/mlearning/cmsis-nn/CMakeLists.txt +++ b/mlearning/cmsis-nn/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/mlearning/cmsis-nn/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/mlearning/cmsis-nn/Make.defs b/mlearning/cmsis-nn/Make.defs index 669ca73a283..760173037f1 100644 --- a/mlearning/cmsis-nn/Make.defs +++ b/mlearning/cmsis-nn/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/mlearning/cmsis/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/mlearning/cmsis-nn/Makefile b/mlearning/cmsis-nn/Makefile index 9254c850202..cd81172758a 100644 --- a/mlearning/cmsis-nn/Makefile +++ b/mlearning/cmsis-nn/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/mlearning/cmsis-nn/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/mlearning/cmsis/Make.defs b/mlearning/cmsis/Make.defs index e36031b92dc..845fa6017e1 100644 --- a/mlearning/cmsis/Make.defs +++ b/mlearning/cmsis/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/mlearning/cmsis/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/mlearning/cmsis/Makefile b/mlearning/cmsis/Makefile index 8bed4380ed7..0ddb4b33079 100644 --- a/mlearning/cmsis/Makefile +++ b/mlearning/cmsis/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/mlearning/cmsis/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/mlearning/cmsis/cmsis-nn-support_nnabla.patch b/mlearning/cmsis/cmsis-nn-support_nnabla.patch index 4de8d687289..58e3a3d8d12 100644 --- a/mlearning/cmsis/cmsis-nn-support_nnabla.patch +++ b/mlearning/cmsis/cmsis-nn-support_nnabla.patch @@ -11,10 +11,10 @@ to add the following function prototypes: +++ CMSIS_5/CMSIS/NN/Include/arm_nnfunctions_nnabla.h @@ -0,0 +1,217 @@ +/* -+ * Copyright (C) 2010-2018 Arm Limited or its affiliates. All rights reserved. -+ * Copyright 2018 Sony Corporation + * + * SPDX-License-Identifier: Apache-2.0 ++ * SPDX-FileCopyrightText: 2010-2018 Arm Limited or its affiliates. ++ * SPDX-FileCopyrightText: 2018 Sony Corporation + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. @@ -237,10 +237,10 @@ Sony Corporation added this file to 5.4.0 for these reasons: +++ CMSIS_5/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_CHW_f32_basic_nonsquare.c @@ -0,0 +1,207 @@ +/* -+ * Copyright (C) 2010-2018 Arm Limited or its affiliates. All rights reserved. -+ * Copyright 2018 Sony Corporation + * + * SPDX-License-Identifier: Apache-2.0 ++ * SPDX-FileCopyrightText: 2010-2018 Arm Limited or its affiliates. ++ * SPDX-FileCopyrightText: 2018 Sony Corporation + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. @@ -451,10 +451,10 @@ Sony Corporation added this file to 5.4.0 to support the CHW tensor layout +++ CMSIS_5/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_CHW_q15_basic_nonsquare.c @@ -0,0 +1,231 @@ +/* -+ * Copyright (C) 2010-2018 Arm Limited or its affiliates. All rights reserved. -+ * Copyright 2018 Sony Corporation + * + * SPDX-License-Identifier: Apache-2.0 ++ * SPDX-FileCopyrightText: 2010-2018 Arm Limited or its affiliates. ++ * SPDX-FileCopyrightText: 2018 Sony Corporation + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. @@ -689,10 +689,10 @@ Sony Corporation added this file to 5.4.0 to support the CHW tensor layout +++ CMSIS_5/CMSIS/NN/Source/ConvolutionFunctions/arm_convolve_CHW_q7_basic_nonsquare.c @@ -0,0 +1,214 @@ +/* -+ * Copyright (C) 2010-2018 Arm Limited or its affiliates. All rights reserved. -+ * Copyright 2018 Sony Corporation + * + * SPDX-License-Identifier: Apache-2.0 ++ * SPDX-FileCopyrightText: 2010-2018 Arm Limited or its affiliates. ++ * SPDX-FileCopyrightText: 2018 Sony Corporation + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. @@ -910,10 +910,10 @@ Sony Corporation added this file to 5.4.0 to support the CHW tensor layout +++ CMSIS_5/CMSIS/NN/Source/ConvolutionFunctions/arm_nn_CHW_mat_mult_kernel_q7_q15.c @@ -0,0 +1,196 @@ +/* -+ * Copyright (C) 2010-2018 Arm Limited or its affiliates. All rights reserved. -+ * Copyright 2018 Sony Corporation + * + * SPDX-License-Identifier: Apache-2.0 ++ * SPDX-FileCopyrightText: 2010-2018 Arm Limited or its affiliates. ++ * SPDX-FileCopyrightText: 2018 Sony Corporation + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. diff --git a/mlearning/cmsis/libcmsisdsp/Make.defs b/mlearning/cmsis/libcmsisdsp/Make.defs index de9d8ea51d0..df93ea67807 100644 --- a/mlearning/cmsis/libcmsisdsp/Make.defs +++ b/mlearning/cmsis/libcmsisdsp/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/mlearning/cmsis/libcmsisdsp/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/mlearning/cmsis/libcmsisdsp/Makefile b/mlearning/cmsis/libcmsisdsp/Makefile index 8fd73168550..141b7cafac4 100644 --- a/mlearning/cmsis/libcmsisdsp/Makefile +++ b/mlearning/cmsis/libcmsisdsp/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/mlearning/cmsis/libcmsisdsp/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/mlearning/cmsis/libcmsisnn/Make.defs b/mlearning/cmsis/libcmsisnn/Make.defs index 187ff5557f3..5119cdb3d0c 100644 --- a/mlearning/cmsis/libcmsisnn/Make.defs +++ b/mlearning/cmsis/libcmsisnn/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/mlearning/cmsis/libcmsisnn/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/mlearning/cmsis/libcmsisnn/Makefile b/mlearning/cmsis/libcmsisnn/Makefile index 759b05f4cd6..63cb79e7c48 100644 --- a/mlearning/cmsis/libcmsisnn/Makefile +++ b/mlearning/cmsis/libcmsisnn/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/mlearning/cmsis/libcmsisnn/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/mlearning/darknet/Make.defs b/mlearning/darknet/Make.defs index b06d5b5349e..41c1569e817 100644 --- a/mlearning/darknet/Make.defs +++ b/mlearning/darknet/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/mlearning/darknet/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/mlearning/darknet/Makefile b/mlearning/darknet/Makefile index cfb379466ac..627245fbd1e 100644 --- a/mlearning/darknet/Makefile +++ b/mlearning/darknet/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/mlearning/darknet/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/mlearning/libnnablart/Make.defs b/mlearning/libnnablart/Make.defs index 8733fa2c900..2f57a0af653 100644 --- a/mlearning/libnnablart/Make.defs +++ b/mlearning/libnnablart/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/mlearning/libnnablart/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/mlearning/libnnablart/Makefile b/mlearning/libnnablart/Makefile index 32735670fc7..8d7c726c68b 100644 --- a/mlearning/libnnablart/Makefile +++ b/mlearning/libnnablart/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/mlearning/libnnablart/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/mlearning/tflite-micro/CMakeLists.txt b/mlearning/tflite-micro/CMakeLists.txt index 0c072a88a07..e3a2830d1da 100644 --- a/mlearning/tflite-micro/CMakeLists.txt +++ b/mlearning/tflite-micro/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/mlearning/tflite-micro/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/mlearning/tflite-micro/Make.defs b/mlearning/tflite-micro/Make.defs index bd375253968..2148d663b47 100644 --- a/mlearning/tflite-micro/Make.defs +++ b/mlearning/tflite-micro/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/mlearning/tflite-micro/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/mlearning/tflite-micro/Makefile b/mlearning/tflite-micro/Makefile index dd0c1c6ad71..aba043805e7 100644 --- a/mlearning/tflite-micro/Makefile +++ b/mlearning/tflite-micro/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/mlearning/tflite-micro/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/mlearning/tflite-micro/operators/neon/arm_convolve_s8.c b/mlearning/tflite-micro/operators/neon/arm_convolve_s8.c index 3d8e5af5ce8..64a3150e10e 100644 --- a/mlearning/tflite-micro/operators/neon/arm_convolve_s8.c +++ b/mlearning/tflite-micro/operators/neon/arm_convolve_s8.c @@ -1,10 +1,9 @@ /**************************************************************************** * apps/mlearning/tflite-micro/operators/neon/arm_convolve_s8.c * - * SPDX-FileCopyrightText: Copyright 2010-2023 Arm Limited and/or - * its affiliates - * * SPDX-License-Identifier: Apache-2.0 + * SPDX-FileCopyrightText: 2010-2023 Arm Limited and/or its affiliates + * * * Licensed under the Apache License, Version 2.0 (the License); you may * not use this file except in compliance with the License. diff --git a/mlearning/tflite-micro/operators/neon/arm_elementwise_add_s8.c b/mlearning/tflite-micro/operators/neon/arm_elementwise_add_s8.c index d7147fbcec1..82718f94b74 100644 --- a/mlearning/tflite-micro/operators/neon/arm_elementwise_add_s8.c +++ b/mlearning/tflite-micro/operators/neon/arm_elementwise_add_s8.c @@ -1,10 +1,9 @@ /**************************************************************************** * apps/mlearning/tflite-micro/operators/neon/arm_elementwise_add_s8.c * - * SPDX-FileCopyrightText: Copyright 2010-2023 Arm Limited and/or - * its affiliates - * * SPDX-License-Identifier: Apache-2.0 + * SPDX-FileCopyrightText: 2010-2023 Arm Limited and/or its affiliates + * * * Licensed under the Apache License, Version 2.0 (the License); you may * not use this file except in compliance with the License. diff --git a/mlearning/tflite-micro/operators/neon/arm_nn_mat_mult_kernel_s8_s16.c b/mlearning/tflite-micro/operators/neon/arm_nn_mat_mult_kernel_s8_s16.c index 190edb74c7e..9d39cd37d3e 100644 --- a/mlearning/tflite-micro/operators/neon/arm_nn_mat_mult_kernel_s8_s16.c +++ b/mlearning/tflite-micro/operators/neon/arm_nn_mat_mult_kernel_s8_s16.c @@ -1,10 +1,9 @@ /**************************************************************************** * apps/mlearning/tflite-micro/operators/neon/arm_nn_mat_mult_kernel_s8_s16.c * - * SPDX-FileCopyrightText: Copyright 2010-2023 Arm Limited and/or - * its affiliates - * * SPDX-License-Identifier: Apache-2.0 + * SPDX-FileCopyrightText: 2010-2023 Arm Limited and/or its affiliates + * * * Licensed under the Apache License, Version 2.0 (the License); you may * not use this file except in compliance with the License. diff --git a/mlearning/tflite-micro/operators/neon/arm_q7_to_q15_with_offset.c b/mlearning/tflite-micro/operators/neon/arm_q7_to_q15_with_offset.c index 770e1a88cca..27349c2316b 100644 --- a/mlearning/tflite-micro/operators/neon/arm_q7_to_q15_with_offset.c +++ b/mlearning/tflite-micro/operators/neon/arm_q7_to_q15_with_offset.c @@ -1,10 +1,9 @@ /**************************************************************************** * apps/mlearning/tflite-micro/operators/neon/arm_q7_to_q15_with_offset.c * - * SPDX-FileCopyrightText: Copyright 2010-2023 Arm Limited and/or - * its affiliates - * * SPDX-License-Identifier: Apache-2.0 + * SPDX-FileCopyrightText: 2010-2023 Arm Limited and/or its affiliates + * * * Licensed under the Apache License, Version 2.0 (the License); you may * not use this file except in compliance with the License. diff --git a/mlearning/tflite-micro/tflm_syslog.cc b/mlearning/tflite-micro/tflm_syslog.cc index f306a9153bf..9a795eeba68 100644 --- a/mlearning/tflite-micro/tflm_syslog.cc +++ b/mlearning/tflite-micro/tflm_syslog.cc @@ -1,6 +1,8 @@ /**************************************************************************** * apps/mlearning/tflite-micro/tflm_syslog.cc * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/mlearning/tflite-micro/tflm_tool.cc b/mlearning/tflite-micro/tflm_tool.cc index df71500b2d2..8edcf45a49b 100644 --- a/mlearning/tflite-micro/tflm_tool.cc +++ b/mlearning/tflite-micro/tflm_tool.cc @@ -1,6 +1,8 @@ /**************************************************************************** * apps/mlearning/tflite-micro/tflm_tool.cc * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The From a53ac351f6a0b7518138e1b27dd1fc3e616509ef Mon Sep 17 00:00:00 2001 From: Alin Jerpelea Date: Fri, 20 Dec 2024 05:58:52 +0100 Subject: [PATCH 086/391] modbus: migrate to SPDX identifier Most tools used for compliance and SBOM generation use SPDX identifiers This change brings us a step closer to an easy SBOM generation. Signed-off-by: Alin Jerpelea --- modbus/CMakeLists.txt | 20 +------------------- modbus/Make.defs | 2 ++ modbus/Makefile | 2 ++ modbus/ascii/Make.defs | 2 ++ modbus/ascii/mbascii.c | 5 ++--- modbus/ascii/mbascii.h | 5 ++--- modbus/functions/Make.defs | 2 ++ modbus/functions/mbfunccoils.c | 5 ++--- modbus/functions/mbfunccoils_m.c | 5 ++--- modbus/functions/mbfuncdiag.c | 5 ++--- modbus/functions/mbfuncdisc.c | 5 ++--- modbus/functions/mbfuncdisc_m.c | 5 ++--- modbus/functions/mbfuncholding.c | 5 ++--- modbus/functions/mbfuncholding_m.c | 5 ++--- modbus/functions/mbfuncinput.c | 5 ++--- modbus/functions/mbfuncinput_m.c | 5 ++--- modbus/functions/mbfuncother.c | 5 ++--- modbus/functions/mbutils.c | 5 ++--- modbus/mb.c | 5 ++--- modbus/mb_m.c | 4 ++-- modbus/nuttx/Make.defs | 2 ++ modbus/nuttx/port.h | 5 ++--- modbus/nuttx/portevent.c | 5 ++--- modbus/nuttx/portevent_m.c | 7 +++---- modbus/nuttx/portother.c | 5 ++--- modbus/nuttx/portother_m.c | 5 ++--- modbus/nuttx/portserial.c | 5 ++--- modbus/nuttx/portserial_m.c | 7 +++---- modbus/nuttx/porttimer.c | 5 ++--- modbus/nuttx/porttimer_m.c | 7 +++---- modbus/rtu/Make.defs | 2 ++ modbus/rtu/mbcrc.c | 5 ++--- modbus/rtu/mbcrc.h | 5 ++--- modbus/rtu/mbrtu.c | 5 ++--- modbus/rtu/mbrtu.h | 5 ++--- modbus/rtu/mbrtu_m.c | 5 ++--- modbus/rtu/mbrtu_m.h | 5 ++--- modbus/tcp/Make.defs | 2 ++ modbus/tcp/mbtcp.c | 5 ++--- modbus/tcp/mbtcp.h | 5 ++--- 40 files changed, 82 insertions(+), 117 deletions(-) diff --git a/modbus/CMakeLists.txt b/modbus/CMakeLists.txt index 27acd1fbe8d..ca4f56b5eaf 100644 --- a/modbus/CMakeLists.txt +++ b/modbus/CMakeLists.txt @@ -1,25 +1,7 @@ # ############################################################################## # apps/modbus/CMakeLists.txt # -# Licensed to the Apache Software Foundation (ASF) under one or more contributor -# license agreements. See the NOTICE file distributed with this work for -# additional information regarding copyright ownership. The ASF licenses this -# file to you under the Apache License, Version 2.0 (the "License"); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. -# -# ############################################################################## - -# ############################################################################## -# apps/modbus/CMakeLists.txt +# SPDX-License-Identifier: Apache-2.0 # # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for diff --git a/modbus/Make.defs b/modbus/Make.defs index 99d262bf082..10fd914c3af 100644 --- a/modbus/Make.defs +++ b/modbus/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/modbus/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/modbus/Makefile b/modbus/Makefile index 3589d9017da..ce7eac1d5d0 100644 --- a/modbus/Makefile +++ b/modbus/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/modbus/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/modbus/ascii/Make.defs b/modbus/ascii/Make.defs index 4d671d314a6..972cd903fff 100644 --- a/modbus/ascii/Make.defs +++ b/modbus/ascii/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/modbus/ascii/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/modbus/ascii/mbascii.c b/modbus/ascii/mbascii.c index a4bf5a1861a..2394ecca5f4 100644 --- a/modbus/ascii/mbascii.c +++ b/modbus/ascii/mbascii.c @@ -1,9 +1,8 @@ /**************************************************************************** * apps/modbus/ascii/mbascii.c * - * FreeModbus Library: A portable Modbus implementation for Modbus ASCII/RTU. - * Copyright (c) 2006 Christian Walter - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2006 Christian Walter * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modbus/ascii/mbascii.h b/modbus/ascii/mbascii.h index 71d63117b19..355484103ef 100644 --- a/modbus/ascii/mbascii.h +++ b/modbus/ascii/mbascii.h @@ -1,9 +1,8 @@ /**************************************************************************** * apps/modbus/ascii/mbascii.h * - * FreeModbus Library: A portable Modbus implementation for Modbus ASCII/RTU. - * Copyright (c) 2006 Christian Walter - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2006 Christian Walter * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modbus/functions/Make.defs b/modbus/functions/Make.defs index 979cf5d7988..a4e6ea90c40 100644 --- a/modbus/functions/Make.defs +++ b/modbus/functions/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/modbus/functions/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/modbus/functions/mbfunccoils.c b/modbus/functions/mbfunccoils.c index 0be07d56fb5..b742de0643b 100644 --- a/modbus/functions/mbfunccoils.c +++ b/modbus/functions/mbfunccoils.c @@ -1,9 +1,8 @@ /**************************************************************************** * apps/functions/mbfunccoils.c * - * FreeModbus Library: A portable Modbus implementation for Modbus ASCII/RTU. - * Copyright (c) 2006 Christian Walter - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2006 Christian Walter * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modbus/functions/mbfunccoils_m.c b/modbus/functions/mbfunccoils_m.c index 710504268ec..c258d757db8 100644 --- a/modbus/functions/mbfunccoils_m.c +++ b/modbus/functions/mbfunccoils_m.c @@ -1,9 +1,8 @@ /**************************************************************************** * apps/modbus/functions/mbfunccoils_m.c * - * FreeModbus Library: A portable Modbus implementation for Modbus ASCII/RTU. - * Copyright (C) 2013 Armink - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2013 Armink * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modbus/functions/mbfuncdiag.c b/modbus/functions/mbfuncdiag.c index a6ee8fa685a..b34581e6e7d 100644 --- a/modbus/functions/mbfuncdiag.c +++ b/modbus/functions/mbfuncdiag.c @@ -1,9 +1,8 @@ /**************************************************************************** * apps/modbus/functions/mbfuncdiag.c * - * FreeModbus Library: A portable Modbus implementation for Modbus ASCII/RTU. - * Copyright (c) 2006 Christian Walter - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2006 Christian Walter * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modbus/functions/mbfuncdisc.c b/modbus/functions/mbfuncdisc.c index 058bdd643c0..3f29072776d 100644 --- a/modbus/functions/mbfuncdisc.c +++ b/modbus/functions/mbfuncdisc.c @@ -1,9 +1,8 @@ /**************************************************************************** * apps/functions/mbfuncdisc.c * - * FreeModbus Library: A portable Modbus implementation for Modbus ASCII/RTU. - * Copyright (c) 2006 Christian Walter - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2006 Christian Walter * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modbus/functions/mbfuncdisc_m.c b/modbus/functions/mbfuncdisc_m.c index 24b620cb754..29386996d51 100644 --- a/modbus/functions/mbfuncdisc_m.c +++ b/modbus/functions/mbfuncdisc_m.c @@ -1,9 +1,8 @@ /**************************************************************************** * apps/modbus/functions/mbfuncdisc_m.c * - * FreeModbus Library: A portable Modbus implementation for Modbus ASCII/RTU. - * Copyright (C) 2013 Armink - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2013 Armink * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modbus/functions/mbfuncholding.c b/modbus/functions/mbfuncholding.c index 1f8b9989806..964db7a7941 100644 --- a/modbus/functions/mbfuncholding.c +++ b/modbus/functions/mbfuncholding.c @@ -1,9 +1,8 @@ /**************************************************************************** * apps/functions/mbfuncholding.c * - * FreeModbus Library: A portable Modbus implementation for Modbus ASCII/RTU. - * Copyright (c) 2006 Christian Walter - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2006 Christian Walter * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modbus/functions/mbfuncholding_m.c b/modbus/functions/mbfuncholding_m.c index 0407825633b..b017be7154d 100644 --- a/modbus/functions/mbfuncholding_m.c +++ b/modbus/functions/mbfuncholding_m.c @@ -1,9 +1,8 @@ /**************************************************************************** * apps/modbus/functions/mbfuncholding_m.c * - * FreeModbus Library: A portable Modbus implementation for Modbus ASCII/RTU. - * Copyright (C) 2013 Armink - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2013 Armink * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modbus/functions/mbfuncinput.c b/modbus/functions/mbfuncinput.c index 73eebb0564d..3874cf9660b 100644 --- a/modbus/functions/mbfuncinput.c +++ b/modbus/functions/mbfuncinput.c @@ -1,9 +1,8 @@ /**************************************************************************** * apps/functions/mbfuncinput.c * - * FreeModbus Library: A portable Modbus implementation for Modbus ASCII/RTU. - * Copyright (c) 2006 Christian Walter - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2006 Christian Walter * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modbus/functions/mbfuncinput_m.c b/modbus/functions/mbfuncinput_m.c index b9577a5cb3c..4ca7e811349 100644 --- a/modbus/functions/mbfuncinput_m.c +++ b/modbus/functions/mbfuncinput_m.c @@ -1,9 +1,8 @@ /**************************************************************************** * apps/modbus/functions/mbfuncinput_m.c * - * FreeModbus Library: A portable Modbus implementation for Modbus ASCII/RTU. - * Copyright (C) 2013 Armink - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2013 Armink * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modbus/functions/mbfuncother.c b/modbus/functions/mbfuncother.c index b0ebaaa5930..ede3fae0cda 100644 --- a/modbus/functions/mbfuncother.c +++ b/modbus/functions/mbfuncother.c @@ -1,9 +1,8 @@ /**************************************************************************** * apps/functions/mbfuncother.c * - * FreeModbus Library: A portable Modbus implementation for Modbus ASCII/RTU. - * Copyright (c) 2006 Christian Walter - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2006 Christian Walter * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modbus/functions/mbutils.c b/modbus/functions/mbutils.c index 3db155eb0b3..816fbe8b2ab 100644 --- a/modbus/functions/mbutils.c +++ b/modbus/functions/mbutils.c @@ -1,9 +1,8 @@ /**************************************************************************** * apps/functions/mbutils.c * - * FreeModbus Library: A portable Modbus implementation for Modbus ASCII/RTU. - * Copyright (c) 2006 Christian Walter - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2006 Christian Walter * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modbus/mb.c b/modbus/mb.c index 7a8155779ee..16f5567d887 100644 --- a/modbus/mb.c +++ b/modbus/mb.c @@ -1,9 +1,8 @@ /**************************************************************************** * apps/modbus/mb.c * - * FreeModbus Library: A portable Modbus implementation for Modbus ASCII/RTU. - * Copyright (c) 2006 Christian Walter - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2006 Christian Walter * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modbus/mb_m.c b/modbus/mb_m.c index 16323d7709d..108fdf67831 100644 --- a/modbus/mb_m.c +++ b/modbus/mb_m.c @@ -1,8 +1,8 @@ /**************************************************************************** * FreeModbus Library: A portable Modbus implementation for Modbus ASCII/RTU. * - * Copyright (C) 2013 Armink - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2013 Armink * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modbus/nuttx/Make.defs b/modbus/nuttx/Make.defs index 11f82abacb0..7960ecee463 100644 --- a/modbus/nuttx/Make.defs +++ b/modbus/nuttx/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/modbus/nuttx/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/modbus/nuttx/port.h b/modbus/nuttx/port.h index 4b75aceabf5..aada110ed26 100644 --- a/modbus/nuttx/port.h +++ b/modbus/nuttx/port.h @@ -1,9 +1,8 @@ /**************************************************************************** * apps/modbus/nuttx/port.h * - * FreeModbus Library: NuttX Port - * Copyright (c) 2006 Christian Walter - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2006 Christian Walter * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modbus/nuttx/portevent.c b/modbus/nuttx/portevent.c index d45c8bad619..bce6e9c5454 100644 --- a/modbus/nuttx/portevent.c +++ b/modbus/nuttx/portevent.c @@ -1,9 +1,8 @@ /**************************************************************************** * apps/modbus/nuttx/portevent.c * - * FreeModbus Library: NuttX Port - * Copyright (c) 2006 Christian Walter - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2006 Christian Walter * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modbus/nuttx/portevent_m.c b/modbus/nuttx/portevent_m.c index 2f6143943f7..fb40f4dee24 100644 --- a/modbus/nuttx/portevent_m.c +++ b/modbus/nuttx/portevent_m.c @@ -1,10 +1,9 @@ /**************************************************************************** * apps/modbus/nuttx/portevent_m.c * - * FreeModbus Library: NuttX Modbus Master Port - * Original work (c) 2006 Christian Walter - * Modified work (c) 2016 Vytautas Lukenskas - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2006 Christian Walter + * SPDX-FileCopyrightText: 2016 Vytautas Lukenskas * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modbus/nuttx/portother.c b/modbus/nuttx/portother.c index 7cb453819be..797ede0dc72 100644 --- a/modbus/nuttx/portother.c +++ b/modbus/nuttx/portother.c @@ -1,9 +1,8 @@ /**************************************************************************** * apps/modbus/nuttx/portother.c * - * FreeModbus Library: NuttX Port - * Copyright (c) 2006 Christian Walter - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2006 Christian Walter * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modbus/nuttx/portother_m.c b/modbus/nuttx/portother_m.c index 799cef6c683..1d703c1926e 100644 --- a/modbus/nuttx/portother_m.c +++ b/modbus/nuttx/portother_m.c @@ -1,9 +1,8 @@ /**************************************************************************** * apps/modbus/nuttx/portother_m.c * - * FreeModbus Library: NuttX Port - * Copyright (c) 2006 Christian Walter - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2006 Christian Walter * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modbus/nuttx/portserial.c b/modbus/nuttx/portserial.c index 3bf88794086..35155a732f5 100644 --- a/modbus/nuttx/portserial.c +++ b/modbus/nuttx/portserial.c @@ -1,9 +1,8 @@ /**************************************************************************** * apps/modbus/nuttx/portserial.c * - * FreeModbus Library: NuttX Port - * Copyright (c) 2006 Christian Walter - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2006 Christian Walter * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modbus/nuttx/portserial_m.c b/modbus/nuttx/portserial_m.c index ea3ad317438..98c11eb2842 100644 --- a/modbus/nuttx/portserial_m.c +++ b/modbus/nuttx/portserial_m.c @@ -1,10 +1,9 @@ /**************************************************************************** * apps/modbus/nuttx/portserial_m.c * - * FreeModbus Library: NuttX Modbus Master Port - * Original work (c) 2006 Christian Walter - * Modified work (c) 2016 Vytautas Lukenskas - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2006 Christian Walter + * SPDX-FileCopyrightText: 2016 Vytautas Lukenskas * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modbus/nuttx/porttimer.c b/modbus/nuttx/porttimer.c index 2a68654cf15..1685df6eeb1 100644 --- a/modbus/nuttx/porttimer.c +++ b/modbus/nuttx/porttimer.c @@ -1,9 +1,8 @@ /**************************************************************************** * apps/modbus/nuttx/porttimer.c * - * FreeModbus Library: NuttX Port - * Copyright (c) 2006 Christian Walter - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2006 Christian Walter * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modbus/nuttx/porttimer_m.c b/modbus/nuttx/porttimer_m.c index 96b355cc338..1e878aa00a6 100644 --- a/modbus/nuttx/porttimer_m.c +++ b/modbus/nuttx/porttimer_m.c @@ -1,10 +1,9 @@ /**************************************************************************** * apps/modbus/nuttx/porttimer_m.c * - * FreeModbus Library: NuttX Modbus Master Port - * Original work (c) 2006 Christian Walter - * Modified work (c) 2016 Vytautas Lukenskas - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2006 Christian Walter + * SPDX-FileCopyrightText: 2016 Vytautas Lukenskas * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modbus/rtu/Make.defs b/modbus/rtu/Make.defs index bc5ce1829a6..ac4ab7e2aa4 100644 --- a/modbus/rtu/Make.defs +++ b/modbus/rtu/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/modbus/rtu/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/modbus/rtu/mbcrc.c b/modbus/rtu/mbcrc.c index 5996f640815..dcaddec7193 100644 --- a/modbus/rtu/mbcrc.c +++ b/modbus/rtu/mbcrc.c @@ -1,9 +1,8 @@ /**************************************************************************** * apps/modbus/rtu/mbcrc.c * - * FreeModbus Library: A portable Modbus implementation for Modbus ASCII/RTU. - * Copyright (c) 2006 Christian Walter - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2006 Christian Walter * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modbus/rtu/mbcrc.h b/modbus/rtu/mbcrc.h index 707feb8ef66..56d3db5f890 100644 --- a/modbus/rtu/mbcrc.h +++ b/modbus/rtu/mbcrc.h @@ -1,9 +1,8 @@ /**************************************************************************** * apps/modutils/rtu/mbcrc.h * - * FreeModbus Library: A portable Modbus implementation for Modbus ASCII/RTU. - * Copyright (c) 2006 Christian Walter - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2006 Christian Walter * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modbus/rtu/mbrtu.c b/modbus/rtu/mbrtu.c index eb0d57d6261..cc6b1088e71 100644 --- a/modbus/rtu/mbrtu.c +++ b/modbus/rtu/mbrtu.c @@ -1,9 +1,8 @@ /**************************************************************************** * apps/modbus/rtu/mbrtu.c * - * FreeModbus Library: A portable Modbus implementation for Modbus ASCII/RTU. - * Copyright (c) 2006 Christian Walter - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2006 Christian Walter * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modbus/rtu/mbrtu.h b/modbus/rtu/mbrtu.h index 7ef009f17e7..418311bffd1 100644 --- a/modbus/rtu/mbrtu.h +++ b/modbus/rtu/mbrtu.h @@ -1,9 +1,8 @@ /**************************************************************************** * apps/modbus/rtu/mbrtu.h * - * FreeModbus Library: A portable Modbus implementation for Modbus ASCII/RTU. - * Copyright (c) 2006 Christian Walter - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2006 Christian Walter * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modbus/rtu/mbrtu_m.c b/modbus/rtu/mbrtu_m.c index 3fde5067002..85827472998 100644 --- a/modbus/rtu/mbrtu_m.c +++ b/modbus/rtu/mbrtu_m.c @@ -1,9 +1,8 @@ /**************************************************************************** * apps/modbus/rtu/mbrtu_m.c * - * FreeModbus Library: A portable Modbus implementation for Modbus ASCII/RTU. - * Copyright (c) 2013 China Beijing Armink - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2013 China Beijing Armink * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modbus/rtu/mbrtu_m.h b/modbus/rtu/mbrtu_m.h index 2a58a31305b..5fb2eee43ef 100644 --- a/modbus/rtu/mbrtu_m.h +++ b/modbus/rtu/mbrtu_m.h @@ -1,9 +1,8 @@ /**************************************************************************** * apps/modbus/rtu/mbrtu_m.h * - * FreeModbus Library: A portable Modbus implementation for Modbus ASCII/RTU. - * Copyright (c) 2013 China Beijing Armink - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2013 China Beijing Armink * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modbus/tcp/Make.defs b/modbus/tcp/Make.defs index 9503ca16bc3..dfd220f4107 100644 --- a/modbus/tcp/Make.defs +++ b/modbus/tcp/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/modbus/tcp/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/modbus/tcp/mbtcp.c b/modbus/tcp/mbtcp.c index 67d503ec7ae..ca9c41c433c 100644 --- a/modbus/tcp/mbtcp.c +++ b/modbus/tcp/mbtcp.c @@ -1,9 +1,8 @@ /**************************************************************************** * apps/modbus/tcp/mbtcp.c * - * FreeModbus Library: A portable Modbus implementation for Modbus ASCII/RTU. - * Copyright (c) 2006 Christian Walter - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2006 Christian Walter * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/modbus/tcp/mbtcp.h b/modbus/tcp/mbtcp.h index b44de01f102..39fa9c8ce44 100644 --- a/modbus/tcp/mbtcp.h +++ b/modbus/tcp/mbtcp.h @@ -1,9 +1,8 @@ /**************************************************************************** * apps/modbus/tcp/mbtcp.h * - * FreeModbus Library: A portable Modbus implementation for Modbus ASCII/RTU. - * Copyright (c) 2006 Christian Walter - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2006 Christian Walter * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions From ac8002d7d36d5f0db4cce6215a29fb9e7d3701a1 Mon Sep 17 00:00:00 2001 From: Alin Jerpelea Date: Fri, 20 Dec 2024 06:46:20 +0100 Subject: [PATCH 087/391] Cmake: migrate the license to ASF Xiaomi has submitted the SGA and we can migate the license to ASF Signed-off-by: Alin Jerpelea --- netutils/mqttc/CMakeLists.txt | 22 ++++++++++++++-------- netutils/nng/CMakeLists.txt | 22 ++++++++++++++-------- 2 files changed, 28 insertions(+), 16 deletions(-) diff --git a/netutils/mqttc/CMakeLists.txt b/netutils/mqttc/CMakeLists.txt index 664539d9f42..246cd191941 100644 --- a/netutils/mqttc/CMakeLists.txt +++ b/netutils/mqttc/CMakeLists.txt @@ -1,18 +1,24 @@ +############################################################################ +# apps/netutils/mqttc/CMakeLists.txt # -# Copyright (C) 2024 Xiaomi Corporation +# SPDX-License-Identifier: Apache-2.0 # -# Licensed under the Apache License, Version 2.0 (the "License"); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. # +############################################################################ if(CONFIG_NETUTILS_MQTTC) diff --git a/netutils/nng/CMakeLists.txt b/netutils/nng/CMakeLists.txt index 4aa74131d6a..e4fc48cb38e 100644 --- a/netutils/nng/CMakeLists.txt +++ b/netutils/nng/CMakeLists.txt @@ -1,18 +1,24 @@ +############################################################################ +# apps/netutils/nng/CMakeLists.txt # -# Copyright (C) 2024 Xiaomi Corporation +# SPDX-License-Identifier: Apache-2.0 # -# Licensed under the Apache License, Version 2.0 (the "License"); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. # +############################################################################ if(CONFIG_NETUTILS_NNG) From 83ea91531fc3da011bf450b5bb01c3eff537a021 Mon Sep 17 00:00:00 2001 From: Alin Jerpelea Date: Fri, 20 Dec 2024 07:57:56 +0100 Subject: [PATCH 088/391] netutils: migrate the license to ASF Xiaomi has submitted the SGA and we can migate the license to ASF Signed-off-by: Alin Jerpelea --- netutils/CMakeLists.txt | 2 + netutils/Make.defs | 2 + netutils/Makefile | 2 + netutils/chat/CMakeLists.txt | 2 + netutils/chat/Make.defs | 2 + netutils/chat/Makefile | 2 + netutils/chat/chat.c | 7 +-- netutils/chat/chat.h | 5 +- netutils/cjson/CMakeLists.txt | 2 + netutils/cjson/Make.defs | 2 + netutils/cjson/Makefile | 2 + netutils/codecs/CMakeLists.txt | 2 + netutils/codecs/Make.defs | 2 + netutils/codecs/Makefile | 2 + netutils/codecs/base64.c | 8 ++-- netutils/codecs/md5.c | 48 ++++++++------------ netutils/codecs/urldecode.c | 39 ++++++---------- netutils/connectedhomeip/CMakeLists.txt | 2 + netutils/cwebsocket/Make.defs | 2 + netutils/cwebsocket/Makefile | 2 + netutils/dhcp6c/CMakeLists.txt | 2 + netutils/dhcp6c/Make.defs | 2 + netutils/dhcp6c/Makefile | 2 + netutils/dhcp6c/dhcp6c.c | 2 + netutils/dhcpc/CMakeLists.txt | 2 + netutils/dhcpc/Make.defs | 2 + netutils/dhcpc/Makefile | 2 + netutils/dhcpc/dhcpc.c | 13 ++---- netutils/dhcpd/CMakeLists.txt | 2 + netutils/dhcpd/Make.defs | 2 + netutils/dhcpd/Makefile | 2 + netutils/dhcpd/dhcpd.c | 2 + netutils/discover/CMakeLists.txt | 2 + netutils/discover/Make.defs | 2 + netutils/discover/Makefile | 2 + netutils/discover/discover.c | 2 + netutils/esp8266/CMakeLists.txt | 2 + netutils/esp8266/Make.defs | 2 + netutils/esp8266/Makefile | 2 + netutils/esp8266/esp8266.c | 2 + netutils/ftpc/CMakeLists.txt | 2 + netutils/ftpc/Make.defs | 2 + netutils/ftpc/Makefile | 2 + netutils/ftpc/ftpc_cdup.c | 2 + netutils/ftpc/ftpc_chdir.c | 2 + netutils/ftpc/ftpc_chmod.c | 2 + netutils/ftpc/ftpc_cmd.c | 2 + netutils/ftpc/ftpc_config.h | 2 + netutils/ftpc/ftpc_connect.c | 2 + netutils/ftpc/ftpc_disconnect.c | 2 + netutils/ftpc/ftpc_filesize.c | 2 + netutils/ftpc/ftpc_filetime.c | 2 + netutils/ftpc/ftpc_getfile.c | 2 + netutils/ftpc/ftpc_getreply.c | 2 + netutils/ftpc/ftpc_help.c | 2 + netutils/ftpc/ftpc_idle.c | 2 + netutils/ftpc/ftpc_internal.h | 2 + netutils/ftpc/ftpc_listdir.c | 2 + netutils/ftpc/ftpc_login.c | 2 + netutils/ftpc/ftpc_mkdir.c | 2 + netutils/ftpc/ftpc_noop.c | 2 + netutils/ftpc/ftpc_putfile.c | 2 + netutils/ftpc/ftpc_quit.c | 2 + netutils/ftpc/ftpc_rename.c | 2 + netutils/ftpc/ftpc_response.c | 2 + netutils/ftpc/ftpc_rmdir.c | 2 + netutils/ftpc/ftpc_rpwd.c | 2 + netutils/ftpc/ftpc_socket.c | 2 + netutils/ftpc/ftpc_transfer.c | 2 + netutils/ftpc/ftpc_unlink.c | 2 + netutils/ftpc/ftpc_utils.c | 2 + netutils/ftpd/CMakeLists.txt | 2 + netutils/ftpd/Make.defs | 2 + netutils/ftpd/Makefile | 2 + netutils/ftpd/ftpd.c | 13 ++---- netutils/ftpd/ftpd.h | 2 + netutils/iperf/CMakeLists.txt | 2 + netutils/iperf/Make.defs | 3 +- netutils/iperf/Makefile | 2 + netutils/iperf/iperf.c | 2 + netutils/iperf/iperf.h | 2 + netutils/iperf/iperf_main.c | 2 + netutils/iptables/CMakeLists.txt | 2 + netutils/iptables/Make.defs | 2 + netutils/iptables/Makefile | 2 + netutils/iptables/xtables.c | 2 + netutils/jsoncpp/CMakeLists.txt | 2 + netutils/jsoncpp/Make.defs | 2 + netutils/jsoncpp/Makefile | 2 + netutils/libcoap/CMakeLists.txt | 2 + netutils/libcoap/Make.defs | 2 + netutils/libcoap/Makefile | 2 + netutils/libcoap/coap_config.h | 8 ++-- netutils/libcurl4nx/CMakeLists.txt | 2 + netutils/libcurl4nx/Make.defs | 2 + netutils/libcurl4nx/Makefile | 2 + netutils/libcurl4nx/curl4nx_easy_cleanup.c | 2 + netutils/libcurl4nx/curl4nx_easy_duphandle.c | 2 + netutils/libcurl4nx/curl4nx_easy_escape.c | 2 + netutils/libcurl4nx/curl4nx_easy_getinfo.c | 2 + netutils/libcurl4nx/curl4nx_easy_init.c | 2 + netutils/libcurl4nx/curl4nx_easy_perform.c | 2 + netutils/libcurl4nx/curl4nx_easy_reset.c | 2 + netutils/libcurl4nx/curl4nx_easy_setopt.c | 2 + netutils/libcurl4nx/curl4nx_easy_unescape.c | 2 + netutils/libcurl4nx/curl4nx_private.h | 2 + netutils/libwebsockets/Make.defs | 2 + netutils/libwebsockets/Makefile | 2 + netutils/libwebsockets/lws_config.h | 2 + netutils/libwebsockets/lws_config_private.h | 4 +- netutils/mqttc/Make.defs | 2 + netutils/mqttc/Makefile | 2 + netutils/nanopb/Make.defs | 2 + netutils/nanopb/Makefile | 2 + netutils/netcat/CMakeLists.txt | 2 + netutils/netcat/Make.defs | 3 +- netutils/netcat/Makefile | 3 +- netutils/netcat/netcat_main.c | 3 +- netutils/netinit/CMakeLists.txt | 2 + netutils/netinit/Make.defs | 2 + netutils/netinit/Makefile | 2 + netutils/netinit/netinit.c | 2 + netutils/netinit/netinit_associate.c | 2 + netutils/netlib/CMakeLists.txt | 2 + netutils/netlib/Make.defs | 2 + netutils/netlib/Makefile | 2 + netutils/netlib/netlib_addipv6addr.c | 2 + netutils/netlib/netlib_autoconfig.c | 2 + netutils/netlib/netlib_conntrack.c | 2 + netutils/netlib/netlib_delarp.c | 2 + netutils/netlib/netlib_delipv6addr.c | 2 + netutils/netlib/netlib_eaddrconv.c | 2 + netutils/netlib/netlib_ethaddrconv.c | 16 +++---- netutils/netlib/netlib_getarp.c | 2 + netutils/netlib/netlib_getarptab.c | 2 + netutils/netlib/netlib_getdevs.c | 2 + netutils/netlib/netlib_getdripv4addr.c | 2 + netutils/netlib/netlib_getessid.c | 2 + netutils/netlib/netlib_getifstatistics.c | 2 + netutils/netlib/netlib_getifstatus.c | 2 + netutils/netlib/netlib_getipv4addr.c | 2 + netutils/netlib/netlib_getipv4netmask.c | 2 + netutils/netlib/netlib_getipv6addr.c | 2 + netutils/netlib/netlib_getmacaddr.c | 2 + netutils/netlib/netlib_getnbtab.c | 2 + netutils/netlib/netlib_getnodeaddr.c | 2 + netutils/netlib/netlib_getpanid.c | 2 + netutils/netlib/netlib_getproperties.c | 2 + netutils/netlib/netlib_getroute.c | 2 + netutils/netlib/netlib_ip6tables.c | 2 + netutils/netlib/netlib_ipmsfilter.c | 2 + netutils/netlib/netlib_iptables.c | 2 + netutils/netlib/netlib_ipv4adaptor.c | 2 + netutils/netlib/netlib_ipv4addrconv.c | 15 +++--- netutils/netlib/netlib_ipv4route.c | 2 + netutils/netlib/netlib_ipv4router.c | 2 + netutils/netlib/netlib_ipv6adaptor.c | 2 + netutils/netlib/netlib_ipv6netmask2prefix.c | 2 + netutils/netlib/netlib_ipv6route.c | 2 + netutils/netlib/netlib_ipv6router.c | 2 + netutils/netlib/netlib_listenon.c | 2 + netutils/netlib/netlib_nodeaddrconv.c | 2 + netutils/netlib/netlib_obtainipv4addr.c | 2 + netutils/netlib/netlib_obtainipv6addr.c | 2 + netutils/netlib/netlib_parsehttpurl.c | 2 + netutils/netlib/netlib_parseurl.c | 2 + netutils/netlib/netlib_prefix2ipv6netmask.c | 2 + netutils/netlib/netlib_saddrconv.c | 2 + netutils/netlib/netlib_server.c | 2 + netutils/netlib/netlib_setarp.c | 2 + netutils/netlib/netlib_setdripv4addr.c | 2 + netutils/netlib/netlib_setdripv6addr.c | 2 + netutils/netlib/netlib_seteaddr.c | 2 + netutils/netlib/netlib_setessid.c | 2 + netutils/netlib/netlib_setifstatus.c | 2 + netutils/netlib/netlib_setipv4addr.c | 2 + netutils/netlib/netlib_setipv4dnsaddr.c | 2 + netutils/netlib/netlib_setipv4netmask.c | 2 + netutils/netlib/netlib_setipv6addr.c | 2 + netutils/netlib/netlib_setipv6dnsaddr.c | 2 + netutils/netlib/netlib_setipv6netmask.c | 2 + netutils/netlib/netlib_setmacaddr.c | 2 + netutils/netlib/netlib_setmtu.c | 2 + netutils/netlib/netlib_setnodeaddr.c | 2 + netutils/nng/Make.defs | 2 + netutils/nng/Makefile | 2 + netutils/ntpclient/CMakeLists.txt | 2 + netutils/ntpclient/Make.defs | 2 + netutils/ntpclient/Makefile | 2 + netutils/ntpclient/ntpclient.c | 2 + netutils/ntpclient/ntpv3.h | 2 + netutils/ping/CMakeLists.txt | 2 + netutils/ping/Make.defs | 2 + netutils/ping/Makefile | 2 + netutils/ping/icmp_ping.c | 2 + netutils/ping/icmpv6_ping.c | 2 + netutils/pppd/CMakeLists.txt | 2 + netutils/pppd/Make.defs | 2 + netutils/pppd/Makefile | 2 + netutils/ptpd/Make.defs | 2 + netutils/ptpd/Makefile | 2 + netutils/ptpd/ptpd.c | 2 + netutils/ptpd/ptpv2.h | 2 + netutils/rexec/CMakeLists.txt | 2 + netutils/rexec/Make.defs | 2 + netutils/rexec/Makefile | 2 + netutils/rexec/rexec.c | 2 + netutils/rexecd/CMakeLists.txt | 2 + netutils/rexecd/Make.defs | 2 + netutils/rexecd/Makefile | 2 + netutils/rexecd/rexecd.c | 2 + netutils/rtptools/CMakeLists.txt | 2 + netutils/rtptools/Make.defs | 2 + netutils/rtptools/Makefile | 2 + netutils/rtptools/config.h | 2 + netutils/smtp/CMakeLists.txt | 2 + netutils/smtp/Make.defs | 2 + netutils/smtp/Makefile | 2 + netutils/smtp/smtp.c | 22 +++------ netutils/telnetc/CMakeLists.txt | 2 + netutils/telnetc/Make.defs | 2 + netutils/telnetc/Makefile | 2 + netutils/telnetc/telnetc.c | 2 + netutils/telnetd/CMakeLists.txt | 2 + netutils/telnetd/Make.defs | 2 + netutils/telnetd/Makefile | 2 + netutils/telnetd/telnetd_daemon.c | 2 + netutils/tftpc/CMakeLists.txt | 2 + netutils/tftpc/Make.defs | 2 + netutils/tftpc/Makefile | 2 + netutils/tftpc/tftpc_get.c | 2 + netutils/tftpc/tftpc_internal.h | 2 + netutils/tftpc/tftpc_packets.c | 2 + netutils/tftpc/tftpc_put.c | 2 + netutils/thttpd/CMakeLists.txt | 2 + netutils/thttpd/Make.defs | 2 + netutils/thttpd/Makefile | 2 + netutils/thttpd/cgi-src/Makefile | 2 + netutils/thttpd/cgi-src/phf.c | 12 ++--- netutils/thttpd/cgi-src/redirect.c | 12 ++--- netutils/thttpd/cgi-src/ssi.c | 12 ++--- netutils/thttpd/config.h | 2 + netutils/thttpd/fdwatch.c | 12 ++--- netutils/thttpd/fdwatch.h | 11 ++--- netutils/thttpd/libhttpd.c | 15 +++--- netutils/thttpd/libhttpd.h | 15 +++--- netutils/thttpd/mime_types.h | 48 ++++++++------------ netutils/thttpd/tdate_parse.c | 12 ++--- netutils/thttpd/tdate_parse.h | 11 ++--- netutils/thttpd/thttpd.c | 14 +++--- netutils/thttpd/thttpd_alloc.c | 2 + netutils/thttpd/thttpd_alloc.h | 39 ++++++---------- netutils/thttpd/thttpd_cgi.c | 15 +++--- netutils/thttpd/thttpd_cgi.h | 15 +++--- netutils/thttpd/thttpd_strings.c | 14 +++--- netutils/thttpd/thttpd_strings.h | 14 +++--- netutils/thttpd/timers.c | 13 ++---- netutils/thttpd/timers.h | 14 +++--- netutils/wakaama/CMakeLists.txt | 2 + netutils/wakaama/examples.cmake | 2 + netutils/wakeonlan/CMakeLists.txt | 2 + netutils/wakeonlan/Make.defs | 2 + netutils/wakeonlan/Makefile | 2 + netutils/wakeonlan/wol_main.c | 2 + netutils/webclient/CMakeLists.txt | 2 + netutils/webclient/Make.defs | 2 + netutils/webclient/Makefile | 2 + netutils/webclient/webclient.c | 17 +++---- netutils/webserver/CMakeLists.txt | 2 + netutils/webserver/Make.defs | 2 + netutils/webserver/Makefile | 2 + netutils/webserver/httpd.c | 19 +++----- netutils/webserver/httpd.h | 14 +++--- netutils/webserver/httpd_cgi.c | 7 ++- netutils/webserver/httpd_cgi.h | 14 +++--- netutils/webserver/httpd_dirlist.c | 2 + netutils/webserver/httpd_fs.c | 14 +++--- netutils/webserver/httpd_mmap.c | 2 + netutils/webserver/httpd_sendfile.c | 2 + netutils/xmlrpc/CMakeLists.txt | 2 + netutils/xmlrpc/Make.defs | 2 + netutils/xmlrpc/Makefile | 2 + netutils/xmlrpc/response.c | 18 ++++---- netutils/xmlrpc/xmlparser.c | 18 ++++---- 284 files changed, 738 insertions(+), 375 deletions(-) diff --git a/netutils/CMakeLists.txt b/netutils/CMakeLists.txt index 62601fd7e9a..e950ed6fff9 100644 --- a/netutils/CMakeLists.txt +++ b/netutils/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/netutils/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/netutils/Make.defs b/netutils/Make.defs index d08431e24bc..bd7c0e0cc7d 100644 --- a/netutils/Make.defs +++ b/netutils/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/Makefile b/netutils/Makefile index 6ec7c188436..87fb891a139 100644 --- a/netutils/Makefile +++ b/netutils/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/chat/CMakeLists.txt b/netutils/chat/CMakeLists.txt index 66a4f73485f..eb847a45383 100644 --- a/netutils/chat/CMakeLists.txt +++ b/netutils/chat/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/netutils/chat/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/netutils/chat/Make.defs b/netutils/chat/Make.defs index 06540e51bc5..db5c1371711 100644 --- a/netutils/chat/Make.defs +++ b/netutils/chat/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/chat/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/chat/Makefile b/netutils/chat/Makefile index 61b61b7fcc0..1c461c85255 100644 --- a/netutils/chat/Makefile +++ b/netutils/chat/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/chat/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/chat/chat.c b/netutils/chat/chat.c index 38ab5dc9201..3849631dfd4 100644 --- a/netutils/chat/chat.c +++ b/netutils/chat/chat.c @@ -1,9 +1,10 @@ /**************************************************************************** * apps/netutils/chat/chat.c * - * Copyright (C) 2016 Vladimir Komendantskiy. All rights reserved. - * Author: Vladimir Komendantskiy - * Partly based on code by Max Nekludov + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2016 Vladimir Komendantskiy. All rights reserved. + * SPDX-FileContributor: Vladimir Komendantskiy + * SPDX-FileContributor: Max Nekludov * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/netutils/chat/chat.h b/netutils/chat/chat.h index 61fcef637a4..4c9a9126800 100644 --- a/netutils/chat/chat.h +++ b/netutils/chat/chat.h @@ -1,8 +1,9 @@ /**************************************************************************** * apps/netutils/chat/chat.h * - * Copyright (C) 2016 Vladimir Komendantskiy. All rights reserved. - * Author: Vladimir Komendantskiy + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2016 Vladimir Komendantskiy. All rights reserved. + * SPDX-FileContributor: Vladimir Komendantskiy * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/netutils/cjson/CMakeLists.txt b/netutils/cjson/CMakeLists.txt index 0261b694c7e..9749f42f12f 100644 --- a/netutils/cjson/CMakeLists.txt +++ b/netutils/cjson/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/netutils/cjson/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/netutils/cjson/Make.defs b/netutils/cjson/Make.defs index 78c8220075a..e8f6d6d8090 100644 --- a/netutils/cjson/Make.defs +++ b/netutils/cjson/Make.defs @@ -1,6 +1,8 @@ ############################################################################# # apps/netutils/cjson/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/cjson/Makefile b/netutils/cjson/Makefile index 7d7c423b059..d8993373d2b 100644 --- a/netutils/cjson/Makefile +++ b/netutils/cjson/Makefile @@ -1,6 +1,8 @@ ############################################################################# # apps/netutils/cjson/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/codecs/CMakeLists.txt b/netutils/codecs/CMakeLists.txt index d4ae752befe..ee93eacd291 100644 --- a/netutils/codecs/CMakeLists.txt +++ b/netutils/codecs/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/netutils/codecs/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/netutils/codecs/Make.defs b/netutils/codecs/Make.defs index 7d2f0592fc1..b17090ec21d 100644 --- a/netutils/codecs/Make.defs +++ b/netutils/codecs/Make.defs @@ -1,6 +1,8 @@ ############################################################################# # apps/netutils/codecs/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/codecs/Makefile b/netutils/codecs/Makefile index 68b3bba9b8f..b6a1dee8907 100644 --- a/netutils/codecs/Makefile +++ b/netutils/codecs/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/codecs/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/codecs/base64.c b/netutils/codecs/base64.c index 442a06bad96..36485b85a55 100644 --- a/netutils/codecs/base64.c +++ b/netutils/codecs/base64.c @@ -1,10 +1,10 @@ /**************************************************************************** * apps/netutils/codecs/base64.c * - * This file is part of the NuttX RTOS: - * - * Copyright (C) 2012, 2018 Gregory Nutt. All rights reserved. - * Author: Darcy Gong + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2012, 2018 Gregory Nutt. All rights reserved. + * SPDX-FileCopyrightText: 2005, Jouni Malinen + * SPDX-FileContributor: Darcy Gong * * Reference: * diff --git a/netutils/codecs/md5.c b/netutils/codecs/md5.c index 38c637dc61c..75dfe3f0c56 100644 --- a/netutils/codecs/md5.c +++ b/netutils/codecs/md5.c @@ -1,11 +1,26 @@ /**************************************************************************** * apps/netutils/codecs/md5.c * - * This file is part of the NuttX RTOS: + * SPDX-License-Identifier: Apache-2.0 * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. - * Author: Darcy Gong + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** * Reference: * * This code implements the MD5 message-digest algorithm. @@ -25,33 +40,6 @@ * * See README and COPYING for more details. * - * And is re-released under the NuttX modified BSD license: - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - * ****************************************************************************/ /**************************************************************************** diff --git a/netutils/codecs/urldecode.c b/netutils/codecs/urldecode.c index 1e1a105fe89..5328f311b14 100644 --- a/netutils/codecs/urldecode.c +++ b/netutils/codecs/urldecode.c @@ -1,35 +1,22 @@ /**************************************************************************** * apps/netutils/codecs/urldecode.c * - * This file is part of the NuttX RTOS: + * SPDX-License-Identifier: Apache-2.0 * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. - * Author: Darcy Gong + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * http://www.apache.org/licenses/LICENSE-2.0 * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/netutils/connectedhomeip/CMakeLists.txt b/netutils/connectedhomeip/CMakeLists.txt index 546fbe7335c..1031b472794 100644 --- a/netutils/connectedhomeip/CMakeLists.txt +++ b/netutils/connectedhomeip/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/netutils/connectedhomeip/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/netutils/cwebsocket/Make.defs b/netutils/cwebsocket/Make.defs index 9d068ef8e10..c08da360db1 100644 --- a/netutils/cwebsocket/Make.defs +++ b/netutils/cwebsocket/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/cwebsocket/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/cwebsocket/Makefile b/netutils/cwebsocket/Makefile index 01ffd9fb219..c9e6bbcd342 100644 --- a/netutils/cwebsocket/Makefile +++ b/netutils/cwebsocket/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/cwebsocket/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/dhcp6c/CMakeLists.txt b/netutils/dhcp6c/CMakeLists.txt index 6ded1078b37..63b061cce86 100644 --- a/netutils/dhcp6c/CMakeLists.txt +++ b/netutils/dhcp6c/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/netutils/dhcp6c/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/netutils/dhcp6c/Make.defs b/netutils/dhcp6c/Make.defs index 39c2c4a3248..120d94f7881 100644 --- a/netutils/dhcp6c/Make.defs +++ b/netutils/dhcp6c/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/dhcp6c/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/dhcp6c/Makefile b/netutils/dhcp6c/Makefile index c4c659693dc..e7be145f304 100644 --- a/netutils/dhcp6c/Makefile +++ b/netutils/dhcp6c/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/dhcp6c/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/dhcp6c/dhcp6c.c b/netutils/dhcp6c/dhcp6c.c index a264721315b..5418c0a98a5 100644 --- a/netutils/dhcp6c/dhcp6c.c +++ b/netutils/dhcp6c/dhcp6c.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/dhcp6c/dhcp6c.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/dhcpc/CMakeLists.txt b/netutils/dhcpc/CMakeLists.txt index 3fdea80c226..7bc2ba17e2b 100644 --- a/netutils/dhcpc/CMakeLists.txt +++ b/netutils/dhcpc/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/netutils/dhcpc/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/netutils/dhcpc/Make.defs b/netutils/dhcpc/Make.defs index 2022610d84e..84be9ecdc91 100644 --- a/netutils/dhcpc/Make.defs +++ b/netutils/dhcpc/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/dhcpc/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/dhcpc/Makefile b/netutils/dhcpc/Makefile index 4eaea283a8a..43b62a53c67 100644 --- a/netutils/dhcpc/Makefile +++ b/netutils/dhcpc/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/dhcpc/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/dhcpc/dhcpc.c b/netutils/dhcpc/dhcpc.c index 2e365e122e7..38de90b2ea4 100644 --- a/netutils/dhcpc/dhcpc.c +++ b/netutils/dhcpc/dhcpc.c @@ -1,14 +1,11 @@ /**************************************************************************** * apps/netutils/dhcpc/dhcpc.c * - * Copyright (C) 2007, 2009, 2011-2012 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Based heavily on portions of uIP: - * - * Author: Adam Dunkels - * Copyright (c) 2005, Swedish Institute of Computer Science - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2007, 2009, 2011-2012 Gregory Nutt. + * SPDX-FileCopyrightText: 2005, Swedish Institute of Computer Science + * SPDX-FileContributor: Gregory Nutt + * SPDX-FileContributor: Adam Dunkels * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/netutils/dhcpd/CMakeLists.txt b/netutils/dhcpd/CMakeLists.txt index ab53fa881e5..5c859f23044 100644 --- a/netutils/dhcpd/CMakeLists.txt +++ b/netutils/dhcpd/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/netutils/dhcpd/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/netutils/dhcpd/Make.defs b/netutils/dhcpd/Make.defs index f91aa017e27..7b676ed3352 100644 --- a/netutils/dhcpd/Make.defs +++ b/netutils/dhcpd/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/dhcpd/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/dhcpd/Makefile b/netutils/dhcpd/Makefile index be43f42096d..41e2f971cf0 100644 --- a/netutils/dhcpd/Makefile +++ b/netutils/dhcpd/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/dhcpd/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/dhcpd/dhcpd.c b/netutils/dhcpd/dhcpd.c index 2f8f280d5cd..367dda5265d 100644 --- a/netutils/dhcpd/dhcpd.c +++ b/netutils/dhcpd/dhcpd.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/dhcpd/dhcpd.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/discover/CMakeLists.txt b/netutils/discover/CMakeLists.txt index 040744fca76..32337dcbf2b 100644 --- a/netutils/discover/CMakeLists.txt +++ b/netutils/discover/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/netutils/discover/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/netutils/discover/Make.defs b/netutils/discover/Make.defs index 6fcbe4d68bc..95a7a9b451c 100644 --- a/netutils/discover/Make.defs +++ b/netutils/discover/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/discover/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/discover/Makefile b/netutils/discover/Makefile index e38c97571b8..43bd51b7c05 100644 --- a/netutils/discover/Makefile +++ b/netutils/discover/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/discover/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/discover/discover.c b/netutils/discover/discover.c index fd77447a801..6bb3f675b8b 100644 --- a/netutils/discover/discover.c +++ b/netutils/discover/discover.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/discover/discover.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/esp8266/CMakeLists.txt b/netutils/esp8266/CMakeLists.txt index 9ed0bbfe5fd..b9232cc6072 100644 --- a/netutils/esp8266/CMakeLists.txt +++ b/netutils/esp8266/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/netutils/esp8266/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/netutils/esp8266/Make.defs b/netutils/esp8266/Make.defs index d78ee97f713..6f9a2f463b1 100644 --- a/netutils/esp8266/Make.defs +++ b/netutils/esp8266/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/esp8266/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/esp8266/Makefile b/netutils/esp8266/Makefile index 357bcb83e8b..faf0f91a393 100644 --- a/netutils/esp8266/Makefile +++ b/netutils/esp8266/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/esp8266/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/esp8266/esp8266.c b/netutils/esp8266/esp8266.c index 5b8b7f62ab8..ac64b4b2f67 100644 --- a/netutils/esp8266/esp8266.c +++ b/netutils/esp8266/esp8266.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/esp8266/esp8266.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/ftpc/CMakeLists.txt b/netutils/ftpc/CMakeLists.txt index 290f7131070..073e22c3c7a 100644 --- a/netutils/ftpc/CMakeLists.txt +++ b/netutils/ftpc/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/netutils/ftpc/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/netutils/ftpc/Make.defs b/netutils/ftpc/Make.defs index 185126699c7..df47acf29a2 100644 --- a/netutils/ftpc/Make.defs +++ b/netutils/ftpc/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/ftpc/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/ftpc/Makefile b/netutils/ftpc/Makefile index 16e2850d1f8..8a7ee81f9c5 100644 --- a/netutils/ftpc/Makefile +++ b/netutils/ftpc/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/ftpc/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/ftpc/ftpc_cdup.c b/netutils/ftpc/ftpc_cdup.c index 25eee22838b..6959918560f 100644 --- a/netutils/ftpc/ftpc_cdup.c +++ b/netutils/ftpc/ftpc_cdup.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/ftpc/ftpc_cdup.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/ftpc/ftpc_chdir.c b/netutils/ftpc/ftpc_chdir.c index de356ed8e51..fcfba68ed04 100644 --- a/netutils/ftpc/ftpc_chdir.c +++ b/netutils/ftpc/ftpc_chdir.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/ftpc/ftpc_chdir.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/ftpc/ftpc_chmod.c b/netutils/ftpc/ftpc_chmod.c index 6e949ee0ec2..5710b7c8bc0 100644 --- a/netutils/ftpc/ftpc_chmod.c +++ b/netutils/ftpc/ftpc_chmod.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/ftpc/ftpc_chmod.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/ftpc/ftpc_cmd.c b/netutils/ftpc/ftpc_cmd.c index 08d3070414f..b6b7556b565 100644 --- a/netutils/ftpc/ftpc_cmd.c +++ b/netutils/ftpc/ftpc_cmd.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/ftpc/ftpc_cmd.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/ftpc/ftpc_config.h b/netutils/ftpc/ftpc_config.h index ff429f1d7b5..9ac5e08ed86 100644 --- a/netutils/ftpc/ftpc_config.h +++ b/netutils/ftpc/ftpc_config.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/ftpc/ftpc_config.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/ftpc/ftpc_connect.c b/netutils/ftpc/ftpc_connect.c index ff1759fa5fc..8624f4905c2 100644 --- a/netutils/ftpc/ftpc_connect.c +++ b/netutils/ftpc/ftpc_connect.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/ftpc/ftpc_connect.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/ftpc/ftpc_disconnect.c b/netutils/ftpc/ftpc_disconnect.c index 60224ffe713..794b1a06bce 100644 --- a/netutils/ftpc/ftpc_disconnect.c +++ b/netutils/ftpc/ftpc_disconnect.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/ftpc/ftpc_disconnect.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/ftpc/ftpc_filesize.c b/netutils/ftpc/ftpc_filesize.c index 2593eac04d9..67df7da3d85 100644 --- a/netutils/ftpc/ftpc_filesize.c +++ b/netutils/ftpc/ftpc_filesize.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/ftpc/ftpc_filesize.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/ftpc/ftpc_filetime.c b/netutils/ftpc/ftpc_filetime.c index 5f3ab5e81f8..8a9611803de 100644 --- a/netutils/ftpc/ftpc_filetime.c +++ b/netutils/ftpc/ftpc_filetime.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/ftpc/ftpc_filetime.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/ftpc/ftpc_getfile.c b/netutils/ftpc/ftpc_getfile.c index 902d61aba17..83524df4e24 100644 --- a/netutils/ftpc/ftpc_getfile.c +++ b/netutils/ftpc/ftpc_getfile.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/ftpc/ftpc_getfile.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/ftpc/ftpc_getreply.c b/netutils/ftpc/ftpc_getreply.c index 9dd3415384f..d5a3d098368 100644 --- a/netutils/ftpc/ftpc_getreply.c +++ b/netutils/ftpc/ftpc_getreply.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/ftpc/ftpc_getreply.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/ftpc/ftpc_help.c b/netutils/ftpc/ftpc_help.c index fcf28190d43..b1c777f4a3d 100644 --- a/netutils/ftpc/ftpc_help.c +++ b/netutils/ftpc/ftpc_help.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/ftpc/ftpc_help.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/ftpc/ftpc_idle.c b/netutils/ftpc/ftpc_idle.c index eea2c054b2c..42e2fdbef50 100644 --- a/netutils/ftpc/ftpc_idle.c +++ b/netutils/ftpc/ftpc_idle.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/ftpc/ftpc_idle.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/ftpc/ftpc_internal.h b/netutils/ftpc/ftpc_internal.h index c01cb1b694a..70e9bb7b91e 100644 --- a/netutils/ftpc/ftpc_internal.h +++ b/netutils/ftpc/ftpc_internal.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/ftpc/ftpc_internal.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/ftpc/ftpc_listdir.c b/netutils/ftpc/ftpc_listdir.c index 44c7c9c44b7..92461f6e3ab 100644 --- a/netutils/ftpc/ftpc_listdir.c +++ b/netutils/ftpc/ftpc_listdir.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/ftpc/ftpc_listdir.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/ftpc/ftpc_login.c b/netutils/ftpc/ftpc_login.c index 7691ae44d66..9e99c0dc525 100644 --- a/netutils/ftpc/ftpc_login.c +++ b/netutils/ftpc/ftpc_login.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/ftpc/ftpc_login.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/ftpc/ftpc_mkdir.c b/netutils/ftpc/ftpc_mkdir.c index c065e34ebc4..53817a378e7 100644 --- a/netutils/ftpc/ftpc_mkdir.c +++ b/netutils/ftpc/ftpc_mkdir.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/ftpc/ftpc_mkdir.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/ftpc/ftpc_noop.c b/netutils/ftpc/ftpc_noop.c index f96a4c989fd..bc72985b933 100644 --- a/netutils/ftpc/ftpc_noop.c +++ b/netutils/ftpc/ftpc_noop.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/ftpc/ftpc_noop.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/ftpc/ftpc_putfile.c b/netutils/ftpc/ftpc_putfile.c index feeaf431354..9ac75cc0e76 100644 --- a/netutils/ftpc/ftpc_putfile.c +++ b/netutils/ftpc/ftpc_putfile.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/ftpc/ftpc_putfile.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/ftpc/ftpc_quit.c b/netutils/ftpc/ftpc_quit.c index 0669e1d952e..28e5acd867a 100644 --- a/netutils/ftpc/ftpc_quit.c +++ b/netutils/ftpc/ftpc_quit.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/ftpc/ftpc_quit.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/ftpc/ftpc_rename.c b/netutils/ftpc/ftpc_rename.c index 90c1f2efc11..8b3e761ffab 100644 --- a/netutils/ftpc/ftpc_rename.c +++ b/netutils/ftpc/ftpc_rename.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/ftpc/ftpc_rename.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/ftpc/ftpc_response.c b/netutils/ftpc/ftpc_response.c index eb381163680..ac2040e39f0 100644 --- a/netutils/ftpc/ftpc_response.c +++ b/netutils/ftpc/ftpc_response.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/ftpc/ftpc_response.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/ftpc/ftpc_rmdir.c b/netutils/ftpc/ftpc_rmdir.c index f2f90bffc54..b8db51dc15b 100644 --- a/netutils/ftpc/ftpc_rmdir.c +++ b/netutils/ftpc/ftpc_rmdir.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/ftpc/ftpc_rmdir.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/ftpc/ftpc_rpwd.c b/netutils/ftpc/ftpc_rpwd.c index fce28e621fa..8ff608d9bbe 100644 --- a/netutils/ftpc/ftpc_rpwd.c +++ b/netutils/ftpc/ftpc_rpwd.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/ftpc/ftpc_rpwd.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/ftpc/ftpc_socket.c b/netutils/ftpc/ftpc_socket.c index 0856ba2556d..db9b4ccd0c7 100644 --- a/netutils/ftpc/ftpc_socket.c +++ b/netutils/ftpc/ftpc_socket.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/ftpc/ftpc_socket.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/ftpc/ftpc_transfer.c b/netutils/ftpc/ftpc_transfer.c index 16864791831..7d294d52dc4 100644 --- a/netutils/ftpc/ftpc_transfer.c +++ b/netutils/ftpc/ftpc_transfer.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/ftpc/ftpc_transfer.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/ftpc/ftpc_unlink.c b/netutils/ftpc/ftpc_unlink.c index 2d99d19628d..42ba48d4882 100644 --- a/netutils/ftpc/ftpc_unlink.c +++ b/netutils/ftpc/ftpc_unlink.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/ftpc/ftpc_unlink.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/ftpc/ftpc_utils.c b/netutils/ftpc/ftpc_utils.c index 23e461fc06b..829aa8672fc 100644 --- a/netutils/ftpc/ftpc_utils.c +++ b/netutils/ftpc/ftpc_utils.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/ftpc/ftpc_utils.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/ftpd/CMakeLists.txt b/netutils/ftpd/CMakeLists.txt index a75bc2ff0d6..c8e742a0989 100644 --- a/netutils/ftpd/CMakeLists.txt +++ b/netutils/ftpd/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/netutils/ftpd/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/netutils/ftpd/Make.defs b/netutils/ftpd/Make.defs index 772fadd8358..21ed7f819d1 100644 --- a/netutils/ftpd/Make.defs +++ b/netutils/ftpd/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/ftpd/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/ftpd/Makefile b/netutils/ftpd/Makefile index 2a61453fe47..244f740d1bd 100644 --- a/netutils/ftpd/Makefile +++ b/netutils/ftpd/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/ftpd/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/ftpd/ftpd.c b/netutils/ftpd/ftpd.c index 9df08a1a65e..12491030a46 100644 --- a/netutils/ftpd/ftpd.c +++ b/netutils/ftpd/ftpd.c @@ -1,14 +1,11 @@ /**************************************************************************** * apps/netutils/ftpd/ftpd.c * - * Copyright (C) 2012, 2015, 2020 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Includes original code as well as logic adapted from hwport_ftpd, written - * by Jaehyuk Cho which is released under a BSD license. - * - * Copyright (C) hwport.com. All rights reserved. - * Author: Jaehyuk Cho + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2012, 2015, 2020 Gregory Nutt. + * SPDX-FileCopyrightText: hwport.com. All rights reserved. + * SPDX-FileContributor: Gregory Nutt + * SPDX-FileContributor: Jaehyuk Cho * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/netutils/ftpd/ftpd.h b/netutils/ftpd/ftpd.h index 31f3ca3e62c..5acea4a2886 100644 --- a/netutils/ftpd/ftpd.h +++ b/netutils/ftpd/ftpd.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/ftpd/ftpd.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/iperf/CMakeLists.txt b/netutils/iperf/CMakeLists.txt index feea71ea6e4..a566030c7bf 100644 --- a/netutils/iperf/CMakeLists.txt +++ b/netutils/iperf/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/netutils/iperf/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/netutils/iperf/Make.defs b/netutils/iperf/Make.defs index 0e121368233..893564b3f37 100644 --- a/netutils/iperf/Make.defs +++ b/netutils/iperf/Make.defs @@ -1,6 +1,7 @@ ############################################################################ # apps/netutils/iperf/Make.defs -# Adds selected applications to apps/ build +# +# SPDX-License-Identifier: Apache-2.0 # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with diff --git a/netutils/iperf/Makefile b/netutils/iperf/Makefile index 9db5e0cc5f9..148026eccda 100644 --- a/netutils/iperf/Makefile +++ b/netutils/iperf/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/iperf/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/iperf/iperf.c b/netutils/iperf/iperf.c index 55ee3ca8e94..cda61f68edc 100644 --- a/netutils/iperf/iperf.c +++ b/netutils/iperf/iperf.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/iperf/iperf.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/iperf/iperf.h b/netutils/iperf/iperf.h index 14b295a9f9f..86739cd5f82 100644 --- a/netutils/iperf/iperf.h +++ b/netutils/iperf/iperf.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/iperf/iperf.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/iperf/iperf_main.c b/netutils/iperf/iperf_main.c index fc42c13a862..67ff3855ef0 100644 --- a/netutils/iperf/iperf_main.c +++ b/netutils/iperf/iperf_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/iperf/iperf_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/iptables/CMakeLists.txt b/netutils/iptables/CMakeLists.txt index 94f1816d6ee..b049971c235 100644 --- a/netutils/iptables/CMakeLists.txt +++ b/netutils/iptables/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/netutils/iptables/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/netutils/iptables/Make.defs b/netutils/iptables/Make.defs index 17e09d4f913..2ea07def710 100644 --- a/netutils/iptables/Make.defs +++ b/netutils/iptables/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/iptables/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/iptables/Makefile b/netutils/iptables/Makefile index 08559b73bbc..4b0fe6ee722 100644 --- a/netutils/iptables/Makefile +++ b/netutils/iptables/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/iptables/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/iptables/xtables.c b/netutils/iptables/xtables.c index 6691706a05e..9786db4727d 100644 --- a/netutils/iptables/xtables.c +++ b/netutils/iptables/xtables.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/iptables/xtables.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/jsoncpp/CMakeLists.txt b/netutils/jsoncpp/CMakeLists.txt index 61422e948d5..3f8d1790370 100644 --- a/netutils/jsoncpp/CMakeLists.txt +++ b/netutils/jsoncpp/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/netutils/jsoncpp/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/netutils/jsoncpp/Make.defs b/netutils/jsoncpp/Make.defs index 3803ab9c064..b66b557f2b9 100644 --- a/netutils/jsoncpp/Make.defs +++ b/netutils/jsoncpp/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/jsoncpp/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/jsoncpp/Makefile b/netutils/jsoncpp/Makefile index 58f301ff5a6..c7218eaaf19 100644 --- a/netutils/jsoncpp/Makefile +++ b/netutils/jsoncpp/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/jsoncpp/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/libcoap/CMakeLists.txt b/netutils/libcoap/CMakeLists.txt index 5e26c4d350f..404fd9956e1 100644 --- a/netutils/libcoap/CMakeLists.txt +++ b/netutils/libcoap/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/netutils/libcoap/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/netutils/libcoap/Make.defs b/netutils/libcoap/Make.defs index e53c8d306a5..c2d7c3ffb86 100644 --- a/netutils/libcoap/Make.defs +++ b/netutils/libcoap/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/libcoap/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/libcoap/Makefile b/netutils/libcoap/Makefile index e69c9be1700..877fdb8437c 100644 --- a/netutils/libcoap/Makefile +++ b/netutils/libcoap/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/libcoap/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/libcoap/coap_config.h b/netutils/libcoap/coap_config.h index 4e44e5e8103..b05bb6433d6 100644 --- a/netutils/libcoap/coap_config.h +++ b/netutils/libcoap/coap_config.h @@ -1,11 +1,11 @@ /**************************************************************************** * apps/netutils/libcoap/coap_config.h * - * Copyright (C) 2020 Carlos Gomes Martinho - * - * Copyright (C) 2021-2023 Jon Shallow - * * SPDX-License-Identifier: BSD-2-Clause + * SPDX-FileCopyrightText: 2020 Carlos Gomes Martinho + * + * SPDX-FileCopyrightText: 2021-2023 Jon Shallow + * * * This file is part of the CoAP library libcoap. Please see README for terms * of use. diff --git a/netutils/libcurl4nx/CMakeLists.txt b/netutils/libcurl4nx/CMakeLists.txt index 7fbf7615809..4a565fd3954 100644 --- a/netutils/libcurl4nx/CMakeLists.txt +++ b/netutils/libcurl4nx/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/netutils/libcurl4nx/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/netutils/libcurl4nx/Make.defs b/netutils/libcurl4nx/Make.defs index e4be480e14f..f3a3a4350dc 100644 --- a/netutils/libcurl4nx/Make.defs +++ b/netutils/libcurl4nx/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/libcurl4nx/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/libcurl4nx/Makefile b/netutils/libcurl4nx/Makefile index 43dde03f448..47eeba9aa48 100644 --- a/netutils/libcurl4nx/Makefile +++ b/netutils/libcurl4nx/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/libcurl4nx/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/libcurl4nx/curl4nx_easy_cleanup.c b/netutils/libcurl4nx/curl4nx_easy_cleanup.c index 353bdf9c273..1c30006716c 100644 --- a/netutils/libcurl4nx/curl4nx_easy_cleanup.c +++ b/netutils/libcurl4nx/curl4nx_easy_cleanup.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/libcurl4nx/curl4nx_easy_cleanup.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/libcurl4nx/curl4nx_easy_duphandle.c b/netutils/libcurl4nx/curl4nx_easy_duphandle.c index f6a10fdc08c..4de16e0aff8 100644 --- a/netutils/libcurl4nx/curl4nx_easy_duphandle.c +++ b/netutils/libcurl4nx/curl4nx_easy_duphandle.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/libcurl4nx/curl4nx_easy_duphandle.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/libcurl4nx/curl4nx_easy_escape.c b/netutils/libcurl4nx/curl4nx_easy_escape.c index cdd77eb1dcc..ff76d6d8cd5 100644 --- a/netutils/libcurl4nx/curl4nx_easy_escape.c +++ b/netutils/libcurl4nx/curl4nx_easy_escape.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/libcurl4nx/curl4nx_easy_escape.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/libcurl4nx/curl4nx_easy_getinfo.c b/netutils/libcurl4nx/curl4nx_easy_getinfo.c index 274bcec426f..ed8e90a9d46 100644 --- a/netutils/libcurl4nx/curl4nx_easy_getinfo.c +++ b/netutils/libcurl4nx/curl4nx_easy_getinfo.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/libcurl4nx/curl4nx_easy_getinfo.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/libcurl4nx/curl4nx_easy_init.c b/netutils/libcurl4nx/curl4nx_easy_init.c index 0fd3d6aec20..1817bf73464 100644 --- a/netutils/libcurl4nx/curl4nx_easy_init.c +++ b/netutils/libcurl4nx/curl4nx_easy_init.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/libcurl4nx/curl4nx_easy_init.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/libcurl4nx/curl4nx_easy_perform.c b/netutils/libcurl4nx/curl4nx_easy_perform.c index 0fdaa1b5aa1..466b3efe7d2 100644 --- a/netutils/libcurl4nx/curl4nx_easy_perform.c +++ b/netutils/libcurl4nx/curl4nx_easy_perform.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/libcurl4nx/curl4nx_easy_perform.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/libcurl4nx/curl4nx_easy_reset.c b/netutils/libcurl4nx/curl4nx_easy_reset.c index d40806f5234..7ece89011ba 100644 --- a/netutils/libcurl4nx/curl4nx_easy_reset.c +++ b/netutils/libcurl4nx/curl4nx_easy_reset.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/libcurl4nx/curl4nx_easy_reset.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/libcurl4nx/curl4nx_easy_setopt.c b/netutils/libcurl4nx/curl4nx_easy_setopt.c index 02fe5d12e4e..03f8ff5d1e0 100644 --- a/netutils/libcurl4nx/curl4nx_easy_setopt.c +++ b/netutils/libcurl4nx/curl4nx_easy_setopt.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/libcurl4nx/curl4nx_easy_setopt.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/libcurl4nx/curl4nx_easy_unescape.c b/netutils/libcurl4nx/curl4nx_easy_unescape.c index 8d1c1bca3a4..23f169afecb 100644 --- a/netutils/libcurl4nx/curl4nx_easy_unescape.c +++ b/netutils/libcurl4nx/curl4nx_easy_unescape.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/libcurl4nx/curl4nx_easy_unescape.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/libcurl4nx/curl4nx_private.h b/netutils/libcurl4nx/curl4nx_private.h index 96fcdd93eeb..a67fd0ab098 100644 --- a/netutils/libcurl4nx/curl4nx_private.h +++ b/netutils/libcurl4nx/curl4nx_private.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/libcurl4nx/curl4nx_private.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/libwebsockets/Make.defs b/netutils/libwebsockets/Make.defs index 7094809e5bb..13fe3849c63 100644 --- a/netutils/libwebsockets/Make.defs +++ b/netutils/libwebsockets/Make.defs @@ -1,6 +1,8 @@ ############################################################################# # apps/netutils/libwebsockets/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/libwebsockets/Makefile b/netutils/libwebsockets/Makefile index f95e77ecbcf..ad8c0c5e6c8 100644 --- a/netutils/libwebsockets/Makefile +++ b/netutils/libwebsockets/Makefile @@ -1,6 +1,8 @@ ############################################################################# # apps/netutils/libwebsockets/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/libwebsockets/lws_config.h b/netutils/libwebsockets/lws_config.h index d4903b8a433..3fe970b4772 100644 --- a/netutils/libwebsockets/lws_config.h +++ b/netutils/libwebsockets/lws_config.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/libwebsockets/lws_config.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/libwebsockets/lws_config_private.h b/netutils/libwebsockets/lws_config_private.h index 893e02f0524..8f5170faff9 100644 --- a/netutils/libwebsockets/lws_config_private.h +++ b/netutils/libwebsockets/lws_config_private.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/libwebsockets/lws_config_private.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The @@ -150,4 +152,4 @@ /* Defined if you have the header file. */ #define LWS_HAVE_INTTYPES_H -#endif \ No newline at end of file +#endif diff --git a/netutils/mqttc/Make.defs b/netutils/mqttc/Make.defs index 7c9d235d2df..dc27a70466d 100644 --- a/netutils/mqttc/Make.defs +++ b/netutils/mqttc/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/mqttc/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/mqttc/Makefile b/netutils/mqttc/Makefile index 89f3a7fc702..730ce5139bd 100644 --- a/netutils/mqttc/Makefile +++ b/netutils/mqttc/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/mqttc/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/nanopb/Make.defs b/netutils/nanopb/Make.defs index 6cd3bef2608..a59e73d5cdc 100644 --- a/netutils/nanopb/Make.defs +++ b/netutils/nanopb/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/nanopb/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/nanopb/Makefile b/netutils/nanopb/Makefile index 8bc6982474c..c3624e7ad27 100644 --- a/netutils/nanopb/Makefile +++ b/netutils/nanopb/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/nanopb/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/netcat/CMakeLists.txt b/netutils/netcat/CMakeLists.txt index 9efd885122b..7ac7d78309e 100644 --- a/netutils/netcat/CMakeLists.txt +++ b/netutils/netcat/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/netutils/netcat/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/netutils/netcat/Make.defs b/netutils/netcat/Make.defs index 7e55c357130..5356f19a1c0 100644 --- a/netutils/netcat/Make.defs +++ b/netutils/netcat/Make.defs @@ -1,6 +1,7 @@ ############################################################################# # apps/netutils/netcat/Make.defs -# netcat sample networking application +# +# SPDX-License-Identifier: Apache-2.0 # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with diff --git a/netutils/netcat/Makefile b/netutils/netcat/Makefile index cc09c0c24f7..c4c3022b3d4 100644 --- a/netutils/netcat/Makefile +++ b/netutils/netcat/Makefile @@ -1,6 +1,7 @@ ############################################################################# # apps/netutils/netcat/Makefile -# Netcat networking application +# +# SPDX-License-Identifier: Apache-2.0 # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with diff --git a/netutils/netcat/netcat_main.c b/netutils/netcat/netcat_main.c index 155de558fc7..4c5d9670414 100644 --- a/netutils/netcat/netcat_main.c +++ b/netutils/netcat/netcat_main.c @@ -1,6 +1,7 @@ /**************************************************************************** * apps/netutils/netcat/netcat_main.c - * netcat networking application + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with diff --git a/netutils/netinit/CMakeLists.txt b/netutils/netinit/CMakeLists.txt index 899a6ebf8a5..694ea93dfe5 100644 --- a/netutils/netinit/CMakeLists.txt +++ b/netutils/netinit/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/netutils/netinit/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/netutils/netinit/Make.defs b/netutils/netinit/Make.defs index effb3f05f25..634118797cb 100644 --- a/netutils/netinit/Make.defs +++ b/netutils/netinit/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/netinit/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/netinit/Makefile b/netutils/netinit/Makefile index 8ee21511fe9..aecf0932546 100644 --- a/netutils/netinit/Makefile +++ b/netutils/netinit/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/netinit/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/netinit/netinit.c b/netutils/netinit/netinit.c index 6a72c3bfe2a..4433eb4a564 100644 --- a/netutils/netinit/netinit.c +++ b/netutils/netinit/netinit.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netinit/netinit.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netinit/netinit_associate.c b/netutils/netinit/netinit_associate.c index 161a3545b88..0ce4beff044 100644 --- a/netutils/netinit/netinit_associate.c +++ b/netutils/netinit/netinit_associate.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netinit/netinit_associate.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/CMakeLists.txt b/netutils/netlib/CMakeLists.txt index 068fa68fe08..d97307e6d03 100644 --- a/netutils/netlib/CMakeLists.txt +++ b/netutils/netlib/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/netutils/netlib/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/netutils/netlib/Make.defs b/netutils/netlib/Make.defs index 15a44d43fec..144e6fcac86 100644 --- a/netutils/netlib/Make.defs +++ b/netutils/netlib/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/netlib/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/Makefile b/netutils/netlib/Makefile index dc8be99d2b6..93508ef859c 100644 --- a/netutils/netlib/Makefile +++ b/netutils/netlib/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/netlib/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_addipv6addr.c b/netutils/netlib/netlib_addipv6addr.c index 142e3e1e3b6..77c18a6f199 100644 --- a/netutils/netlib/netlib_addipv6addr.c +++ b/netutils/netlib/netlib_addipv6addr.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_addipv6addr.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_autoconfig.c b/netutils/netlib/netlib_autoconfig.c index 56f169de756..92bde61a63c 100644 --- a/netutils/netlib/netlib_autoconfig.c +++ b/netutils/netlib/netlib_autoconfig.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_autoconfig.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_conntrack.c b/netutils/netlib/netlib_conntrack.c index fda39476ab9..b6312dd5cc1 100644 --- a/netutils/netlib/netlib_conntrack.c +++ b/netutils/netlib/netlib_conntrack.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_conntrack.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_delarp.c b/netutils/netlib/netlib_delarp.c index 77778ad4295..7a263211c33 100644 --- a/netutils/netlib/netlib_delarp.c +++ b/netutils/netlib/netlib_delarp.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_delarp.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_delipv6addr.c b/netutils/netlib/netlib_delipv6addr.c index d83ffa8077b..bea37aace52 100644 --- a/netutils/netlib/netlib_delipv6addr.c +++ b/netutils/netlib/netlib_delipv6addr.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_delipv6addr.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_eaddrconv.c b/netutils/netlib/netlib_eaddrconv.c index 2f97e05f94b..9039e10b5bf 100644 --- a/netutils/netlib/netlib_eaddrconv.c +++ b/netutils/netlib/netlib_eaddrconv.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_eaddrconv.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_ethaddrconv.c b/netutils/netlib/netlib_ethaddrconv.c index 5f42547d9f8..f83bc779d02 100644 --- a/netutils/netlib/netlib_ethaddrconv.c +++ b/netutils/netlib/netlib_ethaddrconv.c @@ -1,16 +1,12 @@ /**************************************************************************** * apps/netutils/netlib/netlib_ethaddrconv.c - * Various uIP library functions. * - * Copyright (C) 2007, 2009, 2011, 2016 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Based on uIP which also has a BSD style license: - * - * Author: Adam Dunkels - * Copyright (c) 2004, Adam Dunkels and the Swedish Institute of - * Computer Science. - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2007, 2009, 2011, 2016 Gregory Nutt. + * SPDX-FileCopyrightText: 2004 Adam Dunkels. + * SPDX-FileCopyrightText: 2004 Swedish Institute of Computer Science. + * SPDX-FileContributor: Gregory Nutt + * SPDX-FileContributor: Adam Dunkels * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/netutils/netlib/netlib_getarp.c b/netutils/netlib/netlib_getarp.c index 63ec03b0c78..d023bce300d 100644 --- a/netutils/netlib/netlib_getarp.c +++ b/netutils/netlib/netlib_getarp.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_getarp.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_getarptab.c b/netutils/netlib/netlib_getarptab.c index f38b9a89dd2..8efb5e89196 100644 --- a/netutils/netlib/netlib_getarptab.c +++ b/netutils/netlib/netlib_getarptab.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_getarptab.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_getdevs.c b/netutils/netlib/netlib_getdevs.c index 64260e4a034..0e56fe5c564 100644 --- a/netutils/netlib/netlib_getdevs.c +++ b/netutils/netlib/netlib_getdevs.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_getdevs.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_getdripv4addr.c b/netutils/netlib/netlib_getdripv4addr.c index 32398baa921..b6415124e17 100644 --- a/netutils/netlib/netlib_getdripv4addr.c +++ b/netutils/netlib/netlib_getdripv4addr.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_getdripv4addr.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_getessid.c b/netutils/netlib/netlib_getessid.c index 6204c174549..0eb2702c504 100644 --- a/netutils/netlib/netlib_getessid.c +++ b/netutils/netlib/netlib_getessid.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_getessid.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_getifstatistics.c b/netutils/netlib/netlib_getifstatistics.c index a6ac33e6c4d..b838d556dc9 100644 --- a/netutils/netlib/netlib_getifstatistics.c +++ b/netutils/netlib/netlib_getifstatistics.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_getifstatistics.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_getifstatus.c b/netutils/netlib/netlib_getifstatus.c index 378a0bec14b..753e869c337 100644 --- a/netutils/netlib/netlib_getifstatus.c +++ b/netutils/netlib/netlib_getifstatus.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_getifstatus.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_getipv4addr.c b/netutils/netlib/netlib_getipv4addr.c index 56a61853a89..ec9736b958e 100644 --- a/netutils/netlib/netlib_getipv4addr.c +++ b/netutils/netlib/netlib_getipv4addr.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_getipv4addr.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_getipv4netmask.c b/netutils/netlib/netlib_getipv4netmask.c index a341774b196..d1a0d037663 100644 --- a/netutils/netlib/netlib_getipv4netmask.c +++ b/netutils/netlib/netlib_getipv4netmask.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_getipv4netmask.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_getipv6addr.c b/netutils/netlib/netlib_getipv6addr.c index 1260e1f09df..15697d5e2e7 100644 --- a/netutils/netlib/netlib_getipv6addr.c +++ b/netutils/netlib/netlib_getipv6addr.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_getipv6addr.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_getmacaddr.c b/netutils/netlib/netlib_getmacaddr.c index 4a0b7bce73e..1bce3098d97 100644 --- a/netutils/netlib/netlib_getmacaddr.c +++ b/netutils/netlib/netlib_getmacaddr.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_getmacaddr.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_getnbtab.c b/netutils/netlib/netlib_getnbtab.c index 519f89fbd8e..521746f211b 100644 --- a/netutils/netlib/netlib_getnbtab.c +++ b/netutils/netlib/netlib_getnbtab.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_getnbtab.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_getnodeaddr.c b/netutils/netlib/netlib_getnodeaddr.c index 19724456b30..d35d29eba08 100644 --- a/netutils/netlib/netlib_getnodeaddr.c +++ b/netutils/netlib/netlib_getnodeaddr.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_getnodeaddr.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_getpanid.c b/netutils/netlib/netlib_getpanid.c index ca63db1b34e..c6b236559fd 100644 --- a/netutils/netlib/netlib_getpanid.c +++ b/netutils/netlib/netlib_getpanid.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_getpanid.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_getproperties.c b/netutils/netlib/netlib_getproperties.c index d0f2c4cf2c0..9ffbc66bfb8 100644 --- a/netutils/netlib/netlib_getproperties.c +++ b/netutils/netlib/netlib_getproperties.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_getproperties.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_getroute.c b/netutils/netlib/netlib_getroute.c index 07db740704a..ff7c318bc74 100644 --- a/netutils/netlib/netlib_getroute.c +++ b/netutils/netlib/netlib_getroute.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_getroute.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_ip6tables.c b/netutils/netlib/netlib_ip6tables.c index 59915077bc7..d966e432d2a 100644 --- a/netutils/netlib/netlib_ip6tables.c +++ b/netutils/netlib/netlib_ip6tables.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_ip6tables.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_ipmsfilter.c b/netutils/netlib/netlib_ipmsfilter.c index 29af7746dcd..d7f9b0ff16d 100644 --- a/netutils/netlib/netlib_ipmsfilter.c +++ b/netutils/netlib/netlib_ipmsfilter.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_ipmsfilter.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_iptables.c b/netutils/netlib/netlib_iptables.c index adfb442d853..e27576a33a2 100644 --- a/netutils/netlib/netlib_iptables.c +++ b/netutils/netlib/netlib_iptables.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_iptables.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_ipv4adaptor.c b/netutils/netlib/netlib_ipv4adaptor.c index c38bd0df10f..92cd73c9433 100644 --- a/netutils/netlib/netlib_ipv4adaptor.c +++ b/netutils/netlib/netlib_ipv4adaptor.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_ipv4adaptor.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_ipv4addrconv.c b/netutils/netlib/netlib_ipv4addrconv.c index 1341eab76fd..27325ca0a18 100644 --- a/netutils/netlib/netlib_ipv4addrconv.c +++ b/netutils/netlib/netlib_ipv4addrconv.c @@ -1,15 +1,12 @@ /**************************************************************************** * apps/netutils/netlib/netlib_ipv4addrconv.c * - * Copyright (C) 2007, 2009, 2011, 2016 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Based on uIP which also has a BSD style license: - * - * Author: Adam Dunkels - * Copyright (c) 2004, Adam Dunkels and the Swedish Institute of - * Computer Science. - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2007, 2009, 2011, 2016 Gregory Nutt. + * SPDX-FileCopyrightText: 2004 Adam Dunkels. + * SPDX-FileCopyrightText: 2004 Swedish Institute of Computer Science. + * SPDX-FileContributor: Gregory Nutt + * SPDX-FileContributor: Adam Dunkels * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/netutils/netlib/netlib_ipv4route.c b/netutils/netlib/netlib_ipv4route.c index f5343801cac..225b68c0b2f 100644 --- a/netutils/netlib/netlib_ipv4route.c +++ b/netutils/netlib/netlib_ipv4route.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_ipv4route.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_ipv4router.c b/netutils/netlib/netlib_ipv4router.c index 73f672daf55..f1877fbc062 100644 --- a/netutils/netlib/netlib_ipv4router.c +++ b/netutils/netlib/netlib_ipv4router.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_ipv4router.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_ipv6adaptor.c b/netutils/netlib/netlib_ipv6adaptor.c index 7cfdd3308ee..cb979cc02c8 100644 --- a/netutils/netlib/netlib_ipv6adaptor.c +++ b/netutils/netlib/netlib_ipv6adaptor.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_ipv6adaptor.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_ipv6netmask2prefix.c b/netutils/netlib/netlib_ipv6netmask2prefix.c index a3ce602bf26..b2fb5d1bfb4 100644 --- a/netutils/netlib/netlib_ipv6netmask2prefix.c +++ b/netutils/netlib/netlib_ipv6netmask2prefix.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_ipv6netmask2prefix.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_ipv6route.c b/netutils/netlib/netlib_ipv6route.c index c35e26f4ac5..a0e10fa7c77 100644 --- a/netutils/netlib/netlib_ipv6route.c +++ b/netutils/netlib/netlib_ipv6route.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_ipv6route.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_ipv6router.c b/netutils/netlib/netlib_ipv6router.c index bb7ff3dbe07..ce041373f5b 100644 --- a/netutils/netlib/netlib_ipv6router.c +++ b/netutils/netlib/netlib_ipv6router.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_ipv6router.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_listenon.c b/netutils/netlib/netlib_listenon.c index 13482541155..608937ff755 100644 --- a/netutils/netlib/netlib_listenon.c +++ b/netutils/netlib/netlib_listenon.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_listenon.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_nodeaddrconv.c b/netutils/netlib/netlib_nodeaddrconv.c index 76816725f2e..67c6ee2f75e 100644 --- a/netutils/netlib/netlib_nodeaddrconv.c +++ b/netutils/netlib/netlib_nodeaddrconv.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_nodeaddrconv.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_obtainipv4addr.c b/netutils/netlib/netlib_obtainipv4addr.c index 53e8ea7251d..6156445f627 100644 --- a/netutils/netlib/netlib_obtainipv4addr.c +++ b/netutils/netlib/netlib_obtainipv4addr.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_obtainipv4addr.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_obtainipv6addr.c b/netutils/netlib/netlib_obtainipv6addr.c index f5054c3e053..f556677051f 100644 --- a/netutils/netlib/netlib_obtainipv6addr.c +++ b/netutils/netlib/netlib_obtainipv6addr.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_obtainipv6addr.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_parsehttpurl.c b/netutils/netlib/netlib_parsehttpurl.c index 0cba03d0bb1..d56a800567e 100644 --- a/netutils/netlib/netlib_parsehttpurl.c +++ b/netutils/netlib/netlib_parsehttpurl.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_parsehttpurl.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_parseurl.c b/netutils/netlib/netlib_parseurl.c index a806129667b..b6bfda64396 100644 --- a/netutils/netlib/netlib_parseurl.c +++ b/netutils/netlib/netlib_parseurl.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_parseurl.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_prefix2ipv6netmask.c b/netutils/netlib/netlib_prefix2ipv6netmask.c index c8f7a71d983..b82bbbcb46e 100644 --- a/netutils/netlib/netlib_prefix2ipv6netmask.c +++ b/netutils/netlib/netlib_prefix2ipv6netmask.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_prefix2ipv6netmask.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_saddrconv.c b/netutils/netlib/netlib_saddrconv.c index 069ba11eb81..d3dda010fce 100644 --- a/netutils/netlib/netlib_saddrconv.c +++ b/netutils/netlib/netlib_saddrconv.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_saddrconv.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_server.c b/netutils/netlib/netlib_server.c index 3c9bdf69cef..98ff5e907fb 100644 --- a/netutils/netlib/netlib_server.c +++ b/netutils/netlib/netlib_server.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_server.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_setarp.c b/netutils/netlib/netlib_setarp.c index edb566089c1..88dbba81044 100644 --- a/netutils/netlib/netlib_setarp.c +++ b/netutils/netlib/netlib_setarp.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_setarp.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_setdripv4addr.c b/netutils/netlib/netlib_setdripv4addr.c index 019c50b0310..1b5ad5052e7 100644 --- a/netutils/netlib/netlib_setdripv4addr.c +++ b/netutils/netlib/netlib_setdripv4addr.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_setdripv4addr.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_setdripv6addr.c b/netutils/netlib/netlib_setdripv6addr.c index 4da663e6c5c..2f1a1b7e09a 100644 --- a/netutils/netlib/netlib_setdripv6addr.c +++ b/netutils/netlib/netlib_setdripv6addr.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_setdripv6addr.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_seteaddr.c b/netutils/netlib/netlib_seteaddr.c index 6008fc3aa87..fdabc726906 100644 --- a/netutils/netlib/netlib_seteaddr.c +++ b/netutils/netlib/netlib_seteaddr.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_seteaddr.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_setessid.c b/netutils/netlib/netlib_setessid.c index ab91d09bf8a..0a45e42fa98 100644 --- a/netutils/netlib/netlib_setessid.c +++ b/netutils/netlib/netlib_setessid.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_setessid.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_setifstatus.c b/netutils/netlib/netlib_setifstatus.c index 6a36eaa9025..8a3f58db111 100644 --- a/netutils/netlib/netlib_setifstatus.c +++ b/netutils/netlib/netlib_setifstatus.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_setifstatus.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_setipv4addr.c b/netutils/netlib/netlib_setipv4addr.c index 8ada0e48a53..db03ddb6114 100644 --- a/netutils/netlib/netlib_setipv4addr.c +++ b/netutils/netlib/netlib_setipv4addr.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_setipv4addr.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_setipv4dnsaddr.c b/netutils/netlib/netlib_setipv4dnsaddr.c index f95af1c9d0d..ae155eabee9 100644 --- a/netutils/netlib/netlib_setipv4dnsaddr.c +++ b/netutils/netlib/netlib_setipv4dnsaddr.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_setipv4dnsaddr.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_setipv4netmask.c b/netutils/netlib/netlib_setipv4netmask.c index c34b017f6a9..9abd0aaa665 100644 --- a/netutils/netlib/netlib_setipv4netmask.c +++ b/netutils/netlib/netlib_setipv4netmask.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_setipv4netmask.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_setipv6addr.c b/netutils/netlib/netlib_setipv6addr.c index 79cad9bd06b..6c2ee0b3d3f 100644 --- a/netutils/netlib/netlib_setipv6addr.c +++ b/netutils/netlib/netlib_setipv6addr.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_setipv6addr.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_setipv6dnsaddr.c b/netutils/netlib/netlib_setipv6dnsaddr.c index ee7b5afe0e6..123951c47a4 100644 --- a/netutils/netlib/netlib_setipv6dnsaddr.c +++ b/netutils/netlib/netlib_setipv6dnsaddr.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_setipv6dnsaddr.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_setipv6netmask.c b/netutils/netlib/netlib_setipv6netmask.c index 985d55ed749..443adcafe08 100644 --- a/netutils/netlib/netlib_setipv6netmask.c +++ b/netutils/netlib/netlib_setipv6netmask.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_setipv6netmask.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_setmacaddr.c b/netutils/netlib/netlib_setmacaddr.c index 07c3263cea1..d794ec45e01 100644 --- a/netutils/netlib/netlib_setmacaddr.c +++ b/netutils/netlib/netlib_setmacaddr.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_setmacaddr.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_setmtu.c b/netutils/netlib/netlib_setmtu.c index 8c36b2c277e..18b81809cb7 100644 --- a/netutils/netlib/netlib_setmtu.c +++ b/netutils/netlib/netlib_setmtu.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_setmtu.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/netlib/netlib_setnodeaddr.c b/netutils/netlib/netlib_setnodeaddr.c index 7e41e59c6e8..7bc58cafc8a 100644 --- a/netutils/netlib/netlib_setnodeaddr.c +++ b/netutils/netlib/netlib_setnodeaddr.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/netlib/netlib_setnodeaddr.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/nng/Make.defs b/netutils/nng/Make.defs index 0eea850157f..e0e9193372d 100644 --- a/netutils/nng/Make.defs +++ b/netutils/nng/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/nng/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/nng/Makefile b/netutils/nng/Makefile index 8d45e2130ce..e3e1a0f8981 100644 --- a/netutils/nng/Makefile +++ b/netutils/nng/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/nng/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/ntpclient/CMakeLists.txt b/netutils/ntpclient/CMakeLists.txt index df273e02e94..3a6a47d5e00 100644 --- a/netutils/ntpclient/CMakeLists.txt +++ b/netutils/ntpclient/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/netutils/ntpclient/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/netutils/ntpclient/Make.defs b/netutils/ntpclient/Make.defs index 691ddfe4b34..d97f3db49a1 100644 --- a/netutils/ntpclient/Make.defs +++ b/netutils/ntpclient/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/ntpclient/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/ntpclient/Makefile b/netutils/ntpclient/Makefile index 27233557646..d528591dae3 100644 --- a/netutils/ntpclient/Makefile +++ b/netutils/ntpclient/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/ntpclient/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/ntpclient/ntpclient.c b/netutils/ntpclient/ntpclient.c index ac48a3e091d..66aaacb4aaa 100644 --- a/netutils/ntpclient/ntpclient.c +++ b/netutils/ntpclient/ntpclient.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/ntpclient/ntpclient.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/ntpclient/ntpv3.h b/netutils/ntpclient/ntpv3.h index 0f439a32ee3..837722697eb 100644 --- a/netutils/ntpclient/ntpv3.h +++ b/netutils/ntpclient/ntpv3.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/ntpclient/ntpv3.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/ping/CMakeLists.txt b/netutils/ping/CMakeLists.txt index e250aaa97de..9f362a5ba4a 100644 --- a/netutils/ping/CMakeLists.txt +++ b/netutils/ping/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/netutils/ping/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/netutils/ping/Make.defs b/netutils/ping/Make.defs index 753819bf283..70680487ffd 100644 --- a/netutils/ping/Make.defs +++ b/netutils/ping/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/ping/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/ping/Makefile b/netutils/ping/Makefile index 847950a80f8..f65b1744596 100644 --- a/netutils/ping/Makefile +++ b/netutils/ping/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/ping/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/ping/icmp_ping.c b/netutils/ping/icmp_ping.c index 024bbeb2dac..efbc8a61a78 100644 --- a/netutils/ping/icmp_ping.c +++ b/netutils/ping/icmp_ping.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/ping/icmp_ping.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/ping/icmpv6_ping.c b/netutils/ping/icmpv6_ping.c index 96bdae10ded..74cd59ee975 100644 --- a/netutils/ping/icmpv6_ping.c +++ b/netutils/ping/icmpv6_ping.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/ping/icmpv6_ping.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/pppd/CMakeLists.txt b/netutils/pppd/CMakeLists.txt index 5d160b28951..0c35f1cbb7f 100644 --- a/netutils/pppd/CMakeLists.txt +++ b/netutils/pppd/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/netutils/pppd/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/netutils/pppd/Make.defs b/netutils/pppd/Make.defs index 7d0412ec4ee..cad4791fcf3 100644 --- a/netutils/pppd/Make.defs +++ b/netutils/pppd/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/pppd/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/pppd/Makefile b/netutils/pppd/Makefile index ca97e72bb17..b5a8c98e853 100644 --- a/netutils/pppd/Makefile +++ b/netutils/pppd/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/pppd/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/ptpd/Make.defs b/netutils/ptpd/Make.defs index c3f5f60ffb0..5034710eca0 100644 --- a/netutils/ptpd/Make.defs +++ b/netutils/ptpd/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/ptpd/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/ptpd/Makefile b/netutils/ptpd/Makefile index 3f3e98a361b..95b19a640e5 100644 --- a/netutils/ptpd/Makefile +++ b/netutils/ptpd/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/ptpd/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/ptpd/ptpd.c b/netutils/ptpd/ptpd.c index 080e7b2cafc..309f78a07f1 100644 --- a/netutils/ptpd/ptpd.c +++ b/netutils/ptpd/ptpd.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/ptpd/ptpd.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/ptpd/ptpv2.h b/netutils/ptpd/ptpv2.h index 93bc667f2d0..8b031567b74 100644 --- a/netutils/ptpd/ptpv2.h +++ b/netutils/ptpd/ptpv2.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/ptpd/ptpv2.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/rexec/CMakeLists.txt b/netutils/rexec/CMakeLists.txt index ee95badb9e2..1c6d63d6ba4 100644 --- a/netutils/rexec/CMakeLists.txt +++ b/netutils/rexec/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/netutils/rexec/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/netutils/rexec/Make.defs b/netutils/rexec/Make.defs index bcc9bbd6589..deb3b2de6df 100644 --- a/netutils/rexec/Make.defs +++ b/netutils/rexec/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/rexec/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/rexec/Makefile b/netutils/rexec/Makefile index 98d7f5e33f6..c033850779f 100644 --- a/netutils/rexec/Makefile +++ b/netutils/rexec/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/rexec/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/rexec/rexec.c b/netutils/rexec/rexec.c index 69346d87235..3276ac56a43 100644 --- a/netutils/rexec/rexec.c +++ b/netutils/rexec/rexec.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/rexec/rexec.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/rexecd/CMakeLists.txt b/netutils/rexecd/CMakeLists.txt index 1e37e9acebd..0da40f5bd63 100644 --- a/netutils/rexecd/CMakeLists.txt +++ b/netutils/rexecd/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/netutils/rexecd/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/netutils/rexecd/Make.defs b/netutils/rexecd/Make.defs index 4bb13e4538c..9f0533f291e 100644 --- a/netutils/rexecd/Make.defs +++ b/netutils/rexecd/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/rexecd/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/rexecd/Makefile b/netutils/rexecd/Makefile index c39d9ca65cf..ea332bea600 100644 --- a/netutils/rexecd/Makefile +++ b/netutils/rexecd/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/rexecd/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/rexecd/rexecd.c b/netutils/rexecd/rexecd.c index 431ea26c48f..5c301c62a99 100644 --- a/netutils/rexecd/rexecd.c +++ b/netutils/rexecd/rexecd.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/rexecd/rexecd.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/rtptools/CMakeLists.txt b/netutils/rtptools/CMakeLists.txt index 6627bef78c2..76c8a0ab47c 100644 --- a/netutils/rtptools/CMakeLists.txt +++ b/netutils/rtptools/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/netutils/rtptools/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/netutils/rtptools/Make.defs b/netutils/rtptools/Make.defs index 0c4cf384026..be02f518f33 100644 --- a/netutils/rtptools/Make.defs +++ b/netutils/rtptools/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/rtptools/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/rtptools/Makefile b/netutils/rtptools/Makefile index b6b3a970424..91080291b68 100644 --- a/netutils/rtptools/Makefile +++ b/netutils/rtptools/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/rtptools/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/rtptools/config.h b/netutils/rtptools/config.h index dd077ee99e0..975e6a00537 100644 --- a/netutils/rtptools/config.h +++ b/netutils/rtptools/config.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/rtptools/config.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/smtp/CMakeLists.txt b/netutils/smtp/CMakeLists.txt index 680d8336f89..29402455a6f 100644 --- a/netutils/smtp/CMakeLists.txt +++ b/netutils/smtp/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/netutils/smtp/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/netutils/smtp/Make.defs b/netutils/smtp/Make.defs index 8a2184741ac..9736ebb534d 100644 --- a/netutils/smtp/Make.defs +++ b/netutils/smtp/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/smtp/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/smtp/Makefile b/netutils/smtp/Makefile index 55878ae13d4..d0866399d6a 100644 --- a/netutils/smtp/Makefile +++ b/netutils/smtp/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/smtp/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/smtp/smtp.c b/netutils/smtp/smtp.c index 83081361dda..2a8d2334600 100644 --- a/netutils/smtp/smtp.c +++ b/netutils/smtp/smtp.c @@ -1,22 +1,12 @@ /**************************************************************************** * apps/netutils/smtp/smtp.c - * smtp SMTP E-mail sender * - * Copyright (C) 2007, 2009, 2011, 2015, 2020 Gregory Nutt. All rights - * reserved. - * Author: Gregory Nutt - * - * Heavily leveraged from uIP 1.0 which also has a BSD-like license: - * - * The Simple Mail Transfer Protocol (SMTP) as defined by RFC821 is - * the standard way of sending and transferring e-mail on the - * Internet. This simple example implementation is intended as an - * example of how to implement protocols in uIP, and is able to send - * out e-mail but has not been extensively tested. - * - * Author: Adam Dunkels - * Copyright (c) 2004, Adam Dunkels. - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2015, 2020 Gregory Nutt. All rights reserved. + * SPDX-FileCopyrightText: 2007, 2009, 2011, Gregory Nutt. All rights reserved. + * SPDX-FileCopyrightText: 2004, Adam Dunkels. All rights reserved. + * SPDX-FileContributor: Gregory Nutt + * SPDX-FileContributor: Adam Dunkels * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/netutils/telnetc/CMakeLists.txt b/netutils/telnetc/CMakeLists.txt index 1f24a3b05c7..ec92b08b36a 100644 --- a/netutils/telnetc/CMakeLists.txt +++ b/netutils/telnetc/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/netutils/telnetc/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/netutils/telnetc/Make.defs b/netutils/telnetc/Make.defs index a9da1ef00b9..7e989f656c9 100644 --- a/netutils/telnetc/Make.defs +++ b/netutils/telnetc/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/telnetc/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/telnetc/Makefile b/netutils/telnetc/Makefile index e0361e70de5..4d0a7291718 100644 --- a/netutils/telnetc/Makefile +++ b/netutils/telnetc/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/telnetc/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/telnetc/telnetc.c b/netutils/telnetc/telnetc.c index 73d5f422be0..24f63c206d1 100644 --- a/netutils/telnetc/telnetc.c +++ b/netutils/telnetc/telnetc.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/telnetc/telnetc.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/telnetd/CMakeLists.txt b/netutils/telnetd/CMakeLists.txt index e46969021d1..322868ae094 100644 --- a/netutils/telnetd/CMakeLists.txt +++ b/netutils/telnetd/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/netutils/telnetd/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/netutils/telnetd/Make.defs b/netutils/telnetd/Make.defs index d2903dae047..7dcdc877628 100644 --- a/netutils/telnetd/Make.defs +++ b/netutils/telnetd/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/telnetd/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/telnetd/Makefile b/netutils/telnetd/Makefile index 9eab6856e59..d53bcacf415 100644 --- a/netutils/telnetd/Makefile +++ b/netutils/telnetd/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/telnetd/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/telnetd/telnetd_daemon.c b/netutils/telnetd/telnetd_daemon.c index b78e9f5db17..ed02b156909 100644 --- a/netutils/telnetd/telnetd_daemon.c +++ b/netutils/telnetd/telnetd_daemon.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/telnetd/telnetd_daemon.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/tftpc/CMakeLists.txt b/netutils/tftpc/CMakeLists.txt index f0eaee92aab..bb808b15f66 100644 --- a/netutils/tftpc/CMakeLists.txt +++ b/netutils/tftpc/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/netutils/tftpc/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/netutils/tftpc/Make.defs b/netutils/tftpc/Make.defs index aeb33fe947a..f6abbc18c54 100644 --- a/netutils/tftpc/Make.defs +++ b/netutils/tftpc/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/tftpc/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/tftpc/Makefile b/netutils/tftpc/Makefile index b2594517d91..3fe7a411943 100644 --- a/netutils/tftpc/Makefile +++ b/netutils/tftpc/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/tftpc/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/tftpc/tftpc_get.c b/netutils/tftpc/tftpc_get.c index 4432e1e960f..36227e29a6a 100644 --- a/netutils/tftpc/tftpc_get.c +++ b/netutils/tftpc/tftpc_get.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/tftpc/tftpc_get.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/tftpc/tftpc_internal.h b/netutils/tftpc/tftpc_internal.h index 83443b85416..337bbeb6822 100644 --- a/netutils/tftpc/tftpc_internal.h +++ b/netutils/tftpc/tftpc_internal.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/tftpc/tftpc_internal.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/tftpc/tftpc_packets.c b/netutils/tftpc/tftpc_packets.c index 4c981a43efd..05d56083ca3 100644 --- a/netutils/tftpc/tftpc_packets.c +++ b/netutils/tftpc/tftpc_packets.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/tftpc/tftpc_packets.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/tftpc/tftpc_put.c b/netutils/tftpc/tftpc_put.c index a30e3579871..3f3a9c849ce 100644 --- a/netutils/tftpc/tftpc_put.c +++ b/netutils/tftpc/tftpc_put.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/tftpc/tftpc_put.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/thttpd/CMakeLists.txt b/netutils/thttpd/CMakeLists.txt index d7da13a19e3..232cfc71045 100644 --- a/netutils/thttpd/CMakeLists.txt +++ b/netutils/thttpd/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/netutils/thttpd/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/netutils/thttpd/Make.defs b/netutils/thttpd/Make.defs index abd53b55bd8..7847dbf24ac 100644 --- a/netutils/thttpd/Make.defs +++ b/netutils/thttpd/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/thttpd/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/thttpd/Makefile b/netutils/thttpd/Makefile index 65a5f42e8dc..78d39ce7bde 100644 --- a/netutils/thttpd/Makefile +++ b/netutils/thttpd/Makefile @@ -1,6 +1,8 @@ ############################################################################# # apps/netutils/thttpd/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/thttpd/cgi-src/Makefile b/netutils/thttpd/cgi-src/Makefile index 4be27bb696a..dfe18f95425 100644 --- a/netutils/thttpd/cgi-src/Makefile +++ b/netutils/thttpd/cgi-src/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/thttpd/cgi-src/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/thttpd/cgi-src/phf.c b/netutils/thttpd/cgi-src/phf.c index 9e065df91c5..4155ae98e86 100644 --- a/netutils/thttpd/cgi-src/phf.c +++ b/netutils/thttpd/cgi-src/phf.c @@ -1,14 +1,10 @@ /**************************************************************************** * apps/netutils/thttpd/cgi-src/phf.c - * Cracker trap * - * Copyright (C) 2009, 2015 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Derived from the file of the same name in the original THTTPD package: - * - * Copyright © 1996 by Jef Poskanzer . - * All rights reserved. + * SPDX-License-Identifier: BSD-2-Clause + * SPDX-FileCopyrightText: 2009, 2015 Gregory Nutt. All rights reserved. + * SPDX-FileCopyrightText: 1996 by Jef Poskanzer . + * SPDX-FileContributor: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/netutils/thttpd/cgi-src/redirect.c b/netutils/thttpd/cgi-src/redirect.c index 87811af241e..3b24bb11160 100644 --- a/netutils/thttpd/cgi-src/redirect.c +++ b/netutils/thttpd/cgi-src/redirect.c @@ -1,14 +1,10 @@ /**************************************************************************** * apps/netutils/thttpd/cgi-src/redirect.c - * Simple redirection CGI program * - * Copyright (C) 2009, 2015 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Derived from the file of the same name in the original THTTPD package: - * - * Copyright © 1995 by Jef Poskanzer . - * All rights reserved. + * SPDX-License-Identifier: BSD-2-Clause + * SPDX-FileCopyrightText: 2009, 2015 Gregory Nutt. All rights reserved. + * SPDX-FileCopyrightText: 1995 by Jef Poskanzer . + * SPDX-FileContributor: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/netutils/thttpd/cgi-src/ssi.c b/netutils/thttpd/cgi-src/ssi.c index 6608ba77f76..9c7f4681700 100644 --- a/netutils/thttpd/cgi-src/ssi.c +++ b/netutils/thttpd/cgi-src/ssi.c @@ -1,14 +1,10 @@ /**************************************************************************** * apps/netutils/thttpd/cgi-src/ssi.c - * Server-side-includes CGI program * - * Copyright (C) 2009, 2015 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Derived from the file of the same name in the original THTTPD package: - * - * Copyright 1995 by Jef Poskanzer . - * All rights reserved. + * SPDX-License-Identifier: BSD-2-Clause + * SPDX-FileCopyrightText: 2009, 2015 Gregory Nutt. All rights reserved. + * SPDX-FileCopyrightText: 1995 by Jef Poskanzer . + * SPDX-FileContributor: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/netutils/thttpd/config.h b/netutils/thttpd/config.h index acbbef4a605..dee2eb54245 100644 --- a/netutils/thttpd/config.h +++ b/netutils/thttpd/config.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/thttpd/config.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/thttpd/fdwatch.c b/netutils/thttpd/fdwatch.c index a58b012b601..320cf1a8571 100644 --- a/netutils/thttpd/fdwatch.c +++ b/netutils/thttpd/fdwatch.c @@ -1,14 +1,10 @@ /**************************************************************************** * apps/netutils/thttpd/fdwatch.c - * FD watcher routines for poll() * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Derived from the file of the same name in the original THTTPD package: - * - * Copyright (C) 1999,2000 by Jef Poskanzer . - * All rights reserved. + * SPDX-License-Identifier: BSD-2-Clause + * SPDX-FileCopyrightText: 2009 Gregory Nutt. All rights reserved. + * SPDX-FileCopyrightText: 1999,2000 by Jef Poskanzer . + * SPDX-FileContributor: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/netutils/thttpd/fdwatch.h b/netutils/thttpd/fdwatch.h index 4cb67aaa418..b985e17f9e2 100644 --- a/netutils/thttpd/fdwatch.h +++ b/netutils/thttpd/fdwatch.h @@ -1,13 +1,10 @@ /**************************************************************************** * apps/netutils/thttpd/fdwatch.h * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Derived from the file of the same name in THTTPD: - * - * Copyright (C) 1999 by Jef Poskanzer . - * All rights reserved. + * SPDX-License-Identifier: BSD-2-Clause + * SPDX-FileCopyrightText: 2009 Gregory Nutt. All rights reserved. + * SPDX-FileCopyrightText: 1999 by Jef Poskanzer . + * SPDX-FileContributor: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/netutils/thttpd/libhttpd.c b/netutils/thttpd/libhttpd.c index 697dd1d50cc..9bb8d20d7ef 100644 --- a/netutils/thttpd/libhttpd.c +++ b/netutils/thttpd/libhttpd.c @@ -1,14 +1,13 @@ /**************************************************************************** * apps/netutils/thttpd/libhttpd.c - * HTTP Protocol Library * - * Copyright (C) 2011, 2013, 2015-2016 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Derived from the file of the same name in the original THTTPD package: - * - * Copyright 1995,1998,1999,2000,2001 by Jef Poskanzer . - * All rights reserved. + * SPDX-License-Identifier: BSD-2-Clause + * SPDX-FileCopyrightText: 2015, 2016 Gregory Nutt. All rights reserved. + * SPDX-FileCopyrightText: 2011, 2013 Gregory Nutt. All rights reserved. + * SPDX-FileCopyrightText: 2000, 2001 by Jef Poskanzer . + * SPDX-FileCopyrightText: 1998, 1999 by Jef Poskanzer . + * SPDX-FileCopyrightText: 1995 by Jef Poskanzer . + * SPDX-FileContributor: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/netutils/thttpd/libhttpd.h b/netutils/thttpd/libhttpd.h index e5c3486716d..310b9f625fd 100644 --- a/netutils/thttpd/libhttpd.h +++ b/netutils/thttpd/libhttpd.h @@ -1,15 +1,12 @@ /**************************************************************************** * apps/netutils/thttpd/libhttpd.h - * HTTP Protocol Library Definitions * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Derived from the file of the same name in the original THTTPD package: - * - * Copyright (C) 1995,1998,1999,2000,2001 by Jef Poskanzer - * . - * All rights reserved. + * SPDX-License-Identifier: BSD-2-Clause + * SPDX-FileCopyrightText: 2009 Gregory Nutt. All rights reserved. + * SPDX-FileCopyrightText: 2000, 2001 by Jef Poskanzer . + * SPDX-FileCopyrightText: 1998, 1999 by Jef Poskanzer . + * SPDX-FileCopyrightText: 1995 by Jef Poskanzer . + * SPDX-FileContributor: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/netutils/thttpd/mime_types.h b/netutils/thttpd/mime_types.h index 8889cd3f735..4b0ba121eb1 100644 --- a/netutils/thttpd/mime_types.h +++ b/netutils/thttpd/mime_types.h @@ -1,39 +1,29 @@ /**************************************************************************** * apps/netutils/thttpd/mime_types.h - * Provides mappings between filename extensions, MIME types and encodings. * - * Based on mime_encodings.txt and mime_types.txt by Jef Poskanser which - * contained no copyright information. + * SPDX-License-Identifier: Apache-2.0 * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * http://www.apache.org/licenses/LICENSE-2.0 * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * Based on mime_encodings.txt and mime_types.txt by Jef Poskanser which + * contained no copyright information. * ****************************************************************************/ diff --git a/netutils/thttpd/tdate_parse.c b/netutils/thttpd/tdate_parse.c index 3622ffe9725..113059223d0 100644 --- a/netutils/thttpd/tdate_parse.c +++ b/netutils/thttpd/tdate_parse.c @@ -1,14 +1,10 @@ /**************************************************************************** * apps/netutils/thttpd/tdate_parse.c - * Parse string dates into internal form, stripped-down version * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Derived from the file of the same name in the original THTTPD package: - * - * Copyright © 1995 by Jef Poskanzer . - * All rights reserved. + * SPDX-License-Identifier: BSD-2-Clause + * SPDX-FileCopyrightText: 2009 Gregory Nutt. All rights reserved. + * SPDX-FileCopyrightText: 1995 by Jef Poskanzer . + * SPDX-FileContributor: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/netutils/thttpd/tdate_parse.h b/netutils/thttpd/tdate_parse.h index 8b984301dd9..efec65900fc 100644 --- a/netutils/thttpd/tdate_parse.h +++ b/netutils/thttpd/tdate_parse.h @@ -1,13 +1,10 @@ /**************************************************************************** * apps/netutils/thttpd/tdate_parse.h * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Derived from the file of the same name in THTTPD: - * - * Copyright (C) 1995 by Jef Poskanzer . - * All rights reserved. + * SPDX-License-Identifier: BSD-2-Clause + * SPDX-FileCopyrightText: 2009 Gregory Nutt. All rights reserved. + * SPDX-FileCopyrightText: 1995 by Jef Poskanzer . + * SPDX-FileContributor: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/netutils/thttpd/thttpd.c b/netutils/thttpd/thttpd.c index 58c6a290b43..22338665b16 100644 --- a/netutils/thttpd/thttpd.c +++ b/netutils/thttpd/thttpd.c @@ -1,14 +1,12 @@ /**************************************************************************** * apps/netutils/thttpd/thttpd.c - * Tiny HTTP Server * - * Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Derived from the file of the same name in the original THTTPD package: - * - * Copyright (C) 1995,1998,1999,2000,2001 by - * Jef Poskanzer . All rights reserved. + * SPDX-License-Identifier: BSD-2-Clause + * SPDX-FileCopyrightText: 2009, 2011 Gregory Nutt. All rights reserved. + * SPDX-FileCopyrightText: 2000, 2001 by Jef Poskanzer . + * SPDX-FileCopyrightText: 1998, 1999 by Jef Poskanzer . + * SPDX-FileCopyrightText: 1995 by Jef Poskanzer . + * SPDX-FileContributor: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/netutils/thttpd/thttpd_alloc.c b/netutils/thttpd/thttpd_alloc.c index 15640575fdc..7999f7823a7 100644 --- a/netutils/thttpd/thttpd_alloc.c +++ b/netutils/thttpd/thttpd_alloc.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/thttpd/thttpd_alloc.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/thttpd/thttpd_alloc.h b/netutils/thttpd/thttpd_alloc.h index 639e74dadf9..eab3208a1ea 100644 --- a/netutils/thttpd/thttpd_alloc.h +++ b/netutils/thttpd/thttpd_alloc.h @@ -1,35 +1,22 @@ /**************************************************************************** * apps/netutils/thttpd/thttpd_alloc.h * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt + * SPDX-License-Identifier: Apache-2.0 * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. + * http://www.apache.org/licenses/LICENSE-2.0 * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/netutils/thttpd/thttpd_cgi.c b/netutils/thttpd/thttpd_cgi.c index 456350b42b9..5c891456005 100644 --- a/netutils/thttpd/thttpd_cgi.c +++ b/netutils/thttpd/thttpd_cgi.c @@ -1,14 +1,13 @@ /**************************************************************************** * apps/netutils/thttpd/thttpd_cgi.c - * CGI support * - * Copyright (C) 2009, 2011, 2016 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Derived from the file libhttpd.c in the original THTTPD package: - * - * Copyright © 1995,1998,1999,2000,2001 by - * Jef Poskanzer . All rights reserved. + * SPDX-License-Identifier: BSD-2-Clause + * SPDX-FileCopyrightText: 2011, 2016 Gregory Nutt. All rights reserved. + * SPDX-FileCopyrightText: 2009 Gregory Nutt. All rights reserved. + * SPDX-FileCopyrightText: 2000, 2001 by Jef Poskanzer . + * SPDX-FileCopyrightText: 1998, 1999 by Jef Poskanzer . + * SPDX-FileCopyrightText: 1995 by Jef Poskanzer . + * SPDX-FileContributor: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/netutils/thttpd/thttpd_cgi.h b/netutils/thttpd/thttpd_cgi.h index 2d5c34bc198..2adcc676768 100644 --- a/netutils/thttpd/thttpd_cgi.h +++ b/netutils/thttpd/thttpd_cgi.h @@ -1,15 +1,12 @@ /**************************************************************************** * apps/netutils/thttpd/thttpd_cgi.h - * CGI support * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Derived from the file libhttpd.c in the original THTTPD package: - * - * Copyright (C) 1995,1998,1999,2000,2001 by Jef Poskanzer - * . - * All rights reserved. + * SPDX-License-Identifier: BSD-2-Clause + * SPDX-FileCopyrightText: 2009 Gregory Nutt. All rights reserved. + * SPDX-FileCopyrightText: 2000, 2001 by Jef Poskanzer . + * SPDX-FileCopyrightText: 1998, 1999 by Jef Poskanzer . + * SPDX-FileCopyrightText: 1995 by Jef Poskanzer . + * SPDX-FileContributor: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/netutils/thttpd/thttpd_strings.c b/netutils/thttpd/thttpd_strings.c index d541b7dcd0e..60f78e14dc4 100644 --- a/netutils/thttpd/thttpd_strings.c +++ b/netutils/thttpd/thttpd_strings.c @@ -1,14 +1,12 @@ /**************************************************************************** * apps/netutils/thttpd/thttpd_strings.c - * HTTP strings * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Derived from the file of the same name in the original THTTPD package: - * - * Copyright © 1995,1998,1999,2000,2001 by Jef Poskanzer - * . All rights reserved. + * SPDX-License-Identifier: BSD-2-Clause + * SPDX-FileCopyrightText: 2009 Gregory Nutt. All rights reserved. + * SPDX-FileCopyrightText: 2000, 2001 by Jef Poskanzer . + * SPDX-FileCopyrightText: 1998, 1999 by Jef Poskanzer . + * SPDX-FileCopyrightText: 1995 by Jef Poskanzer . + * SPDX-FileContributor: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/netutils/thttpd/thttpd_strings.h b/netutils/thttpd/thttpd_strings.h index 9b8d64d5a8c..ae063f63acf 100644 --- a/netutils/thttpd/thttpd_strings.h +++ b/netutils/thttpd/thttpd_strings.h @@ -1,14 +1,12 @@ /**************************************************************************** * apps/netutils/thttpd/thttpd_strings.h - * HTTP strings * - * Copyright (C) 2009, 2015 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Derived from the file of the same name in the original THTTPD package: - * - * Copyright (C) 1995,1998,1999,2000,2001 by Jef Poskanzer - * . All rights reserved. + * SPDX-License-Identifier: BSD-2-Clause + * SPDX-FileCopyrightText: 2009, 2015 Gregory Nutt. All rights reserved. + * SPDX-FileCopyrightText: 2000, 2001 by Jef Poskanzer . + * SPDX-FileCopyrightText: 1998, 1999 by Jef Poskanzer . + * SPDX-FileCopyrightText: 1995 by Jef Poskanzer . + * SPDX-FileContributor: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/netutils/thttpd/timers.c b/netutils/thttpd/timers.c index 828756d607a..a3bd898310c 100644 --- a/netutils/thttpd/timers.c +++ b/netutils/thttpd/timers.c @@ -1,14 +1,11 @@ /**************************************************************************** * apps/netutils/thttpd/timers.c - * Simple Timer Routines * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Derived from the file of the same name in the original THTTPD package: - * - * Copyright © 1995,1998,2000 by Jef Poskanzer . - * All rights reserved. + * SPDX-License-Identifier: BSD-2-Clause + * SPDX-FileCopyrightText: 2009 Gregory Nutt. All rights reserved. + * SPDX-FileCopyrightText: 1998, 2000 by Jef Poskanzer . + * SPDX-FileCopyrightText: 1995 by Jef Poskanzer . + * SPDX-FileContributor: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/netutils/thttpd/timers.h b/netutils/thttpd/timers.h index 4975a980918..dab16e29726 100644 --- a/netutils/thttpd/timers.h +++ b/netutils/thttpd/timers.h @@ -1,14 +1,12 @@ /**************************************************************************** * apps/netutils/thttpd/timers.h - * Header file for THTTPD timers package * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Derived from the file of the same name in THTTPD: - * - * Copyright (C) 1995,1998,1999,2000 by Jef Poskanzer . - * All rights reserved. + * SPDX-License-Identifier: BSD-2-Clause + * SPDX-FileCopyrightText: 2009 Gregory Nutt. All rights reserved. + * SPDX-FileCopyrightText: 2000 by Jef Poskanzer . + * SPDX-FileCopyrightText: 1998, 1999 by Jef Poskanzer . + * SPDX-FileCopyrightText: 1995 by Jef Poskanzer . + * SPDX-FileContributor: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/netutils/wakaama/CMakeLists.txt b/netutils/wakaama/CMakeLists.txt index 4f56ebb135e..97a6823c28e 100644 --- a/netutils/wakaama/CMakeLists.txt +++ b/netutils/wakaama/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/netutils/wakaama/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/netutils/wakaama/examples.cmake b/netutils/wakaama/examples.cmake index bfce0ffb068..3c4e6257f97 100644 --- a/netutils/wakaama/examples.cmake +++ b/netutils/wakaama/examples.cmake @@ -1,6 +1,8 @@ # ############################################################################## # apps/netutils/wakaama/examples.cmake # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/netutils/wakeonlan/CMakeLists.txt b/netutils/wakeonlan/CMakeLists.txt index b773dd3ef58..c881d7c7792 100644 --- a/netutils/wakeonlan/CMakeLists.txt +++ b/netutils/wakeonlan/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/netutils/wakeonlan/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/netutils/wakeonlan/Make.defs b/netutils/wakeonlan/Make.defs index e673d0be0d0..b36aab16713 100644 --- a/netutils/wakeonlan/Make.defs +++ b/netutils/wakeonlan/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/wakeonlan/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/wakeonlan/Makefile b/netutils/wakeonlan/Makefile index dc767528ed9..1e1cfc2b2ad 100644 --- a/netutils/wakeonlan/Makefile +++ b/netutils/wakeonlan/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/wakeonlan/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/wakeonlan/wol_main.c b/netutils/wakeonlan/wol_main.c index e756e178004..9c289bf1687 100644 --- a/netutils/wakeonlan/wol_main.c +++ b/netutils/wakeonlan/wol_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/wakeonlan/wol_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/webclient/CMakeLists.txt b/netutils/webclient/CMakeLists.txt index 2c09042174d..b3dfaf22d2d 100644 --- a/netutils/webclient/CMakeLists.txt +++ b/netutils/webclient/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/netutils/webclient/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/netutils/webclient/Make.defs b/netutils/webclient/Make.defs index b0277210a70..4f775bfc16e 100644 --- a/netutils/webclient/Make.defs +++ b/netutils/webclient/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/webclient/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/webclient/Makefile b/netutils/webclient/Makefile index 22b347f8b97..6446c8f8076 100644 --- a/netutils/webclient/Makefile +++ b/netutils/webclient/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/webclient/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/webclient/webclient.c b/netutils/webclient/webclient.c index d16db2f0720..8784b68b562 100644 --- a/netutils/webclient/webclient.c +++ b/netutils/webclient/webclient.c @@ -1,16 +1,13 @@ /**************************************************************************** * apps/netutils/webclient/webclient.c - * Implementation of the HTTP client. * - * Copyright (C) 2007, 2009, 2011-2012, 2014, 2020 Gregory Nutt. - * All rights reserved. - * Author: Gregory Nutt - * - * Based on uIP which also has a BSD style license: - * - * Author: Adam Dunkels - * Copyright (c) 2002, Adam Dunkels. - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2014, 2020 Gregory Nutt. All rights reserved. + * SPDX-FileCopyrightText: 2011-2012 Gregory Nutt. All rights reserved. + * SPDX-FileCopyrightText: 2007, 2009 Gregory Nutt. All rights reserved. + * SPDX-FileCopyrightText: 2002 Adam Dunkels. All rights reserved. + * SPDX-FileContributor: Gregory Nutt + * SPDX-FileContributor: Adam Dunkels * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/netutils/webserver/CMakeLists.txt b/netutils/webserver/CMakeLists.txt index 1d76e6592f5..fa7e37dd8d2 100644 --- a/netutils/webserver/CMakeLists.txt +++ b/netutils/webserver/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/netutils/webserver/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/netutils/webserver/Make.defs b/netutils/webserver/Make.defs index f61c832a0eb..c80c3d703a1 100644 --- a/netutils/webserver/Make.defs +++ b/netutils/webserver/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/webserver/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/webserver/Makefile b/netutils/webserver/Makefile index 2e46ff02511..32406ccdc5a 100644 --- a/netutils/webserver/Makefile +++ b/netutils/webserver/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/webserver/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/webserver/httpd.c b/netutils/webserver/httpd.c index 5916cbc63cd..23f69a94956 100644 --- a/netutils/webserver/httpd.c +++ b/netutils/webserver/httpd.c @@ -1,19 +1,12 @@ /**************************************************************************** * apps/netutils/webserver/httpd.c - * httpd Web server * - * Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * This is a leverage of similar logic from uIP: - * - * Author: Adam Dunkels - * Copyright (c) 2004, Adam Dunkels. - * All rights reserved. - * - * The uIP web server is a very simplistic implementation of an HTTP - * server. It can serve web pages and files from a read-only ROM - * filesystem, and provides a very small scripting language. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2011-2012 Gregory Nutt. All rights reserved. + * SPDX-FileCopyrightText: 2007-2009 Gregory Nutt. All rights reserved. + * SPDX-FileCopyrightText: 2004 Adam Dunkels. All rights reserved. + * SPDX-FileContributor: Gregory Nutt + * SPDX-FileContributor: Adam Dunkels * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/netutils/webserver/httpd.h b/netutils/webserver/httpd.h index 0a28fce1259..253adfcf1da 100644 --- a/netutils/webserver/httpd.h +++ b/netutils/webserver/httpd.h @@ -1,14 +1,12 @@ /**************************************************************************** * apps/netutils/webserver/httpd.h * - * Copyright (C) 2007, 2009, 2012 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Based on uIP which also has a BSD style license: - * - * Author: Adam Dunkels - * Copyright (c) 2001-2005, Adam Dunkels. - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2012 Gregory Nutt. All rights reserved. + * SPDX-FileCopyrightText: 2007,2009 Gregory Nutt. All rights reserved. + * SPDX-FileCopyrightText: 2001-2005 Adam Dunkels. All rights reserved. + * SPDX-FileContributor: Gregory Nutt + * SPDX-FileContributor: Adam Dunkels * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/netutils/webserver/httpd_cgi.c b/netutils/webserver/httpd_cgi.c index f917ebd16a9..aed510d54bb 100644 --- a/netutils/webserver/httpd_cgi.c +++ b/netutils/webserver/httpd_cgi.c @@ -1,10 +1,9 @@ /**************************************************************************** * apps/netutils/webserver/httpd_cgi.c - * Web server script interface - * Author: Adam Dunkels * - * Copyright (c) 2001-2006, Adam Dunkels. - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2001-2006 Adam Dunkels. All rights reserved. + * SPDX-FileContributor: Adam Dunkels * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/netutils/webserver/httpd_cgi.h b/netutils/webserver/httpd_cgi.h index 2a23664d645..b6f35aaed39 100644 --- a/netutils/webserver/httpd_cgi.h +++ b/netutils/webserver/httpd_cgi.h @@ -1,14 +1,12 @@ /**************************************************************************** * apps/netutils/webserver/httpd_cgi.h * - * Copyright (C) 2007, 2009, 2012 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Based on uIP which also has a BSD style license: - * - * Author: Adam Dunkels - * Copyright (c) 2001-2005, Adam Dunkels. - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2012 Gregory Nutt. All rights reserved. + * SPDX-FileCopyrightText: 2007, 2009 Gregory Nutt. All rights reserved. + * SPDX-FileCopyrightText: 2001-2005 Adam Dunkels. All rights reserved. + * SPDX-FileContributor: Gregory Nutt + * SPDX-FileContributor: Adam Dunkels * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/netutils/webserver/httpd_dirlist.c b/netutils/webserver/httpd_dirlist.c index cf2e0114aa1..bac1b2d77c2 100644 --- a/netutils/webserver/httpd_dirlist.c +++ b/netutils/webserver/httpd_dirlist.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/webserver/httpd_dirlist.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/webserver/httpd_fs.c b/netutils/webserver/httpd_fs.c index fb095c0636b..a32b7c4d490 100644 --- a/netutils/webserver/httpd_fs.c +++ b/netutils/webserver/httpd_fs.c @@ -1,14 +1,12 @@ /**************************************************************************** * apps/netutils/webserver/httpd_fs.c * - * Copyright (C) 2007-2009, 2011-2012 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Based on uIP which also has a BSD style license: - * - * Author: Adam Dunkels - * Copyright (c) 2001, Swedish Institute of Computer Science. - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2011-2012 Gregory Nutt. All rights reserved. + * SPDX-FileCopyrightText: 2007-2009 Gregory Nutt. All rights reserved. + * SPDX-FileCopyrightText: 2001, Swedish Institute of Computer Science. + * SPDX-FileContributor: Gregory Nutt + * SPDX-FileContributor: Adam Dunkels * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/netutils/webserver/httpd_mmap.c b/netutils/webserver/httpd_mmap.c index 10686c40ccb..a4f47427dee 100644 --- a/netutils/webserver/httpd_mmap.c +++ b/netutils/webserver/httpd_mmap.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/webserver/httpd_mmap.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/webserver/httpd_sendfile.c b/netutils/webserver/httpd_sendfile.c index 58847fd7da3..7ff8a5ccd7f 100644 --- a/netutils/webserver/httpd_sendfile.c +++ b/netutils/webserver/httpd_sendfile.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/netutils/webserver/httpd_sendfile.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/netutils/xmlrpc/CMakeLists.txt b/netutils/xmlrpc/CMakeLists.txt index f17396c0747..e03521be796 100644 --- a/netutils/xmlrpc/CMakeLists.txt +++ b/netutils/xmlrpc/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/netutils/xmlrpc/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/netutils/xmlrpc/Make.defs b/netutils/xmlrpc/Make.defs index 1758a6c8405..287e261ee78 100644 --- a/netutils/xmlrpc/Make.defs +++ b/netutils/xmlrpc/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/xmlrpc/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/xmlrpc/Makefile b/netutils/xmlrpc/Makefile index ccd7ec72979..b01f2eee061 100644 --- a/netutils/xmlrpc/Makefile +++ b/netutils/xmlrpc/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/netutils/xmlrpc/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/netutils/xmlrpc/response.c b/netutils/xmlrpc/response.c index 54577be7422..c9eef6b737d 100644 --- a/netutils/xmlrpc/response.c +++ b/netutils/xmlrpc/response.c @@ -1,14 +1,10 @@ /**************************************************************************** * apps/netutils/xmlrpc/response.c * - * Copyright (C) 2012 Max Holtzberg. All rights reserved. - * Author: Max Holtzberg - * - * Based on the embeddable lightweight XML-RPC server code discussed - * in the article at: http://www.drdobbs.com/web-development/\ - * an-embeddable-lightweight-xml-rpc-server/184405364 - * - * Copyright (c) 2002 Cogito LLC. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2012 Max Holtzberg. All rights reserved. + * SPDX-FileCopyrightText: 2002 Cogito LLC. All rights reserved. + * SPDX-FileContributor: Max Holtzberg * * Redistribution and use in source and binary forms, with or * without modification, is hereby granted without fee provided @@ -40,6 +36,12 @@ * POSSIBILITY OF SUCH DAMAGE. ****************************************************************************/ +/**************************************************************************** + * Based on the embeddable lightweight XML-RPC server code discussed + * in the article at: http://www.drdobbs.com/web-development/\ + * an-embeddable-lightweight-xml-rpc-server/184405364 + ****************************************************************************/ + /* Lightweight Embedded XML-RPC Server Response Generator * * mtj@cogitollc.com diff --git a/netutils/xmlrpc/xmlparser.c b/netutils/xmlrpc/xmlparser.c index a7276e734da..4c0203a67ac 100644 --- a/netutils/xmlrpc/xmlparser.c +++ b/netutils/xmlrpc/xmlparser.c @@ -1,14 +1,10 @@ /**************************************************************************** * apps/netutils/xmlrpc/xmlparser.c * - * Copyright (C) 2012 Max Holtzberg. All rights reserved. - * Author: Max Holtzberg - * - * Based on the embeddable lightweight XML-RPC server code discussed - * in the article at: http://www.drdobbs.com/web-development/\ - * an-embeddable-lightweight-xml-rpc-server/184405364 - * - * Copyright (c) 2002 Cogito LLC. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2012 Max Holtzberg. All rights reserved. + * SPDX-FileCopyrightText: 2002 Cogito LLC. All rights reserved. + * SPDX-FileContributor: Max Holtzberg * * Redistribution and use in source and binary forms, with or * without modification, is hereby granted without fee provided @@ -40,6 +36,12 @@ * POSSIBILITY OF SUCH DAMAGE. ****************************************************************************/ +/**************************************************************************** + * Based on the embeddable lightweight XML-RPC server code discussed + * in the article at: http://www.drdobbs.com/web-development/\ + * an-embeddable-lightweight-xml-rpc-server/184405364 + ****************************************************************************/ + /* Lightweight Embedded XML-RPC Server XML Parser * * mtj@cogitollc.com From 196be15587c2ff215eea118563c9f290641b7604 Mon Sep 17 00:00:00 2001 From: chenrun1 Date: Tue, 17 Dec 2024 12:27:11 +0800 Subject: [PATCH 089/391] Adjust the default priority of some test cases Summary: Avoid blocking other tasks when there is a large amount of data, such as rpmsg, etc. 1. change ramtest PRI to 90 2. change memtester PRI to 90 Signed-off-by: chenrun1 --- testing/memtester/Kconfig | 2 +- testing/ramtest/Kconfig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/testing/memtester/Kconfig b/testing/memtester/Kconfig index 98c6c4cffc3..ecfdaefb9d6 100644 --- a/testing/memtester/Kconfig +++ b/testing/memtester/Kconfig @@ -19,7 +19,7 @@ config UTILS_MEMTESTER_STACKSIZE config UTILS_MEMTESTER_PRIORITY int "Task PRIORITY" - default 100 + default 90 config UTILS_MEMTESTER_NARROW bool "TEST_NARROW" diff --git a/testing/ramtest/Kconfig b/testing/ramtest/Kconfig index 4846e06cc7e..a8d4a5fe98e 100644 --- a/testing/ramtest/Kconfig +++ b/testing/ramtest/Kconfig @@ -20,7 +20,7 @@ config TESTING_RAMTEST_PROGNAME config TESTING_RAMTEST_PRIORITY int "RAM test task priority" - default 100 + default 90 config TESTING_RAMTEST_STACKSIZE int "RAM test stack size" From 876130b8e78da578cbec4143bf12dab55cb0db42 Mon Sep 17 00:00:00 2001 From: chenrun1 Date: Fri, 8 Nov 2024 17:58:09 +0800 Subject: [PATCH 090/391] memorystress:Optimization of multithreaded scenario Summary: 1. In a multi-threaded scenario, each thread has its own context 2. Adjust code structure Signed-off-by: chenrun1 --- testing/memstress/memorystress_main.c | 190 +++++++++++++------------- 1 file changed, 92 insertions(+), 98 deletions(-) diff --git a/testing/memstress/memorystress_main.c b/testing/memstress/memorystress_main.c index dbf77222db7..fa6ff5b5627 100644 --- a/testing/memstress/memorystress_main.c +++ b/testing/memstress/memorystress_main.c @@ -69,13 +69,6 @@ struct memorystress_func_s void (*freefunc)(FAR void *ptr); }; -struct memorystress_config_s -{ - FAR struct memorystress_func_s *func; - size_t max_allocsize; - size_t nodelen; -}; - struct memorystress_error_s { FAR uint8_t *buf; @@ -95,14 +88,21 @@ struct memorystress_node_s size_t size; }; -struct memorystress_context_s +struct memorystress_thread_context_s { FAR struct memorystress_node_s *node_array; - FAR struct memorystress_config_s *config; - FAR pthread_t *threads; + FAR struct memorystress_global_s *global; struct memorystress_error_s error; - uint32_t sleep_us; +}; + +struct memorystress_global_s +{ + FAR struct memorystress_func_s func; + FAR pthread_t *threads; + size_t max_allocsize; size_t nthreads; + size_t nodelen; + uint32_t sleep_us; bool debug; }; @@ -116,13 +116,14 @@ struct memorystress_context_s static void show_usage(FAR const char *progname) { - printf("\nUsage: %s -m -n -t " + printf("\nUsage: %s -m [max allocsize Default:8192] " + "-n [node length Default:1024] -t [sleep us Default:100]" " -x [nthreads Default:1] -d [debuger mode]\n", progname); printf("\nWhere:\n"); - printf(" -m max alloc size.\n"); - printf(" -n Number of allocated memory blocks .\n"); - printf(" -t Length of time between each test.\n"); + printf(" -m [max-allocsize] max alloc size.\n"); + printf(" -n [node length] Number of allocated memory blocks .\n"); + printf(" -t [sleep us] Length of time between each test.\n"); printf(" -x [nthreads] Enable multi-thread stress testing. \n"); printf(" -d [debug mode] Helps to localize the problem situation," "there is a lot of information output in this mode.\n"); @@ -187,7 +188,7 @@ static void error_result(struct memorystress_error_s error) * Name: checknode ****************************************************************************/ -static void checknode(FAR struct memorystress_context_s *context, +static void checknode(FAR struct memorystress_thread_context_s *context, FAR struct memorystress_node_s *node, enum memorystress_rwerror_e rwerror) { @@ -199,7 +200,7 @@ static void checknode(FAR struct memorystress_context_s *context, for (i = 0; i < size; i++) { - uint8_t write_value = genvalue(&seed, context->debug); + uint8_t write_value = genvalue(&seed, context->global->debug); uint8_t read_value = node->buf[i]; if (read_value != write_value) @@ -225,17 +226,18 @@ static void checknode(FAR struct memorystress_context_s *context, * Name: memorystress_iter ****************************************************************************/ -static bool memorystress_iter(FAR struct memorystress_context_s *context) +static bool memorystress_iter(FAR struct memorystress_thread_context_s + *context) { FAR struct memorystress_node_s *node; FAR struct memorystress_func_s *func; uint32_t seed = rand() % UINT32_MAX; - bool debug = context->debug; + bool debug = context->global->debug; size_t index; - index = randnum(context->config->nodelen, &seed); + index = randnum(context->global->nodelen, &seed); node = &(context->node_array[index]); - func = (FAR struct memorystress_func_s *)context->config->func; + func = &context->global->func; /* Record the current index and node address */ @@ -249,7 +251,7 @@ static bool memorystress_iter(FAR struct memorystress_context_s *context) /* Selection of test type and test size by random number */ FAR uint8_t *ptr = NULL; - size_t size = randnum(context->config->max_allocsize, &seed); + size_t size = randnum(context->global->max_allocsize, &seed); int switch_func = randnum(3, &seed); int align = 1 << (randnum(4, &seed) + 2); @@ -372,46 +374,41 @@ static FAR void *debug_realloc(FAR void *ptr, size_t new_size) } /**************************************************************************** - * Name: init + * Name: global_init ****************************************************************************/ -static void init(FAR struct memorystress_context_s *context, int argc, - FAR char *argv[]) +static void global_init(FAR struct memorystress_global_s *global, int argc, + FAR char *argv[]) { - FAR struct memorystress_config_s *config; - FAR struct memorystress_func_s *func; int ch; - memset(context, 0, sizeof(struct memorystress_context_s)); - context->nthreads = 1; - config = zalloc(sizeof(struct memorystress_config_s)); - func = zalloc(sizeof(struct memorystress_func_s)); - if (func == NULL || config == NULL) - { - free(config); - free(func); - syslog(LOG_ERR, MEMSTRESS_PREFIX "Malloc struct Failed\n"); - exit(EXIT_FAILURE); - } + memset(global, 0, sizeof(struct memorystress_global_s)); + + /* The default maximum memory held by a single thread is 8M */ + + global->nthreads = 1; + global->sleep_us = 100; + global->max_allocsize = 8192; + global->nodelen = 1024; while ((ch = getopt(argc, argv, "dm:n:t:x::")) != ERROR) { switch (ch) { case 'd': - context->debug = true; + global->debug = true; break; case 'm': - OPTARG_TO_VALUE(config->max_allocsize, size_t); + OPTARG_TO_VALUE(global->max_allocsize, size_t); break; case 'n': - OPTARG_TO_VALUE(config->nodelen, int); + OPTARG_TO_VALUE(global->nodelen, int); break; case 't': - OPTARG_TO_VALUE(context->sleep_us, uint32_t); + OPTARG_TO_VALUE(global->sleep_us, uint32_t); break; case 'x': - OPTARG_TO_VALUE(context->nthreads, int); + OPTARG_TO_VALUE(global->nthreads, int); break; default: show_usage(argv[0]); @@ -419,57 +416,52 @@ static void init(FAR struct memorystress_context_s *context, int argc, } } - if (config->max_allocsize == 0 || config->nodelen == 0 || - context->sleep_us == 0) - { - free(config); - free(func); - show_usage(argv[0]); - } - - /* initialization function */ - - if (context->debug) - { - func->malloc = debug_malloc; - func->aligned_alloc = debug_aligned_alloc; - func->realloc = debug_realloc; - func->freefunc = debug_free; - } - else - { - func->malloc = malloc; - func->aligned_alloc = aligned_alloc; - func->realloc = realloc; - func->freefunc = free; - } - - config->func = func; - context->config = config; + if (global->debug) + { + global->func.malloc = debug_malloc; + global->func.aligned_alloc = debug_aligned_alloc; + global->func.realloc = debug_realloc; + global->func.freefunc = debug_free; + } + else + { + global->func.malloc = malloc; + global->func.aligned_alloc = aligned_alloc; + global->func.realloc = realloc; + global->func.freefunc = free; + } + + global->threads = (FAR pthread_t *)malloc(sizeof(pthread_t) * + global->nthreads); + if (global->threads == NULL) + { + syslog(LOG_ERR, MEMSTRESS_PREFIX "Malloc threads Failed\n"); + exit(EXIT_FAILURE); + } + + syslog(LOG_INFO, MEMSTRESS_PREFIX "\n max_allocsize: %zu\n" + " nodelen: %zu\n sleep_us: %lu\n nthreads: %zu\n debug: %s\n", + global->max_allocsize, global->nodelen, global->sleep_us, + global->nthreads, global->debug ? "true" : "false"); + + srand(time(NULL)); +} - /* init node array */ +/**************************************************************************** + * Name: thread_init + ****************************************************************************/ - context->node_array = zalloc(config->nodelen * - sizeof(struct memorystress_node_s)); +static void thread_init(FAR struct memorystress_thread_context_s *context, + FAR struct memorystress_global_s *global) +{ + context->global = global; + context->node_array = zalloc(sizeof(struct memorystress_node_s) * + global->nodelen); if (context->node_array == NULL) { - free(func); - free(config); syslog(LOG_ERR, MEMSTRESS_PREFIX "Malloc Node Array Failed\n"); exit(EXIT_FAILURE); } - - context->threads = zalloc(context->nthreads * sizeof(pthread_t)); - if (context->threads == NULL) - { - free(func); - free(config); - free(context->node_array); - syslog(LOG_ERR, MEMSTRESS_PREFIX "Malloc threads Failed\n"); - exit(EXIT_FAILURE); - } - - srand(time(NULL)); } /**************************************************************************** @@ -478,12 +470,14 @@ static void init(FAR struct memorystress_context_s *context, int argc, FAR void *memorystress_thread(FAR void *arg) { - FAR struct memorystress_context_s *context; + FAR struct memorystress_global_s *global; + struct memorystress_thread_context_s context; - context = (FAR struct memorystress_context_s *)arg; - while (memorystress_iter(context)) + global = (FAR struct memorystress_global_s *)arg; + thread_init(&context, global); + while (memorystress_iter(&context)) { - usleep(context->sleep_us); + usleep(global->sleep_us); } return NULL; @@ -499,24 +493,24 @@ FAR void *memorystress_thread(FAR void *arg) int main(int argc, FAR char *argv[]) { - struct memorystress_context_s context; + struct memorystress_global_s global; int i; - init(&context, argc, argv); + global_init(&global, argc, argv); syslog(LOG_INFO, MEMSTRESS_PREFIX "testing...\n"); - for (i = 0; i < context.nthreads; i++) + for (i = 0; i < global.nthreads; i++) { - if (pthread_create(&context.threads[i], NULL, memorystress_thread, - (FAR void *)&context) != 0) + if (pthread_create(&global.threads[i], NULL, memorystress_thread, + (FAR void *)&global) != 0) { syslog(LOG_ERR, "Failed to create thread\n"); return 1; } } - for (i = 0; i < context.nthreads; i++) + for (i = 0; i < global.nthreads; i++) { - pthread_join(context.threads[i], NULL); + pthread_join(global.threads[i], NULL); } return 0; From 42d6ae6d07dd8abc83e59c6d9beee0f958d2b8fb Mon Sep 17 00:00:00 2001 From: chenrun1 Date: Fri, 29 Nov 2024 20:31:45 +0800 Subject: [PATCH 091/391] memorystress:fix build warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: CC: memorystress_main.c memorystress_main.c: In function ‘global_init’: memorystress_main.c:39:26: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘uint32_t’ {aka ‘unsigned int’} [-Wformat=] 39 | #define MEMSTRESS_PREFIX "MemoryStress:" | ^~~~~~~~~~~~~~~ memorystress_main.c:442:22: note: in expansion of macro ‘MEMSTRESS_PREFIX’ 442 | syslog(LOG_INFO, MEMSTRESS_PREFIX "\n max_allocsize: %zu\n" | ^~~~~~~~~~~~~~~~ memorystress_main.c:443:41: note: format string is defined here 443 | " nodelen: %zu\n sleep_us: %lu\n nthreads: %zu\n debug: %s\n", | ~~^ | | | long unsigned int | %u Signed-off-by: chenrun1 --- testing/memstress/memorystress_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testing/memstress/memorystress_main.c b/testing/memstress/memorystress_main.c index fa6ff5b5627..583c7015475 100644 --- a/testing/memstress/memorystress_main.c +++ b/testing/memstress/memorystress_main.c @@ -440,7 +440,8 @@ static void global_init(FAR struct memorystress_global_s *global, int argc, } syslog(LOG_INFO, MEMSTRESS_PREFIX "\n max_allocsize: %zu\n" - " nodelen: %zu\n sleep_us: %lu\n nthreads: %zu\n debug: %s\n", + " nodelen: %zu\n sleep_us: %" PRIu32 "\n nthreads: %zu\n " + "debug: %s\n", global->max_allocsize, global->nodelen, global->sleep_us, global->nthreads, global->debug ? "true" : "false"); From ee3400e78a30f04252af05d171a38b4b605fc1db Mon Sep 17 00:00:00 2001 From: chenrun1 Date: Mon, 23 Dec 2024 14:28:22 +0800 Subject: [PATCH 092/391] scanftest:need enable CONFIG_LIBC_SCANSET MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: "", instead of " ", to the first argument. Test #29 returned 0 instead of 1. Test #29 assigned "", instead of " q", to the first argument. Test #30 returned 0 instead of 2. Test #30 assigned "", instead of " ", to the first argument. Test #30 assigned "", instead of "Q", to the second argument. Test #31 returned 0 instead of 2. Test #31 assigned "", instead of "qwerty-", to the first argument. Test #31 assigned "", instead of "QWERTY-", to the second argument. Signed-off-by: chenrun1 --- testing/scanftest/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/testing/scanftest/Kconfig b/testing/scanftest/Kconfig index beb935a6bce..33426dc978c 100644 --- a/testing/scanftest/Kconfig +++ b/testing/scanftest/Kconfig @@ -5,6 +5,7 @@ config TESTING_SCANFTEST tristate "sscanf() test" + depends on LIBC_SCANSET default n ---help--- Enable sscanf() test From 54d73e46663bc8e5862d7747cde5238bc5bbb839 Mon Sep 17 00:00:00 2001 From: zhangshoukui Date: Wed, 25 Dec 2024 17:06:08 +0800 Subject: [PATCH 093/391] TESTING_NAND_SIM: Add depends on apps/testing/nand_sim/nand_sim_main.c:172:(.text.nand_main+0x93): undefined reference to `nand_ram_initialize' collect2: error: ld returned 1 exit status Signed-off-by: zhangshoukui --- testing/nand_sim/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/testing/nand_sim/Kconfig b/testing/nand_sim/Kconfig index a32f4d6dc8b..ccf2c657b9d 100644 --- a/testing/nand_sim/Kconfig +++ b/testing/nand_sim/Kconfig @@ -5,6 +5,7 @@ config TESTING_NAND_SIM boolean "NAND Flash Simulator" + depends on MTD_NAND_RAM default n ---help--- Enable the NAND Flash Simulator device. From c7a694ecc8fb7c5c544bb66ba7c7f15b818d86f9 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Sun, 29 Dec 2024 15:22:46 +0900 Subject: [PATCH 094/391] toywasm: bump to v65.0.0 --- interpreters/toywasm/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/interpreters/toywasm/Makefile b/interpreters/toywasm/Makefile index 6a012b808be..9de01ccc968 100644 --- a/interpreters/toywasm/Makefile +++ b/interpreters/toywasm/Makefile @@ -64,6 +64,7 @@ CSRCS += options.c CSRCS += report.c CSRCS += restart.c CSRCS += shared_memory.c +CSRCS += slist.c CSRCS += timeutil.c CSRCS += toywasm_config.c CSRCS += type.c @@ -145,7 +146,7 @@ CFLAGS += ${INCDIR_PREFIX}$(APPDIR)/interpreters/toywasm/toywasm/libdyld CFLAGS += -Wno-unknown-warning-option -Wno-unused-but-set-variable -Wno-unused-variable -Wno-return-type -TOYWASM_VERSION = d7bb4aaef08be2d7821891f17bd9ef82ac1ba358 +TOYWASM_VERSION = e972e94fa427c3371fb21ad4bb9f238a1cca7795 TOYWASM_UNPACK = toywasm TOYWASM_TARBALL = $(TOYWASM_VERSION).zip TOYWASM_URL_BASE = https://github.com/yamt/toywasm/archive/ From c2b6c75cdcb3a54b7c0fefe583864cc8568ec2c6 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Sun, 29 Dec 2024 15:27:01 +0900 Subject: [PATCH 095/391] toywasm/tmpl: Revert "interpreters: migrate to SPDX identifier" Note that these files are templates used by regen.sh script. --- interpreters/toywasm/tmpl/c-sections.in | 20 -------------------- interpreters/toywasm/tmpl/license.in | 2 +- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/interpreters/toywasm/tmpl/c-sections.in b/interpreters/toywasm/tmpl/c-sections.in index 723a3f7b4a6..46a3315126d 100644 --- a/interpreters/toywasm/tmpl/c-sections.in +++ b/interpreters/toywasm/tmpl/c-sections.in @@ -1,23 +1,3 @@ -/**************************************************************************** - * apps/interpreters/toywasm/tmpl/c-sections.in - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - /**************************************************************************** * Private Functions ****************************************************************************/ diff --git a/interpreters/toywasm/tmpl/license.in b/interpreters/toywasm/tmpl/license.in index 97d002a8452..90da07e105a 100644 --- a/interpreters/toywasm/tmpl/license.in +++ b/interpreters/toywasm/tmpl/license.in @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/interpreters/toywasm/tmpl/license.in + * apps/interpreters/toywasm/FILENAME * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with From 9b6bb67f9e32fa82cf002ba602fbf8547a97410e Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Sun, 29 Dec 2024 15:29:28 +0900 Subject: [PATCH 096/391] interpreters/toywasm/tmpl/license.in: Add SPDX identifier --- interpreters/toywasm/tmpl/license.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/interpreters/toywasm/tmpl/license.in b/interpreters/toywasm/tmpl/license.in index 90da07e105a..2f7e88877ba 100644 --- a/interpreters/toywasm/tmpl/license.in +++ b/interpreters/toywasm/tmpl/license.in @@ -1,6 +1,8 @@ /**************************************************************************** * apps/interpreters/toywasm/FILENAME * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The From 7a36a70e06402b9c1647dcf6833ca5a58e927132 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Sun, 29 Dec 2024 15:31:04 +0900 Subject: [PATCH 097/391] toywasm: regen ``` REF=e972e94fa427c3371fb21ad4bb9f238a1cca7795 ./regen.sh ``` --- interpreters/toywasm/include/toywasm_version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interpreters/toywasm/include/toywasm_version.h b/interpreters/toywasm/include/toywasm_version.h index 903f6778fe4..c069030f507 100644 --- a/interpreters/toywasm/include/toywasm_version.h +++ b/interpreters/toywasm/include/toywasm_version.h @@ -23,6 +23,6 @@ #if !defined(_TOYWASM_VERSION_H) #define _TOYWASM_VERSION_H -#define TOYWASM_VERSION "v63.0.0" +#define TOYWASM_VERSION "v65.0.0" #endif /* !defined(_TOYWASM_VERSION_H) */ From d581ccc7e2c79c831307fbf39333fd2075e984b6 Mon Sep 17 00:00:00 2001 From: zhangshoukui Date: Mon, 30 Dec 2024 15:50:56 +0800 Subject: [PATCH 098/391] fix tab error and remove Useless depends on Signed-off-by: zhangshoukui --- testing/testsuites/Kconfig | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/testing/testsuites/Kconfig b/testing/testsuites/Kconfig index 1b9070fccbc..d95596b8d4f 100644 --- a/testing/testsuites/Kconfig +++ b/testing/testsuites/Kconfig @@ -27,41 +27,33 @@ config TESTS_TESTSUITES_STACKSIZE config CM_FS_TEST bool "enable fs test" default n - depends on TESTS_TESTSUITES config CM_SCHED_TEST bool "enbale schedule test" default n - depends on TESTS_TESTSUITES config CM_MM_TEST bool "enbale MM test" default n - depends on TESTS_TESTSUITES config CM_TIME_TEST bool "enbale time test" default n - depends on TESTS_TESTSUITES config CM_PTHREAD_TEST bool "enbale pthread test" default n - depends on TESTS_TESTSUITES config CM_SOCKET_TEST - bool "enbale socket test" - default n - depends on TESTS_TESTSUITES + bool "enbale socket test" + default n config CM_SYSCALL_TEST - bool "enbale syscall test" - default n - depends on TESTS_TESTSUITES + bool "enbale syscall test" + default n config CM_MUTEX_TEST - bool "enbale mutex test" - default n - depends on TESTS_TESTSUITES + bool "enbale mutex test" + default n endif # TESTS_TESTSUITES From a91768e715b55fc1e124af923cd857824a745d21 Mon Sep 17 00:00:00 2001 From: Alin Jerpelea Date: Sun, 29 Dec 2024 12:19:52 +0100 Subject: [PATCH 099/391] examples: migrate to SPDX identifier Most tools used for compliance and SBOM generation use SPDX identifiers This change brings us a step closer to an easy SBOM generation. Signed-off-by: Alin Jerpelea --- examples/CMakeLists.txt | 2 ++ examples/Make.defs | 2 ++ examples/Makefile | 2 ++ examples/abntcodi/CMakeLists.txt | 2 ++ examples/abntcodi/Make.defs | 2 ++ examples/abntcodi/Makefile | 2 ++ examples/abntcodi/abntcodi_main.c | 2 ++ examples/adc/CMakeLists.txt | 2 ++ examples/adc/Make.defs | 2 ++ examples/adc/Makefile | 2 ++ examples/adc/adc.h | 2 ++ examples/adc/adc_main.c | 2 ++ examples/adjtime/CMakeLists.txt | 2 ++ examples/adjtime/Make.defs | 2 ++ examples/adjtime/Makefile | 2 ++ examples/adjtime/adjtime_main.c | 2 ++ examples/adxl372_test/CMakeLists.txt | 2 ++ examples/adxl372_test/Make.defs | 2 ++ examples/adxl372_test/Makefile | 2 ++ examples/adxl372_test/adxl372_test_main.c | 2 ++ examples/ajoystick/CMakeLists.txt | 2 ++ examples/ajoystick/Make.defs | 2 ++ examples/ajoystick/Makefile | 2 ++ examples/ajoystick/ajoy_main.c | 2 ++ examples/alarm/CMakeLists.txt | 2 ++ examples/alarm/Make.defs | 2 ++ examples/alarm/Makefile | 2 ++ examples/alarm/alarm_main.c | 2 ++ examples/amg88xx/CMakeLists.txt | 2 ++ examples/amg88xx/Make.defs | 2 ++ examples/amg88xx/Makefile | 2 ++ examples/amg88xx/amg88xx_main.c | 2 ++ examples/apa102/CMakeLists.txt | 2 ++ examples/apa102/Make.defs | 2 ++ examples/apa102/Makefile | 2 ++ examples/apa102/apa102_main.c | 2 ++ examples/apds9960/CMakeLists.txt | 2 ++ examples/apds9960/Make.defs | 2 ++ examples/apds9960/Makefile | 2 ++ examples/apds9960/apds9960_main.c | 2 ++ examples/audio_rttl/CMakeLists.txt | 2 ++ examples/audio_rttl/Make.defs | 2 ++ examples/audio_rttl/Makefile | 2 ++ examples/audio_rttl/audio_rttl.cxx | 2 ++ examples/audio_rttl/audio_rttl.h | 2 ++ examples/bastest/CMakeLists.txt | 2 ++ examples/bastest/Make.defs | 2 ++ examples/bastest/Makefile | 2 ++ examples/bastest/bastest_main.c | 2 ++ examples/battery/CMakeLists.txt | 2 ++ examples/battery/Make.defs | 2 ++ examples/battery/Makefile | 2 ++ examples/battery/batt_main.c | 2 ++ examples/ble/CMakeLists.txt | 2 ++ examples/ble/Make.defs | 2 ++ examples/ble/Makefile | 2 ++ examples/ble/ble.c | 2 ++ examples/ble/ble_main.c | 2 ++ examples/ble/dummy.c | 2 ++ examples/ble/sensors.c | 2 ++ examples/ble/sensors.h | 2 ++ examples/bme680/CMakeLists.txt | 2 ++ examples/bme680/Make.defs | 2 ++ examples/bme680/Makefile | 2 ++ examples/bme680/bme680_main.c | 2 ++ examples/bmi160/CMakeLists.txt | 2 ++ examples/bmi160/Make.defs | 2 ++ examples/bmi160/Makefile | 2 ++ examples/bmi160/sixaxis_main.c | 2 ++ examples/bmi160/sixaxis_uorb_main.c | 2 ++ examples/bmp180/CMakeLists.txt | 2 ++ examples/bmp180/Make.defs | 2 ++ examples/bmp180/Makefile | 2 ++ examples/bmp180/bmp180_main.c | 2 ++ examples/bmp280/CMakeLists.txt | 2 ++ examples/bmp280/Make.defs | 2 ++ examples/bmp280/Makefile | 2 ++ examples/bmp280/bmp280_main.c | 2 ++ examples/bridge/CMakeLists.txt | 2 ++ examples/bridge/Make.defs | 2 ++ examples/bridge/Makefile | 2 ++ examples/bridge/bridge_main.c | 2 ++ examples/bridge/host_main.c | 2 ++ examples/bridge/host_net1.c | 2 ++ examples/bridge/host_net2.c | 2 ++ examples/buttons/CMakeLists.txt | 2 ++ examples/buttons/Make.defs | 2 ++ examples/buttons/Makefile | 2 ++ examples/buttons/buttons_main.c | 2 ++ examples/calib_udelay/CMakeLists.txt | 2 ++ examples/calib_udelay/Make.defs | 2 ++ examples/calib_udelay/Makefile | 2 ++ examples/calib_udelay/calib_udelay_main.c | 2 ++ examples/camera/CMakeLists.txt | 2 ++ examples/camera/Make.defs | 2 ++ examples/camera/Makefile | 2 ++ examples/camera/camera_bkgd.c | 2 ++ examples/camera/camera_bkgd.h | 2 ++ examples/camera/camera_fileutil.c | 2 ++ examples/camera/camera_fileutil.h | 2 ++ examples/camera/camera_main.c | 2 ++ examples/can/CMakeLists.txt | 2 ++ examples/can/Make.defs | 2 ++ examples/can/Makefile | 2 ++ examples/can/can.h | 2 ++ examples/can/can_main.c | 2 ++ examples/capture/CMakeLists.txt | 2 ++ examples/capture/Make.defs | 2 ++ examples/capture/Makefile | 2 ++ examples/capture/cap.h | 2 ++ examples/capture/cap_main.c | 2 ++ examples/cbortest/CMakeLists.txt | 2 ++ examples/cbortest/Make.defs | 2 ++ examples/cbortest/Makefile | 2 ++ examples/cbortest/cbortest_main.c | 2 ++ examples/cctype/CMakeLists.txt | 2 ++ examples/cctype/Make.defs | 2 ++ examples/cctype/Makefile | 2 ++ examples/cctype/cctype_main.cxx | 2 ++ examples/charger/CMakeLists.txt | 2 ++ examples/charger/Make.defs | 2 ++ examples/charger/Makefile | 2 ++ examples/charger/charger_main.c | 2 ++ examples/chat/CMakeLists.txt | 2 ++ examples/chat/Make.defs | 2 ++ examples/chat/Makefile | 2 ++ examples/chat/chat_main.c | 5 ++-- examples/chrono/CMakeLists.txt | 2 ++ examples/chrono/Make.defs | 2 ++ examples/chrono/Makefile | 2 ++ examples/chrono/chrono_main.c | 2 ++ examples/configdata/CMakeLists.txt | 2 ++ examples/configdata/Make.defs | 2 ++ examples/configdata/Makefile | 2 ++ examples/configdata/configdata_main.c | 2 ++ examples/cordic/CMakeLists.txt | 2 ++ examples/cordic/Make.defs | 2 ++ examples/cordic/Makefile | 2 ++ examples/cordic/cordic_main.c | 2 ++ examples/cpuhog/CMakeLists.txt | 2 ++ examples/cpuhog/Make.defs | 2 ++ examples/cpuhog/Makefile | 2 ++ examples/cpuhog/cpuhog_main.c | 2 ++ examples/cromfs/CMakeLists.txt | 2 ++ examples/cromfs/Make.defs | 2 ++ examples/cromfs/Makefile | 2 ++ examples/dac/CMakeLists.txt | 2 ++ examples/dac/Make.defs | 2 ++ examples/dac/Makefile | 2 ++ examples/dac/dac_main.c | 2 ++ examples/dhcpd/CMakeLists.txt | 2 ++ examples/dhcpd/Make.defs | 2 ++ examples/dhcpd/Makefile | 2 ++ examples/dhcpd/Makefile.host | 2 ++ examples/dhcpd/dhcpd_daemon.c | 2 ++ examples/dhcpd/dhcpd_daemon.h | 2 ++ examples/dhcpd/dhcpd_start.c | 2 ++ examples/dhcpd/dhcpd_stop.c | 2 ++ examples/dhcpd/host.c | 2 ++ examples/dhcpd/target.c | 2 ++ examples/dhtxx/CMakeLists.txt | 2 ++ examples/dhtxx/Make.defs | 2 ++ examples/dhtxx/Makefile | 2 ++ examples/dhtxx/dhtxx_main.c | 2 ++ examples/discover/CMakeLists.txt | 2 ++ examples/discover/Make.defs | 2 ++ examples/discover/Makefile | 2 ++ examples/discover/discover_main.c | 2 ++ examples/djoystick/CMakeLists.txt | 2 ++ examples/djoystick/Make.defs | 2 ++ examples/djoystick/Makefile | 2 ++ examples/djoystick/djoy_main.c | 2 ++ examples/dronecan/CMakeLists.txt | 2 ++ examples/dronecan/Make.defs | 2 ++ examples/dronecan/Makefile | 2 ++ examples/dronecan/canard_main.c | 5 ++-- examples/elf/CMakeLists.txt | 2 ++ examples/elf/Make.defs | 2 ++ examples/elf/Makefile | 2 ++ examples/elf/elf_main.c | 2 ++ examples/elf/tests/Makefile | 2 ++ examples/elf/tests/errno/Makefile | 2 ++ examples/elf/tests/errno/errno.c | 2 ++ examples/elf/tests/hello/Makefile | 2 ++ examples/elf/tests/hello/hello.c | 2 ++ examples/elf/tests/helloxx/Makefile | 2 ++ examples/elf/tests/helloxx/hello++1.cxx | 2 ++ examples/elf/tests/helloxx/hello++2.cxx | 2 ++ examples/elf/tests/helloxx/hello++3.cxx | 2 ++ examples/elf/tests/helloxx/hello++4.cxx | 2 ++ examples/elf/tests/helloxx/hello++5.cxx | 2 ++ examples/elf/tests/longjmp/Makefile | 2 ++ examples/elf/tests/longjmp/longjmp.c | 2 ++ examples/elf/tests/mutex/Makefile | 2 ++ examples/elf/tests/mutex/mutex.c | 2 ++ examples/elf/tests/pthread/Makefile | 2 ++ examples/elf/tests/pthread/pthread.c | 2 ++ examples/elf/tests/signal/Makefile | 2 ++ examples/elf/tests/signal/signal.c | 2 ++ examples/elf/tests/struct/Makefile | 2 ++ examples/elf/tests/struct/struct.h | 2 ++ examples/elf/tests/struct/struct_dummy.c | 2 ++ examples/elf/tests/struct/struct_main.c | 2 ++ examples/elf/tests/task/Makefile | 2 ++ examples/elf/tests/task/task.c | 2 ++ examples/embedlog/CMakeLists.txt | 2 ++ examples/embedlog/Make.defs | 2 ++ examples/embedlog/Makefile | 2 ++ examples/embedlog/embedlog_main.c | 2 ++ examples/esp32_himem/CMakeLists.txt | 2 ++ examples/esp32_himem/Make.defs | 2 ++ examples/esp32_himem/Makefile | 2 ++ examples/esp32_himem/esp32_himem_main.c | 2 ++ examples/etl/CMakeLists.txt | 2 ++ examples/etl/Make.defs | 2 ++ examples/etl/Makefile | 2 ++ examples/etl/etl_main.cxx | 2 ++ examples/fb/CMakeLists.txt | 2 ++ examples/fb/Make.defs | 2 ++ examples/fb/Makefile | 2 ++ examples/fb/fb_main.c | 2 ++ examples/fboverlay/CMakeLists.txt | 2 ++ examples/fboverlay/Make.defs | 2 ++ examples/fboverlay/Makefile | 2 ++ examples/fboverlay/fboverlay_main.c | 2 ++ examples/flash_test/CMakeLists.txt | 2 ++ examples/flash_test/Make.defs | 2 ++ examples/flash_test/Makefile | 2 ++ examples/flash_test/flash_test.c | 2 ++ examples/flowc/CMakeLists.txt | 2 ++ examples/flowc/Make.defs | 2 ++ examples/flowc/Makefile | 2 ++ examples/flowc/flowc.h | 2 ++ examples/flowc/flowc_host.c | 2 ++ examples/flowc/flowc_mktestdata.c | 2 ++ examples/flowc/flowc_receiver.c | 2 ++ examples/flowc/flowc_sender.c | 2 ++ examples/flowc/flowc_target1.c | 2 ++ examples/flowc/flowc_target2.c | 2 ++ examples/fmsynth/CMakeLists.txt | 2 ++ examples/fmsynth/Make.defs | 2 ++ examples/fmsynth/Makefile | 2 ++ examples/fmsynth/keyboard_main.c | 2 ++ examples/fmsynth/mmlplayer_main.c | 2 ++ examples/fmsynth/mmlplayer_score.h | 2 ++ examples/fmsynth/music_scale.c | 2 ++ examples/fmsynth/music_scale.h | 2 ++ examples/fmsynth/operator_algorithm.c | 2 ++ examples/fmsynth/operator_algorithm.h | 2 ++ examples/foc/CMakeLists.txt | 2 ++ examples/foc/Make.defs | 2 ++ examples/foc/Makefile | 2 ++ examples/foc/foc_adc.h | 2 ++ examples/foc/foc_cfg.h | 2 ++ examples/foc/foc_debug.h | 2 ++ examples/foc/foc_device.c | 2 ++ examples/foc/foc_device.h | 2 ++ examples/foc/foc_fixed16_thr.c | 2 ++ examples/foc/foc_float_thr.c | 2 ++ examples/foc/foc_intf.c | 2 ++ examples/foc/foc_intf.h | 2 ++ examples/foc/foc_main.c | 2 ++ examples/foc/foc_motor_b16.c | 2 ++ examples/foc/foc_motor_b16.h | 2 ++ examples/foc/foc_motor_f32.c | 2 ++ examples/foc/foc_motor_f32.h | 2 ++ examples/foc/foc_mq.c | 2 ++ examples/foc/foc_mq.h | 2 ++ examples/foc/foc_nxscope.c | 2 ++ examples/foc/foc_nxscope.h | 2 ++ examples/foc/foc_parseargs.c | 2 ++ examples/foc/foc_parseargs.h | 2 ++ examples/foc/foc_perf.c | 2 ++ examples/foc/foc_perf.h | 2 ++ examples/foc/foc_thr.c | 2 ++ examples/foc/foc_thr.h | 2 ++ examples/ft80x/CMakeLists.txt | 2 ++ examples/ft80x/Make.defs | 2 ++ examples/ft80x/Makefile | 2 ++ examples/ft80x/ft80x.h | 2 ++ examples/ft80x/ft80x_bitmaps.c | 2 ++ examples/ft80x/ft80x_coprocessor.c | 2 ++ examples/ft80x/ft80x_main.c | 2 ++ examples/ft80x/ft80x_primitives.c | 2 ++ examples/ftpc/CMakeLists.txt | 2 ++ examples/ftpc/Make.defs | 2 ++ examples/ftpc/Makefile | 2 ++ examples/ftpc/ftpc.h | 2 ++ examples/ftpc/ftpc_cmds.c | 2 ++ examples/ftpc/ftpc_main.c | 2 ++ examples/ftpd/CMakeLists.txt | 2 ++ examples/ftpd/Make.defs | 2 ++ examples/ftpd/Makefile | 2 ++ examples/ftpd/ftpd.h | 2 ++ examples/ftpd/ftpd_main.c | 2 ++ examples/fxos8700cq_test/CMakeLists.txt | 2 ++ examples/fxos8700cq_test/Make.defs | 2 ++ examples/fxos8700cq_test/Makefile | 2 ++ examples/fxos8700cq_test/fxos8700cq_main.c | 3 ++- examples/gpio/CMakeLists.txt | 2 ++ examples/gpio/Make.defs | 2 ++ examples/gpio/Makefile | 2 ++ examples/gpio/gpio_main.c | 2 ++ examples/gps/CMakeLists.txt | 2 ++ examples/gps/Make.defs | 2 ++ examples/gps/Makefile | 2 ++ examples/gps/gps_main.c | 2 ++ examples/hall/CMakeLists.txt | 2 ++ examples/hall/Make.defs | 2 ++ examples/hall/Makefile | 2 ++ examples/hall/hall.h | 2 ++ examples/hall/hall_main.c | 2 ++ examples/hdc1008_demo/CMakeLists.txt | 2 ++ examples/hdc1008_demo/Make.defs | 2 ++ examples/hdc1008_demo/Makefile | 2 ++ examples/hdc1008_demo/hdc1008_main.c | 2 ++ examples/hello/CMakeLists.txt | 2 ++ examples/hello/Make.defs | 2 ++ examples/hello/Makefile | 2 ++ examples/hello/hello_main.c | 2 ++ examples/hello_d/Make.defs | 2 ++ examples/hello_d/Makefile | 2 ++ examples/hello_d/hello_d_main.d | 2 ++ examples/hello_d/nuttx_std.c | 2 ++ examples/hello_nim/Make.defs | 2 ++ examples/hello_nim/Makefile | 2 ++ examples/hello_nim/hello_nim_async.nim | 22 ++++++++++++++++ examples/hello_nim/hello_nim_main.c | 2 ++ examples/hello_rust/Make.defs | 2 ++ examples/hello_rust/Makefile | 2 ++ examples/hello_rust/hello_rust_main.rs | 2 ++ examples/hello_swift/BridgingHeader.h | 2 ++ examples/hello_swift/Make.defs | 2 ++ examples/hello_swift/Makefile | 2 ++ examples/hello_swift/hello_swift_main.swift | 2 ++ examples/hello_wasm/CMakeLists.txt | 2 ++ examples/hello_wasm/Make.defs | 2 ++ examples/hello_wasm/Makefile | 2 ++ examples/hello_wasm/hello_main.c | 2 ++ examples/hello_zig/Make.defs | 2 ++ examples/hello_zig/Makefile | 2 ++ examples/hello_zig/hello_zig.zig | 2 ++ examples/helloxx/CMakeLists.txt | 2 ++ examples/helloxx/Make.defs | 2 ++ examples/helloxx/Makefile | 2 ++ examples/helloxx/helloxx_main.cxx | 2 ++ examples/hidkbd/CMakeLists.txt | 2 ++ examples/hidkbd/Make.defs | 2 ++ examples/hidkbd/Makefile | 2 ++ examples/hidkbd/hidkbd_main.c | 2 ++ examples/hts221_reader/CMakeLists.txt | 2 ++ examples/hts221_reader/Make.defs | 2 ++ examples/hts221_reader/Makefile | 2 ++ examples/hts221_reader/hts221_reader_main.c | 2 ++ examples/hx711/CMakeLists.txt | 2 ++ examples/hx711/Make.defs | 2 ++ examples/hx711/Makefile | 2 ++ examples/hx711/hx711_main.c | 2 ++ examples/i2schar/CMakeLists.txt | 2 ++ examples/i2schar/Make.defs | 2 ++ examples/i2schar/Makefile | 2 ++ examples/i2schar/i2schar.h | 2 ++ examples/i2schar/i2schar_main.c | 2 ++ examples/i2schar/i2schar_receiver.c | 2 ++ examples/i2schar/i2schar_transmitter.c | 2 ++ examples/i2sloop/CMakeLists.txt | 2 ++ examples/i2sloop/Make.defs | 2 ++ examples/i2sloop/Makefile | 2 ++ examples/i2sloop/i2sloop_main.c | 2 ++ examples/igmp/CMakeLists.txt | 2 ++ examples/igmp/Make.defs | 2 ++ examples/igmp/Makefile | 2 ++ examples/igmp/igmp.c | 2 ++ examples/igmp/igmp.h | 2 ++ examples/ina219/CMakeLists.txt | 2 ++ examples/ina219/Make.defs | 2 ++ examples/ina219/Makefile | 2 ++ examples/ina219/ina219_main.c | 2 ++ examples/ina226/CMakeLists.txt | 2 ++ examples/ina226/Make.defs | 2 ++ examples/ina226/Makefile | 2 ++ examples/ina226/ina226_main.c | 2 ++ examples/ini_dumper/CMakeLists.txt | 2 ++ examples/ini_dumper/Make.defs | 2 ++ examples/ini_dumper/Makefile | 2 ++ examples/ini_dumper/ini_dumper_main.c | 2 ++ examples/ipcfg/CMakeLists.txt | 2 ++ examples/ipcfg/Make.defs | 2 ++ examples/ipcfg/Makefile | 2 ++ examples/ipcfg/ipcfg_main.c | 2 ++ examples/ipforward/CMakeLists.txt | 2 ++ examples/ipforward/Make.defs | 2 ++ examples/ipforward/Makefile | 2 ++ examples/ipforward/ipforward.c | 2 ++ examples/isl29023/CMakeLists.txt | 2 ++ examples/isl29023/Make.defs | 2 ++ examples/isl29023/Makefile | 2 ++ examples/isl29023/isl29023_main.c | 2 ++ examples/json/CMakeLists.txt | 2 ++ examples/json/Make.defs | 2 ++ examples/json/Makefile | 2 ++ examples/json/json_main.c | 12 +++------ examples/keyboard/Make.defs | 2 ++ examples/keyboard/Makefile | 2 ++ examples/keyboard/kbd_main.c | 2 ++ examples/leds/CMakeLists.txt | 2 ++ examples/leds/Make.defs | 2 ++ examples/leds/Makefile | 2 ++ examples/leds/leds_main.c | 2 ++ examples/leds_rust/Make.defs | 2 ++ examples/leds_rust/Makefile | 2 ++ examples/leds_rust/leds_rust_main.rs | 2 ++ examples/leds_rust/nuttx.rs | 2 ++ examples/leds_zig/Make.defs | 2 ++ examples/leds_zig/Makefile | 2 ++ examples/leds_zig/leds_zig.zig | 2 ++ examples/libtest/CMakeLists.txt | 2 ++ examples/libtest/Make.defs | 2 ++ examples/libtest/Makefile | 2 ++ examples/libtest/libtest.c | 2 ++ examples/libtest/libtest.h | 2 ++ examples/libtest/libtest_main.c | 2 ++ examples/lis3dsh_reader/CMakeLists.txt | 2 ++ examples/lis3dsh_reader/Make.defs | 2 ++ examples/lis3dsh_reader/Makefile | 2 ++ examples/lis3dsh_reader/lis3dsh_reader_main.c | 5 ++-- examples/lp503x/CMakeLists.txt | 2 ++ examples/lp503x/Make.defs | 2 ++ examples/lp503x/Makefile | 2 ++ examples/lp503x/lp503x_main.c | 2 ++ examples/lsm303_reader/CMakeLists.txt | 2 ++ examples/lsm303_reader/Make.defs | 2 ++ examples/lsm303_reader/Makefile | 2 ++ examples/lsm303_reader/lsm303_reader_main.c | 2 ++ examples/lsm330spi_test/CMakeLists.txt | 2 ++ examples/lsm330spi_test/Make.defs | 2 ++ examples/lsm330spi_test/Makefile | 2 ++ examples/lsm330spi_test/lsm330spi_test_main.c | 2 ++ examples/lsm6dsl_reader/CMakeLists.txt | 2 ++ examples/lsm6dsl_reader/Make.defs | 2 ++ examples/lsm6dsl_reader/Makefile | 2 ++ examples/lsm6dsl_reader/lsm6dsl_reader_main.c | 2 ++ examples/ltr308/CMakeLists.txt | 2 ++ examples/ltr308/Make.defs | 2 ++ examples/ltr308/Makefile | 2 ++ examples/ltr308/ltr308_main.c | 2 ++ examples/lua_module/CMakeLists.txt | 2 ++ examples/lua_module/Make.defs | 2 ++ examples/lua_module/Makefile | 2 ++ examples/lua_module/luamod_hello.c | 2 ++ examples/lvgldemo/CMakeLists.txt | 2 ++ examples/lvgldemo/Make.defs | 2 ++ examples/lvgldemo/Makefile | 2 ++ examples/lvgldemo/lvgldemo.c | 2 ++ examples/lvglterm/CMakeLists.txt | 2 ++ examples/lvglterm/Make.defs | 2 ++ examples/lvglterm/Makefile | 2 ++ examples/lvglterm/lvglterm.c | 2 ++ examples/max31855/CMakeLists.txt | 2 ++ examples/max31855/Make.defs | 2 ++ examples/max31855/Makefile | 2 ++ examples/max31855/max31855_main.c | 2 ++ examples/mcuboot/CMakeLists.txt | 2 ++ examples/mcuboot/Make.defs | 2 ++ examples/mcuboot/Makefile | 2 ++ examples/mcuboot/slot_confirm/CMakeLists.txt | 2 ++ examples/mcuboot/slot_confirm/Make.defs | 2 ++ examples/mcuboot/slot_confirm/Makefile | 2 ++ .../slot_confirm/mcuboot_confirm_main.c | 2 ++ examples/mcuboot/swap_test/CMakeLists.txt | 2 ++ examples/mcuboot/swap_test/Make.defs | 2 ++ examples/mcuboot/swap_test/Makefile | 2 ++ examples/mcuboot/swap_test/confirm_main.c | 2 ++ examples/mcuboot/swap_test/set_img_main.c | 2 ++ examples/mcuboot/swap_test/version_main.c | 2 ++ examples/mcuboot/update_agent/CMakeLists.txt | 2 ++ examples/mcuboot/update_agent/Make.defs | 2 ++ examples/mcuboot/update_agent/Makefile | 2 ++ .../mcuboot/update_agent/mcuboot_agent_main.c | 2 ++ examples/media/CMakeLists.txt | 2 ++ examples/media/Make.defs | 2 ++ examples/media/Makefile | 2 ++ examples/media/media_main.c | 2 ++ examples/mld/CMakeLists.txt | 2 ++ examples/mld/Make.defs | 2 ++ examples/mld/Makefile | 2 ++ examples/mld/mld.h | 2 ++ examples/mld/mld_main.c | 2 ++ examples/mlx90614/CMakeLists.txt | 2 ++ examples/mlx90614/Make.defs | 2 ++ examples/mlx90614/Makefile | 2 ++ examples/mlx90614/mlx90614_main.c | 7 ++--- examples/mml_parser/CMakeLists.txt | 2 ++ examples/mml_parser/Make.defs | 2 ++ examples/mml_parser/Makefile | 2 ++ examples/mml_parser/mml_parser_main.c | 2 ++ examples/modbus/CMakeLists.txt | 2 ++ examples/modbus/Make.defs | 2 ++ examples/modbus/Makefile | 2 ++ examples/modbus/modbus_main.c | 2 ++ examples/modbusmaster/CMakeLists.txt | 2 ++ examples/modbusmaster/Make.defs | 2 ++ examples/modbusmaster/Makefile | 2 ++ examples/modbusmaster/mbmaster_main.c | 6 ++--- examples/module/CMakeLists.txt | 2 ++ examples/module/Make.defs | 2 ++ examples/module/Makefile | 2 ++ examples/module/chardev/Make.defs | 2 ++ examples/module/chardev/Makefile | 2 ++ examples/module/chardev/chardev.c | 2 ++ examples/module/main/CMakeLists.txt | 2 ++ examples/module/main/Make.defs | 2 ++ examples/module/main/Makefile | 6 ++++- examples/module/main/module_main.c | 2 ++ examples/mount/CMakeLists.txt | 2 ++ examples/mount/Make.defs | 2 ++ examples/mount/Makefile | 2 ++ examples/mount/mount.h | 2 ++ examples/mount/mount_main.c | 2 ++ examples/mount/ramdisk.c | 2 ++ examples/mqttc/CMakeLists.txt | 2 ++ examples/mqttc/Make.defs | 2 ++ examples/mqttc/Makefile | 2 ++ examples/mqttc/mqttc_pub.c | 2 ++ examples/mtdpart/CMakeLists.txt | 2 ++ examples/mtdpart/Make.defs | 2 ++ examples/mtdpart/Makefile | 2 ++ examples/mtdpart/mtdpart_main.c | 2 ++ examples/mtdrwb/CMakeLists.txt | 2 ++ examples/mtdrwb/Make.defs | 2 ++ examples/mtdrwb/Makefile | 2 ++ examples/mtdrwb/mtdrwb_main.c | 2 ++ examples/netlink_route/CMakeLists.txt | 2 ++ examples/netlink_route/Make.defs | 2 ++ examples/netlink_route/Makefile | 2 ++ examples/netlink_route/netlink_route_main.c | 2 ++ examples/netloop/CMakeLists.txt | 2 ++ examples/netloop/Make.defs | 2 ++ examples/netloop/Makefile | 2 ++ examples/netloop/lo_listener.c | 2 ++ examples/netloop/lo_main.c | 2 ++ examples/netloop/netloop.h | 2 ++ examples/netpkt/CMakeLists.txt | 2 ++ examples/netpkt/Make.defs | 2 ++ examples/netpkt/Makefile | 2 ++ examples/netpkt/netpkt_ethercat.c | 2 ++ examples/netpkt/netpkt_main.c | 2 ++ examples/nettest/CMakeLists.txt | 2 ++ examples/nettest/Make.defs | 2 ++ examples/nettest/Makefile | 2 ++ examples/nettest/host/CMakeLists.txt | 2 ++ examples/nettest/nettest.h | 2 ++ examples/nettest/nettest_client.c | 2 ++ examples/nettest/nettest_cmdline.c | 2 ++ examples/nettest/nettest_host.c | 2 ++ examples/nettest/nettest_netinit.c | 2 ++ examples/nettest/nettest_server.c | 2 ++ examples/nettest/nettest_target1.c | 2 ++ examples/nettest/nettest_target2.c | 2 ++ examples/nimble/CMakeLists.txt | 2 ++ examples/nimble/Make.defs | 2 ++ examples/nimble/Makefile | 2 ++ examples/nimble/nimble_main.c | 2 ++ examples/nng_test/CMakeLists.txt | 2 ++ examples/nng_test/Make.defs | 2 ++ examples/nng_test/Makefile | 2 ++ examples/nng_test/pubsub.c | 2 ++ examples/noteprintf/CMakeLists.txt | 2 ++ examples/noteprintf/Make.defs | 2 ++ examples/noteprintf/Makefile | 2 ++ examples/noteprintf/noteprintf_main.c | 2 ++ examples/nrf24l01_btle/CMakeLists.txt | 2 ++ examples/nrf24l01_btle/Make.defs | 5 ++-- examples/nrf24l01_btle/Makefile | 26 ++++++++++--------- examples/nrf24l01_btle/nrf24l01_btle.c | 2 ++ examples/nrf24l01_btle/nrf24l01_btle.h | 2 ++ examples/nrf24l01_term/CMakeLists.txt | 2 ++ examples/nrf24l01_term/Make.defs | 2 ++ examples/nrf24l01_term/Makefile | 2 ++ examples/nrf24l01_term/nrf24l01_term.c | 2 ++ examples/null/CMakeLists.txt | 2 ++ examples/null/Make.defs | 2 ++ examples/null/Makefile | 2 ++ examples/null/null_main.c | 2 ++ examples/nunchuck/CMakeLists.txt | 2 ++ examples/nunchuck/Make.defs | 2 ++ examples/nunchuck/Makefile | 2 ++ examples/nunchuck/nunchuck_main.c | 2 ++ examples/nx/CMakeLists.txt | 2 ++ examples/nx/Make.defs | 2 ++ examples/nx/Makefile | 2 ++ examples/nx/nx_events.c | 2 ++ examples/nx/nx_internal.h | 2 ++ examples/nx/nx_kbdin.c | 2 ++ examples/nx/nx_main.c | 2 ++ examples/nxdemo/CMakeLists.txt | 2 ++ examples/nxdemo/Make.defs | 2 ++ examples/nxdemo/Makefile | 2 ++ examples/nxdemo/images.h | 2 ++ examples/nxdemo/nxdemo.h | 2 ++ examples/nxdemo/nxdemo_bkgd.c | 2 ++ examples/nxdemo/nxdemo_listener.c | 2 ++ examples/nxdemo/nxdemo_main.c | 2 ++ examples/nxflat/CMakeLists.txt | 2 ++ examples/nxflat/Make.defs | 2 ++ examples/nxflat/Makefile | 2 ++ examples/nxflat/nxflat_main.c | 2 ++ examples/nxflat/tests/Makefile | 2 ++ examples/nxflat/tests/errno/Makefile | 2 ++ examples/nxflat/tests/errno/errno.c | 2 ++ examples/nxflat/tests/hello++/Makefile | 2 ++ examples/nxflat/tests/hello++/hello++1.cxx | 2 ++ examples/nxflat/tests/hello++/hello++2.cxx | 2 ++ examples/nxflat/tests/hello++/hello++3.cxx | 2 ++ examples/nxflat/tests/hello++/hello++4.cxx | 2 ++ examples/nxflat/tests/hello/Makefile | 2 ++ examples/nxflat/tests/hello/hello.c | 2 ++ examples/nxflat/tests/longjmp/Makefile | 2 ++ examples/nxflat/tests/longjmp/longjmp.c | 2 ++ examples/nxflat/tests/mkdirlist.sh | 21 +++++++++++++++ examples/nxflat/tests/mutex/Makefile | 2 ++ examples/nxflat/tests/mutex/mutex.c | 2 ++ examples/nxflat/tests/pthread/Makefile | 2 ++ examples/nxflat/tests/pthread/pthread.c | 2 ++ examples/nxflat/tests/signal/Makefile | 2 ++ examples/nxflat/tests/signal/signal.c | 2 ++ examples/nxflat/tests/struct/Makefile | 2 ++ examples/nxflat/tests/struct/struct.h | 2 ++ examples/nxflat/tests/struct/struct_dummy.c | 2 ++ examples/nxflat/tests/struct/struct_main.c | 2 ++ examples/nxflat/tests/task/Makefile | 2 ++ examples/nxflat/tests/task/task.c | 2 ++ examples/nxhello/CMakeLists.txt | 2 ++ examples/nxhello/Make.defs | 2 ++ examples/nxhello/Makefile | 2 ++ examples/nxhello/nxhello.h | 2 ++ examples/nxhello/nxhello_bkgd.c | 2 ++ examples/nxhello/nxhello_listener.c | 2 ++ examples/nxhello/nxhello_main.c | 2 ++ examples/nximage/CMakeLists.txt | 2 ++ examples/nximage/Make.defs | 2 ++ examples/nximage/Makefile | 2 ++ examples/nximage/nximage.h | 2 ++ examples/nximage/nximage_bitmap.c | 2 ++ examples/nximage/nximage_bkgd.c | 2 ++ examples/nximage/nximage_listener.c | 2 ++ examples/nximage/nximage_main.c | 2 ++ examples/nxlines/CMakeLists.txt | 2 ++ examples/nxlines/Make.defs | 2 ++ examples/nxlines/Makefile | 2 ++ examples/nxlines/nxlines.h | 2 ++ examples/nxlines/nxlines_bkgd.c | 2 ++ examples/nxlines/nxlines_listener.c | 2 ++ examples/nxlines/nxlines_main.c | 2 ++ examples/nxscope/CMakeLists.txt | 2 ++ examples/nxscope/Make.defs | 2 ++ examples/nxscope/Makefile | 2 ++ examples/nxscope/nxscope_main.c | 2 ++ examples/nxterm/CMakeLists.txt | 2 ++ examples/nxterm/Make.defs | 2 ++ examples/nxterm/Makefile | 2 ++ examples/nxterm/nxterm_internal.h | 2 ++ examples/nxterm/nxterm_listener.c | 2 ++ examples/nxterm/nxterm_main.c | 2 ++ examples/nxterm/nxterm_toolbar.c | 2 ++ examples/nxterm/nxterm_wndo.c | 2 ++ examples/nxtext/CMakeLists.txt | 2 ++ examples/nxtext/Make.defs | 2 ++ examples/nxtext/Makefile | 2 ++ examples/nxtext/nxtext_bkgd.c | 2 ++ examples/nxtext/nxtext_internal.h | 2 ++ examples/nxtext/nxtext_listener.c | 2 ++ examples/nxtext/nxtext_main.c | 2 ++ examples/nxtext/nxtext_popup.c | 2 ++ examples/nxtext/nxtext_putc.c | 2 ++ examples/obd2/CMakeLists.txt | 2 ++ examples/obd2/Make.defs | 2 ++ examples/obd2/Makefile | 2 ++ examples/obd2/obd2_main.c | 2 ++ examples/oneshot/CMakeLists.txt | 2 ++ examples/oneshot/Make.defs | 2 ++ examples/oneshot/Makefile | 2 ++ examples/oneshot/oneshot_main.c | 2 ++ examples/opencyphal/CMakeLists.txt | 2 ++ examples/opencyphal/Make.defs | 2 ++ examples/opencyphal/Makefile | 2 ++ examples/opencyphal/canard_main.c | 2 ++ examples/opencyphal/socketcan.c | 2 ++ examples/opencyphal/socketcan.h | 2 ++ examples/pca9635/CMakeLists.txt | 2 ++ examples/pca9635/Make.defs | 2 ++ examples/pca9635/Makefile | 2 ++ examples/pca9635/pca9635_main.c | 2 ++ examples/pdcurses/CMakeLists.txt | 2 ++ examples/pdcurses/Make.defs | 2 ++ examples/pdcurses/Makefile | 2 ++ examples/pdcurses/charset_main.c | 2 ++ examples/pdcurses/firework_main.c | 2 ++ examples/pdcurses/newdemo_main.c | 2 ++ examples/pdcurses/panel_main.c | 2 ++ examples/pdcurses/rain_main.c | 2 ++ examples/pdcurses/testcurs_main.c | 2 ++ examples/pdcurses/tui.c | 2 ++ examples/pdcurses/tui.h | 2 ++ examples/pdcurses/tui_main.c | 2 ++ examples/pdcurses/worm_main.c | 2 ++ examples/pdcurses/xmas_main.c | 2 ++ examples/pf_ieee802154/CMakeLists.txt | 2 ++ examples/pf_ieee802154/Make.defs | 2 ++ examples/pf_ieee802154/Makefile | 2 ++ examples/pf_ieee802154/pf_client.c | 2 ++ examples/pf_ieee802154/pf_cmdline.c | 2 ++ examples/pf_ieee802154/pf_server.c | 2 ++ examples/pf_ieee802154/pfieee802154.h | 2 ++ examples/pipe/CMakeLists.txt | 2 ++ examples/pipe/Make.defs | 2 ++ examples/pipe/Makefile | 2 ++ examples/pipe/interlock_test.c | 2 ++ examples/pipe/pipe.h | 2 ++ examples/pipe/pipe_main.c | 2 ++ examples/pipe/redirect_test.c | 2 ++ examples/pipe/transfer_test.c | 2 ++ examples/poll/CMakeLists.txt | 2 ++ examples/poll/Make.defs | 2 ++ examples/poll/Makefile | 2 ++ examples/poll/Makefile.host | 2 ++ examples/poll/host.c | 2 ++ examples/poll/net_listener.c | 2 ++ examples/poll/net_reader.c | 2 ++ examples/poll/poll_internal.h | 2 ++ examples/poll/poll_listener.c | 2 ++ examples/poll/poll_main.c | 2 ++ examples/poll/select_listener.c | 2 ++ examples/popen/CMakeLists.txt | 2 ++ examples/popen/Make.defs | 2 ++ examples/popen/Makefile | 2 ++ examples/popen/popen_main.c | 2 ++ examples/posix_spawn/CMakeLists.txt | 2 ++ examples/posix_spawn/Make.defs | 2 ++ examples/posix_spawn/Makefile | 2 ++ examples/posix_spawn/filesystem/Makefile | 2 ++ .../posix_spawn/filesystem/hello/Makefile | 2 ++ examples/posix_spawn/filesystem/hello/hello.c | 2 ++ .../posix_spawn/filesystem/redirect/Makefile | 2 ++ .../filesystem/redirect/redirect.c | 2 ++ examples/posix_spawn/spawn_main.c | 2 ++ examples/powerled/CMakeLists.txt | 2 ++ examples/powerled/Make.defs | 2 ++ examples/powerled/Makefile | 2 ++ examples/powerled/powerled_main.c | 2 ++ examples/powermonitor/CMakeLists.txt | 2 ++ examples/powermonitor/Make.defs | 2 ++ examples/powermonitor/Makefile | 2 ++ examples/powermonitor/powermonitor_main.c | 2 ++ examples/pppd/CMakeLists.txt | 2 ++ examples/pppd/Make.defs | 2 ++ examples/pppd/Makefile | 2 ++ examples/pppd/pppd_main.c | 5 ++-- examples/pty_test/CMakeLists.txt | 2 ++ examples/pty_test/Make.defs | 2 ++ examples/pty_test/Makefile | 2 ++ examples/pty_test/pty_test.c | 2 ++ examples/pwfb/CMakeLists.txt | 2 ++ examples/pwfb/Make.defs | 2 ++ examples/pwfb/Makefile | 2 ++ examples/pwfb/pwfb_events.c | 2 ++ examples/pwfb/pwfb_internal.h | 2 ++ examples/pwfb/pwfb_main.c | 2 ++ examples/pwfb/pwfb_motion.c | 2 ++ examples/pwlines/CMakeLists.txt | 2 ++ examples/pwlines/Make.defs | 2 ++ examples/pwlines/Makefile | 2 ++ examples/pwlines/pwlines_events.c | 2 ++ examples/pwlines/pwlines_internal.h | 2 ++ examples/pwlines/pwlines_main.c | 2 ++ examples/pwlines/pwlines_motion.c | 2 ++ examples/pwlines/pwlines_update.c | 2 ++ examples/pwm/CMakeLists.txt | 2 ++ examples/pwm/Make.defs | 2 ++ examples/pwm/Makefile | 2 ++ examples/pwm/pwm.h | 2 ++ examples/pwm/pwm_main.c | 2 ++ examples/qencoder/CMakeLists.txt | 2 ++ examples/qencoder/Make.defs | 2 ++ examples/qencoder/Makefile | 2 ++ examples/qencoder/qe.h | 2 ++ examples/qencoder/qe_main.c | 2 ++ examples/random/CMakeLists.txt | 2 ++ examples/random/Make.defs | 2 ++ examples/random/Makefile | 2 ++ examples/random/random_main.c | 2 ++ examples/relays/CMakeLists.txt | 2 ++ examples/relays/Make.defs | 2 ++ examples/relays/Makefile | 2 ++ examples/relays/relays_main.c | 2 ++ examples/rfid_readuid/CMakeLists.txt | 2 ++ examples/rfid_readuid/Make.defs | 2 ++ examples/rfid_readuid/Makefile | 2 ++ examples/rfid_readuid/rfid_readuid.c | 2 ++ examples/rgbled/CMakeLists.txt | 2 ++ examples/rgbled/Make.defs | 2 ++ examples/rgbled/Makefile | 2 ++ examples/rgbled/rgbled.c | 2 ++ examples/rmtchar/CMakeLists.txt | 2 ++ examples/rmtchar/Make.defs | 2 ++ examples/rmtchar/Makefile | 2 ++ examples/rmtchar/rmtchar.h | 2 ++ examples/rmtchar/rmtchar_common.c | 2 ++ examples/rmtchar/rmtchar_main.c | 2 ++ examples/rmtchar/rmtchar_receiver.c | 2 ++ examples/rmtchar/rmtchar_transmitter.c | 2 ++ examples/romfs/CMakeLists.txt | 2 ++ examples/romfs/Make.defs | 2 ++ examples/romfs/Makefile | 2 ++ examples/romfs/romfs_main.c | 2 ++ examples/rpmsgsocket/CMakeLists.txt | 6 +++-- examples/rpmsgsocket/Make.defs | 2 ++ examples/rpmsgsocket/Makefile | 2 ++ examples/rpmsgsocket/rpsock_client.c | 2 ++ examples/rpmsgsocket/rpsock_server.c | 2 ++ examples/scd41/CMakeLists.txt | 6 +++-- examples/scd41/Make.defs | 2 ++ examples/scd41/Makefile | 2 ++ examples/scd41/scd41_main.c | 2 ++ examples/sendmail/CMakeLists.txt | 2 ++ examples/sendmail/Make.defs | 2 ++ examples/sendmail/Makefile | 2 ++ examples/sendmail/sendmail_main.c | 2 ++ examples/sensor_fusion/Make.defs | 2 ++ examples/sensor_fusion/Makefile | 2 ++ examples/sensor_fusion/sensor_fusion_main.c | 2 ++ examples/serialblaster/CMakeLists.txt | 2 ++ examples/serialblaster/Make.defs | 2 ++ examples/serialblaster/Makefile | 2 ++ examples/serialblaster/serialblaster_main.c | 2 ++ examples/serialrx/CMakeLists.txt | 2 ++ examples/serialrx/Make.defs | 2 ++ examples/serialrx/Makefile | 2 ++ examples/serialrx/serialrx_main.c | 2 ++ examples/serloop/CMakeLists.txt | 2 ++ examples/serloop/Make.defs | 2 ++ examples/serloop/Makefile | 2 ++ examples/serloop/serloop_main.c | 2 ++ examples/settings/Make.defs | 2 ++ examples/settings/Makefile | 2 ++ examples/settings/settings_main.c | 2 ++ examples/shm_test/CMakeLists.txt | 2 ++ examples/shm_test/Make.defs | 2 ++ examples/shm_test/Makefile | 2 ++ examples/shm_test/shm_main.c | 2 ++ examples/sht3x/CMakeLists.txt | 2 ++ examples/sht3x/Make.defs | 2 ++ examples/sht3x/Makefile | 2 ++ examples/sht3x/sht3x_main.c | 2 ++ examples/slcd/CMakeLists.txt | 2 ++ examples/slcd/Make.defs | 2 ++ examples/slcd/Makefile | 2 ++ examples/slcd/slcd_main.c | 2 ++ examples/smps/CMakeLists.txt | 2 ++ examples/smps/Make.defs | 2 ++ examples/smps/Makefile | 2 ++ examples/smps/smps_main.c | 2 ++ examples/sotest/CMakeLists.txt | 2 ++ examples/sotest/Make.defs | 2 ++ examples/sotest/Makefile | 2 ++ examples/sotest/main/CMakeLists.txt | 2 ++ examples/sotest/main/Make.defs | 2 ++ examples/sotest/main/Makefile | 2 ++ examples/sotest/main/sotest_main.c | 2 ++ examples/sotest/modprint/Make.defs | 2 ++ examples/sotest/modprint/Makefile | 2 ++ examples/sotest/modprint/modprint.c | 2 ++ examples/sotest/sotest/Make.defs | 2 ++ examples/sotest/sotest/Makefile | 2 ++ examples/sotest/sotest/sotest.c | 2 ++ examples/spislv_test/CMakeLists.txt | 2 ++ examples/spislv_test/Make.defs | 2 ++ examples/spislv_test/Makefile | 2 ++ examples/spislv_test/spislv_test.c | 2 ++ examples/stat/CMakeLists.txt | 2 ++ examples/stat/Make.defs | 2 ++ examples/stat/Makefile | 2 ++ examples/stat/stat_main.c | 2 ++ examples/stepper/CMakeLists.txt | 2 ++ examples/stepper/Make.defs | 2 ++ examples/stepper/Makefile | 2 ++ examples/stepper/stepper.c | 2 ++ examples/sx127x_demo/CMakeLists.txt | 2 ++ examples/sx127x_demo/Make.defs | 2 ++ examples/sx127x_demo/Makefile | 2 ++ examples/sx127x_demo/sx127x_demo.c | 2 ++ examples/system/CMakeLists.txt | 2 ++ examples/system/Make.defs | 2 ++ examples/system/Makefile | 2 ++ examples/system/system_main.c | 2 ++ examples/tcp_ipc_client/CMakeLists.txt | 2 ++ examples/tcp_ipc_client/Make.defs | 2 ++ examples/tcp_ipc_client/Makefile | 2 ++ examples/tcp_ipc_client/protocol.h | 4 ++- examples/tcp_ipc_client/tcp_ipc_client_main.c | 2 ++ examples/tcp_ipc_server/CMakeLists.txt | 2 ++ examples/tcp_ipc_server/Make.defs | 2 ++ examples/tcp_ipc_server/Makefile | 2 ++ .../lorawan/uart_lorawan_layer.h | 4 ++- examples/tcp_ipc_server/protocol.c | 2 ++ examples/tcp_ipc_server/protocol.h | 4 ++- examples/tcp_ipc_server/tcp_ipc_server_main.c | 2 ++ examples/tcp_ipc_server/uart_lorawan_layer.c | 2 ++ examples/tcpblaster/CMakeLists.txt | 2 ++ examples/tcpblaster/Make.defs | 2 ++ examples/tcpblaster/Makefile | 2 ++ examples/tcpblaster/tcpblaster.h | 2 ++ examples/tcpblaster/tcpblaster_client.c | 2 ++ examples/tcpblaster/tcpblaster_cmdline.c | 2 ++ examples/tcpblaster/tcpblaster_host.c | 2 ++ examples/tcpblaster/tcpblaster_host.cmake | 2 ++ examples/tcpblaster/tcpblaster_netinit.c | 2 ++ examples/tcpblaster/tcpblaster_server.c | 2 ++ examples/tcpblaster/tcpblaster_target1.c | 2 ++ examples/tcpblaster/tcpblaster_target2.c | 2 ++ examples/tcpecho/CMakeLists.txt | 2 ++ examples/tcpecho/Make.defs | 2 ++ examples/tcpecho/Makefile | 2 ++ examples/tcpecho/tcpecho_main.c | 2 ++ examples/telnetd/CMakeLists.txt | 2 ++ examples/telnetd/Make.defs | 2 ++ examples/telnetd/Makefile | 2 ++ examples/telnetd/telnetd.c | 13 ++++------ examples/telnetd/telnetd.h | 2 ++ examples/termios/CMakeLists.txt | 2 ++ examples/termios/Make.defs | 2 ++ examples/termios/Makefile | 2 ++ examples/termios/termios_main.c | 2 ++ examples/thttpd/CMakeLists.txt | 2 ++ examples/thttpd/Make.defs | 2 ++ examples/thttpd/Makefile | 2 ++ examples/thttpd/content/Makefile.binfs | 2 ++ examples/thttpd/content/Makefile.nxflat | 2 ++ examples/thttpd/content/hello/Makefile | 2 ++ examples/thttpd/content/hello/hello.c | 2 ++ examples/thttpd/content/tasks/Makefile | 2 ++ examples/thttpd/content/tasks/tasks.c | 2 ++ examples/thttpd/thttpd_main.c | 2 ++ examples/tiff/CMakeLists.txt | 2 ++ examples/tiff/Make.defs | 2 ++ examples/tiff/Makefile | 2 ++ examples/tiff/tiff_main.c | 2 ++ examples/timer/CMakeLists.txt | 2 ++ examples/timer/Make.defs | 2 ++ examples/timer/Makefile | 2 ++ examples/timer/timer_main.c | 2 ++ examples/timer_gpio/CMakeLists.txt | 2 ++ examples/timer_gpio/Make.defs | 2 ++ examples/timer_gpio/Makefile | 2 ++ examples/timer_gpio/timer_gpio_main.c | 2 ++ examples/tlpi/Make.defs | 2 ++ examples/tlpi/Makefile | 2 ++ examples/touchscreen/CMakeLists.txt | 2 ++ examples/touchscreen/Make.defs | 2 ++ examples/touchscreen/Makefile | 2 ++ examples/touchscreen/tc.h | 2 ++ examples/touchscreen/tc_main.c | 2 ++ examples/udgram/CMakeLists.txt | 2 ++ examples/udgram/Make.defs | 2 ++ examples/udgram/Makefile | 2 ++ examples/udgram/udgram.h | 2 ++ examples/udgram/udgram_client.c | 2 ++ examples/udgram/udgram_server.c | 2 ++ examples/udp/CMakeLists.txt | 2 ++ examples/udp/Make.defs | 2 ++ examples/udp/Makefile | 2 ++ examples/udp/udp.h | 2 ++ examples/udp/udp_client.c | 2 ++ examples/udp/udp_cmdline.c | 2 ++ examples/udp/udp_host.c | 2 ++ examples/udp/udp_netinit.c | 2 ++ examples/udp/udp_server.c | 2 ++ examples/udp/udp_target1.c | 2 ++ examples/udp/udp_target2.c | 2 ++ examples/udpblaster/CMakeLists.txt | 2 ++ examples/udpblaster/Make.defs | 2 ++ examples/udpblaster/Makefile | 2 ++ examples/udpblaster/udpblaster.h | 2 ++ examples/udpblaster/udpblaster_host.c | 2 ++ examples/udpblaster/udpblaster_host.cmake | 2 ++ examples/udpblaster/udpblaster_target.c | 2 ++ examples/udpblaster/udpblaster_text.c | 2 ++ examples/uid/CMakeLists.txt | 2 ++ examples/uid/Make.defs | 2 ++ examples/uid/Makefile | 2 ++ examples/uid/uid_main.c | 2 ++ examples/unionfs/CMakeLists.txt | 2 ++ examples/unionfs/Make.defs | 2 ++ examples/unionfs/Makefile | 2 ++ examples/unionfs/unionfs_main.c | 2 ++ examples/usbserial/CMakeLists.txt | 2 ++ examples/usbserial/Make.defs | 2 ++ examples/usbserial/Makefile | 2 ++ examples/usbserial/Makefile.host | 2 ++ examples/usbserial/host.c | 2 ++ examples/usbserial/usbserial_main.c | 2 ++ examples/userfs/CMakeLists.txt | 2 ++ examples/userfs/Make.defs | 2 ++ examples/userfs/Makefile | 2 ++ examples/userfs/userfs_main.c | 2 ++ examples/usrsocktest/CMakeLists.txt | 2 ++ examples/usrsocktest/Make.defs | 2 ++ examples/usrsocktest/Makefile | 2 ++ examples/usrsocktest/defines.h | 2 ++ .../usrsocktest/usrsocktest_basic_connect.c | 2 ++ .../usrsocktest/usrsocktest_basic_daemon.c | 2 ++ .../usrsocktest_basic_getsockname.c | 2 ++ .../usrsocktest_basic_getsockopt.c | 2 ++ examples/usrsocktest/usrsocktest_basic_send.c | 2 ++ .../usrsocktest_basic_setsockopt.c | 2 ++ examples/usrsocktest/usrsocktest_block_recv.c | 2 ++ examples/usrsocktest/usrsocktest_block_send.c | 2 ++ examples/usrsocktest/usrsocktest_chardev.c | 2 ++ examples/usrsocktest/usrsocktest_daemon.c | 2 ++ examples/usrsocktest/usrsocktest_main.c | 2 ++ .../usrsocktest/usrsocktest_multi_thread.c | 2 ++ .../usrsocktest/usrsocktest_noblock_connect.c | 2 ++ .../usrsocktest/usrsocktest_noblock_recv.c | 2 ++ .../usrsocktest/usrsocktest_noblock_send.c | 2 ++ examples/usrsocktest/usrsocktest_nodaemon.c | 2 ++ examples/usrsocktest/usrsocktest_poll.c | 2 ++ .../usrsocktest_remote_disconnect.c | 2 ++ .../usrsocktest_wake_with_signal.c | 2 ++ examples/ustream/CMakeLists.txt | 2 ++ examples/ustream/Make.defs | 2 ++ examples/ustream/Makefile | 2 ++ examples/ustream/ustream.h | 2 ++ examples/ustream/ustream_client.c | 2 ++ examples/ustream/ustream_server.c | 2 ++ examples/veml6070/CMakeLists.txt | 2 ++ examples/veml6070/Make.defs | 2 ++ examples/veml6070/Makefile | 2 ++ examples/veml6070/veml6070_main.c | 2 ++ examples/wamr_module/CMakeLists.txt | 2 ++ examples/wamr_module/Make.defs | 2 ++ examples/wamr_module/Makefile | 2 ++ examples/wamr_module/module_hello.c | 2 ++ examples/watchdog/CMakeLists.txt | 2 ++ examples/watchdog/Make.defs | 2 ++ examples/watchdog/Makefile | 2 ++ examples/watchdog/watchdog.h | 2 ++ examples/watchdog/watchdog_main.c | 2 ++ examples/watched/CMakeLists.txt | 2 ++ examples/watched/Make.defs | 3 ++- examples/watched/Makefile | 4 ++- examples/watched/watched.c | 2 ++ examples/watched/watched.h | 2 ++ examples/watched/watched_main.c | 2 ++ examples/watcher/CMakeLists.txt | 2 ++ examples/watcher/Make.defs | 2 ++ examples/watcher/Makefile | 2 ++ examples/watcher/ramdisk.c | 2 ++ examples/watcher/ramdisk.h | 2 ++ examples/watcher/task_mn.c | 2 ++ examples/watcher/task_mn.h | 2 ++ examples/watcher/watcher_main.c | 2 ++ examples/watcher/wdt.c | 2 ++ examples/watcher/wdt.h | 2 ++ examples/webserver/CMakeLists.txt | 2 ++ examples/webserver/Make.defs | 2 ++ examples/webserver/Makefile | 2 ++ examples/webserver/cgi.c | 7 +++-- examples/webserver/cgi.h | 7 +++-- examples/wget/CMakeLists.txt | 2 ++ examples/wget/Make.defs | 2 ++ examples/wget/Makefile | 2 ++ examples/wget/wget_main.c | 2 ++ examples/wgetjson/CMakeLists.txt | 2 ++ examples/wgetjson/Make.defs | 2 ++ examples/wgetjson/Makefile | 2 ++ examples/wgetjson/wgetjson_main.c | 2 ++ examples/wiegand/Make.defs | 2 ++ examples/wiegand/Makefile | 2 ++ examples/wiegand/wiegand.c | 2 ++ examples/ws2812/CMakeLists.txt | 2 ++ examples/ws2812/Make.defs | 2 ++ examples/ws2812/Makefile | 2 ++ examples/ws2812/ws2812_main.c | 2 ++ examples/ws2812esp32rmt/CMakeLists.txt | 2 ++ examples/ws2812esp32rmt/Make.defs | 2 ++ examples/ws2812esp32rmt/Makefile | 2 ++ examples/ws2812esp32rmt/ws2812esp32rmt_main.c | 2 ++ examples/xbc_test/CMakeLists.txt | 6 ++--- examples/xbc_test/Make.defs | 2 ++ examples/xbc_test/Makefile | 2 ++ examples/xbc_test/xbc_test_main.c | 10 +++---- examples/xmlrpc/CMakeLists.txt | 2 ++ examples/xmlrpc/Make.defs | 2 ++ examples/xmlrpc/Makefile | 2 ++ examples/xmlrpc/calls.c | 17 ++++++------ examples/xmlrpc/xmlrpc_main.c | 18 ++++++------- examples/zerocross/CMakeLists.txt | 2 ++ examples/zerocross/Make.defs | 2 ++ examples/zerocross/Makefile | 2 ++ examples/zerocross/zerocross_main.c | 2 ++ 1100 files changed, 2294 insertions(+), 89 deletions(-) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 16281b51090..3d04efdf4f9 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/Make.defs b/examples/Make.defs index aa354e50318..08127668f52 100644 --- a/examples/Make.defs +++ b/examples/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/Makefile b/examples/Makefile index 26ecf518afd..9f8132ba599 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/abntcodi/CMakeLists.txt b/examples/abntcodi/CMakeLists.txt index b1d9eb4b616..19d10a4d8ca 100644 --- a/examples/abntcodi/CMakeLists.txt +++ b/examples/abntcodi/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/abntcodi/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/abntcodi/Make.defs b/examples/abntcodi/Make.defs index f6e97a68567..1e5389c2729 100644 --- a/examples/abntcodi/Make.defs +++ b/examples/abntcodi/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/abntcodi/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/abntcodi/Makefile b/examples/abntcodi/Makefile index e85c7a94bd8..d0277e3d275 100644 --- a/examples/abntcodi/Makefile +++ b/examples/abntcodi/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/abntcodi/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/abntcodi/abntcodi_main.c b/examples/abntcodi/abntcodi_main.c index 3a74f445be9..547b7d88d11 100644 --- a/examples/abntcodi/abntcodi_main.c +++ b/examples/abntcodi/abntcodi_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/abntcodi/abntcodi_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/adc/CMakeLists.txt b/examples/adc/CMakeLists.txt index 89242551eb5..215137a4005 100644 --- a/examples/adc/CMakeLists.txt +++ b/examples/adc/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/adc/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/adc/Make.defs b/examples/adc/Make.defs index 6f7d70ac4b5..baecb9a7073 100644 --- a/examples/adc/Make.defs +++ b/examples/adc/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/adc/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/adc/Makefile b/examples/adc/Makefile index 25d0e5f48b9..631234ff680 100644 --- a/examples/adc/Makefile +++ b/examples/adc/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/adc/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/adc/adc.h b/examples/adc/adc.h index e7bad34fdaf..45497b0c986 100644 --- a/examples/adc/adc.h +++ b/examples/adc/adc.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/adc/adc.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/adc/adc_main.c b/examples/adc/adc_main.c index 1db9817e0dd..89cee2f23f9 100644 --- a/examples/adc/adc_main.c +++ b/examples/adc/adc_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/adc/adc_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/adjtime/CMakeLists.txt b/examples/adjtime/CMakeLists.txt index 633bb7b1976..77c9338befa 100644 --- a/examples/adjtime/CMakeLists.txt +++ b/examples/adjtime/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/adjtime/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/adjtime/Make.defs b/examples/adjtime/Make.defs index f0ef399f1ea..0abb68bb1cd 100644 --- a/examples/adjtime/Make.defs +++ b/examples/adjtime/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/adjtime/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/adjtime/Makefile b/examples/adjtime/Makefile index 4874145665f..c35b77f2605 100644 --- a/examples/adjtime/Makefile +++ b/examples/adjtime/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/adjtime/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/adjtime/adjtime_main.c b/examples/adjtime/adjtime_main.c index a897fa15310..17eda10f510 100644 --- a/examples/adjtime/adjtime_main.c +++ b/examples/adjtime/adjtime_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/adjtime/adjtime_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/adxl372_test/CMakeLists.txt b/examples/adxl372_test/CMakeLists.txt index 3c5ae442897..ead2dd360e9 100644 --- a/examples/adxl372_test/CMakeLists.txt +++ b/examples/adxl372_test/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/adxl372_test/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/adxl372_test/Make.defs b/examples/adxl372_test/Make.defs index d5311c7a37b..92384909fea 100644 --- a/examples/adxl372_test/Make.defs +++ b/examples/adxl372_test/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/adxl372_test/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/adxl372_test/Makefile b/examples/adxl372_test/Makefile index 583a03e6da7..5c30ba191a2 100644 --- a/examples/adxl372_test/Makefile +++ b/examples/adxl372_test/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/adxl372_test/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/adxl372_test/adxl372_test_main.c b/examples/adxl372_test/adxl372_test_main.c index 2c05d61ba01..4d8b3ced9ab 100644 --- a/examples/adxl372_test/adxl372_test_main.c +++ b/examples/adxl372_test/adxl372_test_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/adxl372_test/adxl372_test_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/ajoystick/CMakeLists.txt b/examples/ajoystick/CMakeLists.txt index 6448f21f415..b35aff10aae 100644 --- a/examples/ajoystick/CMakeLists.txt +++ b/examples/ajoystick/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/ajoystick/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/ajoystick/Make.defs b/examples/ajoystick/Make.defs index e7757702350..623b4f1693d 100644 --- a/examples/ajoystick/Make.defs +++ b/examples/ajoystick/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/ajoystick/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/ajoystick/Makefile b/examples/ajoystick/Makefile index 04620d741b5..68d9de39f7d 100644 --- a/examples/ajoystick/Makefile +++ b/examples/ajoystick/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/ajoystick/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/ajoystick/ajoy_main.c b/examples/ajoystick/ajoy_main.c index c66a2c1a1c1..178608b2ff4 100644 --- a/examples/ajoystick/ajoy_main.c +++ b/examples/ajoystick/ajoy_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/ajoystick/ajoy_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/alarm/CMakeLists.txt b/examples/alarm/CMakeLists.txt index ecdfbd1cdf1..31445775044 100644 --- a/examples/alarm/CMakeLists.txt +++ b/examples/alarm/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/alarm/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/alarm/Make.defs b/examples/alarm/Make.defs index d2699def19d..79c467cd49d 100644 --- a/examples/alarm/Make.defs +++ b/examples/alarm/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/alarm/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/alarm/Makefile b/examples/alarm/Makefile index f0b8d745017..59cdad47a30 100644 --- a/examples/alarm/Makefile +++ b/examples/alarm/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/alarm/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/alarm/alarm_main.c b/examples/alarm/alarm_main.c index 74c5e8fc601..d4ab70a80cc 100644 --- a/examples/alarm/alarm_main.c +++ b/examples/alarm/alarm_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/alarm/alarm_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/amg88xx/CMakeLists.txt b/examples/amg88xx/CMakeLists.txt index 65493e9e9b6..cfd88724bfb 100644 --- a/examples/amg88xx/CMakeLists.txt +++ b/examples/amg88xx/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/amg88xx/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/amg88xx/Make.defs b/examples/amg88xx/Make.defs index 2fb5e030e19..ba390c84dbe 100644 --- a/examples/amg88xx/Make.defs +++ b/examples/amg88xx/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/amg88xx/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/amg88xx/Makefile b/examples/amg88xx/Makefile index a07deffdc8d..85f777d49f9 100644 --- a/examples/amg88xx/Makefile +++ b/examples/amg88xx/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/amg88xx/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/amg88xx/amg88xx_main.c b/examples/amg88xx/amg88xx_main.c index ded223369d0..93234832694 100644 --- a/examples/amg88xx/amg88xx_main.c +++ b/examples/amg88xx/amg88xx_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/amg88xx/amg88xx_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/apa102/CMakeLists.txt b/examples/apa102/CMakeLists.txt index c97ecf72f45..35344d1b467 100644 --- a/examples/apa102/CMakeLists.txt +++ b/examples/apa102/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/apa102/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/apa102/Make.defs b/examples/apa102/Make.defs index 6bcac6cd3d8..8286107ea43 100644 --- a/examples/apa102/Make.defs +++ b/examples/apa102/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/apa102/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/apa102/Makefile b/examples/apa102/Makefile index fe7d5e68990..afe3f91aea9 100644 --- a/examples/apa102/Makefile +++ b/examples/apa102/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/apa102/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/apa102/apa102_main.c b/examples/apa102/apa102_main.c index df41b016858..8e933b3923b 100644 --- a/examples/apa102/apa102_main.c +++ b/examples/apa102/apa102_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/apa102/apa102_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/apds9960/CMakeLists.txt b/examples/apds9960/CMakeLists.txt index e391d1d2ea5..6f2c7f2e8f2 100644 --- a/examples/apds9960/CMakeLists.txt +++ b/examples/apds9960/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/apds9960/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/apds9960/Make.defs b/examples/apds9960/Make.defs index 44bf6c6aa7b..3902c6ab28c 100644 --- a/examples/apds9960/Make.defs +++ b/examples/apds9960/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/apds9960/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/apds9960/Makefile b/examples/apds9960/Makefile index eced4dd3ecd..7701173d720 100644 --- a/examples/apds9960/Makefile +++ b/examples/apds9960/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/apds9960/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/apds9960/apds9960_main.c b/examples/apds9960/apds9960_main.c index ec186d5a0d7..97b5f907aca 100644 --- a/examples/apds9960/apds9960_main.c +++ b/examples/apds9960/apds9960_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/apds9960/apds9960_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/audio_rttl/CMakeLists.txt b/examples/audio_rttl/CMakeLists.txt index 713549198ea..ec7709bd3cb 100644 --- a/examples/audio_rttl/CMakeLists.txt +++ b/examples/audio_rttl/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/audio_rttl/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/audio_rttl/Make.defs b/examples/audio_rttl/Make.defs index 8d5430e2f46..8975cb9ab00 100644 --- a/examples/audio_rttl/Make.defs +++ b/examples/audio_rttl/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/audio_rttl/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/audio_rttl/Makefile b/examples/audio_rttl/Makefile index c644377ad00..1816513a7b9 100644 --- a/examples/audio_rttl/Makefile +++ b/examples/audio_rttl/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/audio_rttl/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/audio_rttl/audio_rttl.cxx b/examples/audio_rttl/audio_rttl.cxx index bad903e919c..3533258c1a9 100644 --- a/examples/audio_rttl/audio_rttl.cxx +++ b/examples/audio_rttl/audio_rttl.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/audio_rttl/audio_rttl.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/audio_rttl/audio_rttl.h b/examples/audio_rttl/audio_rttl.h index 4759fb56ca8..41c5386d308 100644 --- a/examples/audio_rttl/audio_rttl.h +++ b/examples/audio_rttl/audio_rttl.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/audio_rttl/audio_rttl.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/bastest/CMakeLists.txt b/examples/bastest/CMakeLists.txt index fd26f559710..033ec2133b3 100644 --- a/examples/bastest/CMakeLists.txt +++ b/examples/bastest/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/bastest/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/bastest/Make.defs b/examples/bastest/Make.defs index 269db66092c..1ce65d36249 100644 --- a/examples/bastest/Make.defs +++ b/examples/bastest/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/bastest/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/bastest/Makefile b/examples/bastest/Makefile index 58531970d9e..ceed0ad3ba0 100644 --- a/examples/bastest/Makefile +++ b/examples/bastest/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/bastest/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/bastest/bastest_main.c b/examples/bastest/bastest_main.c index 4c0deab9e1c..2397b90c3ee 100644 --- a/examples/bastest/bastest_main.c +++ b/examples/bastest/bastest_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/bastest/bastest_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/battery/CMakeLists.txt b/examples/battery/CMakeLists.txt index 7968bb88c0a..857a78f108c 100644 --- a/examples/battery/CMakeLists.txt +++ b/examples/battery/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/battery/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/battery/Make.defs b/examples/battery/Make.defs index 499c6449bab..eb4247aab5a 100644 --- a/examples/battery/Make.defs +++ b/examples/battery/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/battery/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/battery/Makefile b/examples/battery/Makefile index 82cf964f537..184fdfb5d45 100644 --- a/examples/battery/Makefile +++ b/examples/battery/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/battery/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/battery/batt_main.c b/examples/battery/batt_main.c index fc427671adb..d88a2885f7a 100644 --- a/examples/battery/batt_main.c +++ b/examples/battery/batt_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/battery/batt_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/ble/CMakeLists.txt b/examples/ble/CMakeLists.txt index 037f9b2c8a5..7a01af99d9b 100644 --- a/examples/ble/CMakeLists.txt +++ b/examples/ble/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/ble/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/ble/Make.defs b/examples/ble/Make.defs index 1795a888c57..ddd9bd391ad 100644 --- a/examples/ble/Make.defs +++ b/examples/ble/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/ble/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/ble/Makefile b/examples/ble/Makefile index b3376702138..a2cfd248388 100644 --- a/examples/ble/Makefile +++ b/examples/ble/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/ble/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/ble/ble.c b/examples/ble/ble.c index eb18c4aba48..82bbed5e5e0 100644 --- a/examples/ble/ble.c +++ b/examples/ble/ble.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/ble/ble.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/ble/ble_main.c b/examples/ble/ble_main.c index 788efe417dc..7afb2eedd01 100644 --- a/examples/ble/ble_main.c +++ b/examples/ble/ble_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/ble/ble_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/ble/dummy.c b/examples/ble/dummy.c index 2d3a713294e..528c3a5b6d1 100644 --- a/examples/ble/dummy.c +++ b/examples/ble/dummy.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/ble/dummy.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. diff --git a/examples/ble/sensors.c b/examples/ble/sensors.c index 45c0aa85237..85aed45aad5 100644 --- a/examples/ble/sensors.c +++ b/examples/ble/sensors.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/ble/sensors.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. diff --git a/examples/ble/sensors.h b/examples/ble/sensors.h index a382f049978..9d6defe70b7 100644 --- a/examples/ble/sensors.h +++ b/examples/ble/sensors.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/ble/sensors.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. diff --git a/examples/bme680/CMakeLists.txt b/examples/bme680/CMakeLists.txt index 2da7f2a1194..9b151abaa9a 100644 --- a/examples/bme680/CMakeLists.txt +++ b/examples/bme680/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/bme680/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/bme680/Make.defs b/examples/bme680/Make.defs index 2578737a240..d4c3c6a9d12 100644 --- a/examples/bme680/Make.defs +++ b/examples/bme680/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/bme680/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/bme680/Makefile b/examples/bme680/Makefile index de2e631cf17..fd5240c3147 100644 --- a/examples/bme680/Makefile +++ b/examples/bme680/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/bme680/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/bme680/bme680_main.c b/examples/bme680/bme680_main.c index da7905ad916..d0e626f0183 100644 --- a/examples/bme680/bme680_main.c +++ b/examples/bme680/bme680_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/bme680/bme680_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/bmi160/CMakeLists.txt b/examples/bmi160/CMakeLists.txt index 18e1d01f978..a21a690bb70 100644 --- a/examples/bmi160/CMakeLists.txt +++ b/examples/bmi160/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/bmi160/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/bmi160/Make.defs b/examples/bmi160/Make.defs index d5495526c59..48c25caa972 100644 --- a/examples/bmi160/Make.defs +++ b/examples/bmi160/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/bmi160/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/bmi160/Makefile b/examples/bmi160/Makefile index 80d98ae2f2f..27789bd39e4 100644 --- a/examples/bmi160/Makefile +++ b/examples/bmi160/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/bmi160/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/bmi160/sixaxis_main.c b/examples/bmi160/sixaxis_main.c index c1456cefca5..bded1ead1cd 100644 --- a/examples/bmi160/sixaxis_main.c +++ b/examples/bmi160/sixaxis_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/bmi160/sixaxis_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/bmi160/sixaxis_uorb_main.c b/examples/bmi160/sixaxis_uorb_main.c index b07249ba5ac..2d9143eb82c 100644 --- a/examples/bmi160/sixaxis_uorb_main.c +++ b/examples/bmi160/sixaxis_uorb_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/bmi160/sixaxis_uorb_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/bmp180/CMakeLists.txt b/examples/bmp180/CMakeLists.txt index 90546f34199..814a5c896d3 100644 --- a/examples/bmp180/CMakeLists.txt +++ b/examples/bmp180/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/bmp180/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/bmp180/Make.defs b/examples/bmp180/Make.defs index 536fbb2af91..182d14940ca 100644 --- a/examples/bmp180/Make.defs +++ b/examples/bmp180/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/bmp180/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/bmp180/Makefile b/examples/bmp180/Makefile index d67c98f27da..acdae3da2c0 100644 --- a/examples/bmp180/Makefile +++ b/examples/bmp180/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/bmp180/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/bmp180/bmp180_main.c b/examples/bmp180/bmp180_main.c index 0b5b98c23ef..69c467cf0c9 100644 --- a/examples/bmp180/bmp180_main.c +++ b/examples/bmp180/bmp180_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/bmp180/bmp180_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/bmp280/CMakeLists.txt b/examples/bmp280/CMakeLists.txt index 44b02d6d3be..6d45eb5256a 100644 --- a/examples/bmp280/CMakeLists.txt +++ b/examples/bmp280/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/bmp280/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/bmp280/Make.defs b/examples/bmp280/Make.defs index 875a775b008..0f7ee54cf97 100644 --- a/examples/bmp280/Make.defs +++ b/examples/bmp280/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/bmp280/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/bmp280/Makefile b/examples/bmp280/Makefile index 566cafb5287..bda4bb88110 100644 --- a/examples/bmp280/Makefile +++ b/examples/bmp280/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/bmp280/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/bmp280/bmp280_main.c b/examples/bmp280/bmp280_main.c index d41927b25f1..1b8fdde88c9 100644 --- a/examples/bmp280/bmp280_main.c +++ b/examples/bmp280/bmp280_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/bmp280/bmp280_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/bridge/CMakeLists.txt b/examples/bridge/CMakeLists.txt index f04b54826ee..02d0b58fabb 100644 --- a/examples/bridge/CMakeLists.txt +++ b/examples/bridge/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/bridge/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/bridge/Make.defs b/examples/bridge/Make.defs index 74bac57317d..deff70d1d00 100644 --- a/examples/bridge/Make.defs +++ b/examples/bridge/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/bridge/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/bridge/Makefile b/examples/bridge/Makefile index 63b8ce1652d..c5d73e5947f 100644 --- a/examples/bridge/Makefile +++ b/examples/bridge/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/bridge/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/bridge/bridge_main.c b/examples/bridge/bridge_main.c index 6b79480a0f7..2893c01c4d8 100644 --- a/examples/bridge/bridge_main.c +++ b/examples/bridge/bridge_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/bridge/bridge_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/bridge/host_main.c b/examples/bridge/host_main.c index e2f12f6dd31..25a6c16311c 100644 --- a/examples/bridge/host_main.c +++ b/examples/bridge/host_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/bridge/host_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/bridge/host_net1.c b/examples/bridge/host_net1.c index 7584643fc2b..a05c6711edc 100644 --- a/examples/bridge/host_net1.c +++ b/examples/bridge/host_net1.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/bridge/host_net1.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/bridge/host_net2.c b/examples/bridge/host_net2.c index b12cc13b464..87510ebdaff 100644 --- a/examples/bridge/host_net2.c +++ b/examples/bridge/host_net2.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/bridge/host_net2.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/buttons/CMakeLists.txt b/examples/buttons/CMakeLists.txt index 7d05e0525d1..bf266157f65 100644 --- a/examples/buttons/CMakeLists.txt +++ b/examples/buttons/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/buttons/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/buttons/Make.defs b/examples/buttons/Make.defs index 90ac06fabba..86b92252e92 100644 --- a/examples/buttons/Make.defs +++ b/examples/buttons/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/buttons/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/buttons/Makefile b/examples/buttons/Makefile index d77ff3988d3..4602b9bbb46 100644 --- a/examples/buttons/Makefile +++ b/examples/buttons/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/buttons/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/buttons/buttons_main.c b/examples/buttons/buttons_main.c index 2e034bc7d0f..d4b36431c95 100644 --- a/examples/buttons/buttons_main.c +++ b/examples/buttons/buttons_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/buttons/buttons_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/calib_udelay/CMakeLists.txt b/examples/calib_udelay/CMakeLists.txt index ccba69415ea..d48449bab9a 100644 --- a/examples/calib_udelay/CMakeLists.txt +++ b/examples/calib_udelay/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/calib_udelay/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/calib_udelay/Make.defs b/examples/calib_udelay/Make.defs index 1e9f8e23788..d890de933de 100644 --- a/examples/calib_udelay/Make.defs +++ b/examples/calib_udelay/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/calib_udelay/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/calib_udelay/Makefile b/examples/calib_udelay/Makefile index ba1e17c1884..4570c51f7c2 100644 --- a/examples/calib_udelay/Makefile +++ b/examples/calib_udelay/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/calib_udelay/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/calib_udelay/calib_udelay_main.c b/examples/calib_udelay/calib_udelay_main.c index 8f3638a13db..1c9a822f9b3 100644 --- a/examples/calib_udelay/calib_udelay_main.c +++ b/examples/calib_udelay/calib_udelay_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/calib_udelay/calib_udelay_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/camera/CMakeLists.txt b/examples/camera/CMakeLists.txt index 6b6ca0eb46d..488f485e55c 100644 --- a/examples/camera/CMakeLists.txt +++ b/examples/camera/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/camera/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/camera/Make.defs b/examples/camera/Make.defs index d2507a9db82..7007a068204 100644 --- a/examples/camera/Make.defs +++ b/examples/camera/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/camera/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/camera/Makefile b/examples/camera/Makefile index 946f3049b8f..e734c96dbae 100644 --- a/examples/camera/Makefile +++ b/examples/camera/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/camera/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/camera/camera_bkgd.c b/examples/camera/camera_bkgd.c index 32e07e7465c..cdd6653ff0f 100644 --- a/examples/camera/camera_bkgd.c +++ b/examples/camera/camera_bkgd.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/camera/camera_bkgd.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/camera/camera_bkgd.h b/examples/camera/camera_bkgd.h index 7d56aadde0d..1ebee240bb2 100644 --- a/examples/camera/camera_bkgd.h +++ b/examples/camera/camera_bkgd.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/camera/camera_bkgd.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/camera/camera_fileutil.c b/examples/camera/camera_fileutil.c index 4635677043d..f8c7500e379 100644 --- a/examples/camera/camera_fileutil.c +++ b/examples/camera/camera_fileutil.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/camera/camera_fileutil.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/camera/camera_fileutil.h b/examples/camera/camera_fileutil.h index 08d2513d796..f9bce368c5e 100644 --- a/examples/camera/camera_fileutil.h +++ b/examples/camera/camera_fileutil.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/camera/camera_fileutil.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/camera/camera_main.c b/examples/camera/camera_main.c index 6fce11ccf18..221fa4c4b8b 100644 --- a/examples/camera/camera_main.c +++ b/examples/camera/camera_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/camera/camera_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/can/CMakeLists.txt b/examples/can/CMakeLists.txt index 03a77e313e4..783d82dc6a9 100644 --- a/examples/can/CMakeLists.txt +++ b/examples/can/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/can/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/can/Make.defs b/examples/can/Make.defs index 420dbbf03fa..a8a53ac2beb 100644 --- a/examples/can/Make.defs +++ b/examples/can/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/can/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/can/Makefile b/examples/can/Makefile index 5e02c45b1f4..297591fe8ba 100644 --- a/examples/can/Makefile +++ b/examples/can/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/can/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/can/can.h b/examples/can/can.h index 9d598483b51..21a2fbda5cb 100644 --- a/examples/can/can.h +++ b/examples/can/can.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/can/can.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/can/can_main.c b/examples/can/can_main.c index 6d73910ac82..bba0b2275c3 100644 --- a/examples/can/can_main.c +++ b/examples/can/can_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/can/can_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/capture/CMakeLists.txt b/examples/capture/CMakeLists.txt index fe7c2ca0ef5..e23ee56aab1 100644 --- a/examples/capture/CMakeLists.txt +++ b/examples/capture/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/capture/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/capture/Make.defs b/examples/capture/Make.defs index de9fcd063d8..2e64699f4c4 100644 --- a/examples/capture/Make.defs +++ b/examples/capture/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/capture/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/capture/Makefile b/examples/capture/Makefile index db92c71f044..add205481a5 100644 --- a/examples/capture/Makefile +++ b/examples/capture/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/capture/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/capture/cap.h b/examples/capture/cap.h index 1e218ec44c8..2b1c6f5cfa3 100644 --- a/examples/capture/cap.h +++ b/examples/capture/cap.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/capture/cap.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/capture/cap_main.c b/examples/capture/cap_main.c index f8a47cda5df..3cbe9e8c2d6 100644 --- a/examples/capture/cap_main.c +++ b/examples/capture/cap_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/capture/cap_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/cbortest/CMakeLists.txt b/examples/cbortest/CMakeLists.txt index b17eff412ea..01557a340f2 100644 --- a/examples/cbortest/CMakeLists.txt +++ b/examples/cbortest/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/cbortest/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/cbortest/Make.defs b/examples/cbortest/Make.defs index feecd1f0379..a4844be9d88 100644 --- a/examples/cbortest/Make.defs +++ b/examples/cbortest/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/cbortest/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/cbortest/Makefile b/examples/cbortest/Makefile index d2f76a3434d..01061a2011e 100644 --- a/examples/cbortest/Makefile +++ b/examples/cbortest/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/cbortest/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/cbortest/cbortest_main.c b/examples/cbortest/cbortest_main.c index ce9d763c5d2..1ce7ccee503 100644 --- a/examples/cbortest/cbortest_main.c +++ b/examples/cbortest/cbortest_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/cbortest/cbortest_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/cctype/CMakeLists.txt b/examples/cctype/CMakeLists.txt index 734fc731746..921d91a6cb5 100644 --- a/examples/cctype/CMakeLists.txt +++ b/examples/cctype/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/cctype/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/cctype/Make.defs b/examples/cctype/Make.defs index 30174b5fd80..f1cdcd34e5a 100644 --- a/examples/cctype/Make.defs +++ b/examples/cctype/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/cctype/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/cctype/Makefile b/examples/cctype/Makefile index bd7bbee1d1a..c58e8326f0c 100644 --- a/examples/cctype/Makefile +++ b/examples/cctype/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/cctype/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/cctype/cctype_main.cxx b/examples/cctype/cctype_main.cxx index 27b885fdc51..68014356300 100644 --- a/examples/cctype/cctype_main.cxx +++ b/examples/cctype/cctype_main.cxx @@ -1,6 +1,8 @@ //*************************************************************************** // apps/examples/cctype/cctype_main.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/examples/charger/CMakeLists.txt b/examples/charger/CMakeLists.txt index e93dac45822..54a33207654 100644 --- a/examples/charger/CMakeLists.txt +++ b/examples/charger/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/charger/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/charger/Make.defs b/examples/charger/Make.defs index 05c7a0425a2..2e9d48467d9 100644 --- a/examples/charger/Make.defs +++ b/examples/charger/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/charger/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/charger/Makefile b/examples/charger/Makefile index e96d4dfe80d..a9f5366119e 100644 --- a/examples/charger/Makefile +++ b/examples/charger/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/charger/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/charger/charger_main.c b/examples/charger/charger_main.c index 84b4bb8a7d5..baac2f27e92 100644 --- a/examples/charger/charger_main.c +++ b/examples/charger/charger_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/charger/charger_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/chat/CMakeLists.txt b/examples/chat/CMakeLists.txt index 14d8d9fce5d..b63991ab2f4 100644 --- a/examples/chat/CMakeLists.txt +++ b/examples/chat/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/chat/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/chat/Make.defs b/examples/chat/Make.defs index 8725d60f1ba..6f5f9498dd0 100644 --- a/examples/chat/Make.defs +++ b/examples/chat/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/chat/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/chat/Makefile b/examples/chat/Makefile index 5c30573de42..c4d1d90cc1b 100644 --- a/examples/chat/Makefile +++ b/examples/chat/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/chat/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/chat/chat_main.c b/examples/chat/chat_main.c index 837ba9c5314..caf6cca2832 100644 --- a/examples/chat/chat_main.c +++ b/examples/chat/chat_main.c @@ -1,8 +1,9 @@ /**************************************************************************** * apps/examples/chat/chat_main.c * - * Copyright (C) 2016 Vladimir Komendantskiy. All rights reserved. - * Author: Vladimir Komendantskiy + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2016 Vladimir Komendantskiy. All rights reserved. + * SPDX-FileContributor: Vladimir Komendantskiy * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/examples/chrono/CMakeLists.txt b/examples/chrono/CMakeLists.txt index 571eb84ae09..e4523875e3b 100644 --- a/examples/chrono/CMakeLists.txt +++ b/examples/chrono/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/chrono/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/chrono/Make.defs b/examples/chrono/Make.defs index 8577d853637..ff572352726 100644 --- a/examples/chrono/Make.defs +++ b/examples/chrono/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/chrono/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/chrono/Makefile b/examples/chrono/Makefile index f28079cef5e..5cec2e30d97 100644 --- a/examples/chrono/Makefile +++ b/examples/chrono/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/chrono/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/chrono/chrono_main.c b/examples/chrono/chrono_main.c index 1902b92ada5..ee6658591d1 100644 --- a/examples/chrono/chrono_main.c +++ b/examples/chrono/chrono_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/chrono/chrono_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/configdata/CMakeLists.txt b/examples/configdata/CMakeLists.txt index 242bc649835..3047383c0e5 100644 --- a/examples/configdata/CMakeLists.txt +++ b/examples/configdata/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/configdata/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/configdata/Make.defs b/examples/configdata/Make.defs index 0db814b6baf..61e3f1554e0 100644 --- a/examples/configdata/Make.defs +++ b/examples/configdata/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/configdata/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/configdata/Makefile b/examples/configdata/Makefile index c27eb6b75c2..8e6fba9430c 100644 --- a/examples/configdata/Makefile +++ b/examples/configdata/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/configdata/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/configdata/configdata_main.c b/examples/configdata/configdata_main.c index 7c687835b25..236d8e26713 100644 --- a/examples/configdata/configdata_main.c +++ b/examples/configdata/configdata_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/configdata/configdata_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/cordic/CMakeLists.txt b/examples/cordic/CMakeLists.txt index 53c0262d9b2..e303d8b966b 100644 --- a/examples/cordic/CMakeLists.txt +++ b/examples/cordic/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/cordic/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/cordic/Make.defs b/examples/cordic/Make.defs index 7494f87eccf..b1342b63812 100644 --- a/examples/cordic/Make.defs +++ b/examples/cordic/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/cordic/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/cordic/Makefile b/examples/cordic/Makefile index 36918650afe..18344c92c01 100644 --- a/examples/cordic/Makefile +++ b/examples/cordic/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/cordic/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/cordic/cordic_main.c b/examples/cordic/cordic_main.c index fe128a7d599..204a755ac35 100644 --- a/examples/cordic/cordic_main.c +++ b/examples/cordic/cordic_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/cordic/cordic_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/cpuhog/CMakeLists.txt b/examples/cpuhog/CMakeLists.txt index 18acc19421e..c9995e7c990 100644 --- a/examples/cpuhog/CMakeLists.txt +++ b/examples/cpuhog/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/cpuhog/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/cpuhog/Make.defs b/examples/cpuhog/Make.defs index a80cad30419..c15cb779eec 100644 --- a/examples/cpuhog/Make.defs +++ b/examples/cpuhog/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/cpuhog/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/cpuhog/Makefile b/examples/cpuhog/Makefile index 2f1214930f8..8fa589e5879 100644 --- a/examples/cpuhog/Makefile +++ b/examples/cpuhog/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/cpuhog/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/cpuhog/cpuhog_main.c b/examples/cpuhog/cpuhog_main.c index 2c8d773445d..6a45ddad0d7 100644 --- a/examples/cpuhog/cpuhog_main.c +++ b/examples/cpuhog/cpuhog_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/cpuhog/cpuhog_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/cromfs/CMakeLists.txt b/examples/cromfs/CMakeLists.txt index 6f75a5638ce..9c06bf85504 100644 --- a/examples/cromfs/CMakeLists.txt +++ b/examples/cromfs/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/cromfs/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/cromfs/Make.defs b/examples/cromfs/Make.defs index f95a7f623c7..dbf0dbeb0b6 100644 --- a/examples/cromfs/Make.defs +++ b/examples/cromfs/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/cromfs/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/cromfs/Makefile b/examples/cromfs/Makefile index 161736d2919..96078719e05 100644 --- a/examples/cromfs/Makefile +++ b/examples/cromfs/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/cromfs/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/dac/CMakeLists.txt b/examples/dac/CMakeLists.txt index 6c0b76de07e..854199b9a1a 100644 --- a/examples/dac/CMakeLists.txt +++ b/examples/dac/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/dac/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/dac/Make.defs b/examples/dac/Make.defs index a8b027520aa..9e53508173d 100644 --- a/examples/dac/Make.defs +++ b/examples/dac/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/dac/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/dac/Makefile b/examples/dac/Makefile index ea26dea9d55..3f983939fef 100644 --- a/examples/dac/Makefile +++ b/examples/dac/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/dac/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/dac/dac_main.c b/examples/dac/dac_main.c index ac524be5bf6..050cc0f800b 100644 --- a/examples/dac/dac_main.c +++ b/examples/dac/dac_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/dac/dac_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/dhcpd/CMakeLists.txt b/examples/dhcpd/CMakeLists.txt index 09cc83d8fc0..0305ab59cfd 100644 --- a/examples/dhcpd/CMakeLists.txt +++ b/examples/dhcpd/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/dhcpd/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/dhcpd/Make.defs b/examples/dhcpd/Make.defs index 6d002428658..8c6fddcf6a3 100644 --- a/examples/dhcpd/Make.defs +++ b/examples/dhcpd/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/dhcpd/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/dhcpd/Makefile b/examples/dhcpd/Makefile index 5f127cdc602..84ce2efc4f0 100644 --- a/examples/dhcpd/Makefile +++ b/examples/dhcpd/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/dhcpd/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/dhcpd/Makefile.host b/examples/dhcpd/Makefile.host index 78caadfe83f..18795707ad3 100644 --- a/examples/dhcpd/Makefile.host +++ b/examples/dhcpd/Makefile.host @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/dhcpd/Makefile.host # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/dhcpd/dhcpd_daemon.c b/examples/dhcpd/dhcpd_daemon.c index 34747b3456a..5b8f521862b 100644 --- a/examples/dhcpd/dhcpd_daemon.c +++ b/examples/dhcpd/dhcpd_daemon.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/dhcpd/dhcpd_daemon.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/dhcpd/dhcpd_daemon.h b/examples/dhcpd/dhcpd_daemon.h index 5c2e521c7c6..bdf929146a3 100644 --- a/examples/dhcpd/dhcpd_daemon.h +++ b/examples/dhcpd/dhcpd_daemon.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/dhcpd/dhcpd_daemon.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/dhcpd/dhcpd_start.c b/examples/dhcpd/dhcpd_start.c index 1ab56aa615f..e5e7d5c2451 100644 --- a/examples/dhcpd/dhcpd_start.c +++ b/examples/dhcpd/dhcpd_start.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/dhcpd/dhcpd_start.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/dhcpd/dhcpd_stop.c b/examples/dhcpd/dhcpd_stop.c index 7d6795d169b..099d47fcd3b 100644 --- a/examples/dhcpd/dhcpd_stop.c +++ b/examples/dhcpd/dhcpd_stop.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/dhcpd/dhcpd_stop.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/dhcpd/host.c b/examples/dhcpd/host.c index 89c4885eeef..bd806f06a7d 100644 --- a/examples/dhcpd/host.c +++ b/examples/dhcpd/host.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/dhcpd/host.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/dhcpd/target.c b/examples/dhcpd/target.c index 574a6b6cb95..3a5117f6199 100644 --- a/examples/dhcpd/target.c +++ b/examples/dhcpd/target.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/dhcpd/target.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/dhtxx/CMakeLists.txt b/examples/dhtxx/CMakeLists.txt index 2d271c6fa6e..b46b9b4043a 100644 --- a/examples/dhtxx/CMakeLists.txt +++ b/examples/dhtxx/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/dhtxx/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/dhtxx/Make.defs b/examples/dhtxx/Make.defs index 924d5dac79b..7caff590768 100644 --- a/examples/dhtxx/Make.defs +++ b/examples/dhtxx/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/dhtxx/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/dhtxx/Makefile b/examples/dhtxx/Makefile index cfebad51563..cca81fc2f43 100644 --- a/examples/dhtxx/Makefile +++ b/examples/dhtxx/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/dhtxx/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/dhtxx/dhtxx_main.c b/examples/dhtxx/dhtxx_main.c index 4720c4d7b4a..d38b502aed0 100644 --- a/examples/dhtxx/dhtxx_main.c +++ b/examples/dhtxx/dhtxx_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/dhtxx/dhtxx_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/discover/CMakeLists.txt b/examples/discover/CMakeLists.txt index 83fdc7e6f8e..1baaa7a8e35 100644 --- a/examples/discover/CMakeLists.txt +++ b/examples/discover/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/discover/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/discover/Make.defs b/examples/discover/Make.defs index 79226fec9c3..b5491e9572d 100644 --- a/examples/discover/Make.defs +++ b/examples/discover/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/discover/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/discover/Makefile b/examples/discover/Makefile index 7c4e96b7ce4..698d9cbd1d8 100644 --- a/examples/discover/Makefile +++ b/examples/discover/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/discover/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/discover/discover_main.c b/examples/discover/discover_main.c index 9a3bfe3c8a1..ba81dbcb020 100644 --- a/examples/discover/discover_main.c +++ b/examples/discover/discover_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/discover/discover_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/djoystick/CMakeLists.txt b/examples/djoystick/CMakeLists.txt index 8c05fdb0bec..37152b56b89 100644 --- a/examples/djoystick/CMakeLists.txt +++ b/examples/djoystick/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/djoystick/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/djoystick/Make.defs b/examples/djoystick/Make.defs index f4a06499250..280c627af97 100644 --- a/examples/djoystick/Make.defs +++ b/examples/djoystick/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/djoystick/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/djoystick/Makefile b/examples/djoystick/Makefile index 9a071735e5c..74e31b644bf 100644 --- a/examples/djoystick/Makefile +++ b/examples/djoystick/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/djoystick/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/djoystick/djoy_main.c b/examples/djoystick/djoy_main.c index f32de94d65b..110de4531c6 100644 --- a/examples/djoystick/djoy_main.c +++ b/examples/djoystick/djoy_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/djoystick/djoy_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/dronecan/CMakeLists.txt b/examples/dronecan/CMakeLists.txt index e52cbbc4cf2..353bd4dc71d 100644 --- a/examples/dronecan/CMakeLists.txt +++ b/examples/dronecan/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/dronecan/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/dronecan/Make.defs b/examples/dronecan/Make.defs index afcaed2be3e..f17aebd60f0 100644 --- a/examples/dronecan/Make.defs +++ b/examples/dronecan/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/dronecan/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/dronecan/Makefile b/examples/dronecan/Makefile index b2f35d86196..a8f309b6868 100644 --- a/examples/dronecan/Makefile +++ b/examples/dronecan/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/dronecan/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/dronecan/canard_main.c b/examples/dronecan/canard_main.c index eb2f7b320e2..a5a55ebe947 100644 --- a/examples/dronecan/canard_main.c +++ b/examples/dronecan/canard_main.c @@ -1,8 +1,9 @@ /**************************************************************************** * apps/examples/dronecan/canard_main.c * - * Copyright (C) 2016 ETH Zuerich. All rights reserved. - * Author: Matthias Renner + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2016 ETH Zuerich. All rights reserved. + * SPDX-FileContributor: Matthias Renner * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/examples/elf/CMakeLists.txt b/examples/elf/CMakeLists.txt index 181927e84a6..341fc4b530a 100644 --- a/examples/elf/CMakeLists.txt +++ b/examples/elf/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/elf/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/elf/Make.defs b/examples/elf/Make.defs index a86d97359e6..e01a9d0ddb1 100644 --- a/examples/elf/Make.defs +++ b/examples/elf/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/elf/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/elf/Makefile b/examples/elf/Makefile index 0d17c8a1c11..8d1e32f139f 100644 --- a/examples/elf/Makefile +++ b/examples/elf/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/elf/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/elf/elf_main.c b/examples/elf/elf_main.c index 91a2f971c7f..160d1e233bc 100644 --- a/examples/elf/elf_main.c +++ b/examples/elf/elf_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/elf/elf_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/elf/tests/Makefile b/examples/elf/tests/Makefile index b72020917d0..ca78d8d5d3b 100644 --- a/examples/elf/tests/Makefile +++ b/examples/elf/tests/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/elf/tests/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/elf/tests/errno/Makefile b/examples/elf/tests/errno/Makefile index 4432cbd4a25..2f9d2a13ab0 100644 --- a/examples/elf/tests/errno/Makefile +++ b/examples/elf/tests/errno/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/elf/tests/errno/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/elf/tests/errno/errno.c b/examples/elf/tests/errno/errno.c index e75659f3ba6..8a26e47c43e 100644 --- a/examples/elf/tests/errno/errno.c +++ b/examples/elf/tests/errno/errno.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/elf/tests/errno/errno.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/elf/tests/hello/Makefile b/examples/elf/tests/hello/Makefile index cde309695b3..88ec0f0a807 100644 --- a/examples/elf/tests/hello/Makefile +++ b/examples/elf/tests/hello/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/elf/tests/hello/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/elf/tests/hello/hello.c b/examples/elf/tests/hello/hello.c index 41b3cfcb8a0..d2856f73bea 100644 --- a/examples/elf/tests/hello/hello.c +++ b/examples/elf/tests/hello/hello.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/elf/tests/hello/hello.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/elf/tests/helloxx/Makefile b/examples/elf/tests/helloxx/Makefile index 142282a0021..b2f2768342d 100644 --- a/examples/elf/tests/helloxx/Makefile +++ b/examples/elf/tests/helloxx/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/elf/tests/helloxx/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/elf/tests/helloxx/hello++1.cxx b/examples/elf/tests/helloxx/hello++1.cxx index acc86c04caf..5b79d7f2fbe 100644 --- a/examples/elf/tests/helloxx/hello++1.cxx +++ b/examples/elf/tests/helloxx/hello++1.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/examples/elf/tests/helloxx/hello++1.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/examples/elf/tests/helloxx/hello++2.cxx b/examples/elf/tests/helloxx/hello++2.cxx index cd666bd8bc1..a7dc7191819 100644 --- a/examples/elf/tests/helloxx/hello++2.cxx +++ b/examples/elf/tests/helloxx/hello++2.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/examples/elf/tests/helloxx/hello++2.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/examples/elf/tests/helloxx/hello++3.cxx b/examples/elf/tests/helloxx/hello++3.cxx index c1f6d0c14b0..d76406eac1b 100644 --- a/examples/elf/tests/helloxx/hello++3.cxx +++ b/examples/elf/tests/helloxx/hello++3.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/examples/elf/tests/helloxx/hello++3.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/examples/elf/tests/helloxx/hello++4.cxx b/examples/elf/tests/helloxx/hello++4.cxx index d0743f40245..3f065cafeea 100644 --- a/examples/elf/tests/helloxx/hello++4.cxx +++ b/examples/elf/tests/helloxx/hello++4.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/examples/elf/tests/helloxx/hello++4.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/examples/elf/tests/helloxx/hello++5.cxx b/examples/elf/tests/helloxx/hello++5.cxx index 38417dd5de2..c72a8cc9a3c 100644 --- a/examples/elf/tests/helloxx/hello++5.cxx +++ b/examples/elf/tests/helloxx/hello++5.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/examples/elf/tests/helloxx/hello++5.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/examples/elf/tests/longjmp/Makefile b/examples/elf/tests/longjmp/Makefile index 17e325c786b..fa792e6ff0d 100644 --- a/examples/elf/tests/longjmp/Makefile +++ b/examples/elf/tests/longjmp/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/elf/tests/longjmp/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/elf/tests/longjmp/longjmp.c b/examples/elf/tests/longjmp/longjmp.c index ca36b95dd2a..ea48d456901 100644 --- a/examples/elf/tests/longjmp/longjmp.c +++ b/examples/elf/tests/longjmp/longjmp.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/elf/tests/longjmp/longjmp.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/elf/tests/mutex/Makefile b/examples/elf/tests/mutex/Makefile index e95fba84e75..5fec89d3c0c 100644 --- a/examples/elf/tests/mutex/Makefile +++ b/examples/elf/tests/mutex/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/elf/tests/mutex/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/elf/tests/mutex/mutex.c b/examples/elf/tests/mutex/mutex.c index 714dc94c65f..2c7310ccfa5 100644 --- a/examples/elf/tests/mutex/mutex.c +++ b/examples/elf/tests/mutex/mutex.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/elf/tests/mutex/mutex.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/elf/tests/pthread/Makefile b/examples/elf/tests/pthread/Makefile index 39e821e802b..61108bc5f0d 100644 --- a/examples/elf/tests/pthread/Makefile +++ b/examples/elf/tests/pthread/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/elf/tests/pthread/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/elf/tests/pthread/pthread.c b/examples/elf/tests/pthread/pthread.c index 4e5e8f810fd..cea9f033072 100644 --- a/examples/elf/tests/pthread/pthread.c +++ b/examples/elf/tests/pthread/pthread.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/elf/tests/pthread/pthread.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/elf/tests/signal/Makefile b/examples/elf/tests/signal/Makefile index d89e1838442..21df11dd0d0 100644 --- a/examples/elf/tests/signal/Makefile +++ b/examples/elf/tests/signal/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/elf/tests/signal/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/elf/tests/signal/signal.c b/examples/elf/tests/signal/signal.c index a55070fbed6..b091602bcce 100644 --- a/examples/elf/tests/signal/signal.c +++ b/examples/elf/tests/signal/signal.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/elf/tests/signal/signal.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/elf/tests/struct/Makefile b/examples/elf/tests/struct/Makefile index e76e5a6c4ff..990d990c25d 100644 --- a/examples/elf/tests/struct/Makefile +++ b/examples/elf/tests/struct/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/elf/tests/struct/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/elf/tests/struct/struct.h b/examples/elf/tests/struct/struct.h index 7508f053de0..bfbe1c8ac5b 100644 --- a/examples/elf/tests/struct/struct.h +++ b/examples/elf/tests/struct/struct.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/elf/tests/struct/struct.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/elf/tests/struct/struct_dummy.c b/examples/elf/tests/struct/struct_dummy.c index d3376417cf5..c1361d4eb75 100644 --- a/examples/elf/tests/struct/struct_dummy.c +++ b/examples/elf/tests/struct/struct_dummy.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/elf/tests/struct/struct_dummy.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/elf/tests/struct/struct_main.c b/examples/elf/tests/struct/struct_main.c index 2cb707ec1a5..801d2c5c55e 100644 --- a/examples/elf/tests/struct/struct_main.c +++ b/examples/elf/tests/struct/struct_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/elf/tests/struct/struct_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/elf/tests/task/Makefile b/examples/elf/tests/task/Makefile index 3db9ab24f56..b57b98885f9 100644 --- a/examples/elf/tests/task/Makefile +++ b/examples/elf/tests/task/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/elf/tests/task/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/elf/tests/task/task.c b/examples/elf/tests/task/task.c index dfaf9834a22..64a90f07f70 100644 --- a/examples/elf/tests/task/task.c +++ b/examples/elf/tests/task/task.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/elf/tests/task/task.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/embedlog/CMakeLists.txt b/examples/embedlog/CMakeLists.txt index 055126498ad..0a403bfc5a8 100644 --- a/examples/embedlog/CMakeLists.txt +++ b/examples/embedlog/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/embedlog/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/embedlog/Make.defs b/examples/embedlog/Make.defs index 9c2ef3aad71..6096211d44e 100644 --- a/examples/embedlog/Make.defs +++ b/examples/embedlog/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/embedlog/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/embedlog/Makefile b/examples/embedlog/Makefile index 6524a872f20..a48e7e76d97 100644 --- a/examples/embedlog/Makefile +++ b/examples/embedlog/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/embedlog/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/embedlog/embedlog_main.c b/examples/embedlog/embedlog_main.c index 497fa145228..85c1193647d 100644 --- a/examples/embedlog/embedlog_main.c +++ b/examples/embedlog/embedlog_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/embedlog/embedlog_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/esp32_himem/CMakeLists.txt b/examples/esp32_himem/CMakeLists.txt index bf96baf00ce..313e906740b 100644 --- a/examples/esp32_himem/CMakeLists.txt +++ b/examples/esp32_himem/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/esp32_himem/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/esp32_himem/Make.defs b/examples/esp32_himem/Make.defs index 69f4979b3f4..2f6324c6b29 100644 --- a/examples/esp32_himem/Make.defs +++ b/examples/esp32_himem/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/esp32_himem/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/esp32_himem/Makefile b/examples/esp32_himem/Makefile index d80be5cc9fd..aba61321da9 100644 --- a/examples/esp32_himem/Makefile +++ b/examples/esp32_himem/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/esp32_himem/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/esp32_himem/esp32_himem_main.c b/examples/esp32_himem/esp32_himem_main.c index 88e29546377..bf7eda01c41 100644 --- a/examples/esp32_himem/esp32_himem_main.c +++ b/examples/esp32_himem/esp32_himem_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/esp32_himem/esp32_himem_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/etl/CMakeLists.txt b/examples/etl/CMakeLists.txt index 2c705062a73..9c0a201060a 100644 --- a/examples/etl/CMakeLists.txt +++ b/examples/etl/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/etl/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/etl/Make.defs b/examples/etl/Make.defs index b020e2bc11d..54405b0eddb 100644 --- a/examples/etl/Make.defs +++ b/examples/etl/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/etl/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/etl/Makefile b/examples/etl/Makefile index f273f4fa77d..89b4c57a8fd 100644 --- a/examples/etl/Makefile +++ b/examples/etl/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/etl/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/etl/etl_main.cxx b/examples/etl/etl_main.cxx index ec4a08187b7..efb4aa835dd 100644 --- a/examples/etl/etl_main.cxx +++ b/examples/etl/etl_main.cxx @@ -1,6 +1,8 @@ //*************************************************************************** // apps/examples/etl/etl_main.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/examples/fb/CMakeLists.txt b/examples/fb/CMakeLists.txt index fdabfec244c..87736c9600a 100644 --- a/examples/fb/CMakeLists.txt +++ b/examples/fb/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/fb/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/fb/Make.defs b/examples/fb/Make.defs index 319ba7ea175..a8ddc29d39f 100644 --- a/examples/fb/Make.defs +++ b/examples/fb/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/fb/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/fb/Makefile b/examples/fb/Makefile index 1ccc6944aad..fcf0f41abf5 100644 --- a/examples/fb/Makefile +++ b/examples/fb/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/fb/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/fb/fb_main.c b/examples/fb/fb_main.c index 835e70733ff..8948770bfd7 100644 --- a/examples/fb/fb_main.c +++ b/examples/fb/fb_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/fb/fb_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/fboverlay/CMakeLists.txt b/examples/fboverlay/CMakeLists.txt index a3248597ad6..0a90f9ab43c 100644 --- a/examples/fboverlay/CMakeLists.txt +++ b/examples/fboverlay/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/fboverlay/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/fboverlay/Make.defs b/examples/fboverlay/Make.defs index 0fc92aaa6b9..62ea27755c0 100644 --- a/examples/fboverlay/Make.defs +++ b/examples/fboverlay/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/fboverlay/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/fboverlay/Makefile b/examples/fboverlay/Makefile index 8072f0f89f1..d68057f25df 100644 --- a/examples/fboverlay/Makefile +++ b/examples/fboverlay/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/fboverlay/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/fboverlay/fboverlay_main.c b/examples/fboverlay/fboverlay_main.c index 193c4b81d36..f71e17e9b6c 100644 --- a/examples/fboverlay/fboverlay_main.c +++ b/examples/fboverlay/fboverlay_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/fboverlay/fboverlay_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/flash_test/CMakeLists.txt b/examples/flash_test/CMakeLists.txt index ea278ae7f7c..136905dfc0e 100644 --- a/examples/flash_test/CMakeLists.txt +++ b/examples/flash_test/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/flash_test/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/flash_test/Make.defs b/examples/flash_test/Make.defs index a5ef02bb4d7..04e423a2df2 100644 --- a/examples/flash_test/Make.defs +++ b/examples/flash_test/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/flash_test/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/flash_test/Makefile b/examples/flash_test/Makefile index 462b72b5081..6b1cf355f40 100644 --- a/examples/flash_test/Makefile +++ b/examples/flash_test/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/flash_test/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/flash_test/flash_test.c b/examples/flash_test/flash_test.c index eeda05fbe5c..2dea201c2ba 100644 --- a/examples/flash_test/flash_test.c +++ b/examples/flash_test/flash_test.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/flash_test/flash_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/flowc/CMakeLists.txt b/examples/flowc/CMakeLists.txt index cdcdcde2f28..fd7d7096069 100644 --- a/examples/flowc/CMakeLists.txt +++ b/examples/flowc/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/flowc/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/flowc/Make.defs b/examples/flowc/Make.defs index 060c7d3ad3e..5153fbc9b6e 100644 --- a/examples/flowc/Make.defs +++ b/examples/flowc/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/flowc/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/flowc/Makefile b/examples/flowc/Makefile index 597f6eedced..9d9d90f54c9 100644 --- a/examples/flowc/Makefile +++ b/examples/flowc/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/flowc/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/flowc/flowc.h b/examples/flowc/flowc.h index 8f9b3eb2bfc..c96fe76afce 100644 --- a/examples/flowc/flowc.h +++ b/examples/flowc/flowc.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/flowc/flowc.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/flowc/flowc_host.c b/examples/flowc/flowc_host.c index a2d97bb8b08..3355dcb3ed1 100644 --- a/examples/flowc/flowc_host.c +++ b/examples/flowc/flowc_host.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/flowc/flowc_host.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/flowc/flowc_mktestdata.c b/examples/flowc/flowc_mktestdata.c index 900c0d70093..0ad5546a22c 100644 --- a/examples/flowc/flowc_mktestdata.c +++ b/examples/flowc/flowc_mktestdata.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/flowc/flowc_mktestdata.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/flowc/flowc_receiver.c b/examples/flowc/flowc_receiver.c index fe57f60c834..07d9ede0ff9 100644 --- a/examples/flowc/flowc_receiver.c +++ b/examples/flowc/flowc_receiver.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/flowc/flowc_receiver.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/flowc/flowc_sender.c b/examples/flowc/flowc_sender.c index 5149c512cf5..fc536c45273 100644 --- a/examples/flowc/flowc_sender.c +++ b/examples/flowc/flowc_sender.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/flowc/flowc_sender.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/flowc/flowc_target1.c b/examples/flowc/flowc_target1.c index 80790b323ec..a7956211504 100644 --- a/examples/flowc/flowc_target1.c +++ b/examples/flowc/flowc_target1.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/flowc/flowc_target1.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/flowc/flowc_target2.c b/examples/flowc/flowc_target2.c index 4488308bfc5..31fa0071847 100644 --- a/examples/flowc/flowc_target2.c +++ b/examples/flowc/flowc_target2.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/flowc/flowc_target2.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/fmsynth/CMakeLists.txt b/examples/fmsynth/CMakeLists.txt index 5279ba28965..b6ff8c4f19e 100644 --- a/examples/fmsynth/CMakeLists.txt +++ b/examples/fmsynth/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/fmsynth/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/fmsynth/Make.defs b/examples/fmsynth/Make.defs index 25be117b1d8..ecca6198f49 100644 --- a/examples/fmsynth/Make.defs +++ b/examples/fmsynth/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/fmsynth/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/fmsynth/Makefile b/examples/fmsynth/Makefile index d89a7df17a8..11aa02ff94f 100644 --- a/examples/fmsynth/Makefile +++ b/examples/fmsynth/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/fmsynth/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/fmsynth/keyboard_main.c b/examples/fmsynth/keyboard_main.c index 1cbaba2a554..e30eab3de74 100644 --- a/examples/fmsynth/keyboard_main.c +++ b/examples/fmsynth/keyboard_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/fmsynth/keyboard_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/fmsynth/mmlplayer_main.c b/examples/fmsynth/mmlplayer_main.c index 88c849c02f7..dd2a2b47880 100644 --- a/examples/fmsynth/mmlplayer_main.c +++ b/examples/fmsynth/mmlplayer_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/fmsynth/mmlplayer_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/fmsynth/mmlplayer_score.h b/examples/fmsynth/mmlplayer_score.h index f9e7578469b..eae095aa162 100644 --- a/examples/fmsynth/mmlplayer_score.h +++ b/examples/fmsynth/mmlplayer_score.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/fmsynth/mmlplayer_score.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/fmsynth/music_scale.c b/examples/fmsynth/music_scale.c index 7ec2e7709f9..185528be08d 100644 --- a/examples/fmsynth/music_scale.c +++ b/examples/fmsynth/music_scale.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/fmsynth/music_scale.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/fmsynth/music_scale.h b/examples/fmsynth/music_scale.h index 577564a3c90..afb5a384a10 100644 --- a/examples/fmsynth/music_scale.h +++ b/examples/fmsynth/music_scale.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/fmsynth/music_scale.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/fmsynth/operator_algorithm.c b/examples/fmsynth/operator_algorithm.c index 2d6b6068ec1..6eafe902598 100644 --- a/examples/fmsynth/operator_algorithm.c +++ b/examples/fmsynth/operator_algorithm.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/fmsynth/operator_algorithm.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/fmsynth/operator_algorithm.h b/examples/fmsynth/operator_algorithm.h index 94594d027bd..45adb4a194d 100644 --- a/examples/fmsynth/operator_algorithm.h +++ b/examples/fmsynth/operator_algorithm.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/fmsynth/operator_algorithm.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/foc/CMakeLists.txt b/examples/foc/CMakeLists.txt index 8cf8faa005a..17fcc5fa698 100644 --- a/examples/foc/CMakeLists.txt +++ b/examples/foc/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/foc/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/foc/Make.defs b/examples/foc/Make.defs index 8387dcfafc0..646d0c54b54 100644 --- a/examples/foc/Make.defs +++ b/examples/foc/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/foc/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/foc/Makefile b/examples/foc/Makefile index cc81a317253..e0785cf2187 100644 --- a/examples/foc/Makefile +++ b/examples/foc/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/foc/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/foc/foc_adc.h b/examples/foc/foc_adc.h index d578d1fb0cf..fbc1a69abd4 100644 --- a/examples/foc/foc_adc.h +++ b/examples/foc/foc_adc.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/foc/foc_adc.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/foc/foc_cfg.h b/examples/foc/foc_cfg.h index 3e03d3725d7..6ce0343472e 100644 --- a/examples/foc/foc_cfg.h +++ b/examples/foc/foc_cfg.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/foc/foc_cfg.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/foc/foc_debug.h b/examples/foc/foc_debug.h index fd92d247e30..ed8ebcb2089 100644 --- a/examples/foc/foc_debug.h +++ b/examples/foc/foc_debug.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/foc/foc_debug.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/foc/foc_device.c b/examples/foc/foc_device.c index e4075f1c426..3ebea241fc4 100644 --- a/examples/foc/foc_device.c +++ b/examples/foc/foc_device.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/foc/foc_device.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/foc/foc_device.h b/examples/foc/foc_device.h index 8c57934cf0c..aa056b63d5f 100644 --- a/examples/foc/foc_device.h +++ b/examples/foc/foc_device.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/foc/foc_device.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/foc/foc_fixed16_thr.c b/examples/foc/foc_fixed16_thr.c index 47a979d41dd..412b2b26e87 100644 --- a/examples/foc/foc_fixed16_thr.c +++ b/examples/foc/foc_fixed16_thr.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/foc/foc_fixed16_thr.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/foc/foc_float_thr.c b/examples/foc/foc_float_thr.c index 44bde00e60f..52fb0833b92 100644 --- a/examples/foc/foc_float_thr.c +++ b/examples/foc/foc_float_thr.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/foc/foc_float_thr.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/foc/foc_intf.c b/examples/foc/foc_intf.c index 04a3493a34a..1b0d4a8b1b0 100644 --- a/examples/foc/foc_intf.c +++ b/examples/foc/foc_intf.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/foc/foc_intf.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/foc/foc_intf.h b/examples/foc/foc_intf.h index 28689831991..ca6edf7bdf9 100644 --- a/examples/foc/foc_intf.h +++ b/examples/foc/foc_intf.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/foc/foc_intf.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/foc/foc_main.c b/examples/foc/foc_main.c index e4626baf673..4b280e848de 100644 --- a/examples/foc/foc_main.c +++ b/examples/foc/foc_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/foc/foc_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/foc/foc_motor_b16.c b/examples/foc/foc_motor_b16.c index a67230fac45..f7a8ed2a523 100644 --- a/examples/foc/foc_motor_b16.c +++ b/examples/foc/foc_motor_b16.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/foc/foc_motor_b16.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/foc/foc_motor_b16.h b/examples/foc/foc_motor_b16.h index ee8c73a591c..834d92111ee 100644 --- a/examples/foc/foc_motor_b16.h +++ b/examples/foc/foc_motor_b16.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/foc/foc_motor_b16.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/foc/foc_motor_f32.c b/examples/foc/foc_motor_f32.c index 5feedf5db08..8499a34ccf0 100644 --- a/examples/foc/foc_motor_f32.c +++ b/examples/foc/foc_motor_f32.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/foc/foc_motor_f32.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/foc/foc_motor_f32.h b/examples/foc/foc_motor_f32.h index 3a031282e62..773241f28c6 100644 --- a/examples/foc/foc_motor_f32.h +++ b/examples/foc/foc_motor_f32.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/foc/foc_motor_f32.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/foc/foc_mq.c b/examples/foc/foc_mq.c index aa32c4ed481..bbcd5a4fa43 100644 --- a/examples/foc/foc_mq.c +++ b/examples/foc/foc_mq.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/foc/foc_mq.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/foc/foc_mq.h b/examples/foc/foc_mq.h index e096d0c4b36..a2fd32c4d06 100644 --- a/examples/foc/foc_mq.h +++ b/examples/foc/foc_mq.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/foc/foc_mq.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/foc/foc_nxscope.c b/examples/foc/foc_nxscope.c index f40297d51dd..93fd992af1d 100644 --- a/examples/foc/foc_nxscope.c +++ b/examples/foc/foc_nxscope.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/foc/foc_nxscope.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/foc/foc_nxscope.h b/examples/foc/foc_nxscope.h index 911e0afdf17..28ab6c06e24 100644 --- a/examples/foc/foc_nxscope.h +++ b/examples/foc/foc_nxscope.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/foc/foc_nxscope.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/foc/foc_parseargs.c b/examples/foc/foc_parseargs.c index cddd73b8569..972a0703f35 100644 --- a/examples/foc/foc_parseargs.c +++ b/examples/foc/foc_parseargs.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/foc/foc_parseargs.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/foc/foc_parseargs.h b/examples/foc/foc_parseargs.h index a019bc5283a..485ab7a4324 100644 --- a/examples/foc/foc_parseargs.h +++ b/examples/foc/foc_parseargs.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/foc/foc_parseargs.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/foc/foc_perf.c b/examples/foc/foc_perf.c index 3c64d3816f2..22a0456daea 100644 --- a/examples/foc/foc_perf.c +++ b/examples/foc/foc_perf.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/foc/foc_perf.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/foc/foc_perf.h b/examples/foc/foc_perf.h index 9409e10575e..d8b90d795ce 100644 --- a/examples/foc/foc_perf.h +++ b/examples/foc/foc_perf.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/foc/foc_perf.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/foc/foc_thr.c b/examples/foc/foc_thr.c index a4bf87e33a9..6de9900faca 100644 --- a/examples/foc/foc_thr.c +++ b/examples/foc/foc_thr.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/foc/foc_thr.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/foc/foc_thr.h b/examples/foc/foc_thr.h index 93f6832abbf..f7a931c6066 100644 --- a/examples/foc/foc_thr.h +++ b/examples/foc/foc_thr.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/foc/foc_thr.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/ft80x/CMakeLists.txt b/examples/ft80x/CMakeLists.txt index 979ad69a538..beacaaa5ee8 100644 --- a/examples/ft80x/CMakeLists.txt +++ b/examples/ft80x/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/ft80x/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/ft80x/Make.defs b/examples/ft80x/Make.defs index 6cc416928de..c4a5c5f63c1 100644 --- a/examples/ft80x/Make.defs +++ b/examples/ft80x/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/ft80x/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/ft80x/Makefile b/examples/ft80x/Makefile index 04ef4ab2276..9bbf390dc4e 100644 --- a/examples/ft80x/Makefile +++ b/examples/ft80x/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/ft80x/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/ft80x/ft80x.h b/examples/ft80x/ft80x.h index b87164e6160..0349f6eb488 100644 --- a/examples/ft80x/ft80x.h +++ b/examples/ft80x/ft80x.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/ft80x/ft80x.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/ft80x/ft80x_bitmaps.c b/examples/ft80x/ft80x_bitmaps.c index 4794f3c5202..aecfbfb4f63 100644 --- a/examples/ft80x/ft80x_bitmaps.c +++ b/examples/ft80x/ft80x_bitmaps.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/ft80x/ft80x_bitmaps.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/ft80x/ft80x_coprocessor.c b/examples/ft80x/ft80x_coprocessor.c index 3ca5bb69102..474097a4555 100644 --- a/examples/ft80x/ft80x_coprocessor.c +++ b/examples/ft80x/ft80x_coprocessor.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/ft80x/ft80x_coprocessor.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/ft80x/ft80x_main.c b/examples/ft80x/ft80x_main.c index 06a11112332..e3529454733 100644 --- a/examples/ft80x/ft80x_main.c +++ b/examples/ft80x/ft80x_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/ft80x/ft80x_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/ft80x/ft80x_primitives.c b/examples/ft80x/ft80x_primitives.c index 3bd075cfea5..6f70b53f2ca 100644 --- a/examples/ft80x/ft80x_primitives.c +++ b/examples/ft80x/ft80x_primitives.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/ft80x/ft80x_primitives.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/ftpc/CMakeLists.txt b/examples/ftpc/CMakeLists.txt index 6318c9cb4d6..1e7f1512b63 100644 --- a/examples/ftpc/CMakeLists.txt +++ b/examples/ftpc/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/ftpc/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/ftpc/Make.defs b/examples/ftpc/Make.defs index b6b5e7a4484..22d85b45c65 100644 --- a/examples/ftpc/Make.defs +++ b/examples/ftpc/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/ftpc/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/ftpc/Makefile b/examples/ftpc/Makefile index f49e509a9a2..733ef4e69d3 100644 --- a/examples/ftpc/Makefile +++ b/examples/ftpc/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/ftpc/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/ftpc/ftpc.h b/examples/ftpc/ftpc.h index 55bf004061a..5b20aa63443 100644 --- a/examples/ftpc/ftpc.h +++ b/examples/ftpc/ftpc.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/ftpc/ftpc.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/ftpc/ftpc_cmds.c b/examples/ftpc/ftpc_cmds.c index a3abd17d6e0..4d7a890d47e 100644 --- a/examples/ftpc/ftpc_cmds.c +++ b/examples/ftpc/ftpc_cmds.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/ftpc/ftpc_cmds.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/ftpc/ftpc_main.c b/examples/ftpc/ftpc_main.c index ba57e17beaa..cce4cf6c246 100644 --- a/examples/ftpc/ftpc_main.c +++ b/examples/ftpc/ftpc_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/ftpc/ftpc_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/ftpd/CMakeLists.txt b/examples/ftpd/CMakeLists.txt index e433f125beb..7b3b33b43c0 100644 --- a/examples/ftpd/CMakeLists.txt +++ b/examples/ftpd/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/ftpd/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/ftpd/Make.defs b/examples/ftpd/Make.defs index 4761439f8e5..b845f46df0e 100644 --- a/examples/ftpd/Make.defs +++ b/examples/ftpd/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/ftpd/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/ftpd/Makefile b/examples/ftpd/Makefile index fe42036f91f..564dd149b1c 100644 --- a/examples/ftpd/Makefile +++ b/examples/ftpd/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/ftpd/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/ftpd/ftpd.h b/examples/ftpd/ftpd.h index 213ab1b1935..59bf11b80e2 100644 --- a/examples/ftpd/ftpd.h +++ b/examples/ftpd/ftpd.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/ftpd/ftpd.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/ftpd/ftpd_main.c b/examples/ftpd/ftpd_main.c index d1052b50c3c..5c7888b2416 100644 --- a/examples/ftpd/ftpd_main.c +++ b/examples/ftpd/ftpd_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/ftpd/ftpd_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/fxos8700cq_test/CMakeLists.txt b/examples/fxos8700cq_test/CMakeLists.txt index add6afd763f..d1fa727ed35 100644 --- a/examples/fxos8700cq_test/CMakeLists.txt +++ b/examples/fxos8700cq_test/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/fxos8700cq_test/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/fxos8700cq_test/Make.defs b/examples/fxos8700cq_test/Make.defs index e43f726d9d9..6f58ed4c0ea 100644 --- a/examples/fxos8700cq_test/Make.defs +++ b/examples/fxos8700cq_test/Make.defs @@ -1,6 +1,8 @@ ############################################################################# # apps/examples/fxos8700cq_test/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/fxos8700cq_test/Makefile b/examples/fxos8700cq_test/Makefile index 3cb1ccecb4a..18f857db0ce 100644 --- a/examples/fxos8700cq_test/Makefile +++ b/examples/fxos8700cq_test/Makefile @@ -1,6 +1,8 @@ ############################################################################# # apps/examples/fxos8700cq_test/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/fxos8700cq_test/fxos8700cq_main.c b/examples/fxos8700cq_test/fxos8700cq_main.c index 02bda14f4ca..b55ad7aef43 100644 --- a/examples/fxos8700cq_test/fxos8700cq_main.c +++ b/examples/fxos8700cq_test/fxos8700cq_main.c @@ -1,6 +1,7 @@ /**************************************************************************** * apps/examples/fxos8700cq_test/fxos8700cq_main.c - * fxos8700cq motion sensor sample application + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with diff --git a/examples/gpio/CMakeLists.txt b/examples/gpio/CMakeLists.txt index ba9246cb580..e0d66402012 100644 --- a/examples/gpio/CMakeLists.txt +++ b/examples/gpio/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/gpio/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/gpio/Make.defs b/examples/gpio/Make.defs index 6575a1ef4e9..05f914f31d9 100644 --- a/examples/gpio/Make.defs +++ b/examples/gpio/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/gpio/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/gpio/Makefile b/examples/gpio/Makefile index 889ca59af57..be8b54ab724 100644 --- a/examples/gpio/Makefile +++ b/examples/gpio/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/gpio/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/gpio/gpio_main.c b/examples/gpio/gpio_main.c index c097a265f3e..1b2e86ad568 100644 --- a/examples/gpio/gpio_main.c +++ b/examples/gpio/gpio_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/gpio/gpio_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/gps/CMakeLists.txt b/examples/gps/CMakeLists.txt index 26103014fa6..43d7dd0815e 100644 --- a/examples/gps/CMakeLists.txt +++ b/examples/gps/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/gps/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/gps/Make.defs b/examples/gps/Make.defs index e90682038ac..a7b093ba154 100644 --- a/examples/gps/Make.defs +++ b/examples/gps/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/gps/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/gps/Makefile b/examples/gps/Makefile index efac4f0ba4e..b6af0ca7d1b 100644 --- a/examples/gps/Makefile +++ b/examples/gps/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/gps/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/gps/gps_main.c b/examples/gps/gps_main.c index e042449d3d8..a79cd65c2da 100644 --- a/examples/gps/gps_main.c +++ b/examples/gps/gps_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/gps/gps_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/hall/CMakeLists.txt b/examples/hall/CMakeLists.txt index 44a7674ee6a..9626d70fa07 100644 --- a/examples/hall/CMakeLists.txt +++ b/examples/hall/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/hall/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/hall/Make.defs b/examples/hall/Make.defs index 7db20e76998..40bb4483fe2 100644 --- a/examples/hall/Make.defs +++ b/examples/hall/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/hall/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/hall/Makefile b/examples/hall/Makefile index 3c415e238fb..12e6dfe2317 100644 --- a/examples/hall/Makefile +++ b/examples/hall/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/hall/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/hall/hall.h b/examples/hall/hall.h index 3bb2a2a76b7..242e9d06483 100644 --- a/examples/hall/hall.h +++ b/examples/hall/hall.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/hall/hall.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/hall/hall_main.c b/examples/hall/hall_main.c index 3cf2a4d4ac7..ed3c3b570bd 100644 --- a/examples/hall/hall_main.c +++ b/examples/hall/hall_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/hall/hall_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/hdc1008_demo/CMakeLists.txt b/examples/hdc1008_demo/CMakeLists.txt index 1bf7ce4daf1..d2807a4ea30 100644 --- a/examples/hdc1008_demo/CMakeLists.txt +++ b/examples/hdc1008_demo/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/hdc1008_demo/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/hdc1008_demo/Make.defs b/examples/hdc1008_demo/Make.defs index fa1dd8e8a01..ac45aa939d4 100644 --- a/examples/hdc1008_demo/Make.defs +++ b/examples/hdc1008_demo/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/hdc1008_demo/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/hdc1008_demo/Makefile b/examples/hdc1008_demo/Makefile index 6f691ea5e29..0016c3e71ad 100644 --- a/examples/hdc1008_demo/Makefile +++ b/examples/hdc1008_demo/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/hdc1008_demo/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/hdc1008_demo/hdc1008_main.c b/examples/hdc1008_demo/hdc1008_main.c index 589f7ddd591..57b6f221503 100644 --- a/examples/hdc1008_demo/hdc1008_main.c +++ b/examples/hdc1008_demo/hdc1008_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/hdc1008_demo/hdc1008_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/hello/CMakeLists.txt b/examples/hello/CMakeLists.txt index d71131595a7..94fefd6124d 100644 --- a/examples/hello/CMakeLists.txt +++ b/examples/hello/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/hello/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/hello/Make.defs b/examples/hello/Make.defs index b21f7d2031a..e31ef0f1d80 100644 --- a/examples/hello/Make.defs +++ b/examples/hello/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/hello/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/hello/Makefile b/examples/hello/Makefile index f5f6017c0e0..e8bcc498584 100644 --- a/examples/hello/Makefile +++ b/examples/hello/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/hello/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/hello/hello_main.c b/examples/hello/hello_main.c index 2cd6cb400a7..fd194a623ae 100644 --- a/examples/hello/hello_main.c +++ b/examples/hello/hello_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/hello/hello_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/hello_d/Make.defs b/examples/hello_d/Make.defs index b267da14fab..1dbcd3b9fac 100644 --- a/examples/hello_d/Make.defs +++ b/examples/hello_d/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/hello_d/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/hello_d/Makefile b/examples/hello_d/Makefile index 805edea851a..983d3f3d751 100644 --- a/examples/hello_d/Makefile +++ b/examples/hello_d/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/hello_d/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/hello_d/hello_d_main.d b/examples/hello_d/hello_d_main.d index 47dd4e88541..4d165b1f31d 100644 --- a/examples/hello_d/hello_d_main.d +++ b/examples/hello_d/hello_d_main.d @@ -1,6 +1,8 @@ //*************************************************************************** // apps/examples/hello_d/hello_d_main.d // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/examples/hello_d/nuttx_std.c b/examples/hello_d/nuttx_std.c index f8585c47f5c..0583f396bb4 100644 --- a/examples/hello_d/nuttx_std.c +++ b/examples/hello_d/nuttx_std.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/hello_d/nuttx_std.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/hello_nim/Make.defs b/examples/hello_nim/Make.defs index 3c8fdf662d8..595d851339d 100644 --- a/examples/hello_nim/Make.defs +++ b/examples/hello_nim/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/hello_nim/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/hello_nim/Makefile b/examples/hello_nim/Makefile index 67e9bf9c97a..fa797310614 100644 --- a/examples/hello_nim/Makefile +++ b/examples/hello_nim/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/hello_nim/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/hello_nim/hello_nim_async.nim b/examples/hello_nim/hello_nim_async.nim index 580283c17b3..664fe7d9bd3 100644 --- a/examples/hello_nim/hello_nim_async.nim +++ b/examples/hello_nim/hello_nim_async.nim @@ -1,3 +1,25 @@ +/**************************************************************************** + * apps/examples/hello_nim/hello_nim_async.c + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + import std/asyncdispatch import std/strformat diff --git a/examples/hello_nim/hello_nim_main.c b/examples/hello_nim/hello_nim_main.c index 9cad2fd9242..2f138653307 100644 --- a/examples/hello_nim/hello_nim_main.c +++ b/examples/hello_nim/hello_nim_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/hello_nim/hello_nim_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/hello_rust/Make.defs b/examples/hello_rust/Make.defs index 245662e68ce..7cb3099d206 100644 --- a/examples/hello_rust/Make.defs +++ b/examples/hello_rust/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/hello_rust/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/hello_rust/Makefile b/examples/hello_rust/Makefile index 8415ff40288..b1ac1824ca7 100644 --- a/examples/hello_rust/Makefile +++ b/examples/hello_rust/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/hello_rust/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/hello_rust/hello_rust_main.rs b/examples/hello_rust/hello_rust_main.rs index 3a276e94dd6..fa24671cd7f 100644 --- a/examples/hello_rust/hello_rust_main.rs +++ b/examples/hello_rust/hello_rust_main.rs @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/hello_rust/hello_rust_main.rs * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/hello_swift/BridgingHeader.h b/examples/hello_swift/BridgingHeader.h index 4d5ed3d94eb..ca7ed2ce656 100644 --- a/examples/hello_swift/BridgingHeader.h +++ b/examples/hello_swift/BridgingHeader.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/hello_swift/BridgingHeader.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/hello_swift/Make.defs b/examples/hello_swift/Make.defs index 2829de01e12..d3e68fc72ec 100644 --- a/examples/hello_swift/Make.defs +++ b/examples/hello_swift/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/hello_swift/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/hello_swift/Makefile b/examples/hello_swift/Makefile index 5f6a39be841..49fabf55d2d 100644 --- a/examples/hello_swift/Makefile +++ b/examples/hello_swift/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/hello_swift/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/hello_swift/hello_swift_main.swift b/examples/hello_swift/hello_swift_main.swift index 215235e50be..665704908ee 100644 --- a/examples/hello_swift/hello_swift_main.swift +++ b/examples/hello_swift/hello_swift_main.swift @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/hello_swift/hello_swift_main.swift * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/hello_wasm/CMakeLists.txt b/examples/hello_wasm/CMakeLists.txt index 556aafd5b40..ecdc6e8e787 100644 --- a/examples/hello_wasm/CMakeLists.txt +++ b/examples/hello_wasm/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/hello_wasm/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/hello_wasm/Make.defs b/examples/hello_wasm/Make.defs index 26d76c29290..4f780cbbcb2 100644 --- a/examples/hello_wasm/Make.defs +++ b/examples/hello_wasm/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/hello_wasm/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/hello_wasm/Makefile b/examples/hello_wasm/Makefile index 1d6f4f81a03..1ca45f7c531 100644 --- a/examples/hello_wasm/Makefile +++ b/examples/hello_wasm/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/hello_wasm/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/hello_wasm/hello_main.c b/examples/hello_wasm/hello_main.c index c351cf93984..856f6b4ccd3 100644 --- a/examples/hello_wasm/hello_main.c +++ b/examples/hello_wasm/hello_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/hello_wasm/hello_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/hello_zig/Make.defs b/examples/hello_zig/Make.defs index 25dcc1824f4..e60bcc7ce04 100644 --- a/examples/hello_zig/Make.defs +++ b/examples/hello_zig/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/hello_zig/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/hello_zig/Makefile b/examples/hello_zig/Makefile index 90b9de59011..a1a66d2f845 100644 --- a/examples/hello_zig/Makefile +++ b/examples/hello_zig/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/hello_zig/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/hello_zig/hello_zig.zig b/examples/hello_zig/hello_zig.zig index 4c8fbcbcadb..d3b5dd35d4a 100644 --- a/examples/hello_zig/hello_zig.zig +++ b/examples/hello_zig/hello_zig.zig @@ -1,6 +1,8 @@ //*************************************************************************** // examples/hello_zig/hello_zig.zig // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/examples/helloxx/CMakeLists.txt b/examples/helloxx/CMakeLists.txt index 6138c309e45..12c27efe2e1 100644 --- a/examples/helloxx/CMakeLists.txt +++ b/examples/helloxx/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/helloxx/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/helloxx/Make.defs b/examples/helloxx/Make.defs index 13fbd567b44..318436af99b 100644 --- a/examples/helloxx/Make.defs +++ b/examples/helloxx/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/helloxx/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/helloxx/Makefile b/examples/helloxx/Makefile index 30b02cfd181..a9741277fa4 100644 --- a/examples/helloxx/Makefile +++ b/examples/helloxx/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/helloxx/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/helloxx/helloxx_main.cxx b/examples/helloxx/helloxx_main.cxx index fb0134a8483..c3425ff6b92 100644 --- a/examples/helloxx/helloxx_main.cxx +++ b/examples/helloxx/helloxx_main.cxx @@ -1,6 +1,8 @@ //*************************************************************************** // apps/examples/helloxx/helloxx_main.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/examples/hidkbd/CMakeLists.txt b/examples/hidkbd/CMakeLists.txt index cbbe8bf7e4b..90654c581dd 100644 --- a/examples/hidkbd/CMakeLists.txt +++ b/examples/hidkbd/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/hidkbd/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/hidkbd/Make.defs b/examples/hidkbd/Make.defs index 7868506f9e2..659cf76da41 100644 --- a/examples/hidkbd/Make.defs +++ b/examples/hidkbd/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/hidkbd/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/hidkbd/Makefile b/examples/hidkbd/Makefile index 91a644692d3..8532747f39b 100644 --- a/examples/hidkbd/Makefile +++ b/examples/hidkbd/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/hidkbd/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/hidkbd/hidkbd_main.c b/examples/hidkbd/hidkbd_main.c index d2b53ee9de1..1515d65261b 100644 --- a/examples/hidkbd/hidkbd_main.c +++ b/examples/hidkbd/hidkbd_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/hidkbd/hidkbd_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/hts221_reader/CMakeLists.txt b/examples/hts221_reader/CMakeLists.txt index edd1ad9664c..70b883a4b77 100644 --- a/examples/hts221_reader/CMakeLists.txt +++ b/examples/hts221_reader/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/hts221_reader/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/hts221_reader/Make.defs b/examples/hts221_reader/Make.defs index 846a0ff2003..d6577e5b276 100644 --- a/examples/hts221_reader/Make.defs +++ b/examples/hts221_reader/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/hts221_reader/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/hts221_reader/Makefile b/examples/hts221_reader/Makefile index 46db8727c26..90b9cc57928 100644 --- a/examples/hts221_reader/Makefile +++ b/examples/hts221_reader/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/hts221_reader/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/hts221_reader/hts221_reader_main.c b/examples/hts221_reader/hts221_reader_main.c index f77bbfd88a1..ac00ede5e7a 100644 --- a/examples/hts221_reader/hts221_reader_main.c +++ b/examples/hts221_reader/hts221_reader_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/hts221_reader/hts221_reader_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/hx711/CMakeLists.txt b/examples/hx711/CMakeLists.txt index aabe90ef60d..df388c6ae13 100644 --- a/examples/hx711/CMakeLists.txt +++ b/examples/hx711/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/hx711/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/hx711/Make.defs b/examples/hx711/Make.defs index 7cffdda6f42..2503e5b994b 100644 --- a/examples/hx711/Make.defs +++ b/examples/hx711/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/hx711/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/hx711/Makefile b/examples/hx711/Makefile index 4d2a8461991..d68a8767e12 100644 --- a/examples/hx711/Makefile +++ b/examples/hx711/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/hx711/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/hx711/hx711_main.c b/examples/hx711/hx711_main.c index fc7117469e3..3e9f1755c85 100644 --- a/examples/hx711/hx711_main.c +++ b/examples/hx711/hx711_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/hx711/hx711_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/i2schar/CMakeLists.txt b/examples/i2schar/CMakeLists.txt index aca814c244c..003a13e9803 100644 --- a/examples/i2schar/CMakeLists.txt +++ b/examples/i2schar/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/i2schar/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/i2schar/Make.defs b/examples/i2schar/Make.defs index eb17a38b4a2..a4add3ee858 100644 --- a/examples/i2schar/Make.defs +++ b/examples/i2schar/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/i2schar/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/i2schar/Makefile b/examples/i2schar/Makefile index 8a312abcda0..6f4ad7de289 100644 --- a/examples/i2schar/Makefile +++ b/examples/i2schar/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/i2schar/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/i2schar/i2schar.h b/examples/i2schar/i2schar.h index ed140e6e7c2..b80b5e4832a 100644 --- a/examples/i2schar/i2schar.h +++ b/examples/i2schar/i2schar.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/i2schar/i2schar.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/i2schar/i2schar_main.c b/examples/i2schar/i2schar_main.c index 28f2fd59af7..ea5d6850ff5 100644 --- a/examples/i2schar/i2schar_main.c +++ b/examples/i2schar/i2schar_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/i2schar/i2schar_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/i2schar/i2schar_receiver.c b/examples/i2schar/i2schar_receiver.c index 9b6300f6734..164635779db 100644 --- a/examples/i2schar/i2schar_receiver.c +++ b/examples/i2schar/i2schar_receiver.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/i2schar/i2schar_receiver.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/i2schar/i2schar_transmitter.c b/examples/i2schar/i2schar_transmitter.c index 1396757e257..aa5c59db9ff 100644 --- a/examples/i2schar/i2schar_transmitter.c +++ b/examples/i2schar/i2schar_transmitter.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/i2schar/i2schar_transmitter.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/i2sloop/CMakeLists.txt b/examples/i2sloop/CMakeLists.txt index a36cd669b39..c1d64f1367f 100644 --- a/examples/i2sloop/CMakeLists.txt +++ b/examples/i2sloop/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/i2sloop/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/i2sloop/Make.defs b/examples/i2sloop/Make.defs index 6f72f5fcb70..97c751df4cd 100644 --- a/examples/i2sloop/Make.defs +++ b/examples/i2sloop/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/i2sloop/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/i2sloop/Makefile b/examples/i2sloop/Makefile index d3341ac2f11..fb5b5625527 100644 --- a/examples/i2sloop/Makefile +++ b/examples/i2sloop/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/i2sloop/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/i2sloop/i2sloop_main.c b/examples/i2sloop/i2sloop_main.c index f64aa816836..a84c8254c33 100644 --- a/examples/i2sloop/i2sloop_main.c +++ b/examples/i2sloop/i2sloop_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/i2sloop/i2sloop_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/igmp/CMakeLists.txt b/examples/igmp/CMakeLists.txt index bf5f770e3f7..f02381f8153 100644 --- a/examples/igmp/CMakeLists.txt +++ b/examples/igmp/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/igmp/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/igmp/Make.defs b/examples/igmp/Make.defs index 5ce9853f313..1f839cc9e79 100644 --- a/examples/igmp/Make.defs +++ b/examples/igmp/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/igmp/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/igmp/Makefile b/examples/igmp/Makefile index 4fc9fef0159..9dbec79ca90 100644 --- a/examples/igmp/Makefile +++ b/examples/igmp/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/igmp/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/igmp/igmp.c b/examples/igmp/igmp.c index 4822227cc0e..da904fa34f6 100644 --- a/examples/igmp/igmp.c +++ b/examples/igmp/igmp.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/igmp/igmp.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/igmp/igmp.h b/examples/igmp/igmp.h index 3d9ac6466f5..11ffb57f959 100644 --- a/examples/igmp/igmp.h +++ b/examples/igmp/igmp.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/igmp/igmp.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/ina219/CMakeLists.txt b/examples/ina219/CMakeLists.txt index d507fd5b6ed..451ddffaf96 100644 --- a/examples/ina219/CMakeLists.txt +++ b/examples/ina219/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/ina219/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/ina219/Make.defs b/examples/ina219/Make.defs index 4aad654d6c5..29ae967e004 100644 --- a/examples/ina219/Make.defs +++ b/examples/ina219/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/ina219/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/ina219/Makefile b/examples/ina219/Makefile index 16d3e6348d3..5580850fea8 100644 --- a/examples/ina219/Makefile +++ b/examples/ina219/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/ina219/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/ina219/ina219_main.c b/examples/ina219/ina219_main.c index a82064ceb2f..ddb4ce5abba 100644 --- a/examples/ina219/ina219_main.c +++ b/examples/ina219/ina219_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/ina219/ina219_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/ina226/CMakeLists.txt b/examples/ina226/CMakeLists.txt index cade2d42cee..1e34b265990 100644 --- a/examples/ina226/CMakeLists.txt +++ b/examples/ina226/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/ina226/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/ina226/Make.defs b/examples/ina226/Make.defs index 980fd358a91..a335ce5c039 100644 --- a/examples/ina226/Make.defs +++ b/examples/ina226/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/ina226/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/ina226/Makefile b/examples/ina226/Makefile index 0a5859b5fda..46efa9d1ccc 100644 --- a/examples/ina226/Makefile +++ b/examples/ina226/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/ina226/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/ina226/ina226_main.c b/examples/ina226/ina226_main.c index 69d040cdfd8..6a73f6cbb52 100644 --- a/examples/ina226/ina226_main.c +++ b/examples/ina226/ina226_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/ina226/ina226_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/ini_dumper/CMakeLists.txt b/examples/ini_dumper/CMakeLists.txt index f97058410e7..e6cf9392931 100644 --- a/examples/ini_dumper/CMakeLists.txt +++ b/examples/ini_dumper/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/ini_dumper/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/ini_dumper/Make.defs b/examples/ini_dumper/Make.defs index f83e58fdbf3..2c92065a834 100644 --- a/examples/ini_dumper/Make.defs +++ b/examples/ini_dumper/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/ini_dumper/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/ini_dumper/Makefile b/examples/ini_dumper/Makefile index fdd362a3d75..cecc252abc4 100644 --- a/examples/ini_dumper/Makefile +++ b/examples/ini_dumper/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/ini_dumper/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/ini_dumper/ini_dumper_main.c b/examples/ini_dumper/ini_dumper_main.c index 7f950e1f572..8f3e2ca7646 100644 --- a/examples/ini_dumper/ini_dumper_main.c +++ b/examples/ini_dumper/ini_dumper_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/ini_dumper/ini_dumper_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/ipcfg/CMakeLists.txt b/examples/ipcfg/CMakeLists.txt index eed3461196c..ab57dcd6d0f 100644 --- a/examples/ipcfg/CMakeLists.txt +++ b/examples/ipcfg/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/ipcfg/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/ipcfg/Make.defs b/examples/ipcfg/Make.defs index 1a54ae6f8b4..6dc082db01a 100644 --- a/examples/ipcfg/Make.defs +++ b/examples/ipcfg/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/ipcfg/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/ipcfg/Makefile b/examples/ipcfg/Makefile index 82c6b018c0d..fe823188044 100644 --- a/examples/ipcfg/Makefile +++ b/examples/ipcfg/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/ipcfg/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/ipcfg/ipcfg_main.c b/examples/ipcfg/ipcfg_main.c index 2caa7d1bdcb..f64a73ea850 100644 --- a/examples/ipcfg/ipcfg_main.c +++ b/examples/ipcfg/ipcfg_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/ipcfg/ipcfg_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/ipforward/CMakeLists.txt b/examples/ipforward/CMakeLists.txt index 04f4fee6239..350da02db7e 100644 --- a/examples/ipforward/CMakeLists.txt +++ b/examples/ipforward/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/ipforward/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/ipforward/Make.defs b/examples/ipforward/Make.defs index 51f4e5da981..42f55108feb 100644 --- a/examples/ipforward/Make.defs +++ b/examples/ipforward/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/ipforward/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/ipforward/Makefile b/examples/ipforward/Makefile index 2fa6f4866d5..1a5c2a90963 100644 --- a/examples/ipforward/Makefile +++ b/examples/ipforward/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/ipforward/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/ipforward/ipforward.c b/examples/ipforward/ipforward.c index 45fa3e79081..205df55482d 100644 --- a/examples/ipforward/ipforward.c +++ b/examples/ipforward/ipforward.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/ipforward/ipforward.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/isl29023/CMakeLists.txt b/examples/isl29023/CMakeLists.txt index a04780ba156..d833c1a62fd 100644 --- a/examples/isl29023/CMakeLists.txt +++ b/examples/isl29023/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/isl29023/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/isl29023/Make.defs b/examples/isl29023/Make.defs index f6497bbe002..e8e9583c556 100644 --- a/examples/isl29023/Make.defs +++ b/examples/isl29023/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/isl29023/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/isl29023/Makefile b/examples/isl29023/Makefile index 7e3a0801fb0..2c20c2665bb 100644 --- a/examples/isl29023/Makefile +++ b/examples/isl29023/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/isl29023/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/isl29023/isl29023_main.c b/examples/isl29023/isl29023_main.c index 7ccddda67cf..2c36d817833 100644 --- a/examples/isl29023/isl29023_main.c +++ b/examples/isl29023/isl29023_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/isl29023/isl29023_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/json/CMakeLists.txt b/examples/json/CMakeLists.txt index c8f862dacc8..f2c1d432d3a 100644 --- a/examples/json/CMakeLists.txt +++ b/examples/json/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/json/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/json/Make.defs b/examples/json/Make.defs index 1156c79288d..023d630f533 100644 --- a/examples/json/Make.defs +++ b/examples/json/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/json/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/json/Makefile b/examples/json/Makefile index 2ce52673078..c416b223348 100644 --- a/examples/json/Makefile +++ b/examples/json/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/json/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/json/json_main.c b/examples/json/json_main.c index e3b1c9118c9..d49d40316a6 100644 --- a/examples/json/json_main.c +++ b/examples/json/json_main.c @@ -1,14 +1,10 @@ /**************************************************************************** * apps/examples/json/json_main.c * - * This file is a part of NuttX: - * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. - * Ported by: Darcy Gong - * - * And derives from the cJSON Project which has an MIT license: - * - * Copyright (c) 2009 Dave Gamble + * SPDX-License-Identifier: MIT + * SPDX-FileCopyrightText: 2012 Gregory Nutt. All rights reserved. + * SPDX-FileCopyrightText: 2009 Dave Gamble + * SPDX-FileContributor: Darcy Gong * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/examples/keyboard/Make.defs b/examples/keyboard/Make.defs index 0310f739ed7..ddd11f9bcc0 100644 --- a/examples/keyboard/Make.defs +++ b/examples/keyboard/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/keyboard/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/keyboard/Makefile b/examples/keyboard/Makefile index 8010d71a134..1284fb73a1c 100644 --- a/examples/keyboard/Makefile +++ b/examples/keyboard/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/keyboard/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/keyboard/kbd_main.c b/examples/keyboard/kbd_main.c index a1624e844c0..58a6e9f3efe 100644 --- a/examples/keyboard/kbd_main.c +++ b/examples/keyboard/kbd_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/keyboard/kbd_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/leds/CMakeLists.txt b/examples/leds/CMakeLists.txt index 71c32cd7a26..9e45423d28f 100644 --- a/examples/leds/CMakeLists.txt +++ b/examples/leds/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/leds/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/leds/Make.defs b/examples/leds/Make.defs index eff16b38941..50b1b9997ea 100644 --- a/examples/leds/Make.defs +++ b/examples/leds/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/leds/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/leds/Makefile b/examples/leds/Makefile index f98a32f4812..2bd032ba357 100644 --- a/examples/leds/Makefile +++ b/examples/leds/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/leds/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/leds/leds_main.c b/examples/leds/leds_main.c index 71864dc0c13..4d785f65cd2 100644 --- a/examples/leds/leds_main.c +++ b/examples/leds/leds_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/leds/leds_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/leds_rust/Make.defs b/examples/leds_rust/Make.defs index 0749823da12..059e8a20e89 100644 --- a/examples/leds_rust/Make.defs +++ b/examples/leds_rust/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/leds_rust/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/leds_rust/Makefile b/examples/leds_rust/Makefile index ab3d86e2bcd..bf3c8345dd7 100644 --- a/examples/leds_rust/Makefile +++ b/examples/leds_rust/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/leds_rust/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/leds_rust/leds_rust_main.rs b/examples/leds_rust/leds_rust_main.rs index 1bd1bca4254..206d36028a4 100644 --- a/examples/leds_rust/leds_rust_main.rs +++ b/examples/leds_rust/leds_rust_main.rs @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/leds_rust/leds_rust_main.rs * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/leds_rust/nuttx.rs b/examples/leds_rust/nuttx.rs index 4b075767b6e..41366096d55 100644 --- a/examples/leds_rust/nuttx.rs +++ b/examples/leds_rust/nuttx.rs @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/leds_rust/nuttx.rs * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/leds_zig/Make.defs b/examples/leds_zig/Make.defs index 9f5fb809e02..1ea4e5d040e 100644 --- a/examples/leds_zig/Make.defs +++ b/examples/leds_zig/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/leds_zig/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/leds_zig/Makefile b/examples/leds_zig/Makefile index 4da5a89084d..a97c199d16a 100644 --- a/examples/leds_zig/Makefile +++ b/examples/leds_zig/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/leds_zig/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/leds_zig/leds_zig.zig b/examples/leds_zig/leds_zig.zig index ad1b3f435d4..bbfbffd546f 100644 --- a/examples/leds_zig/leds_zig.zig +++ b/examples/leds_zig/leds_zig.zig @@ -1,6 +1,8 @@ ///************************************************************************** // examples/leds_zig/leds_zig.zig // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/examples/libtest/CMakeLists.txt b/examples/libtest/CMakeLists.txt index 4458322ff53..a1975f18431 100644 --- a/examples/libtest/CMakeLists.txt +++ b/examples/libtest/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/libtest/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/libtest/Make.defs b/examples/libtest/Make.defs index a76fbef7cd9..c9e0a6c887e 100644 --- a/examples/libtest/Make.defs +++ b/examples/libtest/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/libtest/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/libtest/Makefile b/examples/libtest/Makefile index 95606815e5a..b29501389bd 100644 --- a/examples/libtest/Makefile +++ b/examples/libtest/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/libtest/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/libtest/libtest.c b/examples/libtest/libtest.c index 83360588434..a1d9852c8ad 100644 --- a/examples/libtest/libtest.c +++ b/examples/libtest/libtest.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/libtest/libtest.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/libtest/libtest.h b/examples/libtest/libtest.h index 59f7d2acf10..df0ed548a88 100644 --- a/examples/libtest/libtest.h +++ b/examples/libtest/libtest.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/libtest/libtest.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/libtest/libtest_main.c b/examples/libtest/libtest_main.c index 60281a4705a..9ce19525619 100644 --- a/examples/libtest/libtest_main.c +++ b/examples/libtest/libtest_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/libtest/libtest_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/lis3dsh_reader/CMakeLists.txt b/examples/lis3dsh_reader/CMakeLists.txt index 641904e2adf..37e2d5961f9 100644 --- a/examples/lis3dsh_reader/CMakeLists.txt +++ b/examples/lis3dsh_reader/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/lis3dsh_reader/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/lis3dsh_reader/Make.defs b/examples/lis3dsh_reader/Make.defs index 2245b4d37d7..1caf28f154f 100644 --- a/examples/lis3dsh_reader/Make.defs +++ b/examples/lis3dsh_reader/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/lis3dsh_reader/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/lis3dsh_reader/Makefile b/examples/lis3dsh_reader/Makefile index b83339d9e0b..d97e90a41ad 100644 --- a/examples/lis3dsh_reader/Makefile +++ b/examples/lis3dsh_reader/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/lis3dsh_reader/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/lis3dsh_reader/lis3dsh_reader_main.c b/examples/lis3dsh_reader/lis3dsh_reader_main.c index 7d5816ac2e7..dad00b312b3 100644 --- a/examples/lis3dsh_reader/lis3dsh_reader_main.c +++ b/examples/lis3dsh_reader/lis3dsh_reader_main.c @@ -1,8 +1,9 @@ /**************************************************************************** * apps/examples/lis3dsh_reader/lis3dsh_reader_main.c * - * Copyright (C) 2017 Florian Olbrich. All rights reserved. - * Author: Florian Olbrich + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2017 Florian Olbrich. All rights reserved. + * SPDX-FileContributor: Florian Olbrich * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/examples/lp503x/CMakeLists.txt b/examples/lp503x/CMakeLists.txt index 78c7f70b3d9..1256caabb09 100644 --- a/examples/lp503x/CMakeLists.txt +++ b/examples/lp503x/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/lp503x/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/lp503x/Make.defs b/examples/lp503x/Make.defs index f89e60f5e14..bf3f20b86ca 100644 --- a/examples/lp503x/Make.defs +++ b/examples/lp503x/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/lp503x/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/lp503x/Makefile b/examples/lp503x/Makefile index abad5899ca6..5cab0d4e49b 100644 --- a/examples/lp503x/Makefile +++ b/examples/lp503x/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/lp503x/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/lp503x/lp503x_main.c b/examples/lp503x/lp503x_main.c index 6443052481d..2d34929a6c5 100644 --- a/examples/lp503x/lp503x_main.c +++ b/examples/lp503x/lp503x_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/lp503x/lp503x_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/lsm303_reader/CMakeLists.txt b/examples/lsm303_reader/CMakeLists.txt index f7d857393ad..b45c576a774 100644 --- a/examples/lsm303_reader/CMakeLists.txt +++ b/examples/lsm303_reader/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/lsm303_reader/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/lsm303_reader/Make.defs b/examples/lsm303_reader/Make.defs index e47c99ca111..3035bb27661 100644 --- a/examples/lsm303_reader/Make.defs +++ b/examples/lsm303_reader/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/lsm303_reader/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/lsm303_reader/Makefile b/examples/lsm303_reader/Makefile index 325b9104841..0183a532080 100644 --- a/examples/lsm303_reader/Makefile +++ b/examples/lsm303_reader/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/lsm303_reader/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/lsm303_reader/lsm303_reader_main.c b/examples/lsm303_reader/lsm303_reader_main.c index 7c5c2e7f67e..b48e81a2d91 100644 --- a/examples/lsm303_reader/lsm303_reader_main.c +++ b/examples/lsm303_reader/lsm303_reader_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/lsm303_reader/lsm303_reader_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/lsm330spi_test/CMakeLists.txt b/examples/lsm330spi_test/CMakeLists.txt index 92aade46c9c..96438b7729b 100644 --- a/examples/lsm330spi_test/CMakeLists.txt +++ b/examples/lsm330spi_test/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/lsm330spi_test/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/lsm330spi_test/Make.defs b/examples/lsm330spi_test/Make.defs index ea85abe516d..19908c39205 100644 --- a/examples/lsm330spi_test/Make.defs +++ b/examples/lsm330spi_test/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/lsm330spi_test/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/lsm330spi_test/Makefile b/examples/lsm330spi_test/Makefile index 4e2ebc68da1..341cf7567fd 100644 --- a/examples/lsm330spi_test/Makefile +++ b/examples/lsm330spi_test/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/lsm330spi_test/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/lsm330spi_test/lsm330spi_test_main.c b/examples/lsm330spi_test/lsm330spi_test_main.c index f78032a6f91..2ac49feac1c 100644 --- a/examples/lsm330spi_test/lsm330spi_test_main.c +++ b/examples/lsm330spi_test/lsm330spi_test_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/lsm330spi_test/lsm330spi_test_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/lsm6dsl_reader/CMakeLists.txt b/examples/lsm6dsl_reader/CMakeLists.txt index ee068dd7d41..766504114d3 100644 --- a/examples/lsm6dsl_reader/CMakeLists.txt +++ b/examples/lsm6dsl_reader/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/lsm6dsl_reader/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/lsm6dsl_reader/Make.defs b/examples/lsm6dsl_reader/Make.defs index 4db2424da95..19918cf56b6 100644 --- a/examples/lsm6dsl_reader/Make.defs +++ b/examples/lsm6dsl_reader/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/lsm6dsl_reader/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/lsm6dsl_reader/Makefile b/examples/lsm6dsl_reader/Makefile index f1a8cb3e242..a9fbfb47599 100644 --- a/examples/lsm6dsl_reader/Makefile +++ b/examples/lsm6dsl_reader/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/lsm6dsl_reader/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/lsm6dsl_reader/lsm6dsl_reader_main.c b/examples/lsm6dsl_reader/lsm6dsl_reader_main.c index 6fea70de5b0..c3ec68ff725 100644 --- a/examples/lsm6dsl_reader/lsm6dsl_reader_main.c +++ b/examples/lsm6dsl_reader/lsm6dsl_reader_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/lsm6dsl_reader/lsm6dsl_reader_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/ltr308/CMakeLists.txt b/examples/ltr308/CMakeLists.txt index 16409fe40e0..5d3615c0402 100644 --- a/examples/ltr308/CMakeLists.txt +++ b/examples/ltr308/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/ltr308/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/ltr308/Make.defs b/examples/ltr308/Make.defs index 6fc8ea33631..16bdcc134e3 100644 --- a/examples/ltr308/Make.defs +++ b/examples/ltr308/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/ltr308/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/ltr308/Makefile b/examples/ltr308/Makefile index 3eef9a3fc3b..0db3eb1f403 100644 --- a/examples/ltr308/Makefile +++ b/examples/ltr308/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/ltr308/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/ltr308/ltr308_main.c b/examples/ltr308/ltr308_main.c index c951add02f2..1109b1799ad 100644 --- a/examples/ltr308/ltr308_main.c +++ b/examples/ltr308/ltr308_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/ltr308/ltr308_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/lua_module/CMakeLists.txt b/examples/lua_module/CMakeLists.txt index 951002584c1..713f5abbdae 100644 --- a/examples/lua_module/CMakeLists.txt +++ b/examples/lua_module/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/lua_module/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/lua_module/Make.defs b/examples/lua_module/Make.defs index 4daf2b8d07d..11cf233b148 100644 --- a/examples/lua_module/Make.defs +++ b/examples/lua_module/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/lua_module/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/lua_module/Makefile b/examples/lua_module/Makefile index c588aacf09f..77f1932612f 100644 --- a/examples/lua_module/Makefile +++ b/examples/lua_module/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/lua_module/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/lua_module/luamod_hello.c b/examples/lua_module/luamod_hello.c index dd9fb8b3c2c..22f13c2fbed 100644 --- a/examples/lua_module/luamod_hello.c +++ b/examples/lua_module/luamod_hello.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/lua_module/luamod_hello.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/lvgldemo/CMakeLists.txt b/examples/lvgldemo/CMakeLists.txt index 1b8734b9512..a3b241fa888 100644 --- a/examples/lvgldemo/CMakeLists.txt +++ b/examples/lvgldemo/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/lvgldemo/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/lvgldemo/Make.defs b/examples/lvgldemo/Make.defs index 1793bbd9676..7729d01d63c 100644 --- a/examples/lvgldemo/Make.defs +++ b/examples/lvgldemo/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/lvgldemo/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/lvgldemo/Makefile b/examples/lvgldemo/Makefile index 65e0b5a9599..f2645b2437e 100644 --- a/examples/lvgldemo/Makefile +++ b/examples/lvgldemo/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/lvgldemo/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/lvgldemo/lvgldemo.c b/examples/lvgldemo/lvgldemo.c index 34b1b6e8c14..05741cb88e0 100644 --- a/examples/lvgldemo/lvgldemo.c +++ b/examples/lvgldemo/lvgldemo.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/lvgldemo/lvgldemo.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/lvglterm/CMakeLists.txt b/examples/lvglterm/CMakeLists.txt index 82ded6f6720..fe6d3c48cab 100644 --- a/examples/lvglterm/CMakeLists.txt +++ b/examples/lvglterm/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/lvglterm/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/lvglterm/Make.defs b/examples/lvglterm/Make.defs index 17e96e8b7a9..89c84302ac2 100644 --- a/examples/lvglterm/Make.defs +++ b/examples/lvglterm/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/lvglterm/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/lvglterm/Makefile b/examples/lvglterm/Makefile index 6ff05028605..531d8c405f2 100644 --- a/examples/lvglterm/Makefile +++ b/examples/lvglterm/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/lvglterm/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/lvglterm/lvglterm.c b/examples/lvglterm/lvglterm.c index 8ee096f1b84..90269daa875 100644 --- a/examples/lvglterm/lvglterm.c +++ b/examples/lvglterm/lvglterm.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/lvglterm/lvglterm.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/max31855/CMakeLists.txt b/examples/max31855/CMakeLists.txt index 38d998a1860..68a8014e14f 100644 --- a/examples/max31855/CMakeLists.txt +++ b/examples/max31855/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/max31855/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/max31855/Make.defs b/examples/max31855/Make.defs index b707cabf47c..d114228b1c5 100644 --- a/examples/max31855/Make.defs +++ b/examples/max31855/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/max31855/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/max31855/Makefile b/examples/max31855/Makefile index 592c03d0be9..04951afa10e 100644 --- a/examples/max31855/Makefile +++ b/examples/max31855/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/max31855/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/max31855/max31855_main.c b/examples/max31855/max31855_main.c index 1c345d12e58..fb26fee2cef 100644 --- a/examples/max31855/max31855_main.c +++ b/examples/max31855/max31855_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/max31855/max31855_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/mcuboot/CMakeLists.txt b/examples/mcuboot/CMakeLists.txt index 26f891869f8..7c6b7189d11 100644 --- a/examples/mcuboot/CMakeLists.txt +++ b/examples/mcuboot/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/mcuboot/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/mcuboot/Make.defs b/examples/mcuboot/Make.defs index fea6548f9d0..f8cc9ed896a 100644 --- a/examples/mcuboot/Make.defs +++ b/examples/mcuboot/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/mcuboot/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/mcuboot/Makefile b/examples/mcuboot/Makefile index 3bd6703c205..5687f531cca 100644 --- a/examples/mcuboot/Makefile +++ b/examples/mcuboot/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/mcuboot/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/mcuboot/slot_confirm/CMakeLists.txt b/examples/mcuboot/slot_confirm/CMakeLists.txt index 415556ffad5..ec4c24abd56 100644 --- a/examples/mcuboot/slot_confirm/CMakeLists.txt +++ b/examples/mcuboot/slot_confirm/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/mcuboot/slot_confirm/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/mcuboot/slot_confirm/Make.defs b/examples/mcuboot/slot_confirm/Make.defs index dc9bad2e4c7..5050148d10b 100644 --- a/examples/mcuboot/slot_confirm/Make.defs +++ b/examples/mcuboot/slot_confirm/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/mcuboot/slot_confirm/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/mcuboot/slot_confirm/Makefile b/examples/mcuboot/slot_confirm/Makefile index 809dc864efb..dc4a93279ea 100644 --- a/examples/mcuboot/slot_confirm/Makefile +++ b/examples/mcuboot/slot_confirm/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/mcuboot/slot_confirm/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/mcuboot/slot_confirm/mcuboot_confirm_main.c b/examples/mcuboot/slot_confirm/mcuboot_confirm_main.c index 0052716c6f2..2f296b08122 100644 --- a/examples/mcuboot/slot_confirm/mcuboot_confirm_main.c +++ b/examples/mcuboot/slot_confirm/mcuboot_confirm_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/mcuboot/slot_confirm/mcuboot_confirm_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/mcuboot/swap_test/CMakeLists.txt b/examples/mcuboot/swap_test/CMakeLists.txt index 2d7467dcd69..0de3e51b710 100644 --- a/examples/mcuboot/swap_test/CMakeLists.txt +++ b/examples/mcuboot/swap_test/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/mcuboot/swap_test/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/mcuboot/swap_test/Make.defs b/examples/mcuboot/swap_test/Make.defs index e4d01553288..e503eab8a56 100644 --- a/examples/mcuboot/swap_test/Make.defs +++ b/examples/mcuboot/swap_test/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/mcuboot/swap_test/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/mcuboot/swap_test/Makefile b/examples/mcuboot/swap_test/Makefile index ad91a880462..c409490a830 100644 --- a/examples/mcuboot/swap_test/Makefile +++ b/examples/mcuboot/swap_test/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/mcuboot/swap_test/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/mcuboot/swap_test/confirm_main.c b/examples/mcuboot/swap_test/confirm_main.c index c8a29c179e9..8f1980455fa 100644 --- a/examples/mcuboot/swap_test/confirm_main.c +++ b/examples/mcuboot/swap_test/confirm_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/mcuboot/swap_test/confirm_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/mcuboot/swap_test/set_img_main.c b/examples/mcuboot/swap_test/set_img_main.c index b8c538e5279..b8196094a4a 100644 --- a/examples/mcuboot/swap_test/set_img_main.c +++ b/examples/mcuboot/swap_test/set_img_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/mcuboot/swap_test/set_img_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/mcuboot/swap_test/version_main.c b/examples/mcuboot/swap_test/version_main.c index fbe04e36251..b606c628c69 100644 --- a/examples/mcuboot/swap_test/version_main.c +++ b/examples/mcuboot/swap_test/version_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/mcuboot/swap_test/version_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/mcuboot/update_agent/CMakeLists.txt b/examples/mcuboot/update_agent/CMakeLists.txt index 9a84d60dc0a..f356d8c22a4 100644 --- a/examples/mcuboot/update_agent/CMakeLists.txt +++ b/examples/mcuboot/update_agent/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/mcuboot/update_agent/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/mcuboot/update_agent/Make.defs b/examples/mcuboot/update_agent/Make.defs index 2419050c3f5..0130402bdb6 100644 --- a/examples/mcuboot/update_agent/Make.defs +++ b/examples/mcuboot/update_agent/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/mcuboot/update_agent/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/mcuboot/update_agent/Makefile b/examples/mcuboot/update_agent/Makefile index a0d40ebf623..bb227cabf4b 100644 --- a/examples/mcuboot/update_agent/Makefile +++ b/examples/mcuboot/update_agent/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/mcuboot/update_agent/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/mcuboot/update_agent/mcuboot_agent_main.c b/examples/mcuboot/update_agent/mcuboot_agent_main.c index 935dca5010d..697825acb83 100644 --- a/examples/mcuboot/update_agent/mcuboot_agent_main.c +++ b/examples/mcuboot/update_agent/mcuboot_agent_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/mcuboot/update_agent/mcuboot_agent_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/media/CMakeLists.txt b/examples/media/CMakeLists.txt index f812ae8806c..e579c4fd959 100644 --- a/examples/media/CMakeLists.txt +++ b/examples/media/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/media/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/media/Make.defs b/examples/media/Make.defs index 99d09ae79e7..d6ae0164a3f 100644 --- a/examples/media/Make.defs +++ b/examples/media/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/media/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/media/Makefile b/examples/media/Makefile index d0203d196f7..c1d39a1b2c7 100644 --- a/examples/media/Makefile +++ b/examples/media/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/media/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/media/media_main.c b/examples/media/media_main.c index 7dee8c90d5c..f27b507c402 100644 --- a/examples/media/media_main.c +++ b/examples/media/media_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/media/media_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/mld/CMakeLists.txt b/examples/mld/CMakeLists.txt index 3ccae2b0105..66120beb4b0 100644 --- a/examples/mld/CMakeLists.txt +++ b/examples/mld/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/mld/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/mld/Make.defs b/examples/mld/Make.defs index c94b181f24b..350dbd00560 100644 --- a/examples/mld/Make.defs +++ b/examples/mld/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/mld/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/mld/Makefile b/examples/mld/Makefile index f309c17e849..af45c88665a 100644 --- a/examples/mld/Makefile +++ b/examples/mld/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/mld/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/mld/mld.h b/examples/mld/mld.h index c2d5afbfc64..69d8f13a4c6 100644 --- a/examples/mld/mld.h +++ b/examples/mld/mld.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/mld/mld.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/mld/mld_main.c b/examples/mld/mld_main.c index a2cad6fb626..363a7e41d39 100644 --- a/examples/mld/mld_main.c +++ b/examples/mld/mld_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/mld/mld_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/mlx90614/CMakeLists.txt b/examples/mlx90614/CMakeLists.txt index 2d601e2204d..aaa6ea2443e 100644 --- a/examples/mlx90614/CMakeLists.txt +++ b/examples/mlx90614/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/mlx90614/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/mlx90614/Make.defs b/examples/mlx90614/Make.defs index 6c59d12ffa1..f0a682e74de 100644 --- a/examples/mlx90614/Make.defs +++ b/examples/mlx90614/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/mlx90614/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/mlx90614/Makefile b/examples/mlx90614/Makefile index 0c7316ca7a4..60ddd79a116 100644 --- a/examples/mlx90614/Makefile +++ b/examples/mlx90614/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/mlx90614/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/mlx90614/mlx90614_main.c b/examples/mlx90614/mlx90614_main.c index 7b8d95c6ce3..0311ceddd2f 100644 --- a/examples/mlx90614/mlx90614_main.c +++ b/examples/mlx90614/mlx90614_main.c @@ -1,9 +1,10 @@ /**************************************************************************** * apps/examples/mlx90614/mlx90614_main.c * - * Copyright (C) 2017 Gregory Nutt. All rights reserved. - * Copyright (c) 2015-2017 Pololu Corporation. - * Author: Alan Carvalho de Assis + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2017 Gregory Nutt. All rights reserved. + * SPDX-FileCopyrightText: 2015-2017 Pololu Corporation. + * SPDX-FileContributor: Alan Carvalho de Assis * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/examples/mml_parser/CMakeLists.txt b/examples/mml_parser/CMakeLists.txt index 2d2f909140f..b6792dd7bca 100644 --- a/examples/mml_parser/CMakeLists.txt +++ b/examples/mml_parser/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/mml_parser/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/mml_parser/Make.defs b/examples/mml_parser/Make.defs index e24a6d54e7e..5f290c70bec 100644 --- a/examples/mml_parser/Make.defs +++ b/examples/mml_parser/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/mml_parser/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/mml_parser/Makefile b/examples/mml_parser/Makefile index 99bf56503ea..796153ed6af 100644 --- a/examples/mml_parser/Makefile +++ b/examples/mml_parser/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/mml_parser/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/mml_parser/mml_parser_main.c b/examples/mml_parser/mml_parser_main.c index 9bd1adebad8..4f4fe9bf255 100644 --- a/examples/mml_parser/mml_parser_main.c +++ b/examples/mml_parser/mml_parser_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/mml_parser/mml_parser_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/modbus/CMakeLists.txt b/examples/modbus/CMakeLists.txt index 8c8e5bd7b94..37104316f86 100644 --- a/examples/modbus/CMakeLists.txt +++ b/examples/modbus/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/modbus/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/modbus/Make.defs b/examples/modbus/Make.defs index b44c8b8b8ee..2032f5c2608 100644 --- a/examples/modbus/Make.defs +++ b/examples/modbus/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/modbus/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/modbus/Makefile b/examples/modbus/Makefile index c792c809bc5..7d7810f079e 100644 --- a/examples/modbus/Makefile +++ b/examples/modbus/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/modbus/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/modbus/modbus_main.c b/examples/modbus/modbus_main.c index cefa94f90a1..7178a458e84 100644 --- a/examples/modbus/modbus_main.c +++ b/examples/modbus/modbus_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/modbus/modbus_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/modbusmaster/CMakeLists.txt b/examples/modbusmaster/CMakeLists.txt index 5dd9ae8a843..3a6043a384e 100644 --- a/examples/modbusmaster/CMakeLists.txt +++ b/examples/modbusmaster/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/modbusmaster/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/modbusmaster/Make.defs b/examples/modbusmaster/Make.defs index e90c3d1ec48..bcdef99c5b7 100644 --- a/examples/modbusmaster/Make.defs +++ b/examples/modbusmaster/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/modbusmaster/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/modbusmaster/Makefile b/examples/modbusmaster/Makefile index 188a70e556a..fc93c00cef4 100644 --- a/examples/modbusmaster/Makefile +++ b/examples/modbusmaster/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/modbusmaster/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/modbusmaster/mbmaster_main.c b/examples/modbusmaster/mbmaster_main.c index 4f80f12679c..2c369dd35b1 100644 --- a/examples/modbusmaster/mbmaster_main.c +++ b/examples/modbusmaster/mbmaster_main.c @@ -1,9 +1,9 @@ /**************************************************************************** * apps/examples/modbusmaster/mbmaster_main.c * - * Copyright (c) 2016 Vytautas Lukenskas - * Copyright (c) 2019 Alan Carvalho de Assis - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2016 Vytautas Lukenskas + * SPDX-FileCopyrightText: 2019 Alan Carvalho de Assis * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/examples/module/CMakeLists.txt b/examples/module/CMakeLists.txt index 54e5a388b93..77e6b30aa36 100644 --- a/examples/module/CMakeLists.txt +++ b/examples/module/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/module/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/module/Make.defs b/examples/module/Make.defs index 57b758ed1f5..2e99fa3b5d8 100644 --- a/examples/module/Make.defs +++ b/examples/module/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/module/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/module/Makefile b/examples/module/Makefile index 8024342718a..ca547c70d48 100644 --- a/examples/module/Makefile +++ b/examples/module/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/module/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/module/chardev/Make.defs b/examples/module/chardev/Make.defs index df35a6034c2..71ed9fb3a53 100644 --- a/examples/module/chardev/Make.defs +++ b/examples/module/chardev/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/module/chardev/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/module/chardev/Makefile b/examples/module/chardev/Makefile index 070247a01e4..94d56ed8715 100644 --- a/examples/module/chardev/Makefile +++ b/examples/module/chardev/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/module/chardev/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/module/chardev/chardev.c b/examples/module/chardev/chardev.c index 5291a13cc98..82eed698c95 100644 --- a/examples/module/chardev/chardev.c +++ b/examples/module/chardev/chardev.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/module/chardev/chardev.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/module/main/CMakeLists.txt b/examples/module/main/CMakeLists.txt index 57f3f4f0178..8036a7c87c1 100644 --- a/examples/module/main/CMakeLists.txt +++ b/examples/module/main/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/module/main/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/module/main/Make.defs b/examples/module/main/Make.defs index f4f4ea83c87..7e049406d89 100644 --- a/examples/module/main/Make.defs +++ b/examples/module/main/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/module/main/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/module/main/Makefile b/examples/module/main/Makefile index ceacd6abc60..f5294b25748 100644 --- a/examples/module/main/Makefile +++ b/examples/module/main/Makefile @@ -1,12 +1,16 @@ ############################################################################ # apps/examples/module/main/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The # ASF licenses this file to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance with the -# License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT diff --git a/examples/module/main/module_main.c b/examples/module/main/module_main.c index 903aced652d..0d31fb38b51 100644 --- a/examples/module/main/module_main.c +++ b/examples/module/main/module_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/module/main/module_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/mount/CMakeLists.txt b/examples/mount/CMakeLists.txt index 748a1ca6ccd..9c7e5b03cff 100644 --- a/examples/mount/CMakeLists.txt +++ b/examples/mount/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/mount/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/mount/Make.defs b/examples/mount/Make.defs index 998094833a2..eed839585f0 100644 --- a/examples/mount/Make.defs +++ b/examples/mount/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/mount/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/mount/Makefile b/examples/mount/Makefile index 32d8641a905..197c6b00452 100644 --- a/examples/mount/Makefile +++ b/examples/mount/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/mount/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/mount/mount.h b/examples/mount/mount.h index a1ac41212b6..4697ec2a3d1 100644 --- a/examples/mount/mount.h +++ b/examples/mount/mount.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/mount/mount.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/mount/mount_main.c b/examples/mount/mount_main.c index 89c23da115f..c2b4e45b489 100644 --- a/examples/mount/mount_main.c +++ b/examples/mount/mount_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/mount/mount_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/mount/ramdisk.c b/examples/mount/ramdisk.c index f732c28348a..7eeeafaab80 100644 --- a/examples/mount/ramdisk.c +++ b/examples/mount/ramdisk.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/mount/ramdisk.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/mqttc/CMakeLists.txt b/examples/mqttc/CMakeLists.txt index ade8dcbd68b..56771255847 100644 --- a/examples/mqttc/CMakeLists.txt +++ b/examples/mqttc/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/mqttc/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/mqttc/Make.defs b/examples/mqttc/Make.defs index 80ed6a46a50..87bb6453085 100644 --- a/examples/mqttc/Make.defs +++ b/examples/mqttc/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/mqttc/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/mqttc/Makefile b/examples/mqttc/Makefile index 6ade70103d9..9aacf67f6c8 100644 --- a/examples/mqttc/Makefile +++ b/examples/mqttc/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/mqttc/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/mqttc/mqttc_pub.c b/examples/mqttc/mqttc_pub.c index 876e67e7056..6948afb426a 100644 --- a/examples/mqttc/mqttc_pub.c +++ b/examples/mqttc/mqttc_pub.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/mqttc/mqttc_pub.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/mtdpart/CMakeLists.txt b/examples/mtdpart/CMakeLists.txt index 1ec237c64c9..2b629ba0387 100644 --- a/examples/mtdpart/CMakeLists.txt +++ b/examples/mtdpart/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/mtdpart/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/mtdpart/Make.defs b/examples/mtdpart/Make.defs index b15dcadd094..a5bb9f62da3 100644 --- a/examples/mtdpart/Make.defs +++ b/examples/mtdpart/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/mtdpart/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/mtdpart/Makefile b/examples/mtdpart/Makefile index c758eb3cc11..ac0785e75d3 100644 --- a/examples/mtdpart/Makefile +++ b/examples/mtdpart/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/mtdpart/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/mtdpart/mtdpart_main.c b/examples/mtdpart/mtdpart_main.c index 12f77e9287e..9b4496e9164 100644 --- a/examples/mtdpart/mtdpart_main.c +++ b/examples/mtdpart/mtdpart_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/mtdpart/mtdpart_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/mtdrwb/CMakeLists.txt b/examples/mtdrwb/CMakeLists.txt index bf84c01708f..f0e53117d11 100644 --- a/examples/mtdrwb/CMakeLists.txt +++ b/examples/mtdrwb/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/mtdrwb/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/mtdrwb/Make.defs b/examples/mtdrwb/Make.defs index c63649109ac..b5f983c5e20 100644 --- a/examples/mtdrwb/Make.defs +++ b/examples/mtdrwb/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/mtdrwb/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/mtdrwb/Makefile b/examples/mtdrwb/Makefile index 609e2cf7bd1..79831664d4f 100644 --- a/examples/mtdrwb/Makefile +++ b/examples/mtdrwb/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/mtdrwb/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/mtdrwb/mtdrwb_main.c b/examples/mtdrwb/mtdrwb_main.c index 7110f112a12..1ebbe44f5b3 100644 --- a/examples/mtdrwb/mtdrwb_main.c +++ b/examples/mtdrwb/mtdrwb_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/mtdrwb/mtdrwb_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/netlink_route/CMakeLists.txt b/examples/netlink_route/CMakeLists.txt index 9f0dc52cec3..57d14f97740 100644 --- a/examples/netlink_route/CMakeLists.txt +++ b/examples/netlink_route/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/netlink_route/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/netlink_route/Make.defs b/examples/netlink_route/Make.defs index 0fdbd42d032..7b46636ba73 100644 --- a/examples/netlink_route/Make.defs +++ b/examples/netlink_route/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/netlink_route/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/netlink_route/Makefile b/examples/netlink_route/Makefile index dd6c790db89..9fd5052c83b 100644 --- a/examples/netlink_route/Makefile +++ b/examples/netlink_route/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/netlink_route/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/netlink_route/netlink_route_main.c b/examples/netlink_route/netlink_route_main.c index 887ac9a93bb..c69f4dd12c4 100644 --- a/examples/netlink_route/netlink_route_main.c +++ b/examples/netlink_route/netlink_route_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/netlink_route/netlink_route_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/netloop/CMakeLists.txt b/examples/netloop/CMakeLists.txt index 783827dafb7..22a4bedbead 100644 --- a/examples/netloop/CMakeLists.txt +++ b/examples/netloop/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/netloop/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/netloop/Make.defs b/examples/netloop/Make.defs index 2478605a2f7..aac6a4db967 100644 --- a/examples/netloop/Make.defs +++ b/examples/netloop/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/netloop/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/netloop/Makefile b/examples/netloop/Makefile index 486cb02d41d..bb6c3d73fb8 100644 --- a/examples/netloop/Makefile +++ b/examples/netloop/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/netloop/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/netloop/lo_listener.c b/examples/netloop/lo_listener.c index 84b0572905f..8b51027bbc1 100644 --- a/examples/netloop/lo_listener.c +++ b/examples/netloop/lo_listener.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/netloop/lo_listener.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/netloop/lo_main.c b/examples/netloop/lo_main.c index 2775c0da9cc..cfdfab429d8 100644 --- a/examples/netloop/lo_main.c +++ b/examples/netloop/lo_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/netloop/lo_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/netloop/netloop.h b/examples/netloop/netloop.h index e6788f08ff9..c4d6415d6ce 100644 --- a/examples/netloop/netloop.h +++ b/examples/netloop/netloop.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/netloop/netloop.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/netpkt/CMakeLists.txt b/examples/netpkt/CMakeLists.txt index 0550d3af477..54da626d4a4 100644 --- a/examples/netpkt/CMakeLists.txt +++ b/examples/netpkt/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/netpkt/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/netpkt/Make.defs b/examples/netpkt/Make.defs index ff4735448c1..2c6ceecc9ec 100644 --- a/examples/netpkt/Make.defs +++ b/examples/netpkt/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/netpkt/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/netpkt/Makefile b/examples/netpkt/Makefile index d9f1e11abf5..b3c056a6d79 100644 --- a/examples/netpkt/Makefile +++ b/examples/netpkt/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/netpkt/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/netpkt/netpkt_ethercat.c b/examples/netpkt/netpkt_ethercat.c index 9d0a17012fc..8b8ab298abb 100644 --- a/examples/netpkt/netpkt_ethercat.c +++ b/examples/netpkt/netpkt_ethercat.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/netpkt/netpkt_ethercat.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/netpkt/netpkt_main.c b/examples/netpkt/netpkt_main.c index 94a37f050d3..5f9aec81f21 100644 --- a/examples/netpkt/netpkt_main.c +++ b/examples/netpkt/netpkt_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/netpkt/netpkt_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nettest/CMakeLists.txt b/examples/nettest/CMakeLists.txt index 2bcedfbf31f..fafdec23618 100644 --- a/examples/nettest/CMakeLists.txt +++ b/examples/nettest/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/nettest/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/nettest/Make.defs b/examples/nettest/Make.defs index a18a3eca30f..36647cfc195 100644 --- a/examples/nettest/Make.defs +++ b/examples/nettest/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/nettest/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/nettest/Makefile b/examples/nettest/Makefile index 9cd52eacf4f..763cd4476af 100644 --- a/examples/nettest/Makefile +++ b/examples/nettest/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/nettest/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/nettest/host/CMakeLists.txt b/examples/nettest/host/CMakeLists.txt index b0f87c8de10..6a06817e802 100644 --- a/examples/nettest/host/CMakeLists.txt +++ b/examples/nettest/host/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/nettest/host/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/nettest/nettest.h b/examples/nettest/nettest.h index d49e7de31b9..e4ff7f3cc99 100644 --- a/examples/nettest/nettest.h +++ b/examples/nettest/nettest.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nettest/nettest.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nettest/nettest_client.c b/examples/nettest/nettest_client.c index 9a3a10408c4..c6070b7c649 100644 --- a/examples/nettest/nettest_client.c +++ b/examples/nettest/nettest_client.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nettest/nettest_client.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nettest/nettest_cmdline.c b/examples/nettest/nettest_cmdline.c index af8ed5e690d..397e0aa7cc4 100644 --- a/examples/nettest/nettest_cmdline.c +++ b/examples/nettest/nettest_cmdline.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nettest/nettest_cmdline.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nettest/nettest_host.c b/examples/nettest/nettest_host.c index 6e6ce25bd1e..e6dfb4eafb0 100644 --- a/examples/nettest/nettest_host.c +++ b/examples/nettest/nettest_host.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nettest/nettest_host.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nettest/nettest_netinit.c b/examples/nettest/nettest_netinit.c index 481a7737f26..5c29ca411d7 100644 --- a/examples/nettest/nettest_netinit.c +++ b/examples/nettest/nettest_netinit.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nettest/nettest_netinit.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nettest/nettest_server.c b/examples/nettest/nettest_server.c index fefcd451bc2..26fca608833 100644 --- a/examples/nettest/nettest_server.c +++ b/examples/nettest/nettest_server.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nettest/nettest_server.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nettest/nettest_target1.c b/examples/nettest/nettest_target1.c index 9a14f3fe8f1..3875be272c2 100644 --- a/examples/nettest/nettest_target1.c +++ b/examples/nettest/nettest_target1.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nettest/nettest_target1.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nettest/nettest_target2.c b/examples/nettest/nettest_target2.c index 43e4e080698..4a56f18a240 100644 --- a/examples/nettest/nettest_target2.c +++ b/examples/nettest/nettest_target2.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nettest/nettest_target2.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nimble/CMakeLists.txt b/examples/nimble/CMakeLists.txt index ede1b48c909..6298d5d4a96 100644 --- a/examples/nimble/CMakeLists.txt +++ b/examples/nimble/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/nimble/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/nimble/Make.defs b/examples/nimble/Make.defs index a3be37e41e6..09cc79a8bca 100644 --- a/examples/nimble/Make.defs +++ b/examples/nimble/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/nimble/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/nimble/Makefile b/examples/nimble/Makefile index 4e6a3b71489..6b75c2aa1d7 100644 --- a/examples/nimble/Makefile +++ b/examples/nimble/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/nimble/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/nimble/nimble_main.c b/examples/nimble/nimble_main.c index bae871b7f88..829e02cdb08 100644 --- a/examples/nimble/nimble_main.c +++ b/examples/nimble/nimble_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nimble/nimble_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nng_test/CMakeLists.txt b/examples/nng_test/CMakeLists.txt index da59e8ce85f..3d35655ee3c 100644 --- a/examples/nng_test/CMakeLists.txt +++ b/examples/nng_test/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/nng_test/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/nng_test/Make.defs b/examples/nng_test/Make.defs index e63161ba219..c8a42149bab 100644 --- a/examples/nng_test/Make.defs +++ b/examples/nng_test/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/nng_test/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/nng_test/Makefile b/examples/nng_test/Makefile index 950bd990294..7ab7ecb6c33 100644 --- a/examples/nng_test/Makefile +++ b/examples/nng_test/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/nng_test/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/nng_test/pubsub.c b/examples/nng_test/pubsub.c index a5dc1cda3e0..4f285906efe 100644 --- a/examples/nng_test/pubsub.c +++ b/examples/nng_test/pubsub.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nng_test/pubsub.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/noteprintf/CMakeLists.txt b/examples/noteprintf/CMakeLists.txt index 07bb69c57e2..3bcfc483a7f 100644 --- a/examples/noteprintf/CMakeLists.txt +++ b/examples/noteprintf/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/noteprintf/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/noteprintf/Make.defs b/examples/noteprintf/Make.defs index 3c481289d1d..eb21a4d5c33 100644 --- a/examples/noteprintf/Make.defs +++ b/examples/noteprintf/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/noteprintf/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/noteprintf/Makefile b/examples/noteprintf/Makefile index 06b11cbcef5..b14eddf9827 100644 --- a/examples/noteprintf/Makefile +++ b/examples/noteprintf/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/noteprintf/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/noteprintf/noteprintf_main.c b/examples/noteprintf/noteprintf_main.c index 6e1e73a9b76..dbc81ee8f79 100644 --- a/examples/noteprintf/noteprintf_main.c +++ b/examples/noteprintf/noteprintf_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/noteprintf/noteprintf_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nrf24l01_btle/CMakeLists.txt b/examples/nrf24l01_btle/CMakeLists.txt index 660424ae317..ec150791f96 100644 --- a/examples/nrf24l01_btle/CMakeLists.txt +++ b/examples/nrf24l01_btle/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/nrf24l01_btle/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/nrf24l01_btle/Make.defs b/examples/nrf24l01_btle/Make.defs index 459ce982b27..adb767470c0 100644 --- a/examples/nrf24l01_btle/Make.defs +++ b/examples/nrf24l01_btle/Make.defs @@ -1,7 +1,8 @@ ############################################################################ # apps/examples/nrf24l01_btle/Make.defs - -# Adds selected applications to apps/ build +# +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/nrf24l01_btle/Makefile b/examples/nrf24l01_btle/Makefile index 4e1eda4e1de..621635598a2 100644 --- a/examples/nrf24l01_btle/Makefile +++ b/examples/nrf24l01_btle/Makefile @@ -1,20 +1,22 @@ ############################################################################ # apps/examples/nrf24l01_btle/Makefile # -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. The -# ASF licenses this file to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance with the -# License. You may obtain a copy of the License at +# SPDX-License-Identifier: Apache-2.0 # -# http://www.apache.org/licenses/LICENSE-2.0 +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at # -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. # ############################################################################ diff --git a/examples/nrf24l01_btle/nrf24l01_btle.c b/examples/nrf24l01_btle/nrf24l01_btle.c index 33db52f973a..1f0e68a13a0 100644 --- a/examples/nrf24l01_btle/nrf24l01_btle.c +++ b/examples/nrf24l01_btle/nrf24l01_btle.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nrf24l01_btle/nrf24l01_btle.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nrf24l01_btle/nrf24l01_btle.h b/examples/nrf24l01_btle/nrf24l01_btle.h index 10abe165d82..73d16635616 100644 --- a/examples/nrf24l01_btle/nrf24l01_btle.h +++ b/examples/nrf24l01_btle/nrf24l01_btle.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nrf24l01_btle/nrf24l01_btle.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nrf24l01_term/CMakeLists.txt b/examples/nrf24l01_term/CMakeLists.txt index 99ee24ae062..e1e46c0ae58 100644 --- a/examples/nrf24l01_term/CMakeLists.txt +++ b/examples/nrf24l01_term/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/nrf24l01_term/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/nrf24l01_term/Make.defs b/examples/nrf24l01_term/Make.defs index 4129a49f596..35985af7fa6 100644 --- a/examples/nrf24l01_term/Make.defs +++ b/examples/nrf24l01_term/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/nrf24l01_term/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/nrf24l01_term/Makefile b/examples/nrf24l01_term/Makefile index f0911da2e29..f496bd8520d 100644 --- a/examples/nrf24l01_term/Makefile +++ b/examples/nrf24l01_term/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/nrf24l01_term/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/nrf24l01_term/nrf24l01_term.c b/examples/nrf24l01_term/nrf24l01_term.c index 91cc766dfee..b8af3dca030 100644 --- a/examples/nrf24l01_term/nrf24l01_term.c +++ b/examples/nrf24l01_term/nrf24l01_term.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nrf24l01_term/nrf24l01_term.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/null/CMakeLists.txt b/examples/null/CMakeLists.txt index 5d359bd8f44..299433f0b85 100644 --- a/examples/null/CMakeLists.txt +++ b/examples/null/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/null/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/null/Make.defs b/examples/null/Make.defs index 0fdb580f46f..6d55c9de2b9 100644 --- a/examples/null/Make.defs +++ b/examples/null/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/null/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/null/Makefile b/examples/null/Makefile index b5a051051cc..602f6117174 100644 --- a/examples/null/Makefile +++ b/examples/null/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/null/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/null/null_main.c b/examples/null/null_main.c index 43702b20d57..0e9ea160e75 100644 --- a/examples/null/null_main.c +++ b/examples/null/null_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/null/null_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nunchuck/CMakeLists.txt b/examples/nunchuck/CMakeLists.txt index 6f3fc48dcc9..50680da74ef 100644 --- a/examples/nunchuck/CMakeLists.txt +++ b/examples/nunchuck/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/nunchuck/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/nunchuck/Make.defs b/examples/nunchuck/Make.defs index 1ec2ae31201..931735e59c5 100644 --- a/examples/nunchuck/Make.defs +++ b/examples/nunchuck/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/nunchuck/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/nunchuck/Makefile b/examples/nunchuck/Makefile index 1bcb336bfb6..87e66e50cef 100644 --- a/examples/nunchuck/Makefile +++ b/examples/nunchuck/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/nunchuck/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/nunchuck/nunchuck_main.c b/examples/nunchuck/nunchuck_main.c index f3f7e6e7fdc..fa72e1ce6aa 100644 --- a/examples/nunchuck/nunchuck_main.c +++ b/examples/nunchuck/nunchuck_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nunchuck/nunchuck_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nx/CMakeLists.txt b/examples/nx/CMakeLists.txt index 9ca2a119dfc..a4ff9f8d1c5 100644 --- a/examples/nx/CMakeLists.txt +++ b/examples/nx/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/nx/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/nx/Make.defs b/examples/nx/Make.defs index c8adfaba47c..db23b214ee0 100644 --- a/examples/nx/Make.defs +++ b/examples/nx/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/nx/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/nx/Makefile b/examples/nx/Makefile index b743cf0efca..cacdb2e311b 100644 --- a/examples/nx/Makefile +++ b/examples/nx/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/nx/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/nx/nx_events.c b/examples/nx/nx_events.c index 7aaf1272dd5..36085658486 100644 --- a/examples/nx/nx_events.c +++ b/examples/nx/nx_events.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nx/nx_events.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nx/nx_internal.h b/examples/nx/nx_internal.h index b9477284666..c92b1ccfa46 100644 --- a/examples/nx/nx_internal.h +++ b/examples/nx/nx_internal.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nx/nx_internal.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nx/nx_kbdin.c b/examples/nx/nx_kbdin.c index 137207f8192..856323a2482 100644 --- a/examples/nx/nx_kbdin.c +++ b/examples/nx/nx_kbdin.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nx/nx_kbdin.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nx/nx_main.c b/examples/nx/nx_main.c index 674d9149644..a7b9134c00d 100644 --- a/examples/nx/nx_main.c +++ b/examples/nx/nx_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nx/nx_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nxdemo/CMakeLists.txt b/examples/nxdemo/CMakeLists.txt index 26fe5144a3c..b43078f14d4 100644 --- a/examples/nxdemo/CMakeLists.txt +++ b/examples/nxdemo/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/nxdemo/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/nxdemo/Make.defs b/examples/nxdemo/Make.defs index acde420ba33..7a75f29afa6 100644 --- a/examples/nxdemo/Make.defs +++ b/examples/nxdemo/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/nxdemo/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/nxdemo/Makefile b/examples/nxdemo/Makefile index 475e58c99d0..67faa61aae3 100644 --- a/examples/nxdemo/Makefile +++ b/examples/nxdemo/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/nxdemo/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/nxdemo/images.h b/examples/nxdemo/images.h index a3bed7888bd..b0c411a62fd 100644 --- a/examples/nxdemo/images.h +++ b/examples/nxdemo/images.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nxdemo/images.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nxdemo/nxdemo.h b/examples/nxdemo/nxdemo.h index 190d9efa43d..ebace04ae39 100644 --- a/examples/nxdemo/nxdemo.h +++ b/examples/nxdemo/nxdemo.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nxdemo/nxdemo.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nxdemo/nxdemo_bkgd.c b/examples/nxdemo/nxdemo_bkgd.c index 23ada3a6b72..fd03f08c00b 100644 --- a/examples/nxdemo/nxdemo_bkgd.c +++ b/examples/nxdemo/nxdemo_bkgd.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nxdemo/nxdemo_bkgd.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nxdemo/nxdemo_listener.c b/examples/nxdemo/nxdemo_listener.c index 430b9003994..83458491326 100644 --- a/examples/nxdemo/nxdemo_listener.c +++ b/examples/nxdemo/nxdemo_listener.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nxdemo/nxdemo_listener.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nxdemo/nxdemo_main.c b/examples/nxdemo/nxdemo_main.c index e09e0182fd9..ca5d5b878db 100644 --- a/examples/nxdemo/nxdemo_main.c +++ b/examples/nxdemo/nxdemo_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nxdemo/nxdemo_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nxflat/CMakeLists.txt b/examples/nxflat/CMakeLists.txt index bb3de47a2e7..35107f1b996 100644 --- a/examples/nxflat/CMakeLists.txt +++ b/examples/nxflat/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/nxflat/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/nxflat/Make.defs b/examples/nxflat/Make.defs index 765c7957484..45e6739089c 100644 --- a/examples/nxflat/Make.defs +++ b/examples/nxflat/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/nxflat/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/nxflat/Makefile b/examples/nxflat/Makefile index db78b8349e4..a8aa8184249 100644 --- a/examples/nxflat/Makefile +++ b/examples/nxflat/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/nxflat/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/nxflat/nxflat_main.c b/examples/nxflat/nxflat_main.c index fe856087a93..0c8425e2e68 100644 --- a/examples/nxflat/nxflat_main.c +++ b/examples/nxflat/nxflat_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nxflat/nxflat_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nxflat/tests/Makefile b/examples/nxflat/tests/Makefile index b14d2f74ba2..0f83f513728 100644 --- a/examples/nxflat/tests/Makefile +++ b/examples/nxflat/tests/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/nxflat/tests/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/nxflat/tests/errno/Makefile b/examples/nxflat/tests/errno/Makefile index 97d707a9877..43ee63d4e9c 100644 --- a/examples/nxflat/tests/errno/Makefile +++ b/examples/nxflat/tests/errno/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/nxflat/tests/errno/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/nxflat/tests/errno/errno.c b/examples/nxflat/tests/errno/errno.c index bb5acd3c477..1c3e4305774 100644 --- a/examples/nxflat/tests/errno/errno.c +++ b/examples/nxflat/tests/errno/errno.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nxflat/tests/errno/errno.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nxflat/tests/hello++/Makefile b/examples/nxflat/tests/hello++/Makefile index f34dc338723..3202dd1b9c0 100644 --- a/examples/nxflat/tests/hello++/Makefile +++ b/examples/nxflat/tests/hello++/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/nxflat/tests/hello++/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/nxflat/tests/hello++/hello++1.cxx b/examples/nxflat/tests/hello++/hello++1.cxx index 013861a71f5..d0a229f9854 100644 --- a/examples/nxflat/tests/hello++/hello++1.cxx +++ b/examples/nxflat/tests/hello++/hello++1.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/examples/nxflat/tests/hello++/hello++1.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/examples/nxflat/tests/hello++/hello++2.cxx b/examples/nxflat/tests/hello++/hello++2.cxx index 96c1c2ba2a1..d5ee74edaab 100644 --- a/examples/nxflat/tests/hello++/hello++2.cxx +++ b/examples/nxflat/tests/hello++/hello++2.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/examples/nxflat/tests/hello++/hello++2.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/examples/nxflat/tests/hello++/hello++3.cxx b/examples/nxflat/tests/hello++/hello++3.cxx index bf308517582..c16686e6825 100644 --- a/examples/nxflat/tests/hello++/hello++3.cxx +++ b/examples/nxflat/tests/hello++/hello++3.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/examples/nxflat/tests/hello++/hello++3.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/examples/nxflat/tests/hello++/hello++4.cxx b/examples/nxflat/tests/hello++/hello++4.cxx index e1c30de2633..98a1eb7465f 100644 --- a/examples/nxflat/tests/hello++/hello++4.cxx +++ b/examples/nxflat/tests/hello++/hello++4.cxx @@ -1,6 +1,8 @@ ///////////////////////////////////////////////////////////////////////////// // apps/examples/nxflat/tests/hello++/hello++4.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/examples/nxflat/tests/hello/Makefile b/examples/nxflat/tests/hello/Makefile index fb7036409e0..c176050953b 100644 --- a/examples/nxflat/tests/hello/Makefile +++ b/examples/nxflat/tests/hello/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/nxflat/tests/hello/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/nxflat/tests/hello/hello.c b/examples/nxflat/tests/hello/hello.c index f55565b33dc..90017f1b2c1 100644 --- a/examples/nxflat/tests/hello/hello.c +++ b/examples/nxflat/tests/hello/hello.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nxflat/tests/hello/hello.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nxflat/tests/longjmp/Makefile b/examples/nxflat/tests/longjmp/Makefile index 1cb724b1822..d1dfdd6a444 100644 --- a/examples/nxflat/tests/longjmp/Makefile +++ b/examples/nxflat/tests/longjmp/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/nxflat/tests/longjmp/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/nxflat/tests/longjmp/longjmp.c b/examples/nxflat/tests/longjmp/longjmp.c index c27518f1707..ea7ae7bad74 100644 --- a/examples/nxflat/tests/longjmp/longjmp.c +++ b/examples/nxflat/tests/longjmp/longjmp.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nxflat/tests/longjmp/longjmp.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nxflat/tests/mkdirlist.sh b/examples/nxflat/tests/mkdirlist.sh index 96f928c7ac3..786a7b4cdee 100755 --- a/examples/nxflat/tests/mkdirlist.sh +++ b/examples/nxflat/tests/mkdirlist.sh @@ -1,4 +1,25 @@ #!/usr/bin/env bash +############################################################################ +# apps/examples/nxflat/tests/mkdirlist.sh +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ usage="Usage: %0 " diff --git a/examples/nxflat/tests/mutex/Makefile b/examples/nxflat/tests/mutex/Makefile index 6ed1f382320..afdfc4966e0 100644 --- a/examples/nxflat/tests/mutex/Makefile +++ b/examples/nxflat/tests/mutex/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/nxflat/tests/mutex/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/nxflat/tests/mutex/mutex.c b/examples/nxflat/tests/mutex/mutex.c index bbf7102c926..c8bede26d92 100644 --- a/examples/nxflat/tests/mutex/mutex.c +++ b/examples/nxflat/tests/mutex/mutex.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nxflat/tests/mutex/mutex.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nxflat/tests/pthread/Makefile b/examples/nxflat/tests/pthread/Makefile index 219213d4d94..34eda9330c0 100644 --- a/examples/nxflat/tests/pthread/Makefile +++ b/examples/nxflat/tests/pthread/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/nxflat/tests/pthread/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/nxflat/tests/pthread/pthread.c b/examples/nxflat/tests/pthread/pthread.c index 200de0a5aea..ca2f6268d1e 100644 --- a/examples/nxflat/tests/pthread/pthread.c +++ b/examples/nxflat/tests/pthread/pthread.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nxflat/tests/pthread/pthread.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nxflat/tests/signal/Makefile b/examples/nxflat/tests/signal/Makefile index cb20c01187b..0fba3386436 100644 --- a/examples/nxflat/tests/signal/Makefile +++ b/examples/nxflat/tests/signal/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/nxflat/tests/signal/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/nxflat/tests/signal/signal.c b/examples/nxflat/tests/signal/signal.c index 7cf4732d327..7deb7768e70 100644 --- a/examples/nxflat/tests/signal/signal.c +++ b/examples/nxflat/tests/signal/signal.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nxflat/tests/signal/signal.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nxflat/tests/struct/Makefile b/examples/nxflat/tests/struct/Makefile index eb37c8b8010..463b2c260de 100644 --- a/examples/nxflat/tests/struct/Makefile +++ b/examples/nxflat/tests/struct/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/nxflat/tests/struct/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/nxflat/tests/struct/struct.h b/examples/nxflat/tests/struct/struct.h index 1afd0c5a2ff..199efd8cae5 100644 --- a/examples/nxflat/tests/struct/struct.h +++ b/examples/nxflat/tests/struct/struct.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nxflat/tests/struct/struct.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nxflat/tests/struct/struct_dummy.c b/examples/nxflat/tests/struct/struct_dummy.c index c1444a4aed3..5630b22add0 100644 --- a/examples/nxflat/tests/struct/struct_dummy.c +++ b/examples/nxflat/tests/struct/struct_dummy.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nxflat/tests/struct/struct_dummy.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nxflat/tests/struct/struct_main.c b/examples/nxflat/tests/struct/struct_main.c index f8abc2a7323..18aa4917897 100644 --- a/examples/nxflat/tests/struct/struct_main.c +++ b/examples/nxflat/tests/struct/struct_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nxflat/tests/struct/struct_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nxflat/tests/task/Makefile b/examples/nxflat/tests/task/Makefile index 712f5b1fd40..cb3473d6be6 100644 --- a/examples/nxflat/tests/task/Makefile +++ b/examples/nxflat/tests/task/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/nxflat/tests/task/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/nxflat/tests/task/task.c b/examples/nxflat/tests/task/task.c index e77dc887538..8a208d5aa7f 100644 --- a/examples/nxflat/tests/task/task.c +++ b/examples/nxflat/tests/task/task.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nxflat/tests/task/task.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nxhello/CMakeLists.txt b/examples/nxhello/CMakeLists.txt index 9d7732c0303..96330188f5a 100644 --- a/examples/nxhello/CMakeLists.txt +++ b/examples/nxhello/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/nxhello/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/nxhello/Make.defs b/examples/nxhello/Make.defs index c0081cd1130..c64c988f5eb 100644 --- a/examples/nxhello/Make.defs +++ b/examples/nxhello/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/nxhello/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/nxhello/Makefile b/examples/nxhello/Makefile index 5e0c54de897..4fd312e8950 100644 --- a/examples/nxhello/Makefile +++ b/examples/nxhello/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/nxhello/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/nxhello/nxhello.h b/examples/nxhello/nxhello.h index 87e2ee4669b..9fae5855a67 100644 --- a/examples/nxhello/nxhello.h +++ b/examples/nxhello/nxhello.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nxhello/nxhello.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nxhello/nxhello_bkgd.c b/examples/nxhello/nxhello_bkgd.c index 3c224a39839..ee73f2614a0 100644 --- a/examples/nxhello/nxhello_bkgd.c +++ b/examples/nxhello/nxhello_bkgd.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nxhello/nxhello_bkgd.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nxhello/nxhello_listener.c b/examples/nxhello/nxhello_listener.c index 73793652375..65995f476f5 100644 --- a/examples/nxhello/nxhello_listener.c +++ b/examples/nxhello/nxhello_listener.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nxhello/nxhello_listener.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nxhello/nxhello_main.c b/examples/nxhello/nxhello_main.c index 097134ebe68..13e2b8a622e 100644 --- a/examples/nxhello/nxhello_main.c +++ b/examples/nxhello/nxhello_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nxhello/nxhello_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nximage/CMakeLists.txt b/examples/nximage/CMakeLists.txt index f8aa815ace4..0fa9b0adcc4 100644 --- a/examples/nximage/CMakeLists.txt +++ b/examples/nximage/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/nximage/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/nximage/Make.defs b/examples/nximage/Make.defs index dbdbd4b182c..5fdc157938f 100644 --- a/examples/nximage/Make.defs +++ b/examples/nximage/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/nximage/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/nximage/Makefile b/examples/nximage/Makefile index 1e11d344b13..b4ed626a34f 100644 --- a/examples/nximage/Makefile +++ b/examples/nximage/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/nximage/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/nximage/nximage.h b/examples/nximage/nximage.h index a9fb4724d04..12e79e0e50d 100644 --- a/examples/nximage/nximage.h +++ b/examples/nximage/nximage.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nximage/nximage.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nximage/nximage_bitmap.c b/examples/nximage/nximage_bitmap.c index 16b339feabd..ee7444a14b8 100644 --- a/examples/nximage/nximage_bitmap.c +++ b/examples/nximage/nximage_bitmap.c @@ -1,6 +1,8 @@ /******************************************************************************************** * apps/examples/nximage/nximage_bitmap.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nximage/nximage_bkgd.c b/examples/nximage/nximage_bkgd.c index 953d3f03335..36ac04eda64 100644 --- a/examples/nximage/nximage_bkgd.c +++ b/examples/nximage/nximage_bkgd.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nximage/nximage_bkgd.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nximage/nximage_listener.c b/examples/nximage/nximage_listener.c index f92f10b873d..cc0353ee031 100644 --- a/examples/nximage/nximage_listener.c +++ b/examples/nximage/nximage_listener.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nximage/nximage_listener.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nximage/nximage_main.c b/examples/nximage/nximage_main.c index 96a85b63f9b..4598ae4f648 100644 --- a/examples/nximage/nximage_main.c +++ b/examples/nximage/nximage_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nximage/nximage_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nxlines/CMakeLists.txt b/examples/nxlines/CMakeLists.txt index a563be7deb5..4ae6fc2132a 100644 --- a/examples/nxlines/CMakeLists.txt +++ b/examples/nxlines/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/nxlines/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/nxlines/Make.defs b/examples/nxlines/Make.defs index 9f3337688da..bfdf332329a 100644 --- a/examples/nxlines/Make.defs +++ b/examples/nxlines/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/nxlines/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/nxlines/Makefile b/examples/nxlines/Makefile index 14ae58a698d..836ffde06da 100644 --- a/examples/nxlines/Makefile +++ b/examples/nxlines/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/nxlines/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/nxlines/nxlines.h b/examples/nxlines/nxlines.h index 5e92ad312a5..98993c25ad6 100644 --- a/examples/nxlines/nxlines.h +++ b/examples/nxlines/nxlines.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nxlines/nxlines.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nxlines/nxlines_bkgd.c b/examples/nxlines/nxlines_bkgd.c index 03be1d0d758..22b068c645b 100644 --- a/examples/nxlines/nxlines_bkgd.c +++ b/examples/nxlines/nxlines_bkgd.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nxlines/nxlines_bkgd.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nxlines/nxlines_listener.c b/examples/nxlines/nxlines_listener.c index 452e2b65898..ab1c2530667 100644 --- a/examples/nxlines/nxlines_listener.c +++ b/examples/nxlines/nxlines_listener.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nxlines/nxlines_listener.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nxlines/nxlines_main.c b/examples/nxlines/nxlines_main.c index 8b6753b40a7..7b3d4ba0de2 100644 --- a/examples/nxlines/nxlines_main.c +++ b/examples/nxlines/nxlines_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nxlines/nxlines_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nxscope/CMakeLists.txt b/examples/nxscope/CMakeLists.txt index 56e19d76c3c..09f9b8e168b 100644 --- a/examples/nxscope/CMakeLists.txt +++ b/examples/nxscope/CMakeLists.txt @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/nxscope/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/nxscope/Make.defs b/examples/nxscope/Make.defs index 738d2209bb1..0e16898752c 100644 --- a/examples/nxscope/Make.defs +++ b/examples/nxscope/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/nxscope/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/nxscope/Makefile b/examples/nxscope/Makefile index 285b4da49fd..d9f4029a121 100644 --- a/examples/nxscope/Makefile +++ b/examples/nxscope/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/nxscope/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/nxscope/nxscope_main.c b/examples/nxscope/nxscope_main.c index bfdfadcbcf9..b4bf72665cc 100644 --- a/examples/nxscope/nxscope_main.c +++ b/examples/nxscope/nxscope_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nxscope/nxscope_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nxterm/CMakeLists.txt b/examples/nxterm/CMakeLists.txt index aa413133c02..816d90c365a 100644 --- a/examples/nxterm/CMakeLists.txt +++ b/examples/nxterm/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/nxterm/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/nxterm/Make.defs b/examples/nxterm/Make.defs index 9392c310ed8..096848dece7 100644 --- a/examples/nxterm/Make.defs +++ b/examples/nxterm/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/nxterm/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/nxterm/Makefile b/examples/nxterm/Makefile index b2911fe8d05..58b7037ad8a 100644 --- a/examples/nxterm/Makefile +++ b/examples/nxterm/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/nxterm/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/nxterm/nxterm_internal.h b/examples/nxterm/nxterm_internal.h index 7a959950ad6..d72aa0159a1 100644 --- a/examples/nxterm/nxterm_internal.h +++ b/examples/nxterm/nxterm_internal.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nxterm/nxterm_internal.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nxterm/nxterm_listener.c b/examples/nxterm/nxterm_listener.c index de20445caab..b01328ab2b8 100644 --- a/examples/nxterm/nxterm_listener.c +++ b/examples/nxterm/nxterm_listener.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nxterm/nxterm_listener.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nxterm/nxterm_main.c b/examples/nxterm/nxterm_main.c index b3c736ea8bb..c1a912a0842 100644 --- a/examples/nxterm/nxterm_main.c +++ b/examples/nxterm/nxterm_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nxterm/nxterm_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nxterm/nxterm_toolbar.c b/examples/nxterm/nxterm_toolbar.c index 63076ac5b94..24bcee46369 100644 --- a/examples/nxterm/nxterm_toolbar.c +++ b/examples/nxterm/nxterm_toolbar.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nxterm/nxterm_toolbar.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nxterm/nxterm_wndo.c b/examples/nxterm/nxterm_wndo.c index 227f4db9758..2bba6016aae 100644 --- a/examples/nxterm/nxterm_wndo.c +++ b/examples/nxterm/nxterm_wndo.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nxterm/nxterm_wndo.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nxtext/CMakeLists.txt b/examples/nxtext/CMakeLists.txt index 42337d504b7..7bfa5f756a3 100644 --- a/examples/nxtext/CMakeLists.txt +++ b/examples/nxtext/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/nxtext/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/nxtext/Make.defs b/examples/nxtext/Make.defs index 028b1f756a9..003fb52db5c 100644 --- a/examples/nxtext/Make.defs +++ b/examples/nxtext/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/nxtext/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/nxtext/Makefile b/examples/nxtext/Makefile index 420746da008..dafa6386e74 100644 --- a/examples/nxtext/Makefile +++ b/examples/nxtext/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/nxtext/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/nxtext/nxtext_bkgd.c b/examples/nxtext/nxtext_bkgd.c index 98c761bbbe0..1e0d4a18d83 100644 --- a/examples/nxtext/nxtext_bkgd.c +++ b/examples/nxtext/nxtext_bkgd.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nxtext/nxtext_bkgd.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nxtext/nxtext_internal.h b/examples/nxtext/nxtext_internal.h index 45652a852b9..376fe5d0740 100644 --- a/examples/nxtext/nxtext_internal.h +++ b/examples/nxtext/nxtext_internal.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nxtext/nxtext_internal.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nxtext/nxtext_listener.c b/examples/nxtext/nxtext_listener.c index 7189d684a4a..ddb9069ef7d 100644 --- a/examples/nxtext/nxtext_listener.c +++ b/examples/nxtext/nxtext_listener.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nxtext/nxtext_listener.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nxtext/nxtext_main.c b/examples/nxtext/nxtext_main.c index 3814c8dd9a4..1ad8bb9b379 100644 --- a/examples/nxtext/nxtext_main.c +++ b/examples/nxtext/nxtext_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nxtext/nxtext_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nxtext/nxtext_popup.c b/examples/nxtext/nxtext_popup.c index a4087779fd6..4ca10e1b70b 100644 --- a/examples/nxtext/nxtext_popup.c +++ b/examples/nxtext/nxtext_popup.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nxtext/nxtext_popup.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/nxtext/nxtext_putc.c b/examples/nxtext/nxtext_putc.c index 93c8ca402be..47fdd9ba518 100644 --- a/examples/nxtext/nxtext_putc.c +++ b/examples/nxtext/nxtext_putc.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nxtext/nxtext_putc.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/obd2/CMakeLists.txt b/examples/obd2/CMakeLists.txt index 09993acb5cf..a2d8d9fd774 100644 --- a/examples/obd2/CMakeLists.txt +++ b/examples/obd2/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/obd2/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/obd2/Make.defs b/examples/obd2/Make.defs index 49e7cdb7bd7..61ccfd4a37e 100644 --- a/examples/obd2/Make.defs +++ b/examples/obd2/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/obd2/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/obd2/Makefile b/examples/obd2/Makefile index 73be458549d..d3d64bfec2d 100644 --- a/examples/obd2/Makefile +++ b/examples/obd2/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/obd2/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/obd2/obd2_main.c b/examples/obd2/obd2_main.c index eeadebe0db9..20efcdb7d61 100644 --- a/examples/obd2/obd2_main.c +++ b/examples/obd2/obd2_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/obd2/obd2_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/oneshot/CMakeLists.txt b/examples/oneshot/CMakeLists.txt index d8d3c0bb307..d38a0e419e7 100644 --- a/examples/oneshot/CMakeLists.txt +++ b/examples/oneshot/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/oneshot/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/oneshot/Make.defs b/examples/oneshot/Make.defs index d194c2e918b..d3a12049c7e 100644 --- a/examples/oneshot/Make.defs +++ b/examples/oneshot/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/oneshot/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/oneshot/Makefile b/examples/oneshot/Makefile index 1ddce30496b..5e498965775 100644 --- a/examples/oneshot/Makefile +++ b/examples/oneshot/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/oneshot/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/oneshot/oneshot_main.c b/examples/oneshot/oneshot_main.c index c7c505da34b..50760e360d6 100644 --- a/examples/oneshot/oneshot_main.c +++ b/examples/oneshot/oneshot_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/oneshot/oneshot_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/opencyphal/CMakeLists.txt b/examples/opencyphal/CMakeLists.txt index f68b268eeb1..386a094b80f 100644 --- a/examples/opencyphal/CMakeLists.txt +++ b/examples/opencyphal/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/opencyphal/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/opencyphal/Make.defs b/examples/opencyphal/Make.defs index 60b182fab1b..432f44b2238 100644 --- a/examples/opencyphal/Make.defs +++ b/examples/opencyphal/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/opencyphal/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/opencyphal/Makefile b/examples/opencyphal/Makefile index 2004e1469bb..6168f583c98 100644 --- a/examples/opencyphal/Makefile +++ b/examples/opencyphal/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/opencyphal/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/opencyphal/canard_main.c b/examples/opencyphal/canard_main.c index 4d0cce80185..4c6f6dd308c 100644 --- a/examples/opencyphal/canard_main.c +++ b/examples/opencyphal/canard_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/opencyphal/canard_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/opencyphal/socketcan.c b/examples/opencyphal/socketcan.c index ac6f58a016f..37809833725 100644 --- a/examples/opencyphal/socketcan.c +++ b/examples/opencyphal/socketcan.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/opencyphal/socketcan.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/opencyphal/socketcan.h b/examples/opencyphal/socketcan.h index 5df786c0159..8876813c712 100644 --- a/examples/opencyphal/socketcan.h +++ b/examples/opencyphal/socketcan.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/opencyphal/socketcan.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/pca9635/CMakeLists.txt b/examples/pca9635/CMakeLists.txt index 016409d28df..459fe370a22 100644 --- a/examples/pca9635/CMakeLists.txt +++ b/examples/pca9635/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/pca9635/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/pca9635/Make.defs b/examples/pca9635/Make.defs index 5093e997cba..c9909027ec5 100644 --- a/examples/pca9635/Make.defs +++ b/examples/pca9635/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/pca9635/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/pca9635/Makefile b/examples/pca9635/Makefile index 18f0de29863..1b399bde31f 100644 --- a/examples/pca9635/Makefile +++ b/examples/pca9635/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/pca9635/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/pca9635/pca9635_main.c b/examples/pca9635/pca9635_main.c index 2af21999f63..28ad428f148 100644 --- a/examples/pca9635/pca9635_main.c +++ b/examples/pca9635/pca9635_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/pca9635/pca9635_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/pdcurses/CMakeLists.txt b/examples/pdcurses/CMakeLists.txt index cfb74067cf6..462dad6b1a9 100644 --- a/examples/pdcurses/CMakeLists.txt +++ b/examples/pdcurses/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/pdcurses/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/pdcurses/Make.defs b/examples/pdcurses/Make.defs index bbd979834a1..119f3968367 100644 --- a/examples/pdcurses/Make.defs +++ b/examples/pdcurses/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/pdcurses/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/pdcurses/Makefile b/examples/pdcurses/Makefile index 74348515271..0ebf82c3e4e 100644 --- a/examples/pdcurses/Makefile +++ b/examples/pdcurses/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/pdcurses/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/pdcurses/charset_main.c b/examples/pdcurses/charset_main.c index 46a4e8eb1b9..a7baceeaf61 100644 --- a/examples/pdcurses/charset_main.c +++ b/examples/pdcurses/charset_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/pdcurses/charset_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/pdcurses/firework_main.c b/examples/pdcurses/firework_main.c index b7c17992ec8..ec8034264b4 100644 --- a/examples/pdcurses/firework_main.c +++ b/examples/pdcurses/firework_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/pdcurses/firework_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/pdcurses/newdemo_main.c b/examples/pdcurses/newdemo_main.c index b6583a9b379..aea60acf5d2 100644 --- a/examples/pdcurses/newdemo_main.c +++ b/examples/pdcurses/newdemo_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/pdcurses/newdemo_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/pdcurses/panel_main.c b/examples/pdcurses/panel_main.c index 8c80959021c..e9b252c175d 100644 --- a/examples/pdcurses/panel_main.c +++ b/examples/pdcurses/panel_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/pdcurses/panel_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/pdcurses/rain_main.c b/examples/pdcurses/rain_main.c index 703afc2943d..dfd3ec776be 100644 --- a/examples/pdcurses/rain_main.c +++ b/examples/pdcurses/rain_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/pdcurses/rain_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/pdcurses/testcurs_main.c b/examples/pdcurses/testcurs_main.c index abec88a9d9d..759cee9e68c 100644 --- a/examples/pdcurses/testcurs_main.c +++ b/examples/pdcurses/testcurs_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/pdcurses/testcurs_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/pdcurses/tui.c b/examples/pdcurses/tui.c index ae08eabf7b5..70084a6ea17 100644 --- a/examples/pdcurses/tui.c +++ b/examples/pdcurses/tui.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/pdcurses/tui.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/pdcurses/tui.h b/examples/pdcurses/tui.h index c15db56101e..e989562d91b 100644 --- a/examples/pdcurses/tui.h +++ b/examples/pdcurses/tui.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/pdcurses/tui.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/pdcurses/tui_main.c b/examples/pdcurses/tui_main.c index c9a8c1b2f19..0a9ef0e3d57 100644 --- a/examples/pdcurses/tui_main.c +++ b/examples/pdcurses/tui_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/pdcurses/tui_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/pdcurses/worm_main.c b/examples/pdcurses/worm_main.c index 84bba04d5e3..7e3d0c488e0 100644 --- a/examples/pdcurses/worm_main.c +++ b/examples/pdcurses/worm_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/pdcurses/rain_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/pdcurses/xmas_main.c b/examples/pdcurses/xmas_main.c index 3168b509e20..83542d5921c 100644 --- a/examples/pdcurses/xmas_main.c +++ b/examples/pdcurses/xmas_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/pdcurses/tui.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/pf_ieee802154/CMakeLists.txt b/examples/pf_ieee802154/CMakeLists.txt index 376a55cd44f..e02fe47ceb3 100644 --- a/examples/pf_ieee802154/CMakeLists.txt +++ b/examples/pf_ieee802154/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/pf_ieee802154/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/pf_ieee802154/Make.defs b/examples/pf_ieee802154/Make.defs index 09c9f0bef00..db390a0a5e3 100644 --- a/examples/pf_ieee802154/Make.defs +++ b/examples/pf_ieee802154/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/pf_ieee802154/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/pf_ieee802154/Makefile b/examples/pf_ieee802154/Makefile index 1c8929aa547..fab3910a96f 100644 --- a/examples/pf_ieee802154/Makefile +++ b/examples/pf_ieee802154/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/pf_ieee802154/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/pf_ieee802154/pf_client.c b/examples/pf_ieee802154/pf_client.c index b8cbbae9215..3c409229074 100644 --- a/examples/pf_ieee802154/pf_client.c +++ b/examples/pf_ieee802154/pf_client.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/pf_ieee802154/pf_client.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/pf_ieee802154/pf_cmdline.c b/examples/pf_ieee802154/pf_cmdline.c index 1fa694948b0..6dfb6890d94 100644 --- a/examples/pf_ieee802154/pf_cmdline.c +++ b/examples/pf_ieee802154/pf_cmdline.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/pf_ieee802154/pf_cmdline.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/pf_ieee802154/pf_server.c b/examples/pf_ieee802154/pf_server.c index 5996012a734..8b0ba87f5d6 100644 --- a/examples/pf_ieee802154/pf_server.c +++ b/examples/pf_ieee802154/pf_server.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/pf_ieee802154/pf_server.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/pf_ieee802154/pfieee802154.h b/examples/pf_ieee802154/pfieee802154.h index 86baf2c73f1..ee7a88b5c4a 100644 --- a/examples/pf_ieee802154/pfieee802154.h +++ b/examples/pf_ieee802154/pfieee802154.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/pf_ieee802154/pfieee802154.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/pipe/CMakeLists.txt b/examples/pipe/CMakeLists.txt index 9a63cbe32cb..505689e3eb5 100644 --- a/examples/pipe/CMakeLists.txt +++ b/examples/pipe/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/pipe/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/pipe/Make.defs b/examples/pipe/Make.defs index 08e63cfefdc..cc32907bd5e 100644 --- a/examples/pipe/Make.defs +++ b/examples/pipe/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/pipe/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/pipe/Makefile b/examples/pipe/Makefile index 5358908fde3..cac461a6966 100644 --- a/examples/pipe/Makefile +++ b/examples/pipe/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/pipe/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/pipe/interlock_test.c b/examples/pipe/interlock_test.c index f666fbafc75..7d614e78af2 100644 --- a/examples/pipe/interlock_test.c +++ b/examples/pipe/interlock_test.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/pipe/interlock_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/pipe/pipe.h b/examples/pipe/pipe.h index 14931607ac8..9dc14b4c16d 100644 --- a/examples/pipe/pipe.h +++ b/examples/pipe/pipe.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/pipe/pipe.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/pipe/pipe_main.c b/examples/pipe/pipe_main.c index d34845ce794..c34f281f583 100644 --- a/examples/pipe/pipe_main.c +++ b/examples/pipe/pipe_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/pipe/pipe_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/pipe/redirect_test.c b/examples/pipe/redirect_test.c index 9f9a07dca9e..83892958881 100644 --- a/examples/pipe/redirect_test.c +++ b/examples/pipe/redirect_test.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/pipe/redirect_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/pipe/transfer_test.c b/examples/pipe/transfer_test.c index 2294558da93..5c929ca5145 100644 --- a/examples/pipe/transfer_test.c +++ b/examples/pipe/transfer_test.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/pipe/transfer_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/poll/CMakeLists.txt b/examples/poll/CMakeLists.txt index 9480486c4f1..6c66a9fe069 100644 --- a/examples/poll/CMakeLists.txt +++ b/examples/poll/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/poll/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/poll/Make.defs b/examples/poll/Make.defs index abf4f758510..c14ebf06fe7 100644 --- a/examples/poll/Make.defs +++ b/examples/poll/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/poll/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/poll/Makefile b/examples/poll/Makefile index 0d13c436d4d..48c9693c00e 100644 --- a/examples/poll/Makefile +++ b/examples/poll/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/poll/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/poll/Makefile.host b/examples/poll/Makefile.host index 51ddc474532..36a34347b8a 100644 --- a/examples/poll/Makefile.host +++ b/examples/poll/Makefile.host @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/poll/Makefile.host # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/poll/host.c b/examples/poll/host.c index e3dbbc2ede2..740bccb2200 100644 --- a/examples/poll/host.c +++ b/examples/poll/host.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/poll/host.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/poll/net_listener.c b/examples/poll/net_listener.c index 3f04ea771a7..9db855477f6 100644 --- a/examples/poll/net_listener.c +++ b/examples/poll/net_listener.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/poll/net_listener.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/poll/net_reader.c b/examples/poll/net_reader.c index c60de47004f..5e22822e38d 100644 --- a/examples/poll/net_reader.c +++ b/examples/poll/net_reader.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/poll/net_reader.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/poll/poll_internal.h b/examples/poll/poll_internal.h index 72579528dee..ba3a03fe6c9 100644 --- a/examples/poll/poll_internal.h +++ b/examples/poll/poll_internal.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/poll/poll_internal.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/poll/poll_listener.c b/examples/poll/poll_listener.c index 1905a5e8230..5864c4222c0 100644 --- a/examples/poll/poll_listener.c +++ b/examples/poll/poll_listener.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/poll/poll_listener.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/poll/poll_main.c b/examples/poll/poll_main.c index 888922c32ee..81791683967 100644 --- a/examples/poll/poll_main.c +++ b/examples/poll/poll_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/poll/poll_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/poll/select_listener.c b/examples/poll/select_listener.c index 50697ec143a..69cfe92d619 100644 --- a/examples/poll/select_listener.c +++ b/examples/poll/select_listener.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/poll/select_listener.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/popen/CMakeLists.txt b/examples/popen/CMakeLists.txt index e28072768ff..b256ae71713 100644 --- a/examples/popen/CMakeLists.txt +++ b/examples/popen/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/popen/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/popen/Make.defs b/examples/popen/Make.defs index a154c93e3fe..a91ae672cfa 100644 --- a/examples/popen/Make.defs +++ b/examples/popen/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/popen/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/popen/Makefile b/examples/popen/Makefile index a7a7cd89a34..73de35df649 100644 --- a/examples/popen/Makefile +++ b/examples/popen/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/popen/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/popen/popen_main.c b/examples/popen/popen_main.c index d928629e1fe..c830085e54c 100644 --- a/examples/popen/popen_main.c +++ b/examples/popen/popen_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/popen/popen_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/posix_spawn/CMakeLists.txt b/examples/posix_spawn/CMakeLists.txt index f9391d84e6f..453224edde6 100644 --- a/examples/posix_spawn/CMakeLists.txt +++ b/examples/posix_spawn/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/posix_spawn/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/posix_spawn/Make.defs b/examples/posix_spawn/Make.defs index e3f7eb9f67a..de98e6c38d7 100644 --- a/examples/posix_spawn/Make.defs +++ b/examples/posix_spawn/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/posix_spawn/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/posix_spawn/Makefile b/examples/posix_spawn/Makefile index 312d0437888..08e87cdf7f3 100644 --- a/examples/posix_spawn/Makefile +++ b/examples/posix_spawn/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/posix_spawn/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/posix_spawn/filesystem/Makefile b/examples/posix_spawn/filesystem/Makefile index 45008e5e1b5..1632627addb 100644 --- a/examples/posix_spawn/filesystem/Makefile +++ b/examples/posix_spawn/filesystem/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/posix_spawn/filesystem/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/posix_spawn/filesystem/hello/Makefile b/examples/posix_spawn/filesystem/hello/Makefile index f98419b377e..c4f0056ab5d 100644 --- a/examples/posix_spawn/filesystem/hello/Makefile +++ b/examples/posix_spawn/filesystem/hello/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/posix_spawn/filesystem/hello/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/posix_spawn/filesystem/hello/hello.c b/examples/posix_spawn/filesystem/hello/hello.c index 5269d03594c..e460fa5575c 100644 --- a/examples/posix_spawn/filesystem/hello/hello.c +++ b/examples/posix_spawn/filesystem/hello/hello.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/posix_spawn/filesystem/hello/hello.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/posix_spawn/filesystem/redirect/Makefile b/examples/posix_spawn/filesystem/redirect/Makefile index 38bf2c17b81..a570c24a058 100644 --- a/examples/posix_spawn/filesystem/redirect/Makefile +++ b/examples/posix_spawn/filesystem/redirect/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/posix_spawn/filesystem/redirect/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/posix_spawn/filesystem/redirect/redirect.c b/examples/posix_spawn/filesystem/redirect/redirect.c index fd34d18f6d2..f8ecd48a8af 100644 --- a/examples/posix_spawn/filesystem/redirect/redirect.c +++ b/examples/posix_spawn/filesystem/redirect/redirect.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/posix_spawn/filesystem/redirect/redirect.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/posix_spawn/spawn_main.c b/examples/posix_spawn/spawn_main.c index 4a62383d2f8..100030b6c7d 100644 --- a/examples/posix_spawn/spawn_main.c +++ b/examples/posix_spawn/spawn_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/posix_spawn/spawn_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/powerled/CMakeLists.txt b/examples/powerled/CMakeLists.txt index b38e0f71fd1..700c2daa5f7 100644 --- a/examples/powerled/CMakeLists.txt +++ b/examples/powerled/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/powerled/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/powerled/Make.defs b/examples/powerled/Make.defs index 7015da2557e..a2e1b26bf47 100644 --- a/examples/powerled/Make.defs +++ b/examples/powerled/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/powerled/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/powerled/Makefile b/examples/powerled/Makefile index ca02d8011d1..7a489c932ae 100644 --- a/examples/powerled/Makefile +++ b/examples/powerled/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/powerled/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/powerled/powerled_main.c b/examples/powerled/powerled_main.c index 1d2e2a6830d..4df021b4b1c 100644 --- a/examples/powerled/powerled_main.c +++ b/examples/powerled/powerled_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/powerled/powerled_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/powermonitor/CMakeLists.txt b/examples/powermonitor/CMakeLists.txt index 107906b6fe0..522c2e27b98 100644 --- a/examples/powermonitor/CMakeLists.txt +++ b/examples/powermonitor/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/powermonitor/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/powermonitor/Make.defs b/examples/powermonitor/Make.defs index d383969eda4..9a0248feaba 100644 --- a/examples/powermonitor/Make.defs +++ b/examples/powermonitor/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/powermonitor/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/powermonitor/Makefile b/examples/powermonitor/Makefile index 2de62f9ab4a..05f669075f6 100644 --- a/examples/powermonitor/Makefile +++ b/examples/powermonitor/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/powermonitor/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/powermonitor/powermonitor_main.c b/examples/powermonitor/powermonitor_main.c index e455420402d..3a335dd66a6 100644 --- a/examples/powermonitor/powermonitor_main.c +++ b/examples/powermonitor/powermonitor_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/powermonitor/powermonitor_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/pppd/CMakeLists.txt b/examples/pppd/CMakeLists.txt index 5921a5a1c33..7b07f05c2df 100644 --- a/examples/pppd/CMakeLists.txt +++ b/examples/pppd/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/pppd/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/pppd/Make.defs b/examples/pppd/Make.defs index 0adf2bf7c88..9497a83d798 100644 --- a/examples/pppd/Make.defs +++ b/examples/pppd/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/pppd/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/pppd/Makefile b/examples/pppd/Makefile index 3f341d0349a..a1c4c7e1ef5 100644 --- a/examples/pppd/Makefile +++ b/examples/pppd/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/pppd/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/pppd/pppd_main.c b/examples/pppd/pppd_main.c index ce80ae90bbb..78af8d1fac6 100644 --- a/examples/pppd/pppd_main.c +++ b/examples/pppd/pppd_main.c @@ -1,8 +1,9 @@ /**************************************************************************** * apps/examples/pppd/pppd_main.c * - * Copyright (C) 2015 Brennan Ashton. All rights reserved. - * Author: Brennan Ashton + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2015 Brennan Ashton. All rights reserved. + * SPDX-FileContributor: Brennan Ashton * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/examples/pty_test/CMakeLists.txt b/examples/pty_test/CMakeLists.txt index 746f40a6ed4..0504a518de6 100644 --- a/examples/pty_test/CMakeLists.txt +++ b/examples/pty_test/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/pty_test/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/pty_test/Make.defs b/examples/pty_test/Make.defs index 870fc757c31..87017568871 100644 --- a/examples/pty_test/Make.defs +++ b/examples/pty_test/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/pty_test/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/pty_test/Makefile b/examples/pty_test/Makefile index 1573c530f63..0fe41e9c789 100644 --- a/examples/pty_test/Makefile +++ b/examples/pty_test/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/pty_test/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/pty_test/pty_test.c b/examples/pty_test/pty_test.c index 731a9ff476a..25c4c9fe018 100644 --- a/examples/pty_test/pty_test.c +++ b/examples/pty_test/pty_test.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/pty_test/pty_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/pwfb/CMakeLists.txt b/examples/pwfb/CMakeLists.txt index 762e1ec88a4..584321e0fe1 100644 --- a/examples/pwfb/CMakeLists.txt +++ b/examples/pwfb/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/pwfb/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/pwfb/Make.defs b/examples/pwfb/Make.defs index 1b7e4a0a199..5c25ee26dc7 100644 --- a/examples/pwfb/Make.defs +++ b/examples/pwfb/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/pwfb/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/pwfb/Makefile b/examples/pwfb/Makefile index 51bc62fb986..8403725b613 100644 --- a/examples/pwfb/Makefile +++ b/examples/pwfb/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/pwfb/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/pwfb/pwfb_events.c b/examples/pwfb/pwfb_events.c index 6f4441ccf03..142985ab717 100644 --- a/examples/pwfb/pwfb_events.c +++ b/examples/pwfb/pwfb_events.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/pwfb/pwfb_events.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/pwfb/pwfb_internal.h b/examples/pwfb/pwfb_internal.h index 8882009e538..f6742736e6b 100644 --- a/examples/pwfb/pwfb_internal.h +++ b/examples/pwfb/pwfb_internal.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/pwfb/pwfb_internal.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/pwfb/pwfb_main.c b/examples/pwfb/pwfb_main.c index 1683b600e1f..6a7bfc438db 100644 --- a/examples/pwfb/pwfb_main.c +++ b/examples/pwfb/pwfb_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/pwfb/pwfb_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/pwfb/pwfb_motion.c b/examples/pwfb/pwfb_motion.c index a44cae4ffc2..37ce79d86ca 100644 --- a/examples/pwfb/pwfb_motion.c +++ b/examples/pwfb/pwfb_motion.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/pwfb/pwfb_motion.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/pwlines/CMakeLists.txt b/examples/pwlines/CMakeLists.txt index 01b4c18a04e..9cbe1d2c39c 100644 --- a/examples/pwlines/CMakeLists.txt +++ b/examples/pwlines/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/pwlines/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/pwlines/Make.defs b/examples/pwlines/Make.defs index 3e6a64e9367..0454dc2ef71 100644 --- a/examples/pwlines/Make.defs +++ b/examples/pwlines/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/pwlines/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/pwlines/Makefile b/examples/pwlines/Makefile index 342d9f2ca3b..fc85c7b861e 100644 --- a/examples/pwlines/Makefile +++ b/examples/pwlines/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/pwlines/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/pwlines/pwlines_events.c b/examples/pwlines/pwlines_events.c index 2441ae0918a..73a2b80a617 100644 --- a/examples/pwlines/pwlines_events.c +++ b/examples/pwlines/pwlines_events.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/pwlines/pwlines_events.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/pwlines/pwlines_internal.h b/examples/pwlines/pwlines_internal.h index 91f188dcd0c..9b830cabe01 100644 --- a/examples/pwlines/pwlines_internal.h +++ b/examples/pwlines/pwlines_internal.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/pwlines/pwlines_internal.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/pwlines/pwlines_main.c b/examples/pwlines/pwlines_main.c index 894fd5a3c84..dc776d74436 100644 --- a/examples/pwlines/pwlines_main.c +++ b/examples/pwlines/pwlines_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/pwlines/pwlines_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/pwlines/pwlines_motion.c b/examples/pwlines/pwlines_motion.c index cf33a6363d4..a812d4d7352 100644 --- a/examples/pwlines/pwlines_motion.c +++ b/examples/pwlines/pwlines_motion.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/pwlines/pwlines_motion.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/pwlines/pwlines_update.c b/examples/pwlines/pwlines_update.c index 54f7eefdf43..2dbe4e39ef0 100644 --- a/examples/pwlines/pwlines_update.c +++ b/examples/pwlines/pwlines_update.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/pwlines/pwlines_update.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/pwm/CMakeLists.txt b/examples/pwm/CMakeLists.txt index 8758605fa0c..2d39c573a40 100644 --- a/examples/pwm/CMakeLists.txt +++ b/examples/pwm/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/pwm/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/pwm/Make.defs b/examples/pwm/Make.defs index 065f656364f..999dcb59686 100644 --- a/examples/pwm/Make.defs +++ b/examples/pwm/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/pwm/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/pwm/Makefile b/examples/pwm/Makefile index d2e44c072b4..785182d356c 100644 --- a/examples/pwm/Makefile +++ b/examples/pwm/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/pwm/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/pwm/pwm.h b/examples/pwm/pwm.h index 133b1e5d5ee..e0447b9b374 100644 --- a/examples/pwm/pwm.h +++ b/examples/pwm/pwm.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/pwm/pwm.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/pwm/pwm_main.c b/examples/pwm/pwm_main.c index c5d4424a899..7a1a83c1610 100644 --- a/examples/pwm/pwm_main.c +++ b/examples/pwm/pwm_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/pwm/pwm_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/qencoder/CMakeLists.txt b/examples/qencoder/CMakeLists.txt index 797f6b832cb..308f9e4ad44 100644 --- a/examples/qencoder/CMakeLists.txt +++ b/examples/qencoder/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/qencoder/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/qencoder/Make.defs b/examples/qencoder/Make.defs index 0778b6aadd9..46a43c14d2e 100644 --- a/examples/qencoder/Make.defs +++ b/examples/qencoder/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/qencoder/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/qencoder/Makefile b/examples/qencoder/Makefile index fe6b71cf6b9..1e0866175da 100644 --- a/examples/qencoder/Makefile +++ b/examples/qencoder/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/qencoder/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/qencoder/qe.h b/examples/qencoder/qe.h index e233c8c4b76..2baa5de1e21 100644 --- a/examples/qencoder/qe.h +++ b/examples/qencoder/qe.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/qencoder/qe.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/qencoder/qe_main.c b/examples/qencoder/qe_main.c index be9a5a26a34..2614fe7fb5f 100644 --- a/examples/qencoder/qe_main.c +++ b/examples/qencoder/qe_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/qencoder/qe_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/random/CMakeLists.txt b/examples/random/CMakeLists.txt index 0f44dd7976b..e3385d489c4 100644 --- a/examples/random/CMakeLists.txt +++ b/examples/random/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/random/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/random/Make.defs b/examples/random/Make.defs index e761c29cef6..6771c5b6515 100644 --- a/examples/random/Make.defs +++ b/examples/random/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/random/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/random/Makefile b/examples/random/Makefile index b064f1fdfaf..ab02a154bce 100644 --- a/examples/random/Makefile +++ b/examples/random/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/random/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/random/random_main.c b/examples/random/random_main.c index e6a13b48758..2b1be28275c 100644 --- a/examples/random/random_main.c +++ b/examples/random/random_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/random/random_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/relays/CMakeLists.txt b/examples/relays/CMakeLists.txt index cc3c1ff26f3..cb1d9b72975 100644 --- a/examples/relays/CMakeLists.txt +++ b/examples/relays/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/relays/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/relays/Make.defs b/examples/relays/Make.defs index c762e8d7d1a..3a1d05f3e16 100644 --- a/examples/relays/Make.defs +++ b/examples/relays/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/relays/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/relays/Makefile b/examples/relays/Makefile index c1a1b3c9bfd..4390ceb5293 100644 --- a/examples/relays/Makefile +++ b/examples/relays/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/relays/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/relays/relays_main.c b/examples/relays/relays_main.c index 33b62dcce86..1d6695027e6 100644 --- a/examples/relays/relays_main.c +++ b/examples/relays/relays_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/relays/relays_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/rfid_readuid/CMakeLists.txt b/examples/rfid_readuid/CMakeLists.txt index d960590fd25..d655272edb5 100644 --- a/examples/rfid_readuid/CMakeLists.txt +++ b/examples/rfid_readuid/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/rfid_readuid/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/rfid_readuid/Make.defs b/examples/rfid_readuid/Make.defs index 3d61abc9123..ed720dbd509 100644 --- a/examples/rfid_readuid/Make.defs +++ b/examples/rfid_readuid/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/rfid_readuid/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/rfid_readuid/Makefile b/examples/rfid_readuid/Makefile index dd13c901e58..0a06297c5c0 100644 --- a/examples/rfid_readuid/Makefile +++ b/examples/rfid_readuid/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/rfid_readuid/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/rfid_readuid/rfid_readuid.c b/examples/rfid_readuid/rfid_readuid.c index 2f8049ca76f..d97c058daf2 100644 --- a/examples/rfid_readuid/rfid_readuid.c +++ b/examples/rfid_readuid/rfid_readuid.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/rfid_readuid/rfid_readuid.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/rgbled/CMakeLists.txt b/examples/rgbled/CMakeLists.txt index 29b1efbcade..edb6b62f22c 100644 --- a/examples/rgbled/CMakeLists.txt +++ b/examples/rgbled/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/rgbled/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/rgbled/Make.defs b/examples/rgbled/Make.defs index bea3eee00ad..e8c793757d0 100644 --- a/examples/rgbled/Make.defs +++ b/examples/rgbled/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/rgbled/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/rgbled/Makefile b/examples/rgbled/Makefile index 3611b032eaf..9f0511c6ab3 100644 --- a/examples/rgbled/Makefile +++ b/examples/rgbled/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/rgbled/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/rgbled/rgbled.c b/examples/rgbled/rgbled.c index 5521383e5d6..4dd9aa2ec67 100644 --- a/examples/rgbled/rgbled.c +++ b/examples/rgbled/rgbled.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/rgbled/rgbled.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/rmtchar/CMakeLists.txt b/examples/rmtchar/CMakeLists.txt index 0adae091397..0d03174f554 100644 --- a/examples/rmtchar/CMakeLists.txt +++ b/examples/rmtchar/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/rmtchar/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/rmtchar/Make.defs b/examples/rmtchar/Make.defs index e6550150c57..0b14b2487d1 100644 --- a/examples/rmtchar/Make.defs +++ b/examples/rmtchar/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/rmtchar/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/rmtchar/Makefile b/examples/rmtchar/Makefile index 342cb6ec465..2c6d454ddd9 100644 --- a/examples/rmtchar/Makefile +++ b/examples/rmtchar/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/rmtchar/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/rmtchar/rmtchar.h b/examples/rmtchar/rmtchar.h index 2d89479bfd2..832b80a4ca5 100644 --- a/examples/rmtchar/rmtchar.h +++ b/examples/rmtchar/rmtchar.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/rmtchar/rmtchar.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/rmtchar/rmtchar_common.c b/examples/rmtchar/rmtchar_common.c index f7d1a4d9d64..663f0abd5fd 100644 --- a/examples/rmtchar/rmtchar_common.c +++ b/examples/rmtchar/rmtchar_common.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/rmtchar/rmtchar_common.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/rmtchar/rmtchar_main.c b/examples/rmtchar/rmtchar_main.c index d57c815becb..dcf2c54f22f 100644 --- a/examples/rmtchar/rmtchar_main.c +++ b/examples/rmtchar/rmtchar_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/rmtchar/rmtchar_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/rmtchar/rmtchar_receiver.c b/examples/rmtchar/rmtchar_receiver.c index 1f1e16a5f52..b6d94800ed9 100644 --- a/examples/rmtchar/rmtchar_receiver.c +++ b/examples/rmtchar/rmtchar_receiver.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/rmtchar/rmtchar_receiver.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/rmtchar/rmtchar_transmitter.c b/examples/rmtchar/rmtchar_transmitter.c index 249f877aeda..8c0528e2a3b 100644 --- a/examples/rmtchar/rmtchar_transmitter.c +++ b/examples/rmtchar/rmtchar_transmitter.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/rmtchar/rmtchar_transmitter.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/romfs/CMakeLists.txt b/examples/romfs/CMakeLists.txt index 11e16fe042b..7bde993d9b1 100644 --- a/examples/romfs/CMakeLists.txt +++ b/examples/romfs/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/romfs/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/romfs/Make.defs b/examples/romfs/Make.defs index 8755a91f33b..9f06ff292e2 100644 --- a/examples/romfs/Make.defs +++ b/examples/romfs/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/romfs/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/romfs/Makefile b/examples/romfs/Makefile index 99c00bc4c31..ba19d237283 100644 --- a/examples/romfs/Makefile +++ b/examples/romfs/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/romfs/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/romfs/romfs_main.c b/examples/romfs/romfs_main.c index 4ffdefe3304..fa957bbd7fc 100644 --- a/examples/romfs/romfs_main.c +++ b/examples/romfs/romfs_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/romfs/romfs_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/rpmsgsocket/CMakeLists.txt b/examples/rpmsgsocket/CMakeLists.txt index 4654624c4a7..edb2dddc7f7 100644 --- a/examples/rpmsgsocket/CMakeLists.txt +++ b/examples/rpmsgsocket/CMakeLists.txt @@ -1,6 +1,8 @@ -# ############################################################################## +################################################################################ # apps/examples/rpmsgsocket/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this @@ -16,7 +18,7 @@ # License for the specific language governing permissions and limitations under # the License. # -# ############################################################################## +################################################################################ if(CONFIG_EXAMPLES_RPMSGSOCKET) nuttx_add_application( diff --git a/examples/rpmsgsocket/Make.defs b/examples/rpmsgsocket/Make.defs index 924623950b3..e7ac2932848 100644 --- a/examples/rpmsgsocket/Make.defs +++ b/examples/rpmsgsocket/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/rpmsgsocket/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/rpmsgsocket/Makefile b/examples/rpmsgsocket/Makefile index acfc183bec0..dffe32a44ff 100644 --- a/examples/rpmsgsocket/Makefile +++ b/examples/rpmsgsocket/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/rpmsgsocket/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/rpmsgsocket/rpsock_client.c b/examples/rpmsgsocket/rpsock_client.c index 335460b8395..447bf77735c 100644 --- a/examples/rpmsgsocket/rpsock_client.c +++ b/examples/rpmsgsocket/rpsock_client.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/rpmsgsocket/rpsock_client.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/rpmsgsocket/rpsock_server.c b/examples/rpmsgsocket/rpsock_server.c index 477239cd053..a0ba62b7126 100644 --- a/examples/rpmsgsocket/rpsock_server.c +++ b/examples/rpmsgsocket/rpsock_server.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/rpmsgsocket/rpsock_server.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/scd41/CMakeLists.txt b/examples/scd41/CMakeLists.txt index 885de570843..5f6d23f59c7 100644 --- a/examples/scd41/CMakeLists.txt +++ b/examples/scd41/CMakeLists.txt @@ -1,6 +1,8 @@ -# ############################################################################## +################################################################################ # apps/examples/scd41/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this @@ -16,7 +18,7 @@ # License for the specific language governing permissions and limitations under # the License. # -# ############################################################################## +################################################################################ if(CONFIG_EXAMPLES_SCD41) nuttx_add_application( diff --git a/examples/scd41/Make.defs b/examples/scd41/Make.defs index a6a5ff7b8d7..94c31ce0b68 100644 --- a/examples/scd41/Make.defs +++ b/examples/scd41/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/scd41/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/scd41/Makefile b/examples/scd41/Makefile index e08598e9ebb..9b255a86693 100644 --- a/examples/scd41/Makefile +++ b/examples/scd41/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/scd41/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/scd41/scd41_main.c b/examples/scd41/scd41_main.c index 433a2818fe4..b524ab55b12 100644 --- a/examples/scd41/scd41_main.c +++ b/examples/scd41/scd41_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/scd41/scd41_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/sendmail/CMakeLists.txt b/examples/sendmail/CMakeLists.txt index 50dde6398c3..04f7f44454b 100644 --- a/examples/sendmail/CMakeLists.txt +++ b/examples/sendmail/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/sendmail/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/sendmail/Make.defs b/examples/sendmail/Make.defs index 32866071234..4d6e9b6e0e6 100644 --- a/examples/sendmail/Make.defs +++ b/examples/sendmail/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/sendmail/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/sendmail/Makefile b/examples/sendmail/Makefile index 61191601d81..9013d24ead9 100644 --- a/examples/sendmail/Makefile +++ b/examples/sendmail/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/sendmail/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/sendmail/sendmail_main.c b/examples/sendmail/sendmail_main.c index 5cd868777e7..7a0abdf1af0 100644 --- a/examples/sendmail/sendmail_main.c +++ b/examples/sendmail/sendmail_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/sendmail/sendmail_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/sensor_fusion/Make.defs b/examples/sensor_fusion/Make.defs index f7499a972b1..82c94795545 100644 --- a/examples/sensor_fusion/Make.defs +++ b/examples/sensor_fusion/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/sensor_fusion/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/sensor_fusion/Makefile b/examples/sensor_fusion/Makefile index ce17e69dfe7..50a33cffcd4 100644 --- a/examples/sensor_fusion/Makefile +++ b/examples/sensor_fusion/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/sensor_fusion/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/sensor_fusion/sensor_fusion_main.c b/examples/sensor_fusion/sensor_fusion_main.c index a603c3c8216..cad5903325e 100644 --- a/examples/sensor_fusion/sensor_fusion_main.c +++ b/examples/sensor_fusion/sensor_fusion_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/sensor_fusion/sensor_fusion_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/serialblaster/CMakeLists.txt b/examples/serialblaster/CMakeLists.txt index 4fa46688d5c..4e3847922b2 100644 --- a/examples/serialblaster/CMakeLists.txt +++ b/examples/serialblaster/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/serialblaster/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/serialblaster/Make.defs b/examples/serialblaster/Make.defs index c92ed53a781..a4178101084 100644 --- a/examples/serialblaster/Make.defs +++ b/examples/serialblaster/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/serialblaster/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/serialblaster/Makefile b/examples/serialblaster/Makefile index ce8fb45b266..79d849fa62e 100644 --- a/examples/serialblaster/Makefile +++ b/examples/serialblaster/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/serialblaster/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/serialblaster/serialblaster_main.c b/examples/serialblaster/serialblaster_main.c index 106a26d367a..b028efa1844 100644 --- a/examples/serialblaster/serialblaster_main.c +++ b/examples/serialblaster/serialblaster_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/serialblaster/serialblaster_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/serialrx/CMakeLists.txt b/examples/serialrx/CMakeLists.txt index 185359aea9a..dab565f6fc0 100644 --- a/examples/serialrx/CMakeLists.txt +++ b/examples/serialrx/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/serialrx/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/serialrx/Make.defs b/examples/serialrx/Make.defs index 942c94f840d..40359140c9b 100644 --- a/examples/serialrx/Make.defs +++ b/examples/serialrx/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/serialrx/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/serialrx/Makefile b/examples/serialrx/Makefile index 56cfa3ad2c5..fbb9ec1adc7 100644 --- a/examples/serialrx/Makefile +++ b/examples/serialrx/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/serialrx/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/serialrx/serialrx_main.c b/examples/serialrx/serialrx_main.c index 0864805ce0e..af7468e4d8d 100644 --- a/examples/serialrx/serialrx_main.c +++ b/examples/serialrx/serialrx_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/serialrx/serialrx_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/serloop/CMakeLists.txt b/examples/serloop/CMakeLists.txt index 182e9182f85..5a3c3e71578 100644 --- a/examples/serloop/CMakeLists.txt +++ b/examples/serloop/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/serloop/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/serloop/Make.defs b/examples/serloop/Make.defs index 2ea8de90af7..268fc5f9033 100644 --- a/examples/serloop/Make.defs +++ b/examples/serloop/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/serloop/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/serloop/Makefile b/examples/serloop/Makefile index 782613a023e..3fcdc6ba344 100644 --- a/examples/serloop/Makefile +++ b/examples/serloop/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/serloop/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/serloop/serloop_main.c b/examples/serloop/serloop_main.c index a1e916e1f46..00bf322536c 100644 --- a/examples/serloop/serloop_main.c +++ b/examples/serloop/serloop_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/serloop/serloop_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/settings/Make.defs b/examples/settings/Make.defs index 8198e28a302..6fac4077bfb 100644 --- a/examples/settings/Make.defs +++ b/examples/settings/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/settings/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/settings/Makefile b/examples/settings/Makefile index 53bf1f22d92..64856378578 100644 --- a/examples/settings/Makefile +++ b/examples/settings/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/settings/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/settings/settings_main.c b/examples/settings/settings_main.c index 9312608360f..b284a48434c 100644 --- a/examples/settings/settings_main.c +++ b/examples/settings/settings_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/settings/settings_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/shm_test/CMakeLists.txt b/examples/shm_test/CMakeLists.txt index 1985986d56a..19f5f849501 100644 --- a/examples/shm_test/CMakeLists.txt +++ b/examples/shm_test/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/shm_test/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/shm_test/Make.defs b/examples/shm_test/Make.defs index 5248c3f6eb1..a5e5e62caac 100644 --- a/examples/shm_test/Make.defs +++ b/examples/shm_test/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/shm_test/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/shm_test/Makefile b/examples/shm_test/Makefile index 1f3346868d7..1f1d900a0bc 100644 --- a/examples/shm_test/Makefile +++ b/examples/shm_test/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/shm_test/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/shm_test/shm_main.c b/examples/shm_test/shm_main.c index 1fb1d0b0d15..e93758d59b5 100644 --- a/examples/shm_test/shm_main.c +++ b/examples/shm_test/shm_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/shm_test/shm_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/sht3x/CMakeLists.txt b/examples/sht3x/CMakeLists.txt index 1c947a3f241..8c22be54f8e 100644 --- a/examples/sht3x/CMakeLists.txt +++ b/examples/sht3x/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/sht3x/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/sht3x/Make.defs b/examples/sht3x/Make.defs index cf752dca4a5..e4bec98324d 100644 --- a/examples/sht3x/Make.defs +++ b/examples/sht3x/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/sht3x/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/sht3x/Makefile b/examples/sht3x/Makefile index e1d753b1e13..6acd0fe07f5 100644 --- a/examples/sht3x/Makefile +++ b/examples/sht3x/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/sht3x/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/sht3x/sht3x_main.c b/examples/sht3x/sht3x_main.c index bd0ef295fb2..078979c7a41 100644 --- a/examples/sht3x/sht3x_main.c +++ b/examples/sht3x/sht3x_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/sht3x/sht3x_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/slcd/CMakeLists.txt b/examples/slcd/CMakeLists.txt index 9cd83621fe7..280cabdb6d6 100644 --- a/examples/slcd/CMakeLists.txt +++ b/examples/slcd/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/slcd/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/slcd/Make.defs b/examples/slcd/Make.defs index 5346c20df56..24c71d0ad15 100644 --- a/examples/slcd/Make.defs +++ b/examples/slcd/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/slcd/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/slcd/Makefile b/examples/slcd/Makefile index 8e3651ffb99..830fa2ead16 100644 --- a/examples/slcd/Makefile +++ b/examples/slcd/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/slcd/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/slcd/slcd_main.c b/examples/slcd/slcd_main.c index 1342ad14b25..e7aedd0c01c 100644 --- a/examples/slcd/slcd_main.c +++ b/examples/slcd/slcd_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/slcd/slcd_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/smps/CMakeLists.txt b/examples/smps/CMakeLists.txt index fd3821aceb1..15344ae4aaa 100644 --- a/examples/smps/CMakeLists.txt +++ b/examples/smps/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/smps/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/smps/Make.defs b/examples/smps/Make.defs index 9cae2ef5546..bb06f35417d 100644 --- a/examples/smps/Make.defs +++ b/examples/smps/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/smps/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/smps/Makefile b/examples/smps/Makefile index 5c9799d5ed1..edbb6e5f8bb 100644 --- a/examples/smps/Makefile +++ b/examples/smps/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/smps/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/smps/smps_main.c b/examples/smps/smps_main.c index f6815f54ce4..99433155887 100644 --- a/examples/smps/smps_main.c +++ b/examples/smps/smps_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/smps/smps_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/sotest/CMakeLists.txt b/examples/sotest/CMakeLists.txt index bab18517a4b..9daecfb7402 100644 --- a/examples/sotest/CMakeLists.txt +++ b/examples/sotest/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/sotest/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/sotest/Make.defs b/examples/sotest/Make.defs index 6f9fbe6f52f..c674e34e66e 100644 --- a/examples/sotest/Make.defs +++ b/examples/sotest/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/sotest/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/sotest/Makefile b/examples/sotest/Makefile index 6e7bb3af7b3..0d23750cf86 100644 --- a/examples/sotest/Makefile +++ b/examples/sotest/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/sotest/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/sotest/main/CMakeLists.txt b/examples/sotest/main/CMakeLists.txt index de0fdd249d6..caca43d2212 100644 --- a/examples/sotest/main/CMakeLists.txt +++ b/examples/sotest/main/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/sotest/main/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/sotest/main/Make.defs b/examples/sotest/main/Make.defs index 1a382e924ea..a904d0ceff3 100644 --- a/examples/sotest/main/Make.defs +++ b/examples/sotest/main/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/sotest/main/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/sotest/main/Makefile b/examples/sotest/main/Makefile index 17c90570324..064b0b434b7 100644 --- a/examples/sotest/main/Makefile +++ b/examples/sotest/main/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/sotest/main/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/sotest/main/sotest_main.c b/examples/sotest/main/sotest_main.c index 205ed397ccc..ccc7a325519 100644 --- a/examples/sotest/main/sotest_main.c +++ b/examples/sotest/main/sotest_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/sotest/main/sotest_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/sotest/modprint/Make.defs b/examples/sotest/modprint/Make.defs index 2d6ae226b1f..07811511bd2 100644 --- a/examples/sotest/modprint/Make.defs +++ b/examples/sotest/modprint/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/sotest/modprint/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/sotest/modprint/Makefile b/examples/sotest/modprint/Makefile index dca51c6f76d..81f5c2c5390 100644 --- a/examples/sotest/modprint/Makefile +++ b/examples/sotest/modprint/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/sotest/modprint/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/sotest/modprint/modprint.c b/examples/sotest/modprint/modprint.c index e5e89f79fd2..898899a24a4 100644 --- a/examples/sotest/modprint/modprint.c +++ b/examples/sotest/modprint/modprint.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/sotest/modprint/modprint.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/sotest/sotest/Make.defs b/examples/sotest/sotest/Make.defs index 08c4edce18f..4a26bb1219b 100644 --- a/examples/sotest/sotest/Make.defs +++ b/examples/sotest/sotest/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/sotest/sotest/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/sotest/sotest/Makefile b/examples/sotest/sotest/Makefile index 94eb777a2ac..dfbec74a171 100644 --- a/examples/sotest/sotest/Makefile +++ b/examples/sotest/sotest/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/sotest/sotest/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/sotest/sotest/sotest.c b/examples/sotest/sotest/sotest.c index 47d99b6213f..df9ab3201ae 100644 --- a/examples/sotest/sotest/sotest.c +++ b/examples/sotest/sotest/sotest.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/sotest/sotest/sotest.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/spislv_test/CMakeLists.txt b/examples/spislv_test/CMakeLists.txt index d4406bae994..137bc91342e 100644 --- a/examples/spislv_test/CMakeLists.txt +++ b/examples/spislv_test/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/spislv_test/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/spislv_test/Make.defs b/examples/spislv_test/Make.defs index e8b23330ea0..14bb4852a9f 100644 --- a/examples/spislv_test/Make.defs +++ b/examples/spislv_test/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/spislv/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/spislv_test/Makefile b/examples/spislv_test/Makefile index 44b099d1d00..1fb3e54c57c 100644 --- a/examples/spislv_test/Makefile +++ b/examples/spislv_test/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/spislv_test/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/spislv_test/spislv_test.c b/examples/spislv_test/spislv_test.c index 1ac4e5b3348..763bee76f7d 100644 --- a/examples/spislv_test/spislv_test.c +++ b/examples/spislv_test/spislv_test.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/spislv_test/spislv_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/stat/CMakeLists.txt b/examples/stat/CMakeLists.txt index 32d10bb4e27..c355cfa7d55 100644 --- a/examples/stat/CMakeLists.txt +++ b/examples/stat/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/stat/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/stat/Make.defs b/examples/stat/Make.defs index 7532ebb254b..c965dbda01f 100644 --- a/examples/stat/Make.defs +++ b/examples/stat/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/stat/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/stat/Makefile b/examples/stat/Makefile index c86c9d03b18..afbb053a426 100644 --- a/examples/stat/Makefile +++ b/examples/stat/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/stat/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/stat/stat_main.c b/examples/stat/stat_main.c index a4c9db4de52..fa04f7add7e 100644 --- a/examples/stat/stat_main.c +++ b/examples/stat/stat_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/stat/stat_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/stepper/CMakeLists.txt b/examples/stepper/CMakeLists.txt index a86573c9246..d8e89647cc6 100644 --- a/examples/stepper/CMakeLists.txt +++ b/examples/stepper/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/stepper/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/stepper/Make.defs b/examples/stepper/Make.defs index e98fa345cfd..859b096373b 100644 --- a/examples/stepper/Make.defs +++ b/examples/stepper/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/stepper/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/stepper/Makefile b/examples/stepper/Makefile index 00fb19999b3..ae9bad0c27f 100644 --- a/examples/stepper/Makefile +++ b/examples/stepper/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/stepper/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/stepper/stepper.c b/examples/stepper/stepper.c index 5aa43dd8a2c..2d9acdaff17 100644 --- a/examples/stepper/stepper.c +++ b/examples/stepper/stepper.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/stepper/stepper.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/sx127x_demo/CMakeLists.txt b/examples/sx127x_demo/CMakeLists.txt index 0fa4bfee599..b9982b87c3c 100644 --- a/examples/sx127x_demo/CMakeLists.txt +++ b/examples/sx127x_demo/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/sx127x_demo/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/sx127x_demo/Make.defs b/examples/sx127x_demo/Make.defs index 226a0982042..f569360a66e 100644 --- a/examples/sx127x_demo/Make.defs +++ b/examples/sx127x_demo/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/sx127x_demo/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/sx127x_demo/Makefile b/examples/sx127x_demo/Makefile index e97f14ebd1f..d24378ee6b9 100644 --- a/examples/sx127x_demo/Makefile +++ b/examples/sx127x_demo/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/sx127x_demo/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/sx127x_demo/sx127x_demo.c b/examples/sx127x_demo/sx127x_demo.c index 79fc54a4da0..05175a6edb5 100644 --- a/examples/sx127x_demo/sx127x_demo.c +++ b/examples/sx127x_demo/sx127x_demo.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/sx127x_demo/sx127x_demo.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/system/CMakeLists.txt b/examples/system/CMakeLists.txt index 22b29bb7533..23ad2681268 100644 --- a/examples/system/CMakeLists.txt +++ b/examples/system/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/system/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/system/Make.defs b/examples/system/Make.defs index 2e624e8fec9..ab6d63674a7 100644 --- a/examples/system/Make.defs +++ b/examples/system/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/system/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/system/Makefile b/examples/system/Makefile index 19aa8750c01..ad4d9ba1d9d 100644 --- a/examples/system/Makefile +++ b/examples/system/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/system/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/system/system_main.c b/examples/system/system_main.c index 0783dda8c6a..b0ff68d9006 100644 --- a/examples/system/system_main.c +++ b/examples/system/system_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/system/system_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/tcp_ipc_client/CMakeLists.txt b/examples/tcp_ipc_client/CMakeLists.txt index a146e630427..2a82875ba34 100644 --- a/examples/tcp_ipc_client/CMakeLists.txt +++ b/examples/tcp_ipc_client/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/tcp_ipc_client/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/tcp_ipc_client/Make.defs b/examples/tcp_ipc_client/Make.defs index 54053a4a217..e55733809e4 100644 --- a/examples/tcp_ipc_client/Make.defs +++ b/examples/tcp_ipc_client/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/tcp_ipc_client/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/tcp_ipc_client/Makefile b/examples/tcp_ipc_client/Makefile index 39fe487839f..fe60b4732ae 100644 --- a/examples/tcp_ipc_client/Makefile +++ b/examples/tcp_ipc_client/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/tcp_ipc_client/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/tcp_ipc_client/protocol.h b/examples/tcp_ipc_client/protocol.h index ecd546bc0a1..7e8f188becf 100644 --- a/examples/tcp_ipc_client/protocol.h +++ b/examples/tcp_ipc_client/protocol.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/tcp_ipc_client/protocol.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The @@ -38,4 +40,4 @@ typedef struct void send_msg_to_lpwan (unsigned char *msg, protocolo_ipc *pt_protocol); -#endif /* __APPS_EXAMPLES_TCP_IPC_CLIENT_PROTOCOL_H */ \ No newline at end of file +#endif /* __APPS_EXAMPLES_TCP_IPC_CLIENT_PROTOCOL_H */ diff --git a/examples/tcp_ipc_client/tcp_ipc_client_main.c b/examples/tcp_ipc_client/tcp_ipc_client_main.c index 79822a5bffd..f1d5943ef0a 100644 --- a/examples/tcp_ipc_client/tcp_ipc_client_main.c +++ b/examples/tcp_ipc_client/tcp_ipc_client_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/tcp_ipc_client/tcp_ipc_client_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/tcp_ipc_server/CMakeLists.txt b/examples/tcp_ipc_server/CMakeLists.txt index f8705ae6cc3..cf1174d9d81 100644 --- a/examples/tcp_ipc_server/CMakeLists.txt +++ b/examples/tcp_ipc_server/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/tcp_ipc_server/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/tcp_ipc_server/Make.defs b/examples/tcp_ipc_server/Make.defs index 09664c68d9c..ea9f3533c34 100644 --- a/examples/tcp_ipc_server/Make.defs +++ b/examples/tcp_ipc_server/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/tcp_ipc_server/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/tcp_ipc_server/Makefile b/examples/tcp_ipc_server/Makefile index ddf704d06f7..6a9fd922718 100644 --- a/examples/tcp_ipc_server/Makefile +++ b/examples/tcp_ipc_server/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/tcp_ipc_server/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/tcp_ipc_server/lorawan/uart_lorawan_layer.h b/examples/tcp_ipc_server/lorawan/uart_lorawan_layer.h index dcd19516465..10f45ca6a5b 100644 --- a/examples/tcp_ipc_server/lorawan/uart_lorawan_layer.h +++ b/examples/tcp_ipc_server/lorawan/uart_lorawan_layer.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/tcp_ipc_server/lorawan/uart_lorawan_layer.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The @@ -55,4 +57,4 @@ int lorawan_radioenge_send_msg(unsigned char * pt_payload_uplink_hexstring, int max_size_downlink, int time_to_wait_ms); -#endif /* __APPS_EXAMPLES_TCP_IPC_SERVER_LORAWAN_H */ \ No newline at end of file +#endif /* __APPS_EXAMPLES_TCP_IPC_SERVER_LORAWAN_H */ diff --git a/examples/tcp_ipc_server/protocol.c b/examples/tcp_ipc_server/protocol.c index 710b3b34e6f..9449faf4bd8 100644 --- a/examples/tcp_ipc_server/protocol.c +++ b/examples/tcp_ipc_server/protocol.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/tcp_ipc_server/protocol.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/tcp_ipc_server/protocol.h b/examples/tcp_ipc_server/protocol.h index a49cae10e36..5031977d279 100644 --- a/examples/tcp_ipc_server/protocol.h +++ b/examples/tcp_ipc_server/protocol.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/tcp_ipc_server/protocol.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The @@ -38,4 +40,4 @@ typedef struct void send_msg_to_lpwan (unsigned char *msg, protocolo_ipc *pt_protocol); -#endif /* __APPS_EXAMPLES_SERVER_TCP_PROTOCOL_H */ \ No newline at end of file +#endif /* __APPS_EXAMPLES_SERVER_TCP_PROTOCOL_H */ diff --git a/examples/tcp_ipc_server/tcp_ipc_server_main.c b/examples/tcp_ipc_server/tcp_ipc_server_main.c index e7d0b50b0e2..af9aff823cd 100644 --- a/examples/tcp_ipc_server/tcp_ipc_server_main.c +++ b/examples/tcp_ipc_server/tcp_ipc_server_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/tcp_ipc_server/tcp_ipc_server_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/tcp_ipc_server/uart_lorawan_layer.c b/examples/tcp_ipc_server/uart_lorawan_layer.c index e38348e2ef2..dedafa08dd6 100644 --- a/examples/tcp_ipc_server/uart_lorawan_layer.c +++ b/examples/tcp_ipc_server/uart_lorawan_layer.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/tcp_ipc_server/uart_lorawan_layer.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/tcpblaster/CMakeLists.txt b/examples/tcpblaster/CMakeLists.txt index 29f69d4f288..5e72826c14f 100644 --- a/examples/tcpblaster/CMakeLists.txt +++ b/examples/tcpblaster/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/tcpblaster/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/tcpblaster/Make.defs b/examples/tcpblaster/Make.defs index 8c834a90fc9..bde73b878a7 100644 --- a/examples/tcpblaster/Make.defs +++ b/examples/tcpblaster/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/tcpblaster/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/tcpblaster/Makefile b/examples/tcpblaster/Makefile index c4fb38f7d70..50efef93a17 100644 --- a/examples/tcpblaster/Makefile +++ b/examples/tcpblaster/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/tcpblaster/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/tcpblaster/tcpblaster.h b/examples/tcpblaster/tcpblaster.h index 97d5bd37c98..9fc7c4dcce9 100644 --- a/examples/tcpblaster/tcpblaster.h +++ b/examples/tcpblaster/tcpblaster.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/tcpblaster/tcpblaster.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/tcpblaster/tcpblaster_client.c b/examples/tcpblaster/tcpblaster_client.c index 9411f53abd5..940651e4d59 100644 --- a/examples/tcpblaster/tcpblaster_client.c +++ b/examples/tcpblaster/tcpblaster_client.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/tcpblaster/tcpblaster_client.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/tcpblaster/tcpblaster_cmdline.c b/examples/tcpblaster/tcpblaster_cmdline.c index d4739596156..6033fafd295 100644 --- a/examples/tcpblaster/tcpblaster_cmdline.c +++ b/examples/tcpblaster/tcpblaster_cmdline.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/tcpblaster/tcpblaster_cmdline.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/tcpblaster/tcpblaster_host.c b/examples/tcpblaster/tcpblaster_host.c index 78868c2a7b7..f1667cc418b 100644 --- a/examples/tcpblaster/tcpblaster_host.c +++ b/examples/tcpblaster/tcpblaster_host.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/tcpblaster/tcpblaster_host.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/tcpblaster/tcpblaster_host.cmake b/examples/tcpblaster/tcpblaster_host.cmake index 467b81af70c..e2bf12e1a36 100644 --- a/examples/tcpblaster/tcpblaster_host.cmake +++ b/examples/tcpblaster/tcpblaster_host.cmake @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/tcpblaster/tcpblaster_host.cmake # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/tcpblaster/tcpblaster_netinit.c b/examples/tcpblaster/tcpblaster_netinit.c index 03fec0965ad..6007674f4b2 100644 --- a/examples/tcpblaster/tcpblaster_netinit.c +++ b/examples/tcpblaster/tcpblaster_netinit.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/tcpblaster/tcpblaster_netinit.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/tcpblaster/tcpblaster_server.c b/examples/tcpblaster/tcpblaster_server.c index 74fb752d4cf..17f5244d7f7 100644 --- a/examples/tcpblaster/tcpblaster_server.c +++ b/examples/tcpblaster/tcpblaster_server.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/tcpblaster/tcpblaster_server.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/tcpblaster/tcpblaster_target1.c b/examples/tcpblaster/tcpblaster_target1.c index fcfdae1126c..f46fd0da82b 100644 --- a/examples/tcpblaster/tcpblaster_target1.c +++ b/examples/tcpblaster/tcpblaster_target1.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/tcpblaster/tcpblaster_target1.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/tcpblaster/tcpblaster_target2.c b/examples/tcpblaster/tcpblaster_target2.c index bd32f92a691..f14107c7d7a 100644 --- a/examples/tcpblaster/tcpblaster_target2.c +++ b/examples/tcpblaster/tcpblaster_target2.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/tcpblaster/tcpblaster_target2.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/tcpecho/CMakeLists.txt b/examples/tcpecho/CMakeLists.txt index 8e5b9ff7a30..c39b5892a67 100644 --- a/examples/tcpecho/CMakeLists.txt +++ b/examples/tcpecho/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/tcpecho/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/tcpecho/Make.defs b/examples/tcpecho/Make.defs index fd6c24f69e9..8670a03ad0a 100644 --- a/examples/tcpecho/Make.defs +++ b/examples/tcpecho/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/tcpecho/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/tcpecho/Makefile b/examples/tcpecho/Makefile index 2ad89140e77..b1e2888bdf1 100644 --- a/examples/tcpecho/Makefile +++ b/examples/tcpecho/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/tcpecho/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/tcpecho/tcpecho_main.c b/examples/tcpecho/tcpecho_main.c index 6ad687679b6..fac12f898c2 100644 --- a/examples/tcpecho/tcpecho_main.c +++ b/examples/tcpecho/tcpecho_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/tcpecho/tcpecho_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/telnetd/CMakeLists.txt b/examples/telnetd/CMakeLists.txt index 941b53524b8..2f128041719 100644 --- a/examples/telnetd/CMakeLists.txt +++ b/examples/telnetd/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/telnetd/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/telnetd/Make.defs b/examples/telnetd/Make.defs index 4bbccca3ee9..59d1fe357f2 100644 --- a/examples/telnetd/Make.defs +++ b/examples/telnetd/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/telnetd/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/telnetd/Makefile b/examples/telnetd/Makefile index 35ebef77cab..427cf3a7f8a 100644 --- a/examples/telnetd/Makefile +++ b/examples/telnetd/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/telnetd/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/telnetd/telnetd.c b/examples/telnetd/telnetd.c index 1716f145b1b..270e6d53b07 100644 --- a/examples/telnetd/telnetd.c +++ b/examples/telnetd/telnetd.c @@ -1,14 +1,11 @@ /**************************************************************************** * apps/examples/telnetd/telnetd.c * - * Copyright (C) 2012, 2017 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * This is a leverage of similar logic from uIP: - * - * Author: Adam Dunkels - * Copyright (c) 2003, Adam Dunkels. - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2012, 2017 Gregory Nutt. All rights reserved. + * SPDX-FileCopyrightText: 2003, Adam Dunkels. All rights reserved. + * SPDX-FileContributor: Gregory Nutt + * SPDX-FileContributor: Adam Dunkels * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/examples/telnetd/telnetd.h b/examples/telnetd/telnetd.h index 141ba3c5e6a..d3661537a66 100644 --- a/examples/telnetd/telnetd.h +++ b/examples/telnetd/telnetd.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/telnetd/telnetd.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/termios/CMakeLists.txt b/examples/termios/CMakeLists.txt index e4bfb640210..186686694b7 100644 --- a/examples/termios/CMakeLists.txt +++ b/examples/termios/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/termios/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/termios/Make.defs b/examples/termios/Make.defs index 06ac9be4629..dc6dd3a5a5f 100644 --- a/examples/termios/Make.defs +++ b/examples/termios/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/termios/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/termios/Makefile b/examples/termios/Makefile index 1429523256d..84cb78ea359 100644 --- a/examples/termios/Makefile +++ b/examples/termios/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/termios/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/termios/termios_main.c b/examples/termios/termios_main.c index 5f3039ee46a..91958a13246 100644 --- a/examples/termios/termios_main.c +++ b/examples/termios/termios_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/termios/termios_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/thttpd/CMakeLists.txt b/examples/thttpd/CMakeLists.txt index 4150f1110d1..1e8a4336ced 100644 --- a/examples/thttpd/CMakeLists.txt +++ b/examples/thttpd/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/thttpd/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/thttpd/Make.defs b/examples/thttpd/Make.defs index 162aa4cc2eb..4966689fc49 100644 --- a/examples/thttpd/Make.defs +++ b/examples/thttpd/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/thttpd/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/thttpd/Makefile b/examples/thttpd/Makefile index 6ad986674bd..1891b10bf02 100644 --- a/examples/thttpd/Makefile +++ b/examples/thttpd/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/thttpd/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/thttpd/content/Makefile.binfs b/examples/thttpd/content/Makefile.binfs index 42dd1082571..60a6a74ed01 100644 --- a/examples/thttpd/content/Makefile.binfs +++ b/examples/thttpd/content/Makefile.binfs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/thttpd/content/Makefile.binfs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/thttpd/content/Makefile.nxflat b/examples/thttpd/content/Makefile.nxflat index 7d4c91961c4..795c8caf0f1 100644 --- a/examples/thttpd/content/Makefile.nxflat +++ b/examples/thttpd/content/Makefile.nxflat @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/thttpd/content/Makefile.nxflat # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/thttpd/content/hello/Makefile b/examples/thttpd/content/hello/Makefile index fceb1c36612..67becfcf7d4 100644 --- a/examples/thttpd/content/hello/Makefile +++ b/examples/thttpd/content/hello/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/thttpd/content/hello/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/thttpd/content/hello/hello.c b/examples/thttpd/content/hello/hello.c index 7c6b4b8e0bc..5a74ffeddd0 100644 --- a/examples/thttpd/content/hello/hello.c +++ b/examples/thttpd/content/hello/hello.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/thttpd/content/hello/hello.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/thttpd/content/tasks/Makefile b/examples/thttpd/content/tasks/Makefile index b1a2f40355d..5fcec6df60e 100644 --- a/examples/thttpd/content/tasks/Makefile +++ b/examples/thttpd/content/tasks/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/thttpd/content/tasks/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/thttpd/content/tasks/tasks.c b/examples/thttpd/content/tasks/tasks.c index 5edb15c08f3..da7347678a4 100644 --- a/examples/thttpd/content/tasks/tasks.c +++ b/examples/thttpd/content/tasks/tasks.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/thttpd/content/tasks/tasks.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/thttpd/thttpd_main.c b/examples/thttpd/thttpd_main.c index 9ed04917f82..291e7552c75 100644 --- a/examples/thttpd/thttpd_main.c +++ b/examples/thttpd/thttpd_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/thttpd/thttpd_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/tiff/CMakeLists.txt b/examples/tiff/CMakeLists.txt index ca3558f5a1c..1e3059a32d3 100644 --- a/examples/tiff/CMakeLists.txt +++ b/examples/tiff/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/tiff/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/tiff/Make.defs b/examples/tiff/Make.defs index 51e773d6394..8f8fa9eeb7a 100644 --- a/examples/tiff/Make.defs +++ b/examples/tiff/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/tiff/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/tiff/Makefile b/examples/tiff/Makefile index d04aa8906b9..a5afb58db4e 100644 --- a/examples/tiff/Makefile +++ b/examples/tiff/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/tiff/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/tiff/tiff_main.c b/examples/tiff/tiff_main.c index 72d5afb1642..e72bc7482e1 100644 --- a/examples/tiff/tiff_main.c +++ b/examples/tiff/tiff_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/tiff/tiff_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/timer/CMakeLists.txt b/examples/timer/CMakeLists.txt index ccd7c036d2c..897ff2ffa64 100644 --- a/examples/timer/CMakeLists.txt +++ b/examples/timer/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/timer/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/timer/Make.defs b/examples/timer/Make.defs index cc24845fafd..bb3ad4b0352 100644 --- a/examples/timer/Make.defs +++ b/examples/timer/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/timer/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/timer/Makefile b/examples/timer/Makefile index b2046da0b35..5e01ed5fb5d 100644 --- a/examples/timer/Makefile +++ b/examples/timer/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/timer/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/timer/timer_main.c b/examples/timer/timer_main.c index 193202a9bb5..eec3cbd5a76 100644 --- a/examples/timer/timer_main.c +++ b/examples/timer/timer_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/timer/timer_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/timer_gpio/CMakeLists.txt b/examples/timer_gpio/CMakeLists.txt index 14ef20b869a..2d64ec3531d 100644 --- a/examples/timer_gpio/CMakeLists.txt +++ b/examples/timer_gpio/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/timer_gpio/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/timer_gpio/Make.defs b/examples/timer_gpio/Make.defs index ed3769801ab..ca5e2034ec3 100644 --- a/examples/timer_gpio/Make.defs +++ b/examples/timer_gpio/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/timer_gpio/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/timer_gpio/Makefile b/examples/timer_gpio/Makefile index 6dd0841ed87..c324f17f3d2 100644 --- a/examples/timer_gpio/Makefile +++ b/examples/timer_gpio/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/timer_gpio/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/timer_gpio/timer_gpio_main.c b/examples/timer_gpio/timer_gpio_main.c index 8ea830d06f7..f39fa125680 100644 --- a/examples/timer_gpio/timer_gpio_main.c +++ b/examples/timer_gpio/timer_gpio_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/timer_gpio/timer_gpio_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/tlpi/Make.defs b/examples/tlpi/Make.defs index 2809debfe72..3177b58aa07 100644 --- a/examples/tlpi/Make.defs +++ b/examples/tlpi/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/tlpi/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/tlpi/Makefile b/examples/tlpi/Makefile index 972d35764ce..519c93d31d4 100644 --- a/examples/tlpi/Makefile +++ b/examples/tlpi/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/tlpi/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/touchscreen/CMakeLists.txt b/examples/touchscreen/CMakeLists.txt index 3005693d1fc..f9630d8f473 100644 --- a/examples/touchscreen/CMakeLists.txt +++ b/examples/touchscreen/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/touchscreen/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/touchscreen/Make.defs b/examples/touchscreen/Make.defs index 37d5c93f514..10c7660894b 100644 --- a/examples/touchscreen/Make.defs +++ b/examples/touchscreen/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/touchscreen/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/touchscreen/Makefile b/examples/touchscreen/Makefile index 217cb5f0c6b..9102bc50ff0 100644 --- a/examples/touchscreen/Makefile +++ b/examples/touchscreen/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/touchscreen/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/touchscreen/tc.h b/examples/touchscreen/tc.h index d525eee5f4e..20741783384 100644 --- a/examples/touchscreen/tc.h +++ b/examples/touchscreen/tc.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/touchscreen/tc.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/touchscreen/tc_main.c b/examples/touchscreen/tc_main.c index cff8d9f516e..129de8d27f5 100644 --- a/examples/touchscreen/tc_main.c +++ b/examples/touchscreen/tc_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/touchscreen/tc_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/udgram/CMakeLists.txt b/examples/udgram/CMakeLists.txt index c897cad3677..2cd497dcba9 100644 --- a/examples/udgram/CMakeLists.txt +++ b/examples/udgram/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/udgram/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/udgram/Make.defs b/examples/udgram/Make.defs index a2389ebfe52..7db4f826294 100644 --- a/examples/udgram/Make.defs +++ b/examples/udgram/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/udgram/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/udgram/Makefile b/examples/udgram/Makefile index 160dbe02542..57b32ba36dd 100644 --- a/examples/udgram/Makefile +++ b/examples/udgram/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/udgram/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/udgram/udgram.h b/examples/udgram/udgram.h index 84c5adf0468..273dd4a996a 100644 --- a/examples/udgram/udgram.h +++ b/examples/udgram/udgram.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/udgram/udgram.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/udgram/udgram_client.c b/examples/udgram/udgram_client.c index c12d3f8994d..f60abedf619 100644 --- a/examples/udgram/udgram_client.c +++ b/examples/udgram/udgram_client.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/udgram/udgram_client.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/udgram/udgram_server.c b/examples/udgram/udgram_server.c index 703baffa15c..49674ff3619 100644 --- a/examples/udgram/udgram_server.c +++ b/examples/udgram/udgram_server.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/udgram/udgram_server.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/udp/CMakeLists.txt b/examples/udp/CMakeLists.txt index d5030a05c23..996b9a9be67 100644 --- a/examples/udp/CMakeLists.txt +++ b/examples/udp/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/udp/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/udp/Make.defs b/examples/udp/Make.defs index efdd724f19c..c8db5a639fa 100644 --- a/examples/udp/Make.defs +++ b/examples/udp/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/udp/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/udp/Makefile b/examples/udp/Makefile index a0cc07608d5..cb3f959336e 100644 --- a/examples/udp/Makefile +++ b/examples/udp/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/udp/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/udp/udp.h b/examples/udp/udp.h index 77d1f928972..415317f50a0 100644 --- a/examples/udp/udp.h +++ b/examples/udp/udp.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/udp/udp.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/udp/udp_client.c b/examples/udp/udp_client.c index 220637b1c34..f3d3f19dc3f 100644 --- a/examples/udp/udp_client.c +++ b/examples/udp/udp_client.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/udp/udp_client.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/udp/udp_cmdline.c b/examples/udp/udp_cmdline.c index 64cb7142573..cefff358610 100644 --- a/examples/udp/udp_cmdline.c +++ b/examples/udp/udp_cmdline.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/udp/udp_cmdline.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/udp/udp_host.c b/examples/udp/udp_host.c index f0bf0a99bfb..5f4aac5f377 100644 --- a/examples/udp/udp_host.c +++ b/examples/udp/udp_host.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/udp/udp_host.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/udp/udp_netinit.c b/examples/udp/udp_netinit.c index e937b0c2e0d..3cd2625b7fd 100644 --- a/examples/udp/udp_netinit.c +++ b/examples/udp/udp_netinit.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/udp/udp_netinit.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/udp/udp_server.c b/examples/udp/udp_server.c index cd1369753bb..6e642e65410 100644 --- a/examples/udp/udp_server.c +++ b/examples/udp/udp_server.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/udp/udp_server.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/udp/udp_target1.c b/examples/udp/udp_target1.c index 3db14c05fe2..656213a291f 100644 --- a/examples/udp/udp_target1.c +++ b/examples/udp/udp_target1.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/udp/udp_target1.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/udp/udp_target2.c b/examples/udp/udp_target2.c index 03104ff92e9..d0abce67e58 100644 --- a/examples/udp/udp_target2.c +++ b/examples/udp/udp_target2.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/udp/udp_target2.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/udpblaster/CMakeLists.txt b/examples/udpblaster/CMakeLists.txt index 3c94fd9d778..7a7f612a3d2 100644 --- a/examples/udpblaster/CMakeLists.txt +++ b/examples/udpblaster/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/udpblaster/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/udpblaster/Make.defs b/examples/udpblaster/Make.defs index 3e8faec8aa5..4068015305b 100644 --- a/examples/udpblaster/Make.defs +++ b/examples/udpblaster/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/udpblaster/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/udpblaster/Makefile b/examples/udpblaster/Makefile index 0d4dce30d20..2db46b110e5 100644 --- a/examples/udpblaster/Makefile +++ b/examples/udpblaster/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/udpblaster/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/udpblaster/udpblaster.h b/examples/udpblaster/udpblaster.h index 2f7c4a484b8..ff727bc58e9 100644 --- a/examples/udpblaster/udpblaster.h +++ b/examples/udpblaster/udpblaster.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/udpblaster/udpblaster.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/udpblaster/udpblaster_host.c b/examples/udpblaster/udpblaster_host.c index a39a506f5fd..d3609c734e3 100644 --- a/examples/udpblaster/udpblaster_host.c +++ b/examples/udpblaster/udpblaster_host.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/udpblaster/udpblaster_host.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/udpblaster/udpblaster_host.cmake b/examples/udpblaster/udpblaster_host.cmake index 3e5e2846cbb..2b132a694d1 100644 --- a/examples/udpblaster/udpblaster_host.cmake +++ b/examples/udpblaster/udpblaster_host.cmake @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/udpblaster/udpblaster.cmake # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/udpblaster/udpblaster_target.c b/examples/udpblaster/udpblaster_target.c index 1c12f10f03b..0df0072d4f9 100644 --- a/examples/udpblaster/udpblaster_target.c +++ b/examples/udpblaster/udpblaster_target.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/udpblaster/udpblaster_target.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/udpblaster/udpblaster_text.c b/examples/udpblaster/udpblaster_text.c index 0715f86f991..367dd5f0f99 100644 --- a/examples/udpblaster/udpblaster_text.c +++ b/examples/udpblaster/udpblaster_text.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/udpblaster/udpblaster_text.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/uid/CMakeLists.txt b/examples/uid/CMakeLists.txt index 270ba9afbd5..7ec80a4861f 100644 --- a/examples/uid/CMakeLists.txt +++ b/examples/uid/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/uid/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/uid/Make.defs b/examples/uid/Make.defs index c4ea55340e4..aee047fcfab 100644 --- a/examples/uid/Make.defs +++ b/examples/uid/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/uid/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/uid/Makefile b/examples/uid/Makefile index e17848e81c2..fa1d79f96f4 100644 --- a/examples/uid/Makefile +++ b/examples/uid/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/uid/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/uid/uid_main.c b/examples/uid/uid_main.c index f5f6e5fa0c3..cc4bfc6fd8a 100644 --- a/examples/uid/uid_main.c +++ b/examples/uid/uid_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/uid/uid_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/unionfs/CMakeLists.txt b/examples/unionfs/CMakeLists.txt index ee83848e962..10471bfb932 100644 --- a/examples/unionfs/CMakeLists.txt +++ b/examples/unionfs/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/unionfs/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/unionfs/Make.defs b/examples/unionfs/Make.defs index 6912a1078cb..73c0d1772cd 100644 --- a/examples/unionfs/Make.defs +++ b/examples/unionfs/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/unionfs/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/unionfs/Makefile b/examples/unionfs/Makefile index ba95b901c51..30064e69ca2 100644 --- a/examples/unionfs/Makefile +++ b/examples/unionfs/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/unionfs/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/unionfs/unionfs_main.c b/examples/unionfs/unionfs_main.c index 31397bc6183..b1a4a50209f 100644 --- a/examples/unionfs/unionfs_main.c +++ b/examples/unionfs/unionfs_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/unionfs/unionfs_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/usbserial/CMakeLists.txt b/examples/usbserial/CMakeLists.txt index 09c04a72be2..6ddd3a4fbdb 100644 --- a/examples/usbserial/CMakeLists.txt +++ b/examples/usbserial/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/usbserial/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/usbserial/Make.defs b/examples/usbserial/Make.defs index 44905ce5966..8fd759570cf 100644 --- a/examples/usbserial/Make.defs +++ b/examples/usbserial/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/usbserial/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/usbserial/Makefile b/examples/usbserial/Makefile index 808a11de374..3146fd11621 100644 --- a/examples/usbserial/Makefile +++ b/examples/usbserial/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/usbserial/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/usbserial/Makefile.host b/examples/usbserial/Makefile.host index 3f50bf1308d..d8bfb3eaacd 100644 --- a/examples/usbserial/Makefile.host +++ b/examples/usbserial/Makefile.host @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/usbserial/Makefile.host # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/usbserial/host.c b/examples/usbserial/host.c index 2b158a388d3..a001ef5eb7b 100644 --- a/examples/usbserial/host.c +++ b/examples/usbserial/host.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/usbserial/host.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/usbserial/usbserial_main.c b/examples/usbserial/usbserial_main.c index 443834a5428..66e4790b962 100644 --- a/examples/usbserial/usbserial_main.c +++ b/examples/usbserial/usbserial_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/usbserial/usbserial_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/userfs/CMakeLists.txt b/examples/userfs/CMakeLists.txt index 9f7f25e23e6..b594dbf7966 100644 --- a/examples/userfs/CMakeLists.txt +++ b/examples/userfs/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/userfs/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/userfs/Make.defs b/examples/userfs/Make.defs index b3f95459423..03ec72e7297 100644 --- a/examples/userfs/Make.defs +++ b/examples/userfs/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/userfs/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/userfs/Makefile b/examples/userfs/Makefile index 85cd484bac5..3b4e2e69bfc 100644 --- a/examples/userfs/Makefile +++ b/examples/userfs/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/userfs/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/userfs/userfs_main.c b/examples/userfs/userfs_main.c index f76c04ed059..a2cf97ea579 100644 --- a/examples/userfs/userfs_main.c +++ b/examples/userfs/userfs_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/userfs/userfs_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/usrsocktest/CMakeLists.txt b/examples/usrsocktest/CMakeLists.txt index 6a07dd6a7b3..a657ae2c8d3 100644 --- a/examples/usrsocktest/CMakeLists.txt +++ b/examples/usrsocktest/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/usrsocktest/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/usrsocktest/Make.defs b/examples/usrsocktest/Make.defs index 0ae117ac205..d107b19c366 100644 --- a/examples/usrsocktest/Make.defs +++ b/examples/usrsocktest/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/usrsocktest/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/usrsocktest/Makefile b/examples/usrsocktest/Makefile index 2840881fa5f..6d4a2b98bf6 100644 --- a/examples/usrsocktest/Makefile +++ b/examples/usrsocktest/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/usrsocktest/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/usrsocktest/defines.h b/examples/usrsocktest/defines.h index 84230f8b5d5..93814122343 100644 --- a/examples/usrsocktest/defines.h +++ b/examples/usrsocktest/defines.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/usrsocktest/defines.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/usrsocktest/usrsocktest_basic_connect.c b/examples/usrsocktest/usrsocktest_basic_connect.c index b6fef5afcd2..b3f651d122e 100644 --- a/examples/usrsocktest/usrsocktest_basic_connect.c +++ b/examples/usrsocktest/usrsocktest_basic_connect.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/usrsocktest/usrsocktest_basic_connect.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/usrsocktest/usrsocktest_basic_daemon.c b/examples/usrsocktest/usrsocktest_basic_daemon.c index 05561dd0cfd..35f0568e3ef 100644 --- a/examples/usrsocktest/usrsocktest_basic_daemon.c +++ b/examples/usrsocktest/usrsocktest_basic_daemon.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/usrsocktest/usrsocktest_basic_daemon.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/usrsocktest/usrsocktest_basic_getsockname.c b/examples/usrsocktest/usrsocktest_basic_getsockname.c index 91e0c6b9e44..ff6377c445f 100644 --- a/examples/usrsocktest/usrsocktest_basic_getsockname.c +++ b/examples/usrsocktest/usrsocktest_basic_getsockname.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/usrsocktest/usrsocktest_basic_getsockname.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/usrsocktest/usrsocktest_basic_getsockopt.c b/examples/usrsocktest/usrsocktest_basic_getsockopt.c index b1802e4bb77..1c6300d6e9f 100644 --- a/examples/usrsocktest/usrsocktest_basic_getsockopt.c +++ b/examples/usrsocktest/usrsocktest_basic_getsockopt.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/usrsocktest/usrsocktest_basic_getsockopt.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/usrsocktest/usrsocktest_basic_send.c b/examples/usrsocktest/usrsocktest_basic_send.c index d053e572e34..7a7fbb5a95f 100644 --- a/examples/usrsocktest/usrsocktest_basic_send.c +++ b/examples/usrsocktest/usrsocktest_basic_send.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/usrsocktest/usrsocktest_basic_send.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/usrsocktest/usrsocktest_basic_setsockopt.c b/examples/usrsocktest/usrsocktest_basic_setsockopt.c index e0e2e2cedde..f38e57db922 100644 --- a/examples/usrsocktest/usrsocktest_basic_setsockopt.c +++ b/examples/usrsocktest/usrsocktest_basic_setsockopt.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/usrsocktest/usrsocktest_basic_setsockopt.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/usrsocktest/usrsocktest_block_recv.c b/examples/usrsocktest/usrsocktest_block_recv.c index 6b534bdeecb..b3832724d30 100644 --- a/examples/usrsocktest/usrsocktest_block_recv.c +++ b/examples/usrsocktest/usrsocktest_block_recv.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/usrsocktest/usrsocktest_block_recv.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/usrsocktest/usrsocktest_block_send.c b/examples/usrsocktest/usrsocktest_block_send.c index a51fadb13d8..87d9d9e30f9 100644 --- a/examples/usrsocktest/usrsocktest_block_send.c +++ b/examples/usrsocktest/usrsocktest_block_send.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/usrsocktest/usrsocktest_block_send.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/usrsocktest/usrsocktest_chardev.c b/examples/usrsocktest/usrsocktest_chardev.c index 347944ebf24..9ba0eb41309 100644 --- a/examples/usrsocktest/usrsocktest_chardev.c +++ b/examples/usrsocktest/usrsocktest_chardev.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/usrsocktest/usrsocktest_chardev.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/usrsocktest/usrsocktest_daemon.c b/examples/usrsocktest/usrsocktest_daemon.c index ef6da99b930..3d84d8396c5 100644 --- a/examples/usrsocktest/usrsocktest_daemon.c +++ b/examples/usrsocktest/usrsocktest_daemon.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/usrsocktest/usrsocktest_daemon.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/usrsocktest/usrsocktest_main.c b/examples/usrsocktest/usrsocktest_main.c index 9545eac0733..d09036c386d 100644 --- a/examples/usrsocktest/usrsocktest_main.c +++ b/examples/usrsocktest/usrsocktest_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/usrsocktest/usrsocktest_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/usrsocktest/usrsocktest_multi_thread.c b/examples/usrsocktest/usrsocktest_multi_thread.c index 7daaa78769e..8c37643109d 100644 --- a/examples/usrsocktest/usrsocktest_multi_thread.c +++ b/examples/usrsocktest/usrsocktest_multi_thread.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/usrsocktest/usrsocktest_multi_thread.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/usrsocktest/usrsocktest_noblock_connect.c b/examples/usrsocktest/usrsocktest_noblock_connect.c index c534c7aa6fa..820ea9f50f4 100644 --- a/examples/usrsocktest/usrsocktest_noblock_connect.c +++ b/examples/usrsocktest/usrsocktest_noblock_connect.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/usrsocktest/usrsocktest_noblock_connect.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/usrsocktest/usrsocktest_noblock_recv.c b/examples/usrsocktest/usrsocktest_noblock_recv.c index 2ebabf43b05..146471d6ffe 100644 --- a/examples/usrsocktest/usrsocktest_noblock_recv.c +++ b/examples/usrsocktest/usrsocktest_noblock_recv.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/usrsocktest/usrsocktest_noblock_recv.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/usrsocktest/usrsocktest_noblock_send.c b/examples/usrsocktest/usrsocktest_noblock_send.c index ebde5fbbf09..7b039f3ae2b 100644 --- a/examples/usrsocktest/usrsocktest_noblock_send.c +++ b/examples/usrsocktest/usrsocktest_noblock_send.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/usrsocktest/usrsocktest_noblock_send.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/usrsocktest/usrsocktest_nodaemon.c b/examples/usrsocktest/usrsocktest_nodaemon.c index d5a256ab364..59c58465bd8 100644 --- a/examples/usrsocktest/usrsocktest_nodaemon.c +++ b/examples/usrsocktest/usrsocktest_nodaemon.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/usrsocktest/usrsocktest_nodaemon.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/usrsocktest/usrsocktest_poll.c b/examples/usrsocktest/usrsocktest_poll.c index 4203653c3eb..8ab7f6ce01e 100644 --- a/examples/usrsocktest/usrsocktest_poll.c +++ b/examples/usrsocktest/usrsocktest_poll.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/usrsocktest/usrsocktest_poll.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/usrsocktest/usrsocktest_remote_disconnect.c b/examples/usrsocktest/usrsocktest_remote_disconnect.c index 7c817e3af2d..1e3681f9d95 100644 --- a/examples/usrsocktest/usrsocktest_remote_disconnect.c +++ b/examples/usrsocktest/usrsocktest_remote_disconnect.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/usrsocktest/usrsocktest_remote_disconnect.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/usrsocktest/usrsocktest_wake_with_signal.c b/examples/usrsocktest/usrsocktest_wake_with_signal.c index 5a63b57f9e4..800eb571d43 100644 --- a/examples/usrsocktest/usrsocktest_wake_with_signal.c +++ b/examples/usrsocktest/usrsocktest_wake_with_signal.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/usrsocktest/usrsocktest_wake_with_signal.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/ustream/CMakeLists.txt b/examples/ustream/CMakeLists.txt index a335e1ce7f7..262c4770a6d 100644 --- a/examples/ustream/CMakeLists.txt +++ b/examples/ustream/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/ustream/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/ustream/Make.defs b/examples/ustream/Make.defs index 4cf4021f398..ec06c89a0f7 100644 --- a/examples/ustream/Make.defs +++ b/examples/ustream/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/ustream/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/ustream/Makefile b/examples/ustream/Makefile index 16206b21485..5be3c868664 100644 --- a/examples/ustream/Makefile +++ b/examples/ustream/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/ustream/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/ustream/ustream.h b/examples/ustream/ustream.h index f74bf48f410..193fa055179 100644 --- a/examples/ustream/ustream.h +++ b/examples/ustream/ustream.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/ustream/ustream.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/ustream/ustream_client.c b/examples/ustream/ustream_client.c index baad92d45b7..c7e69a56b34 100644 --- a/examples/ustream/ustream_client.c +++ b/examples/ustream/ustream_client.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/ustream/ustream_client.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/ustream/ustream_server.c b/examples/ustream/ustream_server.c index b1744a339b0..8f6fffe406c 100644 --- a/examples/ustream/ustream_server.c +++ b/examples/ustream/ustream_server.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/ustream/ustream_server.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/veml6070/CMakeLists.txt b/examples/veml6070/CMakeLists.txt index 47f513a2509..2edc1015d7b 100644 --- a/examples/veml6070/CMakeLists.txt +++ b/examples/veml6070/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/veml6070/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/veml6070/Make.defs b/examples/veml6070/Make.defs index a2e051e4017..4b4c59a9d5e 100644 --- a/examples/veml6070/Make.defs +++ b/examples/veml6070/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/veml6070/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/veml6070/Makefile b/examples/veml6070/Makefile index 32195bf7266..1a68781c311 100644 --- a/examples/veml6070/Makefile +++ b/examples/veml6070/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/veml6070/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/veml6070/veml6070_main.c b/examples/veml6070/veml6070_main.c index facacce5e5f..da5f23b3270 100644 --- a/examples/veml6070/veml6070_main.c +++ b/examples/veml6070/veml6070_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/veml6070/veml6070_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/wamr_module/CMakeLists.txt b/examples/wamr_module/CMakeLists.txt index 540ce7f4062..8319424a62d 100644 --- a/examples/wamr_module/CMakeLists.txt +++ b/examples/wamr_module/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/wamr_module/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/wamr_module/Make.defs b/examples/wamr_module/Make.defs index f4464946cc8..7d4e5e27423 100644 --- a/examples/wamr_module/Make.defs +++ b/examples/wamr_module/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/wamr_module/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/wamr_module/Makefile b/examples/wamr_module/Makefile index 56777bd4e38..448a5e066a3 100644 --- a/examples/wamr_module/Makefile +++ b/examples/wamr_module/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/wamr_module/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/wamr_module/module_hello.c b/examples/wamr_module/module_hello.c index dde411f0bef..a406e297882 100644 --- a/examples/wamr_module/module_hello.c +++ b/examples/wamr_module/module_hello.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/wamr_module/module_hello.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/watchdog/CMakeLists.txt b/examples/watchdog/CMakeLists.txt index 47ad53cd9b2..f879250e5e6 100644 --- a/examples/watchdog/CMakeLists.txt +++ b/examples/watchdog/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/watchdog/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/watchdog/Make.defs b/examples/watchdog/Make.defs index c18a8f2416b..fbf7ad3be68 100644 --- a/examples/watchdog/Make.defs +++ b/examples/watchdog/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/watchdog/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/watchdog/Makefile b/examples/watchdog/Makefile index b8fca35de3a..ccb004a44ff 100644 --- a/examples/watchdog/Makefile +++ b/examples/watchdog/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/watchdog/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/watchdog/watchdog.h b/examples/watchdog/watchdog.h index 7c90ca6ff8e..45c66065d58 100644 --- a/examples/watchdog/watchdog.h +++ b/examples/watchdog/watchdog.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/watchdog/watchdog.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/watchdog/watchdog_main.c b/examples/watchdog/watchdog_main.c index 61108870223..06a36c75d93 100644 --- a/examples/watchdog/watchdog_main.c +++ b/examples/watchdog/watchdog_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/watchdog/watchdog_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/watched/CMakeLists.txt b/examples/watched/CMakeLists.txt index 05127529a3d..e6c89fa70c3 100644 --- a/examples/watched/CMakeLists.txt +++ b/examples/watched/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/watched/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/watched/Make.defs b/examples/watched/Make.defs index 62edd875750..530221fd02b 100644 --- a/examples/watched/Make.defs +++ b/examples/watched/Make.defs @@ -1,6 +1,7 @@ ############################################################################ # apps/examples/watched/Make.defs -# Adds selected applications to apps/ build +# +# SPDX-License-Identifier: Apache-2.0 # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with diff --git a/examples/watched/Makefile b/examples/watched/Makefile index 7d0a746ebe8..d3407607151 100644 --- a/examples/watched/Makefile +++ b/examples/watched/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/watched/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The @@ -32,4 +34,4 @@ MODULE = $(CONFIG_EXAMPLES_WATCHED) CSRCS = watched.c MAINSRC = watched_main.c -include $(APPDIR)/Application.mk \ No newline at end of file +include $(APPDIR)/Application.mk diff --git a/examples/watched/watched.c b/examples/watched/watched.c index 2f6a49df72a..cad7095c0e8 100644 --- a/examples/watched/watched.c +++ b/examples/watched/watched.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/watched/watched.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/watched/watched.h b/examples/watched/watched.h index c49907b9d76..e483bd7e230 100644 --- a/examples/watched/watched.h +++ b/examples/watched/watched.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/watched/watched.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/watched/watched_main.c b/examples/watched/watched_main.c index 80994f645ad..343f636fe0f 100644 --- a/examples/watched/watched_main.c +++ b/examples/watched/watched_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/watched/watched_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/watcher/CMakeLists.txt b/examples/watcher/CMakeLists.txt index 4f4a526dbc4..daf17f48466 100644 --- a/examples/watcher/CMakeLists.txt +++ b/examples/watcher/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/watcher/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/watcher/Make.defs b/examples/watcher/Make.defs index 0b605297d54..6f929a790ff 100644 --- a/examples/watcher/Make.defs +++ b/examples/watcher/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/watcher/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/watcher/Makefile b/examples/watcher/Makefile index 90f885000ed..99f97f94391 100644 --- a/examples/watcher/Makefile +++ b/examples/watcher/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/watcher/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/watcher/ramdisk.c b/examples/watcher/ramdisk.c index 717103eaf39..78dbf10da59 100644 --- a/examples/watcher/ramdisk.c +++ b/examples/watcher/ramdisk.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/watcher/ramdisk.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/watcher/ramdisk.h b/examples/watcher/ramdisk.h index bf10ba65559..07d16ccc253 100644 --- a/examples/watcher/ramdisk.h +++ b/examples/watcher/ramdisk.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/watcher/ramdisk.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/watcher/task_mn.c b/examples/watcher/task_mn.c index 973cdd1e5b7..1d402c7169b 100644 --- a/examples/watcher/task_mn.c +++ b/examples/watcher/task_mn.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/watcher/task_mn.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/watcher/task_mn.h b/examples/watcher/task_mn.h index d2439fedcdc..f8d94075572 100644 --- a/examples/watcher/task_mn.h +++ b/examples/watcher/task_mn.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/watcher/task_mn.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/watcher/watcher_main.c b/examples/watcher/watcher_main.c index 66811169dd9..1fa4b259a52 100644 --- a/examples/watcher/watcher_main.c +++ b/examples/watcher/watcher_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/watcher/watcher_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/watcher/wdt.c b/examples/watcher/wdt.c index 0d055c52782..ccfbeaa9853 100644 --- a/examples/watcher/wdt.c +++ b/examples/watcher/wdt.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/watcher/wdt.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/watcher/wdt.h b/examples/watcher/wdt.h index 2d203958d2e..9f86c22d40c 100644 --- a/examples/watcher/wdt.h +++ b/examples/watcher/wdt.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/watcher/wdt.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/webserver/CMakeLists.txt b/examples/webserver/CMakeLists.txt index ea4d3999a9e..7020d25bf1a 100644 --- a/examples/webserver/CMakeLists.txt +++ b/examples/webserver/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/webserver/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/webserver/Make.defs b/examples/webserver/Make.defs index b4eee076c46..6150f426298 100644 --- a/examples/webserver/Make.defs +++ b/examples/webserver/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/webserver/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/webserver/Makefile b/examples/webserver/Makefile index 41bc984214a..d07ef23debd 100644 --- a/examples/webserver/Makefile +++ b/examples/webserver/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/webserver/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/webserver/cgi.c b/examples/webserver/cgi.c index 46d2871e115..2b113d5b0ff 100644 --- a/examples/webserver/cgi.c +++ b/examples/webserver/cgi.c @@ -1,10 +1,9 @@ /**************************************************************************** * apps/examples/webserver/cgi.c - * Web server script interface - * Author: Adam Dunkels * - * Copyright (c) 2001-2006, Adam Dunkels. - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2001-2006, Adam Dunkels. All rights reserved. + * SPDX-FileContributor: Adam Dunkels * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/examples/webserver/cgi.h b/examples/webserver/cgi.h index 1f0dae9ed52..d1988782103 100644 --- a/examples/webserver/cgi.h +++ b/examples/webserver/cgi.h @@ -1,10 +1,9 @@ /**************************************************************************** * apps/examples/webserver/cgi.h - * Web server script interface header file - * Author: Adam Dunkels * - * Copyright (c) 2001, Adam Dunkels. - * All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2001-2006, Adam Dunkels. All rights reserved. + * SPDX-FileContributor: Adam Dunkels * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/examples/wget/CMakeLists.txt b/examples/wget/CMakeLists.txt index fdae9900597..f62ebb35580 100644 --- a/examples/wget/CMakeLists.txt +++ b/examples/wget/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/wget/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/wget/Make.defs b/examples/wget/Make.defs index 7ee796a10c7..ffdb661794c 100644 --- a/examples/wget/Make.defs +++ b/examples/wget/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/wget/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/wget/Makefile b/examples/wget/Makefile index 4cb01370c07..19309dfcbff 100644 --- a/examples/wget/Makefile +++ b/examples/wget/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/wget/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/wget/wget_main.c b/examples/wget/wget_main.c index d8c8c29c888..53a970c6e94 100644 --- a/examples/wget/wget_main.c +++ b/examples/wget/wget_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/wget/wget_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/wgetjson/CMakeLists.txt b/examples/wgetjson/CMakeLists.txt index 2574e3735ad..e131d013f23 100644 --- a/examples/wgetjson/CMakeLists.txt +++ b/examples/wgetjson/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/wgetjson/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/wgetjson/Make.defs b/examples/wgetjson/Make.defs index d0b2be3ce13..e3786b6998e 100644 --- a/examples/wgetjson/Make.defs +++ b/examples/wgetjson/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/wgetjson/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/wgetjson/Makefile b/examples/wgetjson/Makefile index a5cce7d9d39..5a87b9b7733 100644 --- a/examples/wgetjson/Makefile +++ b/examples/wgetjson/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/wgetjson/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/wgetjson/wgetjson_main.c b/examples/wgetjson/wgetjson_main.c index 4e2dbe38b00..860a0fb5b4a 100644 --- a/examples/wgetjson/wgetjson_main.c +++ b/examples/wgetjson/wgetjson_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/wgetjson/wgetjson_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/wiegand/Make.defs b/examples/wiegand/Make.defs index d509235d29c..3fc0ce9d1ca 100644 --- a/examples/wiegand/Make.defs +++ b/examples/wiegand/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/wiegand/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/wiegand/Makefile b/examples/wiegand/Makefile index 50c7a24e092..bc4c3ed8f83 100644 --- a/examples/wiegand/Makefile +++ b/examples/wiegand/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/wiegand/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/wiegand/wiegand.c b/examples/wiegand/wiegand.c index 9c912f6716e..8beee23dad5 100644 --- a/examples/wiegand/wiegand.c +++ b/examples/wiegand/wiegand.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/wiegand/wiegand.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/ws2812/CMakeLists.txt b/examples/ws2812/CMakeLists.txt index d80cb3b8456..8f6ad89043b 100644 --- a/examples/ws2812/CMakeLists.txt +++ b/examples/ws2812/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/ws2812/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/ws2812/Make.defs b/examples/ws2812/Make.defs index 8dbaa2b1390..888daea231e 100644 --- a/examples/ws2812/Make.defs +++ b/examples/ws2812/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/ws2812/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/ws2812/Makefile b/examples/ws2812/Makefile index 47067476139..0abf2c590cb 100644 --- a/examples/ws2812/Makefile +++ b/examples/ws2812/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/ws2812/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/ws2812/ws2812_main.c b/examples/ws2812/ws2812_main.c index 0bef6d344c8..438e68f119d 100644 --- a/examples/ws2812/ws2812_main.c +++ b/examples/ws2812/ws2812_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/ws2812/ws2812_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/ws2812esp32rmt/CMakeLists.txt b/examples/ws2812esp32rmt/CMakeLists.txt index 11cb695b304..4834b46b692 100644 --- a/examples/ws2812esp32rmt/CMakeLists.txt +++ b/examples/ws2812esp32rmt/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/ws2812esp32rmt/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/ws2812esp32rmt/Make.defs b/examples/ws2812esp32rmt/Make.defs index ddb06ef5838..6216a183d5d 100644 --- a/examples/ws2812esp32rmt/Make.defs +++ b/examples/ws2812esp32rmt/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/ws2812esp32rmt/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/ws2812esp32rmt/Makefile b/examples/ws2812esp32rmt/Makefile index fe1656cf8c8..27da0eb28bb 100644 --- a/examples/ws2812esp32rmt/Makefile +++ b/examples/ws2812esp32rmt/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/ws2812esp32rmt/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/ws2812esp32rmt/ws2812esp32rmt_main.c b/examples/ws2812esp32rmt/ws2812esp32rmt_main.c index 892c135c8b7..3f451436e22 100644 --- a/examples/ws2812esp32rmt/ws2812esp32rmt_main.c +++ b/examples/ws2812esp32rmt/ws2812esp32rmt_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/ws2812esp32rmt/ws2812esp32rmt_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/examples/xbc_test/CMakeLists.txt b/examples/xbc_test/CMakeLists.txt index fc2689b505c..fac0a8c7712 100644 --- a/examples/xbc_test/CMakeLists.txt +++ b/examples/xbc_test/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/xbc_test/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this @@ -18,10 +20,6 @@ # # ############################################################################## -# POSSIBILITY OF SUCH DAMAGE. -# -# ############################################################################## - if(CONFIG_EXAMPLES_XBC_TEST) nuttx_add_application( NAME diff --git a/examples/xbc_test/Make.defs b/examples/xbc_test/Make.defs index b0b6369fdd9..5e94cf0b6bd 100644 --- a/examples/xbc_test/Make.defs +++ b/examples/xbc_test/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/xbc_test/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/xbc_test/Makefile b/examples/xbc_test/Makefile index 25572ec6b37..75032b94219 100644 --- a/examples/xbc_test/Makefile +++ b/examples/xbc_test/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/xbc_test/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/xbc_test/xbc_test_main.c b/examples/xbc_test/xbc_test_main.c index c8ce2108347..691747e069d 100644 --- a/examples/xbc_test/xbc_test_main.c +++ b/examples/xbc_test/xbc_test_main.c @@ -1,11 +1,11 @@ /**************************************************************************** * apps/examples/xbc_test/xbc_test_main.c * - * Copyright (C) 2008, 2011-2012 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Copyright (C) 2017 Brian Webb. All rights reserved. - * Author: Brian Webb + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2017 Brian Webb. All rights reserved. + * SPDX-FileCopyrightText: 2008, 2011-2012 Gregory Nutt. All rights reserved. + * SPDX-FileContributor: Gregory Nutt + * SPDX-FileContributor: Brian Webb * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/examples/xmlrpc/CMakeLists.txt b/examples/xmlrpc/CMakeLists.txt index 322d0c84ce5..9cd0df950ae 100644 --- a/examples/xmlrpc/CMakeLists.txt +++ b/examples/xmlrpc/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/xmlrpc/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/xmlrpc/Make.defs b/examples/xmlrpc/Make.defs index c2c2435fbf5..9a3918d1589 100644 --- a/examples/xmlrpc/Make.defs +++ b/examples/xmlrpc/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/xmlrpc/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/xmlrpc/Makefile b/examples/xmlrpc/Makefile index 4a4e7623e91..9951eb94993 100644 --- a/examples/xmlrpc/Makefile +++ b/examples/xmlrpc/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/xmlrpc/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/xmlrpc/calls.c b/examples/xmlrpc/calls.c index d7cef91722e..41ac1a5fed3 100644 --- a/examples/xmlrpc/calls.c +++ b/examples/xmlrpc/calls.c @@ -1,14 +1,10 @@ /**************************************************************************** * apps/examples/xmlrpc/calls.c * - * Copyright (C) 2012 Max Holtzberg. All rights reserved. - * Author: Max Holtzberg - * - * Based on the embeddable lightweight XML-RPC server code discussed - * in the article at: http://www.drdobbs.com/web-development/\ - * an-embeddable-lightweight-xml-rpc-server/184405364 - * - * Copyright (c) 2002 Cogito LLC. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2012 Max Holtzberg. All rights reserved. + * SPDX-FileCopyrightText: 2002 Cogito LLC. All rights reserved. + * SPDX-FileContributor: Max Holtzberg * * Redistribution and use in source and binary forms, with or * without modification, is hereby granted without fee provided @@ -40,6 +36,11 @@ * POSSIBILITY OF SUCH DAMAGE. ****************************************************************************/ +/* Based on the embeddable lightweight XML-RPC server code discussed + * in the article at: http://www.drdobbs.com/web-development/\ + * an-embeddable-lightweight-xml-rpc-server/184405364 + */ + /**************************************************************************** * Included Files ****************************************************************************/ diff --git a/examples/xmlrpc/xmlrpc_main.c b/examples/xmlrpc/xmlrpc_main.c index 9f9df54f4a8..2147e095f31 100644 --- a/examples/xmlrpc/xmlrpc_main.c +++ b/examples/xmlrpc/xmlrpc_main.c @@ -1,15 +1,11 @@ /**************************************************************************** * apps/examples/xmlrpc/xmlrpc_main.c * - * Copyright (C) 2012 Max Holtzberg. All rights reserved. - * Copyright (C) 2015 Gregory Nutt. All rights reserved. - * Author: Max Holtzberg - * - * Based on the embeddable lightweight XML-RPC server code discussed - * in the article at: http://www.drdobbs.com/web-development/\ - * an-embeddable-lightweight-xml-rpc-server/184405364 - * - * Copyright (c) 2002 Cogito LLC. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2012 Max Holtzberg. All rights reserved. + * SPDX-FileCopyrightText: 2015 Gregory Nutt. All rights reserved. + * SPDX-FileCopyrightText: 2002 Cogito LLC. All rights reserved. + * SPDX-FileContributor: Max Holtzberg * * Redistribution and use in source and binary forms, with or * without modification, is hereby granted without fee provided @@ -41,6 +37,10 @@ * POSSIBILITY OF SUCH DAMAGE. ****************************************************************************/ +/* Based on the embeddable lightweight XML-RPC server code discussed + * in the article at: http://www.drdobbs.com/web-development/\ + * an-embeddable-lightweight-xml-rpc-server/184405364 + */ /* Lightweight Embedded XML-RPC Server main * * mtj@cogitollc.com diff --git a/examples/zerocross/CMakeLists.txt b/examples/zerocross/CMakeLists.txt index 946ad7483fa..f77c12bfbbc 100644 --- a/examples/zerocross/CMakeLists.txt +++ b/examples/zerocross/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/zerocross/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/examples/zerocross/Make.defs b/examples/zerocross/Make.defs index f967a31886c..5ca4c7c1636 100644 --- a/examples/zerocross/Make.defs +++ b/examples/zerocross/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/zerocross/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/zerocross/Makefile b/examples/zerocross/Makefile index 62d83ef5eb8..773fa6eb1a8 100644 --- a/examples/zerocross/Makefile +++ b/examples/zerocross/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/zerocross/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/zerocross/zerocross_main.c b/examples/zerocross/zerocross_main.c index 0d9cb02bde3..d2f49fa5b8e 100644 --- a/examples/zerocross/zerocross_main.c +++ b/examples/zerocross/zerocross_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/zerocross/zerocross_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The From c341185423ac0085fd2869ad596dcf8b0aeb74bc Mon Sep 17 00:00:00 2001 From: Alin Jerpelea Date: Sun, 29 Dec 2024 12:20:13 +0100 Subject: [PATCH 100/391] apps: migrate to SPDX identifier Most tools used for compliance and SBOM generation use SPDX identifiers This change brings us a step closer to an easy SBOM generation. Signed-off-by: Alin Jerpelea --- Application.mk | 2 ++ CMakeLists.txt | 2 ++ Directory.mk | 2 ++ Make.defs | 2 ++ Makefile | 2 ++ config.nims | 2 ++ 6 files changed, 12 insertions(+) diff --git a/Application.mk b/Application.mk index b73d1a68454..e993006441d 100644 --- a/Application.mk +++ b/Application.mk @@ -1,6 +1,8 @@ ############################################################################ # apps/Application.mk # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/CMakeLists.txt b/CMakeLists.txt index f35203b3ee8..e36d9f68f6c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/Directory.mk b/Directory.mk index 87a80d7bd12..ff42d23907a 100644 --- a/Directory.mk +++ b/Directory.mk @@ -1,6 +1,8 @@ ############################################################################ # apps/Directory.mk # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/Make.defs b/Make.defs index 695dfa2be7a..ab79ce71cb5 100644 --- a/Make.defs +++ b/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/Makefile b/Makefile index b2b90c7c49e..5a357053891 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/config.nims b/config.nims index 1bf0ac25b05..2d96ca3905c 100644 --- a/config.nims +++ b/config.nims @@ -1,6 +1,8 @@ ############################################################################ # apps/config.nims # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The From 27d8ae36ba1738d84df21f7e97f05d2dda0dd2ba Mon Sep 17 00:00:00 2001 From: Alin Jerpelea Date: Sun, 29 Dec 2024 12:24:52 +0100 Subject: [PATCH 101/391] nshlib: migrate to SPDX identifier Most tools used for compliance and SBOM generation use SPDX identifiers This change brings us a step closer to an easy SBOM generation. Signed-off-by: Alin Jerpelea --- nshlib/CMakeLists.txt | 2 ++ nshlib/Make.defs | 2 ++ nshlib/Makefile | 2 ++ nshlib/nsh.h | 2 ++ nshlib/nsh_alias.c | 2 ++ nshlib/nsh_altconsole.c | 2 ++ nshlib/nsh_builtin.c | 2 ++ nshlib/nsh_codeccmd.c | 2 ++ nshlib/nsh_command.c | 2 ++ nshlib/nsh_console.c | 2 ++ nshlib/nsh_console.h | 2 ++ nshlib/nsh_consolemain.c | 2 ++ nshlib/nsh_dbgcmds.c | 2 ++ nshlib/nsh_ddcmd.c | 2 ++ nshlib/nsh_envcmds.c | 2 ++ nshlib/nsh_fileapps.c | 2 ++ nshlib/nsh_fscmds.c | 2 ++ nshlib/nsh_fsutils.c | 2 ++ nshlib/nsh_init.c | 2 ++ nshlib/nsh_login.c | 2 ++ nshlib/nsh_mmcmds.c | 2 ++ nshlib/nsh_mntcmds.c | 2 ++ nshlib/nsh_modcmds.c | 2 ++ nshlib/nsh_netcmds.c | 2 ++ nshlib/nsh_parse.c | 2 ++ nshlib/nsh_passwdcmds.c | 2 ++ nshlib/nsh_printf.c | 2 ++ nshlib/nsh_proccmds.c | 2 ++ nshlib/nsh_prompt.c | 2 ++ nshlib/nsh_routecmds.c | 2 ++ nshlib/nsh_script.c | 2 ++ nshlib/nsh_session.c | 2 ++ nshlib/nsh_syscmds.c | 2 ++ nshlib/nsh_system.c | 2 ++ nshlib/nsh_telnetd.c | 2 ++ nshlib/nsh_telnetlogin.c | 2 ++ nshlib/nsh_test.c | 2 ++ nshlib/nsh_timcmds.c | 2 ++ nshlib/nsh_usbconsole.c | 2 ++ nshlib/nsh_usbtrace.c | 2 ++ nshlib/nsh_vars.c | 2 ++ nshlib/nsh_wait.c | 2 ++ 42 files changed, 84 insertions(+) diff --git a/nshlib/CMakeLists.txt b/nshlib/CMakeLists.txt index b7d3fc50d88..d09df277d7d 100644 --- a/nshlib/CMakeLists.txt +++ b/nshlib/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/nshlib/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/nshlib/Make.defs b/nshlib/Make.defs index 8eae4359edc..6f10f0272e3 100644 --- a/nshlib/Make.defs +++ b/nshlib/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/nshlib/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/nshlib/Makefile b/nshlib/Makefile index 808d63af500..917d8baeb28 100644 --- a/nshlib/Makefile +++ b/nshlib/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/nshlib/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/nshlib/nsh.h b/nshlib/nsh.h index 42b7167c2e3..ef33088acc2 100644 --- a/nshlib/nsh.h +++ b/nshlib/nsh.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/nshlib/nsh.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/nshlib/nsh_alias.c b/nshlib/nsh_alias.c index 0024548da63..6c800f6c2ad 100644 --- a/nshlib/nsh_alias.c +++ b/nshlib/nsh_alias.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/nshlib/nsh_alias.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/nshlib/nsh_altconsole.c b/nshlib/nsh_altconsole.c index 3e2c9335b7a..7423fedf739 100644 --- a/nshlib/nsh_altconsole.c +++ b/nshlib/nsh_altconsole.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/nshlib/nsh_altconsole.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/nshlib/nsh_builtin.c b/nshlib/nsh_builtin.c index cfd95120711..6ff8f99a6be 100644 --- a/nshlib/nsh_builtin.c +++ b/nshlib/nsh_builtin.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/nshlib/nsh_builtin.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/nshlib/nsh_codeccmd.c b/nshlib/nsh_codeccmd.c index 859405d5c61..796bcffd9df 100644 --- a/nshlib/nsh_codeccmd.c +++ b/nshlib/nsh_codeccmd.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/nshlib/nsh_codeccmd.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/nshlib/nsh_command.c b/nshlib/nsh_command.c index 69fd54a92ea..3a91a1c2f5a 100644 --- a/nshlib/nsh_command.c +++ b/nshlib/nsh_command.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/nshlib/nsh_command.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/nshlib/nsh_console.c b/nshlib/nsh_console.c index ffa05864068..2d8c315adfe 100644 --- a/nshlib/nsh_console.c +++ b/nshlib/nsh_console.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/nshlib/nsh_console.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/nshlib/nsh_console.h b/nshlib/nsh_console.h index 9d305be014b..1a9ccf034d3 100644 --- a/nshlib/nsh_console.h +++ b/nshlib/nsh_console.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/nshlib/nsh_console.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/nshlib/nsh_consolemain.c b/nshlib/nsh_consolemain.c index 23c650d878e..d58f457e309 100644 --- a/nshlib/nsh_consolemain.c +++ b/nshlib/nsh_consolemain.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/nshlib/nsh_consolemain.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/nshlib/nsh_dbgcmds.c b/nshlib/nsh_dbgcmds.c index ada21293b1c..8f2f0e21520 100644 --- a/nshlib/nsh_dbgcmds.c +++ b/nshlib/nsh_dbgcmds.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/nshlib/nsh_dbgcmds.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/nshlib/nsh_ddcmd.c b/nshlib/nsh_ddcmd.c index 4f43a1a4524..d24aac52bb8 100644 --- a/nshlib/nsh_ddcmd.c +++ b/nshlib/nsh_ddcmd.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/nshlib/nsh_ddcmd.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/nshlib/nsh_envcmds.c b/nshlib/nsh_envcmds.c index 331af3e9f9e..d2378bb381e 100644 --- a/nshlib/nsh_envcmds.c +++ b/nshlib/nsh_envcmds.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/nshlib/nsh_envcmds.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/nshlib/nsh_fileapps.c b/nshlib/nsh_fileapps.c index d49810a9d61..54efd6de2b4 100644 --- a/nshlib/nsh_fileapps.c +++ b/nshlib/nsh_fileapps.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/nshlib/nsh_fileapps.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/nshlib/nsh_fscmds.c b/nshlib/nsh_fscmds.c index aef6fd72f62..60b88e6ddd0 100644 --- a/nshlib/nsh_fscmds.c +++ b/nshlib/nsh_fscmds.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/nshlib/nsh_fscmds.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/nshlib/nsh_fsutils.c b/nshlib/nsh_fsutils.c index 48ddf74c8c5..99e9487848d 100644 --- a/nshlib/nsh_fsutils.c +++ b/nshlib/nsh_fsutils.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/nshlib/nsh_fsutils.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/nshlib/nsh_init.c b/nshlib/nsh_init.c index 5904269e466..4846ff15b97 100644 --- a/nshlib/nsh_init.c +++ b/nshlib/nsh_init.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/nshlib/nsh_init.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/nshlib/nsh_login.c b/nshlib/nsh_login.c index 0b59963676b..74876fc3d74 100644 --- a/nshlib/nsh_login.c +++ b/nshlib/nsh_login.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/nshlib/nsh_login.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/nshlib/nsh_mmcmds.c b/nshlib/nsh_mmcmds.c index e84f6f5999f..518702b0767 100644 --- a/nshlib/nsh_mmcmds.c +++ b/nshlib/nsh_mmcmds.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/nshlib/nsh_mmcmds.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/nshlib/nsh_mntcmds.c b/nshlib/nsh_mntcmds.c index 305ffdd9365..62579d8b7da 100644 --- a/nshlib/nsh_mntcmds.c +++ b/nshlib/nsh_mntcmds.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/nshlib/nsh_mntcmds.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/nshlib/nsh_modcmds.c b/nshlib/nsh_modcmds.c index 6b935e877c1..4c38dff7906 100644 --- a/nshlib/nsh_modcmds.c +++ b/nshlib/nsh_modcmds.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/nshlib/nsh_modcmds.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/nshlib/nsh_netcmds.c b/nshlib/nsh_netcmds.c index cc49771c76a..791e1c922e3 100644 --- a/nshlib/nsh_netcmds.c +++ b/nshlib/nsh_netcmds.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/nshlib/nsh_netcmds.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/nshlib/nsh_parse.c b/nshlib/nsh_parse.c index f6bff1b29c9..f6922b116ef 100644 --- a/nshlib/nsh_parse.c +++ b/nshlib/nsh_parse.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/nshlib/nsh_parse.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/nshlib/nsh_passwdcmds.c b/nshlib/nsh_passwdcmds.c index 889f13f778c..5c7f86ed23f 100644 --- a/nshlib/nsh_passwdcmds.c +++ b/nshlib/nsh_passwdcmds.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/nshlib/nsh_passwdcmds.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/nshlib/nsh_printf.c b/nshlib/nsh_printf.c index bb088e76464..dbd8f09a501 100644 --- a/nshlib/nsh_printf.c +++ b/nshlib/nsh_printf.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/nshlib/nsh_printf.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/nshlib/nsh_proccmds.c b/nshlib/nsh_proccmds.c index 497aa0e00e7..8811357f55b 100644 --- a/nshlib/nsh_proccmds.c +++ b/nshlib/nsh_proccmds.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/nshlib/nsh_proccmds.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/nshlib/nsh_prompt.c b/nshlib/nsh_prompt.c index 964534e1c10..4dfe24c3c30 100644 --- a/nshlib/nsh_prompt.c +++ b/nshlib/nsh_prompt.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/nshlib/nsh_prompt.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/nshlib/nsh_routecmds.c b/nshlib/nsh_routecmds.c index 51c2a70612f..538b1105cf9 100644 --- a/nshlib/nsh_routecmds.c +++ b/nshlib/nsh_routecmds.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/nshlib/nsh_routecmds.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/nshlib/nsh_script.c b/nshlib/nsh_script.c index b9a210dff06..52ab377a557 100644 --- a/nshlib/nsh_script.c +++ b/nshlib/nsh_script.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/nshlib/nsh_script.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/nshlib/nsh_session.c b/nshlib/nsh_session.c index b9ac839c00e..761f84a04d2 100644 --- a/nshlib/nsh_session.c +++ b/nshlib/nsh_session.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/nshlib/nsh_session.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/nshlib/nsh_syscmds.c b/nshlib/nsh_syscmds.c index 7c7156aadc3..7990a2b392d 100644 --- a/nshlib/nsh_syscmds.c +++ b/nshlib/nsh_syscmds.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/nshlib/nsh_syscmds.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/nshlib/nsh_system.c b/nshlib/nsh_system.c index 26aaecbd268..902e8f5a5f7 100644 --- a/nshlib/nsh_system.c +++ b/nshlib/nsh_system.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/nshlib/nsh_system.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/nshlib/nsh_telnetd.c b/nshlib/nsh_telnetd.c index 371993474ff..62f87e47966 100644 --- a/nshlib/nsh_telnetd.c +++ b/nshlib/nsh_telnetd.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/nshlib/nsh_telnetd.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/nshlib/nsh_telnetlogin.c b/nshlib/nsh_telnetlogin.c index 4fc2a4af0c1..9e23cbc26e0 100644 --- a/nshlib/nsh_telnetlogin.c +++ b/nshlib/nsh_telnetlogin.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/nshlib/nsh_telnetlogin.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/nshlib/nsh_test.c b/nshlib/nsh_test.c index b04dfdbf282..242d730c2ff 100644 --- a/nshlib/nsh_test.c +++ b/nshlib/nsh_test.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/nshlib/nsh_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/nshlib/nsh_timcmds.c b/nshlib/nsh_timcmds.c index 3c54ca538a6..cd1bbc378a3 100644 --- a/nshlib/nsh_timcmds.c +++ b/nshlib/nsh_timcmds.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/nshlib/nsh_timcmds.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/nshlib/nsh_usbconsole.c b/nshlib/nsh_usbconsole.c index a111858409e..cc7f97005fa 100644 --- a/nshlib/nsh_usbconsole.c +++ b/nshlib/nsh_usbconsole.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/nshlib/nsh_usbconsole.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/nshlib/nsh_usbtrace.c b/nshlib/nsh_usbtrace.c index 3faaae348c2..df05d45a396 100644 --- a/nshlib/nsh_usbtrace.c +++ b/nshlib/nsh_usbtrace.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/nshlib/nsh_usbtrace.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/nshlib/nsh_vars.c b/nshlib/nsh_vars.c index 57ed512cf23..f940d64a319 100644 --- a/nshlib/nsh_vars.c +++ b/nshlib/nsh_vars.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/nshlib/nsh_vars.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/nshlib/nsh_wait.c b/nshlib/nsh_wait.c index 08106736b23..d6d1de039ec 100644 --- a/nshlib/nsh_wait.c +++ b/nshlib/nsh_wait.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/nshlib/nsh_wait.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The From 4a28a0b693c36a3d83f21f2fac8e997dc2a180dc Mon Sep 17 00:00:00 2001 From: Alin Jerpelea Date: Sun, 29 Dec 2024 12:26:31 +0100 Subject: [PATCH 102/391] platform: migrate to SPDX identifier Most tools used for compliance and SBOM generation use SPDX identifiers This change brings us a step closer to an easy SBOM generation. Signed-off-by: Alin Jerpelea --- platform/CMakeLists.txt | 2 ++ platform/Make.defs | 2 ++ platform/Makefile | 2 ++ platform/bin/Makefile | 2 ++ platform/dummy/Make.defs | 2 ++ platform/dummy/dummy.c | 2 ++ platform/mikroe-stm32f4/Make.defs | 2 ++ platform/mikroe-stm32f4/mikroe_configdata.c | 2 ++ 8 files changed, 16 insertions(+) diff --git a/platform/CMakeLists.txt b/platform/CMakeLists.txt index 847f5778723..91b1f751e76 100644 --- a/platform/CMakeLists.txt +++ b/platform/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/platform/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/platform/Make.defs b/platform/Make.defs index 7e995f82d73..f72db3a4327 100644 --- a/platform/Make.defs +++ b/platform/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/platform/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/platform/Makefile b/platform/Makefile index 8260ad92cd3..8faa82e6967 100644 --- a/platform/Makefile +++ b/platform/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/platform/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/platform/bin/Makefile b/platform/bin/Makefile index f3a01b1eae3..b0d16be83f2 100644 --- a/platform/bin/Makefile +++ b/platform/bin/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/platform/bin/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/platform/dummy/Make.defs b/platform/dummy/Make.defs index 78274ee33b7..aeb565e7791 100644 --- a/platform/dummy/Make.defs +++ b/platform/dummy/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/platform/dummy/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/platform/dummy/dummy.c b/platform/dummy/dummy.c index 229d8eb4340..b3e127f358d 100644 --- a/platform/dummy/dummy.c +++ b/platform/dummy/dummy.c @@ -1,6 +1,8 @@ /*************************************************************************** * apps/platform/dummy/dummy.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/platform/mikroe-stm32f4/Make.defs b/platform/mikroe-stm32f4/Make.defs index 09dedc7b812..90662205dfc 100644 --- a/platform/mikroe-stm32f4/Make.defs +++ b/platform/mikroe-stm32f4/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/platform/mikroe-stm32f4/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/platform/mikroe-stm32f4/mikroe_configdata.c b/platform/mikroe-stm32f4/mikroe_configdata.c index 79ebc1987d1..b6d9bb6fc3b 100644 --- a/platform/mikroe-stm32f4/mikroe_configdata.c +++ b/platform/mikroe-stm32f4/mikroe_configdata.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/platform/mikroe-stm32f4/mikroe_configdata.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The From 209ff8e402d4edc761626e45bcc82b61b059659a Mon Sep 17 00:00:00 2001 From: Alin Jerpelea Date: Sun, 29 Dec 2024 12:27:55 +0100 Subject: [PATCH 103/391] sdr: migrate to SPDX identifier Most tools used for compliance and SBOM generation use SPDX identifiers This change brings us a step closer to an easy SBOM generation. Signed-off-by: Alin Jerpelea --- sdr/CMakeLists.txt | 2 ++ sdr/Make.defs | 2 ++ sdr/Makefile | 2 ++ sdr/liquid_dsp/Make.defs | 3 ++- sdr/liquid_dsp/Makefile | 2 ++ sdr/liquid_dsp/config.h | 2 ++ 6 files changed, 12 insertions(+), 1 deletion(-) diff --git a/sdr/CMakeLists.txt b/sdr/CMakeLists.txt index 24eaf34d7e3..5f8bd4f2f36 100644 --- a/sdr/CMakeLists.txt +++ b/sdr/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/sdr/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/sdr/Make.defs b/sdr/Make.defs index 0a48f77f29d..e78ed07c736 100644 --- a/sdr/Make.defs +++ b/sdr/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/sdr/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/sdr/Makefile b/sdr/Makefile index 6a32e03fd70..9dbadc55f42 100644 --- a/sdr/Makefile +++ b/sdr/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/sdr/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/sdr/liquid_dsp/Make.defs b/sdr/liquid_dsp/Make.defs index eff26a4a857..f61ca389a3c 100644 --- a/sdr/liquid_dsp/Make.defs +++ b/sdr/liquid_dsp/Make.defs @@ -1,6 +1,7 @@ ############################################################################ # apps/sdr/liquid_dsp/Make.defs -# Adds selected applications to apps/ build +# +# SPDX-License-Identifier: Apache-2.0 # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with diff --git a/sdr/liquid_dsp/Makefile b/sdr/liquid_dsp/Makefile index 2da12bee3f1..8a257b30400 100644 --- a/sdr/liquid_dsp/Makefile +++ b/sdr/liquid_dsp/Makefile @@ -1,6 +1,8 @@ ########################################################################### # apps/sdr/liquid_dsp/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/sdr/liquid_dsp/config.h b/sdr/liquid_dsp/config.h index 50f7f44332c..50e5f1b7105 100644 --- a/sdr/liquid_dsp/config.h +++ b/sdr/liquid_dsp/config.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/sdr/liquid_dsp/config.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The From 45c13e594a11414f44a702c26bbc6d48baa71e3a Mon Sep 17 00:00:00 2001 From: Alin Jerpelea Date: Sun, 29 Dec 2024 12:30:44 +0100 Subject: [PATCH 104/391] video: migrate to SPDX identifier Most tools used for compliance and SBOM generation use SPDX identifiers This change brings us a step closer to an easy SBOM generation. Signed-off-by: Alin Jerpelea --- videoutils/CMakeLists.txt | 2 ++ videoutils/Make.defs | 2 ++ videoutils/Makefile | 2 ++ videoutils/openh264/CMakeLists.txt | 2 ++ videoutils/openh264/Make.defs | 2 ++ videoutils/openh264/Makefile | 2 ++ videoutils/openh264/include/sys/sysctl.h | 2 ++ 7 files changed, 14 insertions(+) diff --git a/videoutils/CMakeLists.txt b/videoutils/CMakeLists.txt index 440677ad936..afbdfd4550b 100644 --- a/videoutils/CMakeLists.txt +++ b/videoutils/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/videoutils/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/videoutils/Make.defs b/videoutils/Make.defs index 9b1c12ad374..7a6c4aae8d8 100644 --- a/videoutils/Make.defs +++ b/videoutils/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/videoutils/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/videoutils/Makefile b/videoutils/Makefile index bedc2d2bd4c..590e986ebcf 100644 --- a/videoutils/Makefile +++ b/videoutils/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/videoutils/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/videoutils/openh264/CMakeLists.txt b/videoutils/openh264/CMakeLists.txt index c3c3186f5fe..cffc2d4050a 100644 --- a/videoutils/openh264/CMakeLists.txt +++ b/videoutils/openh264/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/videoutils/openh264/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/videoutils/openh264/Make.defs b/videoutils/openh264/Make.defs index e61072affa1..78932eeeb8c 100644 --- a/videoutils/openh264/Make.defs +++ b/videoutils/openh264/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/videoutils/openh264/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/videoutils/openh264/Makefile b/videoutils/openh264/Makefile index c4f6bdf079b..e7d3bb7d5e9 100644 --- a/videoutils/openh264/Makefile +++ b/videoutils/openh264/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/videoutils/openh264/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/videoutils/openh264/include/sys/sysctl.h b/videoutils/openh264/include/sys/sysctl.h index 2f304e25ace..128d74982fc 100644 --- a/videoutils/openh264/include/sys/sysctl.h +++ b/videoutils/openh264/include/sys/sysctl.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/videoutils/openh264/include/sys/sysctl.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The From 11cd9beb9b1d0f3dfe5ca860d5deba422a42c179 Mon Sep 17 00:00:00 2001 From: Alin Jerpelea Date: Sun, 29 Dec 2024 12:58:59 +0100 Subject: [PATCH 105/391] wireless: migrate to SPDX identifier Most tools used for compliance and SBOM generation use SPDX identifiers This change brings us a step closer to an easy SBOM generation. Signed-off-by: Alin Jerpelea --- wireless/CMakeLists.txt | 2 ++ wireless/Make.defs | 2 ++ wireless/Makefile | 2 ++ wireless/bluetooth/CMakeLists.txt | 2 ++ wireless/bluetooth/Make.defs | 2 ++ wireless/bluetooth/Makefile | 2 ++ wireless/bluetooth/btsak/CMakeLists.txt | 2 ++ wireless/bluetooth/btsak/Make.defs | 2 ++ wireless/bluetooth/btsak/Makefile | 2 ++ wireless/bluetooth/btsak/btsak.h | 2 ++ wireless/bluetooth/btsak/btsak_advertise.c | 2 ++ wireless/bluetooth/btsak/btsak_features.c | 2 ++ wireless/bluetooth/btsak/btsak_gatt.c | 2 ++ wireless/bluetooth/btsak/btsak_info.c | 2 ++ wireless/bluetooth/btsak/btsak_main.c | 2 ++ wireless/bluetooth/btsak/btsak_scan.c | 2 ++ wireless/bluetooth/btsak/btsak_security.c | 2 ++ wireless/bluetooth/nimble/CMakeLists.txt | 2 ++ wireless/bluetooth/nimble/Make.defs | 2 ++ wireless/bluetooth/nimble/Makefile | 2 ++ wireless/bluetooth/nimble/Makefile.nimble | 2 ++ wireless/bluetooth/nimble/include/logcfg/logcfg.h | 2 ++ wireless/bluetooth/nimble/include/syscfg/syscfg.h | 2 ++ wireless/gs2200m/Make.defs | 2 ++ wireless/gs2200m/Makefile | 2 ++ wireless/gs2200m/gs2200m_main.c | 2 ++ wireless/ieee802154/CMakeLists.txt | 2 ++ wireless/ieee802154/Make.defs | 2 ++ wireless/ieee802154/Makefile | 2 ++ wireless/ieee802154/i8sak/CMakeLists.txt | 2 ++ wireless/ieee802154/i8sak/Make.defs | 2 ++ wireless/ieee802154/i8sak/Makefile | 2 ++ wireless/ieee802154/i8sak/i8sak.h | 2 ++ wireless/ieee802154/i8sak/i8sak_acceptassoc.c | 2 ++ wireless/ieee802154/i8sak/i8sak_assoc.c | 2 ++ wireless/ieee802154/i8sak/i8sak_blaster.c | 2 ++ wireless/ieee802154/i8sak/i8sak_events.c | 2 ++ wireless/ieee802154/i8sak/i8sak_events.h | 2 ++ wireless/ieee802154/i8sak/i8sak_get.c | 2 ++ wireless/ieee802154/i8sak/i8sak_main.c | 2 ++ wireless/ieee802154/i8sak/i8sak_poll.c | 2 ++ wireless/ieee802154/i8sak/i8sak_regdump.c | 2 ++ wireless/ieee802154/i8sak/i8sak_reset.c | 2 ++ wireless/ieee802154/i8sak/i8sak_scan.c | 2 ++ wireless/ieee802154/i8sak/i8sak_set.c | 2 ++ wireless/ieee802154/i8sak/i8sak_sniffer.c | 2 ++ wireless/ieee802154/i8sak/i8sak_startpan.c | 2 ++ wireless/ieee802154/i8sak/i8sak_tracedump.c | 2 ++ wireless/ieee802154/i8sak/i8sak_tx.c | 2 ++ wireless/ieee802154/i8shark/CMakeLists.txt | 2 ++ wireless/ieee802154/i8shark/Make.defs | 2 ++ wireless/ieee802154/i8shark/Makefile | 2 ++ wireless/ieee802154/i8shark/i8shark_main.c | 2 ++ wireless/ieee802154/libmac/CMakeLists.txt | 2 ++ wireless/ieee802154/libmac/Make.defs | 2 ++ wireless/ieee802154/libmac/Makefile | 2 ++ wireless/ieee802154/libmac/ieee802154_assocreq.c | 2 ++ wireless/ieee802154/libmac/ieee802154_assocresp.c | 2 ++ .../ieee802154/libmac/ieee802154_disassocreq.c | 2 ++ wireless/ieee802154/libmac/ieee802154_getreq.c | 2 ++ wireless/ieee802154/libmac/ieee802154_gtsreq.c | 2 ++ wireless/ieee802154/libmac/ieee802154_orphanresp.c | 2 ++ wireless/ieee802154/libmac/ieee802154_pollreq.c | 2 ++ wireless/ieee802154/libmac/ieee802154_resetreq.c | 2 ++ wireless/ieee802154/libmac/ieee802154_rxenabreq.c | 2 ++ wireless/ieee802154/libmac/ieee802154_scanreq.c | 2 ++ wireless/ieee802154/libmac/ieee802154_setreq.c | 2 ++ wireless/ieee802154/libmac/ieee802154_startreq.c | 2 ++ wireless/ieee802154/libmac/ieee802154_syncreq.c | 2 ++ wireless/ieee802154/libmac/sixlowpan_assocreq.c | 2 ++ wireless/ieee802154/libmac/sixlowpan_assocresp.c | 2 ++ wireless/ieee802154/libmac/sixlowpan_disassocreq.c | 2 ++ wireless/ieee802154/libmac/sixlowpan_getpromisc.c | 2 ++ wireless/ieee802154/libmac/sixlowpan_getreq.c | 2 ++ wireless/ieee802154/libmac/sixlowpan_gtsreq.c | 2 ++ wireless/ieee802154/libmac/sixlowpan_orphanresp.c | 2 ++ wireless/ieee802154/libmac/sixlowpan_pollreq.c | 2 ++ wireless/ieee802154/libmac/sixlowpan_resetreq.c | 2 ++ wireless/ieee802154/libmac/sixlowpan_rxenabreq.c | 2 ++ wireless/ieee802154/libmac/sixlowpan_scanreq.c | 2 ++ wireless/ieee802154/libmac/sixlowpan_setreq.c | 2 ++ wireless/ieee802154/libmac/sixlowpan_startreq.c | 2 ++ wireless/ieee802154/libmac/sixlowpan_syncreq.c | 2 ++ wireless/ieee802154/libutils/CMakeLists.txt | 2 ++ wireless/ieee802154/libutils/Make.defs | 2 ++ wireless/ieee802154/libutils/Makefile | 2 ++ .../ieee802154/libutils/ieee802154_addrtostr.c | 2 ++ wireless/iwpan/Make.defs | 2 ++ wireless/iwpan/Makefile | 2 ++ wireless/iwpan/src/Make.defs | 2 ++ wireless/iwpan/src/iwpan.c | 2 ++ wireless/wapi/CMakeLists.txt | 2 ++ wireless/wapi/Make.defs | 2 ++ wireless/wapi/Makefile | 2 ++ wireless/wapi/src/Make.defs | 2 ++ wireless/wapi/src/driver_wext.c | 14 +++++--------- wireless/wapi/src/network.c | 11 ++++------- wireless/wapi/src/util.c | 11 ++++------- wireless/wapi/src/util.h | 11 ++++------- wireless/wapi/src/wapi.c | 12 ++++-------- wireless/wapi/src/wireless.c | 11 ++++------- 101 files changed, 215 insertions(+), 45 deletions(-) diff --git a/wireless/CMakeLists.txt b/wireless/CMakeLists.txt index bf103671943..a812059c867 100644 --- a/wireless/CMakeLists.txt +++ b/wireless/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/wireless/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/wireless/Make.defs b/wireless/Make.defs index 276c3edbbd9..dacc6fa3e8f 100644 --- a/wireless/Make.defs +++ b/wireless/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/wireless/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/wireless/Makefile b/wireless/Makefile index 1e6af2a4204..55d0f7e87c3 100644 --- a/wireless/Makefile +++ b/wireless/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/wireless/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/wireless/bluetooth/CMakeLists.txt b/wireless/bluetooth/CMakeLists.txt index ef322d1da36..7f9ea25e3e0 100644 --- a/wireless/bluetooth/CMakeLists.txt +++ b/wireless/bluetooth/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/wireless/bluetooth/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/wireless/bluetooth/Make.defs b/wireless/bluetooth/Make.defs index ec059f75c5d..78ddbcc3473 100644 --- a/wireless/bluetooth/Make.defs +++ b/wireless/bluetooth/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/wireless/bluetooth/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/wireless/bluetooth/Makefile b/wireless/bluetooth/Makefile index fd9310f3555..f22646ddec9 100644 --- a/wireless/bluetooth/Makefile +++ b/wireless/bluetooth/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/wireless/bluetooth/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/wireless/bluetooth/btsak/CMakeLists.txt b/wireless/bluetooth/btsak/CMakeLists.txt index ee599fc02c1..adc34ce0d8b 100644 --- a/wireless/bluetooth/btsak/CMakeLists.txt +++ b/wireless/bluetooth/btsak/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/wireless/bluetooth/btsak/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/wireless/bluetooth/btsak/Make.defs b/wireless/bluetooth/btsak/Make.defs index f8cad29b4d8..c33133d63da 100644 --- a/wireless/bluetooth/btsak/Make.defs +++ b/wireless/bluetooth/btsak/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/wireless/bluetooth/btsak/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/wireless/bluetooth/btsak/Makefile b/wireless/bluetooth/btsak/Makefile index cd483f8f56e..4b244ac6d03 100644 --- a/wireless/bluetooth/btsak/Makefile +++ b/wireless/bluetooth/btsak/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/wireless/bluetooth/btsak/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/wireless/bluetooth/btsak/btsak.h b/wireless/bluetooth/btsak/btsak.h index a07b4cd2bed..d2601f5f0c3 100644 --- a/wireless/bluetooth/btsak/btsak.h +++ b/wireless/bluetooth/btsak/btsak.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/bluetooth/btsak/btsak.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/bluetooth/btsak/btsak_advertise.c b/wireless/bluetooth/btsak/btsak_advertise.c index c36ed029130..0418f0670fe 100644 --- a/wireless/bluetooth/btsak/btsak_advertise.c +++ b/wireless/bluetooth/btsak/btsak_advertise.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/bluetooth/btsak/btsak_advertise.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/bluetooth/btsak/btsak_features.c b/wireless/bluetooth/btsak/btsak_features.c index 5072d586c7d..5647f7b89c3 100644 --- a/wireless/bluetooth/btsak/btsak_features.c +++ b/wireless/bluetooth/btsak/btsak_features.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/bluetooth/btsak/btsak_features.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/bluetooth/btsak/btsak_gatt.c b/wireless/bluetooth/btsak/btsak_gatt.c index 641e42edc98..614782a9a23 100644 --- a/wireless/bluetooth/btsak/btsak_gatt.c +++ b/wireless/bluetooth/btsak/btsak_gatt.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/bluetooth/btsak/btsak_gatt.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/bluetooth/btsak/btsak_info.c b/wireless/bluetooth/btsak/btsak_info.c index 1175506e55c..13e30389e27 100644 --- a/wireless/bluetooth/btsak/btsak_info.c +++ b/wireless/bluetooth/btsak/btsak_info.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/bluetooth/btsak/btsak_info.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/bluetooth/btsak/btsak_main.c b/wireless/bluetooth/btsak/btsak_main.c index 3da320c82f1..c33f4256407 100644 --- a/wireless/bluetooth/btsak/btsak_main.c +++ b/wireless/bluetooth/btsak/btsak_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/bluetooth/btsak/btsak_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/bluetooth/btsak/btsak_scan.c b/wireless/bluetooth/btsak/btsak_scan.c index 69ead7a8392..a12d1a86ab7 100644 --- a/wireless/bluetooth/btsak/btsak_scan.c +++ b/wireless/bluetooth/btsak/btsak_scan.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/bluetooth/btsak/btsak_scan.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/bluetooth/btsak/btsak_security.c b/wireless/bluetooth/btsak/btsak_security.c index e177277e862..33967bc8b4a 100644 --- a/wireless/bluetooth/btsak/btsak_security.c +++ b/wireless/bluetooth/btsak/btsak_security.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/bluetooth/btsak/btsak_security.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/bluetooth/nimble/CMakeLists.txt b/wireless/bluetooth/nimble/CMakeLists.txt index 58601976732..177439447e2 100644 --- a/wireless/bluetooth/nimble/CMakeLists.txt +++ b/wireless/bluetooth/nimble/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/wireless/bluetooth/nimble/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/wireless/bluetooth/nimble/Make.defs b/wireless/bluetooth/nimble/Make.defs index c3c32101109..61310c41d67 100644 --- a/wireless/bluetooth/nimble/Make.defs +++ b/wireless/bluetooth/nimble/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/wireless/bluetooth/nimble/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/wireless/bluetooth/nimble/Makefile b/wireless/bluetooth/nimble/Makefile index 5aba9a4bec6..10133c2cd0e 100644 --- a/wireless/bluetooth/nimble/Makefile +++ b/wireless/bluetooth/nimble/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/wireless/bluetooth/nimble/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/wireless/bluetooth/nimble/Makefile.nimble b/wireless/bluetooth/nimble/Makefile.nimble index adef4563bcd..8a4281dfaf3 100644 --- a/wireless/bluetooth/nimble/Makefile.nimble +++ b/wireless/bluetooth/nimble/Makefile.nimble @@ -1,6 +1,8 @@ ############################################################################ # apps/wireless/bluetooth/nimble/Makefile.nimble # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/wireless/bluetooth/nimble/include/logcfg/logcfg.h b/wireless/bluetooth/nimble/include/logcfg/logcfg.h index 458ea624c0b..419c1373dc3 100644 --- a/wireless/bluetooth/nimble/include/logcfg/logcfg.h +++ b/wireless/bluetooth/nimble/include/logcfg/logcfg.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/bluetooth/nimble/include/logcfg/logcfg.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/bluetooth/nimble/include/syscfg/syscfg.h b/wireless/bluetooth/nimble/include/syscfg/syscfg.h index e49e65cd0e8..a10f5f3d3b4 100644 --- a/wireless/bluetooth/nimble/include/syscfg/syscfg.h +++ b/wireless/bluetooth/nimble/include/syscfg/syscfg.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/bluetooth/nimble/include/syscfg/syscfg.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/gs2200m/Make.defs b/wireless/gs2200m/Make.defs index b2bf0012f67..8b989b1259e 100644 --- a/wireless/gs2200m/Make.defs +++ b/wireless/gs2200m/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/wireless/gs2200m/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/wireless/gs2200m/Makefile b/wireless/gs2200m/Makefile index 7152fdecd4d..b52a7a06226 100644 --- a/wireless/gs2200m/Makefile +++ b/wireless/gs2200m/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/wireless/gs2200m/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/wireless/gs2200m/gs2200m_main.c b/wireless/gs2200m/gs2200m_main.c index 577d289faf3..f58cf882c48 100644 --- a/wireless/gs2200m/gs2200m_main.c +++ b/wireless/gs2200m/gs2200m_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/gs2200m/gs2200m_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/CMakeLists.txt b/wireless/ieee802154/CMakeLists.txt index ad006cbacbd..c4379afe070 100644 --- a/wireless/ieee802154/CMakeLists.txt +++ b/wireless/ieee802154/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/wireless/ieee802154/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/wireless/ieee802154/Make.defs b/wireless/ieee802154/Make.defs index 6a6f8db5585..2c0cafe4439 100644 --- a/wireless/ieee802154/Make.defs +++ b/wireless/ieee802154/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/wireless/ieee802154/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/Makefile b/wireless/ieee802154/Makefile index ce0b87c1445..1f6f8b98e7f 100644 --- a/wireless/ieee802154/Makefile +++ b/wireless/ieee802154/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/wireless/ieee802154/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/i8sak/CMakeLists.txt b/wireless/ieee802154/i8sak/CMakeLists.txt index 8a753bb7514..0eca9516c16 100644 --- a/wireless/ieee802154/i8sak/CMakeLists.txt +++ b/wireless/ieee802154/i8sak/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/wireless/ieee802154/i8sak/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/wireless/ieee802154/i8sak/Make.defs b/wireless/ieee802154/i8sak/Make.defs index 6d35ba553f3..dadff85e133 100644 --- a/wireless/ieee802154/i8sak/Make.defs +++ b/wireless/ieee802154/i8sak/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/wireless/ieee802154/i8sak/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/i8sak/Makefile b/wireless/ieee802154/i8sak/Makefile index d938a0e7886..f2d3b50b588 100644 --- a/wireless/ieee802154/i8sak/Makefile +++ b/wireless/ieee802154/i8sak/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/wireless/ieee802154/i8sak/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/i8sak/i8sak.h b/wireless/ieee802154/i8sak/i8sak.h index 8a6bd5ed51f..385d2c1b907 100644 --- a/wireless/ieee802154/i8sak/i8sak.h +++ b/wireless/ieee802154/i8sak/i8sak.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/ieee802154/i8sak/i8sak.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/i8sak/i8sak_acceptassoc.c b/wireless/ieee802154/i8sak/i8sak_acceptassoc.c index e927f2d188f..42d54288dfb 100644 --- a/wireless/ieee802154/i8sak/i8sak_acceptassoc.c +++ b/wireless/ieee802154/i8sak/i8sak_acceptassoc.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/ieee802154/i8sak/i8sak_acceptassoc.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/i8sak/i8sak_assoc.c b/wireless/ieee802154/i8sak/i8sak_assoc.c index 934741a55eb..52894c0eccb 100644 --- a/wireless/ieee802154/i8sak/i8sak_assoc.c +++ b/wireless/ieee802154/i8sak/i8sak_assoc.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/ieee802154/i8sak/i8sak_assoc.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/i8sak/i8sak_blaster.c b/wireless/ieee802154/i8sak/i8sak_blaster.c index c5d89cd21f9..cbb403703cd 100644 --- a/wireless/ieee802154/i8sak/i8sak_blaster.c +++ b/wireless/ieee802154/i8sak/i8sak_blaster.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/ieee802154/i8sak/i8sak_blaster.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/i8sak/i8sak_events.c b/wireless/ieee802154/i8sak/i8sak_events.c index b6d22d1dcd5..12e4758b9ff 100644 --- a/wireless/ieee802154/i8sak/i8sak_events.c +++ b/wireless/ieee802154/i8sak/i8sak_events.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/ieee802154/i8sak/i8sak_events.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/i8sak/i8sak_events.h b/wireless/ieee802154/i8sak/i8sak_events.h index 71c95182050..49a9cb766c7 100644 --- a/wireless/ieee802154/i8sak/i8sak_events.h +++ b/wireless/ieee802154/i8sak/i8sak_events.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/ieee802154/i8sak/i8sak_events.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/i8sak/i8sak_get.c b/wireless/ieee802154/i8sak/i8sak_get.c index 5716562ff3f..2b04fb769f9 100644 --- a/wireless/ieee802154/i8sak/i8sak_get.c +++ b/wireless/ieee802154/i8sak/i8sak_get.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/ieee802154/i8sak/i8sak_get.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/i8sak/i8sak_main.c b/wireless/ieee802154/i8sak/i8sak_main.c index 315b931632f..1d48777a73b 100644 --- a/wireless/ieee802154/i8sak/i8sak_main.c +++ b/wireless/ieee802154/i8sak/i8sak_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/ieee802154/i8sak/i8sak_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/i8sak/i8sak_poll.c b/wireless/ieee802154/i8sak/i8sak_poll.c index 052cfc4a749..014c9daed2d 100644 --- a/wireless/ieee802154/i8sak/i8sak_poll.c +++ b/wireless/ieee802154/i8sak/i8sak_poll.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/ieee802154/i8sak/i8sak_poll.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/i8sak/i8sak_regdump.c b/wireless/ieee802154/i8sak/i8sak_regdump.c index 26f426f6b76..aa32767c09f 100644 --- a/wireless/ieee802154/i8sak/i8sak_regdump.c +++ b/wireless/ieee802154/i8sak/i8sak_regdump.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/ieee802154/i8sak/i8sak_regdump.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/i8sak/i8sak_reset.c b/wireless/ieee802154/i8sak/i8sak_reset.c index 15dfab3b8d0..f9f30ae5718 100644 --- a/wireless/ieee802154/i8sak/i8sak_reset.c +++ b/wireless/ieee802154/i8sak/i8sak_reset.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/ieee802154/i8sak/i8sak_reset.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/i8sak/i8sak_scan.c b/wireless/ieee802154/i8sak/i8sak_scan.c index e70aef073a9..2ed1bb64536 100644 --- a/wireless/ieee802154/i8sak/i8sak_scan.c +++ b/wireless/ieee802154/i8sak/i8sak_scan.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/ieee802154/i8sak/i8sak_scan.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/i8sak/i8sak_set.c b/wireless/ieee802154/i8sak/i8sak_set.c index d2759dcf4f7..2caf6b270ff 100644 --- a/wireless/ieee802154/i8sak/i8sak_set.c +++ b/wireless/ieee802154/i8sak/i8sak_set.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/ieee802154/i8sak/i8sak_set.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/i8sak/i8sak_sniffer.c b/wireless/ieee802154/i8sak/i8sak_sniffer.c index 5bca97cd2ac..2fea25678f1 100644 --- a/wireless/ieee802154/i8sak/i8sak_sniffer.c +++ b/wireless/ieee802154/i8sak/i8sak_sniffer.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/ieee802154/i8sak/i8sak_sniffer.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/i8sak/i8sak_startpan.c b/wireless/ieee802154/i8sak/i8sak_startpan.c index 61f271a96ba..0954d49d968 100644 --- a/wireless/ieee802154/i8sak/i8sak_startpan.c +++ b/wireless/ieee802154/i8sak/i8sak_startpan.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/ieee802154/i8sak/i8sak_startpan.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/i8sak/i8sak_tracedump.c b/wireless/ieee802154/i8sak/i8sak_tracedump.c index 3b1031c7ad4..e1253446e4b 100644 --- a/wireless/ieee802154/i8sak/i8sak_tracedump.c +++ b/wireless/ieee802154/i8sak/i8sak_tracedump.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/ieee802154/i8sak/i8sak_tracedump.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/i8sak/i8sak_tx.c b/wireless/ieee802154/i8sak/i8sak_tx.c index 59b99f46d2a..fe06614265d 100644 --- a/wireless/ieee802154/i8sak/i8sak_tx.c +++ b/wireless/ieee802154/i8sak/i8sak_tx.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/ieee802154/i8sak/i8sak_tx.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/i8shark/CMakeLists.txt b/wireless/ieee802154/i8shark/CMakeLists.txt index 6c43fa9eb75..fcb9b52b102 100644 --- a/wireless/ieee802154/i8shark/CMakeLists.txt +++ b/wireless/ieee802154/i8shark/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/wireless/ieee802154/i8shark/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/wireless/ieee802154/i8shark/Make.defs b/wireless/ieee802154/i8shark/Make.defs index bae703e6db8..1420f250f95 100644 --- a/wireless/ieee802154/i8shark/Make.defs +++ b/wireless/ieee802154/i8shark/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/wireless/ieee802154/i8shark/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/i8shark/Makefile b/wireless/ieee802154/i8shark/Makefile index 47cc8505b59..904bfb04dd7 100644 --- a/wireless/ieee802154/i8shark/Makefile +++ b/wireless/ieee802154/i8shark/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/wireless/ieee802154/i8shark/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/i8shark/i8shark_main.c b/wireless/ieee802154/i8shark/i8shark_main.c index d7992a9bd5c..8d7af6f7fa0 100644 --- a/wireless/ieee802154/i8shark/i8shark_main.c +++ b/wireless/ieee802154/i8shark/i8shark_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/ieee802154/i8shark/i8shark_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/libmac/CMakeLists.txt b/wireless/ieee802154/libmac/CMakeLists.txt index fe2c964c222..7a7c1d09f58 100644 --- a/wireless/ieee802154/libmac/CMakeLists.txt +++ b/wireless/ieee802154/libmac/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/wireless/ieee802154/libmac/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/wireless/ieee802154/libmac/Make.defs b/wireless/ieee802154/libmac/Make.defs index 909dc7d2b7a..933a5f984d6 100644 --- a/wireless/ieee802154/libmac/Make.defs +++ b/wireless/ieee802154/libmac/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/wireless/ieee802154/libmac/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/libmac/Makefile b/wireless/ieee802154/libmac/Makefile index 4508ff205ac..31dab62d141 100644 --- a/wireless/ieee802154/libmac/Makefile +++ b/wireless/ieee802154/libmac/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/wireless/ieee802154/libmac/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/libmac/ieee802154_assocreq.c b/wireless/ieee802154/libmac/ieee802154_assocreq.c index 8db5e677b84..0d392c4a55b 100644 --- a/wireless/ieee802154/libmac/ieee802154_assocreq.c +++ b/wireless/ieee802154/libmac/ieee802154_assocreq.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/ieee802154/libmac/ieee802154_assocreq.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/libmac/ieee802154_assocresp.c b/wireless/ieee802154/libmac/ieee802154_assocresp.c index 4c38de0769a..d695394a6d0 100644 --- a/wireless/ieee802154/libmac/ieee802154_assocresp.c +++ b/wireless/ieee802154/libmac/ieee802154_assocresp.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/ieee802154/libmac/ieee802154_assocresp.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/libmac/ieee802154_disassocreq.c b/wireless/ieee802154/libmac/ieee802154_disassocreq.c index 81cd90b18ff..2f459b8267c 100644 --- a/wireless/ieee802154/libmac/ieee802154_disassocreq.c +++ b/wireless/ieee802154/libmac/ieee802154_disassocreq.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/ieee802154/libmac/ieee802154_disassocreq.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/libmac/ieee802154_getreq.c b/wireless/ieee802154/libmac/ieee802154_getreq.c index 9d2bd211f79..6ea946c111e 100644 --- a/wireless/ieee802154/libmac/ieee802154_getreq.c +++ b/wireless/ieee802154/libmac/ieee802154_getreq.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/ieee802154/libmac/ieee802154_getreq.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/libmac/ieee802154_gtsreq.c b/wireless/ieee802154/libmac/ieee802154_gtsreq.c index 51bfdccea59..909e6fb7654 100644 --- a/wireless/ieee802154/libmac/ieee802154_gtsreq.c +++ b/wireless/ieee802154/libmac/ieee802154_gtsreq.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/ieee802154/libmac/ieee802154_gtsreq.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/libmac/ieee802154_orphanresp.c b/wireless/ieee802154/libmac/ieee802154_orphanresp.c index af63cc9ac5a..b997091d52e 100644 --- a/wireless/ieee802154/libmac/ieee802154_orphanresp.c +++ b/wireless/ieee802154/libmac/ieee802154_orphanresp.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/ieee802154/libmac/ieee802154_orphanresp.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/libmac/ieee802154_pollreq.c b/wireless/ieee802154/libmac/ieee802154_pollreq.c index 4a51074423d..49e64fd40d7 100644 --- a/wireless/ieee802154/libmac/ieee802154_pollreq.c +++ b/wireless/ieee802154/libmac/ieee802154_pollreq.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/ieee802154/libmac/ieee802154_pollreq.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/libmac/ieee802154_resetreq.c b/wireless/ieee802154/libmac/ieee802154_resetreq.c index 20175af99ea..f5c4e243405 100644 --- a/wireless/ieee802154/libmac/ieee802154_resetreq.c +++ b/wireless/ieee802154/libmac/ieee802154_resetreq.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/ieee802154/libmac/ieee802154_resetreq.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/libmac/ieee802154_rxenabreq.c b/wireless/ieee802154/libmac/ieee802154_rxenabreq.c index f83739cf43c..18e8e33f8f4 100644 --- a/wireless/ieee802154/libmac/ieee802154_rxenabreq.c +++ b/wireless/ieee802154/libmac/ieee802154_rxenabreq.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/ieee802154/libmac/ieee802154_rxenabreq.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/libmac/ieee802154_scanreq.c b/wireless/ieee802154/libmac/ieee802154_scanreq.c index 0744c9eae44..73f3ac7ff1d 100644 --- a/wireless/ieee802154/libmac/ieee802154_scanreq.c +++ b/wireless/ieee802154/libmac/ieee802154_scanreq.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/ieee802154/libmac/ieee802154_scanreq.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/libmac/ieee802154_setreq.c b/wireless/ieee802154/libmac/ieee802154_setreq.c index feaf4c77319..bb7d67d9531 100644 --- a/wireless/ieee802154/libmac/ieee802154_setreq.c +++ b/wireless/ieee802154/libmac/ieee802154_setreq.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/ieee802154/libmac/ieee802154_setreq.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/libmac/ieee802154_startreq.c b/wireless/ieee802154/libmac/ieee802154_startreq.c index 67ae849b4c7..dd94249198d 100644 --- a/wireless/ieee802154/libmac/ieee802154_startreq.c +++ b/wireless/ieee802154/libmac/ieee802154_startreq.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/ieee802154/libmac/ieee802154_startreq.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/libmac/ieee802154_syncreq.c b/wireless/ieee802154/libmac/ieee802154_syncreq.c index 18efd0beed6..7e2c834ce68 100644 --- a/wireless/ieee802154/libmac/ieee802154_syncreq.c +++ b/wireless/ieee802154/libmac/ieee802154_syncreq.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/ieee802154/libmac/ieee802154_syncreq.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/libmac/sixlowpan_assocreq.c b/wireless/ieee802154/libmac/sixlowpan_assocreq.c index d81a61e6f19..734d2aa351b 100644 --- a/wireless/ieee802154/libmac/sixlowpan_assocreq.c +++ b/wireless/ieee802154/libmac/sixlowpan_assocreq.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/ieee802154/libmac/sixlowpan_assocreq.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/libmac/sixlowpan_assocresp.c b/wireless/ieee802154/libmac/sixlowpan_assocresp.c index f6c325af4ac..e67f6c7b3f6 100644 --- a/wireless/ieee802154/libmac/sixlowpan_assocresp.c +++ b/wireless/ieee802154/libmac/sixlowpan_assocresp.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/ieee802154/libmac/sixlowpan_assocresp.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/libmac/sixlowpan_disassocreq.c b/wireless/ieee802154/libmac/sixlowpan_disassocreq.c index e17939fb4b5..8582379d3cf 100644 --- a/wireless/ieee802154/libmac/sixlowpan_disassocreq.c +++ b/wireless/ieee802154/libmac/sixlowpan_disassocreq.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/ieee802154/libmac/sixlowpan_disassocreq.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/libmac/sixlowpan_getpromisc.c b/wireless/ieee802154/libmac/sixlowpan_getpromisc.c index 893369831d7..e524d038cff 100644 --- a/wireless/ieee802154/libmac/sixlowpan_getpromisc.c +++ b/wireless/ieee802154/libmac/sixlowpan_getpromisc.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/ieee802154/libmac/sixlowpan_getpromisc.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/libmac/sixlowpan_getreq.c b/wireless/ieee802154/libmac/sixlowpan_getreq.c index 3d246a274b6..5bdad58d0ee 100644 --- a/wireless/ieee802154/libmac/sixlowpan_getreq.c +++ b/wireless/ieee802154/libmac/sixlowpan_getreq.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/ieee802154/libmac/sixlowpan_getreq.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/libmac/sixlowpan_gtsreq.c b/wireless/ieee802154/libmac/sixlowpan_gtsreq.c index d33742c2f83..e8d20539644 100644 --- a/wireless/ieee802154/libmac/sixlowpan_gtsreq.c +++ b/wireless/ieee802154/libmac/sixlowpan_gtsreq.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/ieee802154/libmac/sixlowpan_gtsreq.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/libmac/sixlowpan_orphanresp.c b/wireless/ieee802154/libmac/sixlowpan_orphanresp.c index 25116c421c3..decb4b58d7e 100644 --- a/wireless/ieee802154/libmac/sixlowpan_orphanresp.c +++ b/wireless/ieee802154/libmac/sixlowpan_orphanresp.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/ieee802154/libmac/sixlowpan_orphanresp.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/libmac/sixlowpan_pollreq.c b/wireless/ieee802154/libmac/sixlowpan_pollreq.c index 84dc31a53cd..4e8a4d60116 100644 --- a/wireless/ieee802154/libmac/sixlowpan_pollreq.c +++ b/wireless/ieee802154/libmac/sixlowpan_pollreq.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/ieee802154/libmac/sixlowpan_pollreq.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/libmac/sixlowpan_resetreq.c b/wireless/ieee802154/libmac/sixlowpan_resetreq.c index 84e182942ee..824c802e8a8 100644 --- a/wireless/ieee802154/libmac/sixlowpan_resetreq.c +++ b/wireless/ieee802154/libmac/sixlowpan_resetreq.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/ieee802154/libmac/sixlowpan_resetreq.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/libmac/sixlowpan_rxenabreq.c b/wireless/ieee802154/libmac/sixlowpan_rxenabreq.c index 4165661cced..d7fff034790 100644 --- a/wireless/ieee802154/libmac/sixlowpan_rxenabreq.c +++ b/wireless/ieee802154/libmac/sixlowpan_rxenabreq.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/ieee802154/libmac/sixlowpan_rxenabreq.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/libmac/sixlowpan_scanreq.c b/wireless/ieee802154/libmac/sixlowpan_scanreq.c index b39124bdc47..04061d8720d 100644 --- a/wireless/ieee802154/libmac/sixlowpan_scanreq.c +++ b/wireless/ieee802154/libmac/sixlowpan_scanreq.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/ieee802154/libmac/sixlowpan_scanreq.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/libmac/sixlowpan_setreq.c b/wireless/ieee802154/libmac/sixlowpan_setreq.c index f115a74bad8..86255930f76 100644 --- a/wireless/ieee802154/libmac/sixlowpan_setreq.c +++ b/wireless/ieee802154/libmac/sixlowpan_setreq.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/ieee802154/libmac/sixlowpan_setreq.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/libmac/sixlowpan_startreq.c b/wireless/ieee802154/libmac/sixlowpan_startreq.c index 36203e7bc82..8d4c529b9cc 100644 --- a/wireless/ieee802154/libmac/sixlowpan_startreq.c +++ b/wireless/ieee802154/libmac/sixlowpan_startreq.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/ieee802154/libmac/sixlowpan_startreq.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/libmac/sixlowpan_syncreq.c b/wireless/ieee802154/libmac/sixlowpan_syncreq.c index f3f5af81926..a4fe76517d5 100644 --- a/wireless/ieee802154/libmac/sixlowpan_syncreq.c +++ b/wireless/ieee802154/libmac/sixlowpan_syncreq.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/ieee802154/libmac/sixlowpan_syncreq.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/libutils/CMakeLists.txt b/wireless/ieee802154/libutils/CMakeLists.txt index 0a09e76af61..2c869dc8079 100644 --- a/wireless/ieee802154/libutils/CMakeLists.txt +++ b/wireless/ieee802154/libutils/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/wireless/ieee802154/libutils/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/wireless/ieee802154/libutils/Make.defs b/wireless/ieee802154/libutils/Make.defs index 3963e4aa5c8..ed20e714da0 100644 --- a/wireless/ieee802154/libutils/Make.defs +++ b/wireless/ieee802154/libutils/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/wireless/ieee802154/libutils/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/libutils/Makefile b/wireless/ieee802154/libutils/Makefile index 164379ef9e3..666e7c8428e 100644 --- a/wireless/ieee802154/libutils/Makefile +++ b/wireless/ieee802154/libutils/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/wireless/ieee802154/libutils/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/wireless/ieee802154/libutils/ieee802154_addrtostr.c b/wireless/ieee802154/libutils/ieee802154_addrtostr.c index 60b480431c8..2cf71afd0b2 100644 --- a/wireless/ieee802154/libutils/ieee802154_addrtostr.c +++ b/wireless/ieee802154/libutils/ieee802154_addrtostr.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/ieee802154/libutils/ieee802154_addrtostr.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/iwpan/Make.defs b/wireless/iwpan/Make.defs index 97e6cd906e8..07667b5245b 100644 --- a/wireless/iwpan/Make.defs +++ b/wireless/iwpan/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/wireless/iwpan/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/wireless/iwpan/Makefile b/wireless/iwpan/Makefile index f8f527043d6..2d50f223984 100644 --- a/wireless/iwpan/Makefile +++ b/wireless/iwpan/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/wireless/iwpan/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/wireless/iwpan/src/Make.defs b/wireless/iwpan/src/Make.defs index 3725a4110cd..bfc7937c644 100644 --- a/wireless/iwpan/src/Make.defs +++ b/wireless/iwpan/src/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/wireless/iwpan/src/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/wireless/iwpan/src/iwpan.c b/wireless/iwpan/src/iwpan.c index d4114a03bf0..db13f251d25 100644 --- a/wireless/iwpan/src/iwpan.c +++ b/wireless/iwpan/src/iwpan.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/wireless/iwpan/src/iwpan.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/wireless/wapi/CMakeLists.txt b/wireless/wapi/CMakeLists.txt index 440e9a4773f..08980c461f8 100644 --- a/wireless/wapi/CMakeLists.txt +++ b/wireless/wapi/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # wireless/wapi/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/wireless/wapi/Make.defs b/wireless/wapi/Make.defs index af7e33d434b..bec2872af39 100644 --- a/wireless/wapi/Make.defs +++ b/wireless/wapi/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/wireless/wapi/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/wireless/wapi/Makefile b/wireless/wapi/Makefile index 0515c2a4b6f..4f5964cb7f9 100644 --- a/wireless/wapi/Makefile +++ b/wireless/wapi/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/wireless/wapi/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/wireless/wapi/src/Make.defs b/wireless/wapi/src/Make.defs index f8691e50b4f..57efc2f7cd8 100644 --- a/wireless/wapi/src/Make.defs +++ b/wireless/wapi/src/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/wireless/wapi/src/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/wireless/wapi/src/driver_wext.c b/wireless/wapi/src/driver_wext.c index dc18610feec..23b1583281b 100644 --- a/wireless/wapi/src/driver_wext.c +++ b/wireless/wapi/src/driver_wext.c @@ -1,15 +1,11 @@ /**************************************************************************** * apps/wireless/wapi/src/driver_wext.c - * Driver interaction with generic Wireless Extensions * - * Copyright (C) 2017, 2019 Gregory Nutt. All rights reserved. - * Author: Simon Piriou - * Gregory Nutt - * - * Adapted for NuttX from the driver_ext.c of WPA suplicant written - * originally by Jouni Malinen - * - * Copyright (c) 2003-2015, Jouni Malinen + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2017, 2019 Gregory Nutt. All rights reserved. + * SPDX-FileCopyrightText: 2003-2015 Jouni Malinen + * SPDX-FileContributor: Simon Piriou + * SPDX-FileContributor: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/wireless/wapi/src/network.c b/wireless/wapi/src/network.c index 7a4141ef992..0521a45f325 100644 --- a/wireless/wapi/src/network.c +++ b/wireless/wapi/src/network.c @@ -1,13 +1,10 @@ /**************************************************************************** * apps/wireless/wapi/src/network.c * - * Copyright (C) 2011, 2017 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Adapted for NuttX from WAPI: - * - * Copyright (c) 2010, Volkan YAZICI - * All rights reserved. + * SPDX-License-Identifier: BSD-2-Clause + * SPDX-FileCopyrightText: 2011, 2017 Gregory Nutt. All rights reserved. + * SPDX-FileCopyrightText: 2010, Volkan YAZICI + * SPDX-FileContributor: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/wireless/wapi/src/util.c b/wireless/wapi/src/util.c index e22b8c18e9f..b2c6b93d392 100644 --- a/wireless/wapi/src/util.c +++ b/wireless/wapi/src/util.c @@ -1,13 +1,10 @@ /**************************************************************************** * apps/wireless/wapi/src/util.c * - * Copyright (C) 2011, 2017Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Adapted for NuttX from WAPI: - * - * Copyright (c) 2010, Volkan YAZICI - * All rights reserved. + * SPDX-License-Identifier: BSD-2-Clause + * SPDX-FileCopyrightText: 2011, 2017 Gregory Nutt. All rights reserved. + * SPDX-FileCopyrightText: 2010 Volkan YAZICI + * SPDX-FileContributor: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/wireless/wapi/src/util.h b/wireless/wapi/src/util.h index 56a513ab70a..4639d3159ae 100644 --- a/wireless/wapi/src/util.h +++ b/wireless/wapi/src/util.h @@ -1,13 +1,10 @@ /**************************************************************************** * apps/wireless/wapi/src/util.h * - * Copyright (C) 2011, 2017Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Adapted for NuttX from WAPI: - * - * Copyright (c) 2010, Volkan YAZICI - * All rights reserved. + * SPDX-License-Identifier: BSD-2-Clause + * SPDX-FileCopyrightText: 2011, 2017 Gregory Nutt. All rights reserved. + * SPDX-FileCopyrightText: 2010 Volkan YAZICI + * SPDX-FileContributor: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/wireless/wapi/src/wapi.c b/wireless/wapi/src/wapi.c index 053d5069826..e61274c849c 100644 --- a/wireless/wapi/src/wapi.c +++ b/wireless/wapi/src/wapi.c @@ -1,14 +1,10 @@ /**************************************************************************** * apps/wireless/wapi/src/wapi.c * - * Copyright (C) 2011, 2017, 2019 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Largely and original work, but highly influenced by sampled code provided - * with WAPI: - * - * Copyright (c) 2010, Volkan YAZICI - * All rights reserved. + * SPDX-License-Identifier: BSD-2-Clause + * SPDX-FileCopyrightText: 2011,2017,2019 Gregory Nutt. All rights reserved. + * SPDX-FileCopyrightText: 2010 Volkan YAZICI + * SPDX-FileContributor: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/wireless/wapi/src/wireless.c b/wireless/wapi/src/wireless.c index 56f67fc813f..fe31c7851c3 100644 --- a/wireless/wapi/src/wireless.c +++ b/wireless/wapi/src/wireless.c @@ -1,13 +1,10 @@ /**************************************************************************** * apps/wireless/wapi/src/wireless.c * - * Copyright (C) 2011, 2017, 2019 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Adapted for NuttX from WAPI: - * - * Copyright (c) 2010, Volkan YAZICI - * All rights reserved. + * SPDX-License-Identifier: BSD-2-Clause + * SPDX-FileCopyrightText: 2011,2017,2019 Gregory Nutt. All rights reserved. + * SPDX-FileCopyrightText: 2010, Volkan YAZICI + * SPDX-FileContributor: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are From 66e829623003c2e1302b25a2d94024a8fae1032f Mon Sep 17 00:00:00 2001 From: Alin Jerpelea Date: Sun, 29 Dec 2024 15:55:00 +0100 Subject: [PATCH 106/391] system: migrate to SPDX identifier Most tools used for compliance and SBOM generation use SPDX identifiers This change brings us a step closer to an easy SBOM generation. Signed-off-by: Alin Jerpelea --- system/CMakeLists.txt | 2 + system/Make.defs | 2 + system/Makefile | 2 + system/adb/CMakeLists.txt | 2 + system/adb/Make.defs | 2 + system/adb/Makefile | 2 + system/adb/adb_banner.c | 2 + system/adb/adb_main.c | 2 + system/adb/logcat_service.c | 2 + system/argtable3/CMakeLists.txt | 2 + system/argtable3/Make.defs | 2 + system/argtable3/Makefile | 2 + system/batterydump/CMakeLists.txt | 2 + system/batterydump/Make.defs | 2 + system/batterydump/Makefile | 2 + system/batterydump/batterydump.c | 2 + system/cdcacm/CMakeLists.txt | 2 + system/cdcacm/Make.defs | 2 + system/cdcacm/Makefile | 2 + system/cdcacm/cdcacm.h | 2 + system/cdcacm/cdcacm_main.c | 2 + system/cfgdata/CMakeLists.txt | 2 + system/cfgdata/Make.defs | 2 + system/cfgdata/Makefile | 2 + system/cfgdata/cfgdata_main.c | 2 + system/cle/CMakeLists.txt | 2 + system/cle/Make.defs | 2 + system/cle/Makefile | 2 + system/cle/cle.c | 2 + system/composite/CMakeLists.txt | 2 + system/composite/Make.defs | 2 + system/composite/Makefile | 2 + system/composite/composite.h | 2 + system/composite/composite_main.c | 2 + system/conntrack/CMakeLists.txt | 2 + system/conntrack/Make.defs | 2 + system/conntrack/Makefile | 2 + system/conntrack/conntrack.c | 2 + system/coredump/CMakeLists.txt | 2 + system/coredump/Make.defs | 2 + system/coredump/Makefile | 2 + system/coredump/coredump.c | 2 + system/critmon/CMakeLists.txt | 2 + system/critmon/Make.defs | 2 + system/critmon/Makefile | 2 + system/critmon/critmon.c | 2 + system/cu/CMakeLists.txt | 2 + system/cu/Make.defs | 2 + system/cu/Makefile | 2 + system/cu/cu.h | 5 ++- system/cu/cu_main.c | 5 ++- system/dd/CMakeLists.txt | 2 + system/dd/Make.defs | 2 + system/dd/Makefile | 2 + system/dd/dd_main.c | 2 + system/debugpoint/CMakeLists.txt | 2 + system/debugpoint/Make.defs | 2 + system/debugpoint/Makefile | 2 + system/debugpoint/debug.c | 2 + system/dhcp6c/CMakeLists.txt | 2 + system/dhcp6c/Make.defs | 2 + system/dhcp6c/Makefile | 2 + system/dhcp6c/renew6_main.c | 2 + system/dhcpc/CMakeLists.txt | 2 + system/dhcpc/Make.defs | 2 + system/dhcpc/Makefile | 2 + system/dhcpc/renew_main.c | 2 + system/dumpstack/CMakeLists.txt | 2 + system/dumpstack/Make.defs | 2 + system/dumpstack/Makefile | 2 + system/dumpstack/dumpstack.c | 2 + system/fastboot/CMakeLists.txt | 2 + system/fastboot/Make.defs | 2 + system/fastboot/Makefile | 2 + system/fastboot/fastboot.c | 2 + system/fdt/CMakeLists.txt | 2 + system/fdt/Make.defs | 2 + system/fdt/Makefile | 2 + system/flash_eraseall/CMakeLists.txt | 2 + system/flash_eraseall/Make.defs | 2 + system/flash_eraseall/Makefile | 2 + system/flash_eraseall/flash_eraseall_main.c | 2 + system/flatbuffers/CMakeLists.txt | 2 + system/flatbuffers/Make.defs | 2 + system/flatbuffers/Makefile | 2 + system/gcov/CMakeLists.txt | 2 + system/gcov/Make.defs | 2 + system/gcov/Makefile | 2 + system/gcov/gcov.c | 2 + system/gdbstub/CMakeLists.txt | 2 + system/gdbstub/Make.defs | 2 + system/gdbstub/Makefile | 2 + system/gdbstub/gdbstub.c | 2 + system/gprof/CMakeLists.txt | 2 + system/gprof/Make.defs | 2 + system/gprof/Makefile | 2 + system/gprof/gprof.c | 2 + system/hex2bin/CMakeLists.txt | 2 + system/hex2bin/Make.defs | 2 + system/hex2bin/Makefile | 2 + system/hex2bin/hex2bin_main.c | 2 + system/hex2bin/hex2mem_main.c | 2 + system/hexed/CMakeLists.txt | 2 + system/hexed/Make.defs | 2 + system/hexed/Makefile | 2 + system/hexed/include/bfile.h | 4 +- system/hexed/include/cmdargs.h | 4 +- system/hexed/include/hexed.h | 4 +- system/hexed/src/bfile.c | 4 +- system/hexed/src/cmdargs.c | 4 +- system/hexed/src/hexcopy.c | 4 +- system/hexed/src/hexdump.c | 4 +- system/hexed/src/hexed.c | 4 +- system/hexed/src/hexenter.c | 4 +- system/hexed/src/hexhelp.c | 4 +- system/hexed/src/hexinsert.c | 4 +- system/hexed/src/hexmove.c | 4 +- system/hexed/src/hexremove.c | 4 +- system/hexed/src/hexword.c | 4 +- system/hostname/CMakeLists.txt | 2 + system/hostname/Make.defs | 2 + system/hostname/Makefile | 2 + system/hostname/hostname_main.c | 2 + system/i2c/CMakeLists.txt | 2 + system/i2c/Make.defs | 2 + system/i2c/Makefile | 2 + system/i2c/i2c_bus.c | 2 + system/i2c/i2c_common.c | 2 + system/i2c/i2c_dev.c | 2 + system/i2c/i2c_devif.c | 2 + system/i2c/i2c_dump.c | 2 + system/i2c/i2c_get.c | 2 + system/i2c/i2c_hexdump.c | 2 + system/i2c/i2c_main.c | 2 + system/i2c/i2c_reset.c | 2 + system/i2c/i2c_set.c | 2 + system/i2c/i2c_verf.c | 2 + system/i2c/i2ctool.h | 2 + system/input/CMakeLists.txt | 2 + system/input/Make.defs | 2 + system/input/Makefile | 2 + system/input/input.c | 2 + system/iptables/CMakeLists.txt | 2 + system/iptables/Make.defs | 2 + system/iptables/Makefile | 2 + system/iptables/ip6tables.c | 2 + system/iptables/iptables.c | 2 + system/iptables/iptables.h | 2 + system/iptables/iptables_utils.c | 2 + system/libuv/CMakeLists.txt | 2 + system/libuv/Make.defs | 2 + system/libuv/Makefile | 2 + system/lm75/CMakeLists.txt | 2 + system/lm75/Make.defs | 2 + system/lm75/Makefile | 2 + system/lm75/lm75.c | 2 + system/lsan/CMakeLists.txt | 2 + system/lsan/Make.defs | 2 + system/lsan/Makefile | 2 + system/lsan/lsan_main.c | 2 + system/lzf/CMakeLists.txt | 2 + system/lzf/Make.defs | 2 + system/lzf/Makefile | 2 + system/lzf/Makefile.host | 2 + system/lzf/lzf_main.c | 3 +- system/mdio/CMakeLists.txt | 2 + system/mdio/Make.defs | 2 + system/mdio/Makefile | 2 + system/mdio/mdio_main.c | 2 + system/netdb/CMakeLists.txt | 2 + system/netdb/Make.defs | 2 + system/netdb/Makefile | 2 + system/netdb/netdb_main.c | 2 + system/nsh/CMakeLists.txt | 2 + system/nsh/Make.defs | 2 + system/nsh/Makefile | 2 + system/nsh/nsh_main.c | 2 + system/nsh/sh_main.c | 2 + system/ntpc/CMakeLists.txt | 2 + system/ntpc/Make.defs | 2 + system/ntpc/Makefile | 2 + system/ntpc/ntpcstart_main.c | 2 + system/ntpc/ntpcstatus_main.c | 2 + system/ntpc/ntpcstop_main.c | 2 + system/nxcamera/CMakeLists.txt | 2 + system/nxcamera/Make.defs | 2 + system/nxcamera/Makefile | 2 + system/nxcamera/nxcamera.c | 2 + system/nxcamera/nxcamera_main.c | 2 + system/nxcodec/CMakeLists.txt | 2 + system/nxcodec/Make.defs | 2 + system/nxcodec/Makefile | 2 + system/nxcodec/nxcodec.c | 2 + system/nxcodec/nxcodec.h | 2 + system/nxcodec/nxcodec_context.c | 2 + system/nxcodec/nxcodec_context.h | 2 + system/nxcodec/nxcodec_main.c | 2 + system/nxdiag/Make.defs | 2 + system/nxdiag/Makefile | 2 + system/nxdiag/nxdiag.c | 2 + system/nxlooper/CMakeLists.txt | 2 + system/nxlooper/Make.defs | 2 + system/nxlooper/Makefile | 2 + system/nxlooper/nxlooper.c | 2 + system/nxlooper/nxlooper_main.c | 2 + system/nxplayer/CMakeLists.txt | 2 + system/nxplayer/Make.defs | 2 + system/nxplayer/Makefile | 2 + system/nxplayer/nxplayer.c | 2 + system/nxplayer/nxplayer_common.c | 2 + system/nxplayer/nxplayer_main.c | 2 + system/nxplayer/nxplayer_mp3.c | 2 + system/nxplayer/nxplayer_sbc.c | 2 + system/nxrecorder/CMakeLists.txt | 2 + system/nxrecorder/Make.defs | 2 + system/nxrecorder/Makefile | 2 + system/nxrecorder/nxrecorder.c | 2 + system/nxrecorder/nxrecorder_amr.c | 2 + system/nxrecorder/nxrecorder_common.c | 2 + system/nxrecorder/nxrecorder_main.c | 2 + system/ofloader/CMakeLists.txt | 2 + system/ofloader/Make.defs | 2 + system/ofloader/Makefile | 2 + system/ofloader/ofloader.c | 2 + system/ofloader/ofloader.h | 2 + system/ofloader/segger.c | 2 + system/ping/CMakeLists.txt | 2 + system/ping/Make.defs | 2 + system/ping/Makefile | 2 + system/ping/ping.c | 2 + system/ping6/CMakeLists.txt | 2 + system/ping6/Make.defs | 2 + system/ping6/Makefile | 2 + system/ping6/ping6.c | 2 + system/popen/CMakeLists.txt | 2 + system/popen/Make.defs | 2 + system/popen/Makefile | 2 + system/popen/popen.c | 2 + system/psmq/Make.defs | 2 + system/psmq/Makefile | 2 + system/ptpd/CMakeLists.txt | 2 + system/ptpd/Make.defs | 2 + system/ptpd/Makefile | 2 + system/ptpd/ptpd_main.c | 2 + system/readline/CMakeLists.txt | 2 + system/readline/Make.defs | 2 + system/readline/Makefile | 2 + system/readline/readline.c | 2 + system/readline/readline.h | 2 + system/readline/readline_common.c | 2 + system/readline/readline_fd.c | 2 + system/readline/readline_stream.c | 2 + system/sched_note/CMakeLists.txt | 2 + system/sched_note/Make.defs | 2 + system/sched_note/Makefile | 2 + system/sched_note/note_main.c | 2 + system/sensorscope/CMakeLists.txt | 2 + system/sensorscope/Make.defs | 2 + system/sensorscope/Makefile | 2 + system/sensorscope/sensorscope_main.c | 2 + system/setlogmask/CMakeLists.txt | 2 + system/setlogmask/Make.defs | 2 + system/setlogmask/Makefile | 2 + system/setlogmask/setlogmask.c | 2 + system/settings/Make.defs | 2 + system/settings/Makefile | 2 + system/settings/settings.c | 2 + system/settings/storage.h | 2 + system/settings/storage_bin.c | 2 + system/settings/storage_text.c | 2 + system/spi/CMakeLists.txt | 2 + system/spi/Make.defs | 2 + system/spi/Makefile | 2 + system/spi/spi_bus.c | 2 + system/spi/spi_common.c | 2 + system/spi/spi_devif.c | 2 + system/spi/spi_exch.c | 2 + system/spi/spi_main.c | 2 + system/spi/spitool.h | 2 + system/stackmonitor/CMakeLists.txt | 2 + system/stackmonitor/Make.defs | 2 + system/stackmonitor/Makefile | 2 + system/stackmonitor/stackmonitor.c | 2 + system/system/CMakeLists.txt | 2 + system/system/Make.defs | 2 + system/system/Makefile | 2 + system/system/system.c | 2 + system/taskset/CMakeLists.txt | 2 + system/taskset/Make.defs | 2 + system/taskset/Makefile | 2 + system/taskset/taskset.c | 2 + system/tcpdump/CMakeLists.txt | 2 + system/tcpdump/Make.defs | 2 + system/tcpdump/Makefile | 2 + system/tcpdump/tcpdump.c | 2 + system/tee/CMakeLists.txt | 2 + system/tee/Make.defs | 2 + system/tee/Makefile | 2 + system/telnet/CMakeLists.txt | 2 + system/telnet/Make.defs | 2 + system/telnet/Makefile | 2 + system/telnet/telnet_chatd.c | 38 ++++++++++--------- system/telnet/telnet_client.c | 38 ++++++++++--------- system/telnetd/CMakeLists.txt | 2 + system/telnetd/Make.defs | 2 + system/telnetd/Makefile | 2 + system/telnetd/telnetd.c | 2 + system/termcurses/CMakeLists.txt | 2 + system/termcurses/Make.defs | 2 + system/termcurses/Makefile | 2 + system/termcurses/tcurses_priv.h | 2 + system/termcurses/tcurses_vt100.c | 2 + system/termcurses/termcurses.c | 2 + system/trace/CMakeLists.txt | 2 + system/trace/Make.defs | 2 + system/trace/Makefile | 2 + system/trace/trace.c | 2 + system/trace/trace.h | 2 + system/trace/trace_dump.c | 2 + system/ubloxmodem/CMakeLists.txt | 2 + system/ubloxmodem/Make.defs | 2 + system/ubloxmodem/Makefile | 2 + system/ubloxmodem/ubloxmodem.h | 5 ++- system/ubloxmodem/ubloxmodem_main.c | 5 ++- system/uniqueid/CMakeLists.txt | 2 + system/uniqueid/Make.defs | 2 + system/uniqueid/Makefile | 2 + system/uniqueid/uniqueid_main.c | 2 + system/uorb/CMakeLists.txt | 2 + system/uorb/Make.defs | 2 + system/uorb/Makefile | 2 + system/uorb/listener.c | 2 + system/uorb/sensor/accel.c | 2 + system/uorb/sensor/accel.h | 2 + system/uorb/sensor/angle.c | 2 + system/uorb/sensor/angle.h | 2 + system/uorb/sensor/baro.c | 2 + system/uorb/sensor/baro.h | 2 + system/uorb/sensor/cap.c | 2 + system/uorb/sensor/cap.h | 2 + system/uorb/sensor/co2.c | 2 + system/uorb/sensor/co2.h | 2 + system/uorb/sensor/dust.c | 2 + system/uorb/sensor/dust.h | 2 + system/uorb/sensor/ecg.c | 2 + system/uorb/sensor/ecg.h | 2 + system/uorb/sensor/force.c | 2 + system/uorb/sensor/force.h | 2 + system/uorb/sensor/gas.c | 2 + system/uorb/sensor/gas.h | 2 + system/uorb/sensor/gesture.c | 2 + system/uorb/sensor/gesture.h | 2 + system/uorb/sensor/gnss.c | 2 + system/uorb/sensor/gnss.h | 2 + system/uorb/sensor/gyro.c | 2 + system/uorb/sensor/gyro.h | 2 + system/uorb/sensor/hall.c | 2 + system/uorb/sensor/hall.h | 2 + system/uorb/sensor/hbeat.c | 2 + system/uorb/sensor/hbeat.h | 2 + system/uorb/sensor/hcho.c | 2 + system/uorb/sensor/hcho.h | 2 + system/uorb/sensor/hrate.c | 2 + system/uorb/sensor/hrate.h | 2 + system/uorb/sensor/humi.c | 2 + system/uorb/sensor/humi.h | 2 + system/uorb/sensor/impd.c | 2 + system/uorb/sensor/impd.h | 2 + system/uorb/sensor/ir.c | 2 + system/uorb/sensor/ir.h | 2 + system/uorb/sensor/light.c | 2 + system/uorb/sensor/light.h | 2 + system/uorb/sensor/mag.c | 2 + system/uorb/sensor/mag.h | 2 + system/uorb/sensor/motion.c | 2 + system/uorb/sensor/motion.h | 2 + system/uorb/sensor/noise.c | 2 + system/uorb/sensor/noise.h | 2 + system/uorb/sensor/ots.c | 2 + system/uorb/sensor/ots.h | 2 + system/uorb/sensor/ph.c | 2 + system/uorb/sensor/ph.h | 2 + system/uorb/sensor/pm10.c | 2 + system/uorb/sensor/pm10.h | 2 + system/uorb/sensor/pm1p0.c | 2 + system/uorb/sensor/pm1p0.h | 2 + system/uorb/sensor/pm25.c | 2 + system/uorb/sensor/pm25.h | 2 + system/uorb/sensor/pose_6dof.c | 2 + system/uorb/sensor/pose_6dof.h | 2 + system/uorb/sensor/ppgd.c | 2 + system/uorb/sensor/ppgd.h | 2 + system/uorb/sensor/ppgq.c | 2 + system/uorb/sensor/ppgq.h | 2 + system/uorb/sensor/prox.c | 2 + system/uorb/sensor/prox.h | 2 + system/uorb/sensor/rgb.c | 2 + system/uorb/sensor/rgb.h | 2 + system/uorb/sensor/rotation.c | 2 + system/uorb/sensor/rotation.h | 2 + system/uorb/sensor/step_counter.c | 2 + system/uorb/sensor/step_counter.h | 2 + system/uorb/sensor/temp.c | 2 + system/uorb/sensor/temp.h | 2 + system/uorb/sensor/topics.c | 2 + system/uorb/sensor/tvoc.c | 2 + system/uorb/sensor/tvoc.h | 2 + system/uorb/sensor/uv.c | 2 + system/uorb/sensor/uv.h | 2 + system/uorb/test/unit_test.c | 2 + system/uorb/test/utility.c | 2 + system/uorb/test/utility.h | 2 + system/uorb/uORB/epoll.c | 2 + system/uorb/uORB/internal.h | 2 + system/uorb/uORB/loop.c | 2 + system/uorb/uORB/uORB.c | 2 + system/uorb/uORB/uORB.h | 2 + system/usbmsc/CMakeLists.txt | 2 + system/usbmsc/Make.defs | 2 + system/usbmsc/Makefile | 2 + system/usbmsc/usbmsc.h | 2 + system/usbmsc/usbmsc_main.c | 2 + system/vi/CMakeLists.txt | 2 + system/vi/Make.defs | 2 + system/vi/Makefile | 2 + system/vi/vi.c | 2 + system/ymodem/CMakeLists.txt | 2 + system/ymodem/Make.defs | 2 + system/ymodem/Makefile | 2 + system/ymodem/rb_main.c | 2 + system/ymodem/sb_main.c | 2 + system/ymodem/sbrb.py | 2 + system/ymodem/ymodem.c | 2 + system/ymodem/ymodem.h | 2 + system/zlib/CMakeLists.txt | 2 + system/zlib/Make.defs | 2 + system/zlib/Makefile | 2 + system/zmodem/CMakeLists.txt | 2 + system/zmodem/Make.defs | 2 + system/zmodem/Makefile | 2 + system/zmodem/Makefile.host | 2 + system/zmodem/host/crc16.c | 36 +++++++++--------- system/zmodem/host/crc32.c | 41 ++++++++++++++++++--- system/zmodem/host/debug.h | 2 + system/zmodem/host/nuttx/ascii.h | 2 + system/zmodem/host/nuttx/compiler.h | 2 + system/zmodem/host/nuttx/config.h | 2 + system/zmodem/host/nuttx/crc16.h | 2 + system/zmodem/host/nuttx/crc32.h | 2 + system/zmodem/rz_main.c | 2 + system/zmodem/sz_main.c | 2 + system/zmodem/zm.h | 2 + system/zmodem/zm_proto.c | 2 + system/zmodem/zm_receive.c | 2 + system/zmodem/zm_send.c | 2 + system/zmodem/zm_state.c | 2 + system/zmodem/zm_utils.c | 2 + system/zmodem/zm_watchdog.c | 2 + 458 files changed, 1008 insertions(+), 94 deletions(-) diff --git a/system/CMakeLists.txt b/system/CMakeLists.txt index 62ca957cb3c..0294b494f0c 100644 --- a/system/CMakeLists.txt +++ b/system/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/Make.defs b/system/Make.defs index e3d5126dc24..11390919145 100644 --- a/system/Make.defs +++ b/system/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/Makefile b/system/Makefile index da623e26411..12d2610c12e 100644 --- a/system/Makefile +++ b/system/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/adb/CMakeLists.txt b/system/adb/CMakeLists.txt index 97ab2754a35..7d1f9234180 100644 --- a/system/adb/CMakeLists.txt +++ b/system/adb/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/adb/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/adb/Make.defs b/system/adb/Make.defs index 83c0d7d5565..d2ba03d0e2c 100644 --- a/system/adb/Make.defs +++ b/system/adb/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/adb/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/adb/Makefile b/system/adb/Makefile index 266b1a16866..d8ed87b7b06 100644 --- a/system/adb/Makefile +++ b/system/adb/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/adb/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/adb/adb_banner.c b/system/adb/adb_banner.c index 5228abc0909..f45c22186c8 100644 --- a/system/adb/adb_banner.c +++ b/system/adb/adb_banner.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/adb/adb_banner.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/adb/adb_main.c b/system/adb/adb_main.c index 93a97d373ac..3895001d50b 100644 --- a/system/adb/adb_main.c +++ b/system/adb/adb_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/adb/adb_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/adb/logcat_service.c b/system/adb/logcat_service.c index 15e9a3bff69..7d4cb1a7595 100644 --- a/system/adb/logcat_service.c +++ b/system/adb/logcat_service.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/adb/logcat_service.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/argtable3/CMakeLists.txt b/system/argtable3/CMakeLists.txt index cb38247c842..fee506f42a0 100644 --- a/system/argtable3/CMakeLists.txt +++ b/system/argtable3/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/argtable3/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/argtable3/Make.defs b/system/argtable3/Make.defs index 8ee8179728b..4b325613dfe 100644 --- a/system/argtable3/Make.defs +++ b/system/argtable3/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/argtable3/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/argtable3/Makefile b/system/argtable3/Makefile index d2daf46aa50..592026f31c6 100644 --- a/system/argtable3/Makefile +++ b/system/argtable3/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/argtable3/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/batterydump/CMakeLists.txt b/system/batterydump/CMakeLists.txt index e822fb237ea..ebb5893a473 100644 --- a/system/batterydump/CMakeLists.txt +++ b/system/batterydump/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/batterydump/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/batterydump/Make.defs b/system/batterydump/Make.defs index 07126ab10bd..d42a961c925 100644 --- a/system/batterydump/Make.defs +++ b/system/batterydump/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/batterydump/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/batterydump/Makefile b/system/batterydump/Makefile index 5f4a4a1ad08..16a1e841317 100644 --- a/system/batterydump/Makefile +++ b/system/batterydump/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/batterydump/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/batterydump/batterydump.c b/system/batterydump/batterydump.c index 0649c0f6c3f..d317058f45f 100644 --- a/system/batterydump/batterydump.c +++ b/system/batterydump/batterydump.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/batterydump/batterydump.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/cdcacm/CMakeLists.txt b/system/cdcacm/CMakeLists.txt index d29b7bad817..c6a12d5b5e7 100644 --- a/system/cdcacm/CMakeLists.txt +++ b/system/cdcacm/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/cdcacm/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/cdcacm/Make.defs b/system/cdcacm/Make.defs index b0bb2f65087..08dc10ed2e6 100644 --- a/system/cdcacm/Make.defs +++ b/system/cdcacm/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/cdcacm/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/cdcacm/Makefile b/system/cdcacm/Makefile index 91db35c0acd..3c306337f2c 100644 --- a/system/cdcacm/Makefile +++ b/system/cdcacm/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/cdcacm/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/cdcacm/cdcacm.h b/system/cdcacm/cdcacm.h index bc255a03f1d..cd2651e8401 100644 --- a/system/cdcacm/cdcacm.h +++ b/system/cdcacm/cdcacm.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/cdcacm/cdcacm.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/cdcacm/cdcacm_main.c b/system/cdcacm/cdcacm_main.c index e3f08b19b93..fcaaf4593fa 100644 --- a/system/cdcacm/cdcacm_main.c +++ b/system/cdcacm/cdcacm_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/cdcacm/cdcacm_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/cfgdata/CMakeLists.txt b/system/cfgdata/CMakeLists.txt index 6a7b8e2dc01..b3aff9de530 100644 --- a/system/cfgdata/CMakeLists.txt +++ b/system/cfgdata/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/cfgdata/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/cfgdata/Make.defs b/system/cfgdata/Make.defs index 8108766005d..133518362ce 100644 --- a/system/cfgdata/Make.defs +++ b/system/cfgdata/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/cfgdata/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/cfgdata/Makefile b/system/cfgdata/Makefile index 4958030b82a..439ad567652 100644 --- a/system/cfgdata/Makefile +++ b/system/cfgdata/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/cfgdata/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/cfgdata/cfgdata_main.c b/system/cfgdata/cfgdata_main.c index 83776a555c0..ac218dc48fd 100644 --- a/system/cfgdata/cfgdata_main.c +++ b/system/cfgdata/cfgdata_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/cfgdata/cfgdata_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/cle/CMakeLists.txt b/system/cle/CMakeLists.txt index ee4f22a7e6a..43c69cfdd2e 100644 --- a/system/cle/CMakeLists.txt +++ b/system/cle/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/cle/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/cle/Make.defs b/system/cle/Make.defs index 561e882cfc9..2f3938a42ed 100644 --- a/system/cle/Make.defs +++ b/system/cle/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/cle/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/cle/Makefile b/system/cle/Makefile index e9ecfa81131..d888d722b20 100644 --- a/system/cle/Makefile +++ b/system/cle/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/cle/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/cle/cle.c b/system/cle/cle.c index 06bdb0b5362..cf11f7097f2 100644 --- a/system/cle/cle.c +++ b/system/cle/cle.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/cle/cle.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/composite/CMakeLists.txt b/system/composite/CMakeLists.txt index eb2b55bc678..9ca2f72ca38 100644 --- a/system/composite/CMakeLists.txt +++ b/system/composite/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/composite/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/composite/Make.defs b/system/composite/Make.defs index 6d591b78150..bede538dd7f 100644 --- a/system/composite/Make.defs +++ b/system/composite/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/composite/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/composite/Makefile b/system/composite/Makefile index a9aa682b1b9..4411d807e2e 100644 --- a/system/composite/Makefile +++ b/system/composite/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/composite/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/composite/composite.h b/system/composite/composite.h index 0bef05ec077..1320748d126 100644 --- a/system/composite/composite.h +++ b/system/composite/composite.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/composite/composite.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/composite/composite_main.c b/system/composite/composite_main.c index 0a99b022f86..9dc4399e881 100644 --- a/system/composite/composite_main.c +++ b/system/composite/composite_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/composite/composite_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/conntrack/CMakeLists.txt b/system/conntrack/CMakeLists.txt index 72fc176963a..b79daec8acd 100644 --- a/system/conntrack/CMakeLists.txt +++ b/system/conntrack/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/conntrack/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/conntrack/Make.defs b/system/conntrack/Make.defs index 9c746c6adca..5c9ec716e29 100644 --- a/system/conntrack/Make.defs +++ b/system/conntrack/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/conntrack/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/conntrack/Makefile b/system/conntrack/Makefile index 31efea8e04f..700a7c32298 100644 --- a/system/conntrack/Makefile +++ b/system/conntrack/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/conntrack/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/conntrack/conntrack.c b/system/conntrack/conntrack.c index c58784b0dee..f8a48302aad 100644 --- a/system/conntrack/conntrack.c +++ b/system/conntrack/conntrack.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/conntrack/conntrack.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/coredump/CMakeLists.txt b/system/coredump/CMakeLists.txt index 5782629e128..ccb43391a0e 100644 --- a/system/coredump/CMakeLists.txt +++ b/system/coredump/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/coredump/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/coredump/Make.defs b/system/coredump/Make.defs index c149e863b31..a4e640c115a 100644 --- a/system/coredump/Make.defs +++ b/system/coredump/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/coredump/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/coredump/Makefile b/system/coredump/Makefile index 4fbd693ee97..ec485903602 100644 --- a/system/coredump/Makefile +++ b/system/coredump/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/coredump/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/coredump/coredump.c b/system/coredump/coredump.c index 1846dc9ee88..d859e074563 100644 --- a/system/coredump/coredump.c +++ b/system/coredump/coredump.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/coredump/coredump.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/critmon/CMakeLists.txt b/system/critmon/CMakeLists.txt index 9271f0b0df9..b826f0987e6 100644 --- a/system/critmon/CMakeLists.txt +++ b/system/critmon/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/critmon/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/critmon/Make.defs b/system/critmon/Make.defs index 864fa768f91..6a893b2e80c 100644 --- a/system/critmon/Make.defs +++ b/system/critmon/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/critmon/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/critmon/Makefile b/system/critmon/Makefile index ec1c3cc9c2c..d0bbeba0e98 100644 --- a/system/critmon/Makefile +++ b/system/critmon/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/critmon/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/critmon/critmon.c b/system/critmon/critmon.c index e5761fa1ee5..6b9f948609b 100644 --- a/system/critmon/critmon.c +++ b/system/critmon/critmon.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/critmon/critmon.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/cu/CMakeLists.txt b/system/cu/CMakeLists.txt index b3121fb5f79..ce84a313e8b 100644 --- a/system/cu/CMakeLists.txt +++ b/system/cu/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/cu/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/cu/Make.defs b/system/cu/Make.defs index a4c20a6e68a..4ebb0f2cabc 100644 --- a/system/cu/Make.defs +++ b/system/cu/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/cu/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/cu/Makefile b/system/cu/Makefile index 3869413cd49..8769a360fac 100644 --- a/system/cu/Makefile +++ b/system/cu/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/cu/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/cu/cu.h b/system/cu/cu.h index 89267b470be..be9b31fb321 100644 --- a/system/cu/cu.h +++ b/system/cu/cu.h @@ -1,8 +1,9 @@ /**************************************************************************** * apps/system/cu/cu.h * - * Copyright (C) 2014 sysmocom - s.f.m.c. GmbH. All rights reserved. - * Author: Harald Welte + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2014 sysmocom - s.f.m.c. GmbH. All rights reserved. + * SPDX-FileContributor: Harald Welte * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/system/cu/cu_main.c b/system/cu/cu_main.c index 0997014cb20..2b8fabda181 100644 --- a/system/cu/cu_main.c +++ b/system/cu/cu_main.c @@ -1,8 +1,9 @@ /**************************************************************************** * apps/system/cu/cu_main.c * - * Copyright (C) 2014 sysmocom - s.f.m.c. GmbH. All rights reserved. - * Author: Harald Welte + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2014 sysmocom - s.f.m.c. GmbH. All rights reserved. + * SPDX-FileContributor: Harald Welte * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/system/dd/CMakeLists.txt b/system/dd/CMakeLists.txt index 945319502f7..4b060867bfd 100644 --- a/system/dd/CMakeLists.txt +++ b/system/dd/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/dd/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/dd/Make.defs b/system/dd/Make.defs index ac47b11c230..f64243ed1f7 100644 --- a/system/dd/Make.defs +++ b/system/dd/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/dd/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/dd/Makefile b/system/dd/Makefile index 0b11782152b..5bfafdca0f2 100644 --- a/system/dd/Makefile +++ b/system/dd/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/dd/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/dd/dd_main.c b/system/dd/dd_main.c index a5e6a13ebe3..ca9e3c7b6f6 100644 --- a/system/dd/dd_main.c +++ b/system/dd/dd_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/dd/dd_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/debugpoint/CMakeLists.txt b/system/debugpoint/CMakeLists.txt index 2741ebf877c..d353425fc15 100644 --- a/system/debugpoint/CMakeLists.txt +++ b/system/debugpoint/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/debugpoint/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/debugpoint/Make.defs b/system/debugpoint/Make.defs index 590a9aa62f6..d452e0c6052 100644 --- a/system/debugpoint/Make.defs +++ b/system/debugpoint/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/debugpoint/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/debugpoint/Makefile b/system/debugpoint/Makefile index 9a6b6506bed..13f5d1f6580 100644 --- a/system/debugpoint/Makefile +++ b/system/debugpoint/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/debugpoint/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/debugpoint/debug.c b/system/debugpoint/debug.c index b4f951ec460..b9696f6f51d 100644 --- a/system/debugpoint/debug.c +++ b/system/debugpoint/debug.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/debugpoint/debug.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/dhcp6c/CMakeLists.txt b/system/dhcp6c/CMakeLists.txt index 0b1a218442f..18e310f07e7 100644 --- a/system/dhcp6c/CMakeLists.txt +++ b/system/dhcp6c/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/dhcp6c/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/dhcp6c/Make.defs b/system/dhcp6c/Make.defs index 336ac6ed0a2..e144517afa1 100644 --- a/system/dhcp6c/Make.defs +++ b/system/dhcp6c/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/dhcp6c/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/dhcp6c/Makefile b/system/dhcp6c/Makefile index dcd4c852a03..d4e67c57fa0 100644 --- a/system/dhcp6c/Makefile +++ b/system/dhcp6c/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/dhcp6c/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/dhcp6c/renew6_main.c b/system/dhcp6c/renew6_main.c index 99e1ac84e81..d0f44382bee 100644 --- a/system/dhcp6c/renew6_main.c +++ b/system/dhcp6c/renew6_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/dhcp6c/renew6_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/dhcpc/CMakeLists.txt b/system/dhcpc/CMakeLists.txt index 63d8c7613b2..76600635980 100644 --- a/system/dhcpc/CMakeLists.txt +++ b/system/dhcpc/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/dhcpc/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/dhcpc/Make.defs b/system/dhcpc/Make.defs index c92e6fa7406..91b1923f22e 100644 --- a/system/dhcpc/Make.defs +++ b/system/dhcpc/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/dhcpc/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/dhcpc/Makefile b/system/dhcpc/Makefile index 88c1f19b6f1..97ba0fda376 100644 --- a/system/dhcpc/Makefile +++ b/system/dhcpc/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/dhcpc/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/dhcpc/renew_main.c b/system/dhcpc/renew_main.c index 33200f52e65..cbd10aa28f3 100644 --- a/system/dhcpc/renew_main.c +++ b/system/dhcpc/renew_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/dhcpc/renew_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/dumpstack/CMakeLists.txt b/system/dumpstack/CMakeLists.txt index f7e4eb800b0..fb0f1b38220 100644 --- a/system/dumpstack/CMakeLists.txt +++ b/system/dumpstack/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/dumpstack/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/dumpstack/Make.defs b/system/dumpstack/Make.defs index e7d51a1dd23..df336e3334a 100644 --- a/system/dumpstack/Make.defs +++ b/system/dumpstack/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/dumpstack/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/dumpstack/Makefile b/system/dumpstack/Makefile index b76243cab1a..8a26abe7151 100644 --- a/system/dumpstack/Makefile +++ b/system/dumpstack/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/dumpstack/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/dumpstack/dumpstack.c b/system/dumpstack/dumpstack.c index d779f808427..4c77317401e 100644 --- a/system/dumpstack/dumpstack.c +++ b/system/dumpstack/dumpstack.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/dumpstack/dumpstack.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/fastboot/CMakeLists.txt b/system/fastboot/CMakeLists.txt index 96a6713f04a..c565caa2687 100644 --- a/system/fastboot/CMakeLists.txt +++ b/system/fastboot/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/fastboot/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/fastboot/Make.defs b/system/fastboot/Make.defs index 441591b4b82..b2ddc28ec82 100644 --- a/system/fastboot/Make.defs +++ b/system/fastboot/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/fastboot/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/fastboot/Makefile b/system/fastboot/Makefile index 9a4793da7ee..866234e5222 100644 --- a/system/fastboot/Makefile +++ b/system/fastboot/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/fastboot/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/fastboot/fastboot.c b/system/fastboot/fastboot.c index 377b37402fc..550ea18c25c 100644 --- a/system/fastboot/fastboot.c +++ b/system/fastboot/fastboot.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/fastboot/fastboot.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/fdt/CMakeLists.txt b/system/fdt/CMakeLists.txt index b11f732ca85..cb1d1dfcca0 100644 --- a/system/fdt/CMakeLists.txt +++ b/system/fdt/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/fdt/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/fdt/Make.defs b/system/fdt/Make.defs index 6958c01f9ce..56b2203d9ef 100644 --- a/system/fdt/Make.defs +++ b/system/fdt/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/fdt/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/fdt/Makefile b/system/fdt/Makefile index a0e656e1888..58329c89aa2 100644 --- a/system/fdt/Makefile +++ b/system/fdt/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/fdt/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/flash_eraseall/CMakeLists.txt b/system/flash_eraseall/CMakeLists.txt index 47b4360cc40..56a8e4e7ce3 100644 --- a/system/flash_eraseall/CMakeLists.txt +++ b/system/flash_eraseall/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/flash_eraseall/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/flash_eraseall/Make.defs b/system/flash_eraseall/Make.defs index e12bb89a480..61ce70fbf04 100644 --- a/system/flash_eraseall/Make.defs +++ b/system/flash_eraseall/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/flash_eraseall/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/flash_eraseall/Makefile b/system/flash_eraseall/Makefile index 77e388f382e..33257a3bf80 100644 --- a/system/flash_eraseall/Makefile +++ b/system/flash_eraseall/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/flash_eraseall/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/flash_eraseall/flash_eraseall_main.c b/system/flash_eraseall/flash_eraseall_main.c index 3381529252c..aabdfab08d7 100644 --- a/system/flash_eraseall/flash_eraseall_main.c +++ b/system/flash_eraseall/flash_eraseall_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/flash_eraseall/flash_eraseall_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/flatbuffers/CMakeLists.txt b/system/flatbuffers/CMakeLists.txt index 82fad521b7b..bbfc684219e 100644 --- a/system/flatbuffers/CMakeLists.txt +++ b/system/flatbuffers/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/flatbuffers/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/flatbuffers/Make.defs b/system/flatbuffers/Make.defs index 7c313e524ad..88f5f6ce12e 100644 --- a/system/flatbuffers/Make.defs +++ b/system/flatbuffers/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/flatbuffers/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/flatbuffers/Makefile b/system/flatbuffers/Makefile index 3b01f6bac29..a0e78caca5f 100644 --- a/system/flatbuffers/Makefile +++ b/system/flatbuffers/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/flatbuffers/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/gcov/CMakeLists.txt b/system/gcov/CMakeLists.txt index 0aadc69ca4b..1902490b58f 100644 --- a/system/gcov/CMakeLists.txt +++ b/system/gcov/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/gcov/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/gcov/Make.defs b/system/gcov/Make.defs index bd791d37b65..35672ceb6ee 100644 --- a/system/gcov/Make.defs +++ b/system/gcov/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/gcov/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/gcov/Makefile b/system/gcov/Makefile index c839707e278..b9e34802082 100644 --- a/system/gcov/Makefile +++ b/system/gcov/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/gcov/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/gcov/gcov.c b/system/gcov/gcov.c index 1feec7d0a8a..64acb3c0e6d 100644 --- a/system/gcov/gcov.c +++ b/system/gcov/gcov.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/gcov/gcov.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/gdbstub/CMakeLists.txt b/system/gdbstub/CMakeLists.txt index b03b657235b..4faa13fb931 100644 --- a/system/gdbstub/CMakeLists.txt +++ b/system/gdbstub/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/gdbstub/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/gdbstub/Make.defs b/system/gdbstub/Make.defs index 9324d49a129..77a270b6b24 100644 --- a/system/gdbstub/Make.defs +++ b/system/gdbstub/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/gdbstub/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/gdbstub/Makefile b/system/gdbstub/Makefile index 75df5cdf65f..1d98bf093ee 100644 --- a/system/gdbstub/Makefile +++ b/system/gdbstub/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/gdbstub/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/gdbstub/gdbstub.c b/system/gdbstub/gdbstub.c index 9fe1b7c033e..e928c7b14dd 100644 --- a/system/gdbstub/gdbstub.c +++ b/system/gdbstub/gdbstub.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/gdbstub/gdbstub.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/gprof/CMakeLists.txt b/system/gprof/CMakeLists.txt index c789c883979..75ea91d57db 100644 --- a/system/gprof/CMakeLists.txt +++ b/system/gprof/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/gprof/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/gprof/Make.defs b/system/gprof/Make.defs index ee8214abbd0..02bd5be0bf4 100644 --- a/system/gprof/Make.defs +++ b/system/gprof/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/gprof/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/gprof/Makefile b/system/gprof/Makefile index 432a735d552..dd6e775d347 100644 --- a/system/gprof/Makefile +++ b/system/gprof/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/gprof/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/gprof/gprof.c b/system/gprof/gprof.c index 61f4637f644..ad75ee7510f 100644 --- a/system/gprof/gprof.c +++ b/system/gprof/gprof.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/gprof/gprof.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/hex2bin/CMakeLists.txt b/system/hex2bin/CMakeLists.txt index c870249041e..d30f9a3e686 100644 --- a/system/hex2bin/CMakeLists.txt +++ b/system/hex2bin/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/hex2bin/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/hex2bin/Make.defs b/system/hex2bin/Make.defs index a2d25e58e8a..5856b5a80e7 100644 --- a/system/hex2bin/Make.defs +++ b/system/hex2bin/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/hex2bin/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/hex2bin/Makefile b/system/hex2bin/Makefile index dde9100fd00..c8b7a1c42a7 100644 --- a/system/hex2bin/Makefile +++ b/system/hex2bin/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/hex2bin/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/hex2bin/hex2bin_main.c b/system/hex2bin/hex2bin_main.c index 1f376f72df0..b83d211b9d0 100644 --- a/system/hex2bin/hex2bin_main.c +++ b/system/hex2bin/hex2bin_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/hex2bin/hex2bin_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/hex2bin/hex2mem_main.c b/system/hex2bin/hex2mem_main.c index 9cd3af2e69f..45a61aade37 100644 --- a/system/hex2bin/hex2mem_main.c +++ b/system/hex2bin/hex2mem_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/hex2bin/hex2mem_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/hexed/CMakeLists.txt b/system/hexed/CMakeLists.txt index a304b7cc0f6..79528bb78c0 100644 --- a/system/hexed/CMakeLists.txt +++ b/system/hexed/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/hexed/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/hexed/Make.defs b/system/hexed/Make.defs index 69dd716f87f..54e9717663d 100644 --- a/system/hexed/Make.defs +++ b/system/hexed/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/hexed/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/hexed/Makefile b/system/hexed/Makefile index aa80b4ad633..4d6caa43603 100644 --- a/system/hexed/Makefile +++ b/system/hexed/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/hexed/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/hexed/include/bfile.h b/system/hexed/include/bfile.h index c517d364408..6fd533d68c4 100644 --- a/system/hexed/include/bfile.h +++ b/system/hexed/include/bfile.h @@ -1,8 +1,8 @@ /**************************************************************************** * apps/system/hexed/include/bfile.h - * Buffered file control header * - * Copyright (c) 2010, B.ZaaR, All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2010, B.ZaaR, All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/system/hexed/include/cmdargs.h b/system/hexed/include/cmdargs.h index 267b153a5c3..04c928f55d0 100644 --- a/system/hexed/include/cmdargs.h +++ b/system/hexed/include/cmdargs.h @@ -1,8 +1,8 @@ /**************************************************************************** * apps/system/hexed/include/cmdargs.h - * Command line argument parsing header * - * Copyright (c) 2010, B.ZaaR, All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2010, B.ZaaR, All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/system/hexed/include/hexed.h b/system/hexed/include/hexed.h index 38265e46068..bf0489bd0e8 100644 --- a/system/hexed/include/hexed.h +++ b/system/hexed/include/hexed.h @@ -1,8 +1,8 @@ /**************************************************************************** * apps/system/hexed/include/hexed.h - * Command line HEXadecimal file EDitor header * - * Copyright (c) 2011, B.ZaaR, All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2010, B.ZaaR, All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/system/hexed/src/bfile.c b/system/hexed/src/bfile.c index 5039f0c9ef2..75cb6b0de26 100644 --- a/system/hexed/src/bfile.c +++ b/system/hexed/src/bfile.c @@ -1,8 +1,8 @@ /**************************************************************************** * apps/system/hexed/src/bfile.c - * Buffered file control * - * Copyright (c) 2011, B.ZaaR, All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2011, B.ZaaR, All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/system/hexed/src/cmdargs.c b/system/hexed/src/cmdargs.c index a1180dd6fbd..ca8f0b4f5db 100644 --- a/system/hexed/src/cmdargs.c +++ b/system/hexed/src/cmdargs.c @@ -1,8 +1,8 @@ /**************************************************************************** * apps/system/hexed/src/cmdargs.c - * Command line argument parsing * - * Copyright (c) 2011, B.ZaaR, All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2011, B.ZaaR, All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/system/hexed/src/hexcopy.c b/system/hexed/src/hexcopy.c index 99b94c5f521..c6ba192ec30 100644 --- a/system/hexed/src/hexcopy.c +++ b/system/hexed/src/hexcopy.c @@ -1,8 +1,8 @@ /**************************************************************************** * apps/system/hexed/src/hexcopy.c - * hexed copy command * - * Copyright (c) 2011, B.ZaaR, All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2011, B.ZaaR, All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/system/hexed/src/hexdump.c b/system/hexed/src/hexdump.c index c4e0dea2a80..063544cc8ca 100644 --- a/system/hexed/src/hexdump.c +++ b/system/hexed/src/hexdump.c @@ -1,8 +1,8 @@ /**************************************************************************** * apps/system/hexed/src/hexdump.c - * hexed dump command * - * Copyright (c) 2010, B.ZaaR, All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2010, B.ZaaR, All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/system/hexed/src/hexed.c b/system/hexed/src/hexed.c index 646faea2486..cb0fdd07b73 100644 --- a/system/hexed/src/hexed.c +++ b/system/hexed/src/hexed.c @@ -1,8 +1,8 @@ /**************************************************************************** * apps/system/hexed/src/hexed.c - * Command line HEXadecimal file EDitor * - * Copyright (c) 2010, B.ZaaR, All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2010, B.ZaaR, All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/system/hexed/src/hexenter.c b/system/hexed/src/hexenter.c index 3fec1c302fc..e53610ccd7d 100644 --- a/system/hexed/src/hexenter.c +++ b/system/hexed/src/hexenter.c @@ -1,8 +1,8 @@ /**************************************************************************** * apps/system/hexed/src/hexenter.c - * hexed enter command * - * Copyright (c) 2011, B.ZaaR, All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2011, B.ZaaR, All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/system/hexed/src/hexhelp.c b/system/hexed/src/hexhelp.c index 6622ed2d7b1..250dbcf8073 100644 --- a/system/hexed/src/hexhelp.c +++ b/system/hexed/src/hexhelp.c @@ -1,8 +1,8 @@ /**************************************************************************** * apps/system/hexed/src/hexhelp.c - * hexed help command * - * Copyright (c) 2011, B.ZaaR, All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2011, B.ZaaR, All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/system/hexed/src/hexinsert.c b/system/hexed/src/hexinsert.c index 377ea1a0138..caf6fdc9f6d 100644 --- a/system/hexed/src/hexinsert.c +++ b/system/hexed/src/hexinsert.c @@ -1,8 +1,8 @@ /**************************************************************************** * apps/system/hexed/src/hexinsert.c - * hexed insert command * - * Copyright (c) 2011, B.ZaaR, All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2011, B.ZaaR, All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/system/hexed/src/hexmove.c b/system/hexed/src/hexmove.c index d3e1c609f3b..4edea1a873c 100644 --- a/system/hexed/src/hexmove.c +++ b/system/hexed/src/hexmove.c @@ -1,8 +1,8 @@ /**************************************************************************** * apps/system/hexed/src/hexmove.c - * hexed move command * - * Copyright (c) 2011, B.ZaaR, All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2011, B.ZaaR, All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are diff --git a/system/hexed/src/hexremove.c b/system/hexed/src/hexremove.c index 69f9e52a356..d282c6db574 100644 --- a/system/hexed/src/hexremove.c +++ b/system/hexed/src/hexremove.c @@ -1,8 +1,8 @@ /**************************************************************************** * apps/system/hexed/src/hexremove.c - * hexed remove command * - * Copyright (c) 2011, B.ZaaR, All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2011, B.ZaaR, All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/system/hexed/src/hexword.c b/system/hexed/src/hexword.c index 660e0baa87d..1ab978d268e 100644 --- a/system/hexed/src/hexword.c +++ b/system/hexed/src/hexword.c @@ -1,8 +1,8 @@ /**************************************************************************** * apps/system/hexed/src/hexword.c - * hexed word command * - * Copyright (c) 2011, B.ZaaR, All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2011, B.ZaaR, All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/system/hostname/CMakeLists.txt b/system/hostname/CMakeLists.txt index 1fbf13cfd9e..15ae7a0a72b 100644 --- a/system/hostname/CMakeLists.txt +++ b/system/hostname/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/hostname/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/hostname/Make.defs b/system/hostname/Make.defs index 92080eef667..028c805255e 100644 --- a/system/hostname/Make.defs +++ b/system/hostname/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/hostname/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/hostname/Makefile b/system/hostname/Makefile index c745113a562..8fe15ef4277 100644 --- a/system/hostname/Makefile +++ b/system/hostname/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/hostname/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/hostname/hostname_main.c b/system/hostname/hostname_main.c index 6a597cf7245..be6d101d886 100644 --- a/system/hostname/hostname_main.c +++ b/system/hostname/hostname_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/hostname/hostname_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/i2c/CMakeLists.txt b/system/i2c/CMakeLists.txt index 39d807dc78e..efe540405d5 100644 --- a/system/i2c/CMakeLists.txt +++ b/system/i2c/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/i2c/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/i2c/Make.defs b/system/i2c/Make.defs index 2d901fc1dd4..fada8ad1fda 100644 --- a/system/i2c/Make.defs +++ b/system/i2c/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/i2c/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/i2c/Makefile b/system/i2c/Makefile index 0e6846aef4c..eaf5eda1796 100644 --- a/system/i2c/Makefile +++ b/system/i2c/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/i2c/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/i2c/i2c_bus.c b/system/i2c/i2c_bus.c index 9c87f9c8d78..b50a7ce62cb 100644 --- a/system/i2c/i2c_bus.c +++ b/system/i2c/i2c_bus.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/i2c/i2c_bus.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/i2c/i2c_common.c b/system/i2c/i2c_common.c index 2ede5323274..96224290bd0 100644 --- a/system/i2c/i2c_common.c +++ b/system/i2c/i2c_common.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/i2c/i2c_common.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/i2c/i2c_dev.c b/system/i2c/i2c_dev.c index a06742febf6..cd83ec965f1 100644 --- a/system/i2c/i2c_dev.c +++ b/system/i2c/i2c_dev.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/i2c/i2c_dev.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/i2c/i2c_devif.c b/system/i2c/i2c_devif.c index 2f72a42adbf..dcf1c2ea640 100644 --- a/system/i2c/i2c_devif.c +++ b/system/i2c/i2c_devif.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/i2c/i2c_devif.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/i2c/i2c_dump.c b/system/i2c/i2c_dump.c index c26c5f333ae..940f2529e79 100644 --- a/system/i2c/i2c_dump.c +++ b/system/i2c/i2c_dump.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/i2c/i2c_dump.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/i2c/i2c_get.c b/system/i2c/i2c_get.c index 569ac50bf2a..57644e895ae 100644 --- a/system/i2c/i2c_get.c +++ b/system/i2c/i2c_get.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/i2c/i2c_get.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/i2c/i2c_hexdump.c b/system/i2c/i2c_hexdump.c index da843ee6563..2046274781f 100644 --- a/system/i2c/i2c_hexdump.c +++ b/system/i2c/i2c_hexdump.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/i2c/i2c_hexdump.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/i2c/i2c_main.c b/system/i2c/i2c_main.c index 2ad9e3a35a4..7abe9bdd1ad 100644 --- a/system/i2c/i2c_main.c +++ b/system/i2c/i2c_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/i2c/i2c_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/i2c/i2c_reset.c b/system/i2c/i2c_reset.c index 550d5607a2c..98177b79319 100644 --- a/system/i2c/i2c_reset.c +++ b/system/i2c/i2c_reset.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/i2c/i2c_reset.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/i2c/i2c_set.c b/system/i2c/i2c_set.c index 883b287de9a..4eb0548d0fd 100644 --- a/system/i2c/i2c_set.c +++ b/system/i2c/i2c_set.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/i2c/i2c_set.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/i2c/i2c_verf.c b/system/i2c/i2c_verf.c index 1c2080921cf..e0e4c921843 100644 --- a/system/i2c/i2c_verf.c +++ b/system/i2c/i2c_verf.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/i2c/i2c_verf.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/i2c/i2ctool.h b/system/i2c/i2ctool.h index 27553866da5..062307c2eab 100644 --- a/system/i2c/i2ctool.h +++ b/system/i2c/i2ctool.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/i2c/i2ctool.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/input/CMakeLists.txt b/system/input/CMakeLists.txt index 38385960135..17d07e6a5e6 100644 --- a/system/input/CMakeLists.txt +++ b/system/input/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/input/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/input/Make.defs b/system/input/Make.defs index 2edb506bd8f..e1fe92b7ecd 100644 --- a/system/input/Make.defs +++ b/system/input/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/input/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/input/Makefile b/system/input/Makefile index 81407a103e2..75c5c6bdac7 100644 --- a/system/input/Makefile +++ b/system/input/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/input/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/input/input.c b/system/input/input.c index de7022caa8d..94004af930e 100644 --- a/system/input/input.c +++ b/system/input/input.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/input/input.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/system/iptables/CMakeLists.txt b/system/iptables/CMakeLists.txt index 6f51fa79fa4..39572f6c021 100644 --- a/system/iptables/CMakeLists.txt +++ b/system/iptables/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/iptables/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/iptables/Make.defs b/system/iptables/Make.defs index 52469d42be0..ccd3c189394 100644 --- a/system/iptables/Make.defs +++ b/system/iptables/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/iptables/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/iptables/Makefile b/system/iptables/Makefile index 5f62b5518b5..1f0155e7516 100644 --- a/system/iptables/Makefile +++ b/system/iptables/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/iptables/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/iptables/ip6tables.c b/system/iptables/ip6tables.c index 4e404a6c9c0..e29d9230151 100644 --- a/system/iptables/ip6tables.c +++ b/system/iptables/ip6tables.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/iptables/ip6tables.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/iptables/iptables.c b/system/iptables/iptables.c index ba957707939..7072ed96820 100644 --- a/system/iptables/iptables.c +++ b/system/iptables/iptables.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/iptables/iptables.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/iptables/iptables.h b/system/iptables/iptables.h index 0f2d269cca4..a5dedbb9f54 100644 --- a/system/iptables/iptables.h +++ b/system/iptables/iptables.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/iptables/iptables.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/iptables/iptables_utils.c b/system/iptables/iptables_utils.c index 89c9aa61152..9428e0feaaf 100644 --- a/system/iptables/iptables_utils.c +++ b/system/iptables/iptables_utils.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/iptables/iptables_utils.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/libuv/CMakeLists.txt b/system/libuv/CMakeLists.txt index 125185f6595..4685da12fb9 100644 --- a/system/libuv/CMakeLists.txt +++ b/system/libuv/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/libuv/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/libuv/Make.defs b/system/libuv/Make.defs index fb9419308b5..d0ca87bf741 100644 --- a/system/libuv/Make.defs +++ b/system/libuv/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/libuv/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/libuv/Makefile b/system/libuv/Makefile index 5adc1f8d7e0..b8d4e0d8b93 100644 --- a/system/libuv/Makefile +++ b/system/libuv/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/libuv/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/lm75/CMakeLists.txt b/system/lm75/CMakeLists.txt index 1dbc8bf1b80..3b68b1307de 100644 --- a/system/lm75/CMakeLists.txt +++ b/system/lm75/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/lm75/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/lm75/Make.defs b/system/lm75/Make.defs index cde71746560..54e09038fa6 100644 --- a/system/lm75/Make.defs +++ b/system/lm75/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/lm75/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/lm75/Makefile b/system/lm75/Makefile index c581c706533..342077710b8 100644 --- a/system/lm75/Makefile +++ b/system/lm75/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/lm75/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/lm75/lm75.c b/system/lm75/lm75.c index 57595fcbe6d..cf9f87f9ebc 100644 --- a/system/lm75/lm75.c +++ b/system/lm75/lm75.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/lm75/lm75.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/lsan/CMakeLists.txt b/system/lsan/CMakeLists.txt index 0e2ded3c5d7..6fbdee370cb 100644 --- a/system/lsan/CMakeLists.txt +++ b/system/lsan/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/lsan/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/lsan/Make.defs b/system/lsan/Make.defs index 10fd558e527..06328232078 100644 --- a/system/lsan/Make.defs +++ b/system/lsan/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/lsan/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/lsan/Makefile b/system/lsan/Makefile index 749ed3ee7f8..ecf8884538e 100644 --- a/system/lsan/Makefile +++ b/system/lsan/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/lsan/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/lsan/lsan_main.c b/system/lsan/lsan_main.c index 3b5003cb0e1..d0c8a06eac9 100644 --- a/system/lsan/lsan_main.c +++ b/system/lsan/lsan_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/lsan/lsan_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/lzf/CMakeLists.txt b/system/lzf/CMakeLists.txt index 5747d844602..6f97cd3a7b6 100644 --- a/system/lzf/CMakeLists.txt +++ b/system/lzf/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/lzf/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/lzf/Make.defs b/system/lzf/Make.defs index ea59457c13a..df8cdac0575 100644 --- a/system/lzf/Make.defs +++ b/system/lzf/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/lzf/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/lzf/Makefile b/system/lzf/Makefile index 140c2f30b0c..40b1df04429 100644 --- a/system/lzf/Makefile +++ b/system/lzf/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/lzf/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/lzf/Makefile.host b/system/lzf/Makefile.host index d0693f0dc73..fa29854c931 100644 --- a/system/lzf/Makefile.host +++ b/system/lzf/Makefile.host @@ -1,6 +1,8 @@ ############################################################################ # apps/system/lzf/Makefile.host # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/lzf/lzf_main.c b/system/lzf/lzf_main.c index f76935f9c0c..5e6fcbe9424 100644 --- a/system/lzf/lzf_main.c +++ b/system/lzf/lzf_main.c @@ -1,7 +1,8 @@ /**************************************************************************** * apps/system/lzf/lzf_main.c * - * Copyright (c) 2006 Stefan Traby + * SPDX-License-Identifier: BSD-2-Clause + * SPDX-FileCopyrightText: 2006 Stefan Traby * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/system/mdio/CMakeLists.txt b/system/mdio/CMakeLists.txt index 0af71533da9..5013ec045e4 100644 --- a/system/mdio/CMakeLists.txt +++ b/system/mdio/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/mdio/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/mdio/Make.defs b/system/mdio/Make.defs index 49ece556f2c..313b4531f76 100644 --- a/system/mdio/Make.defs +++ b/system/mdio/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/mdio/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/mdio/Makefile b/system/mdio/Makefile index f04348dee4e..03813a8659f 100644 --- a/system/mdio/Makefile +++ b/system/mdio/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/mdio/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/mdio/mdio_main.c b/system/mdio/mdio_main.c index 2346a05027e..860d4c3178e 100644 --- a/system/mdio/mdio_main.c +++ b/system/mdio/mdio_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/mdio/mdio_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/netdb/CMakeLists.txt b/system/netdb/CMakeLists.txt index 4bd8d2319f4..525e96d7b2b 100644 --- a/system/netdb/CMakeLists.txt +++ b/system/netdb/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/netdb/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/netdb/Make.defs b/system/netdb/Make.defs index b76d9a9d141..4a2f743a992 100644 --- a/system/netdb/Make.defs +++ b/system/netdb/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/netdb/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/netdb/Makefile b/system/netdb/Makefile index e0c685b87f1..60f50235fcc 100644 --- a/system/netdb/Makefile +++ b/system/netdb/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/netdb/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/netdb/netdb_main.c b/system/netdb/netdb_main.c index 9252011c78e..8260de35d11 100644 --- a/system/netdb/netdb_main.c +++ b/system/netdb/netdb_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/netdb/netdb_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/nsh/CMakeLists.txt b/system/nsh/CMakeLists.txt index 8cf5902ee09..d58dc75b78c 100644 --- a/system/nsh/CMakeLists.txt +++ b/system/nsh/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/nsh/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/nsh/Make.defs b/system/nsh/Make.defs index 1606f757932..401d26d49ee 100644 --- a/system/nsh/Make.defs +++ b/system/nsh/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/nsh/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/nsh/Makefile b/system/nsh/Makefile index d6f14490ac0..fed2f156710 100644 --- a/system/nsh/Makefile +++ b/system/nsh/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/nsh/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/nsh/nsh_main.c b/system/nsh/nsh_main.c index 6a82938eec1..3a68afbfe0c 100644 --- a/system/nsh/nsh_main.c +++ b/system/nsh/nsh_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/nsh/nsh_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/nsh/sh_main.c b/system/nsh/sh_main.c index 38e45920d39..4a324155f6d 100644 --- a/system/nsh/sh_main.c +++ b/system/nsh/sh_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/nsh/sh_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/ntpc/CMakeLists.txt b/system/ntpc/CMakeLists.txt index aaacd50bcd9..6c36cb3495a 100644 --- a/system/ntpc/CMakeLists.txt +++ b/system/ntpc/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/ntpc/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/ntpc/Make.defs b/system/ntpc/Make.defs index 9573fdd2bc6..64949f08db4 100644 --- a/system/ntpc/Make.defs +++ b/system/ntpc/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/ntpc/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/ntpc/Makefile b/system/ntpc/Makefile index 4f25e358865..8a6fb0856cd 100644 --- a/system/ntpc/Makefile +++ b/system/ntpc/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/ntpc/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/ntpc/ntpcstart_main.c b/system/ntpc/ntpcstart_main.c index 3812c130284..dc69a6abe8e 100644 --- a/system/ntpc/ntpcstart_main.c +++ b/system/ntpc/ntpcstart_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/ntpc/ntpcstart_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/ntpc/ntpcstatus_main.c b/system/ntpc/ntpcstatus_main.c index 73c251db57c..457f9f974d8 100644 --- a/system/ntpc/ntpcstatus_main.c +++ b/system/ntpc/ntpcstatus_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/ntpc/ntpcstatus_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/ntpc/ntpcstop_main.c b/system/ntpc/ntpcstop_main.c index be1e911a9ae..89cb397e897 100644 --- a/system/ntpc/ntpcstop_main.c +++ b/system/ntpc/ntpcstop_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/ntpc/ntpcstop_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/nxcamera/CMakeLists.txt b/system/nxcamera/CMakeLists.txt index 4f7aad5dc9f..55aba0df01b 100644 --- a/system/nxcamera/CMakeLists.txt +++ b/system/nxcamera/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/nxcamera/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/nxcamera/Make.defs b/system/nxcamera/Make.defs index bb3931b445e..fe2b92cd521 100644 --- a/system/nxcamera/Make.defs +++ b/system/nxcamera/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/nxcamera/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/nxcamera/Makefile b/system/nxcamera/Makefile index 88cbffe73c5..204e5a48375 100644 --- a/system/nxcamera/Makefile +++ b/system/nxcamera/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/nxcamera/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/nxcamera/nxcamera.c b/system/nxcamera/nxcamera.c index ed68caf533d..d2070e966e6 100644 --- a/system/nxcamera/nxcamera.c +++ b/system/nxcamera/nxcamera.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/nxcamera/nxcamera.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/nxcamera/nxcamera_main.c b/system/nxcamera/nxcamera_main.c index e834932f41b..c5fd52d9ede 100644 --- a/system/nxcamera/nxcamera_main.c +++ b/system/nxcamera/nxcamera_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/nxcamera/nxcamera_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/nxcodec/CMakeLists.txt b/system/nxcodec/CMakeLists.txt index fcb19d80e05..a640dc1dd65 100644 --- a/system/nxcodec/CMakeLists.txt +++ b/system/nxcodec/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/nxcodec/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/nxcodec/Make.defs b/system/nxcodec/Make.defs index ba076854981..2e60809a0cd 100644 --- a/system/nxcodec/Make.defs +++ b/system/nxcodec/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/nxcodec/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/nxcodec/Makefile b/system/nxcodec/Makefile index 220e4f82c89..33722be01cc 100644 --- a/system/nxcodec/Makefile +++ b/system/nxcodec/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/nxcodec/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/nxcodec/nxcodec.c b/system/nxcodec/nxcodec.c index ddcc64bb931..729676fcef7 100644 --- a/system/nxcodec/nxcodec.c +++ b/system/nxcodec/nxcodec.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/nxcodec/nxcodec.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/nxcodec/nxcodec.h b/system/nxcodec/nxcodec.h index a3e89217bf8..eb6d5f2916b 100644 --- a/system/nxcodec/nxcodec.h +++ b/system/nxcodec/nxcodec.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/nxcodec/nxcodec.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/nxcodec/nxcodec_context.c b/system/nxcodec/nxcodec_context.c index 258c3c3e80a..025627d362f 100644 --- a/system/nxcodec/nxcodec_context.c +++ b/system/nxcodec/nxcodec_context.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/nxcodec/nxcodec_context.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/nxcodec/nxcodec_context.h b/system/nxcodec/nxcodec_context.h index 854fc67aa53..b679380ffa5 100644 --- a/system/nxcodec/nxcodec_context.h +++ b/system/nxcodec/nxcodec_context.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/nxcodec/nxcodec_context.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/nxcodec/nxcodec_main.c b/system/nxcodec/nxcodec_main.c index 06f9f910c77..b4aab313142 100644 --- a/system/nxcodec/nxcodec_main.c +++ b/system/nxcodec/nxcodec_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/nxcodec/nxcodec_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/nxdiag/Make.defs b/system/nxdiag/Make.defs index 8ba171698d8..8a8c1a0399e 100644 --- a/system/nxdiag/Make.defs +++ b/system/nxdiag/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/nxdiag/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/nxdiag/Makefile b/system/nxdiag/Makefile index 5180b62be7e..2e971a46d21 100644 --- a/system/nxdiag/Makefile +++ b/system/nxdiag/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/nxdiag/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/nxdiag/nxdiag.c b/system/nxdiag/nxdiag.c index dae2a342be6..c10ebeca3c2 100644 --- a/system/nxdiag/nxdiag.c +++ b/system/nxdiag/nxdiag.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/nxdiag/nxdiag.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/nxlooper/CMakeLists.txt b/system/nxlooper/CMakeLists.txt index 76ab06f07c7..07851911532 100644 --- a/system/nxlooper/CMakeLists.txt +++ b/system/nxlooper/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/nxlooper/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/nxlooper/Make.defs b/system/nxlooper/Make.defs index e2e3c8ec05d..edae44f8dca 100644 --- a/system/nxlooper/Make.defs +++ b/system/nxlooper/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/nxlooper/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/nxlooper/Makefile b/system/nxlooper/Makefile index d3e733767a9..6e32465d6e6 100644 --- a/system/nxlooper/Makefile +++ b/system/nxlooper/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/nxlooper/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/nxlooper/nxlooper.c b/system/nxlooper/nxlooper.c index a55b0285929..d8a5ec19809 100644 --- a/system/nxlooper/nxlooper.c +++ b/system/nxlooper/nxlooper.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/nxlooper/nxlooper.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/nxlooper/nxlooper_main.c b/system/nxlooper/nxlooper_main.c index 39be125ed7d..82a7ec50df6 100644 --- a/system/nxlooper/nxlooper_main.c +++ b/system/nxlooper/nxlooper_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/nxlooper/nxlooper_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/nxplayer/CMakeLists.txt b/system/nxplayer/CMakeLists.txt index 82ef6d13192..f167991d605 100644 --- a/system/nxplayer/CMakeLists.txt +++ b/system/nxplayer/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/nxplayer/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/nxplayer/Make.defs b/system/nxplayer/Make.defs index 2f22783a8b2..5c7e2ed1e96 100644 --- a/system/nxplayer/Make.defs +++ b/system/nxplayer/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/nxplayer/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/nxplayer/Makefile b/system/nxplayer/Makefile index 02e77446f73..777a77b7b09 100644 --- a/system/nxplayer/Makefile +++ b/system/nxplayer/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/nxplayer/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/nxplayer/nxplayer.c b/system/nxplayer/nxplayer.c index 1221935b7fd..38f252c1a76 100644 --- a/system/nxplayer/nxplayer.c +++ b/system/nxplayer/nxplayer.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/nxplayer/nxplayer.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/nxplayer/nxplayer_common.c b/system/nxplayer/nxplayer_common.c index 47e0b288ae8..94b794c2c3a 100644 --- a/system/nxplayer/nxplayer_common.c +++ b/system/nxplayer/nxplayer_common.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/nxplayer/nxplayer_common.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/nxplayer/nxplayer_main.c b/system/nxplayer/nxplayer_main.c index dc9d60152cc..e4869cf64bd 100644 --- a/system/nxplayer/nxplayer_main.c +++ b/system/nxplayer/nxplayer_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/nxplayer/nxplayer_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/nxplayer/nxplayer_mp3.c b/system/nxplayer/nxplayer_mp3.c index 445fe29dda5..7bf324f4727 100644 --- a/system/nxplayer/nxplayer_mp3.c +++ b/system/nxplayer/nxplayer_mp3.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/nxplayer/nxplayer_mp3.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/nxplayer/nxplayer_sbc.c b/system/nxplayer/nxplayer_sbc.c index c3851f4164a..50b7b82a27f 100644 --- a/system/nxplayer/nxplayer_sbc.c +++ b/system/nxplayer/nxplayer_sbc.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/nxplayer/nxplayer_sbc.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/nxrecorder/CMakeLists.txt b/system/nxrecorder/CMakeLists.txt index 5f43d4e7501..91412f89c33 100644 --- a/system/nxrecorder/CMakeLists.txt +++ b/system/nxrecorder/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/nxrecorder/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/nxrecorder/Make.defs b/system/nxrecorder/Make.defs index ca583d4f48c..3f1d4beac8d 100644 --- a/system/nxrecorder/Make.defs +++ b/system/nxrecorder/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/nxrecorder/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/nxrecorder/Makefile b/system/nxrecorder/Makefile index 2a2f6d09f0e..9d83b6dd466 100644 --- a/system/nxrecorder/Makefile +++ b/system/nxrecorder/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/nxrecorder/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/nxrecorder/nxrecorder.c b/system/nxrecorder/nxrecorder.c index 10f4806e964..882632a3765 100644 --- a/system/nxrecorder/nxrecorder.c +++ b/system/nxrecorder/nxrecorder.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/nxrecorder/nxrecorder.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/nxrecorder/nxrecorder_amr.c b/system/nxrecorder/nxrecorder_amr.c index 646be196fa4..2f03d06aff6 100644 --- a/system/nxrecorder/nxrecorder_amr.c +++ b/system/nxrecorder/nxrecorder_amr.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/nxrecorder/nxrecorder_amr.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/nxrecorder/nxrecorder_common.c b/system/nxrecorder/nxrecorder_common.c index 04d3ce94104..d063f140cca 100644 --- a/system/nxrecorder/nxrecorder_common.c +++ b/system/nxrecorder/nxrecorder_common.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/nxrecorder/nxrecorder_common.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/nxrecorder/nxrecorder_main.c b/system/nxrecorder/nxrecorder_main.c index bdfc2c3ebcd..3406116962a 100644 --- a/system/nxrecorder/nxrecorder_main.c +++ b/system/nxrecorder/nxrecorder_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/nxrecorder/nxrecorder_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/ofloader/CMakeLists.txt b/system/ofloader/CMakeLists.txt index b706f9074eb..7346856cfb4 100644 --- a/system/ofloader/CMakeLists.txt +++ b/system/ofloader/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/ofloader/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/ofloader/Make.defs b/system/ofloader/Make.defs index e7b79a4fa5b..e54ca70c19f 100644 --- a/system/ofloader/Make.defs +++ b/system/ofloader/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/ofloader/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/ofloader/Makefile b/system/ofloader/Makefile index 8145e53c6e3..25160bb41ee 100644 --- a/system/ofloader/Makefile +++ b/system/ofloader/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/ofloader/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/ofloader/ofloader.c b/system/ofloader/ofloader.c index 62e52bc0bea..f68e4a96459 100644 --- a/system/ofloader/ofloader.c +++ b/system/ofloader/ofloader.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/ofloader/ofloader.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/ofloader/ofloader.h b/system/ofloader/ofloader.h index 37efff62419..4d42e3dc8ea 100644 --- a/system/ofloader/ofloader.h +++ b/system/ofloader/ofloader.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/ofloader/ofloader.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/ofloader/segger.c b/system/ofloader/segger.c index 0e4d6c6aedb..9308454ae13 100644 --- a/system/ofloader/segger.c +++ b/system/ofloader/segger.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/ofloader/segger.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/ping/CMakeLists.txt b/system/ping/CMakeLists.txt index ede8dc31a9b..e640aa2d32c 100644 --- a/system/ping/CMakeLists.txt +++ b/system/ping/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/ping/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/ping/Make.defs b/system/ping/Make.defs index 72c33608f1d..7f03389ac25 100644 --- a/system/ping/Make.defs +++ b/system/ping/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/ping/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/ping/Makefile b/system/ping/Makefile index 037216226c9..9f82c530418 100644 --- a/system/ping/Makefile +++ b/system/ping/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/ping/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/ping/ping.c b/system/ping/ping.c index 22399c48caa..804522112b7 100644 --- a/system/ping/ping.c +++ b/system/ping/ping.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/ping/ping.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/ping6/CMakeLists.txt b/system/ping6/CMakeLists.txt index 944901a58ee..38589a2b3a3 100644 --- a/system/ping6/CMakeLists.txt +++ b/system/ping6/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/ping6/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/ping6/Make.defs b/system/ping6/Make.defs index ae05cdf5077..e1e6cfcc09a 100644 --- a/system/ping6/Make.defs +++ b/system/ping6/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/ping6/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/ping6/Makefile b/system/ping6/Makefile index d3c6e9eafb7..ce79578adfd 100644 --- a/system/ping6/Makefile +++ b/system/ping6/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/ping6/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/ping6/ping6.c b/system/ping6/ping6.c index edd04eb42c4..5d18637b832 100644 --- a/system/ping6/ping6.c +++ b/system/ping6/ping6.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/ping6/ping6.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/popen/CMakeLists.txt b/system/popen/CMakeLists.txt index 6a15c0a4180..78add77e62a 100644 --- a/system/popen/CMakeLists.txt +++ b/system/popen/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/popen/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/popen/Make.defs b/system/popen/Make.defs index d1aac4c1411..9ecee32e9be 100644 --- a/system/popen/Make.defs +++ b/system/popen/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/popen/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/popen/Makefile b/system/popen/Makefile index 3a25aceaf89..fbd9582745d 100644 --- a/system/popen/Makefile +++ b/system/popen/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/popen/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/popen/popen.c b/system/popen/popen.c index d4dd63cf175..5da6cadf1d0 100644 --- a/system/popen/popen.c +++ b/system/popen/popen.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/popen/popen.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/psmq/Make.defs b/system/psmq/Make.defs index fcf7effede2..dbff8aa2c2a 100644 --- a/system/psmq/Make.defs +++ b/system/psmq/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/psmq/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/psmq/Makefile b/system/psmq/Makefile index 72afd35a2d7..b414da61e48 100644 --- a/system/psmq/Makefile +++ b/system/psmq/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/psmq/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/ptpd/CMakeLists.txt b/system/ptpd/CMakeLists.txt index 318fa485815..d98b30c83a9 100644 --- a/system/ptpd/CMakeLists.txt +++ b/system/ptpd/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/ptpd/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/ptpd/Make.defs b/system/ptpd/Make.defs index 065a6c94bc7..5be56aa89ca 100644 --- a/system/ptpd/Make.defs +++ b/system/ptpd/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/ptpd/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/ptpd/Makefile b/system/ptpd/Makefile index 31c8355fc58..d8eec82d2a6 100644 --- a/system/ptpd/Makefile +++ b/system/ptpd/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/ptpd/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/ptpd/ptpd_main.c b/system/ptpd/ptpd_main.c index 46d24339e83..503300bcef5 100644 --- a/system/ptpd/ptpd_main.c +++ b/system/ptpd/ptpd_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/ptpd/ptpd_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/readline/CMakeLists.txt b/system/readline/CMakeLists.txt index e298f77abb7..09fbd9ae66c 100644 --- a/system/readline/CMakeLists.txt +++ b/system/readline/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/readline/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/readline/Make.defs b/system/readline/Make.defs index 6f6f49ce250..5ebf7ea47ad 100644 --- a/system/readline/Make.defs +++ b/system/readline/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/readline/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/readline/Makefile b/system/readline/Makefile index d14e4f003de..7f529b171a0 100644 --- a/system/readline/Makefile +++ b/system/readline/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/readline/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/readline/readline.c b/system/readline/readline.c index b077b4e8619..b8032e1ee6a 100644 --- a/system/readline/readline.c +++ b/system/readline/readline.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/readline/readline.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/readline/readline.h b/system/readline/readline.h index 58ebc1caae7..b4b5927f839 100644 --- a/system/readline/readline.h +++ b/system/readline/readline.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/readline/readline.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/readline/readline_common.c b/system/readline/readline_common.c index 3e63681b241..273821357fd 100644 --- a/system/readline/readline_common.c +++ b/system/readline/readline_common.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/readline/readline_common.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/readline/readline_fd.c b/system/readline/readline_fd.c index 914cafdde5e..d3822becfc1 100644 --- a/system/readline/readline_fd.c +++ b/system/readline/readline_fd.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/readline/readline_fd.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/readline/readline_stream.c b/system/readline/readline_stream.c index e2f4aeab9b0..3445d65a60f 100644 --- a/system/readline/readline_stream.c +++ b/system/readline/readline_stream.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/readline/readline_stream.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/sched_note/CMakeLists.txt b/system/sched_note/CMakeLists.txt index 4319a662023..df59a5011bc 100644 --- a/system/sched_note/CMakeLists.txt +++ b/system/sched_note/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/sched_note/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/sched_note/Make.defs b/system/sched_note/Make.defs index b9658e92a49..42eb65048d5 100644 --- a/system/sched_note/Make.defs +++ b/system/sched_note/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/sched_note/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/sched_note/Makefile b/system/sched_note/Makefile index 9b92e3bba30..f0db5a6b27f 100644 --- a/system/sched_note/Makefile +++ b/system/sched_note/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/sched_note/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/sched_note/note_main.c b/system/sched_note/note_main.c index 2f0691796bb..4abe3b424b8 100644 --- a/system/sched_note/note_main.c +++ b/system/sched_note/note_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/sched_note/note_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/sensorscope/CMakeLists.txt b/system/sensorscope/CMakeLists.txt index 554114ff239..d1aaa286705 100644 --- a/system/sensorscope/CMakeLists.txt +++ b/system/sensorscope/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/sensorscope/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/sensorscope/Make.defs b/system/sensorscope/Make.defs index 2e766477195..d4b84a72152 100644 --- a/system/sensorscope/Make.defs +++ b/system/sensorscope/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/systen/sensorscope/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/sensorscope/Makefile b/system/sensorscope/Makefile index 18ee6313332..815e72208a3 100644 --- a/system/sensorscope/Makefile +++ b/system/sensorscope/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/sensorscope/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/sensorscope/sensorscope_main.c b/system/sensorscope/sensorscope_main.c index ab80be5270b..fa194b39e65 100644 --- a/system/sensorscope/sensorscope_main.c +++ b/system/sensorscope/sensorscope_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/sensorscope/sensorscope_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/setlogmask/CMakeLists.txt b/system/setlogmask/CMakeLists.txt index 062bdb34714..9a38c0bbfcc 100644 --- a/system/setlogmask/CMakeLists.txt +++ b/system/setlogmask/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/setlogmask/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/setlogmask/Make.defs b/system/setlogmask/Make.defs index 753e357720f..3892070db93 100644 --- a/system/setlogmask/Make.defs +++ b/system/setlogmask/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/setlogmask/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/setlogmask/Makefile b/system/setlogmask/Makefile index 886709fcd08..a5d10ebb6e8 100644 --- a/system/setlogmask/Makefile +++ b/system/setlogmask/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/setlogmask/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/setlogmask/setlogmask.c b/system/setlogmask/setlogmask.c index 83c09174131..c405be5a91f 100644 --- a/system/setlogmask/setlogmask.c +++ b/system/setlogmask/setlogmask.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/setlogmask/setlogmask.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/settings/Make.defs b/system/settings/Make.defs index 9092af73f9e..532ed0e7016 100644 --- a/system/settings/Make.defs +++ b/system/settings/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/settings/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/settings/Makefile b/system/settings/Makefile index 318b2278dcf..cd586572373 100644 --- a/system/settings/Makefile +++ b/system/settings/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/settings/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/settings/settings.c b/system/settings/settings.c index 3af4e4961f7..d6a6673af91 100644 --- a/system/settings/settings.c +++ b/system/settings/settings.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/settings/settings.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/settings/storage.h b/system/settings/storage.h index dd6672baa15..1190d2939e7 100644 --- a/system/settings/storage.h +++ b/system/settings/storage.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/settings/storage.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/settings/storage_bin.c b/system/settings/storage_bin.c index 6c6ed6777cf..dff17f6fa22 100644 --- a/system/settings/storage_bin.c +++ b/system/settings/storage_bin.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/settings/storage_bin.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/settings/storage_text.c b/system/settings/storage_text.c index d1d4f85fe4e..de48a60a2f6 100644 --- a/system/settings/storage_text.c +++ b/system/settings/storage_text.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/settings/storage_text.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/spi/CMakeLists.txt b/system/spi/CMakeLists.txt index 162c86c14bc..691dbfc7655 100644 --- a/system/spi/CMakeLists.txt +++ b/system/spi/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/spi/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/spi/Make.defs b/system/spi/Make.defs index fab66e59cb9..09ff246fc16 100644 --- a/system/spi/Make.defs +++ b/system/spi/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/spi/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/spi/Makefile b/system/spi/Makefile index f9fd9b03a1c..a800ed0e011 100644 --- a/system/spi/Makefile +++ b/system/spi/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/spi/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/spi/spi_bus.c b/system/spi/spi_bus.c index db167afa7d1..d3765009d81 100644 --- a/system/spi/spi_bus.c +++ b/system/spi/spi_bus.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/spi/spi_bus.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/spi/spi_common.c b/system/spi/spi_common.c index 906b4d1f0f3..bb35063af63 100644 --- a/system/spi/spi_common.c +++ b/system/spi/spi_common.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/spi/spi_common.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/spi/spi_devif.c b/system/spi/spi_devif.c index 4243e608b42..e4c270578eb 100644 --- a/system/spi/spi_devif.c +++ b/system/spi/spi_devif.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/spi/spi_devif.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/spi/spi_exch.c b/system/spi/spi_exch.c index f229bf238c3..df2c81b38f1 100644 --- a/system/spi/spi_exch.c +++ b/system/spi/spi_exch.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/spi/spi_exch.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/spi/spi_main.c b/system/spi/spi_main.c index b9a698142a8..b09796db830 100644 --- a/system/spi/spi_main.c +++ b/system/spi/spi_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/spi/spi_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/spi/spitool.h b/system/spi/spitool.h index 8db21821f0e..cf6f4bbc99d 100644 --- a/system/spi/spitool.h +++ b/system/spi/spitool.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/spi/spitool.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/stackmonitor/CMakeLists.txt b/system/stackmonitor/CMakeLists.txt index ad231b60bd3..932cf42340f 100644 --- a/system/stackmonitor/CMakeLists.txt +++ b/system/stackmonitor/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/stackmonitor/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/stackmonitor/Make.defs b/system/stackmonitor/Make.defs index ba3bc06ac7a..d244a2722c0 100644 --- a/system/stackmonitor/Make.defs +++ b/system/stackmonitor/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/stackmonitor/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/stackmonitor/Makefile b/system/stackmonitor/Makefile index 824b96b41e3..7cc81663aea 100644 --- a/system/stackmonitor/Makefile +++ b/system/stackmonitor/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/stackmonitor/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/stackmonitor/stackmonitor.c b/system/stackmonitor/stackmonitor.c index 2aca2c17bd1..7fb316933cd 100644 --- a/system/stackmonitor/stackmonitor.c +++ b/system/stackmonitor/stackmonitor.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/stackmonitor/stackmonitor.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/system/CMakeLists.txt b/system/system/CMakeLists.txt index 97c7e55f712..56136a01b64 100644 --- a/system/system/CMakeLists.txt +++ b/system/system/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/system/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/system/Make.defs b/system/system/Make.defs index bd4b484a99b..00faabf1a15 100644 --- a/system/system/Make.defs +++ b/system/system/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/system/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/system/Makefile b/system/system/Makefile index 73daf2c3321..c3463df93d8 100644 --- a/system/system/Makefile +++ b/system/system/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/system/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/system/system.c b/system/system/system.c index 096f99718ab..3fd9850d729 100644 --- a/system/system/system.c +++ b/system/system/system.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/system/system.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/taskset/CMakeLists.txt b/system/taskset/CMakeLists.txt index 4954b822068..b274f534df9 100644 --- a/system/taskset/CMakeLists.txt +++ b/system/taskset/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/taskset/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/taskset/Make.defs b/system/taskset/Make.defs index b0f5e40dd33..a0c30459042 100644 --- a/system/taskset/Make.defs +++ b/system/taskset/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/taskset/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/taskset/Makefile b/system/taskset/Makefile index 45fec5d2109..82e53853e99 100644 --- a/system/taskset/Makefile +++ b/system/taskset/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/taskset/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/taskset/taskset.c b/system/taskset/taskset.c index 3cffd2e282c..af74a407667 100644 --- a/system/taskset/taskset.c +++ b/system/taskset/taskset.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/taskset/taskset.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/tcpdump/CMakeLists.txt b/system/tcpdump/CMakeLists.txt index f01276cc18c..3728da8257b 100644 --- a/system/tcpdump/CMakeLists.txt +++ b/system/tcpdump/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/tcpdump/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/tcpdump/Make.defs b/system/tcpdump/Make.defs index 37e90067e6f..4f863923074 100644 --- a/system/tcpdump/Make.defs +++ b/system/tcpdump/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/tcpdump/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/tcpdump/Makefile b/system/tcpdump/Makefile index 4968b15ec7d..39edc8da245 100644 --- a/system/tcpdump/Makefile +++ b/system/tcpdump/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/tcpdump/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/tcpdump/tcpdump.c b/system/tcpdump/tcpdump.c index 2daac913ada..0220ae8bd02 100644 --- a/system/tcpdump/tcpdump.c +++ b/system/tcpdump/tcpdump.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/tcpdump/tcpdump.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/tee/CMakeLists.txt b/system/tee/CMakeLists.txt index 0e4af638bfa..a333dcc0e17 100644 --- a/system/tee/CMakeLists.txt +++ b/system/tee/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/tee/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/tee/Make.defs b/system/tee/Make.defs index 6548b82b9b3..42811df1a1c 100644 --- a/system/tee/Make.defs +++ b/system/tee/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/tee/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/tee/Makefile b/system/tee/Makefile index 09ba9b92891..3dd8394f781 100644 --- a/system/tee/Makefile +++ b/system/tee/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/tee/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/telnet/CMakeLists.txt b/system/telnet/CMakeLists.txt index a9d9590524a..7f2eefb2e4a 100644 --- a/system/telnet/CMakeLists.txt +++ b/system/telnet/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/telnet/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/telnet/Make.defs b/system/telnet/Make.defs index 97ec7b226c3..bf732b51c80 100644 --- a/system/telnet/Make.defs +++ b/system/telnet/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/telnet/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/telnet/Makefile b/system/telnet/Makefile index 659fac16f68..f7a9ba0feea 100644 --- a/system/telnet/Makefile +++ b/system/telnet/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/telnet/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/telnet/telnet_chatd.c b/system/telnet/telnet_chatd.c index 5a7ca4fe5b4..5ab503092c7 100644 --- a/system/telnet/telnet_chatd.c +++ b/system/telnet/telnet_chatd.c @@ -1,23 +1,12 @@ /**************************************************************************** * apps/system/telnet/telnet_chatd.c * - * Leveraged from libtelnet, https://github.com/seanmiddleditch/libtelnet. - * Modified and re-released under the BSD license: - * - * Copyright (C) 2017 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * The original authors of libtelnet are listed below. Per their licesne, - * "The author or authors of this code dedicate any and all copyright - * interest in this code to the public domain. We make this dedication for - * the benefit of the public at large and to the detriment of our heirs and - * successors. We intend this dedication to be an overt act of - * relinquishment in perpetuity of all present and future rights to this - * code under copyright law." - * - * Author: Sean Middleditch - * (Also listed in the AUTHORS file are Jack Kelly - * and Katherine Flavel ) + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2017 Gregory Nutt. All rights reserved. + * SPDX-FileContributor: Sean Middleditch + * SPDX-FileContributor: Jack Kelly + * SPDX-FileContributor: Katherine Flavel + * SPDX-FileContributor: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -48,6 +37,21 @@ * ****************************************************************************/ +/* Leveraged from libtelnet, https://github.com/seanmiddleditch/libtelnet. + * Modified and re-released under the BSD license. + * + * The original authors of libtelnet are listed below. Per their licesne, + * "The author or authors of this code dedicate any and all copyright + * interest in this code to the public domain. We make this dedication for + * the benefit of the public at large and to the detriment of our heirs and + * successors. We intend this dedication to be an overt act of + * relinquishment in perpetuity of all present and future rights to this + * code under copyright law." + * + * Author: Sean Middleditch + * (Also listed in the AUTHORS file are Jack Kelly + * and Katherine Flavel ) + */ /**************************************************************************** * Included Files ****************************************************************************/ diff --git a/system/telnet/telnet_client.c b/system/telnet/telnet_client.c index 14ef9f923cd..7104d905396 100644 --- a/system/telnet/telnet_client.c +++ b/system/telnet/telnet_client.c @@ -1,23 +1,12 @@ /**************************************************************************** * apps/system/telnet/telnet_client.c * - * Leveraged from libtelnet, https://github.com/seanmiddleditch/libtelnet. - * Modified and re-released under the BSD license: - * - * Copyright (C) 2017 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * The original authors of libtelnet are listed below. Per their licesne, - * "The author or authors of this code dedicate any and all copyright - * interest in this code to the public domain. We make this dedication for - * the benefit of the public at large and to the detriment of our heirs and - * successors. We intend this dedication to be an overt act of - * relinquishment in perpetuity of all present and future rights to this - * code under copyright law." - * - * Author: Sean Middleditch - * (Also listed in the AUTHORS file are Jack Kelly - * and Katherine Flavel ) + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2017 Gregory Nutt. All rights reserved. + * SPDX-FileContributor: Sean Middleditch + * SPDX-FileContributor: Jack Kelly + * SPDX-FileContributor: Katherine Flavel + * SPDX-FileContributor: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -48,6 +37,21 @@ * ****************************************************************************/ +/* Leveraged from libtelnet, https://github.com/seanmiddleditch/libtelnet. + * Modified and re-released under the BSD license. + * + * The original authors of libtelnet are listed below. Per their licesne, + * "The author or authors of this code dedicate any and all copyright + * interest in this code to the public domain. We make this dedication for + * the benefit of the public at large and to the detriment of our heirs and + * successors. We intend this dedication to be an overt act of + * relinquishment in perpetuity of all present and future rights to this + * code under copyright law." + * + * Author: Sean Middleditch + * (Also listed in the AUTHORS file are Jack Kelly + * and Katherine Flavel ) + */ /**************************************************************************** * Included Files ****************************************************************************/ diff --git a/system/telnetd/CMakeLists.txt b/system/telnetd/CMakeLists.txt index 79b56967788..73990048caf 100644 --- a/system/telnetd/CMakeLists.txt +++ b/system/telnetd/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/telnetd/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/telnetd/Make.defs b/system/telnetd/Make.defs index dceb475ea56..0c3e7a43f19 100644 --- a/system/telnetd/Make.defs +++ b/system/telnetd/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/telnetd/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/telnetd/Makefile b/system/telnetd/Makefile index 414e90ca552..1c7bc749497 100644 --- a/system/telnetd/Makefile +++ b/system/telnetd/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/telnetd/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/telnetd/telnetd.c b/system/telnetd/telnetd.c index 8f536f2eb0b..5d861b1b114 100644 --- a/system/telnetd/telnetd.c +++ b/system/telnetd/telnetd.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/telnetd/telnetd.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/termcurses/CMakeLists.txt b/system/termcurses/CMakeLists.txt index 733250012eb..b38f8216b6e 100644 --- a/system/termcurses/CMakeLists.txt +++ b/system/termcurses/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/termcurses/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/termcurses/Make.defs b/system/termcurses/Make.defs index 9e532aa1335..8a4bbfaefd1 100644 --- a/system/termcurses/Make.defs +++ b/system/termcurses/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/termcurses/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/termcurses/Makefile b/system/termcurses/Makefile index e6e4ccc6b9c..7d42cb50068 100644 --- a/system/termcurses/Makefile +++ b/system/termcurses/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/termcurses/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/termcurses/tcurses_priv.h b/system/termcurses/tcurses_priv.h index 853d45c3ae1..44f708739d6 100644 --- a/system/termcurses/tcurses_priv.h +++ b/system/termcurses/tcurses_priv.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/termcurses/tcurses_priv.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/termcurses/tcurses_vt100.c b/system/termcurses/tcurses_vt100.c index 2cd3c215a56..84c369cce7e 100644 --- a/system/termcurses/tcurses_vt100.c +++ b/system/termcurses/tcurses_vt100.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/termcurses/tcurses_vt100.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/termcurses/termcurses.c b/system/termcurses/termcurses.c index 1b6c6d3929f..4d042b6eb56 100644 --- a/system/termcurses/termcurses.c +++ b/system/termcurses/termcurses.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/termcurses/termcurses.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/trace/CMakeLists.txt b/system/trace/CMakeLists.txt index acb26ba7278..9b192b43d1f 100644 --- a/system/trace/CMakeLists.txt +++ b/system/trace/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/trace/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/trace/Make.defs b/system/trace/Make.defs index 048217064dd..81726f26f95 100644 --- a/system/trace/Make.defs +++ b/system/trace/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/trace/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/trace/Makefile b/system/trace/Makefile index 685c92d1f90..e768d74394b 100644 --- a/system/trace/Makefile +++ b/system/trace/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/trace/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/trace/trace.c b/system/trace/trace.c index e41bf8e8b1e..46126b9e253 100644 --- a/system/trace/trace.c +++ b/system/trace/trace.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/trace/trace.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/trace/trace.h b/system/trace/trace.h index c71df4cb42f..5ac10484174 100644 --- a/system/trace/trace.h +++ b/system/trace/trace.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/trace/trace.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/trace/trace_dump.c b/system/trace/trace_dump.c index b78867a84c0..d51453da125 100644 --- a/system/trace/trace_dump.c +++ b/system/trace/trace_dump.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/trace/trace_dump.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/ubloxmodem/CMakeLists.txt b/system/ubloxmodem/CMakeLists.txt index 7354b5d5fc0..aa794771032 100644 --- a/system/ubloxmodem/CMakeLists.txt +++ b/system/ubloxmodem/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/ubloxmodem/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/ubloxmodem/Make.defs b/system/ubloxmodem/Make.defs index 4b709b8d2a5..3d6a3c28cef 100644 --- a/system/ubloxmodem/Make.defs +++ b/system/ubloxmodem/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/ubloxmodem/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/ubloxmodem/Makefile b/system/ubloxmodem/Makefile index d7a0c928fb7..14ef922a30a 100644 --- a/system/ubloxmodem/Makefile +++ b/system/ubloxmodem/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/ubloxmodem/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/ubloxmodem/ubloxmodem.h b/system/ubloxmodem/ubloxmodem.h index 7c9f99df3c0..c45bef8dd92 100644 --- a/system/ubloxmodem/ubloxmodem.h +++ b/system/ubloxmodem/ubloxmodem.h @@ -1,8 +1,9 @@ /**************************************************************************** * apps/system/ubloxmodem/ubloxmodem.h * - * Copyright (C) 2016 Vladimir Komendantskiy. All rights reserved. - * Author: Vladimir Komendantskiy + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2016 Vladimir Komendantskiy. All rights reserved. + * SPDX-FileContributor: Vladimir Komendantskiy * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/system/ubloxmodem/ubloxmodem_main.c b/system/ubloxmodem/ubloxmodem_main.c index 76f827f62a6..0a54b92400e 100644 --- a/system/ubloxmodem/ubloxmodem_main.c +++ b/system/ubloxmodem/ubloxmodem_main.c @@ -1,8 +1,9 @@ /**************************************************************************** * apps/system/ubloxmodem/ubloxmodem_main.c * - * Copyright (C) 2016 Vladimir Komendantskiy. All rights reserved. - * Author: Vladimir Komendantskiy + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2016 Vladimir Komendantskiy. All rights reserved. + * SPDX-FileContributor: Vladimir Komendantskiy * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/system/uniqueid/CMakeLists.txt b/system/uniqueid/CMakeLists.txt index d0a8c3d2add..633c410fb26 100644 --- a/system/uniqueid/CMakeLists.txt +++ b/system/uniqueid/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/uniqueid/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/uniqueid/Make.defs b/system/uniqueid/Make.defs index 1968d725acd..0a9dac4ccaf 100644 --- a/system/uniqueid/Make.defs +++ b/system/uniqueid/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/uniqueid/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/uniqueid/Makefile b/system/uniqueid/Makefile index 80b71444409..1d6b5553bda 100644 --- a/system/uniqueid/Makefile +++ b/system/uniqueid/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/uniqueid/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/uniqueid/uniqueid_main.c b/system/uniqueid/uniqueid_main.c index 1568d4a9c57..8f4337f297c 100644 --- a/system/uniqueid/uniqueid_main.c +++ b/system/uniqueid/uniqueid_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uniqueid/uniqueid_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/CMakeLists.txt b/system/uorb/CMakeLists.txt index 0242039c37d..18656add337 100644 --- a/system/uorb/CMakeLists.txt +++ b/system/uorb/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/uorb/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/uorb/Make.defs b/system/uorb/Make.defs index 5d4e230ce46..f09e19c5c0c 100644 --- a/system/uorb/Make.defs +++ b/system/uorb/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/uorb/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/uorb/Makefile b/system/uorb/Makefile index 764ae9ac1f8..3b36622080f 100644 --- a/system/uorb/Makefile +++ b/system/uorb/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/uorb/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/uorb/listener.c b/system/uorb/listener.c index 9479cb2dd99..08b57e6e128 100644 --- a/system/uorb/listener.c +++ b/system/uorb/listener.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/listener.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/accel.c b/system/uorb/sensor/accel.c index 6e3d3139104..f2c67a34d06 100644 --- a/system/uorb/sensor/accel.c +++ b/system/uorb/sensor/accel.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/accel.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/accel.h b/system/uorb/sensor/accel.h index d4ac1c4bb68..6ee89ee76fd 100644 --- a/system/uorb/sensor/accel.h +++ b/system/uorb/sensor/accel.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/accel.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/angle.c b/system/uorb/sensor/angle.c index 03cd5aff652..e80404142c7 100644 --- a/system/uorb/sensor/angle.c +++ b/system/uorb/sensor/angle.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/angle.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/angle.h b/system/uorb/sensor/angle.h index cc7fd65fbec..984b31556b0 100644 --- a/system/uorb/sensor/angle.h +++ b/system/uorb/sensor/angle.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/angle.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/baro.c b/system/uorb/sensor/baro.c index 5ee66133e4f..d56cc9b87b6 100644 --- a/system/uorb/sensor/baro.c +++ b/system/uorb/sensor/baro.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/baro.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/baro.h b/system/uorb/sensor/baro.h index b5c8f930b28..579a3e6544b 100644 --- a/system/uorb/sensor/baro.h +++ b/system/uorb/sensor/baro.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/baro.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/cap.c b/system/uorb/sensor/cap.c index b2dd05310ec..b0e662160a0 100644 --- a/system/uorb/sensor/cap.c +++ b/system/uorb/sensor/cap.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/cap.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/cap.h b/system/uorb/sensor/cap.h index b4dd55372f3..092799ea273 100644 --- a/system/uorb/sensor/cap.h +++ b/system/uorb/sensor/cap.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/cap.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/co2.c b/system/uorb/sensor/co2.c index 9e23f73b2cc..50a5bf9312e 100644 --- a/system/uorb/sensor/co2.c +++ b/system/uorb/sensor/co2.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/co2.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/co2.h b/system/uorb/sensor/co2.h index a4692f9fa76..e22035025c4 100644 --- a/system/uorb/sensor/co2.h +++ b/system/uorb/sensor/co2.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/co2.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/dust.c b/system/uorb/sensor/dust.c index b8f55152d22..7e5097eb6ec 100644 --- a/system/uorb/sensor/dust.c +++ b/system/uorb/sensor/dust.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/dust.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/dust.h b/system/uorb/sensor/dust.h index 0be558d1505..07f37f9514b 100644 --- a/system/uorb/sensor/dust.h +++ b/system/uorb/sensor/dust.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/dust.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/ecg.c b/system/uorb/sensor/ecg.c index 99f51854add..7fbc4b6cafe 100644 --- a/system/uorb/sensor/ecg.c +++ b/system/uorb/sensor/ecg.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/ecg.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/ecg.h b/system/uorb/sensor/ecg.h index c190e24075b..021d2b7e95f 100644 --- a/system/uorb/sensor/ecg.h +++ b/system/uorb/sensor/ecg.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/ecg.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/force.c b/system/uorb/sensor/force.c index 4761ff82a7b..ed03c4801ba 100644 --- a/system/uorb/sensor/force.c +++ b/system/uorb/sensor/force.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/force.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/force.h b/system/uorb/sensor/force.h index 21ad64a9d5f..e566c1b5303 100644 --- a/system/uorb/sensor/force.h +++ b/system/uorb/sensor/force.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/force.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/gas.c b/system/uorb/sensor/gas.c index 72fd0e51ccd..24e10076d2e 100644 --- a/system/uorb/sensor/gas.c +++ b/system/uorb/sensor/gas.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/gas.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/gas.h b/system/uorb/sensor/gas.h index 62515040632..b6f4cea3763 100644 --- a/system/uorb/sensor/gas.h +++ b/system/uorb/sensor/gas.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/gas.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/gesture.c b/system/uorb/sensor/gesture.c index 5d50d42e1a0..0848b6fbb32 100644 --- a/system/uorb/sensor/gesture.c +++ b/system/uorb/sensor/gesture.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/gesture.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/gesture.h b/system/uorb/sensor/gesture.h index 8ea55688579..fa9d56d5218 100644 --- a/system/uorb/sensor/gesture.h +++ b/system/uorb/sensor/gesture.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/gesture.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/gnss.c b/system/uorb/sensor/gnss.c index 00ffcd33911..6c483ada702 100644 --- a/system/uorb/sensor/gnss.c +++ b/system/uorb/sensor/gnss.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/gnss.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/gnss.h b/system/uorb/sensor/gnss.h index 4ca00dff8ba..d03e2f95dee 100644 --- a/system/uorb/sensor/gnss.h +++ b/system/uorb/sensor/gnss.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/gnss.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/gyro.c b/system/uorb/sensor/gyro.c index d28e1ab5bd3..d1988f56d16 100644 --- a/system/uorb/sensor/gyro.c +++ b/system/uorb/sensor/gyro.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/gyro.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/gyro.h b/system/uorb/sensor/gyro.h index aeb6b93614f..1a235e2647c 100644 --- a/system/uorb/sensor/gyro.h +++ b/system/uorb/sensor/gyro.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/gyro.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/hall.c b/system/uorb/sensor/hall.c index 54be044140a..ab58b712b17 100644 --- a/system/uorb/sensor/hall.c +++ b/system/uorb/sensor/hall.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/hall.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/hall.h b/system/uorb/sensor/hall.h index 01792d70f87..1acb48301a0 100644 --- a/system/uorb/sensor/hall.h +++ b/system/uorb/sensor/hall.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/hall.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/hbeat.c b/system/uorb/sensor/hbeat.c index 45a317b64d8..77e3abb2799 100644 --- a/system/uorb/sensor/hbeat.c +++ b/system/uorb/sensor/hbeat.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/hbeat.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/hbeat.h b/system/uorb/sensor/hbeat.h index 493743fc16f..75478be95a2 100644 --- a/system/uorb/sensor/hbeat.h +++ b/system/uorb/sensor/hbeat.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/hbeat.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/hcho.c b/system/uorb/sensor/hcho.c index dea34d3b0d7..64db42f7f2e 100644 --- a/system/uorb/sensor/hcho.c +++ b/system/uorb/sensor/hcho.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/hcho.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/hcho.h b/system/uorb/sensor/hcho.h index d52d0b8d67a..22b1e421662 100644 --- a/system/uorb/sensor/hcho.h +++ b/system/uorb/sensor/hcho.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/hcho.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/hrate.c b/system/uorb/sensor/hrate.c index 2eb1df8de30..8616d88e192 100644 --- a/system/uorb/sensor/hrate.c +++ b/system/uorb/sensor/hrate.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/hrate.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/hrate.h b/system/uorb/sensor/hrate.h index d7b5e5266a2..53eec563171 100644 --- a/system/uorb/sensor/hrate.h +++ b/system/uorb/sensor/hrate.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/hrate.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/humi.c b/system/uorb/sensor/humi.c index b381dad42ca..951114413fb 100644 --- a/system/uorb/sensor/humi.c +++ b/system/uorb/sensor/humi.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/humi.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/humi.h b/system/uorb/sensor/humi.h index 32eaf4c0baf..d6cdb8c7d23 100644 --- a/system/uorb/sensor/humi.h +++ b/system/uorb/sensor/humi.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/humi.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/impd.c b/system/uorb/sensor/impd.c index 680f3c9f7b1..b398694ae75 100644 --- a/system/uorb/sensor/impd.c +++ b/system/uorb/sensor/impd.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/impd.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/impd.h b/system/uorb/sensor/impd.h index b2bedb62cda..8c9408f7ad8 100644 --- a/system/uorb/sensor/impd.h +++ b/system/uorb/sensor/impd.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/impd.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/ir.c b/system/uorb/sensor/ir.c index 1f5233bc1c9..a06f624c483 100644 --- a/system/uorb/sensor/ir.c +++ b/system/uorb/sensor/ir.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/ir.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/ir.h b/system/uorb/sensor/ir.h index 2fba176070a..c3049eb123a 100644 --- a/system/uorb/sensor/ir.h +++ b/system/uorb/sensor/ir.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/ir.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/light.c b/system/uorb/sensor/light.c index 27365f4c6ca..58b031a3065 100644 --- a/system/uorb/sensor/light.c +++ b/system/uorb/sensor/light.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/light.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/light.h b/system/uorb/sensor/light.h index c2a7c6f7b5a..bb71827b369 100644 --- a/system/uorb/sensor/light.h +++ b/system/uorb/sensor/light.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/light.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/mag.c b/system/uorb/sensor/mag.c index dd4e4985ccf..97077975b55 100644 --- a/system/uorb/sensor/mag.c +++ b/system/uorb/sensor/mag.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/mag.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/mag.h b/system/uorb/sensor/mag.h index 972e3f83e89..24fc2a72053 100644 --- a/system/uorb/sensor/mag.h +++ b/system/uorb/sensor/mag.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/mag.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/motion.c b/system/uorb/sensor/motion.c index fedaca04c6a..773e39edd04 100644 --- a/system/uorb/sensor/motion.c +++ b/system/uorb/sensor/motion.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/motion.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/motion.h b/system/uorb/sensor/motion.h index 313e9f57813..cbdd7c81e7b 100644 --- a/system/uorb/sensor/motion.h +++ b/system/uorb/sensor/motion.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/motion.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/noise.c b/system/uorb/sensor/noise.c index a87303bc4ac..bcb1fa25c9c 100644 --- a/system/uorb/sensor/noise.c +++ b/system/uorb/sensor/noise.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/noise.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/noise.h b/system/uorb/sensor/noise.h index 5f050416455..f07e72d0a18 100644 --- a/system/uorb/sensor/noise.h +++ b/system/uorb/sensor/noise.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/noise.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/ots.c b/system/uorb/sensor/ots.c index 913e7036629..b808a23cf6b 100644 --- a/system/uorb/sensor/ots.c +++ b/system/uorb/sensor/ots.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/ots.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/ots.h b/system/uorb/sensor/ots.h index 9a8c1ecb710..c2499a99deb 100644 --- a/system/uorb/sensor/ots.h +++ b/system/uorb/sensor/ots.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/ots.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/ph.c b/system/uorb/sensor/ph.c index 35d51e03a94..c8504209191 100644 --- a/system/uorb/sensor/ph.c +++ b/system/uorb/sensor/ph.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/ph.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/ph.h b/system/uorb/sensor/ph.h index 57d1e79e4a2..8153ed6a788 100644 --- a/system/uorb/sensor/ph.h +++ b/system/uorb/sensor/ph.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/ph.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/pm10.c b/system/uorb/sensor/pm10.c index 6ebb6ba47bd..b7feb5290ba 100644 --- a/system/uorb/sensor/pm10.c +++ b/system/uorb/sensor/pm10.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/pm10.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/pm10.h b/system/uorb/sensor/pm10.h index 6cba6edd70d..48bbcec3339 100644 --- a/system/uorb/sensor/pm10.h +++ b/system/uorb/sensor/pm10.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/pm10.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/pm1p0.c b/system/uorb/sensor/pm1p0.c index 4689d660f55..ad8476e40c4 100644 --- a/system/uorb/sensor/pm1p0.c +++ b/system/uorb/sensor/pm1p0.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/pm1p0.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/pm1p0.h b/system/uorb/sensor/pm1p0.h index dca018507eb..244646831c8 100644 --- a/system/uorb/sensor/pm1p0.h +++ b/system/uorb/sensor/pm1p0.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/pm1p0.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/pm25.c b/system/uorb/sensor/pm25.c index c64e56c0dbd..3e489036907 100644 --- a/system/uorb/sensor/pm25.c +++ b/system/uorb/sensor/pm25.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/pm25.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/pm25.h b/system/uorb/sensor/pm25.h index b62fb9d7ce8..f2140649ca0 100644 --- a/system/uorb/sensor/pm25.h +++ b/system/uorb/sensor/pm25.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/pm25.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/pose_6dof.c b/system/uorb/sensor/pose_6dof.c index 2e1741f1202..9eb4395d309 100644 --- a/system/uorb/sensor/pose_6dof.c +++ b/system/uorb/sensor/pose_6dof.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/pose_6dof.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/pose_6dof.h b/system/uorb/sensor/pose_6dof.h index 4601b927ed7..db451d044ca 100644 --- a/system/uorb/sensor/pose_6dof.h +++ b/system/uorb/sensor/pose_6dof.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/pose_6dof.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/ppgd.c b/system/uorb/sensor/ppgd.c index 574f8928b04..c547f0d4e26 100644 --- a/system/uorb/sensor/ppgd.c +++ b/system/uorb/sensor/ppgd.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/ppgd.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/ppgd.h b/system/uorb/sensor/ppgd.h index d326c50bdb4..e1621d1a455 100644 --- a/system/uorb/sensor/ppgd.h +++ b/system/uorb/sensor/ppgd.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/ppgd.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/ppgq.c b/system/uorb/sensor/ppgq.c index 108710533d8..13bcf1761f7 100644 --- a/system/uorb/sensor/ppgq.c +++ b/system/uorb/sensor/ppgq.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/ppgq.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/ppgq.h b/system/uorb/sensor/ppgq.h index 9816fcc8e28..a70fecb89fc 100644 --- a/system/uorb/sensor/ppgq.h +++ b/system/uorb/sensor/ppgq.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/ppgq.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/prox.c b/system/uorb/sensor/prox.c index 33d12d24ddb..ebe90626801 100644 --- a/system/uorb/sensor/prox.c +++ b/system/uorb/sensor/prox.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/prox.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/prox.h b/system/uorb/sensor/prox.h index b4d8eb9a3e4..350c3564546 100644 --- a/system/uorb/sensor/prox.h +++ b/system/uorb/sensor/prox.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/prox.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/rgb.c b/system/uorb/sensor/rgb.c index 0f4830570f8..658bfe4bdcd 100644 --- a/system/uorb/sensor/rgb.c +++ b/system/uorb/sensor/rgb.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/rgb.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/rgb.h b/system/uorb/sensor/rgb.h index 3eee8ec21cb..e28374a7854 100644 --- a/system/uorb/sensor/rgb.h +++ b/system/uorb/sensor/rgb.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/rgb.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/rotation.c b/system/uorb/sensor/rotation.c index 05777b8f133..03b9a4abb2c 100644 --- a/system/uorb/sensor/rotation.c +++ b/system/uorb/sensor/rotation.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/rotation.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/rotation.h b/system/uorb/sensor/rotation.h index e660beb60b6..49602310696 100644 --- a/system/uorb/sensor/rotation.h +++ b/system/uorb/sensor/rotation.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/rotation.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/step_counter.c b/system/uorb/sensor/step_counter.c index 36092254731..706b4f6a654 100644 --- a/system/uorb/sensor/step_counter.c +++ b/system/uorb/sensor/step_counter.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/step_counter.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/step_counter.h b/system/uorb/sensor/step_counter.h index 2e14a48eff9..addace32d0c 100644 --- a/system/uorb/sensor/step_counter.h +++ b/system/uorb/sensor/step_counter.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/step_counter.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/temp.c b/system/uorb/sensor/temp.c index e24089d23e9..8c8153e8348 100644 --- a/system/uorb/sensor/temp.c +++ b/system/uorb/sensor/temp.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/temp.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/temp.h b/system/uorb/sensor/temp.h index 3d0f9301e3f..2ee401af3b6 100644 --- a/system/uorb/sensor/temp.h +++ b/system/uorb/sensor/temp.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/temp.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/topics.c b/system/uorb/sensor/topics.c index f12db068f8d..02666a5f013 100644 --- a/system/uorb/sensor/topics.c +++ b/system/uorb/sensor/topics.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/topics.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/tvoc.c b/system/uorb/sensor/tvoc.c index 2ffb8314117..8fa7a1629c2 100644 --- a/system/uorb/sensor/tvoc.c +++ b/system/uorb/sensor/tvoc.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/tvoc.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/tvoc.h b/system/uorb/sensor/tvoc.h index 9c8f9889e60..7f9ed14cdfe 100644 --- a/system/uorb/sensor/tvoc.h +++ b/system/uorb/sensor/tvoc.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/tvoc.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/uv.c b/system/uorb/sensor/uv.c index 7c4cd205be3..748eafea32c 100644 --- a/system/uorb/sensor/uv.c +++ b/system/uorb/sensor/uv.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/uv.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/sensor/uv.h b/system/uorb/sensor/uv.h index fbdd6ddf929..29f6a9d0958 100644 --- a/system/uorb/sensor/uv.h +++ b/system/uorb/sensor/uv.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/sensor/uv.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/test/unit_test.c b/system/uorb/test/unit_test.c index 901d0a7945c..fc28daee573 100644 --- a/system/uorb/test/unit_test.c +++ b/system/uorb/test/unit_test.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/test/unit_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/test/utility.c b/system/uorb/test/utility.c index 2b65258deff..6e36edf2f30 100644 --- a/system/uorb/test/utility.c +++ b/system/uorb/test/utility.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/test/utility.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/test/utility.h b/system/uorb/test/utility.h index 76b9a406819..512413ab6a2 100644 --- a/system/uorb/test/utility.h +++ b/system/uorb/test/utility.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/test/utility.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/uORB/epoll.c b/system/uorb/uORB/epoll.c index f2972fe8473..28237acc8b9 100644 --- a/system/uorb/uORB/epoll.c +++ b/system/uorb/uORB/epoll.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/uORB/epoll.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/uORB/internal.h b/system/uorb/uORB/internal.h index fc2e2f5201c..7766ca1c417 100644 --- a/system/uorb/uORB/internal.h +++ b/system/uorb/uORB/internal.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/uORB/internal.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/uORB/loop.c b/system/uorb/uORB/loop.c index 62795f9bf62..772e37d40fb 100644 --- a/system/uorb/uORB/loop.c +++ b/system/uorb/uORB/loop.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/uORB/loop.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/uORB/uORB.c b/system/uorb/uORB/uORB.c index c5df8a78e5f..fd3f704af31 100644 --- a/system/uorb/uORB/uORB.c +++ b/system/uorb/uORB/uORB.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/uORB/uORB.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/uorb/uORB/uORB.h b/system/uorb/uORB/uORB.h index 212789918c8..69cffd08ac6 100644 --- a/system/uorb/uORB/uORB.h +++ b/system/uorb/uORB/uORB.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/uorb/uORB/uORB.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/usbmsc/CMakeLists.txt b/system/usbmsc/CMakeLists.txt index 86f984db67f..8c3c96edf6d 100644 --- a/system/usbmsc/CMakeLists.txt +++ b/system/usbmsc/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/usbmsc/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/usbmsc/Make.defs b/system/usbmsc/Make.defs index dce55e1c986..b313829e023 100644 --- a/system/usbmsc/Make.defs +++ b/system/usbmsc/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/usbmsc/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/usbmsc/Makefile b/system/usbmsc/Makefile index 2b3a852655f..8b53f7ce243 100644 --- a/system/usbmsc/Makefile +++ b/system/usbmsc/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/usbmsc/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/usbmsc/usbmsc.h b/system/usbmsc/usbmsc.h index 70a47970463..f931a427d2d 100644 --- a/system/usbmsc/usbmsc.h +++ b/system/usbmsc/usbmsc.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/usbmsc/usbmsc.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/usbmsc/usbmsc_main.c b/system/usbmsc/usbmsc_main.c index 0da82e6ce47..6b08e4da059 100644 --- a/system/usbmsc/usbmsc_main.c +++ b/system/usbmsc/usbmsc_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/usbmsc/usbmsc_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/vi/CMakeLists.txt b/system/vi/CMakeLists.txt index d0e0c6c11bd..b321cd498b5 100644 --- a/system/vi/CMakeLists.txt +++ b/system/vi/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/vi/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/vi/Make.defs b/system/vi/Make.defs index ab490db2fb5..37857e49aec 100644 --- a/system/vi/Make.defs +++ b/system/vi/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/vi/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/vi/Makefile b/system/vi/Makefile index 0c044c5e636..4da7fa812f5 100644 --- a/system/vi/Makefile +++ b/system/vi/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/vi/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/vi/vi.c b/system/vi/vi.c index 77aab8d7915..be4abbd84e0 100644 --- a/system/vi/vi.c +++ b/system/vi/vi.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/vi/vi.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/ymodem/CMakeLists.txt b/system/ymodem/CMakeLists.txt index 1922def8981..297b891a14d 100644 --- a/system/ymodem/CMakeLists.txt +++ b/system/ymodem/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/ymodem/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/ymodem/Make.defs b/system/ymodem/Make.defs index a18826be2c8..ec31227cea9 100644 --- a/system/ymodem/Make.defs +++ b/system/ymodem/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/ymodem/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/ymodem/Makefile b/system/ymodem/Makefile index f0ebc262eb6..c64726df0d7 100644 --- a/system/ymodem/Makefile +++ b/system/ymodem/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/ymodem/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/ymodem/rb_main.c b/system/ymodem/rb_main.c index 28fa4ee92d5..373e597fe96 100644 --- a/system/ymodem/rb_main.c +++ b/system/ymodem/rb_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/ymodem/rb_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/ymodem/sb_main.c b/system/ymodem/sb_main.c index b58a443af42..4453752e596 100644 --- a/system/ymodem/sb_main.c +++ b/system/ymodem/sb_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/ymodem/sb_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/ymodem/sbrb.py b/system/ymodem/sbrb.py index ee91767ec1e..0b97673842a 100755 --- a/system/ymodem/sbrb.py +++ b/system/ymodem/sbrb.py @@ -1,6 +1,8 @@ #!/bin/python3 # apps/system/ymodem/sbrb.py # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/ymodem/ymodem.c b/system/ymodem/ymodem.c index 0a717030e1b..48d1320dccb 100644 --- a/system/ymodem/ymodem.c +++ b/system/ymodem/ymodem.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/ymodem/ymodem.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/ymodem/ymodem.h b/system/ymodem/ymodem.h index d52b4934e3d..e8a6a12b4a4 100644 --- a/system/ymodem/ymodem.h +++ b/system/ymodem/ymodem.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/ymodem/ymodem.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/zlib/CMakeLists.txt b/system/zlib/CMakeLists.txt index 89c39b58c88..c326aef5775 100644 --- a/system/zlib/CMakeLists.txt +++ b/system/zlib/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/zlib/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/zlib/Make.defs b/system/zlib/Make.defs index 87e7a148e35..c828dbe3d19 100644 --- a/system/zlib/Make.defs +++ b/system/zlib/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/zlib/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/zlib/Makefile b/system/zlib/Makefile index b750f78b2a4..7c978a55295 100644 --- a/system/zlib/Makefile +++ b/system/zlib/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/zlib/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/zmodem/CMakeLists.txt b/system/zmodem/CMakeLists.txt index ee8ed7f624f..e35e470ed14 100644 --- a/system/zmodem/CMakeLists.txt +++ b/system/zmodem/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/system/zmodem/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/system/zmodem/Make.defs b/system/zmodem/Make.defs index 625976fafee..d4f60197e0c 100644 --- a/system/zmodem/Make.defs +++ b/system/zmodem/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/zmodem/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/zmodem/Makefile b/system/zmodem/Makefile index ca5a2485190..f9b33079ab2 100644 --- a/system/zmodem/Makefile +++ b/system/zmodem/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/system/zmodem/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/zmodem/Makefile.host b/system/zmodem/Makefile.host index f9697d8ba73..969ba85d823 100644 --- a/system/zmodem/Makefile.host +++ b/system/zmodem/Makefile.host @@ -1,6 +1,8 @@ ############################################################################ # apps/system/zmodem/Makefile.host # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/system/zmodem/host/crc16.c b/system/zmodem/host/crc16.c index 0f353001ce8..9d16ae285a0 100644 --- a/system/zmodem/host/crc16.c +++ b/system/zmodem/host/crc16.c @@ -1,24 +1,10 @@ /************************************************************************************************ * apps/system/zmodem/host/crc16.c * - * This file is a part of NuttX: - * - * Copyright (C) 2013 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * References: - * - * crc16_tab calculated by Mark G. Mendel, Network Systems Corporation. - * crc16part() logic derived from article Copyright (C) 1986 Stephen Satchell. - * - * "Programmers may incorporate any or all code into their programs, - * giving proper credit within the source. Publication of the - * source routines is permitted so long as proper credit is given - * to Stephen Satchell, Satchell Evaluations and Chuck Forsberg, - * Omen Technology." - * - * Re-released under the Modified BSD license which, I believe, is consistent with the - * original authors' intent: + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2013 Gregory Nutt. All rights reserved. + * SPDX-FileCopyrightText: 1986 Stephen Satchell. + * SPDX-FileContributor: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -49,6 +35,20 @@ * ************************************************************************************************/ +/* References: + * + * crc16_tab calculated by Mark G. Mendel, Network Systems Corporation. + * crc16part() logic derived from article Copyright (C) 1986 Stephen Satchell. + * + * "Programmers may incorporate any or all code into their programs, + * giving proper credit within the source. Publication of the + * source routines is permitted so long as proper credit is given + * to Stephen Satchell, Satchell Evaluations and Chuck Forsberg, + * Omen Technology." + * + * Re-released under the Modified BSD license which, I believe, is consistent with the + * original authors' intent. + */ /************************************************************************************************ * Included Files ************************************************************************************************/ diff --git a/system/zmodem/host/crc32.c b/system/zmodem/host/crc32.c index d2b8815ff13..940f8158a40 100644 --- a/system/zmodem/host/crc32.c +++ b/system/zmodem/host/crc32.c @@ -1,16 +1,47 @@ /************************************************************************************************ * apps/system/zmodem/host/crc32.c * - * This file is a part of NuttX: + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2013 Gregory Nutt. All rights reserved. + * SPDX-FileCopyrightText: 1986 Gary S. Brown + * SPDX-FileContributor: Gregory Nutt * - * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: * - * The logic in this file was developed by Gary S. Brown: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ************************************************************************************************/ + +/* The logic in this file was developed by Gary S. Brown: * * COPYRIGHT (C) 1986 Gary S. Brown. You may use this program, or code or tables * extracted from it, as desired without restriction. - * - * First, the polynomial itself and its table of feedback terms. The polynomial is: + */ + +/* First, the polynomial itself and its table of feedback terms. The polynomial is: * * X^32+X^26+X^23+X^22+X^16+X^12+X^11+X^10+X^8+X^7+X^5+X^4+X^2+X^1+X^0 * diff --git a/system/zmodem/host/debug.h b/system/zmodem/host/debug.h index 81605421e16..5f9f0a0f886 100644 --- a/system/zmodem/host/debug.h +++ b/system/zmodem/host/debug.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/zmodem/host/debug.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/zmodem/host/nuttx/ascii.h b/system/zmodem/host/nuttx/ascii.h index a1e55cccdcf..db18b947843 100644 --- a/system/zmodem/host/nuttx/ascii.h +++ b/system/zmodem/host/nuttx/ascii.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/zmodem/host/nuttx/ascii.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/zmodem/host/nuttx/compiler.h b/system/zmodem/host/nuttx/compiler.h index b8b42b9bbbf..d2a4ff0f90b 100644 --- a/system/zmodem/host/nuttx/compiler.h +++ b/system/zmodem/host/nuttx/compiler.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/zmodem/host/nuttx/compiler.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/zmodem/host/nuttx/config.h b/system/zmodem/host/nuttx/config.h index 4b6a21b2676..3e526ba0c77 100644 --- a/system/zmodem/host/nuttx/config.h +++ b/system/zmodem/host/nuttx/config.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/zmodem/host/nuttx/config.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/zmodem/host/nuttx/crc16.h b/system/zmodem/host/nuttx/crc16.h index 6abfb738766..b27f68f19e9 100644 --- a/system/zmodem/host/nuttx/crc16.h +++ b/system/zmodem/host/nuttx/crc16.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/zmodem/host/nuttx/crc16.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/zmodem/host/nuttx/crc32.h b/system/zmodem/host/nuttx/crc32.h index fd48786071e..c899f789609 100644 --- a/system/zmodem/host/nuttx/crc32.h +++ b/system/zmodem/host/nuttx/crc32.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/zmodem/host/nuttx/crc32.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/zmodem/rz_main.c b/system/zmodem/rz_main.c index 16099411f7a..af752ebc4dc 100644 --- a/system/zmodem/rz_main.c +++ b/system/zmodem/rz_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/zmodem/rz_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/zmodem/sz_main.c b/system/zmodem/sz_main.c index ca9d25a1aee..0b3251de587 100644 --- a/system/zmodem/sz_main.c +++ b/system/zmodem/sz_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/zmodem/sz_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/zmodem/zm.h b/system/zmodem/zm.h index 8cf460c8785..a7971c00e6a 100644 --- a/system/zmodem/zm.h +++ b/system/zmodem/zm.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/zmodem/zm.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/zmodem/zm_proto.c b/system/zmodem/zm_proto.c index 09131da6c35..c5600de62ee 100644 --- a/system/zmodem/zm_proto.c +++ b/system/zmodem/zm_proto.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/zmodem/zm_proto.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/zmodem/zm_receive.c b/system/zmodem/zm_receive.c index b93b9508593..6818a1fabe0 100644 --- a/system/zmodem/zm_receive.c +++ b/system/zmodem/zm_receive.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/zmodem/zm_receive.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/zmodem/zm_send.c b/system/zmodem/zm_send.c index 507df00831c..059a7d14a21 100644 --- a/system/zmodem/zm_send.c +++ b/system/zmodem/zm_send.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/zmodem/zm_send.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/zmodem/zm_state.c b/system/zmodem/zm_state.c index 5f8b6d92d34..4b7f4cfaf95 100644 --- a/system/zmodem/zm_state.c +++ b/system/zmodem/zm_state.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/zmodem/zm_state.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/zmodem/zm_utils.c b/system/zmodem/zm_utils.c index 3c130f7fd96..e0969a59154 100644 --- a/system/zmodem/zm_utils.c +++ b/system/zmodem/zm_utils.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/zmodem/zm_utils.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/system/zmodem/zm_watchdog.c b/system/zmodem/zm_watchdog.c index 606b9af9950..3749ea72acf 100644 --- a/system/zmodem/zm_watchdog.c +++ b/system/zmodem/zm_watchdog.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/system/zmodem/zm_watchdog.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The From 5369d238a8dd93e43381c6a7aa1cbfeb3e4746cd Mon Sep 17 00:00:00 2001 From: Alin Jerpelea Date: Sun, 29 Dec 2024 16:00:17 +0100 Subject: [PATCH 107/391] tee: remove the advertising clause 3. All advertising materials mentioning features or use of this software must display the following acknowledgement: This product includes software developed by the University of California, Berkeley and its contributors. permitted by Berkley amendment https://ipira.berkeley.edu/sites/default/files/amendment_of_4-clause_bsd_software_license.pdf following example from NETBSD and OPENBSD https://github.com/NetBSD/src/commit/eb7c1594f145c931049e1fd9eb056a5987e87e59 https://github.com/openbsd/src/commit/6580fee3295c971a919cc04bfc3598c5f8bcd2b1 Signed-off-by: Alin Jerpelea --- system/tee/tee.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/system/tee/tee.c b/system/tee/tee.c index 5a1b377ece3..99ed8386e6a 100644 --- a/system/tee/tee.c +++ b/system/tee/tee.c @@ -19,11 +19,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * From d2ff6c8f28e9565e4564dd8847f167abd3438f17 Mon Sep 17 00:00:00 2001 From: Alin Jerpelea Date: Sun, 29 Dec 2024 16:03:05 +0100 Subject: [PATCH 108/391] system/tee: migrate to SPDX identifier Most tools used for compliance and SBOM generation use SPDX identifiers This change brings us a step closer to an easy SBOM generation. Signed-off-by: Alin Jerpelea --- system/tee/tee.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/system/tee/tee.c b/system/tee/tee.c index 99ed8386e6a..3adab918fae 100644 --- a/system/tee/tee.c +++ b/system/tee/tee.c @@ -1,14 +1,11 @@ /**************************************************************************** * apps/system/tee/tee.c - * $NetBSD: tee.c,v 1.6 1997/10/20 00:37:11 lukem Exp $ * - * Copyright (c) 2016. Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Leveraged from NetBSD: - * - * Copyright (c) 1988, 1993 - * The Regents of the University of California. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2016 Gregory Nutt. All rights reserved. + * SPDX-FileCopyrightText: 1993 The Regents of the University of California. + * SPDX-FileCopyrightText: 1993 The Regents of the University of California. + * SPDX-FileContributor: Gregory Nutt * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions From 068220d3a7b6db0f93e20a4f5a7c52c2b69c5779 Mon Sep 17 00:00:00 2001 From: Alin Jerpelea Date: Sun, 29 Dec 2024 16:26:09 +0100 Subject: [PATCH 109/391] testing: migrate to SPDX identifier Most tools used for compliance and SBOM generation use SPDX identifiers This change brings us a step closer to an easy SBOM generation. Signed-off-by: Alin Jerpelea --- testing/CMakeLists.txt | 2 + testing/Make.defs | 2 + testing/Makefile | 2 + testing/arch_libc/CMakeLists.txt | 2 + testing/arch_libc/Make.defs | 2 + testing/arch_libc/Makefile | 2 + testing/arch_libc/arch_libc_test_main.c | 2 + testing/atomic/CMakeLists.txt | 2 + testing/atomic/Make.defs | 2 + testing/atomic/Makefile | 2 + testing/atomic/atomic_main.c | 2 + testing/cachetest/CMakeLists.txt | 2 + testing/cachetest/Make.defs | 2 + testing/cachetest/Makefile | 2 + testing/cachetest/cachetest_main.c | 2 + testing/cmocka/CMakeLists.txt | 2 + testing/cmocka/Make.defs | 2 + testing/cmocka/Makefile | 2 + testing/cmocka/cmocka_main.c | 2 + testing/cmocka/cmocka_platform.h | 2 + testing/cmocka/tools/cmocka_implement.py | 23 +++++++++ testing/cmocka/tools/cmocka_report.py | 2 + .../cmocka/tools/junit2htmlreport/parser.py | 22 +++++++++ .../cmocka/tools/junit2htmlreport/render.py | 22 +++++++++ .../tools/junit2htmlreport/textutils.py | 22 +++++++++ testing/cpuload/CMakeLists.txt | 2 + testing/cpuload/Make.defs | 2 + testing/cpuload/Makefile | 2 + testing/cpuload/cpuload_main.c | 2 + testing/crypto/3descbc.c | 4 +- testing/crypto/CMakeLists.txt | 2 + testing/crypto/Make.defs | 2 + testing/crypto/Makefile | 2 + testing/crypto/aescbc.c | 4 +- testing/crypto/aescmac.c | 2 + testing/crypto/aesctr.c | 4 +- testing/crypto/aesxts.c | 6 +-- testing/crypto/crc32.c | 2 + testing/crypto/dhm.c | 3 +- testing/crypto/ecdsa.c | 2 + testing/crypto/hash.c | 2 + testing/crypto/hmac.c | 4 +- testing/crypto/rsa.c | 2 + testing/cxxsize/CMakeLists.txt | 2 + testing/cxxsize/Make.defs | 2 + testing/cxxsize/Makefile | 2 + testing/cxxsize/array.cxx | 2 + testing/cxxsize/condition_variable.cxx | 2 + testing/cxxsize/deque.cxx | 2 + testing/cxxsize/exception.cxx | 2 + testing/cxxsize/forward_list.cxx | 2 + testing/cxxsize/future.cxx | 2 + testing/cxxsize/iostream.cxx | 2 + testing/cxxsize/list.cxx | 2 + testing/cxxsize/map.cxx | 2 + testing/cxxsize/multiset.cxx | 2 + testing/cxxsize/mutex.cxx | 2 + testing/cxxsize/rtti.cxx | 2 + testing/cxxsize/semaphore.cxx | 2 + testing/cxxsize/set.cxx | 2 + testing/cxxsize/shared_ptr.cxx | 2 + testing/cxxsize/string.cxx | 2 + testing/cxxsize/string_view.cxx | 2 + testing/cxxsize/thread.cxx | 2 + testing/cxxsize/unordered_map.cxx | 2 + testing/cxxsize/unordered_multimap.cxx | 2 + testing/cxxsize/unordered_multiset.cxx | 2 + testing/cxxsize/unordered_set.cxx | 2 + testing/cxxsize/vector.cxx | 2 + testing/cxxsize/weak_ptr.cxx | 2 + testing/cxxtest/CMakeLists.txt | 2 + testing/cxxtest/Make.defs | 2 + testing/cxxtest/Makefile | 2 + testing/cxxtest/cxxtest_main.cxx | 2 + testing/drivertest/CMakeLists.txt | 2 + testing/drivertest/Make.defs | 2 + testing/drivertest/Makefile | 2 + testing/drivertest/drivertest_adc.c | 2 + testing/drivertest/drivertest_audio.c | 2 + testing/drivertest/drivertest_block.c | 2 + testing/drivertest/drivertest_framebuffer.c | 2 + testing/drivertest/drivertest_gpio.c | 2 + testing/drivertest/drivertest_i2c_read.c | 2 + testing/drivertest/drivertest_i2c_spi.c | 2 + testing/drivertest/drivertest_i2c_write.c | 2 + testing/drivertest/drivertest_lcd.c | 2 + testing/drivertest/drivertest_mps2.c | 2 + .../drivertest/drivertest_mps2_isr_signal.c | 2 + .../drivertest_mps2_zerointerrupt.c | 2 + testing/drivertest/drivertest_oneshot.c | 2 + testing/drivertest/drivertest_pm.c | 2 + testing/drivertest/drivertest_pm_runtime.c | 2 + testing/drivertest/drivertest_pm_smp.c | 2 + testing/drivertest/drivertest_posix_timer.c | 2 + testing/drivertest/drivertest_pwm.c | 2 + testing/drivertest/drivertest_regulator.c | 2 + testing/drivertest/drivertest_relay.c | 2 + testing/drivertest/drivertest_rtc.c | 2 + testing/drivertest/drivertest_simple.c | 2 + testing/drivertest/drivertest_timer.c | 2 + testing/drivertest/drivertest_touchpanel.c | 2 + testing/drivertest/drivertest_uart.c | 2 + testing/drivertest/drivertest_watchdog.c | 2 + testing/drivertest/test_content_gen.py | 8 ++-- testing/epoll/CMakeLists.txt | 2 + testing/epoll/Make.defs | 2 + testing/epoll/Makefile | 2 + testing/epoll/epoll.c | 2 + testing/fatutf8/CMakeLists.txt | 2 + testing/fatutf8/Make.defs | 2 + testing/fatutf8/Makefile | 2 + testing/fatutf8/fatutf8_main.c | 2 + testing/fdsantest/CMakeLists.txt | 2 + testing/fdsantest/Make.defs | 2 + testing/fdsantest/Makefile | 2 + testing/fdsantest/fdsantest_simple.c | 2 + testing/fff/CMakeLists.txt | 2 + testing/fff/Make.defs | 2 + testing/fff/Makefile | 2 + testing/fftest/CMakeLists.txt | 2 + testing/fftest/Make.defs | 2 + testing/fftest/Makefile | 2 + testing/fftest/fftest.c | 2 + testing/fmemopen/CMakeLists.txt | 2 + testing/fmemopen/Make.defs | 2 + testing/fmemopen/Makefile | 2 + testing/fmemopen/fmemopen.c | 2 + testing/fopencookie/Make.defs | 2 + testing/fopencookie/Makefile | 2 + testing/fopencookie/fopencookie.c | 2 + testing/fstest/CMakeLists.txt | 2 + testing/fstest/Make.defs | 2 + testing/fstest/Makefile | 2 + testing/fstest/fstest_main.c | 2 + testing/getprime/CMakeLists.txt | 2 + testing/getprime/Make.defs | 2 + testing/getprime/Makefile | 2 + testing/getprime/getprime_main.c | 2 + testing/himem_test/LibIncludes.mk | 2 + testing/himem_test/Make.defs | 2 + testing/himem_test/Makefile | 2 + testing/himem_test/himem_chardev_test.c | 2 + testing/iob/CMakeLists.txt | 2 + testing/iob/Make.defs | 2 + testing/iob/Makefile | 2 + testing/iob/iob_main.c | 2 + testing/irtest/CMakeLists.txt | 2 + testing/irtest/Make.defs | 2 + testing/irtest/Makefile | 2 + testing/irtest/cmd.cxx | 2 + testing/irtest/cmd.hpp | 2 + testing/irtest/enum.cxx | 2 + testing/irtest/enum.hpp | 2 + testing/irtest/main.cxx | 2 + testing/kasantest/CMakeLists.txt | 2 + testing/kasantest/Make.defs | 2 + testing/kasantest/Makefile | 2 + testing/kasantest/kasantest.c | 2 + testing/ltp/Make.defs | 2 + testing/ltp/Makefile | 2 + testing/ltp/config.h | 2 + testing/memstress/CMakeLists.txt | 2 + testing/memstress/Make.defs | 2 + testing/memstress/Makefile | 2 + testing/memstress/memorystress_main.c | 2 + testing/memtester/CMakeLists.txt | 2 + testing/memtester/Make.defs | 2 + testing/memtester/Makefile | 2 + testing/mm/CMakeLists.txt | 2 + testing/mm/Make.defs | 2 + testing/mm/Makefile | 2 + testing/mm/mm_main.c | 2 + testing/monkey/CMakeLists.txt | 2 + testing/monkey/Make.defs | 2 + testing/monkey/Makefile | 2 + testing/monkey/monkey.c | 2 + testing/monkey/monkey.h | 2 + testing/monkey/monkey_assert.h | 2 + testing/monkey/monkey_dev.c | 2 + testing/monkey/monkey_dev.h | 2 + testing/monkey/monkey_event.c | 2 + testing/monkey/monkey_event.h | 2 + testing/monkey/monkey_log.c | 2 + testing/monkey/monkey_log.h | 2 + testing/monkey/monkey_main.c | 2 + testing/monkey/monkey_proc.c | 2 + testing/monkey/monkey_recorder.c | 2 + testing/monkey/monkey_recorder.h | 2 + testing/monkey/monkey_type.h | 2 + testing/monkey/monkey_utils.c | 2 + testing/monkey/monkey_utils.h | 2 + testing/mtd_config_fs/CMakeLists.txt | 2 + testing/mtd_config_fs/Make.defs | 2 + testing/mtd_config_fs/Makefile | 2 + .../mtd_config_fs/mtd_config_fs_test_main.c | 2 + testing/mtetest/CMakeLists.txt | 2 + testing/mtetest/Make.defs | 2 + testing/mtetest/Makefile | 2 + testing/mtetest/mtetest.c | 2 + testing/nand_sim/CMakeLists.txt | 2 + testing/nand_sim/Make.defs | 2 + testing/nand_sim/Makefile | 2 + testing/nand_sim/nand_sim_main.c | 1 + testing/nist-sts/CMakeLists.txt | 2 + testing/nist-sts/Make.defs | 2 + testing/nist-sts/Makefile | 2 + testing/nxffs/CMakeLists.txt | 2 + testing/nxffs/Make.defs | 2 + testing/nxffs/Makefile | 2 + testing/nxffs/nxffs_main.c | 2 + testing/open_memstream/CMakeLists.txt | 2 + testing/open_memstream/Make.defs | 2 + testing/open_memstream/Makefile | 2 + testing/open_memstream/open_memstream.c | 2 + testing/ostest/CMakeLists.txt | 2 + testing/ostest/Make.defs | 2 + testing/ostest/Makefile | 2 + testing/ostest/aio.c | 2 + testing/ostest/barrier.c | 2 + testing/ostest/cancel.c | 2 + testing/ostest/cond.c | 2 + testing/ostest/dev_null.c | 2 + testing/ostest/fpu.c | 2 + testing/ostest/getopt.c | 2 + testing/ostest/libc_memmem.c | 2 + testing/ostest/mqueue.c | 2 + testing/ostest/mutex.c | 2 + testing/ostest/nsem.c | 2 + testing/ostest/nxevent.c | 2 + testing/ostest/ostest.h | 2 + testing/ostest/ostest_main.c | 2 + testing/ostest/posixtimer.c | 2 + testing/ostest/prioinherit.c | 2 + testing/ostest/pthread_cleanup.c | 2 + testing/ostest/pthread_exit.c | 2 + testing/ostest/pthread_rwlock.c | 2 + testing/ostest/pthread_rwlock_cancel.c | 2 + testing/ostest/restart.c | 2 + testing/ostest/rmutex.c | 2 + testing/ostest/robust.c | 2 + testing/ostest/roundrobin.c | 2 + testing/ostest/sched_thread_local.c | 2 + testing/ostest/schedlock.c | 2 + testing/ostest/sem.c | 2 + testing/ostest/semtimed.c | 2 + testing/ostest/setjmp.c | 2 + testing/ostest/setvbuf.c | 2 + testing/ostest/sigev_thread.c | 2 + testing/ostest/sighand.c | 2 + testing/ostest/sighelper.c | 2 + testing/ostest/signest.c | 2 + testing/ostest/sigprocmask.c | 2 + testing/ostest/smp_call.c | 2 + testing/ostest/specific.c | 2 + testing/ostest/sporadic.c | 2 + testing/ostest/sporadic2.c | 2 + testing/ostest/suspend.c | 2 + testing/ostest/timedmqueue.c | 2 + testing/ostest/timedmutex.c | 2 + testing/ostest/timedwait.c | 2 + testing/ostest/tls.c | 2 + testing/ostest/vfork.c | 2 + testing/ostest/waitpid.c | 2 + testing/ostest/wdog.c | 2 + testing/ostest/wqueue.c | 2 + testing/pcitest/Make.defs | 2 + testing/pcitest/Makefile | 2 + testing/pcitest/pcitest.c | 2 + testing/ramtest/CMakeLists.txt | 2 + testing/ramtest/Make.defs | 2 + testing/ramtest/Makefile | 2 + testing/ramtest/ramtest.c | 2 + testing/resmonitor/CMakeLists.txt | 2 + testing/resmonitor/Make.defs | 3 +- testing/resmonitor/Makefile | 28 +++++++---- testing/resmonitor/fillcpu.c | 2 + testing/resmonitor/filldisk.c | 2 + testing/resmonitor/fillmem.c | 2 + testing/resmonitor/showinfo.c | 2 + testing/scanftest/CMakeLists.txt | 2 + testing/scanftest/Make.defs | 2 + testing/scanftest/Makefile | 2 + testing/scanftest/scanftest_main.c | 47 ++++++++++--------- testing/sd_bench/Make.defs | 2 + testing/sd_bench/Makefile | 2 + testing/sd_bench/sd_bench_main.c | 5 +- testing/sd_stress/Make.defs | 2 + testing/sd_stress/Makefile | 2 + testing/sd_stress/sd_stress_main.c | 5 +- testing/sensortest/CMakeLists.txt | 2 + testing/sensortest/Make.defs | 2 + testing/sensortest/Makefile | 2 + testing/sensortest/sensortest.c | 2 + testing/setest/CMakeLists.txt | 2 + testing/setest/Make.defs | 2 + testing/setest/Makefile | 2 + testing/setest/setest.c | 2 + testing/smart/CMakeLists.txt | 2 + testing/smart/Make.defs | 2 + testing/smart/Makefile | 2 + testing/smart/smart_main.c | 2 + testing/smart_test/CMakeLists.txt | 2 + testing/smart_test/Make.defs | 2 + testing/smart_test/Makefile | 2 + testing/smart_test/smart_test.c | 2 + testing/smp/CMakeLists.txt | 2 + testing/smp/Make.defs | 2 + testing/smp/Makefile | 2 + testing/smp/smp_main.c | 2 + testing/stressapptest/CMakeLists.txt | 2 + testing/stressapptest/Make.defs | 2 + testing/stressapptest/Makefile | 2 + testing/testsuites/Make.defs | 2 + testing/testsuites/Makefile | 2 + .../kernel/fs/cases/fs_append_test.c | 18 +++---- .../kernel/fs/cases/fs_creat_test.c | 18 +++---- .../testsuites/kernel/fs/cases/fs_dup2_test.c | 18 +++---- .../testsuites/kernel/fs/cases/fs_dup_test.c | 18 +++---- .../kernel/fs/cases/fs_eventfd_test.c | 18 +++---- .../kernel/fs/cases/fs_fcntl_test.c | 18 +++---- .../kernel/fs/cases/fs_fstat_test.c | 18 +++---- .../kernel/fs/cases/fs_fstatfs_test.c | 18 +++---- .../kernel/fs/cases/fs_fsync_test.c | 18 +++---- .../kernel/fs/cases/fs_getfilep_test.c | 18 +++---- .../kernel/fs/cases/fs_mkdir_test.c | 18 +++---- .../testsuites/kernel/fs/cases/fs_open_test.c | 18 +++---- .../kernel/fs/cases/fs_opendir_test.c | 18 +++---- .../testsuites/kernel/fs/cases/fs_poll_test.c | 18 +++---- .../kernel/fs/cases/fs_pread_test.c | 18 +++---- .../kernel/fs/cases/fs_pwrite_test.c | 18 +++---- .../testsuites/kernel/fs/cases/fs_read_test.c | 18 +++---- .../kernel/fs/cases/fs_readdir_test.c | 18 +++---- .../kernel/fs/cases/fs_readlink_test.c | 18 +++---- .../kernel/fs/cases/fs_rename_test.c | 18 +++---- .../kernel/fs/cases/fs_rewinddir_test.c | 18 +++---- .../kernel/fs/cases/fs_rmdir_test.c | 18 +++---- .../testsuites/kernel/fs/cases/fs_seek_test.c | 18 +++---- .../kernel/fs/cases/fs_sendfile_test.c | 18 +++---- .../testsuites/kernel/fs/cases/fs_stat_test.c | 18 +++---- .../kernel/fs/cases/fs_statfs_test.c | 18 +++---- .../kernel/fs/cases/fs_stream_test.c | 18 +++---- .../kernel/fs/cases/fs_symlink_test.c | 18 +++---- .../kernel/fs/cases/fs_truncate_test.c | 18 +++---- .../kernel/fs/cases/fs_unlink_test.c | 18 +++---- .../kernel/fs/cases/fs_write_test.c | 18 +++---- testing/testsuites/kernel/fs/cmocka_fs_test.c | 18 +++---- .../kernel/fs/common/test_fs_common.c | 18 +++---- testing/testsuites/kernel/fs/include/fstest.h | 18 +++---- .../testsuites/kernel/mm/cases/mm_test_001.c | 18 +++---- .../testsuites/kernel/mm/cases/mm_test_002.c | 18 +++---- .../testsuites/kernel/mm/cases/mm_test_003.c | 18 +++---- .../testsuites/kernel/mm/cases/mm_test_004.c | 18 +++---- .../testsuites/kernel/mm/cases/mm_test_005.c | 18 +++---- .../testsuites/kernel/mm/cases/mm_test_006.c | 18 +++---- .../testsuites/kernel/mm/cases/mm_test_007.c | 18 +++---- .../testsuites/kernel/mm/cases/mm_test_008.c | 18 +++---- testing/testsuites/kernel/mm/cmocka_mm_test.c | 18 +++---- .../kernel/mm/common/test_mm_common.c | 18 +++---- testing/testsuites/kernel/mm/include/MmTest.h | 20 ++++---- .../kernel/mm/tool/mem_batch_opt_perf_test.c | 18 +++---- .../kernel/mm/tool/mem_cycle_opt_perf_test.c | 18 +++---- .../kernel/mutex/cases/posix_mutex_test_001.c | 18 +++---- .../kernel/mutex/cases/posix_mutex_test_019.c | 18 +++---- .../kernel/mutex/cases/posix_mutex_test_020.c | 18 +++---- .../kernel/mutex/cmocka_mutex_test.c | 18 +++---- .../kernel/mutex/include/MutexTest.h | 19 ++++---- .../pthread/cases/posix_pthread_test_003.c | 18 +++---- .../pthread/cases/posix_pthread_test_004.c | 18 +++---- .../pthread/cases/posix_pthread_test_005.c | 18 +++---- .../pthread/cases/posix_pthread_test_006.c | 18 +++---- .../pthread/cases/posix_pthread_test_009.c | 18 +++---- .../pthread/cases/posix_pthread_test_018.c | 18 +++---- .../pthread/cases/posix_pthread_test_019.c | 18 +++---- .../pthread/cases/posix_pthread_test_021.c | 18 +++---- .../kernel/pthread/cmocka_pthread_test.c | 18 +++---- .../pthread/common/test_pthread_common.c | 18 +++---- .../kernel/pthread/include/PthreadTest.h | 19 ++++---- .../kernel/sched/cases/api_pthread_test_001.c | 18 +++---- .../kernel/sched/cases/api_pthread_test_002.c | 18 +++---- .../kernel/sched/cases/api_pthread_test_003.c | 18 +++---- .../kernel/sched/cases/api_pthread_test_004.c | 18 +++---- .../kernel/sched/cases/api_pthread_test_005.c | 18 +++---- .../kernel/sched/cases/api_pthread_test_006.c | 18 +++---- .../kernel/sched/cases/api_pthread_test_007.c | 18 +++---- .../kernel/sched/cases/api_pthread_test_008.c | 18 +++---- .../kernel/sched/cases/api_pthread_test_009.c | 18 +++---- .../kernel/sched/cases/api_task_test_001.c | 18 +++---- .../kernel/sched/cases/api_task_test_002.c | 18 +++---- .../kernel/sched/cases/api_task_test_003.c | 18 +++---- .../kernel/sched/cases/api_task_test_004.c | 18 +++---- .../kernel/sched/cases/api_task_test_005.c | 18 +++---- .../kernel/sched/cases/api_task_test_006.c | 18 +++---- .../kernel/sched/cases/api_task_test_007.c | 18 +++---- .../kernel/sched/cmocka_sched_test.c | 18 +++---- .../kernel/sched/common/test_sched_common.c | 18 +++---- .../kernel/sched/include/SchedTest.h | 20 ++++---- .../kernel/socket/cases/net_socket_test_005.c | 18 +++---- .../kernel/socket/cases/net_socket_test_006.c | 18 +++---- .../kernel/socket/cases/net_socket_test_008.c | 18 +++---- .../kernel/socket/cases/net_socket_test_009.c | 18 +++---- .../kernel/socket/cases/net_socket_test_010.c | 18 +++---- .../kernel/socket/cases/net_socket_test_011.c | 18 +++---- .../kernel/socket/cmocka_socket_test.c | 18 +++---- .../kernel/socket/include/SocketTest.h | 18 +++---- .../kernel/syscall/cases/Fstatfs_test.c | 18 +++---- .../kernel/syscall/cases/accept_test.c | 18 +++---- .../kernel/syscall/cases/bind_test.c | 18 +++---- .../kernel/syscall/cases/chdir_test.c | 18 +++---- .../kernel/syscall/cases/clock_gettime_test.c | 18 +++---- .../syscall/cases/clock_nanosleep_test.c | 18 +++---- .../kernel/syscall/cases/clock_settime_test.c | 18 +++---- .../kernel/syscall/cases/close_test.c | 18 +++---- .../kernel/syscall/cases/connect_test.c | 18 +++---- .../kernel/syscall/cases/creat_test.c | 18 +++---- .../kernel/syscall/cases/dup2_test.c | 18 +++---- .../kernel/syscall/cases/dup_test.c | 18 +++---- .../kernel/syscall/cases/fcntl_test.c | 18 +++---- .../kernel/syscall/cases/fpathconf_test.c | 18 +++---- .../kernel/syscall/cases/fsync_test.c | 18 +++---- .../kernel/syscall/cases/ftruncate_test.c | 18 +++---- .../kernel/syscall/cases/getTimeofday_test.c | 18 +++---- .../kernel/syscall/cases/getcwd_test.c | 18 +++---- .../kernel/syscall/cases/getegid_test.c | 18 +++---- .../kernel/syscall/cases/geteuid_test.c | 18 +++---- .../kernel/syscall/cases/getgid_test.c | 18 +++---- .../kernel/syscall/cases/gethostname_test.c | 18 +++---- .../kernel/syscall/cases/getitimer_test.c | 18 +++---- .../kernel/syscall/cases/getpeername_test.c | 18 +++---- .../kernel/syscall/cases/getpid_test.c | 18 +++---- .../kernel/syscall/cases/getppid_test.c | 18 +++---- .../kernel/syscall/cases/getsocketopt_test.c | 18 +++---- .../kernel/syscall/cases/getuid_test.c | 18 +++---- .../kernel/syscall/cases/listen_test.c | 18 +++---- .../kernel/syscall/cases/lseek_test.c | 18 +++---- .../kernel/syscall/cases/lstat_test.c | 18 +++---- .../kernel/syscall/cases/memcmp_test.c | 18 +++---- .../kernel/syscall/cases/memcpy_test.c | 18 +++---- .../kernel/syscall/cases/memset_test.c | 18 +++---- .../kernel/syscall/cases/mkdir_test.c | 18 +++---- .../kernel/syscall/cases/nansleep_test.c | 18 +++---- .../kernel/syscall/cases/pathconf_test.c | 18 +++---- .../kernel/syscall/cases/pipe_test.c | 18 +++---- .../kernel/syscall/cases/pread_test.c | 18 +++---- .../kernel/syscall/cases/pwrite_test.c | 18 +++---- .../kernel/syscall/cases/read_test.c | 18 +++---- .../kernel/syscall/cases/readdir_test.c | 18 +++---- .../kernel/syscall/cases/recvfrom_test.c | 18 +++---- .../kernel/syscall/cases/rmdir_test.c | 18 +++---- .../kernel/syscall/cases/sched_test.c | 18 +++---- .../syscall/cases/setsocketopt01_test.c | 18 +++---- .../kernel/syscall/cases/socket_test.c | 18 +++---- .../kernel/syscall/cases/socketpair_test.c | 20 ++++---- .../kernel/syscall/cases/symlink_test.c | 18 +++---- .../kernel/syscall/cases/time_test.c | 18 +++---- .../kernel/syscall/cases/timer_create_test.c | 18 +++---- .../kernel/syscall/cases/timer_delete_test.c | 18 +++---- .../kernel/syscall/cases/timer_gettime_test.c | 18 +++---- .../kernel/syscall/cases/truncate_test.c | 18 +++---- .../kernel/syscall/cases/unlink_test.c | 18 +++---- .../kernel/syscall/cases/write_test.c | 18 +++---- .../kernel/syscall/cmocka_syscall_test.c | 18 +++---- .../syscall/common/test_syscall_common.c | 20 ++++---- .../kernel/syscall/include/SyscallTest.h | 18 +++---- .../kernel/time/cases/clock_test_clock01.c | 18 +++---- .../kernel/time/cases/clock_test_clock02.c | 18 +++---- .../kernel/time/cases/clock_test_smoke.c | 18 +++---- .../kernel/time/cases/clock_test_timer01.c | 18 +++---- .../kernel/time/cases/clock_test_timer03.c | 18 +++---- .../kernel/time/cases/clock_test_timer04.c | 18 +++---- .../kernel/time/cases/clock_test_timer05.c | 18 +++---- .../testsuites/kernel/time/cmocka_time_test.c | 18 +++---- .../testsuites/kernel/time/include/TimeTest.h | 2 + testing/timerjitter/CMakeLists.txt | 2 +- testing/timerjitter/Make.defs | 2 +- testing/timerjitter/Makefile | 24 ++++++---- testing/timerjitter/timerjitter.c | 2 + testing/uclibcxx_test/Make.defs | 2 + testing/uclibcxx_test/Makefile | 2 + testing/unity/CMakeLists.txt | 2 + testing/unity/Make.defs | 2 + testing/unity/Makefile | 2 + testing/x86-64-ABI/Make.defs | 2 + testing/x86-64-ABI/Makefile | 2 + 483 files changed, 2362 insertions(+), 1325 deletions(-) diff --git a/testing/CMakeLists.txt b/testing/CMakeLists.txt index 217971327c1..dcccb6f0983 100644 --- a/testing/CMakeLists.txt +++ b/testing/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/testing/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/testing/Make.defs b/testing/Make.defs index c97e547782c..10d16e26057 100644 --- a/testing/Make.defs +++ b/testing/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/Makefile b/testing/Makefile index 0f0927d9de2..21d1e757f30 100644 --- a/testing/Makefile +++ b/testing/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/arch_libc/CMakeLists.txt b/testing/arch_libc/CMakeLists.txt index 52dcd1eab5a..38224f1752e 100644 --- a/testing/arch_libc/CMakeLists.txt +++ b/testing/arch_libc/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/testing/arch_libc/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/testing/arch_libc/Make.defs b/testing/arch_libc/Make.defs index 4b4d205a116..38c935ec2da 100644 --- a/testing/arch_libc/Make.defs +++ b/testing/arch_libc/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/arch_libc/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/arch_libc/Makefile b/testing/arch_libc/Makefile index bd376459d64..ecd4f543474 100644 --- a/testing/arch_libc/Makefile +++ b/testing/arch_libc/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/arch_libc/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/arch_libc/arch_libc_test_main.c b/testing/arch_libc/arch_libc_test_main.c index 770e2773cdc..a053b7a1a9f 100644 --- a/testing/arch_libc/arch_libc_test_main.c +++ b/testing/arch_libc/arch_libc_test_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/arch_libc/arch_libc_test_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/atomic/CMakeLists.txt b/testing/atomic/CMakeLists.txt index 7e0d9193ad9..5ae8d006b33 100644 --- a/testing/atomic/CMakeLists.txt +++ b/testing/atomic/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/testing/atomic/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/testing/atomic/Make.defs b/testing/atomic/Make.defs index d9d848810d3..be5f4eb465c 100644 --- a/testing/atomic/Make.defs +++ b/testing/atomic/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/atomic/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/atomic/Makefile b/testing/atomic/Makefile index 39584aee079..19f4d48a3fd 100644 --- a/testing/atomic/Makefile +++ b/testing/atomic/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/atomic/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/atomic/atomic_main.c b/testing/atomic/atomic_main.c index 90314190d37..7d3985fd99e 100644 --- a/testing/atomic/atomic_main.c +++ b/testing/atomic/atomic_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/atomic/atomic_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/cachetest/CMakeLists.txt b/testing/cachetest/CMakeLists.txt index 661887ab545..5eb87601db2 100644 --- a/testing/cachetest/CMakeLists.txt +++ b/testing/cachetest/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/testing/cachetest/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/testing/cachetest/Make.defs b/testing/cachetest/Make.defs index 875f334d297..70bbd75aa43 100644 --- a/testing/cachetest/Make.defs +++ b/testing/cachetest/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/cachetest/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/cachetest/Makefile b/testing/cachetest/Makefile index 7d84880f968..544e1da4894 100644 --- a/testing/cachetest/Makefile +++ b/testing/cachetest/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/cachetest/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/cachetest/cachetest_main.c b/testing/cachetest/cachetest_main.c index 9496432dc44..ec1653a5904 100644 --- a/testing/cachetest/cachetest_main.c +++ b/testing/cachetest/cachetest_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/cachetest/cachetest_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/cmocka/CMakeLists.txt b/testing/cmocka/CMakeLists.txt index 11568513eeb..3a9fabd8578 100644 --- a/testing/cmocka/CMakeLists.txt +++ b/testing/cmocka/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/testing/cmocka/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/testing/cmocka/Make.defs b/testing/cmocka/Make.defs index 3086f8fcb1a..396365e9666 100644 --- a/testing/cmocka/Make.defs +++ b/testing/cmocka/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/cmocka/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/cmocka/Makefile b/testing/cmocka/Makefile index c2694f6c527..ac2d177b5ed 100644 --- a/testing/cmocka/Makefile +++ b/testing/cmocka/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/cmocka/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/cmocka/cmocka_main.c b/testing/cmocka/cmocka_main.c index 00b0189940a..dd251fddcaf 100644 --- a/testing/cmocka/cmocka_main.c +++ b/testing/cmocka/cmocka_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/cmocka/cmocka_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/cmocka/cmocka_platform.h b/testing/cmocka/cmocka_platform.h index e452615dba4..70d26250002 100644 --- a/testing/cmocka/cmocka_platform.h +++ b/testing/cmocka/cmocka_platform.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/cmocka/cmocka_platform.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/cmocka/tools/cmocka_implement.py b/testing/cmocka/tools/cmocka_implement.py index aa80f1d6275..71931da76c5 100644 --- a/testing/cmocka/tools/cmocka_implement.py +++ b/testing/cmocka/tools/cmocka_implement.py @@ -1,3 +1,26 @@ +#!/usr/bin/env python3 +############################################################################ +# apps/testing/cmocka/tools/cmocka_implement.py +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + # -*- coding: utf-8 -*- import copy import os diff --git a/testing/cmocka/tools/cmocka_report.py b/testing/cmocka/tools/cmocka_report.py index 7d518d0b604..e9c953aae8d 100644 --- a/testing/cmocka/tools/cmocka_report.py +++ b/testing/cmocka/tools/cmocka_report.py @@ -2,6 +2,8 @@ ############################################################################ # apps/testing/cmocka/tools/cmocka_report.py # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/cmocka/tools/junit2htmlreport/parser.py b/testing/cmocka/tools/junit2htmlreport/parser.py index f580b952409..aa31adef142 100644 --- a/testing/cmocka/tools/junit2htmlreport/parser.py +++ b/testing/cmocka/tools/junit2htmlreport/parser.py @@ -1,3 +1,25 @@ +#!/usr/bin/env python3 +############################################################################ +# apps/testing/cmocka/tools/junit2htmlreport/parser.py +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ """ Parse a junit report file into a family of objects """ diff --git a/testing/cmocka/tools/junit2htmlreport/render.py b/testing/cmocka/tools/junit2htmlreport/render.py index a6179af70f9..e2068226e7d 100644 --- a/testing/cmocka/tools/junit2htmlreport/render.py +++ b/testing/cmocka/tools/junit2htmlreport/render.py @@ -1,3 +1,25 @@ +#!/usr/bin/env python3 +############################################################################ +# apps/testing/cmocka/tools/junit2htmlreport/render.py +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ """ Render junit reports as HTML """ diff --git a/testing/cmocka/tools/junit2htmlreport/textutils.py b/testing/cmocka/tools/junit2htmlreport/textutils.py index cb42ca44d48..46673acbe2a 100644 --- a/testing/cmocka/tools/junit2htmlreport/textutils.py +++ b/testing/cmocka/tools/junit2htmlreport/textutils.py @@ -1,3 +1,25 @@ +#!/usr/bin/env python3 +############################################################################ +# apps/testing/cmocka/tools/junit2htmlreport/textutils.py +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ """ Stringify to unicode """ diff --git a/testing/cpuload/CMakeLists.txt b/testing/cpuload/CMakeLists.txt index 533ddbc464c..60d8e2e6444 100644 --- a/testing/cpuload/CMakeLists.txt +++ b/testing/cpuload/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/testing/cpuload/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/testing/cpuload/Make.defs b/testing/cpuload/Make.defs index a8b0cd6ee77..c43feb47912 100644 --- a/testing/cpuload/Make.defs +++ b/testing/cpuload/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/cpuload/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/cpuload/Makefile b/testing/cpuload/Makefile index 9ffc6394edc..45fcb82c266 100644 --- a/testing/cpuload/Makefile +++ b/testing/cpuload/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/cpuload/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/cpuload/cpuload_main.c b/testing/cpuload/cpuload_main.c index 09cbf10e64a..daa56dd8567 100644 --- a/testing/cpuload/cpuload_main.c +++ b/testing/cpuload/cpuload_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/cpuload/cpuload_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/crypto/3descbc.c b/testing/crypto/3descbc.c index 2e2d0c2fe94..7bf1c836fc6 100644 --- a/testing/crypto/3descbc.c +++ b/testing/crypto/3descbc.c @@ -1,8 +1,8 @@ /**************************************************************************** * apps/testing/crypto/3descbc.c - * $OpenBSD: des3.c,v 1.8 2010/10/15 10:39:12 jsg Exp $ * - * Copyright (c) 2002 Markus Friedl. All rights reserved. + * SPDX-License-Identifier: BSD-2-Clause + * SPDX-FileCopyrightText: 2002 Markus Friedl. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/testing/crypto/CMakeLists.txt b/testing/crypto/CMakeLists.txt index 84b0f008ddb..76df6e7a63d 100644 --- a/testing/crypto/CMakeLists.txt +++ b/testing/crypto/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/testing/crypto/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/testing/crypto/Make.defs b/testing/crypto/Make.defs index 7c92864b367..5d0dee36116 100644 --- a/testing/crypto/Make.defs +++ b/testing/crypto/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/crypto/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/crypto/Makefile b/testing/crypto/Makefile index 00a1ab03e29..825eac40782 100644 --- a/testing/crypto/Makefile +++ b/testing/crypto/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/crypto/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/crypto/aescbc.c b/testing/crypto/aescbc.c index 2bbe408d67b..0c9f464ebdb 100644 --- a/testing/crypto/aescbc.c +++ b/testing/crypto/aescbc.c @@ -1,8 +1,8 @@ /**************************************************************************** * apps/testing/crypto/aescbc.c - * $OpenBSD: aesctr.c,v 1.1 2005/05/25 05:47:53 markus Exp $ * - * Copyright (c) 2005 Markus Friedl + * SPDX-License-Identifier: ISC + * SPDX-FileCopyrightText: 2005 Markus Friedl. All rights reserved. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/testing/crypto/aescmac.c b/testing/crypto/aescmac.c index abf5cf83f07..0e0f57838ba 100644 --- a/testing/crypto/aescmac.c +++ b/testing/crypto/aescmac.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/crypto/aescmac.c * + * SPDX-License-Identifier: ISC + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. diff --git a/testing/crypto/aesctr.c b/testing/crypto/aesctr.c index 6992a29fe36..bf1d9914488 100644 --- a/testing/crypto/aesctr.c +++ b/testing/crypto/aesctr.c @@ -1,8 +1,8 @@ /**************************************************************************** * apps/testing/crypto/aesctr.c - * $OpenBSD: aesctr.c,v 1.1 2005/05/25 05:47:53 markus Exp $ * - * Copyright (c) 2005 Markus Friedl + * SPDX-License-Identifier: ISC + * SPDX-FileCopyrightText: 2005 Markus Friedl * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/testing/crypto/aesxts.c b/testing/crypto/aesxts.c index dce7a9166e6..1692af6bf32 100644 --- a/testing/crypto/aesxts.c +++ b/testing/crypto/aesxts.c @@ -1,9 +1,9 @@ /**************************************************************************** * apps/testing/crypto/aesxts.c - * $OpenBSD: aes_xts.c,v 1.2 2013/10/06 16:59:34 jsing Exp $ * - * Copyright (c) 2002 Markus Friedl. All rights reserved. - * Copyright (c) 2008 Damien Miller. All rights reserved. + * SPDX-License-Identifier: BSD-2-Clause + * SPDX-FileCopyrightText: 2002 Markus Friedl. All rights reserved. + * SPDX-FileCopyrightText: 2008 Damien Miller. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/testing/crypto/crc32.c b/testing/crypto/crc32.c index 6e7cde53af0..9fa227c5d3d 100644 --- a/testing/crypto/crc32.c +++ b/testing/crypto/crc32.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/crypto/crc32.c * + * SPDX-License-Identifier: ISC + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. diff --git a/testing/crypto/dhm.c b/testing/crypto/dhm.c index efb483f66d2..038376104d3 100644 --- a/testing/crypto/dhm.c +++ b/testing/crypto/dhm.c @@ -1,6 +1,7 @@ /**************************************************************************** * apps/testing/crypto/dhm.c - * Copyright (C) 2023 Xiaomi Corporation + * + * SPDX-License-Identifier: Apache-2.0 * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with diff --git a/testing/crypto/ecdsa.c b/testing/crypto/ecdsa.c index c0ef261a44b..007b93b778f 100644 --- a/testing/crypto/ecdsa.c +++ b/testing/crypto/ecdsa.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/crypto/ecdsa.c * + * SPDX-License-Identifier: ISC + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. diff --git a/testing/crypto/hash.c b/testing/crypto/hash.c index 6d8df707b69..1c3d6e6eecd 100644 --- a/testing/crypto/hash.c +++ b/testing/crypto/hash.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/crypto/hash.c * + * SPDX-License-Identifier: ISC + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. diff --git a/testing/crypto/hmac.c b/testing/crypto/hmac.c index a90762da519..48ea6ae460f 100644 --- a/testing/crypto/hmac.c +++ b/testing/crypto/hmac.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/crypto/hmac.c - * Copyright (c) 2008 Damien Bergamini + * + * SPDX-License-Identifier: ISC + * SPDX-FileCopyrightText: 2008 Damien Bergamini * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/testing/crypto/rsa.c b/testing/crypto/rsa.c index 32a93866bb5..e4fe7778a10 100644 --- a/testing/crypto/rsa.c +++ b/testing/crypto/rsa.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/crypto/rsa.c * + * SPDX-License-Identifier: ISC + * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. diff --git a/testing/cxxsize/CMakeLists.txt b/testing/cxxsize/CMakeLists.txt index 6588f089b7d..ddf8f43fd82 100644 --- a/testing/cxxsize/CMakeLists.txt +++ b/testing/cxxsize/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/testing/cxxsize/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/testing/cxxsize/Make.defs b/testing/cxxsize/Make.defs index 6dcca3b48a5..4b3c7cb95be 100644 --- a/testing/cxxsize/Make.defs +++ b/testing/cxxsize/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/cxxtest/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/cxxsize/Makefile b/testing/cxxsize/Makefile index b822abfdea9..04560e0654f 100644 --- a/testing/cxxsize/Makefile +++ b/testing/cxxsize/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/cxxtest/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/cxxsize/array.cxx b/testing/cxxsize/array.cxx index 13b3730c610..6b4deb2cf4b 100644 --- a/testing/cxxsize/array.cxx +++ b/testing/cxxsize/array.cxx @@ -1,6 +1,8 @@ //*************************************************************************** // apps/testing/cxxsize/array.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/testing/cxxsize/condition_variable.cxx b/testing/cxxsize/condition_variable.cxx index 2b9b2e1889b..a9ddf12883d 100644 --- a/testing/cxxsize/condition_variable.cxx +++ b/testing/cxxsize/condition_variable.cxx @@ -1,6 +1,8 @@ //*************************************************************************** // apps/testing/cxxsize/condition_variable.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/testing/cxxsize/deque.cxx b/testing/cxxsize/deque.cxx index a50309e576b..2fbffc1bdc4 100644 --- a/testing/cxxsize/deque.cxx +++ b/testing/cxxsize/deque.cxx @@ -1,6 +1,8 @@ //*************************************************************************** // apps/testing/cxxsize/deque.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/testing/cxxsize/exception.cxx b/testing/cxxsize/exception.cxx index 2e0a66ab54c..baa07dc80d4 100644 --- a/testing/cxxsize/exception.cxx +++ b/testing/cxxsize/exception.cxx @@ -1,6 +1,8 @@ //*************************************************************************** // apps/testing/cxxsize/exception.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/testing/cxxsize/forward_list.cxx b/testing/cxxsize/forward_list.cxx index 9488b84cf05..02512e35a45 100644 --- a/testing/cxxsize/forward_list.cxx +++ b/testing/cxxsize/forward_list.cxx @@ -1,6 +1,8 @@ //*************************************************************************** // apps/testing/cxxsize/forward_list.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/testing/cxxsize/future.cxx b/testing/cxxsize/future.cxx index 3c09862f281..3ecb8cb093f 100644 --- a/testing/cxxsize/future.cxx +++ b/testing/cxxsize/future.cxx @@ -1,6 +1,8 @@ //*************************************************************************** // apps/testing/cxxsize/future.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/testing/cxxsize/iostream.cxx b/testing/cxxsize/iostream.cxx index 038344f5ce5..2b57140c387 100644 --- a/testing/cxxsize/iostream.cxx +++ b/testing/cxxsize/iostream.cxx @@ -1,6 +1,8 @@ //*************************************************************************** // apps/testing/cxxsize/iostream.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/testing/cxxsize/list.cxx b/testing/cxxsize/list.cxx index fa389828ba9..9a83eca727d 100644 --- a/testing/cxxsize/list.cxx +++ b/testing/cxxsize/list.cxx @@ -1,6 +1,8 @@ //*************************************************************************** // apps/testing/cxxsize/list.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/testing/cxxsize/map.cxx b/testing/cxxsize/map.cxx index 5f0f55b5462..f4c5cd09576 100644 --- a/testing/cxxsize/map.cxx +++ b/testing/cxxsize/map.cxx @@ -1,6 +1,8 @@ //*************************************************************************** // apps/testing/cxxsize/map.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/testing/cxxsize/multiset.cxx b/testing/cxxsize/multiset.cxx index 5ad8eefa5d8..a859ec214c2 100644 --- a/testing/cxxsize/multiset.cxx +++ b/testing/cxxsize/multiset.cxx @@ -1,6 +1,8 @@ //*************************************************************************** // apps/testing/cxxsize/multiset.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/testing/cxxsize/mutex.cxx b/testing/cxxsize/mutex.cxx index e831c7dcd5c..4d7b5162db9 100644 --- a/testing/cxxsize/mutex.cxx +++ b/testing/cxxsize/mutex.cxx @@ -1,6 +1,8 @@ //*************************************************************************** // apps/testing/cxxsize/mutex.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/testing/cxxsize/rtti.cxx b/testing/cxxsize/rtti.cxx index 47a574838c4..39590e92578 100644 --- a/testing/cxxsize/rtti.cxx +++ b/testing/cxxsize/rtti.cxx @@ -1,6 +1,8 @@ //*************************************************************************** // apps/testing/cxxsize/rtti.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/testing/cxxsize/semaphore.cxx b/testing/cxxsize/semaphore.cxx index 379f08fb4f0..a1b3a29a8cc 100644 --- a/testing/cxxsize/semaphore.cxx +++ b/testing/cxxsize/semaphore.cxx @@ -1,6 +1,8 @@ //*************************************************************************** // apps/testing/cxxsize/semaphore.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/testing/cxxsize/set.cxx b/testing/cxxsize/set.cxx index 7e9b6bdede3..1285a12fbfc 100644 --- a/testing/cxxsize/set.cxx +++ b/testing/cxxsize/set.cxx @@ -1,6 +1,8 @@ //*************************************************************************** // apps/testing/cxxsize/set.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/testing/cxxsize/shared_ptr.cxx b/testing/cxxsize/shared_ptr.cxx index 9d2defaf684..9e519e11a16 100644 --- a/testing/cxxsize/shared_ptr.cxx +++ b/testing/cxxsize/shared_ptr.cxx @@ -1,6 +1,8 @@ //*************************************************************************** // apps/testing/cxxsize/shared_ptr.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/testing/cxxsize/string.cxx b/testing/cxxsize/string.cxx index 3ad0d005ef4..04988820fd0 100644 --- a/testing/cxxsize/string.cxx +++ b/testing/cxxsize/string.cxx @@ -1,6 +1,8 @@ //*************************************************************************** // apps/testing/cxxsize/string.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/testing/cxxsize/string_view.cxx b/testing/cxxsize/string_view.cxx index 07f7fb9f56f..c415262d064 100644 --- a/testing/cxxsize/string_view.cxx +++ b/testing/cxxsize/string_view.cxx @@ -1,6 +1,8 @@ //*************************************************************************** // apps/testing/cxxsize/string_view.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/testing/cxxsize/thread.cxx b/testing/cxxsize/thread.cxx index 98ed6157ec4..e646c22eb2e 100644 --- a/testing/cxxsize/thread.cxx +++ b/testing/cxxsize/thread.cxx @@ -1,6 +1,8 @@ //*************************************************************************** // apps/testing/cxxsize/thread.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/testing/cxxsize/unordered_map.cxx b/testing/cxxsize/unordered_map.cxx index 8b1a5e1bd43..2d604070116 100644 --- a/testing/cxxsize/unordered_map.cxx +++ b/testing/cxxsize/unordered_map.cxx @@ -1,6 +1,8 @@ //*************************************************************************** // apps/testing/cxxsize/unordered_map.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/testing/cxxsize/unordered_multimap.cxx b/testing/cxxsize/unordered_multimap.cxx index 50034714ebe..153b5f60a7a 100644 --- a/testing/cxxsize/unordered_multimap.cxx +++ b/testing/cxxsize/unordered_multimap.cxx @@ -1,6 +1,8 @@ //*************************************************************************** // apps/testing/cxxsize/unordered_multimap.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/testing/cxxsize/unordered_multiset.cxx b/testing/cxxsize/unordered_multiset.cxx index ecdf7787cd0..f19ae3fcbba 100644 --- a/testing/cxxsize/unordered_multiset.cxx +++ b/testing/cxxsize/unordered_multiset.cxx @@ -1,6 +1,8 @@ //*************************************************************************** // apps/testing/cxxsize/unordered_multiset.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/testing/cxxsize/unordered_set.cxx b/testing/cxxsize/unordered_set.cxx index 5ce56f6e745..c5b606509e7 100644 --- a/testing/cxxsize/unordered_set.cxx +++ b/testing/cxxsize/unordered_set.cxx @@ -1,6 +1,8 @@ //*************************************************************************** // apps/testing/cxxsize/unordered_set.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/testing/cxxsize/vector.cxx b/testing/cxxsize/vector.cxx index a2182b3cecc..5f916d928ec 100644 --- a/testing/cxxsize/vector.cxx +++ b/testing/cxxsize/vector.cxx @@ -1,6 +1,8 @@ //*************************************************************************** // apps/testing/cxxsize/vector.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/testing/cxxsize/weak_ptr.cxx b/testing/cxxsize/weak_ptr.cxx index d93e6b917a2..1ccd95bd2b7 100644 --- a/testing/cxxsize/weak_ptr.cxx +++ b/testing/cxxsize/weak_ptr.cxx @@ -1,6 +1,8 @@ //*************************************************************************** // apps/testing/cxxsize/weak_ptr.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/testing/cxxtest/CMakeLists.txt b/testing/cxxtest/CMakeLists.txt index b191a01cfa7..962b7f09798 100644 --- a/testing/cxxtest/CMakeLists.txt +++ b/testing/cxxtest/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/testing/cxxtest/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/testing/cxxtest/Make.defs b/testing/cxxtest/Make.defs index b742b05bacc..5a06bbbf901 100644 --- a/testing/cxxtest/Make.defs +++ b/testing/cxxtest/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/cxxtest/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/cxxtest/Makefile b/testing/cxxtest/Makefile index 1c3b82d367f..5690c59f9e4 100644 --- a/testing/cxxtest/Makefile +++ b/testing/cxxtest/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/cxxtest/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/cxxtest/cxxtest_main.cxx b/testing/cxxtest/cxxtest_main.cxx index 08cd36227eb..48e0d014187 100644 --- a/testing/cxxtest/cxxtest_main.cxx +++ b/testing/cxxtest/cxxtest_main.cxx @@ -1,6 +1,8 @@ //*************************************************************************** // apps/testing/cxxtest/cxxtest_main.cxx // +// SPDX-License-Identifier: Apache-2.0 +// // Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. The diff --git a/testing/drivertest/CMakeLists.txt b/testing/drivertest/CMakeLists.txt index 0f36f09320b..a3add4dca40 100644 --- a/testing/drivertest/CMakeLists.txt +++ b/testing/drivertest/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/testing/drivertest/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/testing/drivertest/Make.defs b/testing/drivertest/Make.defs index 4c397380ea2..a68b7e050e6 100644 --- a/testing/drivertest/Make.defs +++ b/testing/drivertest/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/drivertest/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/drivertest/Makefile b/testing/drivertest/Makefile index 50a0a56131d..aa25dfa8381 100644 --- a/testing/drivertest/Makefile +++ b/testing/drivertest/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/drivertest/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/drivertest/drivertest_adc.c b/testing/drivertest/drivertest_adc.c index 0a9bd6d582a..267ed770ac4 100644 --- a/testing/drivertest/drivertest_adc.c +++ b/testing/drivertest/drivertest_adc.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/drivertest/drivertest_adc.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/drivertest/drivertest_audio.c b/testing/drivertest/drivertest_audio.c index 556a15f6064..2f019fcdd32 100644 --- a/testing/drivertest/drivertest_audio.c +++ b/testing/drivertest/drivertest_audio.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/drivertest/drivertest_audio.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/drivertest/drivertest_block.c b/testing/drivertest/drivertest_block.c index 7c65ab9269a..daa655378d2 100644 --- a/testing/drivertest/drivertest_block.c +++ b/testing/drivertest/drivertest_block.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/drivertest/drivertest_block.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/drivertest/drivertest_framebuffer.c b/testing/drivertest/drivertest_framebuffer.c index 7d2ac1afe3d..1436d779d30 100644 --- a/testing/drivertest/drivertest_framebuffer.c +++ b/testing/drivertest/drivertest_framebuffer.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/drivertest/drivertest_framebuffer.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/drivertest/drivertest_gpio.c b/testing/drivertest/drivertest_gpio.c index 25291b2e946..a84acf20dcf 100644 --- a/testing/drivertest/drivertest_gpio.c +++ b/testing/drivertest/drivertest_gpio.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/drivertest/drivertest_gpio.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/drivertest/drivertest_i2c_read.c b/testing/drivertest/drivertest_i2c_read.c index fc130cdd984..9e87b0bdf56 100644 --- a/testing/drivertest/drivertest_i2c_read.c +++ b/testing/drivertest/drivertest_i2c_read.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/drivertest/drivertest_i2c_read.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/drivertest/drivertest_i2c_spi.c b/testing/drivertest/drivertest_i2c_spi.c index 93698010cb3..1157a2a4ef1 100644 --- a/testing/drivertest/drivertest_i2c_spi.c +++ b/testing/drivertest/drivertest_i2c_spi.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/drivertest/drivertest_i2c_spi.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/drivertest/drivertest_i2c_write.c b/testing/drivertest/drivertest_i2c_write.c index ba219396402..959e8b62fcd 100644 --- a/testing/drivertest/drivertest_i2c_write.c +++ b/testing/drivertest/drivertest_i2c_write.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/drivertest/drivertest_i2c_write.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/drivertest/drivertest_lcd.c b/testing/drivertest/drivertest_lcd.c index e9ca3713f8f..2a4519cb24e 100644 --- a/testing/drivertest/drivertest_lcd.c +++ b/testing/drivertest/drivertest_lcd.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/drivertest/drivertest_lcd.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/drivertest/drivertest_mps2.c b/testing/drivertest/drivertest_mps2.c index 57bda24ab71..7ccbc1f2142 100644 --- a/testing/drivertest/drivertest_mps2.c +++ b/testing/drivertest/drivertest_mps2.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/drivertest/drivertest_mps2.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/drivertest/drivertest_mps2_isr_signal.c b/testing/drivertest/drivertest_mps2_isr_signal.c index 2c5785694c1..5157b679a35 100644 --- a/testing/drivertest/drivertest_mps2_isr_signal.c +++ b/testing/drivertest/drivertest_mps2_isr_signal.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/drivertest/drivertest_mps2_isr_signal.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/drivertest/drivertest_mps2_zerointerrupt.c b/testing/drivertest/drivertest_mps2_zerointerrupt.c index 013fccf0c1e..852404dec5d 100644 --- a/testing/drivertest/drivertest_mps2_zerointerrupt.c +++ b/testing/drivertest/drivertest_mps2_zerointerrupt.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/drivertest/drivertest_mps2_zerointerrupt.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/drivertest/drivertest_oneshot.c b/testing/drivertest/drivertest_oneshot.c index 99b96d0614f..6d7afcc75ca 100644 --- a/testing/drivertest/drivertest_oneshot.c +++ b/testing/drivertest/drivertest_oneshot.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/drivertest/drivertest_oneshot.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/drivertest/drivertest_pm.c b/testing/drivertest/drivertest_pm.c index 0abbc32478f..fc8ee4bdc38 100644 --- a/testing/drivertest/drivertest_pm.c +++ b/testing/drivertest/drivertest_pm.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/drivertest/drivertest_pm.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/drivertest/drivertest_pm_runtime.c b/testing/drivertest/drivertest_pm_runtime.c index 3b8aa9a900a..a0db9947c9f 100644 --- a/testing/drivertest/drivertest_pm_runtime.c +++ b/testing/drivertest/drivertest_pm_runtime.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/drivertest/drivertest_pm_runtime.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/drivertest/drivertest_pm_smp.c b/testing/drivertest/drivertest_pm_smp.c index 6f9f967d733..6edbb66948a 100644 --- a/testing/drivertest/drivertest_pm_smp.c +++ b/testing/drivertest/drivertest_pm_smp.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/drivertest/drivertest_pm_smp.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/drivertest/drivertest_posix_timer.c b/testing/drivertest/drivertest_posix_timer.c index fed2f0ce117..b52b1887de1 100644 --- a/testing/drivertest/drivertest_posix_timer.c +++ b/testing/drivertest/drivertest_posix_timer.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/drivertest/drivertest_posix_timer.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/drivertest/drivertest_pwm.c b/testing/drivertest/drivertest_pwm.c index fd2fcee3ab2..18475184d5e 100644 --- a/testing/drivertest/drivertest_pwm.c +++ b/testing/drivertest/drivertest_pwm.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/drivertest/drivertest_pwm.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/drivertest/drivertest_regulator.c b/testing/drivertest/drivertest_regulator.c index aa53a693eee..bff19677c6e 100644 --- a/testing/drivertest/drivertest_regulator.c +++ b/testing/drivertest/drivertest_regulator.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/drivertest/drivertest_regulator.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/drivertest/drivertest_relay.c b/testing/drivertest/drivertest_relay.c index 9eed2d7b479..7a1671f88fc 100644 --- a/testing/drivertest/drivertest_relay.c +++ b/testing/drivertest/drivertest_relay.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/drivertest/drivertest_relay.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/drivertest/drivertest_rtc.c b/testing/drivertest/drivertest_rtc.c index 01ce8ee70df..53ed2a5d11f 100644 --- a/testing/drivertest/drivertest_rtc.c +++ b/testing/drivertest/drivertest_rtc.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/drivertest/drivertest_rtc.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/drivertest/drivertest_simple.c b/testing/drivertest/drivertest_simple.c index 0ba0a5db0cc..485b592e203 100644 --- a/testing/drivertest/drivertest_simple.c +++ b/testing/drivertest/drivertest_simple.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/drivertest/drivertest_simple.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/drivertest/drivertest_timer.c b/testing/drivertest/drivertest_timer.c index cd29d90d196..4478eda0f4e 100644 --- a/testing/drivertest/drivertest_timer.c +++ b/testing/drivertest/drivertest_timer.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/drivertest/drivertest_timer.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/drivertest/drivertest_touchpanel.c b/testing/drivertest/drivertest_touchpanel.c index 9a68b283bf0..9f0255ec6ce 100644 --- a/testing/drivertest/drivertest_touchpanel.c +++ b/testing/drivertest/drivertest_touchpanel.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/drivertest/drivertest_touchpanel.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/drivertest/drivertest_uart.c b/testing/drivertest/drivertest_uart.c index 093d002c375..cbe127b7c77 100644 --- a/testing/drivertest/drivertest_uart.c +++ b/testing/drivertest/drivertest_uart.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/drivertest/drivertest_uart.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/drivertest/drivertest_watchdog.c b/testing/drivertest/drivertest_watchdog.c index b55cd0c6a23..865c381edff 100644 --- a/testing/drivertest/drivertest_watchdog.c +++ b/testing/drivertest/drivertest_watchdog.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/drivertest/drivertest_watchdog.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/drivertest/test_content_gen.py b/testing/drivertest/test_content_gen.py index 8c3b2fcc250..3045252d1e9 100644 --- a/testing/drivertest/test_content_gen.py +++ b/testing/drivertest/test_content_gen.py @@ -1,8 +1,9 @@ #!/bin/python3 - -# **************************************************************************** +############################################################################# # apps/testing/drivertest/cmocka_driver_uart/test_content_gen.py # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The @@ -17,7 +18,8 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -# +############################################################################# + import argparse import sys import time diff --git a/testing/epoll/CMakeLists.txt b/testing/epoll/CMakeLists.txt index 082f421f6f5..3839141e1d4 100644 --- a/testing/epoll/CMakeLists.txt +++ b/testing/epoll/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/testing/epoll/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/testing/epoll/Make.defs b/testing/epoll/Make.defs index 00467a4f932..fbabd40594a 100644 --- a/testing/epoll/Make.defs +++ b/testing/epoll/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/epoll/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/epoll/Makefile b/testing/epoll/Makefile index 6d79215ccff..2a78ea7ac8f 100644 --- a/testing/epoll/Makefile +++ b/testing/epoll/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/epoll/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/epoll/epoll.c b/testing/epoll/epoll.c index ad6ab09feb0..970a7ad4cbb 100644 --- a/testing/epoll/epoll.c +++ b/testing/epoll/epoll.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/epoll/epoll.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/fatutf8/CMakeLists.txt b/testing/fatutf8/CMakeLists.txt index 6facb8a67bc..276ae93a91a 100644 --- a/testing/fatutf8/CMakeLists.txt +++ b/testing/fatutf8/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/testing/fatutf8/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/testing/fatutf8/Make.defs b/testing/fatutf8/Make.defs index 039638d4d1a..2c62dc1fa8d 100644 --- a/testing/fatutf8/Make.defs +++ b/testing/fatutf8/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/fatutf8/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/fatutf8/Makefile b/testing/fatutf8/Makefile index be384e57117..e43198ec30a 100644 --- a/testing/fatutf8/Makefile +++ b/testing/fatutf8/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/fatutf8/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/fatutf8/fatutf8_main.c b/testing/fatutf8/fatutf8_main.c index 8f895ed0d41..6975294e83c 100644 --- a/testing/fatutf8/fatutf8_main.c +++ b/testing/fatutf8/fatutf8_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/fatutf8/fatutf8_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/fdsantest/CMakeLists.txt b/testing/fdsantest/CMakeLists.txt index f83dadb9c7d..f6a5f7be15e 100644 --- a/testing/fdsantest/CMakeLists.txt +++ b/testing/fdsantest/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/testing/fdsantest/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/testing/fdsantest/Make.defs b/testing/fdsantest/Make.defs index 3cab033dfd1..4be99c97550 100644 --- a/testing/fdsantest/Make.defs +++ b/testing/fdsantest/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/fdsantest/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/fdsantest/Makefile b/testing/fdsantest/Makefile index 3dc7f4a126f..cddf85651f5 100644 --- a/testing/fdsantest/Makefile +++ b/testing/fdsantest/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/fdsantest/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/fdsantest/fdsantest_simple.c b/testing/fdsantest/fdsantest_simple.c index 4f8c802e69b..ab4068c7f8b 100644 --- a/testing/fdsantest/fdsantest_simple.c +++ b/testing/fdsantest/fdsantest_simple.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/fdsantest/fdsantest_simple.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/fff/CMakeLists.txt b/testing/fff/CMakeLists.txt index d69a69d79a2..fdd1ccd58f7 100644 --- a/testing/fff/CMakeLists.txt +++ b/testing/fff/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/testing/fff/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/testing/fff/Make.defs b/testing/fff/Make.defs index 64be55f8a98..8c53d7685dc 100644 --- a/testing/fff/Make.defs +++ b/testing/fff/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/fff/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/fff/Makefile b/testing/fff/Makefile index 6f1686d499b..0a87831750e 100644 --- a/testing/fff/Makefile +++ b/testing/fff/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/fff/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/fftest/CMakeLists.txt b/testing/fftest/CMakeLists.txt index b91f1c3ac92..77513c6012b 100644 --- a/testing/fftest/CMakeLists.txt +++ b/testing/fftest/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/testing/fftest/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/testing/fftest/Make.defs b/testing/fftest/Make.defs index 871b20f8cbd..0190fb4f21e 100644 --- a/testing/fftest/Make.defs +++ b/testing/fftest/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/fftest/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/fftest/Makefile b/testing/fftest/Makefile index b19fb40cd19..981d502f136 100644 --- a/testing/fftest/Makefile +++ b/testing/fftest/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/fftest/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/fftest/fftest.c b/testing/fftest/fftest.c index f444d3d5d2b..51700914ab9 100644 --- a/testing/fftest/fftest.c +++ b/testing/fftest/fftest.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/fftest/fftest.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/fmemopen/CMakeLists.txt b/testing/fmemopen/CMakeLists.txt index 65e69e6524c..28f688dc123 100644 --- a/testing/fmemopen/CMakeLists.txt +++ b/testing/fmemopen/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/testing/fmemopen/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/testing/fmemopen/Make.defs b/testing/fmemopen/Make.defs index 03c3981fe14..8082235174a 100644 --- a/testing/fmemopen/Make.defs +++ b/testing/fmemopen/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/fmemopen/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/fmemopen/Makefile b/testing/fmemopen/Makefile index 4b712aef1c6..e62c0c9ad7f 100644 --- a/testing/fmemopen/Makefile +++ b/testing/fmemopen/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/fmemopen/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/fmemopen/fmemopen.c b/testing/fmemopen/fmemopen.c index ab332b03c65..06b396e038b 100644 --- a/testing/fmemopen/fmemopen.c +++ b/testing/fmemopen/fmemopen.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/fmemopen/fmemopen.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/fopencookie/Make.defs b/testing/fopencookie/Make.defs index e9ff32601e7..778de83a9e2 100644 --- a/testing/fopencookie/Make.defs +++ b/testing/fopencookie/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/fopencookie/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/fopencookie/Makefile b/testing/fopencookie/Makefile index e1c364c650e..4af65d1f923 100644 --- a/testing/fopencookie/Makefile +++ b/testing/fopencookie/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/fopencookie/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/fopencookie/fopencookie.c b/testing/fopencookie/fopencookie.c index c692778995a..0c35a40da6c 100644 --- a/testing/fopencookie/fopencookie.c +++ b/testing/fopencookie/fopencookie.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/fopencookie/fopencookie.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/fstest/CMakeLists.txt b/testing/fstest/CMakeLists.txt index e9213987a4e..5b938a337dd 100644 --- a/testing/fstest/CMakeLists.txt +++ b/testing/fstest/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/testing/fstest/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/testing/fstest/Make.defs b/testing/fstest/Make.defs index 3572d38c970..4545509e9a4 100644 --- a/testing/fstest/Make.defs +++ b/testing/fstest/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/fstest/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/fstest/Makefile b/testing/fstest/Makefile index 2bbde94c381..4a845eb7995 100644 --- a/testing/fstest/Makefile +++ b/testing/fstest/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/fstest/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/fstest/fstest_main.c b/testing/fstest/fstest_main.c index 17b5b904e83..0579dff36b1 100644 --- a/testing/fstest/fstest_main.c +++ b/testing/fstest/fstest_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/fstest/fstest_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/getprime/CMakeLists.txt b/testing/getprime/CMakeLists.txt index cb6002d9cc9..407ae9649f8 100644 --- a/testing/getprime/CMakeLists.txt +++ b/testing/getprime/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/testing/getprime/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/testing/getprime/Make.defs b/testing/getprime/Make.defs index e4069859740..d990dc0ba81 100644 --- a/testing/getprime/Make.defs +++ b/testing/getprime/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/getprime/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/getprime/Makefile b/testing/getprime/Makefile index a4c7a57e9f7..b7605743c21 100644 --- a/testing/getprime/Makefile +++ b/testing/getprime/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/getprime/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/getprime/getprime_main.c b/testing/getprime/getprime_main.c index 39ba94feb41..710f07dac28 100644 --- a/testing/getprime/getprime_main.c +++ b/testing/getprime/getprime_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/getprime/getprime_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/himem_test/LibIncludes.mk b/testing/himem_test/LibIncludes.mk index 08bbfa63d3b..3ad3e8cedc2 100644 --- a/testing/himem_test/LibIncludes.mk +++ b/testing/himem_test/LibIncludes.mk @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/himem_test/LibIncludes.mk # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/himem_test/Make.defs b/testing/himem_test/Make.defs index 03f0aec7d2b..2e2b03d6378 100644 --- a/testing/himem_test/Make.defs +++ b/testing/himem_test/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/himem_test/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/himem_test/Makefile b/testing/himem_test/Makefile index 33a0dd094c2..76568df31f5 100644 --- a/testing/himem_test/Makefile +++ b/testing/himem_test/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/himem_test/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/himem_test/himem_chardev_test.c b/testing/himem_test/himem_chardev_test.c index fe10637bcf9..118a9ca69e2 100644 --- a/testing/himem_test/himem_chardev_test.c +++ b/testing/himem_test/himem_chardev_test.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/himem_test/himem_chardev_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/iob/CMakeLists.txt b/testing/iob/CMakeLists.txt index ca423c42a94..e569423b9e3 100644 --- a/testing/iob/CMakeLists.txt +++ b/testing/iob/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/testing/iob/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/testing/iob/Make.defs b/testing/iob/Make.defs index 8cd27f45029..3c51ff18f9a 100644 --- a/testing/iob/Make.defs +++ b/testing/iob/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/iob/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/iob/Makefile b/testing/iob/Makefile index 4ba4252b5ed..3ebb8a27fb9 100644 --- a/testing/iob/Makefile +++ b/testing/iob/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/iob/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/iob/iob_main.c b/testing/iob/iob_main.c index 236a0e19d49..7e6e1991d76 100644 --- a/testing/iob/iob_main.c +++ b/testing/iob/iob_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/iob/iob_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/irtest/CMakeLists.txt b/testing/irtest/CMakeLists.txt index 98d4e8c8ec9..6975046ff2f 100644 --- a/testing/irtest/CMakeLists.txt +++ b/testing/irtest/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/testing/irtest/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/testing/irtest/Make.defs b/testing/irtest/Make.defs index d259bad4307..4bd5f37e7da 100644 --- a/testing/irtest/Make.defs +++ b/testing/irtest/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/irtest/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/irtest/Makefile b/testing/irtest/Makefile index b07e77cef2a..28d7b20c11d 100644 --- a/testing/irtest/Makefile +++ b/testing/irtest/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/irtest/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/irtest/cmd.cxx b/testing/irtest/cmd.cxx index 70a93906593..867864a47b0 100644 --- a/testing/irtest/cmd.cxx +++ b/testing/irtest/cmd.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/irtest/cmd.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/irtest/cmd.hpp b/testing/irtest/cmd.hpp index 7a8a9820f52..d1f96fcdf74 100644 --- a/testing/irtest/cmd.hpp +++ b/testing/irtest/cmd.hpp @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/irtest/cmd.hpp * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/irtest/enum.cxx b/testing/irtest/enum.cxx index dcc5305d913..1c3b58afdf4 100644 --- a/testing/irtest/enum.cxx +++ b/testing/irtest/enum.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/irtest/enum.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/irtest/enum.hpp b/testing/irtest/enum.hpp index 43d962133b3..77c7120216b 100644 --- a/testing/irtest/enum.hpp +++ b/testing/irtest/enum.hpp @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/irtest/enum.hpp * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/irtest/main.cxx b/testing/irtest/main.cxx index 521110fd40a..9ea7a144745 100644 --- a/testing/irtest/main.cxx +++ b/testing/irtest/main.cxx @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/irtest/main.cxx * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/kasantest/CMakeLists.txt b/testing/kasantest/CMakeLists.txt index 8a06a10eafb..ff1c65a4ada 100644 --- a/testing/kasantest/CMakeLists.txt +++ b/testing/kasantest/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/testing/kasantest/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/testing/kasantest/Make.defs b/testing/kasantest/Make.defs index 58d797739b0..6760568e9c3 100644 --- a/testing/kasantest/Make.defs +++ b/testing/kasantest/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/kasantest/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/kasantest/Makefile b/testing/kasantest/Makefile index 21b766a1027..5f2669ebe6a 100644 --- a/testing/kasantest/Makefile +++ b/testing/kasantest/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/kasantest/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/kasantest/kasantest.c b/testing/kasantest/kasantest.c index da3de9a3d9f..cdb8b5cecdc 100644 --- a/testing/kasantest/kasantest.c +++ b/testing/kasantest/kasantest.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/kasantest/kasantest.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/ltp/Make.defs b/testing/ltp/Make.defs index a8e12b4c250..50dac21f9f4 100644 --- a/testing/ltp/Make.defs +++ b/testing/ltp/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/ltp/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/ltp/Makefile b/testing/ltp/Makefile index 8d77bda1ee1..1fc2c943d99 100644 --- a/testing/ltp/Makefile +++ b/testing/ltp/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/ltp/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/ltp/config.h b/testing/ltp/config.h index 7bd8c1000b1..253a2363d70 100644 --- a/testing/ltp/config.h +++ b/testing/ltp/config.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/ltp/config.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/memstress/CMakeLists.txt b/testing/memstress/CMakeLists.txt index e10d721d990..5247fbd5739 100644 --- a/testing/memstress/CMakeLists.txt +++ b/testing/memstress/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/testing/memstress/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/testing/memstress/Make.defs b/testing/memstress/Make.defs index e2ac44a38ed..583cf30668e 100644 --- a/testing/memstress/Make.defs +++ b/testing/memstress/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/memstress/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/memstress/Makefile b/testing/memstress/Makefile index aa8e85c4bc5..ae4729d146e 100644 --- a/testing/memstress/Makefile +++ b/testing/memstress/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/memstress/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/memstress/memorystress_main.c b/testing/memstress/memorystress_main.c index 583c7015475..ca43636cb90 100644 --- a/testing/memstress/memorystress_main.c +++ b/testing/memstress/memorystress_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/memstress/memorystress_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/memtester/CMakeLists.txt b/testing/memtester/CMakeLists.txt index 93f0e176d88..e7a1d72df41 100644 --- a/testing/memtester/CMakeLists.txt +++ b/testing/memtester/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/testing/memtester/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/testing/memtester/Make.defs b/testing/memtester/Make.defs index f697e2aed62..315646b8b06 100644 --- a/testing/memtester/Make.defs +++ b/testing/memtester/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/memtester/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/memtester/Makefile b/testing/memtester/Makefile index 98a926862ed..e577d5829e0 100644 --- a/testing/memtester/Makefile +++ b/testing/memtester/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/memtester/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/mm/CMakeLists.txt b/testing/mm/CMakeLists.txt index 2c6f069fefa..043685f330f 100644 --- a/testing/mm/CMakeLists.txt +++ b/testing/mm/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/testing/mm/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/testing/mm/Make.defs b/testing/mm/Make.defs index 389fbcdbd32..a82b81f5655 100644 --- a/testing/mm/Make.defs +++ b/testing/mm/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/mm/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/mm/Makefile b/testing/mm/Makefile index c3220fc813f..bf202717c68 100644 --- a/testing/mm/Makefile +++ b/testing/mm/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/mm/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/mm/mm_main.c b/testing/mm/mm_main.c index 0b9b53dfa35..d1d8367ca4d 100644 --- a/testing/mm/mm_main.c +++ b/testing/mm/mm_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/mm/mm_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/monkey/CMakeLists.txt b/testing/monkey/CMakeLists.txt index e97ca78e0b7..d3649c24f90 100644 --- a/testing/monkey/CMakeLists.txt +++ b/testing/monkey/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/testing/monkey/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/testing/monkey/Make.defs b/testing/monkey/Make.defs index 4ecff2edd70..dbad681de85 100644 --- a/testing/monkey/Make.defs +++ b/testing/monkey/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/monkey/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/monkey/Makefile b/testing/monkey/Makefile index ce70f2a1a6d..0f572a3545f 100644 --- a/testing/monkey/Makefile +++ b/testing/monkey/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/monkey/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/monkey/monkey.c b/testing/monkey/monkey.c index d01a216a6aa..770c59d51e0 100644 --- a/testing/monkey/monkey.c +++ b/testing/monkey/monkey.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/monkey/monkey.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/monkey/monkey.h b/testing/monkey/monkey.h index 39139f19a62..b53771a1c2b 100644 --- a/testing/monkey/monkey.h +++ b/testing/monkey/monkey.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/monkey/monkey.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/monkey/monkey_assert.h b/testing/monkey/monkey_assert.h index 50e5ae4b9af..51d4fd07ced 100644 --- a/testing/monkey/monkey_assert.h +++ b/testing/monkey/monkey_assert.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/monkey/monkey_assert.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/monkey/monkey_dev.c b/testing/monkey/monkey_dev.c index a6f88fc0973..7f196684028 100644 --- a/testing/monkey/monkey_dev.c +++ b/testing/monkey/monkey_dev.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/monkey/monkey_dev.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/monkey/monkey_dev.h b/testing/monkey/monkey_dev.h index 87c1c80dd70..b7b61944e4f 100644 --- a/testing/monkey/monkey_dev.h +++ b/testing/monkey/monkey_dev.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/monkey/monkey_dev.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/monkey/monkey_event.c b/testing/monkey/monkey_event.c index 5e19d3a1965..745d452468a 100644 --- a/testing/monkey/monkey_event.c +++ b/testing/monkey/monkey_event.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/monkey/monkey_event.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/monkey/monkey_event.h b/testing/monkey/monkey_event.h index 2ee31ce5903..60ff88ac072 100644 --- a/testing/monkey/monkey_event.h +++ b/testing/monkey/monkey_event.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/monkey/monkey_event.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/monkey/monkey_log.c b/testing/monkey/monkey_log.c index a726f766dfd..cd3aaa3d653 100644 --- a/testing/monkey/monkey_log.c +++ b/testing/monkey/monkey_log.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/monkey/monkey_log.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/monkey/monkey_log.h b/testing/monkey/monkey_log.h index 931fb9cc205..4071e4c95f8 100644 --- a/testing/monkey/monkey_log.h +++ b/testing/monkey/monkey_log.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/monkey/monkey_log.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/monkey/monkey_main.c b/testing/monkey/monkey_main.c index eab79705304..d9b61a21732 100644 --- a/testing/monkey/monkey_main.c +++ b/testing/monkey/monkey_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/monkey/monkey_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/monkey/monkey_proc.c b/testing/monkey/monkey_proc.c index 4574a626863..8040401fee4 100644 --- a/testing/monkey/monkey_proc.c +++ b/testing/monkey/monkey_proc.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/monkey/monkey_proc.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/monkey/monkey_recorder.c b/testing/monkey/monkey_recorder.c index 261c0849c14..cc497e8f8c1 100644 --- a/testing/monkey/monkey_recorder.c +++ b/testing/monkey/monkey_recorder.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/monkey/monkey_recorder.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/monkey/monkey_recorder.h b/testing/monkey/monkey_recorder.h index 0d69bd19362..756e1a870c0 100644 --- a/testing/monkey/monkey_recorder.h +++ b/testing/monkey/monkey_recorder.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/monkey/monkey_recorder.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/monkey/monkey_type.h b/testing/monkey/monkey_type.h index 1312a82e7bd..ed4f8684f99 100644 --- a/testing/monkey/monkey_type.h +++ b/testing/monkey/monkey_type.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/monkey/monkey_type.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/monkey/monkey_utils.c b/testing/monkey/monkey_utils.c index 9e322c7560f..5e54731ac3d 100644 --- a/testing/monkey/monkey_utils.c +++ b/testing/monkey/monkey_utils.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/monkey/monkey_utils.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/monkey/monkey_utils.h b/testing/monkey/monkey_utils.h index 342f87c907a..d559600a366 100644 --- a/testing/monkey/monkey_utils.h +++ b/testing/monkey/monkey_utils.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/monkey/monkey_utils.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/mtd_config_fs/CMakeLists.txt b/testing/mtd_config_fs/CMakeLists.txt index 75397385dde..30056c35f7d 100644 --- a/testing/mtd_config_fs/CMakeLists.txt +++ b/testing/mtd_config_fs/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/testing/mtd_config_fs/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/testing/mtd_config_fs/Make.defs b/testing/mtd_config_fs/Make.defs index 7d8926c1850..424b907fd0b 100644 --- a/testing/mtd_config_fs/Make.defs +++ b/testing/mtd_config_fs/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/mtd_config_fs/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/mtd_config_fs/Makefile b/testing/mtd_config_fs/Makefile index 85d1aa8a58e..601e42f616a 100644 --- a/testing/mtd_config_fs/Makefile +++ b/testing/mtd_config_fs/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/mtd_config_fs/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/mtd_config_fs/mtd_config_fs_test_main.c b/testing/mtd_config_fs/mtd_config_fs_test_main.c index e4bbf1bcf9a..5ebc2f99057 100644 --- a/testing/mtd_config_fs/mtd_config_fs_test_main.c +++ b/testing/mtd_config_fs/mtd_config_fs_test_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/mtd_config_fs/mtd_config_fs_test_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/mtetest/CMakeLists.txt b/testing/mtetest/CMakeLists.txt index a3a9737b812..fed326f2210 100644 --- a/testing/mtetest/CMakeLists.txt +++ b/testing/mtetest/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/testing/mtetest/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/testing/mtetest/Make.defs b/testing/mtetest/Make.defs index e927e21187a..94339a5ce1e 100644 --- a/testing/mtetest/Make.defs +++ b/testing/mtetest/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/mtetest/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/mtetest/Makefile b/testing/mtetest/Makefile index b95a2a04fb7..9d9a3239f97 100644 --- a/testing/mtetest/Makefile +++ b/testing/mtetest/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/mtetest/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/mtetest/mtetest.c b/testing/mtetest/mtetest.c index a08ef382583..351c38b220e 100644 --- a/testing/mtetest/mtetest.c +++ b/testing/mtetest/mtetest.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/mtetest/mtetest.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/nand_sim/CMakeLists.txt b/testing/nand_sim/CMakeLists.txt index 68994ebd3ae..4f9b4021c60 100644 --- a/testing/nand_sim/CMakeLists.txt +++ b/testing/nand_sim/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/testing/nand_sim/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/testing/nand_sim/Make.defs b/testing/nand_sim/Make.defs index 1330d5d5aec..05557f6de6c 100644 --- a/testing/nand_sim/Make.defs +++ b/testing/nand_sim/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/nand_sim/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/nand_sim/Makefile b/testing/nand_sim/Makefile index f0b6f1c84c0..a665792095e 100644 --- a/testing/nand_sim/Makefile +++ b/testing/nand_sim/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/nand_sim/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/nand_sim/nand_sim_main.c b/testing/nand_sim/nand_sim_main.c index 5e0893558d0..63e64b91faf 100644 --- a/testing/nand_sim/nand_sim_main.c +++ b/testing/nand_sim/nand_sim_main.c @@ -1,6 +1,7 @@ /**************************************************************************** * apps/testing/nand_sim/nand_sim_main.c * + * SPDX-License-Identifier: Apache-2.0 * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with diff --git a/testing/nist-sts/CMakeLists.txt b/testing/nist-sts/CMakeLists.txt index a0a6cf5f0dc..e61b2b19118 100644 --- a/testing/nist-sts/CMakeLists.txt +++ b/testing/nist-sts/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/testing/nist-sts/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/testing/nist-sts/Make.defs b/testing/nist-sts/Make.defs index ba3894344e3..3bb4a2e35b3 100644 --- a/testing/nist-sts/Make.defs +++ b/testing/nist-sts/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/nist-sts/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/nist-sts/Makefile b/testing/nist-sts/Makefile index 66e83c2a676..4240db96883 100644 --- a/testing/nist-sts/Makefile +++ b/testing/nist-sts/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/nist-sts/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/nxffs/CMakeLists.txt b/testing/nxffs/CMakeLists.txt index 17b18b2b14b..493b2c29e7e 100644 --- a/testing/nxffs/CMakeLists.txt +++ b/testing/nxffs/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/testing/nxffs/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/testing/nxffs/Make.defs b/testing/nxffs/Make.defs index 61cd77248e9..6fb1fd54e6d 100644 --- a/testing/nxffs/Make.defs +++ b/testing/nxffs/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/nxffs/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/nxffs/Makefile b/testing/nxffs/Makefile index d5da0ad1104..c03d5d05dec 100644 --- a/testing/nxffs/Makefile +++ b/testing/nxffs/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/nxffs/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/nxffs/nxffs_main.c b/testing/nxffs/nxffs_main.c index 79389510bd7..46f2fb2a582 100644 --- a/testing/nxffs/nxffs_main.c +++ b/testing/nxffs/nxffs_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/nxffs/nxffs_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/open_memstream/CMakeLists.txt b/testing/open_memstream/CMakeLists.txt index fad47958e10..67a764030ff 100644 --- a/testing/open_memstream/CMakeLists.txt +++ b/testing/open_memstream/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/testing/open_memstream/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/testing/open_memstream/Make.defs b/testing/open_memstream/Make.defs index 8500076c4fc..f16c7d494fd 100644 --- a/testing/open_memstream/Make.defs +++ b/testing/open_memstream/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/open_memstream/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/open_memstream/Makefile b/testing/open_memstream/Makefile index 223ea2c9a49..5759cac9f21 100644 --- a/testing/open_memstream/Makefile +++ b/testing/open_memstream/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/open_memstream/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/open_memstream/open_memstream.c b/testing/open_memstream/open_memstream.c index 0cc0efdf75b..b6f9d59c925 100644 --- a/testing/open_memstream/open_memstream.c +++ b/testing/open_memstream/open_memstream.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/open_memstream/open_memstream.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/ostest/CMakeLists.txt b/testing/ostest/CMakeLists.txt index 47db29f77a1..d3286f02366 100644 --- a/testing/ostest/CMakeLists.txt +++ b/testing/ostest/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/testing/ostest/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/testing/ostest/Make.defs b/testing/ostest/Make.defs index 4d40300b522..4f80d35df35 100644 --- a/testing/ostest/Make.defs +++ b/testing/ostest/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/ostest/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/ostest/Makefile b/testing/ostest/Makefile index 18fc1c19d80..c631fb3b878 100644 --- a/testing/ostest/Makefile +++ b/testing/ostest/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/ostest/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/ostest/aio.c b/testing/ostest/aio.c index 775b56aa54c..8a6fe96372d 100644 --- a/testing/ostest/aio.c +++ b/testing/ostest/aio.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/ostest/aio.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/ostest/barrier.c b/testing/ostest/barrier.c index 541c1b55e22..022aebb40a6 100644 --- a/testing/ostest/barrier.c +++ b/testing/ostest/barrier.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/ostest/barrier.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/ostest/cancel.c b/testing/ostest/cancel.c index 752ed747a69..907a69354d6 100644 --- a/testing/ostest/cancel.c +++ b/testing/ostest/cancel.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/ostest/cancel.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/ostest/cond.c b/testing/ostest/cond.c index f797471d9a8..aee88377868 100644 --- a/testing/ostest/cond.c +++ b/testing/ostest/cond.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/ostest/cond.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/ostest/dev_null.c b/testing/ostest/dev_null.c index 4720a049947..439dd93f51a 100644 --- a/testing/ostest/dev_null.c +++ b/testing/ostest/dev_null.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/ostest/dev_null.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/ostest/fpu.c b/testing/ostest/fpu.c index 65545b00b8f..841d458c7d9 100644 --- a/testing/ostest/fpu.c +++ b/testing/ostest/fpu.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/ostest/fpu.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/ostest/getopt.c b/testing/ostest/getopt.c index c8966753956..8406f08fdba 100644 --- a/testing/ostest/getopt.c +++ b/testing/ostest/getopt.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/ostest/getopt.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/ostest/libc_memmem.c b/testing/ostest/libc_memmem.c index 25d38c7b796..60d5194b01e 100644 --- a/testing/ostest/libc_memmem.c +++ b/testing/ostest/libc_memmem.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/ostest/libc_memmem.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/ostest/mqueue.c b/testing/ostest/mqueue.c index 000b426796e..afd178644f3 100644 --- a/testing/ostest/mqueue.c +++ b/testing/ostest/mqueue.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/ostest/mqueue.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/ostest/mutex.c b/testing/ostest/mutex.c index 11781c94527..4e01166eb27 100644 --- a/testing/ostest/mutex.c +++ b/testing/ostest/mutex.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/ostest/mutex.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/ostest/nsem.c b/testing/ostest/nsem.c index 7f8815214e7..a12a162ece4 100644 --- a/testing/ostest/nsem.c +++ b/testing/ostest/nsem.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/ostest/nsem.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/ostest/nxevent.c b/testing/ostest/nxevent.c index 058c942dd39..e77309d16b6 100644 --- a/testing/ostest/nxevent.c +++ b/testing/ostest/nxevent.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/ostest/nxevent.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/ostest/ostest.h b/testing/ostest/ostest.h index 02ed90c7b16..fec7f81c282 100644 --- a/testing/ostest/ostest.h +++ b/testing/ostest/ostest.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/ostest/ostest.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/ostest/ostest_main.c b/testing/ostest/ostest_main.c index 4a3902c8b55..201d52e389f 100644 --- a/testing/ostest/ostest_main.c +++ b/testing/ostest/ostest_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/ostest/ostest_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/ostest/posixtimer.c b/testing/ostest/posixtimer.c index 9ae0a1f8d19..ea47261b2ae 100644 --- a/testing/ostest/posixtimer.c +++ b/testing/ostest/posixtimer.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/ostest/posixtimer.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/ostest/prioinherit.c b/testing/ostest/prioinherit.c index 0704de829f3..a9ffe3d4fe9 100644 --- a/testing/ostest/prioinherit.c +++ b/testing/ostest/prioinherit.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/ostest/prioinherit.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/ostest/pthread_cleanup.c b/testing/ostest/pthread_cleanup.c index f10912d9b77..00a6b91d429 100644 --- a/testing/ostest/pthread_cleanup.c +++ b/testing/ostest/pthread_cleanup.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/ostest/pthread_cleanup.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/ostest/pthread_exit.c b/testing/ostest/pthread_exit.c index 1a95fa75c63..bc4ca5eac5e 100644 --- a/testing/ostest/pthread_exit.c +++ b/testing/ostest/pthread_exit.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/ostest/pthread_exit.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/ostest/pthread_rwlock.c b/testing/ostest/pthread_rwlock.c index 67febadc1d1..ed4159d80af 100644 --- a/testing/ostest/pthread_rwlock.c +++ b/testing/ostest/pthread_rwlock.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/ostest/pthread_rwlock.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/ostest/pthread_rwlock_cancel.c b/testing/ostest/pthread_rwlock_cancel.c index e0c826a9c7b..ab8e84c0c02 100644 --- a/testing/ostest/pthread_rwlock_cancel.c +++ b/testing/ostest/pthread_rwlock_cancel.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/ostest/pthread_rwlock_cancel.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/ostest/restart.c b/testing/ostest/restart.c index ecd336dac43..891a5b5d663 100644 --- a/testing/ostest/restart.c +++ b/testing/ostest/restart.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/ostest/restart.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/ostest/rmutex.c b/testing/ostest/rmutex.c index 5ae872c94cc..5ad1e056be6 100644 --- a/testing/ostest/rmutex.c +++ b/testing/ostest/rmutex.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/ostest/rmutex.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/ostest/robust.c b/testing/ostest/robust.c index e71c0f2d2c2..9a2baa20fe4 100644 --- a/testing/ostest/robust.c +++ b/testing/ostest/robust.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/ostest/robust.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/ostest/roundrobin.c b/testing/ostest/roundrobin.c index f38d81c2144..c74bbc1f0c7 100644 --- a/testing/ostest/roundrobin.c +++ b/testing/ostest/roundrobin.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/ostest/roundrobin.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/ostest/sched_thread_local.c b/testing/ostest/sched_thread_local.c index d2fc08a3104..f36d119da8c 100644 --- a/testing/ostest/sched_thread_local.c +++ b/testing/ostest/sched_thread_local.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/ostest/sched_thread_local.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/ostest/schedlock.c b/testing/ostest/schedlock.c index 6eea5005529..b6e60f8d088 100644 --- a/testing/ostest/schedlock.c +++ b/testing/ostest/schedlock.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/ostest/schedlock.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/ostest/sem.c b/testing/ostest/sem.c index 6a3bc1385a6..4de91c49bf2 100644 --- a/testing/ostest/sem.c +++ b/testing/ostest/sem.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/ostest/sem.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/ostest/semtimed.c b/testing/ostest/semtimed.c index 62b128354c4..ce3f163c111 100644 --- a/testing/ostest/semtimed.c +++ b/testing/ostest/semtimed.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/ostest/semtimed.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/ostest/setjmp.c b/testing/ostest/setjmp.c index 75ee4295821..09635324edc 100644 --- a/testing/ostest/setjmp.c +++ b/testing/ostest/setjmp.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/ostest/setjmp.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/ostest/setvbuf.c b/testing/ostest/setvbuf.c index b2d198b264e..41210d25c0c 100644 --- a/testing/ostest/setvbuf.c +++ b/testing/ostest/setvbuf.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/ostest/setvbuf.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/ostest/sigev_thread.c b/testing/ostest/sigev_thread.c index 930379ea63d..89b1cc8d1a7 100644 --- a/testing/ostest/sigev_thread.c +++ b/testing/ostest/sigev_thread.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/ostest/sigev_thread.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/ostest/sighand.c b/testing/ostest/sighand.c index 72b6538905b..e7f3f5318b5 100644 --- a/testing/ostest/sighand.c +++ b/testing/ostest/sighand.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/ostest/sighand.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/ostest/sighelper.c b/testing/ostest/sighelper.c index 539a4d720db..476e170a8b4 100644 --- a/testing/ostest/sighelper.c +++ b/testing/ostest/sighelper.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/ostest/sighelper.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/ostest/signest.c b/testing/ostest/signest.c index a539986e915..7b0378849d4 100644 --- a/testing/ostest/signest.c +++ b/testing/ostest/signest.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/ostest/signest.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/ostest/sigprocmask.c b/testing/ostest/sigprocmask.c index b8b08129116..d208e1bbcf8 100644 --- a/testing/ostest/sigprocmask.c +++ b/testing/ostest/sigprocmask.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/ostest/sigprocmask.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/ostest/smp_call.c b/testing/ostest/smp_call.c index 74231066f40..18f03097720 100644 --- a/testing/ostest/smp_call.c +++ b/testing/ostest/smp_call.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/ostest/smp_call.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/ostest/specific.c b/testing/ostest/specific.c index f23db85d846..27497ce53b5 100644 --- a/testing/ostest/specific.c +++ b/testing/ostest/specific.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/ostest/specific.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/ostest/sporadic.c b/testing/ostest/sporadic.c index 8f9fc685b8d..5e6986ba774 100644 --- a/testing/ostest/sporadic.c +++ b/testing/ostest/sporadic.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/ostest/sporadic.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/ostest/sporadic2.c b/testing/ostest/sporadic2.c index ce1811ef019..acc7f34e164 100644 --- a/testing/ostest/sporadic2.c +++ b/testing/ostest/sporadic2.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/ostest/sporadic2.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/ostest/suspend.c b/testing/ostest/suspend.c index 16181fc4822..a1d6f6b877c 100644 --- a/testing/ostest/suspend.c +++ b/testing/ostest/suspend.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/ostest/suspend.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/ostest/timedmqueue.c b/testing/ostest/timedmqueue.c index d2c487d42fc..5a4dcb29a13 100644 --- a/testing/ostest/timedmqueue.c +++ b/testing/ostest/timedmqueue.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/ostest/timedmqueue.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/ostest/timedmutex.c b/testing/ostest/timedmutex.c index 1bfd7c5b55b..303dc260c01 100644 --- a/testing/ostest/timedmutex.c +++ b/testing/ostest/timedmutex.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/ostest/timedmutex.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/ostest/timedwait.c b/testing/ostest/timedwait.c index ec4c393d2b2..ab3f6794cc3 100644 --- a/testing/ostest/timedwait.c +++ b/testing/ostest/timedwait.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/ostest/timedwait.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/ostest/tls.c b/testing/ostest/tls.c index 7ae461cc6fd..011f2642c06 100644 --- a/testing/ostest/tls.c +++ b/testing/ostest/tls.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/ostest/tls.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/ostest/vfork.c b/testing/ostest/vfork.c index 5bfbd93dcff..bd6cfabadb9 100644 --- a/testing/ostest/vfork.c +++ b/testing/ostest/vfork.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/ostest/vfork.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/ostest/waitpid.c b/testing/ostest/waitpid.c index 758ffcf9fb0..2be66e8c944 100644 --- a/testing/ostest/waitpid.c +++ b/testing/ostest/waitpid.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/ostest/waitpid.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/ostest/wdog.c b/testing/ostest/wdog.c index 49478ae496a..8c1c35a826a 100644 --- a/testing/ostest/wdog.c +++ b/testing/ostest/wdog.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/ostest/wdog.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/ostest/wqueue.c b/testing/ostest/wqueue.c index 76596c3ae8b..9d0444a968b 100644 --- a/testing/ostest/wqueue.c +++ b/testing/ostest/wqueue.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/ostest/wqueue.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/pcitest/Make.defs b/testing/pcitest/Make.defs index 066363ddccb..985276be2d4 100644 --- a/testing/pcitest/Make.defs +++ b/testing/pcitest/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/pcitest/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/pcitest/Makefile b/testing/pcitest/Makefile index 07bf5ca152a..46c7050bf56 100644 --- a/testing/pcitest/Makefile +++ b/testing/pcitest/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/pcitest/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/pcitest/pcitest.c b/testing/pcitest/pcitest.c index 3f02667dac0..2814c0c517e 100644 --- a/testing/pcitest/pcitest.c +++ b/testing/pcitest/pcitest.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/pcitest/pcitest.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/ramtest/CMakeLists.txt b/testing/ramtest/CMakeLists.txt index 46d9340a830..796f818773f 100644 --- a/testing/ramtest/CMakeLists.txt +++ b/testing/ramtest/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/testing/ramtest/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/testing/ramtest/Make.defs b/testing/ramtest/Make.defs index ff4a4701279..b521135d6bb 100644 --- a/testing/ramtest/Make.defs +++ b/testing/ramtest/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/ramtest/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/ramtest/Makefile b/testing/ramtest/Makefile index 89636f3015b..977f0838acf 100644 --- a/testing/ramtest/Makefile +++ b/testing/ramtest/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/ramtest/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/ramtest/ramtest.c b/testing/ramtest/ramtest.c index 046f63d973f..77989c42145 100644 --- a/testing/ramtest/ramtest.c +++ b/testing/ramtest/ramtest.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/ramtest/ramtest.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/resmonitor/CMakeLists.txt b/testing/resmonitor/CMakeLists.txt index 38f94064e4a..ca110234196 100644 --- a/testing/resmonitor/CMakeLists.txt +++ b/testing/resmonitor/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/testing/resmonitor/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/testing/resmonitor/Make.defs b/testing/resmonitor/Make.defs index a111ad4c89c..886d7b0e9d2 100644 --- a/testing/resmonitor/Make.defs +++ b/testing/resmonitor/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/resmonitor/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The @@ -16,7 +18,6 @@ # License for the specific language governing permissions and limitations # under the License. # -# ############################################################################ ifneq ($(CONFIG_TESTING_RESMONITOR),) diff --git a/testing/resmonitor/Makefile b/testing/resmonitor/Makefile index a5d7d352f72..b61abd1f34e 100644 --- a/testing/resmonitor/Makefile +++ b/testing/resmonitor/Makefile @@ -1,16 +1,24 @@ +############################################################################ # apps/testing/resmonitor/Makefile # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ include $(APPDIR)/Make.defs diff --git a/testing/resmonitor/fillcpu.c b/testing/resmonitor/fillcpu.c index 024219b3105..dddf9da5c38 100644 --- a/testing/resmonitor/fillcpu.c +++ b/testing/resmonitor/fillcpu.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/resmonitor/fillcpu.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/resmonitor/filldisk.c b/testing/resmonitor/filldisk.c index 5f7b6618cbe..4e7b9e618a7 100644 --- a/testing/resmonitor/filldisk.c +++ b/testing/resmonitor/filldisk.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/resmonitor/filldisk.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/resmonitor/fillmem.c b/testing/resmonitor/fillmem.c index 7f96203178f..c301d401f01 100644 --- a/testing/resmonitor/fillmem.c +++ b/testing/resmonitor/fillmem.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/resmonitor/fillmem.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/resmonitor/showinfo.c b/testing/resmonitor/showinfo.c index 44a04471a8a..fe535334beb 100644 --- a/testing/resmonitor/showinfo.c +++ b/testing/resmonitor/showinfo.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/resmonitor/showinfo.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/scanftest/CMakeLists.txt b/testing/scanftest/CMakeLists.txt index 02b966fbf63..dc6827bd06b 100644 --- a/testing/scanftest/CMakeLists.txt +++ b/testing/scanftest/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/testing/scanftest/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/testing/scanftest/Make.defs b/testing/scanftest/Make.defs index 387fd2895a9..ebeffd59060 100644 --- a/testing/scanftest/Make.defs +++ b/testing/scanftest/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/scanftest/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/scanftest/Makefile b/testing/scanftest/Makefile index 14d614f6873..155b32ae437 100644 --- a/testing/scanftest/Makefile +++ b/testing/scanftest/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/scanftest/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/scanftest/scanftest_main.c b/testing/scanftest/scanftest_main.c index c957f44d0f6..2ec1f420fdb 100644 --- a/testing/scanftest/scanftest_main.c +++ b/testing/scanftest/scanftest_main.c @@ -1,29 +1,8 @@ /**************************************************************************** * apps/testing/scanftest/scanftest_main.c * - * Copyright (C) 2005-01-26, Greg King (https://github.com/cc65) - * - * Original License: - * This software is provided 'as-is', without any express or implied - * warranty. - * In no event will the authors be held liable for any damages arising from - * the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software in - * a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * - * 2. Altered source versions must be plainly marked as such, and must not - * be misrepresented as being the original software. - * - * 3. This notice may not be removed or altered from any source distribution. - * - * Modified: Johannes Schock + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2005-01-26, Greg King (https://github.com/cc65) * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -54,6 +33,28 @@ * ****************************************************************************/ +/* Original License: + * This software is provided 'as-is', without any express or implied + * warranty. + * In no event will the authors be held liable for any damages arising from + * the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software in + * a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * + * 2. Altered source versions must be plainly marked as such, and must not + * be misrepresented as being the original software. + * + * 3. This notice may not be removed or altered from any source distribution. + * + * Modified: Johannes Schock + */ /**************************************************************************** * Included Files ****************************************************************************/ diff --git a/testing/sd_bench/Make.defs b/testing/sd_bench/Make.defs index aacfed6ef10..b9e2b9bb018 100644 --- a/testing/sd_bench/Make.defs +++ b/testing/sd_bench/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/sd_bench/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/sd_bench/Makefile b/testing/sd_bench/Makefile index fb220e0c34e..ddd1789947c 100644 --- a/testing/sd_bench/Makefile +++ b/testing/sd_bench/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/sd_bench/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/sd_bench/sd_bench_main.c b/testing/sd_bench/sd_bench_main.c index a8a06f8d20e..e2ae7472280 100644 --- a/testing/sd_bench/sd_bench_main.c +++ b/testing/sd_bench/sd_bench_main.c @@ -1,9 +1,8 @@ /**************************************************************************** * apps/testing/sd_bench/sd_bench_main.c * - * Original Licence: - * - * Copyright (c) 2016-2021 PX4 Development Team. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2016-2021 PX4 Development Team. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/testing/sd_stress/Make.defs b/testing/sd_stress/Make.defs index 4517b39043a..1da23f092af 100644 --- a/testing/sd_stress/Make.defs +++ b/testing/sd_stress/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/sd_stress/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/sd_stress/Makefile b/testing/sd_stress/Makefile index 6c21851afc6..a70d6857d7b 100644 --- a/testing/sd_stress/Makefile +++ b/testing/sd_stress/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/sd_stress/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/sd_stress/sd_stress_main.c b/testing/sd_stress/sd_stress_main.c index 6720dcb3977..ddb598e804f 100644 --- a/testing/sd_stress/sd_stress_main.c +++ b/testing/sd_stress/sd_stress_main.c @@ -1,9 +1,8 @@ /**************************************************************************** * apps/testing/sd_stress/sd_stress_main.c * - * Original Licence: - * - * Copyright (c) 2016-2021 PX4 Development Team. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause + * SPDX-FileCopyrightText: 2016-2021 PX4 Development Team. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/testing/sensortest/CMakeLists.txt b/testing/sensortest/CMakeLists.txt index aa828352335..a95134c8838 100644 --- a/testing/sensortest/CMakeLists.txt +++ b/testing/sensortest/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/testing/sensortest/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/testing/sensortest/Make.defs b/testing/sensortest/Make.defs index df35dadf33c..50603af5cb2 100644 --- a/testing/sensortest/Make.defs +++ b/testing/sensortest/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/sensortest/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/sensortest/Makefile b/testing/sensortest/Makefile index 4f084f096ee..6ecde141018 100644 --- a/testing/sensortest/Makefile +++ b/testing/sensortest/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/sensortest/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/sensortest/sensortest.c b/testing/sensortest/sensortest.c index fb97108f375..8576862e2f0 100644 --- a/testing/sensortest/sensortest.c +++ b/testing/sensortest/sensortest.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/sensortest/sensortest.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/setest/CMakeLists.txt b/testing/setest/CMakeLists.txt index 42951c45133..27235b4351a 100644 --- a/testing/setest/CMakeLists.txt +++ b/testing/setest/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/testing/setest/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/testing/setest/Make.defs b/testing/setest/Make.defs index 68eebe63678..701bb5f0aac 100644 --- a/testing/setest/Make.defs +++ b/testing/setest/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/setest/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/setest/Makefile b/testing/setest/Makefile index 1053f00652b..594455749f4 100644 --- a/testing/setest/Makefile +++ b/testing/setest/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/setest/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/setest/setest.c b/testing/setest/setest.c index 0a773650e3e..f16fca4a18d 100644 --- a/testing/setest/setest.c +++ b/testing/setest/setest.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/setest/setest.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/smart/CMakeLists.txt b/testing/smart/CMakeLists.txt index dc4ea728074..091f1fdf39b 100644 --- a/testing/smart/CMakeLists.txt +++ b/testing/smart/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/testing/smart/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/testing/smart/Make.defs b/testing/smart/Make.defs index 738f7cfa197..771631a8b91 100644 --- a/testing/smart/Make.defs +++ b/testing/smart/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/smart/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/smart/Makefile b/testing/smart/Makefile index 8f180a993b0..deebbc53589 100644 --- a/testing/smart/Makefile +++ b/testing/smart/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/smart/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/smart/smart_main.c b/testing/smart/smart_main.c index 61dd3ec7259..03dd897bb0c 100644 --- a/testing/smart/smart_main.c +++ b/testing/smart/smart_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/smart/smart_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/smart_test/CMakeLists.txt b/testing/smart_test/CMakeLists.txt index b1448da17c1..057e56282dd 100644 --- a/testing/smart_test/CMakeLists.txt +++ b/testing/smart_test/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/testing/smart_test/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/testing/smart_test/Make.defs b/testing/smart_test/Make.defs index ca6932d63b4..e02270134ff 100644 --- a/testing/smart_test/Make.defs +++ b/testing/smart_test/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/smart_test/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/smart_test/Makefile b/testing/smart_test/Makefile index 6738ce91d1b..835a1751ee1 100644 --- a/testing/smart_test/Makefile +++ b/testing/smart_test/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/smart_test/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/smart_test/smart_test.c b/testing/smart_test/smart_test.c index 7f948a20c8e..1650ba7acd1 100644 --- a/testing/smart_test/smart_test.c +++ b/testing/smart_test/smart_test.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/smart_test/smart_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/smp/CMakeLists.txt b/testing/smp/CMakeLists.txt index d22fd43bb71..ada0bceb154 100644 --- a/testing/smp/CMakeLists.txt +++ b/testing/smp/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/testing/smp/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/testing/smp/Make.defs b/testing/smp/Make.defs index 146dac47ade..78a315d54c8 100644 --- a/testing/smp/Make.defs +++ b/testing/smp/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/smp/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/smp/Makefile b/testing/smp/Makefile index b1bc0254ee2..dd36b1c38bd 100644 --- a/testing/smp/Makefile +++ b/testing/smp/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/smp/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/smp/smp_main.c b/testing/smp/smp_main.c index a538c9c5877..c5fedcb740d 100644 --- a/testing/smp/smp_main.c +++ b/testing/smp/smp_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/smp/smp_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/stressapptest/CMakeLists.txt b/testing/stressapptest/CMakeLists.txt index 3e49865fe32..c9c075d3dc5 100644 --- a/testing/stressapptest/CMakeLists.txt +++ b/testing/stressapptest/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/testing/stressapptest/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/testing/stressapptest/Make.defs b/testing/stressapptest/Make.defs index c00a1e89e3c..1b0f51ce594 100644 --- a/testing/stressapptest/Make.defs +++ b/testing/stressapptest/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/stressapptest/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/stressapptest/Makefile b/testing/stressapptest/Makefile index 38c962d1455..2cc05d5079a 100644 --- a/testing/stressapptest/Makefile +++ b/testing/stressapptest/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/stressapptest/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/testsuites/Make.defs b/testing/testsuites/Make.defs index 03ab762a156..ffd04be0601 100644 --- a/testing/testsuites/Make.defs +++ b/testing/testsuites/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/testsuites/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/testsuites/Makefile b/testing/testsuites/Makefile index 1b896ef5bf1..ac63f216402 100644 --- a/testing/testsuites/Makefile +++ b/testing/testsuites/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/testsuites/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/testsuites/kernel/fs/cases/fs_append_test.c b/testing/testsuites/kernel/fs/cases/fs_append_test.c index 691109c4c26..990f4d93dff 100644 --- a/testing/testsuites/kernel/fs/cases/fs_append_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_append_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_append_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/fs/cases/fs_creat_test.c b/testing/testsuites/kernel/fs/cases/fs_creat_test.c index af88a4292dd..23fcab888f0 100644 --- a/testing/testsuites/kernel/fs/cases/fs_creat_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_creat_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_creat_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/fs/cases/fs_dup2_test.c b/testing/testsuites/kernel/fs/cases/fs_dup2_test.c index 7e5faefe53b..7ec1ece9708 100644 --- a/testing/testsuites/kernel/fs/cases/fs_dup2_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_dup2_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_dup2_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/fs/cases/fs_dup_test.c b/testing/testsuites/kernel/fs/cases/fs_dup_test.c index 7b57379ca64..0600041f1de 100644 --- a/testing/testsuites/kernel/fs/cases/fs_dup_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_dup_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_dup_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/fs/cases/fs_eventfd_test.c b/testing/testsuites/kernel/fs/cases/fs_eventfd_test.c index 805311eb5e8..1a70776af91 100644 --- a/testing/testsuites/kernel/fs/cases/fs_eventfd_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_eventfd_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_eventfd_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/fs/cases/fs_fcntl_test.c b/testing/testsuites/kernel/fs/cases/fs_fcntl_test.c index 94007b22a72..1c163690cc6 100644 --- a/testing/testsuites/kernel/fs/cases/fs_fcntl_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_fcntl_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_fcntl_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/fs/cases/fs_fstat_test.c b/testing/testsuites/kernel/fs/cases/fs_fstat_test.c index e0eb6c8dee6..315c3e99162 100644 --- a/testing/testsuites/kernel/fs/cases/fs_fstat_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_fstat_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_fstat_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/fs/cases/fs_fstatfs_test.c b/testing/testsuites/kernel/fs/cases/fs_fstatfs_test.c index ab6653878dc..0f804a6f870 100644 --- a/testing/testsuites/kernel/fs/cases/fs_fstatfs_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_fstatfs_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_fstatfs_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/fs/cases/fs_fsync_test.c b/testing/testsuites/kernel/fs/cases/fs_fsync_test.c index 5ea5fbe7ee8..10c57becc9a 100644 --- a/testing/testsuites/kernel/fs/cases/fs_fsync_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_fsync_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_fsync_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/fs/cases/fs_getfilep_test.c b/testing/testsuites/kernel/fs/cases/fs_getfilep_test.c index 41a19cbd782..06aff68653b 100644 --- a/testing/testsuites/kernel/fs/cases/fs_getfilep_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_getfilep_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_getfilep_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/fs/cases/fs_mkdir_test.c b/testing/testsuites/kernel/fs/cases/fs_mkdir_test.c index a44eed1c795..de189f545d5 100644 --- a/testing/testsuites/kernel/fs/cases/fs_mkdir_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_mkdir_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_mkdir_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/fs/cases/fs_open_test.c b/testing/testsuites/kernel/fs/cases/fs_open_test.c index cd45266cec7..f671438afe3 100644 --- a/testing/testsuites/kernel/fs/cases/fs_open_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_open_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_open_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/fs/cases/fs_opendir_test.c b/testing/testsuites/kernel/fs/cases/fs_opendir_test.c index 83864b49dd0..a92a779d660 100644 --- a/testing/testsuites/kernel/fs/cases/fs_opendir_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_opendir_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_opendir_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/fs/cases/fs_poll_test.c b/testing/testsuites/kernel/fs/cases/fs_poll_test.c index 896ea7b9d7c..c442c7437ef 100644 --- a/testing/testsuites/kernel/fs/cases/fs_poll_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_poll_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_poll_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/fs/cases/fs_pread_test.c b/testing/testsuites/kernel/fs/cases/fs_pread_test.c index 8af428459f5..f1a710cf996 100644 --- a/testing/testsuites/kernel/fs/cases/fs_pread_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_pread_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_pread_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/fs/cases/fs_pwrite_test.c b/testing/testsuites/kernel/fs/cases/fs_pwrite_test.c index 9c8fadd1bbd..1afa3d1cfd4 100644 --- a/testing/testsuites/kernel/fs/cases/fs_pwrite_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_pwrite_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_pwrite_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/fs/cases/fs_read_test.c b/testing/testsuites/kernel/fs/cases/fs_read_test.c index f0164894a56..1ffb0bb8e43 100644 --- a/testing/testsuites/kernel/fs/cases/fs_read_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_read_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_read_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/fs/cases/fs_readdir_test.c b/testing/testsuites/kernel/fs/cases/fs_readdir_test.c index c7b9b0e5cdb..c5a259c5fec 100644 --- a/testing/testsuites/kernel/fs/cases/fs_readdir_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_readdir_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_readdir_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/fs/cases/fs_readlink_test.c b/testing/testsuites/kernel/fs/cases/fs_readlink_test.c index b01da9607c3..c3617c0973b 100644 --- a/testing/testsuites/kernel/fs/cases/fs_readlink_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_readlink_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_readlink_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/fs/cases/fs_rename_test.c b/testing/testsuites/kernel/fs/cases/fs_rename_test.c index 656d575d1d0..36d1d5aba10 100644 --- a/testing/testsuites/kernel/fs/cases/fs_rename_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_rename_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_rename_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/fs/cases/fs_rewinddir_test.c b/testing/testsuites/kernel/fs/cases/fs_rewinddir_test.c index f88645e14fb..6755a1a4636 100644 --- a/testing/testsuites/kernel/fs/cases/fs_rewinddir_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_rewinddir_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_rewinddir_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/fs/cases/fs_rmdir_test.c b/testing/testsuites/kernel/fs/cases/fs_rmdir_test.c index 57e84ca2f43..d90d4c632cd 100644 --- a/testing/testsuites/kernel/fs/cases/fs_rmdir_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_rmdir_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_rmdir_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/fs/cases/fs_seek_test.c b/testing/testsuites/kernel/fs/cases/fs_seek_test.c index da49382eadf..e206e5e0deb 100644 --- a/testing/testsuites/kernel/fs/cases/fs_seek_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_seek_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_seek_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/fs/cases/fs_sendfile_test.c b/testing/testsuites/kernel/fs/cases/fs_sendfile_test.c index eb6dec014f1..5163e7cbfeb 100644 --- a/testing/testsuites/kernel/fs/cases/fs_sendfile_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_sendfile_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_sendfile_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/fs/cases/fs_stat_test.c b/testing/testsuites/kernel/fs/cases/fs_stat_test.c index 3420b30731c..fb2c096d429 100644 --- a/testing/testsuites/kernel/fs/cases/fs_stat_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_stat_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_stat_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/fs/cases/fs_statfs_test.c b/testing/testsuites/kernel/fs/cases/fs_statfs_test.c index 8fa30b8e3cb..6390691dce5 100644 --- a/testing/testsuites/kernel/fs/cases/fs_statfs_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_statfs_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_statfs_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/fs/cases/fs_stream_test.c b/testing/testsuites/kernel/fs/cases/fs_stream_test.c index 2505668cbe7..fbea3e4e4da 100644 --- a/testing/testsuites/kernel/fs/cases/fs_stream_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_stream_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_stream_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/fs/cases/fs_symlink_test.c b/testing/testsuites/kernel/fs/cases/fs_symlink_test.c index 05f6a908e16..a12d727e580 100644 --- a/testing/testsuites/kernel/fs/cases/fs_symlink_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_symlink_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_symlink_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/fs/cases/fs_truncate_test.c b/testing/testsuites/kernel/fs/cases/fs_truncate_test.c index 32afc989c21..ca2cef0bbdd 100644 --- a/testing/testsuites/kernel/fs/cases/fs_truncate_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_truncate_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_truncate_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/fs/cases/fs_unlink_test.c b/testing/testsuites/kernel/fs/cases/fs_unlink_test.c index 7097bc114e8..7d52eb425ea 100644 --- a/testing/testsuites/kernel/fs/cases/fs_unlink_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_unlink_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_unlink_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/fs/cases/fs_write_test.c b/testing/testsuites/kernel/fs/cases/fs_write_test.c index 954704ed213..75bbc96efa3 100644 --- a/testing/testsuites/kernel/fs/cases/fs_write_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_write_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cases/fs_write_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/fs/cmocka_fs_test.c b/testing/testsuites/kernel/fs/cmocka_fs_test.c index f4b581f816e..c5917c3676b 100644 --- a/testing/testsuites/kernel/fs/cmocka_fs_test.c +++ b/testing/testsuites/kernel/fs/cmocka_fs_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/cmocka_fs_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/fs/common/test_fs_common.c b/testing/testsuites/kernel/fs/common/test_fs_common.c index 3761f8fac37..911cad7e3ed 100644 --- a/testing/testsuites/kernel/fs/common/test_fs_common.c +++ b/testing/testsuites/kernel/fs/common/test_fs_common.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/common/test_fs_common.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/fs/include/fstest.h b/testing/testsuites/kernel/fs/include/fstest.h index f16677fb6ff..4892f0ad553 100644 --- a/testing/testsuites/kernel/fs/include/fstest.h +++ b/testing/testsuites/kernel/fs/include/fstest.h @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/fs/include/fstest.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/mm/cases/mm_test_001.c b/testing/testsuites/kernel/mm/cases/mm_test_001.c index 7eb27c541bc..328f95a8dd5 100644 --- a/testing/testsuites/kernel/mm/cases/mm_test_001.c +++ b/testing/testsuites/kernel/mm/cases/mm_test_001.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/mm/cases/mm_test_001.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/mm/cases/mm_test_002.c b/testing/testsuites/kernel/mm/cases/mm_test_002.c index e749b84eeb2..19c35bbe120 100644 --- a/testing/testsuites/kernel/mm/cases/mm_test_002.c +++ b/testing/testsuites/kernel/mm/cases/mm_test_002.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/mm/cases/mm_test_002.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/mm/cases/mm_test_003.c b/testing/testsuites/kernel/mm/cases/mm_test_003.c index cfa9935cf9f..14dca25e8f3 100644 --- a/testing/testsuites/kernel/mm/cases/mm_test_003.c +++ b/testing/testsuites/kernel/mm/cases/mm_test_003.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/mm/cases/mm_test_003.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/mm/cases/mm_test_004.c b/testing/testsuites/kernel/mm/cases/mm_test_004.c index 2dafc6f2320..104835f9407 100644 --- a/testing/testsuites/kernel/mm/cases/mm_test_004.c +++ b/testing/testsuites/kernel/mm/cases/mm_test_004.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/mm/cases/mm_test_004.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/mm/cases/mm_test_005.c b/testing/testsuites/kernel/mm/cases/mm_test_005.c index 6329c73464a..5a916041b06 100644 --- a/testing/testsuites/kernel/mm/cases/mm_test_005.c +++ b/testing/testsuites/kernel/mm/cases/mm_test_005.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/mm/cases/mm_test_005.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/mm/cases/mm_test_006.c b/testing/testsuites/kernel/mm/cases/mm_test_006.c index 98a19c1f260..6c7877489f8 100644 --- a/testing/testsuites/kernel/mm/cases/mm_test_006.c +++ b/testing/testsuites/kernel/mm/cases/mm_test_006.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/mm/cases/mm_test_006.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/mm/cases/mm_test_007.c b/testing/testsuites/kernel/mm/cases/mm_test_007.c index efe33221ce2..decbdec5279 100644 --- a/testing/testsuites/kernel/mm/cases/mm_test_007.c +++ b/testing/testsuites/kernel/mm/cases/mm_test_007.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/mm/cases/mm_test_007.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/mm/cases/mm_test_008.c b/testing/testsuites/kernel/mm/cases/mm_test_008.c index 99aab0c67b3..ab92d6982a6 100644 --- a/testing/testsuites/kernel/mm/cases/mm_test_008.c +++ b/testing/testsuites/kernel/mm/cases/mm_test_008.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/mm/cases/mm_test_008.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/mm/cmocka_mm_test.c b/testing/testsuites/kernel/mm/cmocka_mm_test.c index 27341a84ab8..1c861326bce 100644 --- a/testing/testsuites/kernel/mm/cmocka_mm_test.c +++ b/testing/testsuites/kernel/mm/cmocka_mm_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/mm/cmocka_mm_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/mm/common/test_mm_common.c b/testing/testsuites/kernel/mm/common/test_mm_common.c index 07157579128..ace9dbedb92 100644 --- a/testing/testsuites/kernel/mm/common/test_mm_common.c +++ b/testing/testsuites/kernel/mm/common/test_mm_common.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/mm/common/test_mm_common.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/mm/include/MmTest.h b/testing/testsuites/kernel/mm/include/MmTest.h index 6d1812d9aff..0f453071280 100644 --- a/testing/testsuites/kernel/mm/include/MmTest.h +++ b/testing/testsuites/kernel/mm/include/MmTest.h @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/mm/include/MmTest.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ @@ -95,4 +97,4 @@ void test_nuttx_mm07(FAR void **state); void test_nuttx_mm08(FAR void **state); -#endif \ No newline at end of file +#endif diff --git a/testing/testsuites/kernel/mm/tool/mem_batch_opt_perf_test.c b/testing/testsuites/kernel/mm/tool/mem_batch_opt_perf_test.c index 740aa343584..3485a3f91d9 100644 --- a/testing/testsuites/kernel/mm/tool/mem_batch_opt_perf_test.c +++ b/testing/testsuites/kernel/mm/tool/mem_batch_opt_perf_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/mm/tool/mem_batch_opt_perf_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/mm/tool/mem_cycle_opt_perf_test.c b/testing/testsuites/kernel/mm/tool/mem_cycle_opt_perf_test.c index 858f7abb516..53191b5ec1c 100644 --- a/testing/testsuites/kernel/mm/tool/mem_cycle_opt_perf_test.c +++ b/testing/testsuites/kernel/mm/tool/mem_cycle_opt_perf_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/mm/tool/mem_cycle_opt_perf_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/mutex/cases/posix_mutex_test_001.c b/testing/testsuites/kernel/mutex/cases/posix_mutex_test_001.c index de3c521d7d8..238699540c9 100644 --- a/testing/testsuites/kernel/mutex/cases/posix_mutex_test_001.c +++ b/testing/testsuites/kernel/mutex/cases/posix_mutex_test_001.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/mutex/cases/posix_mutex_test_001.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/mutex/cases/posix_mutex_test_019.c b/testing/testsuites/kernel/mutex/cases/posix_mutex_test_019.c index ed4326e53ec..fcaf2922edb 100644 --- a/testing/testsuites/kernel/mutex/cases/posix_mutex_test_019.c +++ b/testing/testsuites/kernel/mutex/cases/posix_mutex_test_019.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/mutex/cases/posix_mutex_test_019.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/mutex/cases/posix_mutex_test_020.c b/testing/testsuites/kernel/mutex/cases/posix_mutex_test_020.c index c4c795ff0ff..e98f7557e46 100644 --- a/testing/testsuites/kernel/mutex/cases/posix_mutex_test_020.c +++ b/testing/testsuites/kernel/mutex/cases/posix_mutex_test_020.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/mutex/cases/posix_mutex_test_020.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/mutex/cmocka_mutex_test.c b/testing/testsuites/kernel/mutex/cmocka_mutex_test.c index 8ac241bec3f..64df27069b9 100644 --- a/testing/testsuites/kernel/mutex/cmocka_mutex_test.c +++ b/testing/testsuites/kernel/mutex/cmocka_mutex_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/mutex/cmocka_mutex_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/mutex/include/MutexTest.h b/testing/testsuites/kernel/mutex/include/MutexTest.h index f99a775de3b..44e9dbb0b3b 100644 --- a/testing/testsuites/kernel/mutex/include/MutexTest.h +++ b/testing/testsuites/kernel/mutex/include/MutexTest.h @@ -1,22 +1,25 @@ /**************************************************************************** * apps/testing/testsuites/kernel/mutex/include/MutexTest.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ + #ifndef PTHREAD_TEST_H #define PTHREAD_TEST_H diff --git a/testing/testsuites/kernel/pthread/cases/posix_pthread_test_003.c b/testing/testsuites/kernel/pthread/cases/posix_pthread_test_003.c index 1fe33deff09..79ee576c071 100644 --- a/testing/testsuites/kernel/pthread/cases/posix_pthread_test_003.c +++ b/testing/testsuites/kernel/pthread/cases/posix_pthread_test_003.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/pthread/cases/posix_pthread_test_003.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/pthread/cases/posix_pthread_test_004.c b/testing/testsuites/kernel/pthread/cases/posix_pthread_test_004.c index bd968c5769f..8dac61aa1a8 100644 --- a/testing/testsuites/kernel/pthread/cases/posix_pthread_test_004.c +++ b/testing/testsuites/kernel/pthread/cases/posix_pthread_test_004.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/pthread/cases/posix_pthread_test_004.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/pthread/cases/posix_pthread_test_005.c b/testing/testsuites/kernel/pthread/cases/posix_pthread_test_005.c index 32ec5f8c5ce..b6f25eaa873 100644 --- a/testing/testsuites/kernel/pthread/cases/posix_pthread_test_005.c +++ b/testing/testsuites/kernel/pthread/cases/posix_pthread_test_005.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/pthread/cases/posix_pthread_test_005.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/pthread/cases/posix_pthread_test_006.c b/testing/testsuites/kernel/pthread/cases/posix_pthread_test_006.c index 64c3266992b..b416821d8c2 100644 --- a/testing/testsuites/kernel/pthread/cases/posix_pthread_test_006.c +++ b/testing/testsuites/kernel/pthread/cases/posix_pthread_test_006.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/pthread/cases/posix_pthread_test_006.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/pthread/cases/posix_pthread_test_009.c b/testing/testsuites/kernel/pthread/cases/posix_pthread_test_009.c index 731c097f9dd..e1708f70d6b 100644 --- a/testing/testsuites/kernel/pthread/cases/posix_pthread_test_009.c +++ b/testing/testsuites/kernel/pthread/cases/posix_pthread_test_009.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/pthread/cases/posix_pthread_test_009.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/pthread/cases/posix_pthread_test_018.c b/testing/testsuites/kernel/pthread/cases/posix_pthread_test_018.c index b4ca6b9eeb2..962596df436 100644 --- a/testing/testsuites/kernel/pthread/cases/posix_pthread_test_018.c +++ b/testing/testsuites/kernel/pthread/cases/posix_pthread_test_018.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/pthread/cases/posix_pthread_test_018.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/pthread/cases/posix_pthread_test_019.c b/testing/testsuites/kernel/pthread/cases/posix_pthread_test_019.c index 58134db0529..4845e0aa991 100644 --- a/testing/testsuites/kernel/pthread/cases/posix_pthread_test_019.c +++ b/testing/testsuites/kernel/pthread/cases/posix_pthread_test_019.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/pthread/cases/posix_pthread_test_019.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/pthread/cases/posix_pthread_test_021.c b/testing/testsuites/kernel/pthread/cases/posix_pthread_test_021.c index 93a833a028a..a66d9756892 100644 --- a/testing/testsuites/kernel/pthread/cases/posix_pthread_test_021.c +++ b/testing/testsuites/kernel/pthread/cases/posix_pthread_test_021.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/pthread/cases/posix_pthread_test_021.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/pthread/cmocka_pthread_test.c b/testing/testsuites/kernel/pthread/cmocka_pthread_test.c index 1045ff6fea6..8c7b17598e1 100644 --- a/testing/testsuites/kernel/pthread/cmocka_pthread_test.c +++ b/testing/testsuites/kernel/pthread/cmocka_pthread_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/pthread/cmocka_pthread_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/pthread/common/test_pthread_common.c b/testing/testsuites/kernel/pthread/common/test_pthread_common.c index 0c395f5b474..81c78604338 100644 --- a/testing/testsuites/kernel/pthread/common/test_pthread_common.c +++ b/testing/testsuites/kernel/pthread/common/test_pthread_common.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/pthread/common/test_pthread_common.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/pthread/include/PthreadTest.h b/testing/testsuites/kernel/pthread/include/PthreadTest.h index 8a0c8655f8e..3909171d34b 100644 --- a/testing/testsuites/kernel/pthread/include/PthreadTest.h +++ b/testing/testsuites/kernel/pthread/include/PthreadTest.h @@ -1,22 +1,25 @@ /**************************************************************************** * apps/testing/testsuites/kernel/pthread/include/PthreadTest.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ + #ifndef PTHREAD_TEST_H #define PTHREAD_TEST_H diff --git a/testing/testsuites/kernel/sched/cases/api_pthread_test_001.c b/testing/testsuites/kernel/sched/cases/api_pthread_test_001.c index f7e3dd367a7..2063ed32b13 100644 --- a/testing/testsuites/kernel/sched/cases/api_pthread_test_001.c +++ b/testing/testsuites/kernel/sched/cases/api_pthread_test_001.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/sched/cases/api_pthread_test_001.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/sched/cases/api_pthread_test_002.c b/testing/testsuites/kernel/sched/cases/api_pthread_test_002.c index bc70ca80945..40de8ef936d 100644 --- a/testing/testsuites/kernel/sched/cases/api_pthread_test_002.c +++ b/testing/testsuites/kernel/sched/cases/api_pthread_test_002.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/sched/cases/api_pthread_test_002.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/sched/cases/api_pthread_test_003.c b/testing/testsuites/kernel/sched/cases/api_pthread_test_003.c index 2d4998043d3..ad9c7bff401 100644 --- a/testing/testsuites/kernel/sched/cases/api_pthread_test_003.c +++ b/testing/testsuites/kernel/sched/cases/api_pthread_test_003.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/sched/cases/api_pthread_test_003.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/sched/cases/api_pthread_test_004.c b/testing/testsuites/kernel/sched/cases/api_pthread_test_004.c index 5c37ac9b3a6..625d78467c3 100644 --- a/testing/testsuites/kernel/sched/cases/api_pthread_test_004.c +++ b/testing/testsuites/kernel/sched/cases/api_pthread_test_004.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/sched/cases/api_pthread_test_004.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/sched/cases/api_pthread_test_005.c b/testing/testsuites/kernel/sched/cases/api_pthread_test_005.c index 5dc47df2f7d..2ef86ecab0f 100644 --- a/testing/testsuites/kernel/sched/cases/api_pthread_test_005.c +++ b/testing/testsuites/kernel/sched/cases/api_pthread_test_005.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/sched/cases/api_pthread_test_005.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/sched/cases/api_pthread_test_006.c b/testing/testsuites/kernel/sched/cases/api_pthread_test_006.c index 9a962f5fe0b..f7af6101b33 100644 --- a/testing/testsuites/kernel/sched/cases/api_pthread_test_006.c +++ b/testing/testsuites/kernel/sched/cases/api_pthread_test_006.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/sched/cases/api_pthread_test_006.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/sched/cases/api_pthread_test_007.c b/testing/testsuites/kernel/sched/cases/api_pthread_test_007.c index f26d3e1795a..3a50a5f94db 100644 --- a/testing/testsuites/kernel/sched/cases/api_pthread_test_007.c +++ b/testing/testsuites/kernel/sched/cases/api_pthread_test_007.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/sched/cases/api_pthread_test_007.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/sched/cases/api_pthread_test_008.c b/testing/testsuites/kernel/sched/cases/api_pthread_test_008.c index e180fc8d0bc..72fa7d85f7e 100644 --- a/testing/testsuites/kernel/sched/cases/api_pthread_test_008.c +++ b/testing/testsuites/kernel/sched/cases/api_pthread_test_008.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/sched/cases/api_pthread_test_008.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/sched/cases/api_pthread_test_009.c b/testing/testsuites/kernel/sched/cases/api_pthread_test_009.c index 1885d5dc312..b72281bb88d 100644 --- a/testing/testsuites/kernel/sched/cases/api_pthread_test_009.c +++ b/testing/testsuites/kernel/sched/cases/api_pthread_test_009.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/sched/cases/api_pthread_test_009.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/sched/cases/api_task_test_001.c b/testing/testsuites/kernel/sched/cases/api_task_test_001.c index d2ebc9d1250..bf6969e6714 100644 --- a/testing/testsuites/kernel/sched/cases/api_task_test_001.c +++ b/testing/testsuites/kernel/sched/cases/api_task_test_001.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/sched/cases/api_task_test_001.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/sched/cases/api_task_test_002.c b/testing/testsuites/kernel/sched/cases/api_task_test_002.c index 13242e962c5..5eedc66d010 100644 --- a/testing/testsuites/kernel/sched/cases/api_task_test_002.c +++ b/testing/testsuites/kernel/sched/cases/api_task_test_002.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/sched/cases/api_task_test_002.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/sched/cases/api_task_test_003.c b/testing/testsuites/kernel/sched/cases/api_task_test_003.c index b2dd239bf92..d64fe288a25 100644 --- a/testing/testsuites/kernel/sched/cases/api_task_test_003.c +++ b/testing/testsuites/kernel/sched/cases/api_task_test_003.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/sched/cases/api_task_test_003.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/sched/cases/api_task_test_004.c b/testing/testsuites/kernel/sched/cases/api_task_test_004.c index 915c31477d5..13415bde505 100644 --- a/testing/testsuites/kernel/sched/cases/api_task_test_004.c +++ b/testing/testsuites/kernel/sched/cases/api_task_test_004.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/sched/cases/api_task_test_004.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/sched/cases/api_task_test_005.c b/testing/testsuites/kernel/sched/cases/api_task_test_005.c index 2d46a75ade0..187af109361 100644 --- a/testing/testsuites/kernel/sched/cases/api_task_test_005.c +++ b/testing/testsuites/kernel/sched/cases/api_task_test_005.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/sched/cases/api_task_test_005.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/sched/cases/api_task_test_006.c b/testing/testsuites/kernel/sched/cases/api_task_test_006.c index c0031409c56..844993d381a 100644 --- a/testing/testsuites/kernel/sched/cases/api_task_test_006.c +++ b/testing/testsuites/kernel/sched/cases/api_task_test_006.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/sched/cases/api_task_test_006.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/sched/cases/api_task_test_007.c b/testing/testsuites/kernel/sched/cases/api_task_test_007.c index de279236b12..d4fb7003037 100644 --- a/testing/testsuites/kernel/sched/cases/api_task_test_007.c +++ b/testing/testsuites/kernel/sched/cases/api_task_test_007.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/sched/cases/api_task_test_007.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/sched/cmocka_sched_test.c b/testing/testsuites/kernel/sched/cmocka_sched_test.c index c71569a47bb..4eecf2da1d8 100644 --- a/testing/testsuites/kernel/sched/cmocka_sched_test.c +++ b/testing/testsuites/kernel/sched/cmocka_sched_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/sched/cmocka_sched_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/sched/common/test_sched_common.c b/testing/testsuites/kernel/sched/common/test_sched_common.c index 4495a2a2a76..fd240457945 100644 --- a/testing/testsuites/kernel/sched/common/test_sched_common.c +++ b/testing/testsuites/kernel/sched/common/test_sched_common.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/sched/common/test_sched_common.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/sched/include/SchedTest.h b/testing/testsuites/kernel/sched/include/SchedTest.h index a1070fdabbc..a77857c9a68 100644 --- a/testing/testsuites/kernel/sched/include/SchedTest.h +++ b/testing/testsuites/kernel/sched/include/SchedTest.h @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/sched/include/SchedTest.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ @@ -126,4 +128,4 @@ void test_nuttx_sched_task06(FAR void **state); void test_nuttx_sched_task07(FAR void **state); -#endif \ No newline at end of file +#endif diff --git a/testing/testsuites/kernel/socket/cases/net_socket_test_005.c b/testing/testsuites/kernel/socket/cases/net_socket_test_005.c index 7b9853d05c2..8932e76ca70 100644 --- a/testing/testsuites/kernel/socket/cases/net_socket_test_005.c +++ b/testing/testsuites/kernel/socket/cases/net_socket_test_005.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/socket/cases/net_socket_test_005.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/socket/cases/net_socket_test_006.c b/testing/testsuites/kernel/socket/cases/net_socket_test_006.c index c959e75cd2e..0b106695568 100644 --- a/testing/testsuites/kernel/socket/cases/net_socket_test_006.c +++ b/testing/testsuites/kernel/socket/cases/net_socket_test_006.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/socket/cases/net_socket_test_006.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/socket/cases/net_socket_test_008.c b/testing/testsuites/kernel/socket/cases/net_socket_test_008.c index c3268f78b68..a757a0c5945 100644 --- a/testing/testsuites/kernel/socket/cases/net_socket_test_008.c +++ b/testing/testsuites/kernel/socket/cases/net_socket_test_008.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/socket/cases/net_socket_test_008.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/socket/cases/net_socket_test_009.c b/testing/testsuites/kernel/socket/cases/net_socket_test_009.c index 56ad3ced6a1..b847052196f 100644 --- a/testing/testsuites/kernel/socket/cases/net_socket_test_009.c +++ b/testing/testsuites/kernel/socket/cases/net_socket_test_009.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/socket/cases/net_socket_test_009.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/socket/cases/net_socket_test_010.c b/testing/testsuites/kernel/socket/cases/net_socket_test_010.c index d344709ea90..1f049c4e8ab 100644 --- a/testing/testsuites/kernel/socket/cases/net_socket_test_010.c +++ b/testing/testsuites/kernel/socket/cases/net_socket_test_010.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/socket/cases/net_socket_test_010.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/socket/cases/net_socket_test_011.c b/testing/testsuites/kernel/socket/cases/net_socket_test_011.c index f10c04aaa66..90b13f8b047 100644 --- a/testing/testsuites/kernel/socket/cases/net_socket_test_011.c +++ b/testing/testsuites/kernel/socket/cases/net_socket_test_011.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/socket/cases/net_socket_test_011.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/socket/cmocka_socket_test.c b/testing/testsuites/kernel/socket/cmocka_socket_test.c index 5f694031c91..7b6627272f0 100644 --- a/testing/testsuites/kernel/socket/cmocka_socket_test.c +++ b/testing/testsuites/kernel/socket/cmocka_socket_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/socket/cmocka_socket_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/socket/include/SocketTest.h b/testing/testsuites/kernel/socket/include/SocketTest.h index 56440c3fcfa..47700fed234 100644 --- a/testing/testsuites/kernel/socket/include/SocketTest.h +++ b/testing/testsuites/kernel/socket/include/SocketTest.h @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/socket/include/SocketTest.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/Fstatfs_test.c b/testing/testsuites/kernel/syscall/cases/Fstatfs_test.c index d08113ebea4..3c356db8b53 100644 --- a/testing/testsuites/kernel/syscall/cases/Fstatfs_test.c +++ b/testing/testsuites/kernel/syscall/cases/Fstatfs_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/Fstatfs_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/accept_test.c b/testing/testsuites/kernel/syscall/cases/accept_test.c index 2954a906835..b1d16c17f4d 100644 --- a/testing/testsuites/kernel/syscall/cases/accept_test.c +++ b/testing/testsuites/kernel/syscall/cases/accept_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/accept_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/bind_test.c b/testing/testsuites/kernel/syscall/cases/bind_test.c index e035bf8a1f6..1ae9cf39e42 100644 --- a/testing/testsuites/kernel/syscall/cases/bind_test.c +++ b/testing/testsuites/kernel/syscall/cases/bind_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/bind_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/chdir_test.c b/testing/testsuites/kernel/syscall/cases/chdir_test.c index 73c8d750c36..335f121bd8e 100644 --- a/testing/testsuites/kernel/syscall/cases/chdir_test.c +++ b/testing/testsuites/kernel/syscall/cases/chdir_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/chdir_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/clock_gettime_test.c b/testing/testsuites/kernel/syscall/cases/clock_gettime_test.c index 60495c72b6b..4d2082ca3ad 100644 --- a/testing/testsuites/kernel/syscall/cases/clock_gettime_test.c +++ b/testing/testsuites/kernel/syscall/cases/clock_gettime_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/clock_gettime_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/clock_nanosleep_test.c b/testing/testsuites/kernel/syscall/cases/clock_nanosleep_test.c index f0a45ff6118..6ae37f7daa4 100644 --- a/testing/testsuites/kernel/syscall/cases/clock_nanosleep_test.c +++ b/testing/testsuites/kernel/syscall/cases/clock_nanosleep_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/clock_nanosleep_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/clock_settime_test.c b/testing/testsuites/kernel/syscall/cases/clock_settime_test.c index b819508a852..65b80e513e7 100644 --- a/testing/testsuites/kernel/syscall/cases/clock_settime_test.c +++ b/testing/testsuites/kernel/syscall/cases/clock_settime_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/clock_settime_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/close_test.c b/testing/testsuites/kernel/syscall/cases/close_test.c index 1893d0d681e..1d62f92ecb7 100644 --- a/testing/testsuites/kernel/syscall/cases/close_test.c +++ b/testing/testsuites/kernel/syscall/cases/close_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/close_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/connect_test.c b/testing/testsuites/kernel/syscall/cases/connect_test.c index 9e252b47026..530e9c8fdb5 100644 --- a/testing/testsuites/kernel/syscall/cases/connect_test.c +++ b/testing/testsuites/kernel/syscall/cases/connect_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/connect_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/creat_test.c b/testing/testsuites/kernel/syscall/cases/creat_test.c index ccf0239c0ca..65a7ddcbc78 100644 --- a/testing/testsuites/kernel/syscall/cases/creat_test.c +++ b/testing/testsuites/kernel/syscall/cases/creat_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/creat_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/dup2_test.c b/testing/testsuites/kernel/syscall/cases/dup2_test.c index 7d6a605f80d..4a354463921 100644 --- a/testing/testsuites/kernel/syscall/cases/dup2_test.c +++ b/testing/testsuites/kernel/syscall/cases/dup2_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/dup2_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/dup_test.c b/testing/testsuites/kernel/syscall/cases/dup_test.c index 03fec26e0d4..7197b5713d7 100644 --- a/testing/testsuites/kernel/syscall/cases/dup_test.c +++ b/testing/testsuites/kernel/syscall/cases/dup_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/dup_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/fcntl_test.c b/testing/testsuites/kernel/syscall/cases/fcntl_test.c index a2b97c489f9..0897f65b4c8 100644 --- a/testing/testsuites/kernel/syscall/cases/fcntl_test.c +++ b/testing/testsuites/kernel/syscall/cases/fcntl_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/fcntl_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/fpathconf_test.c b/testing/testsuites/kernel/syscall/cases/fpathconf_test.c index 03ea5b0a17d..8b9f7ea98e1 100644 --- a/testing/testsuites/kernel/syscall/cases/fpathconf_test.c +++ b/testing/testsuites/kernel/syscall/cases/fpathconf_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/fpathconf_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/fsync_test.c b/testing/testsuites/kernel/syscall/cases/fsync_test.c index 1d8cf4fa2ae..0e4ad49af22 100644 --- a/testing/testsuites/kernel/syscall/cases/fsync_test.c +++ b/testing/testsuites/kernel/syscall/cases/fsync_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/fsync_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/ftruncate_test.c b/testing/testsuites/kernel/syscall/cases/ftruncate_test.c index a08799ebf9b..e78ed0e86a1 100644 --- a/testing/testsuites/kernel/syscall/cases/ftruncate_test.c +++ b/testing/testsuites/kernel/syscall/cases/ftruncate_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/ftruncate_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/getTimeofday_test.c b/testing/testsuites/kernel/syscall/cases/getTimeofday_test.c index 992edeba097..7c7cb5c733a 100644 --- a/testing/testsuites/kernel/syscall/cases/getTimeofday_test.c +++ b/testing/testsuites/kernel/syscall/cases/getTimeofday_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/getTimeofday_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/getcwd_test.c b/testing/testsuites/kernel/syscall/cases/getcwd_test.c index 49153b45e36..2422a985fd9 100644 --- a/testing/testsuites/kernel/syscall/cases/getcwd_test.c +++ b/testing/testsuites/kernel/syscall/cases/getcwd_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/getcwd_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/getegid_test.c b/testing/testsuites/kernel/syscall/cases/getegid_test.c index f8f1edb2fc8..909c5b88024 100644 --- a/testing/testsuites/kernel/syscall/cases/getegid_test.c +++ b/testing/testsuites/kernel/syscall/cases/getegid_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/getegid_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/geteuid_test.c b/testing/testsuites/kernel/syscall/cases/geteuid_test.c index 4a561db34ac..bc2cca986a6 100644 --- a/testing/testsuites/kernel/syscall/cases/geteuid_test.c +++ b/testing/testsuites/kernel/syscall/cases/geteuid_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/geteuid_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/getgid_test.c b/testing/testsuites/kernel/syscall/cases/getgid_test.c index 7fafa385495..b7c7cb3c256 100644 --- a/testing/testsuites/kernel/syscall/cases/getgid_test.c +++ b/testing/testsuites/kernel/syscall/cases/getgid_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/getgid_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/gethostname_test.c b/testing/testsuites/kernel/syscall/cases/gethostname_test.c index 4b729c629b1..2e607df5e22 100644 --- a/testing/testsuites/kernel/syscall/cases/gethostname_test.c +++ b/testing/testsuites/kernel/syscall/cases/gethostname_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/gethostname_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/getitimer_test.c b/testing/testsuites/kernel/syscall/cases/getitimer_test.c index 1b43cbcfc5d..0de92ec9274 100644 --- a/testing/testsuites/kernel/syscall/cases/getitimer_test.c +++ b/testing/testsuites/kernel/syscall/cases/getitimer_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/getitimer_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/getpeername_test.c b/testing/testsuites/kernel/syscall/cases/getpeername_test.c index be725e13854..e5c82b6c118 100644 --- a/testing/testsuites/kernel/syscall/cases/getpeername_test.c +++ b/testing/testsuites/kernel/syscall/cases/getpeername_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/getpeername_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/getpid_test.c b/testing/testsuites/kernel/syscall/cases/getpid_test.c index 3dc5915c1de..a1e64725c85 100644 --- a/testing/testsuites/kernel/syscall/cases/getpid_test.c +++ b/testing/testsuites/kernel/syscall/cases/getpid_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/getpid_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/getppid_test.c b/testing/testsuites/kernel/syscall/cases/getppid_test.c index 1f8a91cdaa8..b98c105c023 100644 --- a/testing/testsuites/kernel/syscall/cases/getppid_test.c +++ b/testing/testsuites/kernel/syscall/cases/getppid_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/getppid_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/getsocketopt_test.c b/testing/testsuites/kernel/syscall/cases/getsocketopt_test.c index 4674e61d3f4..5f7898ffb4f 100644 --- a/testing/testsuites/kernel/syscall/cases/getsocketopt_test.c +++ b/testing/testsuites/kernel/syscall/cases/getsocketopt_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/getsocketopt_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/getuid_test.c b/testing/testsuites/kernel/syscall/cases/getuid_test.c index c2ffc1921a0..f8ba385cc4b 100644 --- a/testing/testsuites/kernel/syscall/cases/getuid_test.c +++ b/testing/testsuites/kernel/syscall/cases/getuid_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/getuid_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/listen_test.c b/testing/testsuites/kernel/syscall/cases/listen_test.c index a533b523ade..e8099a2709d 100644 --- a/testing/testsuites/kernel/syscall/cases/listen_test.c +++ b/testing/testsuites/kernel/syscall/cases/listen_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/listen_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/lseek_test.c b/testing/testsuites/kernel/syscall/cases/lseek_test.c index 5116d7126ca..cef521915e7 100644 --- a/testing/testsuites/kernel/syscall/cases/lseek_test.c +++ b/testing/testsuites/kernel/syscall/cases/lseek_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/lseek_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/lstat_test.c b/testing/testsuites/kernel/syscall/cases/lstat_test.c index af25f6a0620..19a71cc946a 100644 --- a/testing/testsuites/kernel/syscall/cases/lstat_test.c +++ b/testing/testsuites/kernel/syscall/cases/lstat_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/lstat_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/memcmp_test.c b/testing/testsuites/kernel/syscall/cases/memcmp_test.c index 65394738be1..3e7e0b81709 100644 --- a/testing/testsuites/kernel/syscall/cases/memcmp_test.c +++ b/testing/testsuites/kernel/syscall/cases/memcmp_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/memcmp_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/memcpy_test.c b/testing/testsuites/kernel/syscall/cases/memcpy_test.c index 0628b4a0e6a..60733646d37 100644 --- a/testing/testsuites/kernel/syscall/cases/memcpy_test.c +++ b/testing/testsuites/kernel/syscall/cases/memcpy_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/memcpy_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/memset_test.c b/testing/testsuites/kernel/syscall/cases/memset_test.c index 9ec1bbf40e9..5a40cea4e7f 100644 --- a/testing/testsuites/kernel/syscall/cases/memset_test.c +++ b/testing/testsuites/kernel/syscall/cases/memset_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/memset_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/mkdir_test.c b/testing/testsuites/kernel/syscall/cases/mkdir_test.c index c908e69a1e7..70b276aa065 100644 --- a/testing/testsuites/kernel/syscall/cases/mkdir_test.c +++ b/testing/testsuites/kernel/syscall/cases/mkdir_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/mkdir_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/nansleep_test.c b/testing/testsuites/kernel/syscall/cases/nansleep_test.c index 44c23403bee..b9f498964cb 100644 --- a/testing/testsuites/kernel/syscall/cases/nansleep_test.c +++ b/testing/testsuites/kernel/syscall/cases/nansleep_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/nansleep_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/pathconf_test.c b/testing/testsuites/kernel/syscall/cases/pathconf_test.c index 3daa089676a..3ca5aaf0790 100644 --- a/testing/testsuites/kernel/syscall/cases/pathconf_test.c +++ b/testing/testsuites/kernel/syscall/cases/pathconf_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/pathconf_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/pipe_test.c b/testing/testsuites/kernel/syscall/cases/pipe_test.c index 0edacef0b30..10b0b47d892 100644 --- a/testing/testsuites/kernel/syscall/cases/pipe_test.c +++ b/testing/testsuites/kernel/syscall/cases/pipe_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/pipe_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/pread_test.c b/testing/testsuites/kernel/syscall/cases/pread_test.c index dfa9bcd6ffc..8877e5b999b 100644 --- a/testing/testsuites/kernel/syscall/cases/pread_test.c +++ b/testing/testsuites/kernel/syscall/cases/pread_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/pread_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/pwrite_test.c b/testing/testsuites/kernel/syscall/cases/pwrite_test.c index 13d452c8905..3c91514f79a 100644 --- a/testing/testsuites/kernel/syscall/cases/pwrite_test.c +++ b/testing/testsuites/kernel/syscall/cases/pwrite_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/pwrite_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/read_test.c b/testing/testsuites/kernel/syscall/cases/read_test.c index 41b12659acc..45af7bba9e7 100644 --- a/testing/testsuites/kernel/syscall/cases/read_test.c +++ b/testing/testsuites/kernel/syscall/cases/read_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/read_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/readdir_test.c b/testing/testsuites/kernel/syscall/cases/readdir_test.c index 09555c2e9be..13d123e62c1 100644 --- a/testing/testsuites/kernel/syscall/cases/readdir_test.c +++ b/testing/testsuites/kernel/syscall/cases/readdir_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/readdir_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/recvfrom_test.c b/testing/testsuites/kernel/syscall/cases/recvfrom_test.c index fb9d5907d3b..b07d24a9999 100644 --- a/testing/testsuites/kernel/syscall/cases/recvfrom_test.c +++ b/testing/testsuites/kernel/syscall/cases/recvfrom_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/recvfrom_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/rmdir_test.c b/testing/testsuites/kernel/syscall/cases/rmdir_test.c index 063e6b63435..8068a22539d 100644 --- a/testing/testsuites/kernel/syscall/cases/rmdir_test.c +++ b/testing/testsuites/kernel/syscall/cases/rmdir_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/rmdir_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/sched_test.c b/testing/testsuites/kernel/syscall/cases/sched_test.c index 9aa5edd62bc..65f227a464a 100644 --- a/testing/testsuites/kernel/syscall/cases/sched_test.c +++ b/testing/testsuites/kernel/syscall/cases/sched_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/sched_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/setsocketopt01_test.c b/testing/testsuites/kernel/syscall/cases/setsocketopt01_test.c index 8e2bb42efc1..b877f6f01d0 100644 --- a/testing/testsuites/kernel/syscall/cases/setsocketopt01_test.c +++ b/testing/testsuites/kernel/syscall/cases/setsocketopt01_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/setsocketopt01_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/socket_test.c b/testing/testsuites/kernel/syscall/cases/socket_test.c index 7bad8a0baea..b6a1bf93065 100644 --- a/testing/testsuites/kernel/syscall/cases/socket_test.c +++ b/testing/testsuites/kernel/syscall/cases/socket_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/socket_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/socketpair_test.c b/testing/testsuites/kernel/syscall/cases/socketpair_test.c index 2b4e6209d69..60021d643d1 100644 --- a/testing/testsuites/kernel/syscall/cases/socketpair_test.c +++ b/testing/testsuites/kernel/syscall/cases/socketpair_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/socketpair_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ @@ -227,4 +229,4 @@ void test_nuttx_syscall_socketpair02(FAR void **state) } #undef UCLINUX -#endif \ No newline at end of file +#endif diff --git a/testing/testsuites/kernel/syscall/cases/symlink_test.c b/testing/testsuites/kernel/syscall/cases/symlink_test.c index 40f653c1f38..a676248e402 100644 --- a/testing/testsuites/kernel/syscall/cases/symlink_test.c +++ b/testing/testsuites/kernel/syscall/cases/symlink_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/symlink_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/time_test.c b/testing/testsuites/kernel/syscall/cases/time_test.c index 9a17d3572e5..a5aea765348 100644 --- a/testing/testsuites/kernel/syscall/cases/time_test.c +++ b/testing/testsuites/kernel/syscall/cases/time_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/time_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/timer_create_test.c b/testing/testsuites/kernel/syscall/cases/timer_create_test.c index ac3bf7abef7..f7d95ea5910 100644 --- a/testing/testsuites/kernel/syscall/cases/timer_create_test.c +++ b/testing/testsuites/kernel/syscall/cases/timer_create_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/timer_create_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/timer_delete_test.c b/testing/testsuites/kernel/syscall/cases/timer_delete_test.c index d8bf5ae1ea1..3d2d7a49dac 100644 --- a/testing/testsuites/kernel/syscall/cases/timer_delete_test.c +++ b/testing/testsuites/kernel/syscall/cases/timer_delete_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/timer_delete_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/timer_gettime_test.c b/testing/testsuites/kernel/syscall/cases/timer_gettime_test.c index 772678956fa..b3829209149 100644 --- a/testing/testsuites/kernel/syscall/cases/timer_gettime_test.c +++ b/testing/testsuites/kernel/syscall/cases/timer_gettime_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/timer_gettime_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/truncate_test.c b/testing/testsuites/kernel/syscall/cases/truncate_test.c index 6589cd51ad3..3162bcfd06e 100644 --- a/testing/testsuites/kernel/syscall/cases/truncate_test.c +++ b/testing/testsuites/kernel/syscall/cases/truncate_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/truncate_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/unlink_test.c b/testing/testsuites/kernel/syscall/cases/unlink_test.c index 78b3e6f579c..f3a7e1697b5 100644 --- a/testing/testsuites/kernel/syscall/cases/unlink_test.c +++ b/testing/testsuites/kernel/syscall/cases/unlink_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/unlink_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cases/write_test.c b/testing/testsuites/kernel/syscall/cases/write_test.c index dcd10cc362d..8b274f66c60 100644 --- a/testing/testsuites/kernel/syscall/cases/write_test.c +++ b/testing/testsuites/kernel/syscall/cases/write_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cases/write_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/cmocka_syscall_test.c b/testing/testsuites/kernel/syscall/cmocka_syscall_test.c index 3fa4c101c9b..e1fceb592ba 100644 --- a/testing/testsuites/kernel/syscall/cmocka_syscall_test.c +++ b/testing/testsuites/kernel/syscall/cmocka_syscall_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/cmocka_syscall_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/syscall/common/test_syscall_common.c b/testing/testsuites/kernel/syscall/common/test_syscall_common.c index def66d1b6fe..5665fb0d701 100644 --- a/testing/testsuites/kernel/syscall/common/test_syscall_common.c +++ b/testing/testsuites/kernel/syscall/common/test_syscall_common.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/common/test_syscall_common.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ @@ -764,4 +766,4 @@ int safe_listen(int socket, int backlog) return rval; } -#endif \ No newline at end of file +#endif diff --git a/testing/testsuites/kernel/syscall/include/SyscallTest.h b/testing/testsuites/kernel/syscall/include/SyscallTest.h index 786aea21a1d..d7e931c3f5e 100644 --- a/testing/testsuites/kernel/syscall/include/SyscallTest.h +++ b/testing/testsuites/kernel/syscall/include/SyscallTest.h @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/syscall/include/SyscallTest.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/time/cases/clock_test_clock01.c b/testing/testsuites/kernel/time/cases/clock_test_clock01.c index a0cedb89166..6443495e2c9 100644 --- a/testing/testsuites/kernel/time/cases/clock_test_clock01.c +++ b/testing/testsuites/kernel/time/cases/clock_test_clock01.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/time/cases/clock_test_clock01.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/time/cases/clock_test_clock02.c b/testing/testsuites/kernel/time/cases/clock_test_clock02.c index ebf35522723..9e2e0c5f0d7 100644 --- a/testing/testsuites/kernel/time/cases/clock_test_clock02.c +++ b/testing/testsuites/kernel/time/cases/clock_test_clock02.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/time/cases/clock_test_clock02.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/time/cases/clock_test_smoke.c b/testing/testsuites/kernel/time/cases/clock_test_smoke.c index 7de690d7237..3b8948958f7 100644 --- a/testing/testsuites/kernel/time/cases/clock_test_smoke.c +++ b/testing/testsuites/kernel/time/cases/clock_test_smoke.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/time/cases/clock_test_smoke.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/time/cases/clock_test_timer01.c b/testing/testsuites/kernel/time/cases/clock_test_timer01.c index 5146db37251..24f59391fd7 100644 --- a/testing/testsuites/kernel/time/cases/clock_test_timer01.c +++ b/testing/testsuites/kernel/time/cases/clock_test_timer01.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/time/cases/clock_test_timer01.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/time/cases/clock_test_timer03.c b/testing/testsuites/kernel/time/cases/clock_test_timer03.c index 54228d4ecb4..7539f4479f6 100644 --- a/testing/testsuites/kernel/time/cases/clock_test_timer03.c +++ b/testing/testsuites/kernel/time/cases/clock_test_timer03.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/time/cases/clock_test_timer03.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/time/cases/clock_test_timer04.c b/testing/testsuites/kernel/time/cases/clock_test_timer04.c index a93202ea949..832c6978408 100644 --- a/testing/testsuites/kernel/time/cases/clock_test_timer04.c +++ b/testing/testsuites/kernel/time/cases/clock_test_timer04.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/time/cases/clock_test_timer04.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/time/cases/clock_test_timer05.c b/testing/testsuites/kernel/time/cases/clock_test_timer05.c index a0754a26cff..c9903c3e36c 100644 --- a/testing/testsuites/kernel/time/cases/clock_test_timer05.c +++ b/testing/testsuites/kernel/time/cases/clock_test_timer05.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/time/cases/clock_test_timer05.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/time/cmocka_time_test.c b/testing/testsuites/kernel/time/cmocka_time_test.c index 4d36dcd76f4..855aa5dba98 100644 --- a/testing/testsuites/kernel/time/cmocka_time_test.c +++ b/testing/testsuites/kernel/time/cmocka_time_test.c @@ -1,20 +1,22 @@ /**************************************************************************** * apps/testing/testsuites/kernel/time/cmocka_time_test.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - *The ASF licenses this file to you under the Apache License, Version 2.0 - *(the "License"); you may not use this file except in compliance with - *the License. You may obtain a copy of the License at + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - *implied. See the License for the specific language governing - *permissions and limitations under the License. + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. * ****************************************************************************/ diff --git a/testing/testsuites/kernel/time/include/TimeTest.h b/testing/testsuites/kernel/time/include/TimeTest.h index 79d25937589..c0d344d1a7f 100644 --- a/testing/testsuites/kernel/time/include/TimeTest.h +++ b/testing/testsuites/kernel/time/include/TimeTest.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/testsuites/kernel/time/include/TimeTest.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/timerjitter/CMakeLists.txt b/testing/timerjitter/CMakeLists.txt index ccfd9f6c334..41a369aa2f0 100644 --- a/testing/timerjitter/CMakeLists.txt +++ b/testing/timerjitter/CMakeLists.txt @@ -1,7 +1,7 @@ # ############################################################################## # apps/testing/timerjitter/CMakeLists.txt # -# Copyright (C) 2024 Xiaomi Corporation +# SPDX-License-Identifier: Apache-2.0 # # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for diff --git a/testing/timerjitter/Make.defs b/testing/timerjitter/Make.defs index 3d4e9a8f0db..f5ee5351890 100644 --- a/testing/timerjitter/Make.defs +++ b/testing/timerjitter/Make.defs @@ -1,7 +1,7 @@ ############################################################################ # apps/testing/timerjitter/Make.defs # -# Copyright (C) 2024 Xiaomi Corporation +# SPDX-License-Identifier: Apache-2.0 # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with diff --git a/testing/timerjitter/Makefile b/testing/timerjitter/Makefile index 99290c1085c..993f06fff7f 100644 --- a/testing/timerjitter/Makefile +++ b/testing/timerjitter/Makefile @@ -1,18 +1,24 @@ +############################################################################ +# apps/testing/timerjitter/Makefile # -# Copyright (C) 2024 Xiaomi Corporation +# SPDX-License-Identifier: Apache-2.0 # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. # +############################################################################ include $(APPDIR)/Make.defs diff --git a/testing/timerjitter/timerjitter.c b/testing/timerjitter/timerjitter.c index 7972f902c97..3e335339127 100644 --- a/testing/timerjitter/timerjitter.c +++ b/testing/timerjitter/timerjitter.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/testing/timerjitter/timerjitter.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The diff --git a/testing/uclibcxx_test/Make.defs b/testing/uclibcxx_test/Make.defs index b87be4f4286..2b995217380 100644 --- a/testing/uclibcxx_test/Make.defs +++ b/testing/uclibcxx_test/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/uclibcxx_test/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/uclibcxx_test/Makefile b/testing/uclibcxx_test/Makefile index 19e87a1c67d..464d7b8fec2 100644 --- a/testing/uclibcxx_test/Makefile +++ b/testing/uclibcxx_test/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/uclibcxx_test/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/unity/CMakeLists.txt b/testing/unity/CMakeLists.txt index d2734897f8a..9aef4189996 100644 --- a/testing/unity/CMakeLists.txt +++ b/testing/unity/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/testing/unity/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/testing/unity/Make.defs b/testing/unity/Make.defs index 283cbe05c3b..84434e4e9c5 100644 --- a/testing/unity/Make.defs +++ b/testing/unity/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/unity/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/unity/Makefile b/testing/unity/Makefile index 88442becd13..f3b45fdc644 100644 --- a/testing/unity/Makefile +++ b/testing/unity/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/unity/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/x86-64-ABI/Make.defs b/testing/x86-64-ABI/Make.defs index c520da71b4a..4c5f32cdd01 100644 --- a/testing/x86-64-ABI/Make.defs +++ b/testing/x86-64-ABI/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/system/uorb/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/testing/x86-64-ABI/Makefile b/testing/x86-64-ABI/Makefile index f844114b0bd..927008f33c8 100644 --- a/testing/x86-64-ABI/Makefile +++ b/testing/x86-64-ABI/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/testing/x86-64-ABI/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The From d921170a028378448b553bc7f30c361f831f70dc Mon Sep 17 00:00:00 2001 From: Alin Jerpelea Date: Sun, 29 Dec 2024 12:41:39 +0100 Subject: [PATCH 110/391] tools: migrate to SPDX identifier Most tools used for compliance and SBOM generation use SPDX identifiers This change brings us a step closer to an easy SBOM generation. Signed-off-by: Alin Jerpelea --- tools/CMakeLists.txt | 2 ++ tools/WASI-SDK.defs | 2 ++ tools/Wasm.mk | 3 ++- tools/Wasm/CMakeLists.txt | 2 ++ tools/Wasm/WASI-SDK.cmake | 2 ++ tools/check-hash.sh | 2 ++ tools/host_sysinfo.py | 21 +++++++++++++++++++++ tools/mkimport.sh | 5 ++++- tools/mkkconfig.sh | 5 ++++- tools/mkromfsimg.sh | 2 ++ tools/mksymtab.sh | 2 ++ tools/parse_sysinfo.py | 21 +++++++++++++++++++++ tools/pre-commit | 22 +++++++++++++++++++++- 13 files changed, 87 insertions(+), 4 deletions(-) diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index c473bdbe029..48204653a41 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/tools/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/tools/WASI-SDK.defs b/tools/WASI-SDK.defs index 1bbb3a6b68d..99e0062e280 100644 --- a/tools/WASI-SDK.defs +++ b/tools/WASI-SDK.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/tools/WASI-SDK.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/tools/Wasm.mk b/tools/Wasm.mk index 28627c115d7..a936a768c3c 100644 --- a/tools/Wasm.mk +++ b/tools/Wasm.mk @@ -1,7 +1,8 @@ - ############################################################################ # apps/tools/Wasm.mk # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/tools/Wasm/CMakeLists.txt b/tools/Wasm/CMakeLists.txt index 6675834577c..ca7fe114c75 100644 --- a/tools/Wasm/CMakeLists.txt +++ b/tools/Wasm/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/tools/Wasm/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/tools/Wasm/WASI-SDK.cmake b/tools/Wasm/WASI-SDK.cmake index 9d06fd99b47..5f5309e3fa8 100644 --- a/tools/Wasm/WASI-SDK.cmake +++ b/tools/Wasm/WASI-SDK.cmake @@ -1,6 +1,8 @@ # ############################################################################## # apps/tools/Wasm/WASI-SDK.cmake # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this diff --git a/tools/check-hash.sh b/tools/check-hash.sh index cdf56bb0550..f20e07d6b79 100755 --- a/tools/check-hash.sh +++ b/tools/check-hash.sh @@ -2,6 +2,8 @@ ############################################################################ # apps/tools/check-hash.sh # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/tools/host_sysinfo.py b/tools/host_sysinfo.py index 3e86cfb3557..4d1948ca39e 100755 --- a/tools/host_sysinfo.py +++ b/tools/host_sysinfo.py @@ -1,4 +1,25 @@ #!/usr/bin/env python3 +############################################################################ +# apps/tools/host_sysinfo.py +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ import argparse import os diff --git a/tools/mkimport.sh b/tools/mkimport.sh index e9e2e766484..c91b6321b6a 100755 --- a/tools/mkimport.sh +++ b/tools/mkimport.sh @@ -1,6 +1,9 @@ #!/usr/bin/env bash +############################################################################ # apps/tools/mkimport.sh # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The @@ -16,7 +19,7 @@ # License for the specific language governing permissions and limitations # under the License. # - +############################################################################ # Get the input parameter list USAGE=" diff --git a/tools/mkkconfig.sh b/tools/mkkconfig.sh index 1577de531ff..15db829d48f 100755 --- a/tools/mkkconfig.sh +++ b/tools/mkkconfig.sh @@ -1,6 +1,9 @@ #!/usr/bin/env bash +############################################################################ # apps/tools/mkkconfig.sh # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The @@ -16,7 +19,7 @@ # License for the specific language governing permissions and limitations # under the License. # - +############################################################################ # Get the input parameter list USAGE="USAGE: mkkconfig.sh [-d] [-h] [-m ] [-o ]" diff --git a/tools/mkromfsimg.sh b/tools/mkromfsimg.sh index 45228a85fe0..8e3ceac6f58 100755 --- a/tools/mkromfsimg.sh +++ b/tools/mkromfsimg.sh @@ -2,6 +2,8 @@ ############################################################################ # apps/tools/mkromfsimg.sh # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/tools/mksymtab.sh b/tools/mksymtab.sh index 400a196ba80..744aa05fe7a 100755 --- a/tools/mksymtab.sh +++ b/tools/mksymtab.sh @@ -2,6 +2,8 @@ ############################################################################ # apps/tools/mksymtab.sh # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/tools/parse_sysinfo.py b/tools/parse_sysinfo.py index 428c1ac095e..59a67c59752 100644 --- a/tools/parse_sysinfo.py +++ b/tools/parse_sysinfo.py @@ -1,4 +1,25 @@ #!/usr/bin/env python3 +############################################################################ +# apps/tools/parse_sysinfo.py +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ import argparse import os diff --git a/tools/pre-commit b/tools/pre-commit index f9210fc7cef..4f5de51c2e1 100755 --- a/tools/pre-commit +++ b/tools/pre-commit @@ -1,5 +1,25 @@ #!/usr/bin/env bash -# tools/pre-commit +############################################################################ +# apps/tools/pre-commit +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ # git hook to run check-patch on the output and stop any commits # that do not pass. Note, only for git-commit, and not for any of the # other scenarios From 94b9c0b1208b7919247c4395b10fa10d3c11c259 Mon Sep 17 00:00:00 2001 From: Alin Jerpelea Date: Sun, 29 Dec 2024 12:33:36 +0100 Subject: [PATCH 111/391] videoutils/x264: migrate license to ASF Xiaomi has submitted the SGA and we can migrate the licenses to ASF Signed-off-by: Alin Jerpelea --- videoutils/x264/CMakeLists.txt | 22 ++++++++++++++-------- videoutils/x264/Make.defs | 24 +++++++++++++++--------- videoutils/x264/Makefile | 24 +++++++++++++++--------- 3 files changed, 44 insertions(+), 26 deletions(-) diff --git a/videoutils/x264/CMakeLists.txt b/videoutils/x264/CMakeLists.txt index 806c402889c..defe984d77e 100644 --- a/videoutils/x264/CMakeLists.txt +++ b/videoutils/x264/CMakeLists.txt @@ -1,18 +1,24 @@ +############################################################################ +# apps/videoutils/x264/CMakeLists.txt # -# Copyright (C) 2024 Xiaomi Corporation +# SPDX-License-Identifier: Apache-2.0 # -# Licensed under the Apache License, Version 2.0 (the "License"); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. # +############################################################################ if(CONFIG_VIDEOUTILS_LIBX264) diff --git a/videoutils/x264/Make.defs b/videoutils/x264/Make.defs index 37cfb3e3d84..5d36825bbbe 100644 --- a/videoutils/x264/Make.defs +++ b/videoutils/x264/Make.defs @@ -1,18 +1,24 @@ +############################################################################ +# apps/videoutils/x264/Make.defs # -# Copyright (C) 2023 Xiaomi Corporation +# SPDX-License-Identifier: Apache-2.0 # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. # +############################################################################ ifneq ($(CONFIG_VIDEOUTILS_LIBX264),) CONFIGURED_APPS += $(APPDIR)/videoutils/x264 diff --git a/videoutils/x264/Makefile b/videoutils/x264/Makefile index 7fe775cc7b9..8faf0771a7f 100644 --- a/videoutils/x264/Makefile +++ b/videoutils/x264/Makefile @@ -1,18 +1,24 @@ +############################################################################ +# apps/videoutils/x264/Makefile # -# Copyright (C) 2023 Xiaomi Corporation +# SPDX-License-Identifier: Apache-2.0 # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. # +############################################################################ ifeq ($(DST_PATH),) include $(APPDIR)/Make.defs From 047f881673bf058612bbaf49a2b4568b181e5a58 Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Wed, 4 Dec 2024 20:10:52 +0800 Subject: [PATCH 112/391] testing/rpmsgdev: Add from tests/testcases Add makefile and format codes ../nuttx/tools/checkpatch.sh -f testdev.c Squashed commits commit 2914f842fb7b30f9819f951638a72af7ccd0857e Author: v-chenglong8 Date: Tue Aug 27 20:26:40 2024 +0800 [new]: init coral sea execution client project Signed-off-by: cuiliang commit e783ef9d33e980a8d67f0732287545ee1dc9654d Author: rongyichang Date: Fri Jun 21 11:48:11 2024 +0800 tests/devrpmsg: fix use after free error Signed-off-by: rongyichang commit d2221fa82a9a30c99bcfc6cff46276505f653a77 Author: songshuangshuang Date: Tue May 14 15:27:02 2024 +0800 [tests]: test case cmake transformation Signed-off-by: songshuangshuang commit 4209ce4a10e34fe37a58df5e2c2e8d1299ef056c Author: liugui Date: Wed Aug 16 20:35:41 2023 +0800 [fix]:resolving the problem of rpmsgdev ioctrl interface test crashing on the audio core Signed-off-by: liugui commit a3ac3c9b9dc5210ebc61897cf79e411ae337d70f Author: litong12 Date: Fri Jul 28 15:06:00 2023 +0800 [fix]: fix poll's bug in rpmsgdev test Signed-off-by: litong12 commit c3085e74b2c356bc805d904259e97126ea55ff7d Author: litong12 Date: Wed Jan 18 11:47:25 2023 +0800 [test]: file_operations add mmap and truncate in rpmsgdev test Signed-off-by: litong12 commit 617623f7c3eb302e2921de17d21235ea4c4e2990 Author: litong12 Date: Tue Nov 8 20:13:29 2022 +0800 [test]: add rpmsgdev testcases Signed-off-by: litong12 Signed-off-by: wangjianyu3 --- testing/rpmsgdev/CMakeLists.txt | 32 ++ testing/rpmsgdev/Kconfig | 3 + testing/rpmsgdev/Make.defs | 23 + testing/rpmsgdev/Makefile | 30 ++ testing/rpmsgdev/testdev.c | 816 ++++++++++++++++++++++++++++++++ 5 files changed, 904 insertions(+) create mode 100644 testing/rpmsgdev/CMakeLists.txt create mode 100644 testing/rpmsgdev/Kconfig create mode 100644 testing/rpmsgdev/Make.defs create mode 100644 testing/rpmsgdev/Makefile create mode 100644 testing/rpmsgdev/testdev.c diff --git a/testing/rpmsgdev/CMakeLists.txt b/testing/rpmsgdev/CMakeLists.txt new file mode 100644 index 00000000000..5dd7009af16 --- /dev/null +++ b/testing/rpmsgdev/CMakeLists.txt @@ -0,0 +1,32 @@ +# ############################################################################## +# apps/testing/rpmsgdev/CMakeLists.txt +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for + +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_RPMSGDEV_TEST) + nuttx_add_application( + NAME + rpmsgdev + PRIORITY + ${CONFIG_TESTING_TESTCASES_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_TESTCASES_STACKSIZE} + SRCS + testdev.c) +endif() diff --git a/testing/rpmsgdev/Kconfig b/testing/rpmsgdev/Kconfig new file mode 100644 index 00000000000..a519b84553e --- /dev/null +++ b/testing/rpmsgdev/Kconfig @@ -0,0 +1,3 @@ +config RPMSGDEV_TEST + bool "Enable rpmsgdev test" + default n diff --git a/testing/rpmsgdev/Make.defs b/testing/rpmsgdev/Make.defs new file mode 100644 index 00000000000..686d1e63975 --- /dev/null +++ b/testing/rpmsgdev/Make.defs @@ -0,0 +1,23 @@ +############################################################################ +# apps/testing/rpmsgdev/Make.defs +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +ifneq ($(CONFIG_RPMSGDEV_TEST),) +CONFIGURED_APPS += $(APPDIR)/testing/rpmsgdev +endif diff --git a/testing/rpmsgdev/Makefile b/testing/rpmsgdev/Makefile new file mode 100644 index 00000000000..771e9ef8545 --- /dev/null +++ b/testing/rpmsgdev/Makefile @@ -0,0 +1,30 @@ +############################################################################ +# apps/testing/rpmsgdev/Makefile +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +include $(APPDIR)/Make.defs + +PROGNAME += testdev +PRIORITY := SCHED_PRIORITY_DEFAULT +STACKSIZE := $(CONFIG_DEFAULT_TASK_STACKSIZE) +MODULE = $(CONFIG_RPMSGDEV_TEST) + +MAINSRC += $(CURDIR)/testdev.c + +include $(APPDIR)/Application.mk diff --git a/testing/rpmsgdev/testdev.c b/testing/rpmsgdev/testdev.c new file mode 100644 index 00000000000..cbd79843eb5 --- /dev/null +++ b/testing/rpmsgdev/testdev.c @@ -0,0 +1,816 @@ +/**************************************************************************** + * apps/testing/rpmsgdev/testdev.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef CONFIG_DEV_RPMSG +#include +#endif + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* set a random open flag to check whether the open api behave correctly */ + +#define OPEN_FLAG O_RDWR +#define RET 114514 +#define OFFSET 1234l +#define WHENCE SEEK_SET +#define IOCTL FIONSPACE +#define IOCTL_ARG 0x55AA +static int hour __attribute__((unused)); + +/**************************************************************************** + * Private Function Prototypes + ****************************************************************************/ + +static int testdev_open(FAR struct file *filep); +static int testdev_close(FAR struct file *filep); +static ssize_t testdev_read(FAR struct file *filep, FAR char *buffer, + size_t buflen); +static ssize_t testdev_write(FAR struct file *filep, FAR const char *buffer, + size_t buflen); +static off_t testdev_seek(FAR struct file *filep, off_t offset, + int whence); +static int testdev_ioctl(FAR struct file *filep, int cmd, + unsigned long arg); +static int testdev_poll(FAR struct file *filep, FAR struct pollfd *fds, + bool setup); + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +static const struct file_operations g_testdev_ops = +{ + .open = testdev_open, /* open */ + .close = testdev_close, /* close */ + .read = testdev_read, /* read */ + .write = testdev_write, /* write */ + .seek = testdev_seek, /* seek */ + .ioctl = testdev_ioctl, /* ioctl */ + .poll = testdev_poll /* poll */ +#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS + , + .unlink = NULL /* unlink */ +#endif +}; + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +static int testdev_open(FAR struct file *filep) +{ + if (filep->f_oflags == (OPEN_FLAG | O_NONBLOCK)) + { + filep->f_pos = 0; + syslog(LOG_INFO, "test open success\n"); + return 0; + } + + syslog(LOG_INFO, "test open fail, %d\n", filep->f_oflags); + return -RET; +} + +static int testdev_close(FAR struct file *filep) +{ + if (filep->f_oflags == (OPEN_FLAG | O_NONBLOCK)) + { + syslog(LOG_INFO, "test close success\n"); + return 0; + } + + syslog(LOG_INFO, "test close fail, %d\n", filep->f_oflags); + return -1; +} + +static ssize_t testdev_read(FAR struct file *filep, FAR char *buffer, + size_t buflen) +{ + size_t i; + + for (i = 0; i < buflen; i++) + { + buffer[i] = 'r'; + } + + syslog(LOG_INFO, "test read success\n"); + return buflen; +} + +static ssize_t testdev_write(FAR struct file *filep, FAR const char *buffer, + size_t buflen) +{ + struct timeval tv; + size_t i; + + for (i = 0; i < buflen; i++) + { + if (buffer[i] != 'w') + { + syslog(LOG_INFO, "test write fail\n"); + return -1; + } + } + + tv.tv_usec = buflen; + tv.tv_sec = 0; + select(0, NULL, NULL, NULL, &tv); + syslog(LOG_INFO, "test write success\n"); + return buflen; +} + +static off_t testdev_seek(FAR struct file *filep, off_t offset, int whence) +{ + if (offset != OFFSET || whence != WHENCE) + { + syslog(LOG_ERR, "test seek fail, offset %ld(except %ld), " + "whence %d(except %d)\n", (long)offset, OFFSET, whence, WHENCE); + return -1; + } + + syslog(LOG_INFO, "test seek success, offset %ld\n", (long)offset); + filep->f_pos = offset; + return offset; +} + +static int testdev_ioctl(FAR struct file *filep, int cmd, unsigned long arg) +{ + int ret = -1; + + switch (cmd) + { + case DIOC_SETKEY: + if (arg != 0) + { + syslog(LOG_ERR, "!!!!!!!!!!!!!!!!!! " + "should not print this log " + "!!!!!!!!!!!!!!!!!!!!!\n"); + ret = -1; + } + break; + case IOCTL: + if (arg == 0) + { + syslog(LOG_ERR, "test ioctl fail, cmd %d(except %d), " + "whence 0(expect not 0)\n", cmd, IOCTL); + ret = -1; + } + else + { + if (*(int *)arg == IOCTL_ARG) + { + ret = RET; + } + else + { + syslog(LOG_ERR, "test ioctl fail, cmd %d(except %d), " + "whence %d(expect %d)\n", + cmd, IOCTL, *(int *)arg, IOCTL_ARG); + ret = -1; + } + } + break; + default: + break; + } + + syslog(LOG_INFO, "test ioctl success\n"); + return ret; +} + +static int testdev_poll(FAR struct file *filep, FAR struct pollfd *fds, + bool setup) +{ + if (!setup) + { + syslog(LOG_INFO, "test poll teardown\n"); + return 0; + } + + syslog(LOG_INFO, "test poll, events %lu\n", (unsigned long)fds->events); + poll_notify(&fds, 1, fds->events); + syslog(LOG_INFO, "test poll notify\n"); + return 0; +} + +static void _register_driver(int mode, char *cpu, char *remotepath, + char *localpath) +{ + int ret; + + switch (mode) + { + case 0: + if (remotepath == NULL) + { + syslog(LOG_ERR, "please set -r\n"); + exit(1); + } + + ret = register_driver(remotepath, &g_testdev_ops, 0666, NULL); + break; +#ifdef CONFIG_DEV_RPMSG + case 1: + if (cpu == NULL || remotepath == NULL || localpath == NULL) + { + syslog(LOG_ERR, "please set -c, -r, -l\n"); + exit(1); + } + + ret = rpmsgdev_register(cpu, remotepath, localpath, 0); + break; +#endif + default: + syslog(LOG_ERR, "-r must between 0 and 1\n"); + exit(1); + break; + } + + if (ret < 0) + { + syslog(LOG_ERR, "register driver failed, ret=%d, errno=%d\n", + ret, errno); + exit(1); + } + + syslog(LOG_INFO, "register driver success\n"); +} + +#ifdef CONFIG_DEV_RPMSG +static int test_open(char *path, int flags) +{ + int fd; + + fd = open(path, flags); + if (fd <= 0) + { + syslog(LOG_ERR, "open %s fail, ret %d, errno %d\n", path, fd, errno); + return -1; + } + + return fd; +} + +static int test_close(int fd) +{ + int ret; + + ret = close(fd); + if (ret < 0) + { + syslog(LOG_ERR, "close fail, ret %d, errno %d\n", ret, errno); + } + + syslog(LOG_INFO, "close success, ret %d\n", ret); + return ret; +} + +static int test_read(int fd, size_t len) +{ + ssize_t rd = 0; + ssize_t ret; + char *buf; + + buf = malloc(len); + if (buf == NULL) + { + syslog(LOG_ERR, "read malloc fail\n"); + return -1; + } + + while (rd < len) + { + ret = read(fd, buf + rd, len - rd); + rd += ret; + if (ret <= 0) + { + break; + } + } + + if (rd != len) + { + syslog(LOG_ERR, "read fail, len %zd, except %zu, errno %d\n", + rd, len, errno); + free(buf); + return -1; + } + + for (ret = 0; ret < len; ret++) + { + if (buf[ret] != 'r') + { + syslog(LOG_ERR, "check data error, ret %d, except 'a'", buf[ret]); + free(buf); + return -1; + } + } + + free(buf); + return 0; +} + +static int test_write(int fd, size_t len) +{ + ssize_t wt = 0; + ssize_t ret; + char *buf; + + buf = malloc(len); + if (buf == NULL) + { + syslog(LOG_ERR, "read malloc fail\n"); + return -1; + } + + for (ret = 0; ret < len; ret++) + { + buf[ret] = 'w'; + } + + while (wt < len) + { + ret = write(fd, buf + wt, len - wt); + wt += ret; + if (ret <= 0) + { + break; + } + } + + if (wt != len) + { + free(buf); + syslog(LOG_ERR, "write fail, len %zd, except %zu, errno %d\n", + wt, len, errno); + return -1; + } + + free(buf); + return 0; +} + +static off_t test_seek(int fd, off_t offset, int whence) +{ + off_t ret; + + ret = lseek(fd, offset, whence); + if (ret == -1) + { + syslog(LOG_ERR, "seek fail, errno %d\n", errno); + } + + syslog(LOG_INFO, "test seek return %ld\n", (long)ret); + return ret; +} + +static int test_ioctl(int fd, unsigned long request, unsigned long arg) +{ + int ret; + + ret = ioctl(fd, request, arg); + if (ret == -1) + { + syslog(LOG_ERR, "ioctl fail, errno %d\n", errno); + } + + syslog(LOG_INFO, "test ioctl return %d\n", ret); + return ret; +} + +static int test_poll(int fd, int event, int timeout) +{ + struct pollfd pfd; + int ret; + + memset(&pfd, 0, sizeof(struct pollfd)); + + pfd.fd = fd; + pfd.events = event; + + ret = poll(&pfd, 1, timeout); + if (ret < 0) + { + syslog(LOG_ERR, "fd %d poll failure: %d\n", fd, errno); + return -1; + } + + return ret; +} + +/* open fail -> open success -> read 100 bytes -> close */ + +static int testcase_1(char *path) +{ + size_t len = 100; + int fd; + + fd = open(path, O_RDONLY); + if (fd != -1 || errno != RET) + { + syslog(LOG_ERR, "open test fail, fs %d (expect -1), " + "errno %d (expect %d)\n", fd, errno, RET); + return -1; + } + + if ((fd = test_open(path, OPEN_FLAG)) <= 0) + { + return -1; + } + + if (test_read(fd, len) != 0) + { + return -1; + } + + return test_close(fd); +} + +/* open -> write 100 bytes -> close */ + +static int testcase_2(char *path) +{ + size_t len = 100; + int fd; + + if ((fd = test_open(path, OPEN_FLAG)) <= 0) + { + return -1; + } + + if (test_write(fd, len) != 0) + { + return -1; + } + + return test_close(fd); +} + +/* open -> seek fail -> seek success -> close */ + +static int testcase_3(char *path) +{ + int fd; + + if ((fd = test_open(path, OPEN_FLAG)) <= 0) + { + return -1; + } + + if (test_seek(fd, 123, SEEK_SET) != -1) + { + return -1; + } + + syslog(LOG_INFO, "seek1 success\n"); + + if (test_seek(fd, OFFSET, WHENCE) != OFFSET) + { + return -1; + } + + syslog(LOG_INFO, "seek2 success\n"); + return test_close(fd); +} + +/* open -> ioctl fail -> ioctl success -> close */ + +static int testcase_4(char *path) +{ + int args = 0; + int fd; + + if ((fd = test_open(path, OPEN_FLAG)) <= 0) + { + return -1; + } + + /* cmd not in rpmsgdev_ioctl_arglen */ + + if (test_ioctl(fd, DIOC_SETKEY, IOCTL_ARG) != -1) + { + return -1; + } + + syslog(LOG_INFO, "ioctl0 success\n"); + + if (test_ioctl(fd, IOCTL, (unsigned long)&args) != -1) + { + return -1; + } + + syslog(LOG_INFO, "ioctl1 success\n"); + + args = IOCTL_ARG; + if (test_ioctl(fd, IOCTL, (unsigned long)&args) != RET) + { + return -1; + } + + syslog(LOG_INFO, "ioctl2 success\n"); + return test_close(fd); +} + +/* open -> poll -> close */ + +static int testcase_5(char *path) +{ + int ret; + int fd; + + if ((fd = test_open(path, OPEN_FLAG)) <= 0) + { + return -1; + } + + /* TODO : change poll notify in the threaad */ + + ret = test_poll(fd, POLLIN, 200); + if (ret != 1) + { + syslog(LOG_ERR, "poll test1 fail, ret %d, expect 0\n", ret); + return -1; + } + + syslog(LOG_INFO, "poll1 success\n"); + + ret = test_poll(fd, POLLIN, 2000); + if (ret != 1) + { + syslog(LOG_ERR, "poll test2 fail, ret %d, expect 1\n", ret); + return -1; + } + + syslog(LOG_INFO, "poll2 success\n"); + + ret = test_poll(fd, POLLOUT, 0); + if (ret != 1) + { + syslog(LOG_ERR, "poll test3 fail, ret %d, expect 1\n", ret); + return -1; + } + + syslog(LOG_INFO, "poll3 success\n"); + return test_close(fd); +} + +/* open -> read 20000 bytes -> close */ + +static int testcase_6(char *path) +{ + size_t len = 20000; + int fd; + + if ((fd = test_open(path, OPEN_FLAG | O_NONBLOCK)) <= 0) + { + return -1; + } + + if (test_read(fd, len) != 0) + { + return -1; + } + + return test_close(fd); +} + +/* open -> write 20000 bytes -> close */ + +static int testcase_7(char *path) +{ + size_t len = 20000; + int fd; + + if ((fd = test_open(path, OPEN_FLAG | O_NONBLOCK)) <= 0) + { + return -1; + } + + if (test_write(fd, len) != 0) + { + return -1; + } + + return test_close(fd); +} + +/* open -> write 10000 bytes -> read 10000 bytes -> .... -> close */ + +static int testcase_8(char *path) +{ + size_t len = 10000; + int cnt = 0; + struct timeval t; + time_t start; + time_t finish; + int fd; + + if ((fd = test_open(path, OPEN_FLAG | O_NONBLOCK)) <= 0) + { + return -1; + } + + gettimeofday(&t, NULL); + start = t.tv_sec; + finish = t.tv_sec; + + while ((finish - start) < hour * 3600) + { + cnt++; + gettimeofday(&t, NULL); + finish = t.tv_sec; + + if (test_write(fd, len) != 0) + { + close(fd); + return -1; + } + + if (test_read(fd, len) != 0) + { + close(fd); + return -1; + } + + if (cnt % 50000) + { + cnt = 0; + syslog(LOG_INFO, "[%s] time start: %ld finish: %ld now: %ld\n", + path, (long)start, (long)(start + hour * 3600), + (long)finish); + } + } + + return test_close(fd); +} +#endif + +static void show_usage(void) +{ + syslog(LOG_WARNING, + "Usage: CMD [-d ] [-c ] " + "[-l ] [-r ] [-h ] [-t ]\n" + "\t\t-d: regist driver, 0 for test driver, 1 for rpmsgdev\n" + "\t\t-c: remote cpu which regists test driver\n" + "\t\t-l: localpath, which means rpmsgdev's name\n" + "\t\t-r: remotepath, which means test driver's name\n" + "\t\t-h: set stability test hours\n" + "\t\t-t: set testcases\n" + "\t\t\t 1 for open fail -> open success -> read 100 bytes -> " + "close\n" + "\t\t\t 2 for open -> write 100 bytes -> close\n" + "\t\t\t 3 for open -> seek fail -> seek success -> close\n" + "\t\t\t 4 for open -> ioctl fail -> ioctl success -> close\n" + "\t\t\t 5 for open -> poll -> close\n" + "\t\t\t 6 for open -> write 20000 bytes -> close\n" + "\t\t\t 7 for open -> read 20000 bytes -> close\n" + "\t\t\t 8 read write stability test\n"); + + exit(1); +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +int main(int argc, char *argv[]) +{ + int o; + int mode = -1; + char *cpu = NULL; + char *remotepath = NULL; + char *localpath = NULL; + int test __attribute__((unused)) = -1; + int ret __attribute__((unused)); + + if (argc <= 1) + { + show_usage(); + } + + hour = 1; + + while ((o = getopt(argc, argv, "d:c:l:r:t:h:")) != EOF) + { + switch (o) + { + case 'd': + mode = atoi(optarg); + break; + case 'c': + cpu = optarg; + break; + case 'l': + localpath = optarg; + break; + case 'r': + remotepath = optarg; + break; + case 't': + test = atoi(optarg); + break; + case 'h': + hour = atoi(optarg); + break; + default: + show_usage(); + break; + } + } + + if (mode >= 0) + { + _register_driver(mode, cpu, remotepath, localpath); + } + +#ifdef CONFIG_DEV_RPMSG + if (test >= 0) + { + if (localpath == NULL) + { + syslog(LOG_ERR, "please set -l\n"); + exit(1); + } + + switch (test) + { + case 1: + ret = testcase_1(localpath); + break; + case 2: + ret = testcase_2(localpath); + break; + case 3: + ret = testcase_3(localpath); + break; + case 4: + ret = testcase_4(localpath); + break; + case 5: + ret = testcase_5(localpath); + break; + case 6: + ret = testcase_6(localpath); + break; + case 7: + ret = testcase_7(localpath); + break; + case 8: + ret = testcase_8(localpath); + break; + default: + syslog(LOG_ERR, "-t out of range\n"); + exit(1); + break; + } + + if (ret == 0) + { + syslog(LOG_INFO, "TEST PASS\n"); + } + else + { + syslog(LOG_INFO, "TEST FAIL, expect 0 (ret %d)\n", ret); + } + } +#endif + + return 0; +} From 366865723bf36b7dfeb8c261bc9296b4d2cd04d9 Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Thu, 13 Jun 2024 19:22:22 +0800 Subject: [PATCH 113/391] testing/rpmsgdev: Add option for rpmsgdev_export() And fix errors for other platform Test Server (NuttX) testdev -d 0 -r "/dev/testrpmsgdev" testdev -d 2 -c "CLIENT" -l "/dev/testrpmsgdev" Client (Other) testdev -l /dev/testrpmsgdev -t 1 testdev -l /dev/testrpmsgdev -t 2 testdev -l /dev/testrpmsgdev -t 3 testdev -l /dev/testrpmsgdev -t 5 testdev -l /dev/testrpmsgdev -t 6 testdev -l /dev/testrpmsgdev -t 7 testdev -l /dev/testrpmsgdev -t 8 Signed-off-by: wangjianyu3 --- testing/rpmsgdev/CMakeLists.txt | 6 +-- testing/rpmsgdev/testdev.c | 65 ++++++++++++++++++++++++++------- 2 files changed, 54 insertions(+), 17 deletions(-) diff --git a/testing/rpmsgdev/CMakeLists.txt b/testing/rpmsgdev/CMakeLists.txt index 5dd7009af16..1f6dcb0d1eb 100644 --- a/testing/rpmsgdev/CMakeLists.txt +++ b/testing/rpmsgdev/CMakeLists.txt @@ -22,11 +22,11 @@ if(CONFIG_RPMSGDEV_TEST) nuttx_add_application( NAME - rpmsgdev + testdev PRIORITY - ${CONFIG_TESTING_TESTCASES_PRIORITY} + ${SCHED_PRIORITY_DEFAULT} STACKSIZE - ${CONFIG_TESTING_TESTCASES_STACKSIZE} + ${CONFIG_DEFAULT_TASK_STACKSIZE} SRCS testdev.c) endif() diff --git a/testing/rpmsgdev/testdev.c b/testing/rpmsgdev/testdev.c index cbd79843eb5..f370c4302a3 100644 --- a/testing/rpmsgdev/testdev.c +++ b/testing/rpmsgdev/testdev.c @@ -22,8 +22,6 @@ * Included Files ****************************************************************************/ -#include -#include #include #include #include @@ -32,12 +30,13 @@ #include #include #include +#include #include #include #include #include #include -#ifdef CONFIG_DEV_RPMSG +#if defined(__NuttX__) && (defined(CONFIG_DEV_RPMSG) || defined(CONFIG_DEV_RPMSG_SERVER)) #include #endif @@ -45,20 +44,27 @@ * Pre-processor Definitions ****************************************************************************/ +#ifdef __ANDROID__ +#define syslog(l,...) printf(__VA_ARGS__) +#endif + /* set a random open flag to check whether the open api behave correctly */ #define OPEN_FLAG O_RDWR -#define RET 114514 +#define RET ENOENT #define OFFSET 1234l #define WHENCE SEEK_SET +#ifdef __NuttX__ #define IOCTL FIONSPACE #define IOCTL_ARG 0x55AA +#endif static int hour __attribute__((unused)); /**************************************************************************** * Private Function Prototypes ****************************************************************************/ +#ifdef __NuttX__ static int testdev_open(FAR struct file *filep); static int testdev_close(FAR struct file *filep); static ssize_t testdev_read(FAR struct file *filep, FAR char *buffer, @@ -97,7 +103,8 @@ static const struct file_operations g_testdev_ops = static int testdev_open(FAR struct file *filep) { - if (filep->f_oflags == (OPEN_FLAG | O_NONBLOCK)) + if ((filep->f_oflags & (OPEN_FLAG | O_NONBLOCK)) == + (OPEN_FLAG | O_NONBLOCK)) { filep->f_pos = 0; syslog(LOG_INFO, "test open success\n"); @@ -110,7 +117,8 @@ static int testdev_open(FAR struct file *filep) static int testdev_close(FAR struct file *filep) { - if (filep->f_oflags == (OPEN_FLAG | O_NONBLOCK)) + if ((filep->f_oflags & (OPEN_FLAG | O_NONBLOCK)) == + (OPEN_FLAG | O_NONBLOCK)) { syslog(LOG_INFO, "test close success\n"); return 0; @@ -233,7 +241,7 @@ static int testdev_poll(FAR struct file *filep, FAR struct pollfd *fds, static void _register_driver(int mode, char *cpu, char *remotepath, char *localpath) { - int ret; + int ret = -EINVAL; switch (mode) { @@ -257,8 +265,21 @@ static void _register_driver(int mode, char *cpu, char *remotepath, ret = rpmsgdev_register(cpu, remotepath, localpath, 0); break; #endif + case 2: +#ifdef CONFIG_DEV_RPMSG_SERVER + if (cpu == NULL || localpath == NULL) + { + syslog(LOG_ERR, "please set -c, -l\n"); + exit(1); + } + + ret = rpmsgdev_export(cpu, localpath); +#else + syslog(LOG_WARNING, "feature of case %d not enabled\n", mode); +#endif + break; default: - syslog(LOG_ERR, "-r must between 0 and 1\n"); + syslog(LOG_ERR, "-d must between 0 and 2\n"); exit(1); break; } @@ -272,8 +293,9 @@ static void _register_driver(int mode, char *cpu, char *remotepath, syslog(LOG_INFO, "register driver success\n"); } +#endif -#ifdef CONFIG_DEV_RPMSG +#if defined(CONFIG_DEV_RPMSG) || defined(TEST_RPMSGDEV) static int test_open(char *path, int flags) { int fd; @@ -337,7 +359,8 @@ static int test_read(int fd, size_t len) { if (buf[ret] != 'r') { - syslog(LOG_ERR, "check data error, ret %d, except 'a'", buf[ret]); + syslog(LOG_ERR, "check data error, ret[%d] %d, except 'r'\n", + ret, buf[ret]); free(buf); return -1; } @@ -401,6 +424,7 @@ static off_t test_seek(int fd, off_t offset, int whence) return ret; } +#ifdef __NuttX__ static int test_ioctl(int fd, unsigned long request, unsigned long arg) { int ret; @@ -414,6 +438,7 @@ static int test_ioctl(int fd, unsigned long request, unsigned long arg) syslog(LOG_INFO, "test ioctl return %d\n", ret); return ret; } +#endif static int test_poll(int fd, int event, int timeout) { @@ -445,7 +470,7 @@ static int testcase_1(char *path) fd = open(path, O_RDONLY); if (fd != -1 || errno != RET) { - syslog(LOG_ERR, "open test fail, fs %d (expect -1), " + syslog(LOG_ERR, "open test fail, fd %d (expect -1), " "errno %d (expect %d)\n", fd, errno, RET); return -1; } @@ -510,6 +535,7 @@ static int testcase_3(char *path) return test_close(fd); } +#ifdef __NuttX__ /* open -> ioctl fail -> ioctl success -> close */ static int testcase_4(char *path) @@ -547,6 +573,7 @@ static int testcase_4(char *path) syslog(LOG_INFO, "ioctl2 success\n"); return test_close(fd); } +#endif /* open -> poll -> close */ @@ -565,7 +592,7 @@ static int testcase_5(char *path) ret = test_poll(fd, POLLIN, 200); if (ret != 1) { - syslog(LOG_ERR, "poll test1 fail, ret %d, expect 0\n", ret); + syslog(LOG_ERR, "poll test1 fail, ret %d, expect 1\n", ret); return -1; } @@ -580,6 +607,7 @@ static int testcase_5(char *path) syslog(LOG_INFO, "poll2 success\n"); +#if 0 ret = test_poll(fd, POLLOUT, 0); if (ret != 1) { @@ -588,6 +616,8 @@ static int testcase_5(char *path) } syslog(LOG_INFO, "poll3 success\n"); +#endif + return test_close(fd); } @@ -687,7 +717,10 @@ static void show_usage(void) syslog(LOG_WARNING, "Usage: CMD [-d ] [-c ] " "[-l ] [-r ] [-h ] [-t ]\n" - "\t\t-d: regist driver, 0 for test driver, 1 for rpmsgdev\n" + "\t\t-d: regist driver\n" + "\t\t\t 0 for test driver\n" + "\t\t\t 1 for rpmsgdev(client register)\n" + "\t\t\t 2 for rpmsgdev(server export)\n" "\t\t-c: remote cpu which regists test driver\n" "\t\t-l: localpath, which means rpmsgdev's name\n" "\t\t-r: remotepath, which means test driver's name\n" @@ -757,10 +790,12 @@ int main(int argc, char *argv[]) if (mode >= 0) { +#ifdef __NuttX__ _register_driver(mode, cpu, remotepath, localpath); +#endif } -#ifdef CONFIG_DEV_RPMSG +#if defined(CONFIG_DEV_RPMSG) || defined(TEST_RPMSGDEV) if (test >= 0) { if (localpath == NULL) @@ -780,9 +815,11 @@ int main(int argc, char *argv[]) case 3: ret = testcase_3(localpath); break; +#ifdef __NuttX__ case 4: ret = testcase_4(localpath); break; +#endif case 5: ret = testcase_5(localpath); break; From d404b846f984e5a452cdd9de56a92f4a9fca04a0 Mon Sep 17 00:00:00 2001 From: zhangshoukui Date: Tue, 31 Dec 2024 14:48:22 +0800 Subject: [PATCH 114/391] examples: Add depends on Signed-off-by: zhangshoukui --- examples/adxl372_test/Kconfig | 1 + examples/apa102/Kconfig | 1 + examples/battery/Kconfig | 1 + examples/bmi160/Kconfig | 2 ++ examples/camera/Kconfig | 1 + examples/chrono/Kconfig | 1 + examples/dhtxx/Kconfig | 1 + examples/hdc1008_demo/Kconfig | 1 + examples/hidkbd/Kconfig | 1 + examples/ina219/Kconfig | 1 + examples/ina226/Kconfig | 1 + examples/isl29023/Kconfig | 1 + examples/lp503x/Kconfig | 1 + examples/lsm330spi_test/Kconfig | 1 + examples/pca9635/Kconfig | 1 + examples/powerled/Kconfig | 2 ++ examples/powerled/powerled_main.c | 15 -------- examples/powermonitor/Kconfig | 1 + examples/rfid_readuid/Kconfig | 1 + examples/rfid_readuid/rfid_readuid.c | 5 --- examples/slcd/Kconfig | 1 + examples/smps/Kconfig | 2 ++ examples/smps/smps_main.c | 11 ------ examples/ws2812/Kconfig | 1 + examples/xbc_test/Kconfig | 2 ++ examples/xbc_test/xbc_test_main.c | 52 +++++++++++++--------------- 26 files changed, 51 insertions(+), 58 deletions(-) diff --git a/examples/adxl372_test/Kconfig b/examples/adxl372_test/Kconfig index 9f04a579712..80189ea34e2 100644 --- a/examples/adxl372_test/Kconfig +++ b/examples/adxl372_test/Kconfig @@ -6,6 +6,7 @@ config EXAMPLES_ADXL372_TEST tristate "ADXL372 test program" default n + depends on SENSORS_ADXL372 ---help--- Enable the ADXL372 sensor SPI test program. diff --git a/examples/apa102/Kconfig b/examples/apa102/Kconfig index 9494a744653..6a896cf8344 100644 --- a/examples/apa102/Kconfig +++ b/examples/apa102/Kconfig @@ -6,6 +6,7 @@ config EXAMPLES_APA102 tristate "APA102 LED Strip example" default n + depends on LCD_APA102 ---help--- Enable the APA102 example diff --git a/examples/battery/Kconfig b/examples/battery/Kconfig index 3e532d3e657..c96e2ec0734 100644 --- a/examples/battery/Kconfig +++ b/examples/battery/Kconfig @@ -6,6 +6,7 @@ config EXAMPLES_BATTERY tristate "Battery monitor example" default n + depends on BATTERY_CHARGER || BATTERY_GAUGE || BATTERY_MONITOR ---help--- Enable the battery monitor example diff --git a/examples/bmi160/Kconfig b/examples/bmi160/Kconfig index a850a588743..f97b18f44f3 100644 --- a/examples/bmi160/Kconfig +++ b/examples/bmi160/Kconfig @@ -6,6 +6,7 @@ config EXAMPLES_SIXAXIS bool "BMI160 sensor example" default n + depends on SENSORS_BMG160 ---help--- Enable the 6 axis sensor example @@ -14,6 +15,7 @@ if EXAMPLES_SIXAXIS config EXAMPLES_SIXAXIS_UORB bool "BMI160 sensor uorb example" default n + depends on SENSORS_BMI160_UORB ---help--- Enables Work with the UORB or Character Device interface. If not set, the Character Device is used by default. diff --git a/examples/camera/Kconfig b/examples/camera/Kconfig index ab9532f478c..4c29ed08291 100644 --- a/examples/camera/Kconfig +++ b/examples/camera/Kconfig @@ -6,6 +6,7 @@ config EXAMPLES_CAMERA tristate "Camera example" default n + depends on DRIVERS_VIDEO ---help--- Enable the camera example diff --git a/examples/chrono/Kconfig b/examples/chrono/Kconfig index 26c02ee445e..866bc660ab0 100644 --- a/examples/chrono/Kconfig +++ b/examples/chrono/Kconfig @@ -6,6 +6,7 @@ config EXAMPLES_CHRONO tristate "Chronometer example to use with STM32LDiscover" default n + depends on SLCD ---help--- Enable the Chronometer example diff --git a/examples/dhtxx/Kconfig b/examples/dhtxx/Kconfig index 7489520a22c..f664637f47f 100644 --- a/examples/dhtxx/Kconfig +++ b/examples/dhtxx/Kconfig @@ -6,6 +6,7 @@ config EXAMPLES_DHTXX tristate "Dhtxx sensor example" default n + depends on SENSORS_DHTXX ---help--- Enable the dhtxx sensor example diff --git a/examples/hdc1008_demo/Kconfig b/examples/hdc1008_demo/Kconfig index a52b254f41b..f2348260686 100644 --- a/examples/hdc1008_demo/Kconfig +++ b/examples/hdc1008_demo/Kconfig @@ -6,6 +6,7 @@ config EXAMPLES_HDC1008 tristate "HDC1008 driver example" default n + depends on SENSORS_HDC1008 ---help--- Enable the example application diff --git a/examples/hidkbd/Kconfig b/examples/hidkbd/Kconfig index 0046c36bd5f..c80d4094372 100644 --- a/examples/hidkbd/Kconfig +++ b/examples/hidkbd/Kconfig @@ -6,6 +6,7 @@ config EXAMPLES_HIDKBD tristate "USB HID keyboard example" default n + depends on USBHOST_HIDKBD ---help--- Enable the USB HID keyboard example diff --git a/examples/ina219/Kconfig b/examples/ina219/Kconfig index c5fd8605920..bdb3a256117 100644 --- a/examples/ina219/Kconfig +++ b/examples/ina219/Kconfig @@ -6,6 +6,7 @@ config EXAMPLES_INA219 tristate "INA219 example" default n + depends on SENSORS_INA219 ---help--- Enable the INA219 example diff --git a/examples/ina226/Kconfig b/examples/ina226/Kconfig index 289b30b5be6..55e24b0e84f 100644 --- a/examples/ina226/Kconfig +++ b/examples/ina226/Kconfig @@ -6,6 +6,7 @@ config EXAMPLES_INA226 tristate "INA226 example" default n + depends on SENSORS_INA226 ---help--- Enable the INA226 example diff --git a/examples/isl29023/Kconfig b/examples/isl29023/Kconfig index 3999d8f3355..001570c0869 100644 --- a/examples/isl29023/Kconfig +++ b/examples/isl29023/Kconfig @@ -6,6 +6,7 @@ config EXAMPLES_ISL29023 tristate "ISL29023 driver example" default n + depends on SENSORS_ISL29023 ---help--- Enable the example application diff --git a/examples/lp503x/Kconfig b/examples/lp503x/Kconfig index e2ce1cf1d2e..394105d470e 100644 --- a/examples/lp503x/Kconfig +++ b/examples/lp503x/Kconfig @@ -6,6 +6,7 @@ config EXAMPLES_LP503X tristate "LP503X PWM LED example" default n + depends on LP503X ---help--- Enable the LP503X example diff --git a/examples/lsm330spi_test/Kconfig b/examples/lsm330spi_test/Kconfig index 5f5efee8df2..a245ba02a67 100644 --- a/examples/lsm330spi_test/Kconfig +++ b/examples/lsm330spi_test/Kconfig @@ -6,6 +6,7 @@ config EXAMPLES_LSM330SPI_TEST tristate "LSM330 SPI test program" default n + depends on SENSORS_LSM330SPI ---help--- Enable the LSM330 sensor SPI test program. diff --git a/examples/pca9635/Kconfig b/examples/pca9635/Kconfig index b406017a5ff..631420d785d 100644 --- a/examples/pca9635/Kconfig +++ b/examples/pca9635/Kconfig @@ -6,6 +6,7 @@ config EXAMPLES_PCA9635 tristate "PCA9635 PWM LED example" default n + depends on PCA9635PW ---help--- Enable the PCA9635 example diff --git a/examples/powerled/Kconfig b/examples/powerled/Kconfig index f3056adb0b7..f625d0da441 100644 --- a/examples/powerled/Kconfig +++ b/examples/powerled/Kconfig @@ -6,6 +6,8 @@ config EXAMPLES_POWERLED tristate "Powerled example" default n + depends on DRIVERS_POWERLED + depends on LIBC_FLOATINGPOINT ---help--- Enable the powerled driver example diff --git a/examples/powerled/powerled_main.c b/examples/powerled/powerled_main.c index 4df021b4b1c..d2eda170785 100644 --- a/examples/powerled/powerled_main.c +++ b/examples/powerled/powerled_main.c @@ -42,24 +42,10 @@ #include -#if defined(CONFIG_EXAMPLES_POWERLED) - -#ifndef CONFIG_DRIVERS_POWERLED -# error "Powerled example requires powerled support" -#endif - /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ -#ifndef CONFIG_EXAMPLES_POWERLED_CURRENT_LIMIT -# error "LED current limit must be set!" -#endif - -#ifndef CONFIG_LIBC_FLOATINGPOINT -# error "CONFIG_LIBC_FLOATINGPOINT must be set!" -#endif - #define DEMO_CONT_BRIGHTNESS_MAX 100.0 #define DEMO_CONT_BRIGHTNESS_MIN 0.0 #define DEMO_CONT_BRIGHTNESS_STEP 10.0 @@ -778,4 +764,3 @@ int main(int argc, char *argv[]) return 0; } -#endif /* CONFIG_EXAMPLE_POWERLED */ diff --git a/examples/powermonitor/Kconfig b/examples/powermonitor/Kconfig index e483247c055..05abcb52374 100644 --- a/examples/powermonitor/Kconfig +++ b/examples/powermonitor/Kconfig @@ -6,6 +6,7 @@ config EXAMPLES_POWERMONITOR tristate "LTC4151 powermonitor example" default n + depends on SENSORS_LTC4151 if EXAMPLES_POWERMONITOR endif # EXAMPLES_POWERMONITOR diff --git a/examples/rfid_readuid/Kconfig b/examples/rfid_readuid/Kconfig index e117062b9bf..1c08ba6ccae 100644 --- a/examples/rfid_readuid/Kconfig +++ b/examples/rfid_readuid/Kconfig @@ -6,6 +6,7 @@ config EXAMPLES_RFID_READUID tristate "RFID Read UID example" default n + depends on CL_MFRC522 ---help--- Enable the RFID READUID example diff --git a/examples/rfid_readuid/rfid_readuid.c b/examples/rfid_readuid/rfid_readuid.c index d97c058daf2..0f1521d3e4c 100644 --- a/examples/rfid_readuid/rfid_readuid.c +++ b/examples/rfid_readuid/rfid_readuid.c @@ -37,15 +37,10 @@ * Pre-processor Definitions ****************************************************************************/ -#ifndef CONFIG_CL_MFRC522 -# error "CONFIG_CL_MFRC522 is not defined in the configuration" -#endif - #ifndef CONFIG_EXAMPLES_RFID_READUID_DEVNAME # define CONFIG_EXAMPLES_RFID_READUID_DEVNAME "/dev/rfid0" #endif - /**************************************************************************** * Public Functions ****************************************************************************/ diff --git a/examples/slcd/Kconfig b/examples/slcd/Kconfig index 98b25c5da9d..c55478b33b2 100644 --- a/examples/slcd/Kconfig +++ b/examples/slcd/Kconfig @@ -6,6 +6,7 @@ config EXAMPLES_SLCD tristate "Segment LCD test" default n + depends on SLCD ---help--- Enables a simple test of an alphanumer, segment LCD diff --git a/examples/smps/Kconfig b/examples/smps/Kconfig index 2d45b0ebd52..a89936405a3 100644 --- a/examples/smps/Kconfig +++ b/examples/smps/Kconfig @@ -5,6 +5,8 @@ config EXAMPLES_SMPS tristate "Smps example" + depends on DRIVERS_SMPS + depends on LIBC_FLOATINGPOINT if EXAMPLES_SMPS diff --git a/examples/smps/smps_main.c b/examples/smps/smps_main.c index 99433155887..5c12651ef52 100644 --- a/examples/smps/smps_main.c +++ b/examples/smps/smps_main.c @@ -42,20 +42,10 @@ #include #include -#if defined(CONFIG_EXAMPLES_SMPS) - -#ifndef CONFIG_DRIVERS_SMPS -# error "Smps example requires smps support" -#endif - /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ -#ifndef CONFIG_LIBC_FLOATINGPOINT -# error "CONFIG_LIBC_FLOATINGPOINT must be set!" -#endif - #ifndef CONFIG_EXAMPLES_SMPS_TIME_DEFAULT # define CONFIG_EXAMPLES_SMPS_TIME_DEFAULT 10 #endif @@ -637,4 +627,3 @@ int main(int argc, char *argv[]) return 0; } -#endif /* CONFIG_EXAMPLE_SMPS */ diff --git a/examples/ws2812/Kconfig b/examples/ws2812/Kconfig index c01fb20f21c..67e6248b9de 100644 --- a/examples/ws2812/Kconfig +++ b/examples/ws2812/Kconfig @@ -6,6 +6,7 @@ config EXAMPLES_WS2812 tristate "ws2812 Demo Program" default n + depends on WS2812 ---help--- Enable the ws2812 demo diff --git a/examples/xbc_test/Kconfig b/examples/xbc_test/Kconfig index 99f99f7e419..d7b3d572ae6 100644 --- a/examples/xbc_test/Kconfig +++ b/examples/xbc_test/Kconfig @@ -6,6 +6,8 @@ config EXAMPLES_XBC_TEST tristate "XBox Controller Test example" default n + depends on USBHOST + depends on !USBHOST_INT_DISABLE ---help--- Enable the XBox Controller Test example diff --git a/examples/xbc_test/xbc_test_main.c b/examples/xbc_test/xbc_test_main.c index 691747e069d..28096c60606 100644 --- a/examples/xbc_test/xbc_test_main.c +++ b/examples/xbc_test/xbc_test_main.c @@ -53,17 +53,6 @@ /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ -/* Configuration ************************************************************/ - -/* Sanity checking */ - -#ifndef CONFIG_USBHOST -# error "CONFIG_USBHOST is not defined" -#endif - -#ifdef CONFIG_USBHOST_INT_DISABLE -# error "Interrupt endpoints are disabled (CONFIG_USBHOST_INT_DISABLE)" -#endif /* Provide some default values for other configuration settings */ @@ -89,7 +78,7 @@ int main(int argc, FAR char *argv[]) * controller test. */ - for (;;) + for (; ; ) { /* Open the controller device. Loop until the device is successfully * opened. @@ -122,24 +111,33 @@ int main(int argc, FAR char *argv[]) { /* On success, echo the buffer to stdout */ - printf("%d bytes read\n", nbytes); - if (nbytes == sizeof(struct xbox_controller_buttonstate_s)) - { - struct xbox_controller_buttonstate_s *rpt = (struct xbox_controller_buttonstate_s*)buffer; - printf("guide: %d sync: %d start: %d back: %d a: %d b: %d x: %d y: %d\n", - rpt->guide, rpt->sync, rpt->start, rpt->back, rpt->a, rpt->b, rpt->x, rpt->y); - printf("dpad_u: %d d: %d l: %d r: %d bump_l: %d r: %d stick_l: %d r: %d\n", - rpt->dpad_up, rpt->dpad_down, rpt->dpad_left, rpt->dpad_right, - rpt->bumper_left, rpt->bumper_right, rpt->stick_click_left, rpt->stick_click_right); - printf("stick_left_x: %d y: %d right_x: %d y: %d trigger_l: %d r: %d\n", - rpt->stick_left_x, rpt->stick_left_y, rpt->stick_right_x, rpt->stick_right_y, - rpt->trigger_left, rpt->trigger_right); - } - } + printf("%zd bytes read\n", nbytes); + if (nbytes == sizeof(struct xbox_controller_buttonstate_s)) + { + struct xbox_controller_buttonstate_s *rpt = + (FAR struct xbox_controller_buttonstate_s *)buffer; + printf("guide: %d sync: %d start: %d back: %d + a: %d b: %d x: %d y: %d\n", + rpt->guide, rpt->sync, rpt->start, + rpt->back, rpt->a, rpt->b, rpt->x, rpt->y); + printf("dpad_u: %d d: %d l: %d r: %d bump_l: %d + r: %d stick_l: %d r: %d\n", + rpt->dpad_up, rpt->dpad_down, rpt->dpad_left, + rpt->dpad_right, rpt->bumper_left, + rpt->bumper_right, rpt->stick_click_left, + rpt->stick_click_right); + printf("stick_left_x: %d y: %d right_x: %d y: %d + trigger_l: %d r: %d\n", + rpt->stick_left_x, rpt->stick_left_y, + rpt->stick_right_x, rpt->stick_right_y, + rpt->trigger_left, rpt->trigger_right); + } + } } while (nbytes > 0); - printf("Closing device %s: %d\n", CONFIG_EXAMPLES_XBC_DEVNAME, (int)nbytes); + printf("Closing device %s: %zd\n", CONFIG_EXAMPLES_XBC_DEVNAME, + nbytes); fflush(stdout); close(fd); break; From 2cfbdbb4015aeec4a4579891d85bd09e4cdc5b78 Mon Sep 17 00:00:00 2001 From: zhangshoukui Date: Thu, 2 Jan 2025 16:45:21 +0800 Subject: [PATCH 115/391] driver test: add depends on Signed-off-by: zhangshoukui --- testing/irtest/Kconfig | 1 + testing/pcitest/Kconfig | 1 + testing/sensortest/Kconfig | 1 + testing/testsuites/Kconfig | 1 + 4 files changed, 4 insertions(+) diff --git a/testing/irtest/Kconfig b/testing/irtest/Kconfig index 12bb586fda1..01e23d368ae 100644 --- a/testing/irtest/Kconfig +++ b/testing/irtest/Kconfig @@ -6,6 +6,7 @@ config TESTING_IRTEST tristate "IR driver test" default n + depends on DRIVERS_RC ---help--- Enable the IR driver test diff --git a/testing/pcitest/Kconfig b/testing/pcitest/Kconfig index 6d6b03f678d..2ae78ec05b6 100644 --- a/testing/pcitest/Kconfig +++ b/testing/pcitest/Kconfig @@ -6,6 +6,7 @@ config TESTING_PCITEST tristate "\"pcitest tools\"" default n + depends on PCI_EP_TEST ---help--- Enable the \"pcitest tools\" diff --git a/testing/sensortest/Kconfig b/testing/sensortest/Kconfig index 01f9242913d..7344ebe2e41 100644 --- a/testing/sensortest/Kconfig +++ b/testing/sensortest/Kconfig @@ -6,6 +6,7 @@ config TESTING_SENSORTEST tristate "Sensor driver test" default n + depends on SENSORS ---help--- Enable the Sensor driver test diff --git a/testing/testsuites/Kconfig b/testing/testsuites/Kconfig index d95596b8d4f..a6b6928ccfc 100644 --- a/testing/testsuites/Kconfig +++ b/testing/testsuites/Kconfig @@ -38,6 +38,7 @@ config CM_MM_TEST config CM_TIME_TEST bool "enbale time test" + depends on !DISABLE_POSIX_TIMERS default n config CM_PTHREAD_TEST From c29a75bbfb67066a49990d5d18fe4d3003089d08 Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Mon, 6 Jan 2025 14:47:26 +0800 Subject: [PATCH 116/391] testing/rpmsgdev: Replace space with tab for Kconfig Signed-off-by: wangjianyu3 --- testing/rpmsgdev/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testing/rpmsgdev/Kconfig b/testing/rpmsgdev/Kconfig index a519b84553e..2f4cea0c887 100644 --- a/testing/rpmsgdev/Kconfig +++ b/testing/rpmsgdev/Kconfig @@ -1,3 +1,3 @@ config RPMSGDEV_TEST - bool "Enable rpmsgdev test" - default n + bool "Enable rpmsgdev test" + default n From a61fd58f8ecf7578f47db68c2f9a3fc868eff90e Mon Sep 17 00:00:00 2001 From: Tiago Medicci Date: Mon, 6 Jan 2025 14:56:41 -0300 Subject: [PATCH 117/391] interpreters/python: Enable Python's socket module Enables the Python's socket module. This allows applications to be built to interact with POSIX-compatible sockets, which is supported by NuttX. --- interpreters/python/Setup.local | 1 - interpreters/python/config.site | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/interpreters/python/Setup.local b/interpreters/python/Setup.local index beca9d6663a..5ff7cd3fa48 100644 --- a/interpreters/python/Setup.local +++ b/interpreters/python/Setup.local @@ -28,7 +28,6 @@ _sha2 _sha2 _sha3 _sha3 -_socket _sqlite3 _ssl _statistics diff --git a/interpreters/python/config.site b/interpreters/python/config.site index c99b73e5644..28313d75e7e 100644 --- a/interpreters/python/config.site +++ b/interpreters/python/config.site @@ -19,4 +19,6 @@ export ac_cv_func_fork="yes" export ac_cv_func_waitpid="yes" export ac_cv_func_pipe="yes" export ac_cv_enable_strict_prototypes_warning="no" +export ac_cv_func_getnameinfo="yes" +export ac_cv_func_poll="yes" export MODULE_BUILDTYPE="static" From edf44c881b6a390f8c2bcd62aac8adb176429558 Mon Sep 17 00:00:00 2001 From: wangmingrong1 Date: Tue, 7 Jan 2025 11:52:09 +0800 Subject: [PATCH 118/391] mtetest: add thread to control mte test separately After thread A holds the semaphore, it first accesses it safely. After releasing it, thread B closes MTE for unsafe access. After accessing, it switches back to thread A for unsafe access. At this time, an error should be reported. log: Process 1 holding lock Process 2 holding lock Process 1 holding lock again default_fatal_handler: (IFSC/DFSC) for Data/Instruction aborts: synchronous tag check fault arm64_exception_handler: CurrentEL: MODE_EL1 arm64_exception_handler: ESR_ELn: 0x96000011 arm64_exception_handler: FAR_ELn: 0xf00000040441700 arm64_exception_handler: ELR_ELn: 0x402ee5f4 print_ec_cause: DABT (current EL) print_ec_cause: Data Abort taken without a change in Exception level Signed-off-by: wangmingrong1 --- testing/mtetest/Kconfig | 8 +++ testing/mtetest/Makefile | 2 +- testing/mtetest/mtetest.c | 122 ++++++++++++++++++++++++++++++++++++-- 3 files changed, 126 insertions(+), 6 deletions(-) diff --git a/testing/mtetest/Kconfig b/testing/mtetest/Kconfig index e4574d58149..d00f5ac4f7a 100644 --- a/testing/mtetest/Kconfig +++ b/testing/mtetest/Kconfig @@ -9,3 +9,11 @@ config TESTING_MTE default n ---help--- Enable MTE instruction set test + +if TESTING_MTE + +config TESTING_MTE_PRIORITY + int "Task priority" + default 101 + +endif diff --git a/testing/mtetest/Makefile b/testing/mtetest/Makefile index 9d9a3239f97..73599309f3d 100644 --- a/testing/mtetest/Makefile +++ b/testing/mtetest/Makefile @@ -24,7 +24,7 @@ include $(APPDIR)/Make.defs MAINSRC = mtetest.c PROGNAME = mtetest -PRIORITY = $(CONFIG_TESTING_KASAN_PRIORITY) +PRIORITY = $(CONFIG_TESTING_MTE_PRIORITY) STACKSIZE = $(CONFIG_DEFAULT_TASK_STACKSIZE) include $(APPDIR)/Application.mk diff --git a/testing/mtetest/mtetest.c b/testing/mtetest/mtetest.c index 351c38b220e..ac2f0bf1a8f 100644 --- a/testing/mtetest/mtetest.c +++ b/testing/mtetest/mtetest.c @@ -27,25 +27,42 @@ #include #include +#include + +#include #include #include -#include -#include #include -#include +#include +#include /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ +/* Must be a multiple of sixteen */ #define MTETEST_BUFFER_LEN 512 +#define SCTLR_TCF1_BIT (1ul << 40) + +/**************************************************************************** + * Private Type + ****************************************************************************/ + struct mte_test_s { FAR const char *name; FAR void (*func)(void); }; +struct args_s +{ + char *buffer; + size_t safe_len; + size_t len; + sem_t sem; +}; + /**************************************************************************** * Private Function Prototypes ****************************************************************************/ @@ -55,6 +72,7 @@ static void mtetest2(void); static void mtetest3(void); static void mtetest4(void); static void mtetest5(void); +static void switch_mtetest(void); /**************************************************************************** * Private Data @@ -71,6 +89,7 @@ static const struct mte_test_s g_mtetest[] = { "mtetest3", mtetest3 }, { "mtetest4", mtetest4 }, { "mtetest5", mtetest5 }, + { "Thread switch MTE test", switch_mtetest }, { NULL, NULL } }; @@ -95,7 +114,7 @@ static const struct mte_test_s g_mtetest[] = * tagged. ****************************************************************************/ -static void __attribute__((noinline)) tagset(void *p, size_t size) +static void tagset(const void *p, size_t size) { size_t i; for (i = 0; i < size; i += 16) @@ -123,7 +142,7 @@ static void __attribute__((noinline)) tagset(void *p, size_t size) * correct memory tagging and access. ****************************************************************************/ -static void __attribute__((noinline)) tagcheck(void *p, size_t size) +static void tagcheck(const void *p, size_t size) { size_t i; void *c; @@ -135,6 +154,15 @@ static void __attribute__((noinline)) tagcheck(void *p, size_t size) } } +/* Disable the mte function */ + +static void disable_mte(void) +{ + uint64_t val = read_sysreg(sctlr_el1); + val &= ~SCTLR_TCF1_BIT; + write_sysreg(val, sctlr_el1); +} + /**************************************************************************** * Name: mtetest1 * @@ -316,6 +344,90 @@ static void mtetest5(void) assert(1 == *(p1 + 16)); } +/* The first entry gets the semaphore for safe access, + * and the next switch back to unsafe access + */ + +static void *process1(void *arg) +{ + struct args_s *args = (struct args_s *)arg; + int i; + + while (1) + { + sem_wait(&args->sem); + printf("Process 1 holding lock\n"); + + for (i = 0; i < args->safe_len; i++) + { + args->buffer[i]++; + } + + sem_post(&args->sem); + sleep(1); + printf("Process 1 holding lock again\n"); + for (i = 0; i < args->len; i++) + { + args->buffer[i]++; + } + + sem_post(&args->sem); + } + + return NULL; +} + +/* Disable unsafe access to MTE functions */ + +static void *process2(void *arg) +{ + struct args_s *args = (struct args_s *)arg; + int i; + + while (1) + { + sem_wait(&args->sem); + + printf("Process 2 holding lock\n"); + disable_mte(); + + for (i = 0; i < args->len; i++) + { + args->buffer[i]++; + } + + sem_post(&args->sem); + sleep(1); + } + + return NULL; +} + +static void switch_mtetest(void) +{ + struct args_s args; + pthread_t t1; + pthread_t t2; + + sem_init(&args.sem, 1, 1); + + asm("irg %0,%1,%2" : "=r"(args.buffer) : "r"(g_buffer), "r"(1l)); + assert(args.buffer != g_buffer); + + args.safe_len = sizeof(g_buffer) / 2; + args.len = sizeof(g_buffer); + + tagset(args.buffer, args.safe_len); + + pthread_create(&t1, NULL, process1, &args); + pthread_create(&t2, NULL, process2, &args); + + pthread_join(t1, NULL); + pthread_join(t2, NULL); + + sem_destroy(&args.sem); +} + static void spawn_test_process(const struct mte_test_s *test) { char *args[3]; From b73adbe56bed8eeca63c73a95e15d199537b7010 Mon Sep 17 00:00:00 2001 From: jialuxiao Date: Tue, 24 Dec 2024 12:20:22 +0800 Subject: [PATCH 119/391] testing/monkey: add running-minutes parameter Signed-off-by: jialuxiao --- testing/monkey/monkey_main.c | 37 +++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/testing/monkey/monkey_main.c b/testing/monkey/monkey_main.c index d9b61a21732..1ee6945deff 100644 --- a/testing/monkey/monkey_main.c +++ b/testing/monkey/monkey_main.c @@ -91,6 +91,8 @@ # define MONKEY_SCREEN_GETVIDEOINFO LCDDEVIO_GETVIDEOINFO #endif +#define MONKEY_RUNNING_MINUTES_MAX (UINT32_MAX / 60 / 1000) + #define MONKEY_SCREEN_HOR_RES_DEFAULT 480 #define MONKEY_SCREEN_VER_RES_DEFAULT 480 @@ -137,6 +139,7 @@ struct monkey_param_s int btn_bit; int log_level; struct monkey_event_config_s event[MONKEY_EVENT_LAST]; + uint32_t running_minutes; }; enum monkey_wait_res_e @@ -170,7 +173,8 @@ static void show_usage(FAR const char *progname, int exitcode) " --duration-click " " --duration-longpress " " --duration-drag \n" - " --screen-offset \n", + " --screen-offset \n" + " --running-minutes \n", progname); printf("\nWhere:\n"); @@ -200,6 +204,7 @@ static void show_usage(FAR const char *progname, int exitcode) "-.\n"); printf(" --screen-offset Screen offset: " ",\n"); + printf(" --running-minutes Running minutes.\n"); exit(exitcode); } @@ -304,6 +309,8 @@ static FAR struct monkey_s *monkey_init( config.event[i].duration_max); } + MONKEY_LOG_NOTICE("Running minutes: %" PRIu32, param->running_minutes); + if (MONKEY_IS_UINPUT_TYPE(param->dev_type_mask)) { if (param->file_path) @@ -377,6 +384,17 @@ static void parse_long_commandline(int argc, FAR char **argv, ","); break; + case 7: + OPTARG_TO_VALUE(param->running_minutes, uint32_t, 10); + + if (param->running_minutes > MONKEY_RUNNING_MINUTES_MAX) + { + MONKEY_LOG_WARN("Running minutes must be less than %d", + MONKEY_RUNNING_MINUTES_MAX); + param->running_minutes = MONKEY_RUNNING_MINUTES_MAX; + } + break; + default: MONKEY_LOG_WARN("Unknown longindex: %d", longindex); show_usage(argv[0], EXIT_FAILURE); @@ -403,6 +421,7 @@ static void parse_commandline(int argc, FAR char **argv, {"duration-longpress", required_argument, NULL, 0 }, {"duration-drag", required_argument, NULL, 0 }, {"screen-offset", required_argument, NULL, 0 }, + {"running-minutes", required_argument, NULL, 0 }, {0, 0, NULL, 0 } }; @@ -545,6 +564,7 @@ int main(int argc, FAR char *argv[]) { struct monkey_param_s param; FAR struct monkey_s *monkey; + uint32_t start_tick; parse_commandline(argc, argv, ¶m); monkey = monkey_init(¶m); @@ -554,11 +574,26 @@ int main(int argc, FAR char *argv[]) return ERROR; } + start_tick = monkey_tick_get(); + while (1) { enum monkey_wait_res_e res; int sleep_ms; + if (param.running_minutes > 0) + { + uint32_t elaps = monkey_tick_elaps(monkey_tick_get(), start_tick); + + if (elaps > param.running_minutes * 60 * 1000) + { + MONKEY_LOG_WARN("Running time is over: %" PRIu32 + " minutes, exit...", + param.running_minutes); + break; + } + } + sleep_ms = monkey_update(monkey); if (sleep_ms < 0) From da615bf5a6eafca8ab3af101c8f1d139d2257d4a Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Tue, 7 Jan 2025 20:25:19 +0900 Subject: [PATCH 120/391] examples/pipe/interlock_test.c: fix the uses of uninitialized variables found by clang warnings. --- examples/pipe/interlock_test.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/examples/pipe/interlock_test.c b/examples/pipe/interlock_test.c index 7d614e78af2..6be9b6ec405 100644 --- a/examples/pipe/interlock_test.c +++ b/examples/pipe/interlock_test.c @@ -155,7 +155,7 @@ int interlock_test(void) void *value; char data[16]; ssize_t nbytes; - int fd; + int fd = -1; int ret; /* Create a FIFO */ @@ -208,7 +208,7 @@ int interlock_test(void) fprintf(stderr, \ "interlock_test: read failed, errno=%d\n", errno); ret = 4; - goto errout_with_file; + goto errout_with_null_writer_thread; } else if (ret != 0) { @@ -216,7 +216,7 @@ int interlock_test(void) "interlock_test: Read %ld bytes of data -- aborting: %d\n", (long)nbytes, errno); ret = 5; - goto errout_with_file; + goto errout_with_null_writer_thread; } printf("interlock_test: read returned\n"); @@ -229,6 +229,8 @@ int interlock_test(void) fprintf(stderr, "interlock_test: close failed: %d\n", errno); } + fd = -1; + /* Wait for null_writer thread to complete */ printf("interlock_test: Waiting for null_writer thread\n"); @@ -290,7 +292,7 @@ int interlock_test(void) fprintf(stderr, \ "interlock_test: write failed, errno=%d\n", errno); ret = 10; - goto errout_with_file; + goto errout_with_null_reader_thread; } else if (ret != 0) { @@ -298,7 +300,7 @@ int interlock_test(void) "interlock_test: Wrote %ld bytes of data -- aborting: %d\n", (long)nbytes, errno); ret = 11; - goto errout_with_file; + goto errout_with_null_reader_thread; } printf("interlock_test: write returned\n"); @@ -311,6 +313,8 @@ int interlock_test(void) fprintf(stderr, "interlock_test: close failed: %d\n", errno); } + fd = -1; + /* Wait for null_reader thread to complete */ printf("interlock_test: Waiting for null_reader thread\n"); @@ -335,12 +339,6 @@ int interlock_test(void) ret = 0; goto errout_with_fifo; -errout_with_file: - if (close(fd) != 0) - { - fprintf(stderr, "interlock_test: close failed: %d\n", errno); - } - errout_with_null_reader_thread: pthread_detach(readerid); pthread_cancel(readerid); @@ -351,6 +349,11 @@ int interlock_test(void) errout_with_fifo: + if (fd != -1 && close(fd) != 0) + { + fprintf(stderr, "interlock_test: close failed: %d\n", errno); + } + ret = remove(FIFO_PATH2); if (ret != 0) { From 6c7bc3c788417fc50f7146be291036506bab36ae Mon Sep 17 00:00:00 2001 From: Eren Terzioglu Date: Mon, 30 Dec 2024 09:41:28 +0100 Subject: [PATCH 121/391] apps/nxdiag: Update nxdiag app due to script place changes Nxdiag app build scripts updated due to changes to make diagnostic tools independent from nxdiag app. Change aims that nxdiag app does not a reqirement to fetch system information. --- system/nxdiag/Makefile | 41 +- tools/host_sysinfo.py | 896 ----------------------------------------- tools/parse_sysinfo.py | 156 ------- 3 files changed, 4 insertions(+), 1089 deletions(-) delete mode 100755 tools/host_sysinfo.py delete mode 100644 tools/parse_sysinfo.py diff --git a/system/nxdiag/Makefile b/system/nxdiag/Makefile index 2e971a46d21..9bac8980829 100644 --- a/system/nxdiag/Makefile +++ b/system/nxdiag/Makefile @@ -22,7 +22,7 @@ include $(APPDIR)/Make.defs -NXTOOLSDIR = $(APPDIR)$(DELIM)tools +NXTOOLSDIR = $(realpath $(TOPDIR))$(DELIM)tools NXDIAGDIR = $(APPDIR)$(DELIM)system$(DELIM)nxdiag # Sysinfo application info @@ -68,41 +68,8 @@ endif # Espressif ifeq ($(CONFIG_SYSTEM_NXDIAG_ESPRESSIF),y) - -ARCH_ESP_HALDIR = $(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)chip$(DELIM)esp-hal-3rdparty - -# If the esp-hal-3rdparty directory is not in the arch directory, then it can be -# cloned to the nxdiag directory for debugging purposes. -HALDIR := $(shell \ - if [ -f $(ARCH_ESP_HALDIR)$(DELIM).git$(DELIM)index ]; then \ - echo "$(ARCH_ESP_HALDIR)"; \ - else \ - echo "$(NXDIAGDIR)$(DELIM)esp-hal-3rdparty"; \ - fi \ -) - -INFO_DEPS += espressif_prepare - -espressif_prepare: -ifeq ($(HALDIR),$(ARCH_ESP_HALDIR)) - @echo "Unshallowing Espressif HAL..." - (cd ${HALDIR} && git fetch && git fetch --tags) -endif - -ifdef ESPTOOL_BINDIR -NXDIAG_FLAGS += --espressif "$(ESPTOOL_BINDIR)" "$(HALDIR)" -else -NXDIAG_FLAGS += --espressif "$(TOPDIR)" "$(HALDIR)" -endif - -ifeq ($(CONFIG_SYSTEM_NXDIAG_ESPRESSIF_CHIP),y) -ifneq ($(CONFIG_SYSTEM_NXDIAG_ESPRESSIF_CHIP_WO_TOOL),y) -NXDIAG_FLAGS += --espressif_chip -else -NXDIAG_FLAGS += --espressif_chip_runtime -endif -endif - +NXDIAG_FLAGS += "--target_info" +PY_FLAGS += "-B" endif # Common build @@ -117,7 +84,7 @@ checkpython3: fi sysinfo.h : checkpython3 $(INFO_DEPS) - @python3 $(NXTOOLSDIR)$(DELIM)host_sysinfo.py $(NXDIAG_FLAGS) > sysinfo.h + @python3 $(PY_FLAGS) $(NXTOOLSDIR)$(DELIM)host_info_dump.py $(NXDIAG_FLAGS) > sysinfo.h if ([ $$? -ne 0 ]); then \ echo "ERROR: Failed to generate sysinfo.h"; \ exit 1; \ diff --git a/tools/host_sysinfo.py b/tools/host_sysinfo.py deleted file mode 100755 index 4d1948ca39e..00000000000 --- a/tools/host_sysinfo.py +++ /dev/null @@ -1,896 +0,0 @@ -#!/usr/bin/env python3 -############################################################################ -# apps/tools/host_sysinfo.py -# -# SPDX-License-Identifier: Apache-2.0 -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. The -# ASF licenses this file to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance with the -# License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -# -############################################################################ - -import argparse -import os -import platform -import re -import subprocess -import sys - -# Custom argparse actions # - - -class validate_flags_arg(argparse.Action): - """ - Custom argparse action to validate the number of parameters passed to the - --flags argument. Exactly three parameters are required. - """ - - def __call__(self, parser, namespace, values, option_string=None): - if len(values) != 3: - raise argparse.ArgumentError( - self, - "Invalid number of parameters for --flags. Exactly three parameters are required.", - ) - setattr(namespace, self.dest, values) - - -# Vendor specific functions # - -# Espressif # - - -def run_espressif_tool(cmd): - tool = "esptool.py" - strings_out = "" - command = "{} {}".format(tool, cmd) - - strings_out = subprocess.run( - command, universal_newlines=True, shell=True, capture_output=True - ) - - return strings_out.stdout - - -def get_espressif_chip_id(): - output = run_espressif_tool("chip_id") - string_out = next((s for s in output.split("\n") if "Chip ID" in s), "Not found") - if string_out != "Not found": - string_out = string_out.split("Warning: ")[-1] - return string_out - - -def get_espressif_flash_id(): - strings_out = [] - output = run_espressif_tool("flash_id") - - strings_out.append( - next( - (s for s in output.split("\n") if "Manufacturer" in s), - "Manufacturer: Not found", - ) - ) - strings_out.append( - next((s for s in output.split("\n") if "Device" in s), "Device: Not found") - ) - - return strings_out - - -def get_espressif_security_info(): - output = run_espressif_tool("get_security_info") - - start_string = "=====================" - stop_string = "Hard resetting via RTS pin..." - output = output.split("\n") - strings_out = [] - - str_out = next((s for s in output if start_string in s), "Not found") - if str_out != "Not found": - start_index = output.index(start_string) + 1 - stop_index = output.index(stop_string) - strings_out = output[start_index:stop_index] - else: - strings_out.append(str_out) - - return strings_out - - -def get_espressif_flash_status(): - output = run_espressif_tool("read_flash_status") - - string_out = next( - (s for s in output.split("\n") if "Status value" in s), "Not found" - ) - if string_out != "Not found": - string_out = string_out.split("Status value: ")[-1] - return string_out - - -def get_espressif_mac_address(): - output = run_espressif_tool("read_mac") - - string_out = next((s for s in output.split("\n") if "MAC" in s), "Not found") - if string_out != "Not found": - string_out = string_out.split("MAC: ")[-1] - return string_out - - -def get_espressif_bootloader_version(bindir): - """ - Get the bootloader version for Espressif chips from the bootloader binary. This - function works on Linux, Windows, and macOS. - - Args: - bindir (str): The path to the bootloader binary directory. - - Returns: - dict: A dictionary containing the bootloader version for each chip. - """ - - regex = r"^(?=.*\bv\d+(\.\d+){1,2}\b).+$" - bootloader_chips = [ - "esp32", - "esp32s2", - "esp32s3", - "esp32c2", - "esp32c3", - "esp32c6", - "esp32h2", - ] - bootloader_version = {} - - for chip in bootloader_chips: - file = "bootloader-{}.bin".format(chip) - path = os.path.join(bindir, file) - - if os.path.isfile(path): - if platform.system() == "Linux": - process = subprocess.Popen(["strings", path], stdout=subprocess.PIPE) - elif platform.system() == "Windows": - process = subprocess.Popen( - [ - "powershell", - "Get-Content -Raw -Encoding Byte {} |".format(path) - + " % { [char[]]$_ -join \"\" } | Select-String -Pattern '[\\x20-\\x7E]+'" - + " -AllMatches | % { $_.Matches } | % { $_.Value }", - ], - stdout=subprocess.PIPE, - ) - elif platform.system() == "Darwin": - process = subprocess.Popen( - ["strings", "-", path], stdout=subprocess.PIPE - ) - else: - bootloader_version[chip] = "Not supported on host OS" - break - - output, error = process.communicate() - strings_out = output.decode("utf-8", errors="ignore") - matches = re.finditer(regex, strings_out, re.MULTILINE) - - try: - bootloader_version[chip] = next(matches).group(0) - except StopIteration: - bootloader_version[chip] = "Unknown" - - else: - bootloader_version[chip] = "Bootloader image not found" - - return bootloader_version - - -def get_espressif_toolchain_version(): - """ - Get the version of different toolchains used by Espressif chips. - - Args: - None. - - Returns: - dict: A dictionary containing the toolchain version for each toolchain. - """ - - toolchain_version = {} - toolchain_bins = [ - "clang", - "gcc", - "xtensa-esp32-elf-gcc", - "xtensa-esp32s2-elf-gcc", - "xtensa-esp32s3-elf-gcc", - "riscv32-esp-elf-gcc", - "riscv64-unknown-elf-gcc", - ] - - for binary in toolchain_bins: - try: - version_output = subprocess.check_output( - [binary, "--version"], stderr=subprocess.STDOUT, universal_newlines=True - ) - version_lines = version_output.split("\n") - version = version_lines[0].strip() - toolchain_version[binary] = version - except (subprocess.CalledProcessError, FileNotFoundError): - toolchain_version[binary] = "Not found" - - return toolchain_version - - -def get_espressif_hal_version(hal_dir): - """ - Get the version of the ESP HAL used by Espressif chips. - - Args: - None. - - Returns: - str: The ESP HAL version. - """ - - hal_version = "Not found" - - try: - if os.path.isdir(os.path.join(hal_dir, ".git")): - hal_version_output = subprocess.check_output( - ["git", "describe", "--tags", "--always"], - cwd=hal_dir, - stderr=subprocess.STDOUT, - universal_newlines=True, - ) - hal_version = hal_version_output.strip() - except (subprocess.CalledProcessError, FileNotFoundError): - pass - - return hal_version - - -# Common functions # - - -def verbose(info, logs): - """ - Prepare and print information on build screen. - - Args: - info (dict): Information dictionary of build system. - logs (str): Vendor specific information string. - - Returns: - None. - """ - - if args.verbose: - - out_str = "\n" + "=" * 79 + "\n" - - out_str += "NuttX RTOS info: {}\n\n".format(info["OS_VERSION"]) - if args.flags: - out_str += "NuttX CFLAGS: {}\n\n".format(info["NUTTX_CFLAGS"]) - out_str += "NuttX CXXFLAGS: {}\n\n".format(info["NUTTX_CXXFLAGS"]) - out_str += "NuttX LDFLAGS: {}\n\n".format(info["NUTTX_LDFLAGS"]) - - if args.config: - out_str += "NuttX configuration options: \n" - for i in range(len(info["NUTTX_CONFIG"])): - out_str += " " + info["NUTTX_CONFIG"][i].replace('"', '\\"') + "\n" - out_str += "\n\n" - - if args.path: - out_str += "Host system PATH: \n" - for i in range(len(info["SYSTEM_PATH"])): - out_str += " " + info["SYSTEM_PATH"][i] + "\n" - out_str += "\n\n" - - if args.packages: - out_str += "Host system installed packages: \n" - for i in range(len(info["INSTALLED_PACKAGES"])): - out_str += " " + info["INSTALLED_PACKAGES"][i] + "\n" - out_str += "\n\n" - - if args.modules: - out_str += "Host system installed python modules: \n" - for i in range(len(info["PYTHON_MODULES"])): - out_str += " " + info["PYTHON_MODULES"][i] + "\n" - out_str += "\n\n" - - if args.espressif: - out_str += "Espressif specific information: \n\n" - out_str += logs - out_str += "=" * 79 + "\n" - - eprint(out_str) - - -def eprint(*args, **kwargs): - """ - Prints the arguments passed to stderr. - """ - - print(*args, file=sys.stderr, **kwargs) - - -def get_installed_packages(): - """ - Gets the list of packages installed on the host system. This function works on - Linux (Debian, Red Hat, and Arch-based distros), Windows, and macOS. - - Args: - None. - - Returns: - list: Packages (with version) installed on the host system. - """ - - packages = [] - - if platform.system() == "Linux": - package_managers = [ - { - "name": "Dpkg", - "command": ["dpkg", "-l"], - "skip_lines": 5, - "info_name": 1, - "info_version": 2, - }, - { - "name": "Rpm", - "command": ["rpm", "-qa", "--queryformat", '"%{NAME} %{VERSION}\\n"'], - "skip_lines": 0, - "info_name": 0, - "info_version": 1, - }, - { - "name": "Pacman", - "command": ["pacman", "-Q", "--queryformat", '"%n %v\\n"'], - "skip_lines": 0, - "info_name": 0, - "info_version": 1, - }, - ] - - for manager in package_managers: - try: - process = subprocess.Popen(manager["command"], stdout=subprocess.PIPE) - output, error = process.communicate() - lines = output.decode("utf-8").splitlines() - - # Skip the specified number of lines based on the package manager - if lines: - lines = lines[manager["skip_lines"] :] - - current_packages = [] - for line in lines: - package_info = line.split() - package = package_info[manager["info_name"]] - version = package_info[manager["info_version"]] - current_packages.append(f"{package} ({version})") - - if current_packages: - packages.extend(current_packages) - break - - except (FileNotFoundError, subprocess.CalledProcessError): - pass - - elif platform.system() == "Windows": - try: - output = subprocess.check_output( - [ - "powershell", - "Get-ItemProperty HKLM:\\Software\\Microsoft\\Windows\\" - + "CurrentVersion\\Uninstall\\* | Select-Object DisplayName, DisplayVersion", - ] - ) - output = output.decode("utf-8", errors="ignore").split("\r\n") - for line in output[3:]: - line = line.strip() - if line: - match = re.match(r"^(.*?)(\s{2,}[^ ]+)?$", line) - if match: - name = match.group(1).strip() - version = ( - match.group(2).strip() if match.group(2) else "Unknown" - ) - packages.append(f"{name} ({version})") - except subprocess.CalledProcessError: - eprint("Error: Failed to get installed packages.") - - elif platform.system() == "Darwin": - try: - output = subprocess.check_output(["pkgutil", "--pkgs"]) - output = output.decode("utf-8").split("\n") - for package in output: - if "." in package: - try: - info = subprocess.check_output( - ["pkgutil", "--pkg-info", package] - ) - info = info.decode("utf-8") - version = info.split("version: ")[1].split("\n")[0] - except subprocess.CalledProcessError: - version = "Unknown" - packages.append(f"{package} ({version})") - except subprocess.CalledProcessError: - eprint("Error: Failed to get installed packages.") - - packages.sort() - return packages - - -def get_python_modules(): - """ - Gets the list of python modules installed on the host system. - - Args: - None. - - Returns: - list: Python modules (with version) installed on the host system. - """ - - modules = [] - - output = subprocess.check_output( - ["pip", "list", "--format=freeze"], universal_newlines=True - ) - for line in output.splitlines(): - if line.startswith("#"): - continue - package_info = line.split("==") - if len(package_info) > 1: - modules.append("{}-{}".format(package_info[0], package_info[1])) - else: - modules.append(package_info[0]) - return modules - - -def get_system_path(): - """ - Gets the PATH environment variable. - - Args: - None. - - Returns: - str: The PATH environment variable. - """ - - return os.environ.get("PATH", "") - - -def get_os_version(): - """ - Gets the OS distribution and version. This function works on Linux, Windows, - and macOS. On Linux, if the distro package is installed, it will be used to - get the OS distribution. - - Args: - None. - - Returns: - str: The OS distribution and version. - """ - - os_name = platform.system() - sys_id = "" - - if os_name == "Windows": - os_distro = "Windows" - os_version = platform.win32_ver()[0] - sys_id = f"{os_distro} {os_version}" - - elif os_name == "Darwin": - os_distro = "macOS" - os_uname = " ".join(platform.uname()) - os_version = platform.mac_ver()[0] - sys_id = f"{os_distro} {os_version} {os_uname}" - - elif os_name == "Linux": - os_uname = " ".join(platform.uname()) - try: - import distro - - sys_id = distro.name(pretty=True) + " " + os_uname - except ImportError: - sys_id = os_uname - - return sys_id - - -def get_compilation_flags(flags): - """ - Gets the compilation flags used to compile the NuttX source code and splits - them into a list. - - Args: - arg (str): The compilation flags. - - Returns: - list: The compilation flags. - """ - - if not flags: - return [""] - - flag_list = flags.split(" -") - flag_list[0] = flag_list[0][1:] - flag_list = ["-" + flag for flag in flag_list] - - return flag_list - - -def generate_header(args): - """ - Generates the sysinfo.h header file that contains information about the host system - and NuttX configuration that can be used by NuttX applications. - - Args: - args (argparse.Namespace): The command line arguments. - - Returns: - str: The contents of the sysinfo.h header file. - """ - - info = {} - output = "" - build_output = "" - - output += "/****************************************************************************\n" - output += " * sysinfo.h\n" - output += " *\n" - output += " * Auto-generated by a Python script. Do not edit!\n" - output += " *\n" - output += ( - " * This file contains information about the host and target systems that\n" - ) - output += " * can be used by NuttX applications.\n" - output += " *\n" - output += " ****************************************************************************/\n\n" - - output += "#ifndef __SYSTEM_INFO_H\n" - output += "#define __SYSTEM_INFO_H\n\n" - - # NuttX Compilation Flags - - if args.flags: - cflags, cxxflags, ldflags = args.flags - - if cflags: - cflags = cflags[1:-1] - if cxxflags: - cxxflags = cxxflags[1:-1] - if ldflags: - ldflags = ldflags[1:-1] - - info["NUTTX_CFLAGS"] = get_compilation_flags(cflags) - info["NUTTX_CXXFLAGS"] = get_compilation_flags(cxxflags) - info["NUTTX_LDFLAGS"] = get_compilation_flags(ldflags) - - output += "#define NUTTX_CFLAGS_ARRAY_SIZE {}\n".format( - len(info["NUTTX_CFLAGS"]) - ) - output += "static const char *NUTTX_CFLAGS[NUTTX_CFLAGS_ARRAY_SIZE] =\n{\n" - for i in range(len(info["NUTTX_CFLAGS"])): - output += ' "' + info["NUTTX_CFLAGS"][i] + '",\n' - output += "};\n\n" - - output += "#define NUTTX_CXXFLAGS_ARRAY_SIZE {}\n".format( - len(info["NUTTX_CXXFLAGS"]) - ) - output += "static const char *NUTTX_CXXFLAGS[NUTTX_CXXFLAGS_ARRAY_SIZE] =\n{\n" - for i in range(len(info["NUTTX_CXXFLAGS"])): - output += ' "' + info["NUTTX_CXXFLAGS"][i] + '",\n' - output += "};\n\n" - - output += "#define NUTTX_LDFLAGS_ARRAY_SIZE {}\n".format( - len(info["NUTTX_LDFLAGS"]) - ) - output += "static const char *NUTTX_LDFLAGS[NUTTX_LDFLAGS_ARRAY_SIZE] =\n{\n" - for i in range(len(info["NUTTX_LDFLAGS"])): - output += ' "' + info["NUTTX_LDFLAGS"][i] + '",\n' - output += "};\n\n" - - # NuttX Configuration - - if args.config: - info["NUTTX_CONFIG"] = [] - config_path = os.path.abspath("./.config") - try: - with open(config_path, "r") as f: - for line in f: - line = line.strip() - if not line or line.startswith("#"): - continue - info["NUTTX_CONFIG"].append(line) - - output += "#define NUTTX_CONFIG_ARRAY_SIZE {}\n".format( - len(info["NUTTX_CONFIG"]) - ) - output += "static const char *NUTTX_CONFIG[NUTTX_CONFIG_ARRAY_SIZE] =\n{\n" - for i in range(len(info["NUTTX_CONFIG"])): - output += ' "' + info["NUTTX_CONFIG"][i].replace('"', '\\"') + '",\n' - output += "};\n\n" - except FileNotFoundError: - print("Error: NuttX configuration file not found: {}".format(config_path)) - sys.exit(1) - - # OS Version - - info["OS_VERSION"] = get_os_version() - output += 'static const char OS_VERSION[] = "{}";\n\n'.format(info["OS_VERSION"]) - - # System Path - - if args.path: - info["SYSTEM_PATH"] = str(get_system_path()).split(":") - output += "#define SYSTEM_PATH_ARRAY_SIZE {}\n".format(len(info["SYSTEM_PATH"])) - output += "static const char *SYSTEM_PATH[SYSTEM_PATH_ARRAY_SIZE] =\n{\n" - for i in range(len(info["SYSTEM_PATH"])): - output += ' "' + info["SYSTEM_PATH"][i] + '",\n' - output += "};\n\n" - - # Installed Packages - - if args.packages: - info["INSTALLED_PACKAGES"] = [str(x) for x in get_installed_packages()] - output += "#define INSTALLED_PACKAGES_ARRAY_SIZE {}\n".format( - len(info["INSTALLED_PACKAGES"]) - ) - output += "static const char *INSTALLED_PACKAGES[INSTALLED_PACKAGES_ARRAY_SIZE] =\n{\n" - for i in range(len(info["INSTALLED_PACKAGES"])): - output += ' "' + info["INSTALLED_PACKAGES"][i] + '",\n' - output += "};\n\n" - - # Python Modules - - if args.modules: - info["PYTHON_MODULES"] = [str(x) for x in get_python_modules()] - output += "#define PYTHON_MODULES_ARRAY_SIZE {}\n".format( - len(info["PYTHON_MODULES"]) - ) - output += "static const char *PYTHON_MODULES[PYTHON_MODULES_ARRAY_SIZE] =\n{\n" - for i in range(len(info["PYTHON_MODULES"])): - output += ' "' + info["PYTHON_MODULES"][i] + '",\n' - output += "};\n\n" - - # Vendor Specific - - # Espressif - - if args.espressif: - # Espressif bootloader version - - info["ESPRESSIF_BOOTLOADER"] = get_espressif_bootloader_version( - args.espressif[0] - ) - output += "#define ESPRESSIF_BOOTLOADER_ARRAY_SIZE {}\n".format( - len(info["ESPRESSIF_BOOTLOADER"]) - ) - output += "static const char *ESPRESSIF_BOOTLOADER[ESPRESSIF_BOOTLOADER_ARRAY_SIZE] =\n{\n" - build_output = "Bootloader version:\n" - for key, value in info["ESPRESSIF_BOOTLOADER"].items(): - output += ' "{}: {}",\n'.format(key, value) - build_output += " {}: {},\n".format(key, value) - output += "};\n\n" - build_output += "\n\n" - - # Espressif toolchain version - - info["ESPRESSIF_TOOLCHAIN"] = get_espressif_toolchain_version() - output += "#define ESPRESSIF_TOOLCHAIN_ARRAY_SIZE {}\n".format( - len(info["ESPRESSIF_TOOLCHAIN"]) - ) - output += "static const char *ESPRESSIF_TOOLCHAIN[ESPRESSIF_TOOLCHAIN_ARRAY_SIZE] =\n{\n" - build_output += "Toolchain version:\n" - for key, value in info["ESPRESSIF_TOOLCHAIN"].items(): - output += ' "{}: {}",\n'.format(key, value) - build_output += " {}: {},\n".format(key, value) - output += "};\n\n" - build_output += "\n\n" - - # Espressif esptool version - - info["ESPRESSIF_ESPTOOL"] = next( - (s for s in get_python_modules() if "esptool" in s), "Not found" - ) - output += 'static const char ESPRESSIF_ESPTOOL[] = "{}";\n\n'.format( - info["ESPRESSIF_ESPTOOL"].split("-")[1] - ) - build_output += "Esptool version: {}\n\n".format( - info["ESPRESSIF_ESPTOOL"].split("-")[1] - ) - - # Espressif HAL version - - info["ESPRESSIF_HAL"] = get_espressif_hal_version(args.espressif[1]) - output += 'static const char ESPRESSIF_HAL[] = "{}";\n\n'.format( - info["ESPRESSIF_HAL"] - ) - build_output += "HAL version: {}\n\n".format(info["ESPRESSIF_HAL"]) - - if args.espressif_chip and info["ESPRESSIF_ESPTOOL"] not in "Not found": - info["ESPRESSIF_CHIP_ID"] = get_espressif_chip_id() - output += 'static const char ESPRESSIF_CHIP_ID[] = "{}";\n\n'.format( - info["ESPRESSIF_CHIP_ID"] - ) - build_output += "CHIP ID: = {}\n\n".format(info["ESPRESSIF_CHIP_ID"]) - - info["ESPRESSIF_FLASH_ID"] = get_espressif_flash_id() - output += "#define ESPRESSIF_FLASH_ID_ARRAY_SIZE {}\n".format( - len(info["ESPRESSIF_FLASH_ID"]) - ) - output += "static const char *ESPRESSIF_FLASH_ID[ESPRESSIF_FLASH_ID_ARRAY_SIZE] =\n{\n" - build_output += "Flash ID:\n" - for each_item in info["ESPRESSIF_FLASH_ID"]: - output += ' "{}",\n'.format(each_item) - build_output += " {}\n".format(each_item) - output += "};\n\n" - build_output += "\n\n" - - info["ESPRESSIF_SECURITY_INFO"] = get_espressif_security_info() - output += "#define ESPRESSIF_SECURITY_INFO_ARRAY_SIZE {}\n".format( - len(info["ESPRESSIF_SECURITY_INFO"]) - ) - output += "static const char *ESPRESSIF_SECURITY_INFO[ESPRESSIF_SECURITY_INFO_ARRAY_SIZE] =\n{\n" - build_output += "Security information: \n" - for each_item in info["ESPRESSIF_SECURITY_INFO"]: - output += ' "{}",\n'.format(each_item) - build_output += " {}\n".format(each_item) - output += "};\n\n" - build_output += "\n\n" - - info["ESPRESSIF_FLASH_STAT"] = get_espressif_flash_status() - output += 'static const char ESPRESSIF_FLASH_STAT[] = "{}";\n\n'.format( - info["ESPRESSIF_FLASH_STAT"] - ) - build_output += "Flash status: {}\n\n".format(info["ESPRESSIF_FLASH_STAT"]) - - info["ESPRESSIF_MAC_ADDR"] = get_espressif_mac_address() - output += 'static const char ESPRESSIF_MAC_ADDR[] = "{}";\n\n'.format( - info["ESPRESSIF_MAC_ADDR"] - ) - build_output += "MAC address: {}\n\n".format(info["ESPRESSIF_MAC_ADDR"]) - - elif args.espressif_chip_runtime: - output += "#define ESPRESSIF_INFO_SIZE 384\n" - output += "static char ESPRESSIF_INFO[ESPRESSIF_TOOLCHAIN_ARRAY_SIZE] =\n{\n 0\n};\n\n" - - verbose(info, build_output) - - output += "#endif /* __SYSTEM_INFO_H */\n" - - return output - - -# Main # - -if __name__ == "__main__": - """ - Main function for the script. This function is called when the script is - executed directly. It parses the command line arguments and calls the - appropriate functions. It also prints the output generated to stdout. - - Required arguments: - nuttx_path: The path to the NuttX source directory. - - Optional arguments: - The command line arguments. The available arguments are: - -h, --help: - Show the help message and exit. - -m, --modules: - Get the list of installed Python modules. - -k, --packages: - Get the list of installed system packages. - -p, --path: - Get the system PATH environment variable. - -c, --config: - Get the NuttX compilation configurations used. - -f, --flags : - Provide the NuttX compilation flags used. - --verbose: - Enable printing information during build. - --espressif : - Get Espressif specific information. - Requires the path to the bootloader binary directory. - --espressif_chip: - Get Espressif specific information about chip. - Requires device connection during build. - --espressif_chip_runtime: - Get Espressif specific information about chip - on runtime. - Requires device connection during build. - """ - - # Generic arguments - - parser = argparse.ArgumentParser(add_help=False) - parser.add_argument("nuttx_path", help="NuttX source directory path.") - parser.add_argument( - "-h", - "--help", - action="help", - default=argparse.SUPPRESS, - help="Show this help message and exit.", - ) - parser.add_argument( - "-m", - "--modules", - action="store_true", - help="Get the list of installed Python modules.", - ) - parser.add_argument( - "-k", - "--packages", - action="store_true", - help="Get the list of installed system packages.", - ) - parser.add_argument( - "-p", - "--path", - action="store_true", - help="Get the system PATH environment variable.", - ) - parser.add_argument( - "-c", - "--config", - action="store_true", - help="Get the NuttX compilation configurations used.", - ) - parser.add_argument( - "-f", - "--flags", - nargs=3, - default=[], - metavar=("CFLAGS", "CXXFLAGS", "LDFLAGS"), - action=validate_flags_arg, - help="Provide the NuttX compilation and linker flags used.", - ) - parser.add_argument( - "--verbose", - action="store_true", - help="Enable printing information during build", - ) - - # Vendor specific arguments - - parser.add_argument( - "--espressif", - nargs=2, - default=[], - metavar=("ESPTOOL_BINDIR", "ESP_HAL_DIR"), - help="Get Espressif specific information. Requires the path to the bootloader binary and ESP HAL directories.", - ) - - parser.add_argument( - "--espressif_chip", - action="store_true", - help="Get Espressif specific information about chip. Requires device connection during build.", - ) - - parser.add_argument( - "--espressif_chip_runtime", - action="store_true", - help="Get Espressif specific information about chip on runtime. Requires device connection during build.", - ) - - # Parse arguments - - if len(sys.argv) == 1: - parser.print_help() - sys.exit(1) - - args = parser.parse_args() - os.chdir(args.nuttx_path) - header = generate_header(args) - print(header) diff --git a/tools/parse_sysinfo.py b/tools/parse_sysinfo.py deleted file mode 100644 index 59a67c59752..00000000000 --- a/tools/parse_sysinfo.py +++ /dev/null @@ -1,156 +0,0 @@ -#!/usr/bin/env python3 -############################################################################ -# apps/tools/parse_sysinfo.py -# -# SPDX-License-Identifier: Apache-2.0 -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. The -# ASF licenses this file to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance with the -# License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -# -############################################################################ - -import argparse -import os -import re -import sys - - -def parse_information_from_header(file_path): - """ - Parses the file that contains information about the host system - and NuttX configuration(sysinfo.h). - - Args: - file_path (str): Path of the file to parse. - - Returns: - dict: The contents parsed from file_path (sysinfo.h) header file. - """ - - VARIABLE_NAMES_REGEX = r"static\s+const\s+char\s+\**([A-Za-z0-9_]+)\s*" - VARIABLE_VALUES_REGEX = r'"([^"]*)"|{([^}]+)};' - result = {} - var_name_to_print_dict = { - "NUTTX_CFLAGS": "NuttX CFLAGS", - "NUTTX_CXXFLAGS": "NuttX CXXFLAGS", - "NUTTX_LDFLAGS": "NuttX LDFLAGS", - "NUTTX_CONFIG": "NuttX configuration options", - "SYSTEM_PATH": "Host system PATH", - "OS_VERSION": "Host system OS", - "INSTALLED_PACKAGES": "Host system installed packages", - "PYTHON_MODULES": "Host system installed python modules", - "ESPRESSIF_BOOTLOADER": "Espressif specific information:\n\nToolchain version", - "ESPRESSIF_TOOLCHAIN": "Toolchain version", - "ESPRESSIF_ESPTOOL": "Esptool version", - "ESPRESSIF_HAL": "HAL version", - "ESPRESSIF_CHIP_ID": "CHIP ID", - "ESPRESSIF_FLASH_ID": "Flash ID", - "ESPRESSIF_SECURITY_INFO": "Security information", - "ESPRESSIF_FLASH_STAT": "Flash status", - "ESPRESSIF_MAC_ADDR": "MAC address", - } - - # Regular expression pattern to match array definition - - keys_pattern = re.compile(VARIABLE_NAMES_REGEX, re.DOTALL) - values_pattern = re.compile(VARIABLE_VALUES_REGEX, re.DOTALL) - - with open(file_path, "r") as file: - content = file.read() - - # Match array definition using the regex - - keys_array = keys_pattern.findall(content) - values_array = values_pattern.findall(content) - - # Process values to print it prettier - - for i in range(len(values_array)): - tmp_list = [] - for y in range(len(values_array[i])): - tmp_str = values_array[i][y] - tmp_str = tmp_str.replace('"', "") - tmp_str = tmp_str.replace("\n ", "", 1) - tmp_str = tmp_str.replace(",", "") - - if tmp_str != "": - tmp_list.append(tmp_str) - - values_array[i] = tuple(tmp_list) - - keys_values_to_return = [var_name_to_print_dict[x] for x in keys_array] - result = dict(zip(keys_values_to_return, values_array)) - - return result - - -# Main # - - -if __name__ == "__main__": - """ - Main function for the script. This function is called when the script is - executed directly. It prints the output generated to stdout. - - Required arguments: - nuttx_path: The path to the NuttX source directory. - - Optional arguments: - The command line arguments. The available arguments are: - -h, --help: - Show the help message and exit. - -f, --file : - Provide the diagnostic file output(sysinfo.h). - """ - - # Generic arguments - - parser = argparse.ArgumentParser(add_help=False) - parser.add_argument("nuttx_path", help="NuttX source directory path.") - parser.add_argument( - "-h", - "--help", - action="help", - default=argparse.SUPPRESS, - help="Show this help message and exit.", - ) - parser.add_argument( - "-f", - "--file", - default="", - metavar=("SYSINFO_FILE"), - help="Provide the diagnostic file output(sysinfo.h).", - ) - # Parse arguments - - if len(sys.argv) == 1: - parser.print_help() - sys.exit(1) - - args = parser.parse_args() - os.chdir(args.nuttx_path) - - parsed_data = parse_information_from_header(args.file) - - # Print the extracted name and values - - if parsed_data: - for each_key in parsed_data.keys(): - print("{}:".format(each_key)) - for each_value in parsed_data[each_key]: - print(" {}".format(each_value)) - print("") - else: - print("No matching array found.") From 121205fd136b42034eaddfad6864190ad254f9ac Mon Sep 17 00:00:00 2001 From: Lup Yuen Lee Date: Wed, 8 Jan 2025 11:28:22 +0800 Subject: [PATCH 122/391] CI: Increase CI Jobs to 100% for Complex PRs This PR increases the CI Jobs for Complex PRs from 50% to 100%, as explained here: - https://github.com/apache/nuttx/issues/15451#issuecomment-2576576664 This PR also includes the fix for Simple x86 PR: - https://github.com/apache/nuttx/pull/14896 --- .github/workflows/arch.yml | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/.github/workflows/arch.yml b/.github/workflows/arch.yml index 7367eb9a795..278d5f666dc 100644 --- a/.github/workflows/arch.yml +++ b/.github/workflows/arch.yml @@ -76,6 +76,8 @@ jobs: echo 'arch_contains_sim=1' | tee -a $GITHUB_OUTPUT elif [[ "$labels" == *"Arch: x86_64"* ]]; then echo 'arch_contains_x86_64=1' | tee -a $GITHUB_OUTPUT + elif [[ "$labels" == *"Arch: x86"* ]]; then + echo 'arch_contains_x86=1' | tee -a $GITHUB_OUTPUT elif [[ "$labels" == *"Arch: xtensa"* ]]; then echo 'arch_contains_xtensa=1' | tee -a $GITHUB_OUTPUT fi @@ -91,6 +93,8 @@ jobs: echo 'board_contains_sim=1' | tee -a $GITHUB_OUTPUT elif [[ "$labels" == *"Board: x86_64"* ]]; then echo 'board_contains_x86_64=1' | tee -a $GITHUB_OUTPUT + elif [[ "$labels" == *"Board: x86"* ]]; then + echo 'board_contains_x86=1' | tee -a $GITHUB_OUTPUT elif [[ "$labels" == *"Board: xtensa"* ]]; then echo 'board_contains_xtensa=1' | tee -a $GITHUB_OUTPUT fi @@ -119,12 +123,14 @@ jobs: arch_contains_arm64=${{ steps.get-arch.outputs.arch_contains_arm64 }} arch_contains_riscv=${{ steps.get-arch.outputs.arch_contains_riscv }} arch_contains_sim=${{ steps.get-arch.outputs.arch_contains_sim }} + arch_contains_x86=${{ steps.get-arch.outputs.arch_contains_x86 }} arch_contains_x86_64=${{ steps.get-arch.outputs.arch_contains_x86_64 }} arch_contains_xtensa=${{ steps.get-arch.outputs.arch_contains_xtensa }} board_contains_arm=${{ steps.get-arch.outputs.board_contains_arm }} board_contains_arm64=${{ steps.get-arch.outputs.board_contains_arm64 }} board_contains_riscv=${{ steps.get-arch.outputs.board_contains_riscv }} board_contains_sim=${{ steps.get-arch.outputs.board_contains_sim }} + board_contains_x86=${{ steps.get-arch.outputs.board_contains_x86 }} board_contains_x86_64=${{ steps.get-arch.outputs.board_contains_x86_64 }} board_contains_xtensa=${{ steps.get-arch.outputs.board_contains_xtensa }} @@ -151,6 +157,7 @@ jobs: "$arch_contains_arm64" != "$board_contains_arm64" || "$arch_contains_riscv" != "$board_contains_riscv" || "$arch_contains_sim" != "$board_contains_sim" || + "$arch_contains_x86" != "$board_contains_x86" || "$arch_contains_x86_64" != "$board_contains_x86_64" || "$arch_contains_xtensa" != "$board_contains_xtensa" ]]; then @@ -166,21 +173,14 @@ jobs: # If Not a Simple PR: Build all targets if [[ "$quit" == "1" ]]; then - # If PR was Created or Modified: Exclude some boards + # If PR was Created or Modified: Include all boards pr=${{github.event.pull_request.number}} if [[ "$pr" != "" ]]; then - echo "Excluding arm-0[1249], arm-1[124-9], risc-v-04..06, sim-03, xtensa-02" + echo "Include all boards" boards=$( echo '${{ inputs.boards }}' | jq --compact-output \ - 'map( - select( - test("arm-0[1249]") == false and test("arm-1[124-9]") == false and - test("risc-v-0[4-9]") == false and - test("sim-0[3-9]") == false and - test("xtensa-0[2-9]") == false - ) - )' + '.' ) fi echo "selected_builds=$boards" | tee -a $GITHUB_OUTPUT @@ -218,6 +218,12 @@ jobs: skip_build=1 fi + # For "Arch / Board: x86": Build other + elif [[ "$arch_contains_x86" == "1" || "$board_contains_x86" == "1" ]]; then + if [[ "$board" != *"other"* ]]; then + skip_build=1 + fi + # For "Arch / Board: x86_64": Build x86_64-01 elif [[ "$arch_contains_x86_64" == "1" || "$board_contains_x86_64" == "1" ]]; then if [[ "$board" != *"x86_64-"* ]]; then From f2b0437688e75919444e1298d010a363c1308909 Mon Sep 17 00:00:00 2001 From: zhangshuai39 Date: Mon, 25 Nov 2024 17:36:52 +0800 Subject: [PATCH 123/391] apps/testing: Add a cmocka framework for network testing Provides a network automated testing framework, including the main directory structure and Makefile, CMakeLists, Kconfig and other files such as tcp. Signed-off-by: zhangshuai39 --- testing/nettest/CMakeLists.txt | 45 ++++++++++++++++ testing/nettest/Kconfig | 28 ++++++++++ testing/nettest/Make.defs | 23 +++++++++ testing/nettest/Makefile | 41 +++++++++++++++ testing/nettest/tcp/test_tcp.c | 49 ++++++++++++++++++ testing/nettest/tcp/test_tcp.h | 57 +++++++++++++++++++++ testing/nettest/tcp/test_tcp_common.c | 47 +++++++++++++++++ testing/nettest/tcp/test_tcp_connect_ipv4.c | 46 +++++++++++++++++ 8 files changed, 336 insertions(+) create mode 100644 testing/nettest/CMakeLists.txt create mode 100644 testing/nettest/Kconfig create mode 100644 testing/nettest/Make.defs create mode 100644 testing/nettest/Makefile create mode 100644 testing/nettest/tcp/test_tcp.c create mode 100644 testing/nettest/tcp/test_tcp.h create mode 100644 testing/nettest/tcp/test_tcp_common.c create mode 100644 testing/nettest/tcp/test_tcp_connect_ipv4.c diff --git a/testing/nettest/CMakeLists.txt b/testing/nettest/CMakeLists.txt new file mode 100644 index 00000000000..41e2445a22f --- /dev/null +++ b/testing/nettest/CMakeLists.txt @@ -0,0 +1,45 @@ +# ############################################################################## +# apps/testing/nettest/CMakeLists.txt +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_TESTING_NET_TEST) + if(CONFIG_TESTING_NET_TCP) + set(SRCS ${CMAKE_CURRENT_LIST_DIR}/tcp/test_tcp.c + ${CMAKE_CURRENT_LIST_DIR}/tcp/test_tcp_common.c) + + if(CONFIG_NET_IPv4) + list(APPEND SRCS ${CMAKE_CURRENT_LIST_DIR}/tcp/test_tcp_connect_ipv4.c) + endif() + + nuttx_add_application( + NAME + cmocka_net_tcp + PRIORITY + ${CONFIG_TESTING_NET_TEST_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_NET_TEST_STACKSIZE} + MODULE + ${CONFIG_TESTING_NET_TEST} + DEPENDS + cmocka + SRCS + ${SRCS}) + endif() + +endif() diff --git a/testing/nettest/Kconfig b/testing/nettest/Kconfig new file mode 100644 index 00000000000..b5332469db3 --- /dev/null +++ b/testing/nettest/Kconfig @@ -0,0 +1,28 @@ +# +# For a description of the syntax of this configuration file, +# see the file kconfig-language.txt in the NuttX tools repository. +# + +config TESTING_NET_TEST + tristate "vela cmocka net test" + default n + depends on TESTING_CMOCKA + ---help--- + Enable the cmocka net test + +if TESTING_NET_TEST + +config TESTING_NET_TEST_PRIORITY + int "Task priority" + default 100 + +config TESTING_NET_TEST_STACKSIZE + int "Stack size" + default DEFAULT_TASK_STACKSIZE + +config TESTING_NET_TCP + bool "Enable cmocka net tcp test" + depends on NET_TCP && NET_TCPBACKLOG + default y + +endif diff --git a/testing/nettest/Make.defs b/testing/nettest/Make.defs new file mode 100644 index 00000000000..2f259532543 --- /dev/null +++ b/testing/nettest/Make.defs @@ -0,0 +1,23 @@ +############################################################################ +# apps/testing/nettest/Make.defs +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +ifneq ($(CONFIG_TESTING_NET_TEST),) +CONFIGURED_APPS += $(APPDIR)/testing/nettest +endif diff --git a/testing/nettest/Makefile b/testing/nettest/Makefile new file mode 100644 index 00000000000..3533d44582e --- /dev/null +++ b/testing/nettest/Makefile @@ -0,0 +1,41 @@ +############################################################################ +# apps/testing/nettest/Makefile +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +include $(APPDIR)/Make.defs + +PRIORITY = $(CONFIG_TESTING_NET_TEST_PRIORITY) +STACKSIZE = $(CONFIG_TESTING_NET_TEST_STACKSIZE) +MODULE = $(CONFIG_TESTING_NET_TEST) + +ifeq ($(CONFIG_TESTING_NET_TEST),y) + +ifeq ($(CONFIG_TESTING_NET_TCP),y) +MAINSRC += tcp/test_tcp.c +PROGNAME += cmocka_net_tcp +CSRCS += tcp/test_tcp_common.c + +ifeq ($(CONFIG_NET_IPv4), y) +CSRCS += tcp/test_tcp_connect_ipv4.c +endif + +endif + +endif +include $(APPDIR)/Application.mk diff --git a/testing/nettest/tcp/test_tcp.c b/testing/nettest/tcp/test_tcp.c new file mode 100644 index 00000000000..29edb69ec8f --- /dev/null +++ b/testing/nettest/tcp/test_tcp.c @@ -0,0 +1,49 @@ +/**************************************************************************** + * apps/testing/nettest/tcp/test_tcp.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +#include +#include +#include + +#include "test_tcp.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +int main(int argc, FAR char *argv[]) +{ + const struct CMUnitTest tcp_tests[] = + { +#ifdef CONFIG_NET_IPv4 + cmocka_unit_test_setup(test_tcp_connect_ipv4, + test_tcp_connect_ipv4_setup), +#endif + }; + + return cmocka_run_group_tests(tcp_tests, test_tcp_group_setup, + test_tcp_group_teardown); +} diff --git a/testing/nettest/tcp/test_tcp.h b/testing/nettest/tcp/test_tcp.h new file mode 100644 index 00000000000..d8c391b5e81 --- /dev/null +++ b/testing/nettest/tcp/test_tcp.h @@ -0,0 +1,57 @@ +/**************************************************************************** + * apps/testing/nettest/tcp/test_tcp.h + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +#ifndef __APPS_TESTING_NETTEST_TCP_TEST_TCP_H +#define __APPS_TESTING_NETTEST_TCP_TEST_TCP_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include + +/**************************************************************************** + * Name: test_tcp_group_setup + ****************************************************************************/ + +int test_tcp_group_setup(FAR void **state); + +/**************************************************************************** + * Name: test_tcp_group_teardown + ****************************************************************************/ + +int test_tcp_group_teardown(FAR void **state); + +/**************************************************************************** + * Name: test_tcp_connect_ipv4_setup + ****************************************************************************/ + +#ifdef CONFIG_NET_IPv4 +int test_tcp_connect_ipv4_setup(FAR void **state); + +/**************************************************************************** + * Name: test_tcp_connect_ipv4 + ****************************************************************************/ + +void test_tcp_connect_ipv4(FAR void **state); +#endif /* CONFIG_NET_IPv4 */ +#endif /* __APPS_TESTING_NETTEST_TCP_TEST_TCP_H */ diff --git a/testing/nettest/tcp/test_tcp_common.c b/testing/nettest/tcp/test_tcp_common.c new file mode 100644 index 00000000000..bc5f3697aac --- /dev/null +++ b/testing/nettest/tcp/test_tcp_common.c @@ -0,0 +1,47 @@ +/**************************************************************************** + * apps/testing/nettest/tcp/test_tcp_common.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "test_tcp.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_tcp_group_setup + ****************************************************************************/ + +int test_tcp_group_setup(FAR void **state) +{ + return 0; +} + +/**************************************************************************** + * Name: test_tcp_group_teardown + ****************************************************************************/ + +int test_tcp_group_teardown(FAR void **state) +{ + return 0; +} diff --git a/testing/nettest/tcp/test_tcp_connect_ipv4.c b/testing/nettest/tcp/test_tcp_connect_ipv4.c new file mode 100644 index 00000000000..3ee0b71dcc6 --- /dev/null +++ b/testing/nettest/tcp/test_tcp_connect_ipv4.c @@ -0,0 +1,46 @@ +/**************************************************************************** + * apps/testing/nettest/tcp/test_tcp_connect_ipv4.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "test_tcp.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_tcp_connect_ipv4_setup + ****************************************************************************/ + +int test_tcp_connect_ipv4_setup(FAR void **state) +{ + return 0; +} + +/**************************************************************************** + * Name: test_tcp_connect_ipv4 + ****************************************************************************/ + +void test_tcp_connect_ipv4(FAR void **state) +{ +} From 4e854cfe0317c517f84fabf3f082fff411bd636a Mon Sep 17 00:00:00 2001 From: xuxin19 Date: Tue, 28 May 2024 16:52:14 +0800 Subject: [PATCH 124/391] cmake:builtin register support NONE srcs target Signed-off-by: xuxin19 --- builtin/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/builtin/CMakeLists.txt b/builtin/CMakeLists.txt index 5447ff06749..3d8b244e4fe 100644 --- a/builtin/CMakeLists.txt +++ b/builtin/CMakeLists.txt @@ -26,6 +26,8 @@ if(CONFIG_BUILTIN) # generate registry get_property(nuttx_app_libs GLOBAL PROPERTY NUTTX_APPS_LIBRARIES) + get_property(only_registers GLOBAL PROPERTY NUTTX_APPS_ONLY_REGISTER) + list(APPEND nuttx_app_libs ${only_registers}) set(builtin_list_string) set(builtin_proto_string) foreach(module ${nuttx_app_libs}) From a5a93c0a1742bcc8496f2eba23b1759281d24500 Mon Sep 17 00:00:00 2001 From: wangmingrong1 Date: Fri, 10 Jan 2025 18:02:39 +0800 Subject: [PATCH 125/391] stressapptest: Add download step Signed-off-by: wangmingrong1 --- testing/stressapptest/CMakeLists.txt | 34 ++++++++++++++++++++++++++++ testing/stressapptest/Kconfig | 4 ++++ testing/stressapptest/Makefile | 15 ++++++++++++ 3 files changed, 53 insertions(+) diff --git a/testing/stressapptest/CMakeLists.txt b/testing/stressapptest/CMakeLists.txt index c9c075d3dc5..4a618c2a012 100644 --- a/testing/stressapptest/CMakeLists.txt +++ b/testing/stressapptest/CMakeLists.txt @@ -22,6 +22,40 @@ if(CONFIG_TESTING_STRESSAPPTEST) + set(STRESSAPPTEST_DIR ${CMAKE_CURRENT_LIST_DIR}/stressapptest) + + if(NOT EXISTS ${STRESSAPPTEST_DIR}) + + set(STRESSAPPTEST_VERSION ${CONFIG_TESTING_STRESSAPPTEST_VERSION}) + + FetchContent_Declare( + stressapptest + DOWNLOAD_NAME "v${STRESSAPPTEST_VERSION}.tar.gz" + DOWNLOAD_DIR ${CMAKE_CURRENT_LIST_DIR} + URL "https://github.com/stressapptest/stressapptest/archive/refs/tags/v${STRESSAPPTEST_VERSION}.tar.gz" + SOURCE_DIR + ${CMAKE_CURRENT_LIST_DIR}/stressapptest + BINARY_DIR + ${CMAKE_BINARY_DIR}/stressapptest + CONFIGURE_COMMAND + "" + BUILD_COMMAND + "" + INSTALL_COMMAND + "" + TEST_COMMAND + "" + DOWNLOAD_NO_PROGRESS true + TIMEOUT 30) + + FetchContent_GetProperties(stressapptest) + + if(NOT stressapptest_POPULATED) + FetchContent_Populate(stressapptest) + endif() + + endif() + set(SRC_DIR ${CMAKE_CURRENT_LIST_DIR}/stressapptest/src) set(SRCS diff --git a/testing/stressapptest/Kconfig b/testing/stressapptest/Kconfig index 91f59eba10c..c56aeeae5a1 100644 --- a/testing/stressapptest/Kconfig +++ b/testing/stressapptest/Kconfig @@ -16,6 +16,10 @@ config TESTING_STRESSAPPTEST if TESTING_STRESSAPPTEST +config TESTING_STRESSAPPTEST_VERSION + string "Version of stressapptest" + default "1.0.11" + config TESTING_STRESSAPPTEST_PRIORITY int "Priority of stressapptest process" default 100 diff --git a/testing/stressapptest/Makefile b/testing/stressapptest/Makefile index 2cc05d5079a..e124860436d 100644 --- a/testing/stressapptest/Makefile +++ b/testing/stressapptest/Makefile @@ -22,6 +22,21 @@ include $(APPDIR)/Make.defs +STRESSAPPTEST_VERSION=$(patsubst "%",%,$(CONFIG_TESTING_STRESSAPPTEST_VERSION)) + +v$(STRESSAPPTEST_VERSION).tar.gz: + $(call DOWNLOAD,https://github.com/stressapptest/stressapptest/archive/refs/tags/,$@) + +stressapptest: v$(STRESSAPPTEST_VERSION).tar.gz + $(Q) tar -xf $< + $(Q) mv stressapptest-$(STRESSAPPTEST_VERSION) stressapptest + +context:: stressapptest + +distclean:: + $(Q) $(DELFILE) v$(STRESSAPPTEST_VERSION).tar.gz + $(call DELDIR, stressapptest) + VPATH += stressapptest VPATH += stressapptest/src DEPPATH += --dep-path stressapptest From ffd256d32b492643b33a36c6664ad505d86730a8 Mon Sep 17 00:00:00 2001 From: Huang Qi Date: Fri, 10 Jan 2025 18:13:06 +0800 Subject: [PATCH 126/391] Remove unused header files across multiple source files Clean up code by removing redundant and unused header file includes that were identified through static analysis. This improves code readability and reduces unnecessary dependencies. Signed-off-by: Huang Qi --- canutils/slcan/slcan.c | 1 - examples/can/can_main.c | 1 - examples/module/main/module_main.c | 1 - examples/nimble/nimble_main.c | 3 --- examples/nrf24l01_btle/nrf24l01_btle.c | 1 - examples/relays/relays_main.c | 2 -- examples/rpmsgsocket/rpsock_server.c | 1 - examples/usbserial/host.c | 2 -- examples/usrsocktest/usrsocktest_noblock_connect.c | 1 - netutils/pppd/pppd.c | 1 - netutils/telnetc/telnetc.c | 1 - netutils/thttpd/fdwatch.c | 1 - system/vi/vi.c | 1 - system/zmodem/zm_state.c | 1 - testing/drivertest/drivertest_framebuffer.c | 1 - testing/drivertest/drivertest_i2c_spi.c | 1 - testing/drivertest/drivertest_lcd.c | 1 - testing/drivertest/drivertest_watchdog.c | 1 - testing/ostest/schedlock.c | 1 - testing/testsuites/kernel/fs/cases/fs_append_test.c | 1 - testing/testsuites/kernel/fs/cases/fs_creat_test.c | 1 - testing/testsuites/kernel/fs/cases/fs_pread_test.c | 3 --- testing/testsuites/kernel/fs/cases/fs_pwrite_test.c | 2 -- testing/testsuites/kernel/fs/cases/fs_read_test.c | 1 - testing/testsuites/kernel/fs/cases/fs_readlink_test.c | 2 -- testing/testsuites/kernel/fs/cases/fs_sendfile_test.c | 1 - testing/testsuites/kernel/fs/cases/fs_stat_test.c | 1 - testing/testsuites/kernel/fs/cases/fs_stream_test.c | 1 - testing/testsuites/kernel/fs/cases/fs_symlink_test.c | 3 --- testing/testsuites/kernel/mm/cmocka_mm_test.c | 3 --- testing/testsuites/kernel/mutex/cmocka_mutex_test.c | 3 --- testing/testsuites/kernel/pthread/cmocka_pthread_test.c | 3 --- testing/testsuites/kernel/socket/cmocka_socket_test.c | 3 --- testing/testsuites/kernel/syscall/cases/accept_test.c | 2 -- testing/testsuites/kernel/syscall/cases/bind_test.c | 2 -- testing/testsuites/kernel/syscall/cases/dup2_test.c | 1 - testing/testsuites/kernel/syscall/cases/dup_test.c | 1 - testing/testsuites/kernel/syscall/cases/fsync_test.c | 2 -- testing/testsuites/kernel/syscall/cases/getTimeofday_test.c | 1 - testing/testsuites/kernel/syscall/cases/lstat_test.c | 1 - testing/testsuites/kernel/syscall/cases/memcpy_test.c | 1 - testing/testsuites/kernel/syscall/cases/memset_test.c | 1 - testing/testsuites/kernel/syscall/cases/readdir_test.c | 1 - testing/testsuites/kernel/syscall/cases/sched_test.c | 2 -- 44 files changed, 66 deletions(-) diff --git a/canutils/slcan/slcan.c b/canutils/slcan/slcan.c index c2657781406..f6b6c4e3ccc 100644 --- a/canutils/slcan/slcan.c +++ b/canutils/slcan/slcan.c @@ -46,7 +46,6 @@ #include #include #include -#include #include #include diff --git a/examples/can/can_main.c b/examples/can/can_main.c index bba0b2275c3..94402fdfeaf 100644 --- a/examples/can/can_main.c +++ b/examples/can/can_main.c @@ -36,7 +36,6 @@ #include #include #include -#include #include diff --git a/examples/module/main/module_main.c b/examples/module/main/module_main.c index 0d31fb38b51..74dc98b7c3e 100644 --- a/examples/module/main/module_main.c +++ b/examples/module/main/module_main.c @@ -36,7 +36,6 @@ #include #include #include -#include #include #include #include diff --git a/examples/nimble/nimble_main.c b/examples/nimble/nimble_main.c index 829e02cdb08..ba46199f7fc 100644 --- a/examples/nimble/nimble_main.c +++ b/examples/nimble/nimble_main.c @@ -34,8 +34,6 @@ #include #include #include -#include -#include #include "netutils/netinit.h" @@ -51,7 +49,6 @@ #include "services/ias/ble_svc_ias.h" #include "services/lls/ble_svc_lls.h" #include "services/tps/ble_svc_tps.h" -#include "services/gap/ble_svc_gap.h" #include "services/bas/ble_svc_bas.h" #include "services/dis/ble_svc_dis.h" diff --git a/examples/nrf24l01_btle/nrf24l01_btle.c b/examples/nrf24l01_btle/nrf24l01_btle.c index 1f0e68a13a0..ee373798f45 100644 --- a/examples/nrf24l01_btle/nrf24l01_btle.c +++ b/examples/nrf24l01_btle/nrf24l01_btle.c @@ -38,7 +38,6 @@ #include #include #include -#include #include "nrf24l01_btle.h" diff --git a/examples/relays/relays_main.c b/examples/relays/relays_main.c index 1d6695027e6..f5ab6fb7bb0 100644 --- a/examples/relays/relays_main.c +++ b/examples/relays/relays_main.c @@ -36,8 +36,6 @@ #include #include -#include - #ifdef CONFIG_ARCH_RELAYS /**************************************************************************** diff --git a/examples/rpmsgsocket/rpsock_server.c b/examples/rpmsgsocket/rpsock_server.c index a0ba62b7126..467f4f853d0 100644 --- a/examples/rpmsgsocket/rpsock_server.c +++ b/examples/rpmsgsocket/rpsock_server.c @@ -34,7 +34,6 @@ #include #include #include -#include #include #include #include diff --git a/examples/usbserial/host.c b/examples/usbserial/host.c index a001ef5eb7b..c479c4491b9 100644 --- a/examples/usbserial/host.c +++ b/examples/usbserial/host.c @@ -24,8 +24,6 @@ * Included Files ****************************************************************************/ -#include - #include #include #include diff --git a/examples/usrsocktest/usrsocktest_noblock_connect.c b/examples/usrsocktest/usrsocktest_noblock_connect.c index 820ea9f50f4..bc7264bfea7 100644 --- a/examples/usrsocktest/usrsocktest_noblock_connect.c +++ b/examples/usrsocktest/usrsocktest_noblock_connect.c @@ -33,7 +33,6 @@ #include #include #include -#include #include "defines.h" diff --git a/netutils/pppd/pppd.c b/netutils/pppd/pppd.c index cc3d2b047af..73efa27c971 100644 --- a/netutils/pppd/pppd.c +++ b/netutils/pppd/pppd.c @@ -50,7 +50,6 @@ #include #include #include -#include #include #include diff --git a/netutils/telnetc/telnetc.c b/netutils/telnetc/telnetc.c index 24f63c206d1..c39c5471ac5 100644 --- a/netutils/telnetc/telnetc.c +++ b/netutils/telnetc/telnetc.c @@ -47,7 +47,6 @@ #include #include #include -#include #include #if defined(HAVE_ZLIB) diff --git a/netutils/thttpd/fdwatch.c b/netutils/thttpd/fdwatch.c index 320cf1a8571..105fea30f6b 100644 --- a/netutils/thttpd/fdwatch.c +++ b/netutils/thttpd/fdwatch.c @@ -41,7 +41,6 @@ #include #include #include -#include #include "config.h" #include "thttpd_alloc.h" diff --git a/system/vi/vi.c b/system/vi/vi.c index be4abbd84e0..d2c894cf30e 100644 --- a/system/vi/vi.c +++ b/system/vi/vi.c @@ -35,7 +35,6 @@ #include #include #include -#include #include #include #include diff --git a/system/zmodem/zm_state.c b/system/zmodem/zm_state.c index 4b7f4cfaf95..d3add1c6ee3 100644 --- a/system/zmodem/zm_state.c +++ b/system/zmodem/zm_state.c @@ -44,7 +44,6 @@ #include #include #include -#include #include #include #include diff --git a/testing/drivertest/drivertest_framebuffer.c b/testing/drivertest/drivertest_framebuffer.c index 1436d779d30..03edb568033 100644 --- a/testing/drivertest/drivertest_framebuffer.c +++ b/testing/drivertest/drivertest_framebuffer.c @@ -31,7 +31,6 @@ #include #include #include -#include #include #include diff --git a/testing/drivertest/drivertest_i2c_spi.c b/testing/drivertest/drivertest_i2c_spi.c index 1157a2a4ef1..1faaef177a5 100644 --- a/testing/drivertest/drivertest_i2c_spi.c +++ b/testing/drivertest/drivertest_i2c_spi.c @@ -31,7 +31,6 @@ #include #include #include -#include #include #include #include diff --git a/testing/drivertest/drivertest_lcd.c b/testing/drivertest/drivertest_lcd.c index 2a4519cb24e..22195b8bfb3 100644 --- a/testing/drivertest/drivertest_lcd.c +++ b/testing/drivertest/drivertest_lcd.c @@ -33,7 +33,6 @@ #include #include #include -#include #include #include diff --git a/testing/drivertest/drivertest_watchdog.c b/testing/drivertest/drivertest_watchdog.c index 865c381edff..8efa41eb2b2 100644 --- a/testing/drivertest/drivertest_watchdog.c +++ b/testing/drivertest/drivertest_watchdog.c @@ -34,7 +34,6 @@ #include #include #include -#include #include #include #include diff --git a/testing/ostest/schedlock.c b/testing/ostest/schedlock.c index b6e60f8d088..69d2ef0a387 100644 --- a/testing/ostest/schedlock.c +++ b/testing/ostest/schedlock.c @@ -44,7 +44,6 @@ #include #include #include -#include #include #ifdef CONFIG_SIM_WALLTIME_SLEEP diff --git a/testing/testsuites/kernel/fs/cases/fs_append_test.c b/testing/testsuites/kernel/fs/cases/fs_append_test.c index 990f4d93dff..d96d3046104 100644 --- a/testing/testsuites/kernel/fs/cases/fs_append_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_append_test.c @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include diff --git a/testing/testsuites/kernel/fs/cases/fs_creat_test.c b/testing/testsuites/kernel/fs/cases/fs_creat_test.c index 23fcab888f0..3d7d8833060 100644 --- a/testing/testsuites/kernel/fs/cases/fs_creat_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_creat_test.c @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include diff --git a/testing/testsuites/kernel/fs/cases/fs_pread_test.c b/testing/testsuites/kernel/fs/cases/fs_pread_test.c index f1a710cf996..1095a4827e4 100644 --- a/testing/testsuites/kernel/fs/cases/fs_pread_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_pread_test.c @@ -25,7 +25,6 @@ ****************************************************************************/ #include #include -#include #include #include #include @@ -33,11 +32,9 @@ #include #include #include -#include #include #include #include -#include #include "fstest.h" /**************************************************************************** diff --git a/testing/testsuites/kernel/fs/cases/fs_pwrite_test.c b/testing/testsuites/kernel/fs/cases/fs_pwrite_test.c index 1afa3d1cfd4..b44e87b096b 100644 --- a/testing/testsuites/kernel/fs/cases/fs_pwrite_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_pwrite_test.c @@ -25,7 +25,6 @@ ****************************************************************************/ #include #include -#include #include #include #include @@ -33,7 +32,6 @@ #include #include #include -#include #include #include #include diff --git a/testing/testsuites/kernel/fs/cases/fs_read_test.c b/testing/testsuites/kernel/fs/cases/fs_read_test.c index 1ffb0bb8e43..d9659cf8689 100644 --- a/testing/testsuites/kernel/fs/cases/fs_read_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_read_test.c @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include diff --git a/testing/testsuites/kernel/fs/cases/fs_readlink_test.c b/testing/testsuites/kernel/fs/cases/fs_readlink_test.c index c3617c0973b..c6318e4393d 100644 --- a/testing/testsuites/kernel/fs/cases/fs_readlink_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_readlink_test.c @@ -25,7 +25,6 @@ ****************************************************************************/ #include #include -#include #include #include #include @@ -34,7 +33,6 @@ #include #include #include -#include #include #include #include diff --git a/testing/testsuites/kernel/fs/cases/fs_sendfile_test.c b/testing/testsuites/kernel/fs/cases/fs_sendfile_test.c index 5163e7cbfeb..30337e3ae64 100644 --- a/testing/testsuites/kernel/fs/cases/fs_sendfile_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_sendfile_test.c @@ -31,7 +31,6 @@ #include #include #include -#include #include #include #include diff --git a/testing/testsuites/kernel/fs/cases/fs_stat_test.c b/testing/testsuites/kernel/fs/cases/fs_stat_test.c index fb2c096d429..6a4bfb00cb2 100644 --- a/testing/testsuites/kernel/fs/cases/fs_stat_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_stat_test.c @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include diff --git a/testing/testsuites/kernel/fs/cases/fs_stream_test.c b/testing/testsuites/kernel/fs/cases/fs_stream_test.c index fbea3e4e4da..2f7f1670f20 100644 --- a/testing/testsuites/kernel/fs/cases/fs_stream_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_stream_test.c @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include diff --git a/testing/testsuites/kernel/fs/cases/fs_symlink_test.c b/testing/testsuites/kernel/fs/cases/fs_symlink_test.c index a12d727e580..395bb5fe6eb 100644 --- a/testing/testsuites/kernel/fs/cases/fs_symlink_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_symlink_test.c @@ -25,13 +25,10 @@ ****************************************************************************/ #include #include -#include #include #include -#include #include #include -#include #include #include #include diff --git a/testing/testsuites/kernel/mm/cmocka_mm_test.c b/testing/testsuites/kernel/mm/cmocka_mm_test.c index 1c861326bce..3d4e8ee8ca8 100644 --- a/testing/testsuites/kernel/mm/cmocka_mm_test.c +++ b/testing/testsuites/kernel/mm/cmocka_mm_test.c @@ -27,10 +27,7 @@ #include #include #include -#include -#include #include -#include #include #include "MmTest.h" #include diff --git a/testing/testsuites/kernel/mutex/cmocka_mutex_test.c b/testing/testsuites/kernel/mutex/cmocka_mutex_test.c index 64df27069b9..91b64017700 100644 --- a/testing/testsuites/kernel/mutex/cmocka_mutex_test.c +++ b/testing/testsuites/kernel/mutex/cmocka_mutex_test.c @@ -27,10 +27,7 @@ #include #include #include -#include -#include #include -#include #include #include "MutexTest.h" #include diff --git a/testing/testsuites/kernel/pthread/cmocka_pthread_test.c b/testing/testsuites/kernel/pthread/cmocka_pthread_test.c index 8c7b17598e1..5e04ac87a86 100644 --- a/testing/testsuites/kernel/pthread/cmocka_pthread_test.c +++ b/testing/testsuites/kernel/pthread/cmocka_pthread_test.c @@ -27,10 +27,7 @@ #include #include #include -#include -#include #include -#include #include #include "PthreadTest.h" #include diff --git a/testing/testsuites/kernel/socket/cmocka_socket_test.c b/testing/testsuites/kernel/socket/cmocka_socket_test.c index 7b6627272f0..ea070b4a0ba 100644 --- a/testing/testsuites/kernel/socket/cmocka_socket_test.c +++ b/testing/testsuites/kernel/socket/cmocka_socket_test.c @@ -27,10 +27,7 @@ #include #include #include -#include -#include #include -#include #include #include "SocketTest.h" #include diff --git a/testing/testsuites/kernel/syscall/cases/accept_test.c b/testing/testsuites/kernel/syscall/cases/accept_test.c index b1d16c17f4d..7bb32ad5809 100644 --- a/testing/testsuites/kernel/syscall/cases/accept_test.c +++ b/testing/testsuites/kernel/syscall/cases/accept_test.c @@ -36,8 +36,6 @@ #include #include #include -#include -#include #include #include #include diff --git a/testing/testsuites/kernel/syscall/cases/bind_test.c b/testing/testsuites/kernel/syscall/cases/bind_test.c index 1ae9cf39e42..2b01a5a3e13 100644 --- a/testing/testsuites/kernel/syscall/cases/bind_test.c +++ b/testing/testsuites/kernel/syscall/cases/bind_test.c @@ -38,9 +38,7 @@ #include #include #include -#include #include -#include #include #include diff --git a/testing/testsuites/kernel/syscall/cases/dup2_test.c b/testing/testsuites/kernel/syscall/cases/dup2_test.c index 4a354463921..bdd7b0b9723 100644 --- a/testing/testsuites/kernel/syscall/cases/dup2_test.c +++ b/testing/testsuites/kernel/syscall/cases/dup2_test.c @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include diff --git a/testing/testsuites/kernel/syscall/cases/dup_test.c b/testing/testsuites/kernel/syscall/cases/dup_test.c index 7197b5713d7..0d31adae1a8 100644 --- a/testing/testsuites/kernel/syscall/cases/dup_test.c +++ b/testing/testsuites/kernel/syscall/cases/dup_test.c @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include diff --git a/testing/testsuites/kernel/syscall/cases/fsync_test.c b/testing/testsuites/kernel/syscall/cases/fsync_test.c index 0e4ad49af22..8aabf200295 100644 --- a/testing/testsuites/kernel/syscall/cases/fsync_test.c +++ b/testing/testsuites/kernel/syscall/cases/fsync_test.c @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include @@ -38,7 +37,6 @@ #include #include #include -#include #include #include #include diff --git a/testing/testsuites/kernel/syscall/cases/getTimeofday_test.c b/testing/testsuites/kernel/syscall/cases/getTimeofday_test.c index 7c7cb5c733a..92861fd2181 100644 --- a/testing/testsuites/kernel/syscall/cases/getTimeofday_test.c +++ b/testing/testsuites/kernel/syscall/cases/getTimeofday_test.c @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include diff --git a/testing/testsuites/kernel/syscall/cases/lstat_test.c b/testing/testsuites/kernel/syscall/cases/lstat_test.c index 19a71cc946a..8ea39e1f11c 100644 --- a/testing/testsuites/kernel/syscall/cases/lstat_test.c +++ b/testing/testsuites/kernel/syscall/cases/lstat_test.c @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include diff --git a/testing/testsuites/kernel/syscall/cases/memcpy_test.c b/testing/testsuites/kernel/syscall/cases/memcpy_test.c index 60733646d37..bd7fb28f5ca 100644 --- a/testing/testsuites/kernel/syscall/cases/memcpy_test.c +++ b/testing/testsuites/kernel/syscall/cases/memcpy_test.c @@ -36,7 +36,6 @@ #include #include #include -#include #include #include "SyscallTest.h" diff --git a/testing/testsuites/kernel/syscall/cases/memset_test.c b/testing/testsuites/kernel/syscall/cases/memset_test.c index 5a40cea4e7f..bc1989daa83 100644 --- a/testing/testsuites/kernel/syscall/cases/memset_test.c +++ b/testing/testsuites/kernel/syscall/cases/memset_test.c @@ -36,7 +36,6 @@ #include #include #include -#include #include #include "SyscallTest.h" diff --git a/testing/testsuites/kernel/syscall/cases/readdir_test.c b/testing/testsuites/kernel/syscall/cases/readdir_test.c index 13d123e62c1..007c8516615 100644 --- a/testing/testsuites/kernel/syscall/cases/readdir_test.c +++ b/testing/testsuites/kernel/syscall/cases/readdir_test.c @@ -31,7 +31,6 @@ #include #include #include -#include #include #include #include diff --git a/testing/testsuites/kernel/syscall/cases/sched_test.c b/testing/testsuites/kernel/syscall/cases/sched_test.c index 65f227a464a..901a3464950 100644 --- a/testing/testsuites/kernel/syscall/cases/sched_test.c +++ b/testing/testsuites/kernel/syscall/cases/sched_test.c @@ -35,9 +35,7 @@ #include #include #include -#include #include -#include #include #include #include From f7e7453807d6415c3cb5193a7caf03e8747b5ad7 Mon Sep 17 00:00:00 2001 From: Huang Qi Date: Sun, 18 Aug 2024 13:41:51 +0800 Subject: [PATCH 127/391] examples: New app to build Rust with Cargo Build Rust applictions with cargo is the most commn way, and it's more easy to cooporate with Rust ecosystem. This example shows how to use cargo to build a simple hello world application. And please notice that you need to install nighly version of rustc to support this feature, any version after https://github.com/rust-lang/rust/pull/127755 is merged, can use NuttX as cargo target directly. Build ----- To build hello_rust_cargo application, you can use any target that based on RISCV32IMAC, for example: ``` cmake -B build -DBOARD_CONFIG=rv-virt:nsh -GNinja . ``` And disable ARCH_FPU in menuconfig, since the hard coded target triple in this demo is `riscv32imac`. Signed-off-by: Huang Qi --- CMakeLists.txt | 1 + cmake/nuttx_add_rust.cmake | 165 +++++++++++++++++++++++++++++ examples/rust/.gitignore | 1 + examples/rust/CMakeLists.txt | 24 +++++ examples/rust/Make.defs | 23 ++++ examples/rust/Makefile | 25 +++++ examples/rust/hello/.gitignore | 1 + examples/rust/hello/CMakeLists.txt | 31 ++++++ examples/rust/hello/Cargo.toml | 22 ++++ examples/rust/hello/Kconfig | 29 +++++ examples/rust/hello/Make.defs | 26 +++++ examples/rust/hello/Makefile | 36 +++++++ examples/rust/hello/src/lib.rs | 56 ++++++++++ tools/Rust.mk | 125 ++++++++++++++++++++++ 14 files changed, 565 insertions(+) create mode 100644 cmake/nuttx_add_rust.cmake create mode 100644 examples/rust/.gitignore create mode 100644 examples/rust/CMakeLists.txt create mode 100644 examples/rust/Make.defs create mode 100644 examples/rust/Makefile create mode 100644 examples/rust/hello/.gitignore create mode 100644 examples/rust/hello/CMakeLists.txt create mode 100644 examples/rust/hello/Cargo.toml create mode 100644 examples/rust/hello/Kconfig create mode 100644 examples/rust/hello/Make.defs create mode 100644 examples/rust/hello/Makefile create mode 100644 examples/rust/hello/src/lib.rs create mode 100644 tools/Rust.mk diff --git a/CMakeLists.txt b/CMakeLists.txt index e36d9f68f6c..225c354d16c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,6 +33,7 @@ if(CONFIG_APPS_DIR) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake) include(nuttx_add_luamod) include(nuttx_add_wamrmod) + include(nuttx_add_rust) nuttx_add_library(apps) if(NOT EXISTS {NUTTX_APPS_BINDIR}/dummy.c) file(TOUCH ${NUTTX_APPS_BINDIR}/dummy.c) diff --git a/cmake/nuttx_add_rust.cmake b/cmake/nuttx_add_rust.cmake new file mode 100644 index 00000000000..e590a3fdcbb --- /dev/null +++ b/cmake/nuttx_add_rust.cmake @@ -0,0 +1,165 @@ +# ############################################################################## +# cmake/nuttx_add_rust.cmake +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +include(nuttx_parse_function_args) + +# ~~~ +# Convert architecture type to Rust NuttX target +# +# Supported architectures: +# - armv7a: armv7a-nuttx-eabi, armv7a-nuttx-eabihf +# - thumbv6m: thumbv6m-nuttx-eabi +# - thumbv7a: thumbv7a-nuttx-eabi, thumbv7a-nuttx-eabihf +# - thumbv7m: thumbv7m-nuttx-eabi +# - thumbv7em: thumbv7em-nuttx-eabihf +# - thumbv8m.main: thumbv8m.main-nuttx-eabi, thumbv8m.main-nuttx-eabihf +# - thumbv8m.base: thumbv8m.base-nuttx-eabi, thumbv8m.base-nuttx-eabihf +# - riscv32: riscv32imc/imac/imafc-unknown-nuttx-elf +# - riscv64: riscv64imac/imafdc-unknown-nuttx-elf +# +# Inputs: +# ARCHTYPE - Architecture type (e.g. thumbv7m, riscv32) +# ABITYPE - ABI type (e.g. eabi, eabihf) +# CPUTYPE - CPU type (e.g. cortex-m4, sifive-e20) +# +# Output: +# OUTPUT - Rust target triple (e.g. riscv32imac-unknown-nuttx-elf, +# thumbv7m-nuttx-eabi, thumbv7em-nuttx-eabihf) +# ~~~ + +function(nuttx_rust_target_triple ARCHTYPE ABITYPE CPUTYPE OUTPUT) + if(ARCHTYPE MATCHES "thumb") + if(ARCHTYPE MATCHES "thumbv8m") + # Extract just the base architecture type (thumbv8m.main or thumbv8m.base) + if(ARCHTYPE MATCHES "thumbv8m.main") + set(ARCH_BASE "thumbv8m.main") + elseif(ARCHTYPE MATCHES "thumbv8m.base") + set(ARCH_BASE "thumbv8m.base") + else() + # Otherwise determine if we should use thumbv8m.main or thumbv8m.base + # based on CPU type + if(CPUTYPE MATCHES "cortex-m23") + set(ARCH_BASE "thumbv8m.base") + else() + set(ARCH_BASE "thumbv8m.main") + endif() + endif() + set(TARGET_TRIPLE "${ARCH_BASE}-nuttx-${ABITYPE}") + else() + set(TARGET_TRIPLE "${ARCHTYPE}-nuttx-${ABITYPE}") + endif() + elseif(ARCHTYPE STREQUAL "riscv32") + if(CPUTYPE STREQUAL "sifive-e20") + set(TARGET_TRIPLE "riscv32imc-unknown-nuttx-elf") + elseif(CPUTYPE STREQUAL "sifive-e31") + set(TARGET_TRIPLE "riscv32imac-unknown-nuttx-elf") + elseif(CPUTYPE STREQUAL "sifive-e76") + set(TARGET_TRIPLE "riscv32imafc-unknown-nuttx-elf") + else() + set(TARGET_TRIPLE "riscv32imc-unknown-nuttx-elf") + endif() + elseif(ARCHTYPE STREQUAL "riscv64") + if(CPUTYPE STREQUAL "sifive-s51") + set(TARGET_TRIPLE "riscv64imac-unknown-nuttx-elf") + elseif(CPUTYPE STREQUAL "sifive-u54") + set(TARGET_TRIPLE "riscv64imafdc-unknown-nuttx-elf") + else() + set(TARGET_TRIPLE "riscv64imac-unknown-nuttx-elf") + endif() + endif() + set(${OUTPUT} + ${TARGET_TRIPLE} + PARENT_SCOPE) +endfunction() + +# ~~~ +# nuttx_add_rust +# +# Description: +# Build a Rust crate and add it as a static library to the NuttX build system +# +# Example: +# nuttx_add_rust( +# CRATE_NAME +# hello +# CRATE_PATH +# ${CMAKE_CURRENT_SOURCE_DIR}/hello +# ) +# ~~~ + +function(nuttx_add_rust) + + # parse arguments into variables + nuttx_parse_function_args( + FUNC + nuttx_add_rust + ONE_VALUE + CRATE_NAME + CRATE_PATH + REQUIRED + CRATE_NAME + CRATE_PATH + ARGN + ${ARGN}) + + # Determine build profile based on CONFIG_DEBUG_FULLOPT + if(CONFIG_DEBUG_FULLOPT) + set(RUST_PROFILE "release") + else() + set(RUST_PROFILE "debug") + endif() + + # Get the Rust target triple + nuttx_rust_target_triple(${LLVM_ARCHTYPE} ${LLVM_ABITYPE} ${LLVM_CPUTYPE} + RUST_TARGET) + + # Set up build directory in current binary dir + set(RUST_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CRATE_NAME}) + set(RUST_LIB_PATH + ${RUST_BUILD_DIR}/${RUST_TARGET}/${RUST_PROFILE}/lib${CRATE_NAME}.a) + + # Create build directory + file(MAKE_DIRECTORY ${RUST_BUILD_DIR}) + + # Add a custom command to build the Rust crate + add_custom_command( + OUTPUT ${RUST_LIB_PATH} + COMMAND + cargo build --${RUST_PROFILE} -Zbuild-std=std,panic_abort --manifest-path + ${CRATE_PATH}/Cargo.toml --target ${RUST_TARGET} --target-dir + ${RUST_BUILD_DIR} + COMMENT "Building Rust crate ${CRATE_NAME}" + VERBATIM) + + # Add a custom target that depends on the built library + add_custom_target(${CRATE_NAME}_build ALL DEPENDS ${RUST_LIB_PATH}) + + # Add imported library target + add_library(${CRATE_NAME} STATIC IMPORTED GLOBAL) + set_target_properties(${CRATE_NAME} PROPERTIES IMPORTED_LOCATION + ${RUST_LIB_PATH}) + + # Add the Rust library to NuttX build + nuttx_add_extra_library(${RUST_LIB_PATH}) + + # Ensure the Rust library is built before linking + add_dependencies(${CRATE_NAME} ${CRATE_NAME}_build) + +endfunction() diff --git a/examples/rust/.gitignore b/examples/rust/.gitignore new file mode 100644 index 00000000000..9e1d2593ee8 --- /dev/null +++ b/examples/rust/.gitignore @@ -0,0 +1 @@ +/Kconfig diff --git a/examples/rust/CMakeLists.txt b/examples/rust/CMakeLists.txt new file mode 100644 index 00000000000..a4fe835a8bd --- /dev/null +++ b/examples/rust/CMakeLists.txt @@ -0,0 +1,24 @@ +# ############################################################################## +# apps/examples/rust/CMakeLists.txt +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +nuttx_add_subdirectory() +nuttx_generate_kconfig(MENUDESC "Rust Examples") diff --git a/examples/rust/Make.defs b/examples/rust/Make.defs new file mode 100644 index 00000000000..e7fdfe51da0 --- /dev/null +++ b/examples/rust/Make.defs @@ -0,0 +1,23 @@ +############################################################################ +# apps/examples/rust/Make.defs +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +include $(wildcard $(APPDIR)/examples/rust/*/Make.defs) diff --git a/examples/rust/Makefile b/examples/rust/Makefile new file mode 100644 index 00000000000..5d75f316ea6 --- /dev/null +++ b/examples/rust/Makefile @@ -0,0 +1,25 @@ +############################################################################ +# apps/examples/rust/Makefile +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +MENUDESC = "Rust Examples" + +include $(APPDIR)/Directory.mk diff --git a/examples/rust/hello/.gitignore b/examples/rust/hello/.gitignore new file mode 100644 index 00000000000..eb5a316cbd1 --- /dev/null +++ b/examples/rust/hello/.gitignore @@ -0,0 +1 @@ +target diff --git a/examples/rust/hello/CMakeLists.txt b/examples/rust/hello/CMakeLists.txt new file mode 100644 index 00000000000..c0daea419c4 --- /dev/null +++ b/examples/rust/hello/CMakeLists.txt @@ -0,0 +1,31 @@ +# ############################################################################## +# apps/examples/rust/hello/CMakeLists.txt +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_EXAMPLES_HELLO_RUST_CARGO) + + # Build the Rust crate using nuttx_add_rust + nuttx_add_rust(CRATE_NAME hello CRATE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) + + nuttx_add_application( + NAME ${CONFIG_EXAMPLES_HELLO_RUST_CARGO_PROGNAME} STACKSIZE + ${CONFIG_EXAMPLES_HELLO_STACKSIZE} PRIORITY + ${CONFIG_EXAMPLES_HELLO_PRIORITY}) + +endif() # CONFIG_EXAMPLES_HELLO_RUST_CARGO diff --git a/examples/rust/hello/Cargo.toml b/examples/rust/hello/Cargo.toml new file mode 100644 index 00000000000..d6cba821792 --- /dev/null +++ b/examples/rust/hello/Cargo.toml @@ -0,0 +1,22 @@ +[package] +name = "hello" +version = "0.1.0" +edition = "2021" + +[lib] +crate-type = ["staticlib"] + +[profile.dev] +panic = "abort" + +# Special hanlding for the panic! macro, can be removed once +# the libstd port for NuttX is complete. +[profile.release] +panic = "abort" +lto = true + +[dependencies] +serde = { version = "1.0", features = ["derive"] } +serde_json = "1.0" + +tokio = { version = "1", features = ["rt"] } diff --git a/examples/rust/hello/Kconfig b/examples/rust/hello/Kconfig new file mode 100644 index 00000000000..47954ed0f41 --- /dev/null +++ b/examples/rust/hello/Kconfig @@ -0,0 +1,29 @@ +# +# For a description of the syntax of this configuration file, +# see the file kconfig-language.txt in the NuttX tools repository. +# + +config EXAMPLES_HELLO_RUST_CARGO + tristate "\"Hello, Rust!\" example with Cargo" + default n + ---help--- + Enable the \"Hello, Rust!\" example using Cargo to build. + +if EXAMPLES_HELLO_RUST_CARGO + +config EXAMPLES_HELLO_RUST_CARGO_PROGNAME + string "Program name" + default "hello_rust_cargo" + ---help--- + This is the name of the program that will be used when the + program is installed. + +config EXAMPLES_HELLO_RUST_CARGO_PRIORITY + int "Hello Rust task priority" + default 100 + +config EXAMPLES_HELLO_RUST_CARGO_STACKSIZE + int "Hello Rust stack size" + default DEFAULT_TASK_STACKSIZE + +endif diff --git a/examples/rust/hello/Make.defs b/examples/rust/hello/Make.defs new file mode 100644 index 00000000000..aaacb0efa96 --- /dev/null +++ b/examples/rust/hello/Make.defs @@ -0,0 +1,26 @@ +############################################################################ +# apps/examples/hello_rust_cargo/Make.defs +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +include $(APPDIR)/tools/Rust.mk + +ifneq ($(CONFIG_EXAMPLES_HELLO_RUST_CARGO),) +CONFIGURED_APPS += $(APPDIR)/examples/rust/hello +EXTRA_LIBS += $(call RUST_GET_BINDIR,hello,$(APPDIR)/examples/rust) +endif diff --git a/examples/rust/hello/Makefile b/examples/rust/hello/Makefile new file mode 100644 index 00000000000..2c638eb3c44 --- /dev/null +++ b/examples/rust/hello/Makefile @@ -0,0 +1,36 @@ +############################################################################ +# apps/examples/rust/hello/Makefile +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +include $(APPDIR)/Make.defs + +# Hello, Rust! built-in application info + +PROGNAME = $(CONFIG_EXAMPLES_HELLO_RUST_CARGO_PROGNAME) +PRIORITY = $(CONFIG_EXAMPLES_HELLO_RUST_CARGO_PRIORITY) +STACKSIZE = $(CONFIG_EXAMPLES_HELLO_RUST_CARGO_STACKSIZE) +MODULE = $(CONFIG_EXAMPLES_HELLO_RUST_CARGO) + +context:: + $(call RUST_CARGO_BUILD,hello,$(APPDIR)/examples/rust) + +clean:: + $(call RUST_CARGO_CLEAN,hello,$(APPDIR)/examples/rust) + +include $(APPDIR)/Application.mk diff --git a/examples/rust/hello/src/lib.rs b/examples/rust/hello/src/lib.rs new file mode 100644 index 00000000000..f50cf5bc5c3 --- /dev/null +++ b/examples/rust/hello/src/lib.rs @@ -0,0 +1,56 @@ +extern crate serde; +extern crate serde_json; + +use serde::{Deserialize, Serialize}; + +#[derive(Serialize, Deserialize)] +struct Person { + name: String, + age: u8, +} + +// Function hello_rust_cargo without manglng +#[no_mangle] +pub extern "C" fn hello_rust_cargo_main() { + // Print hello world to stdout + + let john = Person { + name: "John".to_string(), + age: 30, + }; + + let json_str = serde_json::to_string(&john).unwrap(); + println!("{}", json_str); + + let jane = Person { + name: "Jane".to_string(), + age: 25, + }; + + let json_str_jane = serde_json::to_string(&jane).unwrap(); + println!("{}", json_str_jane); + + let json_data = r#" + { + "name": "Alice", + "age": 28 + }"#; + + let alice: Person = serde_json::from_str(json_data).unwrap(); + println!("Deserialized: {} is {} years old", alice.name, alice.age); + + let pretty_json_str = serde_json::to_string_pretty(&alice).unwrap(); + println!("Pretty JSON:\n{}", pretty_json_str); + + tokio::runtime::Builder::new_current_thread() + .enable_all() + .build() + .unwrap() + .block_on(async { + println!("Hello world from tokio!"); + }); + + loop { + // Do nothing + } +} diff --git a/tools/Rust.mk b/tools/Rust.mk new file mode 100644 index 00000000000..f62d51e7bdc --- /dev/null +++ b/tools/Rust.mk @@ -0,0 +1,125 @@ +############################################################################ +# apps/tools/Rust.mk +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +# Generate Rust target triple based on LLVM architecture configuration +# +# Uses the following LLVM variables directly: +# - LLVM_ARCHTYPE: Architecture type (e.g. thumbv7m, riscv32) +# - LLVM_ABITYPE: ABI type (e.g. eabi, eabihf) +# - LLVM_CPUTYPE: CPU type (e.g. cortex-m23, sifive-e20) +# +# Supported architectures and their target triples: +# - armv7a: armv7a-nuttx-eabi, armv7a-nuttx-eabihf +# - thumbv6m: thumbv6m-nuttx-eabi +# - thumbv7a: thumbv7a-nuttx-eabi, thumbv7a-nuttx-eabihf +# - thumbv7m: thumbv7m-nuttx-eabi +# - thumbv7em: thumbv7em-nuttx-eabihf +# - thumbv8m.main: thumbv8m.main-nuttx-eabi, thumbv8m.main-nuttx-eabihf +# - thumbv8m.base: thumbv8m.base-nuttx-eabi, thumbv8m.base-nuttx-eabihf +# - riscv32: riscv32imc/imac/imafc-unknown-nuttx-elf +# - riscv64: riscv64imac/imafdc-unknown-nuttx-elf +# +# Usage: $(call RUST_TARGET_TRIPLE) +# +# Output: +# Rust target triple (e.g. riscv32imac-unknown-nuttx-elf, +# thumbv7m-nuttx-eabi, thumbv7em-nuttx-eabihf) + +define RUST_TARGET_TRIPLE +$(or \ + $(and $(filter thumb%,$(LLVM_ARCHTYPE)), \ + $(if $(filter thumbv8m%,$(LLVM_ARCHTYPE)), \ + $(if $(filter cortex-m23,$(LLVM_CPUTYPE)),thumbv8m.base,thumbv8m.main)-nuttx-$(LLVM_ABITYPE), \ + $(LLVM_ARCHTYPE)-nuttx-$(LLVM_ABITYPE) \ + ) \ + ), \ + $(and $(filter riscv32,$(LLVM_ARCHTYPE)), \ + riscv32$(or \ + $(and $(filter sifive-e20,$(LLVM_CPUTYPE)),imc), \ + $(and $(filter sifive-e31,$(LLVM_CPUTYPE)),imac), \ + $(and $(filter sifive-e76,$(LLVM_CPUTYPE)),imafc), \ + imc \ + )-unknown-nuttx-elf \ + ), \ + $(and $(filter riscv64,$(LLVM_ARCHTYPE)), \ + riscv64$(or \ + $(and $(filter sifive-s51,$(LLVM_CPUTYPE)),imac), \ + $(and $(filter sifive-u54,$(LLVM_CPUTYPE)),imafdc), \ + imac \ + )-unknown-nuttx-elf \ + ) \ +) +endef + +# Build Rust project using cargo +# +# Usage: $(call RUST_CARGO_BUILD,cratename,prefix) +# +# Inputs: +# cratename - Name of the Rust crate (e.g. hello) +# prefix - Path prefix to the crate (e.g. path/to/project) +# +# Output: +# None, builds the Rust project + +ifeq ($(CONFIG_DEBUG_FULLOPT),y) +define RUST_CARGO_BUILD + cargo build --release -Zbuild-std=std,panic_abort \ + --manifest-path $(2)/$(1)/Cargo.toml \ + --target $(call RUST_TARGET_TRIPLE) +endef +else +define RUST_CARGO_BUILD + @echo "Building Rust code with cargo..." + cargo build -Zbuild-std=std,panic_abort \ + --manifest-path $(2)/$(1)/Cargo.toml \ + --target $(call RUST_TARGET_TRIPLE) +endef +endif + +# Clean Rust project using cargo +# +# Usage: $(call RUST_CARGO_CLEAN,cratename,prefix) +# +# Inputs: +# cratename - Name of the Rust crate (e.g. hello) +# prefix - Path prefix to the crate (e.g. path/to/project) +# +# Output: +# None, cleans the Rust project + +define RUST_CARGO_CLEAN + cargo clean --manifest-path $(2)/$(1)/Cargo.toml +endef + +# Get Rust binary path for given crate and path prefix +# +# Usage: $(call RUST_GET_BINDIR,cratename,prefix) +# +# Inputs: +# cratename - Name of the Rust crate (e.g. hello) +# prefix - Path prefix to the crate (e.g. path/to/project) +# +# Output: +# Path to the Rust binary (e.g. path/to/project/target/riscv32imac-unknown-nuttx-elf/release/libhello.a) + +define RUST_GET_BINDIR +$(2)/$(1)/target/$(strip $(call RUST_TARGET_TRIPLE))/$(if $(CONFIG_DEBUG_FULLOPT),release,debug)/lib$(1).a +endef From 46f77a632d09817692d293612ca45d38231b034c Mon Sep 17 00:00:00 2001 From: Huang Qi Date: Fri, 10 Jan 2025 23:36:47 +0800 Subject: [PATCH 128/391] examples/usbserial: Fix style issues in host.c - Break long preprocessor conditionals across multiple lines - Add spaces around operators for better readability - Reformat long string literals to fit within line length limits - Improve consistency in spacing around parentheses and brackets Signed-off-by: Huang Qi --- examples/usbserial/host.c | 130 ++++++++++++++++++++------------------ 1 file changed, 70 insertions(+), 60 deletions(-) diff --git a/examples/usbserial/host.c b/examples/usbserial/host.c index c479c4491b9..0e29ff52539 100644 --- a/examples/usbserial/host.c +++ b/examples/usbserial/host.c @@ -38,14 +38,17 @@ * Pre-processor Definitions ****************************************************************************/ -#if defined(CONFIG_EXAMPLES_USBSERIAL_INONLY) && defined(CONFIG_EXAMPLES_USBSERIAL_OUTONLY) +#if defined(CONFIG_EXAMPLES_USBSERIAL_INONLY) && \ + defined(CONFIG_EXAMPLES_USBSERIAL_OUTONLY) # error "Cannot define both CONFIG_EXAMPLES_USBSERIAL_INONLY and _OUTONLY" #endif -#if defined(CONFIG_EXAMPLES_USBSERIAL_ONLYSMALL) && defined(CONFIG_EXAMPLES_USBSERIAL_ONLYBIG) +#if defined(CONFIG_EXAMPLES_USBSERIAL_ONLYSMALL) && \ + defined(CONFIG_EXAMPLES_USBSERIAL_ONLYBIG) # error "Cannot define both CONFIG_EXAMPLES_USBSERIAL_ONLYSMALL and _ONLYBIG" #endif -#if !defined(CONFIG_EXAMPLES_USBSERIAL_ONLYBIG) && !defined(CONFIG_EXAMPLES_USBSERIAL_ONLYSMALL) +#if !defined(CONFIG_EXAMPLES_USBSERIAL_ONLYBIG) && \ + !defined(CONFIG_EXAMPLES_USBSERIAL_ONLYSMALL) # ifndef CONFIG_EXAMPLES_USBSERIAL_INONLY # define COUNTER_NEEDED 1 # endif @@ -70,56 +73,60 @@ static const char g_shortmsg[] = "Sure... You betcha!!\n"; #ifndef CONFIG_EXAMPLES_USBSERIAL_ONLYSMALL static const char g_longmsg[] = - "I am proud to come to this city as the guest of your distinguished Mayor, " - "who has symbolized throughout the world the fighting spirit of West Berlin. " - "And I am proud to visit the Federal Republic with your distinguished Chancellor " - "who for so many years has committed Germany to democracy and freedom and " - "progress, and to come here in the company of my fellow American, General Clay, " - "who has been in this city during its great moments of crisis and will come " - "again if ever needed.\n" - "Two thousand years ago the proudest boast was \"civis Romanus sum.\" Today, " - "in the world of freedom, the proudest boast is \"Ich bin ein Berliner.\"\r\"" - "I appreciate my interpreter translating my German!\n" - "There are many people in the world who really don't understand, or say they " - "don't, what is the great issue between the free world and the Communist world. " - "Let them come to Berlin. There are some who say that communism is the wave of " - "the future. Let them come to Berlin. And there are some who say in Europe and " - "elsewhere we can work with the Communists. Let them come to Berlin. And there " - "are even a few who say that it is true that communism is an evil system, but it " - "permits us to make economic progress. Lass' sie nach Berlin kommen. Let them " - "come to Berlin.\n" - "Freedom has many difficulties and democracy is not perfect, but we have never " - "had to put a wall up to keep our people in, to prevent them from leaving us. I " - "want to say, on behalf of my countrymen, who live many miles away on the other " - "side of the Atlantic, who are far distant from you, that they take the greatest " - "pride that they have been able to share with you, even from a distance, the " - "story of the last 18 years. I know of no town, no city, that has been besieged " - "for 18 years that still lives with the vitality and the force, and the hope and " - "the determination of the city of West Berlin. While the wall is the most obvious " - "and vivid demonstration of the failures of the Communist system, for all the " - "world to see, we take no satisfaction in it, for it is, as your Mayor has said, " - "an offense not only against history but an offense against humanity, separating " - "families, dividing husbands and wives and brothers and sisters, and dividing a " - "people who wish to be joined together.\n" - "What is true of this city is true of Germany--real, lasting peace in Europe can " - "never be assured as long as one German out of four is denied the elementary " - "right of free men, and that is to make a free choice. In 18 years of peace and " - "good faith, this generation of Germans has earned the right to be free, " - "including the right to unite their families and their nation in lasting peace, " - "with good will to all people. You live in a defended island of freedom, but " - "your life is part of the main. So let me ask you as I close, to lift your eyes " - "beyond the dangers of today, to the hopes of tomorrow, beyond the freedom merely " - "of this city of Berlin, or your country of Germany, to the advance of freedom " - "everywhere, beyond the wall to the day of peace with justice, beyond yourselves " - "and ourselves to all mankind.\n" - "Freedom is indivisible, and when one man is enslaved, all are not free. When all " - "are free, then we can look forward to that day when this city will be joined as " - "one and this country and this great Continent of Europe in a peaceful and hopeful " - "globe. When that day finally comes, as it will, the people of West Berlin can take " - "sober satisfaction in the fact that they were in the front lines for almost two " - "decades.\n" - "All free men, wherever they may live, are citizens of Berlin, and, therefore, " - "as a free man, I take pride in the words \"Ich bin ein Berliner.\"\n" + "I am proud to come to this city as the guest of your distinguished " + "Mayor, who has symbolized throughout the world the fighting spirit of " + "West Berlin. And I am proud to visit the Federal Republic with your " + "distinguished Chancellor who for so many years has committed Germany " + "to democracy and freedom and progress, and to come here in the company " + "of my fellow American, General Clay, who has been in this city during " + "its great moments of crisis and will come again if ever needed.\n" + "Two thousand years ago the proudest boast was \"civis Romanus sum.\" " + "Today, in the world of freedom, the proudest boast is " + "\"Ich bin ein Berliner.\"\r\"I appreciate my interpreter translating " + "my German!\nThere are many people in the world who really " + "don't understand, or say they don't, what is the great issue between " + "the free world and the Communist world. Let them come to Berlin. " + "There are some who say that communism is the wave of the future. " + "Let them come to Berlin. And there are some who say in Europe and " + "elsewhere we can work with the Communists. Let them come to Berlin. " + "And there are even a few who say that it is true that communism is " + "an evil system, but it permits us to make economic progress. " + "Lass' sie nach Berlin kommen. Let them come to Berlin.\n" + "Freedom has many difficulties and democracy is not perfect, but we have " + "never had to put a wall up to keep our people in, to prevent them from " + "leaving us. I want to say, on behalf of my countrymen, who live many " + "miles away on the other side of the Atlantic, who are far distant " + "from you, that they take the greatest pride that they have been able " + "to share with you, even from a distance, the story of the last 18 years. " + "I know of no town, no city, that has been besieged for 18 years that " + "still lives with the vitality and the force, and the hope and the " + "determination of the city of West Berlin. While the wall is the most " + "obvious and vivid demonstration of the failures of the Communist system, " + "for all the world to see, we take no satisfaction in it, for it is, " + "as your Mayor has said, an offense not only against history but an " + "offense against humanity, separating families, dividing husbands and " + "wives and brothers and sisters, and dividing a people who wish to be " + "joined together.\nWhat is true of this city is true of Germany--real, " + "lasting peace in Europe can never be assured as long as one German " + "out of four is denied the elementary right of free men, and that is " + "to make a free choice. In 18 years of peace and good faith, this " + "generation of Germans has earned the right to be free, including the " + "right to unite their families and their nation in lasting peace, " + "with good will to all people. You live in a defended island of freedom, " + "but your life is part of the main. So let me ask you as I close, to lift " + "your eyes beyond the dangers of today, to the hopes of tomorrow, beyond " + "the freedom merely of this city of Berlin, or your country of Germany, " + "to the advance of freedom everywhere, beyond the wall to the day of " + "peace with justice, beyond yourselves and ourselves to all mankind.\n" + "Freedom is indivisible, and when one man is enslaved, all are not free. " + "When all are free, then we can look forward to that day when this city " + "will be joined as one and this country and this great Continent of " + "Europe in a peaceful and hopeful globe. When that day finally comes, " + "as it will, the people of West Berlin can take sober satisfaction " + "in the fact that they were in the front lines for almost two decades.\n" + "All free men, wherever they may live, are citizens of Berlin, and, " + "therefore, as a free man, I take pride in the words " + "\"Ich bin ein Berliner.\"\n" "President John F. Kennedy - June 26, 1963\n"; #endif @@ -200,10 +207,11 @@ int main(int argc, char **argv, char **envp) return 1; } - tty.c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON); + tty.c_iflag &= + ~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON); tty.c_oflag &= ~OPOST; - tty.c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN); - tty.c_cflag &= ~(CSIZE|PARENB); + tty.c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN); + tty.c_cflag &= ~(CSIZE | PARENB); tty.c_cflag |= CS8; ret = tcsetattr(fd, TCSANOW, &tty); @@ -217,14 +225,14 @@ int main(int argc, char **argv, char **envp) /* Wait for and/or send messages -- forever */ - for (;;) + for (; ; ) { /* Test IN messages (device-to-host) */ #ifndef CONFIG_EXAMPLES_USBSERIAL_OUTONLY printf("main: Reading from the serial driver\n"); printf("main: ... (Control-C to terminate) ...\n"); - nbytes = read(fd, g_iobuffer, BUFFER_SIZE-1); + nbytes = read(fd, g_iobuffer, BUFFER_SIZE - 1); if (nbytes < 0) { printf("main: ERROR: Failed to read from %s: %s\n", @@ -249,7 +257,8 @@ int main(int argc, char **argv, char **envp) /* Test OUT messages (host-to-device) */ #ifndef CONFIG_EXAMPLES_USBSERIAL_INONLY -#if !defined(CONFIG_EXAMPLES_USBSERIAL_ONLYSMALL) && !defined(CONFIG_EXAMPLES_USBSERIAL_ONLYBIG) +#if !defined(CONFIG_EXAMPLES_USBSERIAL_ONLYSMALL) && \ + !defined(CONFIG_EXAMPLES_USBSERIAL_ONLYBIG) count++; if (count < 5) { @@ -276,7 +285,8 @@ int main(int argc, char **argv, char **envp) if (nbytes < 0) { - printf("main: ERROR: Failed to write to %s: %s\n", g_ttydev, strerror(errno)); + printf("main: ERROR: Failed to write to %s: %s\n", g_ttydev, + strerror(errno)); close(fd); return 2; } From a6b9e718460a56722205c2a84a9b07b94ca664aa Mon Sep 17 00:00:00 2001 From: zhangshuai39 Date: Thu, 28 Nov 2024 14:58:09 +0800 Subject: [PATCH 129/391] testing/nettest: Add utils directory and two tcp testcases to the testing framework Based on the original directory structure, an additional utils directory is added. It store public functions which used by multiple testcases, such as the tcp server-related functions added this time. In addition, two testcases for testing tcp connections have been added. Signed-off-by: zhangshuai39 --- testing/nettest/CMakeLists.txt | 12 +- testing/nettest/Kconfig | 9 + testing/nettest/Makefile | 10 +- testing/nettest/tcp/test_tcp.c | 12 +- testing/nettest/tcp/test_tcp.h | 38 +- testing/nettest/tcp/test_tcp_common.c | 42 ++ testing/nettest/tcp/test_tcp_connect_ipv4.c | 62 +++ testing/nettest/tcp/test_tcp_connect_ipv6.c | 107 +++++ testing/nettest/utils/nettest_tcpserver.c | 455 ++++++++++++++++++++ testing/nettest/utils/utils.h | 54 +++ 10 files changed, 792 insertions(+), 9 deletions(-) create mode 100644 testing/nettest/tcp/test_tcp_connect_ipv6.c create mode 100644 testing/nettest/utils/nettest_tcpserver.c create mode 100644 testing/nettest/utils/utils.h diff --git a/testing/nettest/CMakeLists.txt b/testing/nettest/CMakeLists.txt index 41e2445a22f..96699191d0a 100644 --- a/testing/nettest/CMakeLists.txt +++ b/testing/nettest/CMakeLists.txt @@ -20,13 +20,19 @@ if(CONFIG_TESTING_NET_TEST) if(CONFIG_TESTING_NET_TCP) - set(SRCS ${CMAKE_CURRENT_LIST_DIR}/tcp/test_tcp.c - ${CMAKE_CURRENT_LIST_DIR}/tcp/test_tcp_common.c) + set(SRCS + ${CMAKE_CURRENT_LIST_DIR}/tcp/test_tcp.c + ${CMAKE_CURRENT_LIST_DIR}/tcp/test_tcp_common.c + ${CMAKE_CURRENT_LIST_DIR}/utils/nettest_tcpserver.c) if(CONFIG_NET_IPv4) list(APPEND SRCS ${CMAKE_CURRENT_LIST_DIR}/tcp/test_tcp_connect_ipv4.c) endif() + if(CONFIG_NET_IPv6) + list(APPEND SRCS ${CMAKE_CURRENT_LIST_DIR}/tcp/test_tcp_connect_ipv6.c) + endif() + nuttx_add_application( NAME cmocka_net_tcp @@ -38,6 +44,8 @@ if(CONFIG_TESTING_NET_TEST) ${CONFIG_TESTING_NET_TEST} DEPENDS cmocka + INCLUDE_DIRECTORIES + ${CMAKE_CURRENT_LIST_DIR}/utils SRCS ${SRCS}) endif() diff --git a/testing/nettest/Kconfig b/testing/nettest/Kconfig index b5332469db3..2aa80f5495b 100644 --- a/testing/nettest/Kconfig +++ b/testing/nettest/Kconfig @@ -23,6 +23,15 @@ config TESTING_NET_TEST_STACKSIZE config TESTING_NET_TCP bool "Enable cmocka net tcp test" depends on NET_TCP && NET_TCPBACKLOG + depends on NET_IPv4 || NET_IPv6 default y +if TESTING_NET_TCP + +config TESTING_NET_TCP_PORT + int "TCP port of test server" + default 5471 + +endif + endif diff --git a/testing/nettest/Makefile b/testing/nettest/Makefile index 3533d44582e..15b2285b3b4 100644 --- a/testing/nettest/Makefile +++ b/testing/nettest/Makefile @@ -20,21 +20,29 @@ include $(APPDIR)/Make.defs +NETTEST_UTILS_DIR := $(APPDIR)/testing/nettest/utils + PRIORITY = $(CONFIG_TESTING_NET_TEST_PRIORITY) STACKSIZE = $(CONFIG_TESTING_NET_TEST_STACKSIZE) MODULE = $(CONFIG_TESTING_NET_TEST) ifeq ($(CONFIG_TESTING_NET_TEST),y) +CFLAGS += -I$(NETTEST_UTILS_DIR) + ifeq ($(CONFIG_TESTING_NET_TCP),y) MAINSRC += tcp/test_tcp.c PROGNAME += cmocka_net_tcp -CSRCS += tcp/test_tcp_common.c +CSRCS += tcp/test_tcp_common.c utils/nettest_tcpserver.c ifeq ($(CONFIG_NET_IPv4), y) CSRCS += tcp/test_tcp_connect_ipv4.c endif +ifeq ($(CONFIG_NET_IPv6), y) +CSRCS += tcp/test_tcp_connect_ipv6.c +endif + endif endif diff --git a/testing/nettest/tcp/test_tcp.c b/testing/nettest/tcp/test_tcp.c index 29edb69ec8f..0e08889d249 100644 --- a/testing/nettest/tcp/test_tcp.c +++ b/testing/nettest/tcp/test_tcp.c @@ -22,10 +22,10 @@ * Included Files ****************************************************************************/ +#include #include #include #include -#include #include #include "test_tcp.h" @@ -39,8 +39,14 @@ int main(int argc, FAR char *argv[]) const struct CMUnitTest tcp_tests[] = { #ifdef CONFIG_NET_IPv4 - cmocka_unit_test_setup(test_tcp_connect_ipv4, - test_tcp_connect_ipv4_setup), + cmocka_unit_test_setup_teardown(test_tcp_connect_ipv4, + test_tcp_connect_ipv4_setup, + test_tcp_common_teardown), +#endif +#ifdef CONFIG_NET_IPv6 + cmocka_unit_test_setup_teardown(test_tcp_connect_ipv6, + test_tcp_connect_ipv6_setup, + test_tcp_common_teardown), #endif }; diff --git a/testing/nettest/tcp/test_tcp.h b/testing/nettest/tcp/test_tcp.h index d8c391b5e81..af07926b6d6 100644 --- a/testing/nettest/tcp/test_tcp.h +++ b/testing/nettest/tcp/test_tcp.h @@ -25,9 +25,21 @@ * Included Files ****************************************************************************/ -#include +#include -#include +/**************************************************************************** + * Public Types + ****************************************************************************/ + +struct nettest_tcp_state_s +{ + int client_fd; + pthread_t server_tid; +}; + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ /**************************************************************************** * Name: test_tcp_group_setup @@ -41,6 +53,12 @@ int test_tcp_group_setup(FAR void **state); int test_tcp_group_teardown(FAR void **state); +/**************************************************************************** + * Name: test_tcp_common_teardown + ****************************************************************************/ + +int test_tcp_common_teardown(FAR void **state); + /**************************************************************************** * Name: test_tcp_connect_ipv4_setup ****************************************************************************/ @@ -53,5 +71,19 @@ int test_tcp_connect_ipv4_setup(FAR void **state); ****************************************************************************/ void test_tcp_connect_ipv4(FAR void **state); -#endif /* CONFIG_NET_IPv4 */ +#endif + +/**************************************************************************** + * Name: test_tcp_connect_ipv6_setup + ****************************************************************************/ + +#ifdef CONFIG_NET_IPv6 +int test_tcp_connect_ipv6_setup(FAR void **state); + +/**************************************************************************** + * Name: test_tcp_connect_ipv6 + ****************************************************************************/ + +void test_tcp_connect_ipv6(FAR void **state); +#endif #endif /* __APPS_TESTING_NETTEST_TCP_TEST_TCP_H */ diff --git a/testing/nettest/tcp/test_tcp_common.c b/testing/nettest/tcp/test_tcp_common.c index bc5f3697aac..be33e7f270e 100644 --- a/testing/nettest/tcp/test_tcp_common.c +++ b/testing/nettest/tcp/test_tcp_common.c @@ -22,7 +22,16 @@ * Included Files ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include + #include "test_tcp.h" +#include "utils.h" /**************************************************************************** * Public Functions @@ -34,6 +43,14 @@ int test_tcp_group_setup(FAR void **state) { + FAR struct nettest_tcp_state_s *tcp_state = zalloc(sizeof(*tcp_state)); + assert_non_null(tcp_state); + + *state = tcp_state; + + tcp_state->server_tid = nettest_create_tcp_lo_server(); + assert_return_code(tcp_state->server_tid, errno); + return 0; } @@ -43,5 +60,30 @@ int test_tcp_group_setup(FAR void **state) int test_tcp_group_teardown(FAR void **state) { + FAR struct nettest_tcp_state_s *tcp_state = *state; + + int ret = nettest_destroy_tcp_lo_server(tcp_state->server_tid); + assert_return_code(ret, errno); + + free(tcp_state); + + return 0; +} + +/**************************************************************************** + * Name: test_tcp_common_teardown + ****************************************************************************/ + +int test_tcp_common_teardown(FAR void **state) +{ + FAR struct nettest_tcp_state_s *tcp_state = *state; + + if (tcp_state->client_fd > 0) + { + shutdown(tcp_state->client_fd, SHUT_RDWR); + close(tcp_state->client_fd); + tcp_state->client_fd = -1; + } + return 0; } diff --git a/testing/nettest/tcp/test_tcp_connect_ipv4.c b/testing/nettest/tcp/test_tcp_connect_ipv4.c index 3ee0b71dcc6..6439c63d1d9 100644 --- a/testing/nettest/tcp/test_tcp_connect_ipv4.c +++ b/testing/nettest/tcp/test_tcp_connect_ipv4.c @@ -22,7 +22,25 @@ * Included Files ****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include + #include "test_tcp.h" +#include "utils.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#define TEST_LOOP_CNT 5 +#define TEST_BUFFER_SIZE 80 +#define TEST_MSG "loopback message" /**************************************************************************** * Public Functions @@ -34,6 +52,23 @@ int test_tcp_connect_ipv4_setup(FAR void **state) { + FAR struct nettest_tcp_state_s *tcp_state = *state; + struct timeval tv; + int ret; + + tcp_state->client_fd = socket(PF_INET, SOCK_STREAM, 0); + assert_true(tcp_state->client_fd > 0); + + tv.tv_sec = 0; + tv.tv_usec = 10000; + ret = setsockopt(tcp_state->client_fd, SOL_SOCKET, + SO_RCVTIMEO, &tv, sizeof(tv)); + assert_return_code(ret, errno); + + ret = setsockopt(tcp_state->client_fd, SOL_SOCKET, + SO_SNDTIMEO, &tv, sizeof(tv)); + assert_return_code(ret, errno); + return 0; } @@ -43,4 +78,31 @@ int test_tcp_connect_ipv4_setup(FAR void **state) void test_tcp_connect_ipv4(FAR void **state) { + FAR struct nettest_tcp_state_s *tcp_state = *state; + struct sockaddr_in myaddr; + char outbuf[TEST_BUFFER_SIZE]; + char inbuf[TEST_BUFFER_SIZE]; + int addrlen; + int ret; + int len; + + addrlen = nettest_lo_addr((FAR struct sockaddr *)&myaddr, AF_INET); + + ret = connect(tcp_state->client_fd, (FAR struct sockaddr *)&myaddr, + addrlen); + assert_return_code(ret, errno); + + for (int i = 0; i < TEST_LOOP_CNT; i++) + { + strcpy(outbuf, TEST_MSG); + len = strlen(outbuf); + ret = send(tcp_state->client_fd, outbuf, len, 0); + assert_true(ret == len); + + ret = recv(tcp_state->client_fd, inbuf, TEST_BUFFER_SIZE, 0); + assert_true(ret == len); + + ret = strncmp(inbuf, TEST_MSG, len); + assert_true(ret == 0); + } } diff --git a/testing/nettest/tcp/test_tcp_connect_ipv6.c b/testing/nettest/tcp/test_tcp_connect_ipv6.c new file mode 100644 index 00000000000..01285d92c5b --- /dev/null +++ b/testing/nettest/tcp/test_tcp_connect_ipv6.c @@ -0,0 +1,107 @@ +/**************************************************************************** + * apps/testing/nettest/tcp/test_tcp_connect_ipv6.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include + +#include "test_tcp.h" +#include "utils.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#define TEST_LOOP_CNT 5 +#define TEST_BUFFER_SIZE 80 +#define TEST_MSG "loopback message" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_tcp_connect_ipv6_setup + ****************************************************************************/ + +int test_tcp_connect_ipv6_setup(FAR void **state) +{ + FAR struct nettest_tcp_state_s *tcp_state = *state; + struct timeval tv; + int ret; + + tcp_state->client_fd = socket(PF_INET6, SOCK_STREAM, 0); + assert_true(tcp_state->client_fd > 0); + + tv.tv_sec = 0; + tv.tv_usec = 10000; + ret = setsockopt(tcp_state->client_fd, SOL_SOCKET, + SO_RCVTIMEO, &tv, sizeof(tv)); + assert_return_code(ret, errno); + + ret = setsockopt(tcp_state->client_fd, SOL_SOCKET, + SO_SNDTIMEO, &tv, sizeof(tv)); + assert_return_code(ret, errno); + + return 0; +} + +/**************************************************************************** + * Name: test_tcp_connect_ipv6 + ****************************************************************************/ + +void test_tcp_connect_ipv6(FAR void **state) +{ + FAR struct nettest_tcp_state_s *tcp_state = *state; + struct sockaddr_in6 myaddr; + char outbuf[TEST_BUFFER_SIZE]; + char inbuf[TEST_BUFFER_SIZE]; + int addrlen; + int ret; + int len; + + addrlen = nettest_lo_addr((FAR struct sockaddr *)&myaddr, AF_INET6); + + ret = connect(tcp_state->client_fd, (FAR struct sockaddr *)&myaddr, + addrlen); + assert_return_code(ret, errno); + + for (int i = 0; i < TEST_LOOP_CNT; i++) + { + strcpy(outbuf, TEST_MSG); + len = strlen(outbuf); + ret = send(tcp_state->client_fd, outbuf, len, 0); + assert_true(ret == len); + + ret = recv(tcp_state->client_fd, inbuf, TEST_BUFFER_SIZE, 0); + assert_true(ret == len); + + ret = strncmp(inbuf, TEST_MSG, len); + assert_true(ret == 0); + } +} diff --git a/testing/nettest/utils/nettest_tcpserver.c b/testing/nettest/utils/nettest_tcpserver.c new file mode 100644 index 00000000000..c31acf8b4a8 --- /dev/null +++ b/testing/nettest/utils/nettest_tcpserver.c @@ -0,0 +1,455 @@ +/**************************************************************************** + * apps/testing/nettest/utils/nettest_tcpserver.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include + +#include "utils.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#define TEST_BUFFER_SIZE 80 +#define EXIT_MSG "exit" + +/**************************************************************************** + * Private Types + ****************************************************************************/ + +struct nettest_listener_s +{ + fd_set master; + fd_set working; + char buffer[TEST_BUFFER_SIZE]; + int listensdv4; + int listensdv6; + int mxsd; +}; + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: net_closeclient + ****************************************************************************/ + +static void nettest_closeclient(FAR struct nettest_listener_s *nls, int sd) +{ + close(sd); + FD_CLR(sd, &nls->master); + + /* If we just closed the max SD, then search downward for the next + * biggest SD. + */ + + while (FD_ISSET(nls->mxsd, &nls->master) == false) + { + nls->mxsd -= 1; + } +} + +/**************************************************************************** + * Name: is_exit_message + ****************************************************************************/ + +static inline bool is_exit_message(FAR char *buffer) +{ + return strncmp(buffer, EXIT_MSG, strlen(EXIT_MSG)) == 0; +} + +/**************************************************************************** + * Name: net_incomingdata + ****************************************************************************/ + +static inline bool nettest_incomingdata(FAR struct nettest_listener_s *nls, + int sd) +{ + FAR char *ptr; + int nbytes; + int ret; + + /* Read data from the socket */ + + for (; ; ) + { + ret = recv(sd, nls->buffer, TEST_BUFFER_SIZE, 0); + if (ret <= 0) + { + if (ret < 0 && errno == EAGAIN) + { + return false; + } + + nettest_closeclient(nls, sd); + return false; + } + + nls->buffer[ret] = '\0'; + if (is_exit_message(nls->buffer)) + { + return true; + } + + /* Echo the data back to the client */ + + nbytes = ret; + for (ptr = nls->buffer; nbytes > 0; ) + { + ret = send(sd, ptr, nbytes, 0); + if (ret >= 0) + { + nbytes -= ret; + ptr += ret; + } + else if (errno == EAGAIN) + { + usleep(1000); + } + else + { + nettest_closeclient(nls, sd); + return false; + } + } + } +} + +/**************************************************************************** + * Name: net_connection + ****************************************************************************/ + +static inline void nettest_connection(FAR struct nettest_listener_s *nls, + int lsd) +{ + /* Loop until all connections have been processed */ + + for (; ; ) + { + int sd = accept4(lsd, NULL, NULL, SOCK_CLOEXEC | SOCK_NONBLOCK); + if (sd >= 0) + { +#ifdef CONFIG_FDCHECK + sd = fdcheck_restore(sd); +#endif + + /* Add the new connection to the master set */ + + FD_SET(sd, &nls->master); + if (sd > nls->mxsd) + { + nls->mxsd = sd; + } + } + else + { + return; + } + } +} + +/**************************************************************************** + * Name: net_cfgsocket + ****************************************************************************/ + +static int nettest_tcpsocket(FAR struct sockaddr *addr, int addrlen) +{ + int listensd; + int value = 1; + int ret; + + listensd = socket(addr->sa_family, SOCK_STREAM | + SOCK_CLOEXEC | SOCK_NONBLOCK, 0); + if (listensd < 0) + { + return listensd; + } + +#ifdef CONFIG_FDCHECK + listensd = fdcheck_restore(listensd); +#endif + + ret = setsockopt(listensd, SOL_SOCKET, SO_REUSEADDR, &value, sizeof(int)); + if (ret < 0) + { + goto errout; + } + + ret = bind(listensd, addr, addrlen); + if (ret < 0) + { + goto errout; + } + + ret = listen(listensd, 32); + if (ret < 0) + { + goto errout; + } + + return listensd; + +errout: + close(listensd); + return ret; +} + +/**************************************************************************** + * Name: nettest_lo_addr + ****************************************************************************/ + +socklen_t nettest_lo_addr(FAR struct sockaddr *addr, int family) +{ + switch (family) + { + case AF_INET: + FAR struct sockaddr_in *addr4 = (FAR struct sockaddr_in *)addr; + addr4->sin_family = AF_INET; + addr4->sin_port = htons(CONFIG_TESTING_NET_TCP_PORT); + addr4->sin_addr.s_addr = htonl(INADDR_LOOPBACK); + return sizeof(struct sockaddr_in); + case AF_INET6: + FAR struct sockaddr_in6 *addr6 = (FAR struct sockaddr_in6 *)addr; + addr6->sin6_family = AF_INET6; + addr6->sin6_port = htons(CONFIG_TESTING_NET_TCP_PORT); + addr6->sin6_addr = (struct in6_addr)IN6ADDR_LOOPBACK_INIT; + return sizeof(struct sockaddr_in6); + default: + return 0; + } +} + +/**************************************************************************** + * Name: net_mksocket + ****************************************************************************/ + +static inline bool nettest_mksockets(FAR struct nettest_listener_s *nls) +{ + struct sockaddr_storage addr; + socklen_t addrlen; + + FD_ZERO(&nls->master); + +#ifdef CONFIG_NET_IPv4 + addrlen = nettest_lo_addr((FAR struct sockaddr *)&addr, AF_INET); + nls->listensdv4 = nettest_tcpsocket((FAR struct sockaddr *)&addr, addrlen); + if (nls->listensdv4 < 0) + { + return false; + } + + FD_SET(nls->listensdv4, &nls->master); +#endif + +#ifdef CONFIG_NET_IPv6 + addrlen = nettest_lo_addr((FAR struct sockaddr *)&addr, AF_INET6); + nls->listensdv6 = nettest_tcpsocket((FAR struct sockaddr *)&addr, addrlen); + if (nls->listensdv6 < 0) + { + return false; + } + + FD_SET(nls->listensdv6, &nls->master); +#endif + + return true; +} + +/**************************************************************************** + * Name: nettest_lo_listener + ****************************************************************************/ + +FAR static void *nettest_lo_listener(pthread_addr_t pvarg) +{ + FAR sem_t *sem = (FAR sem_t *)pvarg; + struct nettest_listener_s nls; + struct timeval timeout; + bool exiting = false; + int nsds; + int ret; + int i; + + /* Set up a listening socket */ + + memset(&nls, 0, sizeof(struct nettest_listener_s)); + nls.listensdv4 = -1; + nls.listensdv6 = -1; + + if (!nettest_mksockets(&nls)) + { + sem_post(sem); + return NULL; + } + + nls.mxsd = MAX(nls.listensdv4, nls.listensdv6); + + /* Set up indefinitely timeout */ + + timeout.tv_sec = -1; + timeout.tv_usec = 0; + + /* Loop waiting for incoming connections or for incoming data + * on any of the connect sockets. + */ + + sem_post(sem); + + while (!exiting) + { + /* Wait on select */ + + memcpy(&nls.working, &nls.master, sizeof(fd_set)); + ret = select(nls.mxsd + 1, &nls.working, NULL, NULL, &timeout); + if (ret < 0) + { + break; + } + + /* Check for timeout */ + + if (ret == 0) + { + continue; + } + + /* Find which descriptors caused the wakeup */ + + nsds = ret; + for (i = 0; i <= nls.mxsd && nsds > 0; i++) + { + /* Is this descriptor ready? */ + + if (FD_ISSET(i, &nls.working)) + { + /* Yes, is it our listener? */ + + nsds--; + if (i == nls.listensdv4 || i == nls.listensdv6) + { + nettest_connection(&nls, i); + } + else + { + exiting = nettest_incomingdata(&nls, i); + } + } + } + } + + /* Close the listening socket */ + +#ifdef CONFIG_NET_IPv4 + close(nls.listensdv4); +#endif +#ifdef CONFIG_NET_IPv6 + close(nls.listensdv6); +#endif + + /* Keeps some compilers from complaining */ + + return NULL; +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: nettest_destroy_tcp_lo_server + ****************************************************************************/ + +int nettest_destroy_tcp_lo_server(pthread_t server_tid) +{ + int sockfd; + int ret; + struct sockaddr_storage myaddr; +#ifdef CONFIG_NET_IPv4 + socklen_t addrlen = nettest_lo_addr((FAR struct sockaddr *)&myaddr, + AF_INET); +#else + socklen_t addrlen = nettest_lo_addr((FAR struct sockaddr *)&myaddr, + AF_INET6); +#endif + + if (server_tid > 0) + { + sockfd = socket(myaddr.ss_family, SOCK_STREAM, 0); + if (sockfd < 0) + { + return -errno; + } + + ret = connect(sockfd, (FAR struct sockaddr *)&myaddr, addrlen); + if (ret < 0) + { + goto err_destory; + } + + ret = send(sockfd, EXIT_MSG, strlen(EXIT_MSG), 0); + if (ret < 0) + { + goto err_destory; + } + + pthread_join(server_tid, NULL); + close(sockfd); + } + + return 0; + +err_destory: + close(sockfd); + return -errno; +} + +/**************************************************************************** + * Name: nettest_create_tcp_lo_server + ****************************************************************************/ + +pthread_t nettest_create_tcp_lo_server(void) +{ + pthread_t server_tid; + sem_t sem; + int ret; + + sem_init(&sem, 0, 0); + + ret = pthread_create(&server_tid, NULL, nettest_lo_listener, &sem); + if (ret != 0) + { + return -ret; + } + + /* Wait for the server to start */ + + sem_wait(&sem); + + return server_tid; +} diff --git a/testing/nettest/utils/utils.h b/testing/nettest/utils/utils.h new file mode 100644 index 00000000000..8625774b46b --- /dev/null +++ b/testing/nettest/utils/utils.h @@ -0,0 +1,54 @@ +/**************************************************************************** + * apps/testing/nettest/utils/utils.h + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +#ifndef __APPS_TESTING_NETTEST_UTILS_UTILS_H +#define __APPS_TESTING_NETTEST_UTILS_UTILS_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +/**************************************************************************** + * Name: nettest_lo_addr + ****************************************************************************/ + +#if defined (CONFIG_TESTING_NET_TCP) +socklen_t nettest_lo_addr(FAR struct sockaddr *addr, int family); + +/**************************************************************************** + * Name: nettest_destroy_tcp_lo_server + ****************************************************************************/ + +int nettest_destroy_tcp_lo_server(pthread_t server_tid); + +/**************************************************************************** + * Name: nettest_create_tcp_lo_server + ****************************************************************************/ + +pthread_t nettest_create_tcp_lo_server(void); +#endif +#endif /* __APPS_TESTING_NETTEST_UTILS_UTILS_H */ From 2df25348984c1989a026e979a687808e11dc6347 Mon Sep 17 00:00:00 2001 From: Zhe Weng Date: Thu, 2 Jan 2025 15:59:30 +0800 Subject: [PATCH 130/391] testing/nettest: Add test for net bufpool Signed-off-by: Zhe Weng --- testing/nettest/CMakeLists.txt | 23 ++++ testing/nettest/Kconfig | 5 + testing/nettest/Makefile | 6 + testing/nettest/others/test_others.c | 46 +++++++ testing/nettest/others/test_others.h | 52 +++++++ testing/nettest/others/test_others_bufpool.c | 134 +++++++++++++++++++ testing/nettest/others/test_others_common.c | 48 +++++++ 7 files changed, 314 insertions(+) create mode 100644 testing/nettest/others/test_others.c create mode 100644 testing/nettest/others/test_others.h create mode 100644 testing/nettest/others/test_others_bufpool.c create mode 100644 testing/nettest/others/test_others_common.c diff --git a/testing/nettest/CMakeLists.txt b/testing/nettest/CMakeLists.txt index 96699191d0a..6a36708dacc 100644 --- a/testing/nettest/CMakeLists.txt +++ b/testing/nettest/CMakeLists.txt @@ -50,4 +50,27 @@ if(CONFIG_TESTING_NET_TEST) ${SRCS}) endif() + if(CONFIG_TESTING_NET_OTHERS) + set(SRCS + ${CMAKE_CURRENT_LIST_DIR}/others/test_others.c + ${CMAKE_CURRENT_LIST_DIR}/others/test_others_common.c + ${CMAKE_CURRENT_LIST_DIR}/others/test_others_bufpool.c) + + nuttx_add_application( + NAME + cmocka_net_others + PRIORITY + ${CONFIG_TESTING_NET_TEST_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_NET_TEST_STACKSIZE} + MODULE + ${CONFIG_TESTING_NET_TEST} + DEPENDS + cmocka + INCLUDE_DIRECTORIES + ${CMAKE_CURRENT_LIST_DIR}/utils + SRCS + ${SRCS}) + endif() + endif() diff --git a/testing/nettest/Kconfig b/testing/nettest/Kconfig index 2aa80f5495b..750b5796a01 100644 --- a/testing/nettest/Kconfig +++ b/testing/nettest/Kconfig @@ -7,6 +7,7 @@ config TESTING_NET_TEST tristate "vela cmocka net test" default n depends on TESTING_CMOCKA + depends on NET ---help--- Enable the cmocka net test @@ -34,4 +35,8 @@ config TESTING_NET_TCP_PORT endif +config TESTING_NET_OTHERS + bool "Enable cmocka net other test" + default y + endif diff --git a/testing/nettest/Makefile b/testing/nettest/Makefile index 15b2285b3b4..2abd410bcbd 100644 --- a/testing/nettest/Makefile +++ b/testing/nettest/Makefile @@ -45,5 +45,11 @@ endif endif +ifeq ($(CONFIG_TESTING_NET_OTHERS),y) +MAINSRC += others/test_others.c +PROGNAME += cmocka_net_others +CSRCS += others/test_others_common.c others/test_others_bufpool.c +endif + endif include $(APPDIR)/Application.mk diff --git a/testing/nettest/others/test_others.c b/testing/nettest/others/test_others.c new file mode 100644 index 00000000000..b883840d237 --- /dev/null +++ b/testing/nettest/others/test_others.c @@ -0,0 +1,46 @@ +/**************************************************************************** + * apps/testing/nettest/others/test_others.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +#include +#include +#include + +#include "test_others.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +int main(int argc, FAR char *argv[]) +{ + const struct CMUnitTest others_tests[] = + { + cmocka_unit_test(test_others_bufpool), + }; + + return cmocka_run_group_tests(others_tests, test_others_group_setup, + test_others_group_teardown); +} diff --git a/testing/nettest/others/test_others.h b/testing/nettest/others/test_others.h new file mode 100644 index 00000000000..f59024e84eb --- /dev/null +++ b/testing/nettest/others/test_others.h @@ -0,0 +1,52 @@ +/**************************************************************************** + * apps/testing/nettest/others/test_others.h + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +#ifndef __APPS_TESTING_NETTEST_OTHERS_TEST_OTHERS_H +#define __APPS_TESTING_NETTEST_OTHERS_TEST_OTHERS_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +/**************************************************************************** + * Name: test_others_group_setup + ****************************************************************************/ + +int test_others_group_setup(FAR void **state); + +/**************************************************************************** + * Name: test_others_group_teardown + ****************************************************************************/ + +int test_others_group_teardown(FAR void **state); + +/**************************************************************************** + * Name: test_others_bufpool + ****************************************************************************/ + +void test_others_bufpool(FAR void **state); + +#endif /* __APPS_TESTING_NETTEST_OTHERS_TEST_OTHERS_H */ diff --git a/testing/nettest/others/test_others_bufpool.c b/testing/nettest/others/test_others_bufpool.c new file mode 100644 index 00000000000..9cb41fafce1 --- /dev/null +++ b/testing/nettest/others/test_others_bufpool.c @@ -0,0 +1,134 @@ +/**************************************************************************** + * apps/testing/nettest/others/test_others_bufpool.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +#include +#include +#include +#include + +#include "../../nuttx/net/utils/utils.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#define TEST_PREALLOC 10 +#define TEST_DYNALLOC 1 +#define TEST_MAXALLOC 20 + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_net_bufpool_alloc_to + ****************************************************************************/ + +static void test_net_bufpool_alloc_to(FAR struct net_bufpool_s *pool, + FAR sq_queue_t *allocated) +{ + FAR sq_entry_t *node; + assert_true(NET_BUFPOOL_TEST(*pool) == OK); + node = NET_BUFPOOL_ALLOC(*pool); + assert_non_null(node); + sq_addlast(node, allocated); +} + +/**************************************************************************** + * Name: test_net_bufpool_free_from + ****************************************************************************/ + +static void test_net_bufpool_free_from(FAR struct net_bufpool_s *pool, + FAR sq_queue_t *allocated) +{ + while (!sq_empty(allocated)) + { + FAR sq_entry_t *node = sq_remfirst(allocated); + NET_BUFPOOL_FREE(*pool, node); + assert_true(NET_BUFPOOL_TEST(*pool) == OK); + } +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_others_bufpool + ****************************************************************************/ + +void test_others_bufpool(FAR void **state) +{ + NET_BUFPOOL_DECLARE(fixed, sizeof(sq_entry_t), TEST_PREALLOC, 0, 0); + NET_BUFPOOL_DECLARE(limited, sizeof(sq_entry_t), TEST_PREALLOC, + TEST_DYNALLOC, TEST_MAXALLOC); + NET_BUFPOOL_DECLARE(unlimited, sizeof(sq_entry_t), TEST_PREALLOC, + TEST_DYNALLOC, 0); + sq_queue_t allocated_fixed; + sq_queue_t allocated_limited; + sq_queue_t allocated_unlimited; + FAR sq_entry_t *node; + int i; + +#ifdef NET_BUFPOOL_INIT + NET_BUFPOOL_INIT(fixed); + NET_BUFPOOL_INIT(limited); + NET_BUFPOOL_INIT(unlimited); +#endif + sq_init(&allocated_fixed); + sq_init(&allocated_limited); + sq_init(&allocated_unlimited); + + for (i = 0; i < TEST_PREALLOC; i++) + { + test_net_bufpool_alloc_to(&fixed, &allocated_fixed); + test_net_bufpool_alloc_to(&limited, &allocated_limited); + test_net_bufpool_alloc_to(&unlimited, &allocated_unlimited); + } + + for (i = TEST_PREALLOC; i < TEST_MAXALLOC; i++) + { + test_net_bufpool_alloc_to(&limited, &allocated_limited); + test_net_bufpool_alloc_to(&unlimited, &allocated_unlimited); + } + + node = NET_BUFPOOL_TRYALLOC(fixed); + assert_null(node); + assert_true(NET_BUFPOOL_TEST(fixed) == -ENOSPC); + + node = NET_BUFPOOL_TRYALLOC(limited); + assert_null(node); + assert_true(NET_BUFPOOL_TEST(limited) == -ENOSPC); + + node = NET_BUFPOOL_TRYALLOC(unlimited); + assert_non_null(node); + assert_true(NET_BUFPOOL_TEST(unlimited) == OK); + NET_BUFPOOL_FREE(unlimited, node); + + test_net_bufpool_free_from(&fixed, &allocated_fixed); + test_net_bufpool_free_from(&limited, &allocated_limited); + test_net_bufpool_free_from(&unlimited, &allocated_unlimited); +} diff --git a/testing/nettest/others/test_others_common.c b/testing/nettest/others/test_others_common.c new file mode 100644 index 00000000000..cdf6a1e8946 --- /dev/null +++ b/testing/nettest/others/test_others_common.c @@ -0,0 +1,48 @@ +/**************************************************************************** + * apps/testing/nettest/others/test_others_common.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "test_others.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: test_others_group_setup + ****************************************************************************/ + +int test_others_group_setup(FAR void **state) +{ + return 0; +} + +/**************************************************************************** + * Name: test_others_group_teardown + ****************************************************************************/ + +int test_others_group_teardown(FAR void **state) +{ + return 0; +} + From 66231194be3de611c18bfaa2e63eece604184041 Mon Sep 17 00:00:00 2001 From: chao an Date: Fri, 27 Dec 2024 14:20:37 +0800 Subject: [PATCH 131/391] apps/system: replace CONFIG_NSH_LINELEN to LINE_MAX Applications should not depend on any properties of nshlib Signed-off-by: chao an --- examples/lp503x/lp503x_main.c | 2 +- netutils/rexec/rexec.c | 2 +- nshlib/nsh.h | 2 +- system/nxcamera/nxcamera_main.c | 2 +- system/nxlooper/nxlooper_main.c | 2 +- system/nxplayer/nxplayer_main.c | 2 +- system/nxrecorder/nxrecorder_main.c | 2 +- system/readline/readline.c | 14 ++------------ system/taskset/taskset.c | 4 ++-- system/trace/trace.c | 2 +- 10 files changed, 12 insertions(+), 22 deletions(-) diff --git a/examples/lp503x/lp503x_main.c b/examples/lp503x/lp503x_main.c index 2d34929a6c5..4ab99803fd5 100644 --- a/examples/lp503x/lp503x_main.c +++ b/examples/lp503x/lp503x_main.c @@ -626,7 +626,7 @@ static int lp503x_cmd_help(FAR char *parg) int main(int argc, FAR char *argv[]) { bool running; - char buffer[CONFIG_NSH_LINELEN]; + char buffer[LINE_MAX]; int len; int x; char *cmd; diff --git a/netutils/rexec/rexec.c b/netutils/rexec/rexec.c index 3276ac56a43..01c8000bf5d 100644 --- a/netutils/rexec/rexec.c +++ b/netutils/rexec/rexec.c @@ -155,7 +155,7 @@ static int do_rexec(FAR struct rexec_arg_s *arg) int main(int argc, FAR char **argv) { - char cmd[CONFIG_NSH_LINELEN]; + char cmd[LINE_MAX]; struct rexec_arg_s arg; int option; int i; diff --git a/nshlib/nsh.h b/nshlib/nsh.h index ef33088acc2..f040e0b16ca 100644 --- a/nshlib/nsh.h +++ b/nshlib/nsh.h @@ -382,7 +382,7 @@ /* Maximum size of one command line (telnet or serial) */ #ifndef CONFIG_NSH_LINELEN -# define CONFIG_NSH_LINELEN 80 +# define CONFIG_NSH_LINELEN LINE_MAX #endif /* The maximum number of nested if-then[-else]-fi sequences that diff --git a/system/nxcamera/nxcamera_main.c b/system/nxcamera/nxcamera_main.c index c5fd52d9ede..754f12e1d2f 100644 --- a/system/nxcamera/nxcamera_main.c +++ b/system/nxcamera/nxcamera_main.c @@ -398,7 +398,7 @@ static int nxcamera_cmd_help(FAR struct nxcamera_s *pcam, FAR char *parg) int main(int argc, FAR char *argv[]) { - char buffer[CONFIG_NSH_LINELEN]; + char buffer[LINE_MAX]; int len; int x; bool running = true; diff --git a/system/nxlooper/nxlooper_main.c b/system/nxlooper/nxlooper_main.c index 82a7ec50df6..710fb8a77a8 100644 --- a/system/nxlooper/nxlooper_main.c +++ b/system/nxlooper/nxlooper_main.c @@ -502,7 +502,7 @@ static int nxlooper_cmd_help(FAR struct nxlooper_s *plooper, char *parg) int main(int argc, FAR char *argv[]) { - char buffer[CONFIG_NSH_LINELEN]; + char buffer[LINE_MAX]; int len; int x; int running; diff --git a/system/nxplayer/nxplayer_main.c b/system/nxplayer/nxplayer_main.c index e4869cf64bd..daeed9477b2 100644 --- a/system/nxplayer/nxplayer_main.c +++ b/system/nxplayer/nxplayer_main.c @@ -739,7 +739,7 @@ static int nxplayer_cmd_help(FAR struct nxplayer_s *pplayer, char *parg) int main(int argc, FAR char *argv[]) { - char buffer[CONFIG_NSH_LINELEN]; + char buffer[LINE_MAX]; int len; int x; int running; diff --git a/system/nxrecorder/nxrecorder_main.c b/system/nxrecorder/nxrecorder_main.c index 3406116962a..5b649d5321f 100644 --- a/system/nxrecorder/nxrecorder_main.c +++ b/system/nxrecorder/nxrecorder_main.c @@ -531,7 +531,7 @@ static int nxrecorder_cmd_help(FAR struct nxrecorder_s *precorder, int main(int argc, FAR char *argv[]) { - char buffer[CONFIG_NSH_LINELEN]; + char buffer[LINE_MAX]; int len; int x; int running; diff --git a/system/readline/readline.c b/system/readline/readline.c index b8032e1ee6a..f767b0ab2bf 100644 --- a/system/readline/readline.c +++ b/system/readline/readline.c @@ -32,16 +32,6 @@ #include "system/readline.h" -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* Maximum size of one command line (telnet or serial) */ - -#ifndef CONFIG_NSH_LINELEN -# define CONFIG_NSH_LINELEN 80 -#endif - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -59,14 +49,14 @@ FAR char *readline(FAR const char *prompt) { - FAR char *line = malloc(CONFIG_NSH_LINELEN); + FAR char *line = malloc(LINE_MAX); if (line != NULL) { #ifdef CONFIG_READLINE_TABCOMPLETION FAR const char *orig = readline_prompt(prompt); #endif - if (readline_fd(line, CONFIG_NSH_LINELEN, + if (readline_fd(line, LINE_MAX, STDIN_FILENO, STDOUT_FILENO) == 0) { free(line); diff --git a/system/taskset/taskset.c b/system/taskset/taskset.c index af74a407667..bae0246a9b3 100644 --- a/system/taskset/taskset.c +++ b/system/taskset/taskset.c @@ -82,7 +82,7 @@ static bool get_cpuset(const char *arg, cpu_set_t *cpu_set) int main(int argc, FAR char *argv[]) { - char command[CONFIG_NSH_LINELEN]; + char command[LINE_MAX]; int exitcode; int option; int pid = -1; @@ -153,7 +153,7 @@ int main(int argc, FAR char *argv[]) } /* Construct actual command with args - * NOTE: total length does not exceed CONFIG_NSH_LINELEN + * NOTE: total length does not exceed LINE_MAX */ for (i = 0; i < argc - 2; i++) diff --git a/system/trace/trace.c b/system/trace/trace.c index 46126b9e253..f4a5454a40a 100644 --- a/system/trace/trace.c +++ b/system/trace/trace.c @@ -229,7 +229,7 @@ static int trace_cmd_dump(FAR const char *name, int index, int argc, static int trace_cmd_cmd(FAR const char *name, int index, int argc, FAR char **argv, int notectlfd) { - char command[CONFIG_NSH_LINELEN]; + char command[LINE_MAX]; bool changed; bool cont = false; From 26173597a9808086ecc89800fece5108872c04da Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Tue, 14 Jan 2025 10:55:27 +0800 Subject: [PATCH 132/391] apps/nshlib: replace CONFIG_NSH_LINELEN to LINE_MAX LINE_MAX: https://github.com/apache/nuttx/pull/15344 Signed-off-by: wangjianyu3 --- nshlib/nsh.h | 6 ------ nshlib/nsh_console.h | 2 +- nshlib/nsh_login.c | 5 ++--- nshlib/nsh_mmcmds.c | 8 ++++---- nshlib/nsh_parse.c | 6 +++--- nshlib/nsh_script.c | 2 +- nshlib/nsh_session.c | 4 ++-- nshlib/nsh_telnetlogin.c | 4 ++-- nshlib/nsh_timcmds.c | 4 ++-- 9 files changed, 17 insertions(+), 24 deletions(-) diff --git a/nshlib/nsh.h b/nshlib/nsh.h index f040e0b16ca..cd0ea0e1a26 100644 --- a/nshlib/nsh.h +++ b/nshlib/nsh.h @@ -379,12 +379,6 @@ # define NSH_HERRNO_OF(err) (err) #endif -/* Maximum size of one command line (telnet or serial) */ - -#ifndef CONFIG_NSH_LINELEN -# define CONFIG_NSH_LINELEN LINE_MAX -#endif - /* The maximum number of nested if-then[-else]-fi sequences that * are permissible. */ diff --git a/nshlib/nsh_console.h b/nshlib/nsh_console.h index 1a9ccf034d3..0b94a2b6bd6 100644 --- a/nshlib/nsh_console.h +++ b/nshlib/nsh_console.h @@ -188,7 +188,7 @@ struct console_stdio_s /* Line input buffer */ - char cn_line[CONFIG_NSH_LINELEN]; + char cn_line[LINE_MAX]; }; /**************************************************************************** diff --git a/nshlib/nsh_login.c b/nshlib/nsh_login.c index 74876fc3d74..cde17f55cac 100644 --- a/nshlib/nsh_login.c +++ b/nshlib/nsh_login.c @@ -173,7 +173,7 @@ int nsh_login(FAR struct console_stdio_s *pstate) /* readline() returns EOF on failure */ - ret = readline_fd(pstate->cn_line, CONFIG_NSH_LINELEN, + ret = readline_fd(pstate->cn_line, LINE_MAX, INFD(pstate), OUTFD(pstate)); if (ret != EOF) { @@ -209,8 +209,7 @@ int nsh_login(FAR struct console_stdio_s *pstate) } password[0] = '\0'; - ret = readline_fd(pstate->cn_line, CONFIG_NSH_LINELEN, - INFD(pstate), -1); + ret = readline_fd(pstate->cn_line, LINE_MAX, INFD(pstate), -1); /* Enable echo again after password */ diff --git a/nshlib/nsh_mmcmds.c b/nshlib/nsh_mmcmds.c index 518702b0767..81427a00baa 100644 --- a/nshlib/nsh_mmcmds.c +++ b/nshlib/nsh_mmcmds.c @@ -58,12 +58,12 @@ int cmd_free(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv) int cmd_memdump(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv) { - char arg[CONFIG_NSH_LINELEN] = ""; + char arg[LINE_MAX] = ""; int i; if (argc == 1) { - strlcpy(arg, "used", CONFIG_NSH_LINELEN); + strlcpy(arg, "used", LINE_MAX); } else if (argc >= 2 && (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "help") == 0)) @@ -75,10 +75,10 @@ int cmd_memdump(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv) { for (i = 1; i < argc; i++) { - strlcat(arg, argv[i], CONFIG_NSH_LINELEN); + strlcat(arg, argv[i], LINE_MAX); if (i < argc - 1) { - strlcat(arg, " ", CONFIG_NSH_LINELEN); + strlcat(arg, " ", LINE_MAX); } } } diff --git a/nshlib/nsh_parse.c b/nshlib/nsh_parse.c index f6922b116ef..3ca731a00eb 100644 --- a/nshlib/nsh_parse.c +++ b/nshlib/nsh_parse.c @@ -607,7 +607,7 @@ static int nsh_execute(FAR struct nsh_vtbl_s *vtbl, { FAR char *sh_argv[4]; FAR char *sh_cmd = "sh"; - char sh_arg2[CONFIG_NSH_LINELEN]; + char sh_arg2[LINE_MAX]; DEBUGASSERT(strncmp(argv[0], sh_cmd, 3) != 0); @@ -2462,7 +2462,7 @@ static int nsh_parse_command(FAR struct nsh_vtbl_s *vtbl, FAR char *cmdline) #endif #ifdef CONFIG_SCHED_INSTRUMENTATION_DUMP - char tracebuf[CONFIG_NSH_LINELEN + 1]; + char tracebuf[LINE_MAX + 1]; strlcpy(tracebuf, cmdline, sizeof(tracebuf)); sched_note_beginex(NOTE_TAG_APP, tracebuf); @@ -2685,7 +2685,7 @@ static int nsh_parse_command(FAR struct nsh_vtbl_s *vtbl, FAR char *cmdline) { FAR char *arg; FAR char *sh_argv[4]; - char sh_arg2[CONFIG_NSH_LINELEN]; + char sh_arg2[LINE_MAX]; if (argv[argc][g_pipeline1_len]) { diff --git a/nshlib/nsh_script.c b/nshlib/nsh_script.c index 52ab377a557..a049de62413 100644 --- a/nshlib/nsh_script.c +++ b/nshlib/nsh_script.c @@ -163,7 +163,7 @@ int nsh_script(FAR struct nsh_vtbl_s *vtbl, FAR const FAR char *cmd, /* Now read the next line from the script file */ - ret = readline_fd(buffer, CONFIG_NSH_LINELEN, vtbl->np.np_fd, -1); + ret = readline_fd(buffer, LINE_MAX, vtbl->np.np_fd, -1); if (ret >= 0) { /* Parse process the command. NOTE: this is recursive... diff --git a/nshlib/nsh_session.c b/nshlib/nsh_session.c index 761f84a04d2..500c8d6f157 100644 --- a/nshlib/nsh_session.c +++ b/nshlib/nsh_session.c @@ -209,7 +209,7 @@ int nsh_session(FAR struct console_stdio_s *pstate, * occurs. Either will cause the session to terminate. */ - ret = cle_fd(pstate->cn_line, nsh_prompt(), CONFIG_NSH_LINELEN, + ret = cle_fd(pstate->cn_line, nsh_prompt(), LINE_MAX, INFD(pstate), OUTFD(pstate)); if (ret < 0) { @@ -227,7 +227,7 @@ int nsh_session(FAR struct console_stdio_s *pstate, * will cause the session to terminate. */ - ret = readline_fd(pstate->cn_line, CONFIG_NSH_LINELEN, + ret = readline_fd(pstate->cn_line, LINE_MAX, INFD(pstate), OUTFD(pstate)); if (ret == EOF) { diff --git a/nshlib/nsh_telnetlogin.c b/nshlib/nsh_telnetlogin.c index 9e23cbc26e0..417ffda6837 100644 --- a/nshlib/nsh_telnetlogin.c +++ b/nshlib/nsh_telnetlogin.c @@ -178,7 +178,7 @@ int nsh_telnetlogin(FAR struct console_stdio_s *pstate) write(OUTFD(pstate), g_userprompt, strlen(g_userprompt)); username[0] = '\0'; - if (readline_fd(pstate->cn_line, CONFIG_NSH_LINELEN, + if (readline_fd(pstate->cn_line, LINE_MAX, INFD(pstate), OUTFD(pstate)) >= 0) { @@ -214,7 +214,7 @@ int nsh_telnetlogin(FAR struct console_stdio_s *pstate) } password[0] = '\0'; - ret = readline_fd(pstate->cn_line, CONFIG_NSH_LINELEN, + ret = readline_fd(pstate->cn_line, LINE_MAX, INFD(pstate), OUTFD(pstate)); /* Enable echo again after password */ diff --git a/nshlib/nsh_timcmds.c b/nshlib/nsh_timcmds.c index cd1bbc378a3..732bb512e9a 100644 --- a/nshlib/nsh_timcmds.c +++ b/nshlib/nsh_timcmds.c @@ -552,7 +552,7 @@ int cmd_timedatectl(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv) #ifndef CONFIG_NSH_DISABLE_WATCH int cmd_watch(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv) { - char buffer[CONFIG_NSH_LINELEN]; + char buffer[LINE_MAX]; int interval = 2; int count = -1; FAR char *cmd; @@ -595,7 +595,7 @@ int cmd_watch(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv) for (i = 0; i < count; i++) { - strlcpy(buffer, cmd, CONFIG_NSH_LINELEN); + strlcpy(buffer, cmd, LINE_MAX); ret = nsh_parse(vtbl, buffer); if (ret < 0) { From a3049aae5695d1a2a3284c5e2374d7c1599878ad Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Tue, 14 Jan 2025 11:39:07 +0800 Subject: [PATCH 133/391] apps/nshlib: Using `lib_get_tempbuffer()` to save stack space Comparison Config: "esp32s3-devkit:adb" with `CONFIG_LINE_MAX=512` Test CMD: `ls | cat | cat | cat` Without this patch | | Before Test CMD | After Test CMD | |---------------:|----------------:|----------------:| | nsh_main.STACK | 0002624/0008096 | 0002624/0008096 | | sh.STACK | 0003360/0004008 | 0003360/0004008 | | Free/Total | 355288/403116 | 355288/403116 | With this patch | | Before Test CMD | After Test CMD | |---------------:|----------------:|----------------:| | nsh_main.STACK | 0001616/0008096 | 0001616/0008096 | | sh.STACK | 0002352/0004008 | 0002352/0004008 | | Free/Total | 355288/403116 | 354760/403116 | Signed-off-by: wangjianyu3 --- nshlib/nsh_parse.c | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/nshlib/nsh_parse.c b/nshlib/nsh_parse.c index 3ca731a00eb..d60e4c76871 100644 --- a/nshlib/nsh_parse.c +++ b/nshlib/nsh_parse.c @@ -607,15 +607,22 @@ static int nsh_execute(FAR struct nsh_vtbl_s *vtbl, { FAR char *sh_argv[4]; FAR char *sh_cmd = "sh"; - char sh_arg2[LINE_MAX]; + FAR char *sh_arg2; DEBUGASSERT(strncmp(argv[0], sh_cmd, 3) != 0); + sh_arg2 = lib_get_tempbuffer(LINE_MAX); + if (sh_arg2 == NULL) + { + nsh_error(vtbl, g_fmtcmdoutofmemory, sh_cmd); + ret = -errno; + } + sh_arg2[0] = '\0'; for (ret = 0; ret < argc; ret++) { - strlcat(sh_arg2, argv[ret], sizeof(sh_arg2)); + strlcat(sh_arg2, argv[ret], LINE_MAX); if (ret < argc - 1) { @@ -632,7 +639,9 @@ static int nsh_execute(FAR struct nsh_vtbl_s *vtbl, * dispatch the backgroud by sh -c "" */ - return nsh_execute(vtbl, 4, sh_argv, param); + ret = nsh_execute(vtbl, 4, sh_argv, param); + lib_put_tempbuffer(sh_arg2); + return ret; } else #endif @@ -2685,7 +2694,7 @@ static int nsh_parse_command(FAR struct nsh_vtbl_s *vtbl, FAR char *cmdline) { FAR char *arg; FAR char *sh_argv[4]; - char sh_arg2[LINE_MAX]; + FAR char *sh_arg2; if (argv[argc][g_pipeline1_len]) { @@ -2703,11 +2712,19 @@ static int nsh_parse_command(FAR struct nsh_vtbl_s *vtbl, FAR char *cmdline) goto dynlist_free; } + sh_arg2 = lib_get_tempbuffer(LINE_MAX); + if (sh_arg2 == NULL) + { + nsh_error(vtbl, g_fmtcmdoutofmemory, cmd); + ret = -errno; + goto dynlist_free; + } + sh_arg2[0] = '\0'; for (ret = 0; ret < argc; ret++) { - strlcat(sh_arg2, argv[ret], sizeof(sh_arg2)); + strlcat(sh_arg2, argv[ret], LINE_MAX); if (ret < argc - 1) { @@ -2723,6 +2740,7 @@ static int nsh_parse_command(FAR struct nsh_vtbl_s *vtbl, FAR char *cmdline) ret = pipe2(pipefd, 0); if (ret < 0) { + lib_put_tempbuffer(sh_arg2); ret = -errno; goto dynlist_free; } @@ -2735,6 +2753,7 @@ static int nsh_parse_command(FAR struct nsh_vtbl_s *vtbl, FAR char *cmdline) vtbl->np.np_bg = true; ret = nsh_execute(vtbl, 4, sh_argv, ¶m); + lib_put_tempbuffer(sh_arg2); vtbl->np.np_bg = bg_save; From 14fa7d27269cb088035d4a0ec34636b178a76eee Mon Sep 17 00:00:00 2001 From: Huang Qi Date: Tue, 14 Jan 2025 22:53:02 +0800 Subject: [PATCH 134/391] examples/rust: Rename hello_rust to rust/baremetal Summary: - Renamed hello_rust example to rust/baremetal to better reflect its purpose - Updated file headers and Makefile paths - Maintained all existing Kconfig options and functionality - Prepares for future Rust development patterns where Cargo will be the mainstream approach, with baremetal demonstrating traditional build method - Creates clearer structure for Rust examples as we expand Rust support Impact: - No functional changes to the example itself - Better organization of Rust examples under examples/rust/ - Existing configurations using this example will continue to work - Build system will now look for the example in the new location Testing: - Confirmed Kconfig options remain unchanged - GitHub CI passed and local build tested Signed-off-by: Huang Qi --- examples/{hello_rust => rust/baremetal}/Kconfig | 3 ++- examples/{hello_rust => rust/baremetal}/Make.defs | 4 ++-- examples/{hello_rust => rust/baremetal}/Makefile | 2 +- examples/{hello_rust => rust/baremetal}/hello_rust_main.rs | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) rename examples/{hello_rust => rust/baremetal}/Kconfig (84%) rename examples/{hello_rust => rust/baremetal}/Make.defs (91%) rename examples/{hello_rust => rust/baremetal}/Makefile (97%) rename examples/{hello_rust => rust/baremetal}/hello_rust_main.rs (98%) diff --git a/examples/hello_rust/Kconfig b/examples/rust/baremetal/Kconfig similarity index 84% rename from examples/hello_rust/Kconfig rename to examples/rust/baremetal/Kconfig index 92e3b1f34d7..a1b391beee6 100644 --- a/examples/hello_rust/Kconfig +++ b/examples/rust/baremetal/Kconfig @@ -7,7 +7,8 @@ config EXAMPLES_HELLO_RUST tristate "\"Hello, Rust!\" example" default n ---help--- - Enable the \"Hello, Rust!\" example + Enable the \"Hello, Rust!\" example to show how to build + and run a baremetal Rust application with rustc. if EXAMPLES_HELLO_RUST diff --git a/examples/hello_rust/Make.defs b/examples/rust/baremetal/Make.defs similarity index 91% rename from examples/hello_rust/Make.defs rename to examples/rust/baremetal/Make.defs index 7cb3099d206..9ea1b9f9f9e 100644 --- a/examples/hello_rust/Make.defs +++ b/examples/rust/baremetal/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/examples/hello_rust/Make.defs +# apps/examples/rust/baremetal/Make.defs # # SPDX-License-Identifier: Apache-2.0 # @@ -21,5 +21,5 @@ ############################################################################ ifneq ($(CONFIG_EXAMPLES_HELLO_RUST),) -CONFIGURED_APPS += $(APPDIR)/examples/hello_rust +CONFIGURED_APPS += $(APPDIR)/examples/rust/baremetal endif diff --git a/examples/hello_rust/Makefile b/examples/rust/baremetal/Makefile similarity index 97% rename from examples/hello_rust/Makefile rename to examples/rust/baremetal/Makefile index b1ac1824ca7..55e98ce7b81 100644 --- a/examples/hello_rust/Makefile +++ b/examples/rust/baremetal/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# apps/examples/hello_rust/Makefile +# apps/examples/rust/baremetal/Makefile # # SPDX-License-Identifier: Apache-2.0 # diff --git a/examples/hello_rust/hello_rust_main.rs b/examples/rust/baremetal/hello_rust_main.rs similarity index 98% rename from examples/hello_rust/hello_rust_main.rs rename to examples/rust/baremetal/hello_rust_main.rs index fa24671cd7f..3d7a3eceba1 100644 --- a/examples/hello_rust/hello_rust_main.rs +++ b/examples/rust/baremetal/hello_rust_main.rs @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/examples/hello_rust/hello_rust_main.rs + * apps/examples/rust/baremetal/hello_rust_main.rs * * SPDX-License-Identifier: Apache-2.0 * From 410ca7d88e101b0c76aa94f5ac18c41f12613d8d Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Wed, 15 Jan 2025 11:00:40 +0800 Subject: [PATCH 135/391] apps/nshlib: Remove the deprecated config NSH_LINELEN NSH_LINELEN is replaced by POSIX standard LINE_MAX. https://github.com/apache/nuttx/pull/15541 https://github.com/apache/nuttx-apps/pull/2943 Signed-off-by: wangjianyu3 --- nshlib/Kconfig | 8 -------- 1 file changed, 8 deletions(-) diff --git a/nshlib/Kconfig b/nshlib/Kconfig index 78633e9da41..77533466e6e 100644 --- a/nshlib/Kconfig +++ b/nshlib/Kconfig @@ -125,14 +125,6 @@ config NSH_CLE endchoice -config NSH_LINELEN - int "Max command line length" - default 64 if DEFAULT_SMALL - default 80 if !DEFAULT_SMALL - ---help--- - The maximum length of one command line and of one output line. - Default: 64/80 - config NSH_DISABLE_SEMICOLON bool "Disable multiple commands per line" default DEFAULT_SMALL From 4432d84dd32b21b0cbeea4b156e4589eb1ae557a Mon Sep 17 00:00:00 2001 From: tengshuangshuang Date: Mon, 23 Dec 2024 19:25:53 +0800 Subject: [PATCH 136/391] test:driver_audio bug fix Signed-off-by: tengshuangshuang --- examples/camera/camera_main.c | 2 +- testing/drivertest/drivertest_audio.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/camera/camera_main.c b/examples/camera/camera_main.c index 221fa4c4b8b..43f1fff9d52 100644 --- a/examples/camera/camera_main.c +++ b/examples/camera/camera_main.c @@ -680,7 +680,7 @@ int main(int argc, FAR char *argv[]) { gettimeofday(&now, NULL); timersub(&now, &start, &delta); - if (timercmp(&delta, &wait, >)) + if (timercmp(&delta, &wait, > /* For checkpatch */)) { printf("Expire time is pasted. GoTo next state.\n"); if (app_state == APP_STATE_BEFORE_CAPTURE) diff --git a/testing/drivertest/drivertest_audio.c b/testing/drivertest/drivertest_audio.c index 2f019fcdd32..5ce08329f15 100644 --- a/testing/drivertest/drivertest_audio.c +++ b/testing/drivertest/drivertest_audio.c @@ -481,7 +481,7 @@ static bool audio_test_timeout(FAR struct audio_state_s *state, gettimeofday(&now, NULL); timersub(&now, &start, &delta); - return timercmp(&delta, &wait, >); + return timercmp(&delta, &wait, > /* For checkpatch */); } static int audio_test_stop(FAR struct audio_state_s *state, int direction) @@ -741,8 +741,8 @@ static int audio_test_setup(FAR void **audio_state) attr.mq_curmsgs = 0; attr.mq_flags = 0; - snprintf(state->mqname, sizeof(state->mqname), "/tmp/%0lx", - (unsigned long)((uintptr_t)state)); + snprintf(state->mqname, sizeof(state->mqname), "/tmp/%p", + ((void *)state)); state->mq = mq_open(state->mqname, O_RDWR | O_CREAT, 0644, &attr); assert_false(state->mq < 0); From b4def306fa36a8c7df26d9d4a1bb8e55ba9c2a20 Mon Sep 17 00:00:00 2001 From: zhangshoukui Date: Thu, 16 Jan 2025 16:29:25 +0800 Subject: [PATCH 137/391] Remove Useless filtering.The string for filtering rules should not point to a stack space ==1805058==ERROR: AddressSanitizer: heap-use-after-free on address 0xe18126a0 at pc 0x52b06320 bp 0xd7b13ee8 sp 0xd7b13ed8 READ of size 1 at 0xe18126a0 thread T0 #0 0x52b0631f in tre_parse regex/regcomp.c:1356 #1 0x52b2b1d0 in regcomp regex/regcomp.c:3710 #2 0x48f55435 in c_regexmatch cmocka/src/cmocka.c:494 #3 0x48f65bcf in _cmocka_run_group_tests cmocka/src/cmocka.c:3252 #4 0x48f67e2d in cmocka_fs_test_main apps/testing/testsuites/kernel/fs/cmocka_fs_test.c:201 #5 0x46210b2a in nxtask_startup sched/task_startup.c:72 #6 0x45ff40fb in nxtask_start task/task_start.c:116 #7 0x462695bb in pre_start sim/sim_initialstate.c:52 Signed-off-by: zhangshoukui --- testing/drivertest/drivertest_framebuffer.c | 5 ----- testing/drivertest/drivertest_lcd.c | 5 ----- 2 files changed, 10 deletions(-) diff --git a/testing/drivertest/drivertest_framebuffer.c b/testing/drivertest/drivertest_framebuffer.c index 03edb568033..2d84567eb26 100644 --- a/testing/drivertest/drivertest_framebuffer.c +++ b/testing/drivertest/drivertest_framebuffer.c @@ -532,7 +532,6 @@ int main(int argc, FAR char *argv[]) /* Initialize the state data */ struct fb_state_s fb_state; - char test_filter[64]; memset(&fb_state, 0, sizeof(struct fb_state_s)); snprintf(fb_state.devpath, sizeof(fb_state.devpath), "%s", @@ -552,9 +551,5 @@ int main(int argc, FAR char *argv[]) fb_teardown, &fb_state), }; - snprintf(test_filter, sizeof(test_filter), "test_case_fb_%d", - fb_state.test_case_id); - cmocka_set_test_filter(test_filter); - return cmocka_run_group_tests(tests, NULL, NULL); } diff --git a/testing/drivertest/drivertest_lcd.c b/testing/drivertest/drivertest_lcd.c index 22195b8bfb3..39530f79e20 100644 --- a/testing/drivertest/drivertest_lcd.c +++ b/testing/drivertest/drivertest_lcd.c @@ -418,7 +418,6 @@ int main(int argc, FAR char *argv[]) /* Initialize the state data */ struct lcd_state_s lcd_state; - char test_filter[64]; memset(&lcd_state, 0, sizeof(struct lcd_state_s)); snprintf(lcd_state.devpath, sizeof(lcd_state.devpath), "%s", @@ -438,9 +437,5 @@ int main(int argc, FAR char *argv[]) lcd_teardown, &lcd_state), }; - snprintf(test_filter, sizeof(test_filter), "test_case_lcd_%d", - lcd_state.test_case_id); - cmocka_set_test_filter(test_filter); - return cmocka_run_group_tests(tests, NULL, NULL); } From f8e4afbad3b9b65e1408ed975ec6edbe80bed903 Mon Sep 17 00:00:00 2001 From: zhangshoukui Date: Thu, 16 Jan 2025 16:31:14 +0800 Subject: [PATCH 138/391] optimize GPIO test for sim test pass cmocka_driver_gpio //gpio input/output is tested by default cmocka_driver_gpio -a /dev/gpio0 -b /dev/gpio1 -l // test loop cmocka_driver_gpio -a /dev/gpio0 -b /dev/gpio0 // gpio input/output is tested by default Signed-off-by: zhangshoukui --- testing/drivertest/drivertest_gpio.c | 78 +++++++++++++++++++++++++--- 1 file changed, 70 insertions(+), 8 deletions(-) diff --git a/testing/drivertest/drivertest_gpio.c b/testing/drivertest/drivertest_gpio.c index a84acf20dcf..32a0afd3d48 100644 --- a/testing/drivertest/drivertest_gpio.c +++ b/testing/drivertest/drivertest_gpio.c @@ -49,6 +49,7 @@ struct pre_build_s { FAR char *gpio_a; FAR char *gpio_b; + bool loop; }; /**************************************************************************** @@ -62,10 +63,11 @@ struct pre_build_s static void show_usage(FAR const char *progname, int exitcode) { printf("Usage: %s -a [dev/gpio0] -b" - " [dev/gpio1] \n", progname); + " [dev/gpio1] -l [loop test]\n", progname); printf("Where:\n"); printf(" -a gpio_a location [default location: dev/gpio0].\n"); printf(" -b gpio_b location [default location: dev/gpio1].\n"); + printf(" -l [default: Test the input and output of GPIO ]\n"); exit(exitcode); } @@ -78,7 +80,7 @@ static void parse_commandline(int argc, FAR char **argv, { int option; - while ((option = getopt(argc, argv, "a:b:")) != ERROR) + while ((option = getopt(argc, argv, "a:b:l")) != ERROR) { switch (option) { @@ -88,6 +90,9 @@ static void parse_commandline(int argc, FAR char **argv, case 'b': pre_build->gpio_b = optarg; break; + case 'l': + pre_build->loop = true; + break; case '?': printf("Unknown option: %c\n", optopt); show_usage(argv[0], EXIT_FAILURE); @@ -133,10 +138,55 @@ static int setup(FAR void **state) } /**************************************************************************** - * Name: gpiotest01 + * Name: drivertest_gpio_one + ****************************************************************************/ + +static void drivertest_gpio_one(FAR void **state) +{ + FAR struct pre_build_s *pre_build; + bool outvalue; + bool invalue; + int fd[2]; + int ret; + int i; + int j; + + pre_build = (FAR struct pre_build_s *)*state; + fd[0] = open(pre_build->gpio_a, O_RDWR); + assert_false(fd[0] < 0); + + fd[1] = open(pre_build->gpio_b, O_RDWR); + assert_false(fd[1] < 0); + + /* Test Single GPIO I/O functionality */ + + for (i = 0; i < 2; i++) + { + ret = ioctl(fd[i], GPIOC_SETPINTYPE, GPIO_INPUT_PIN | GPIO_OUTPUT_PIN); + assert_false(ret < 0); + for (j = 0; j < GPIOTEST_MAXVALUE; j++) + { + outvalue = gpiotest_randbin(); + ret = ioctl(fd[i], GPIOC_WRITE, outvalue); + assert_false(ret < 0); + + ret = ioctl(fd[i], GPIOC_READ, &invalue); + assert_false(ret < 0); + + printf("[input and output test] outvalue is %d, invalue is %d\n", + outvalue, invalue); + assert_int_equal(invalue, outvalue); + } + + close(fd[i]); + } +} + +/**************************************************************************** + * Name: drivertest_gpio_loop ****************************************************************************/ -static void gpiotest01(FAR void **state) +static void drivertest_gpio_loop(FAR void **state) { FAR struct pre_build_s *pre_build; int fd_a; @@ -179,7 +229,7 @@ static void gpiotest01(FAR void **state) ret = ioctl(fd_b, GPIOC_READ, (unsigned long)((uintptr_t)&invalue)); assert_false(ret < 0); - printf("[__Verify__] outvalue is %d, invalue is %d\n", + printf("[Loop test] outvalue is %d, invalue is %d\n", outvalue, invalue); assert_int_equal(invalue, outvalue); } @@ -205,7 +255,7 @@ static void gpiotest01(FAR void **state) ret = ioctl(fd_a, GPIOC_READ, (unsigned long)((uintptr_t)&invalue)); assert_false(ret < 0); - printf("[__Verify__] outvalue is %d, invalue is %d\n", + printf("[Loop test] outvalue is %d, invalue is %d\n", outvalue, invalue); assert_int_equal(invalue, outvalue); } @@ -233,16 +283,28 @@ static int teardown(FAR void **state) int main(int argc, FAR char *argv[]) { + void (*drivertest_gpio)(FAR void **state); FAR struct pre_build_s pre_build = { .gpio_a = "dev/gpio0", - .gpio_b = "dev/gpio1" + .gpio_b = "dev/gpio1", + .loop = false }; parse_commandline(argc, argv, &pre_build); + + if (pre_build.loop) + { + drivertest_gpio = drivertest_gpio_loop; + } + else + { + drivertest_gpio = drivertest_gpio_one; + } + const struct CMUnitTest tests[] = { - cmocka_unit_test_prestate_setup_teardown(gpiotest01, setup, + cmocka_unit_test_prestate_setup_teardown(drivertest_gpio, setup, teardown, &pre_build), }; From 3108c278777636246d3df2c58d1681dc533ceba6 Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Thu, 16 Jan 2025 12:12:17 +0800 Subject: [PATCH 139/391] apps/nshlib: Save result and return ERROR if `lib_get_tempbuffer()` fails Signed-off-by: wangjianyu3 --- nshlib/nsh_parse.c | 1 + 1 file changed, 1 insertion(+) diff --git a/nshlib/nsh_parse.c b/nshlib/nsh_parse.c index d60e4c76871..e21381b9f4b 100644 --- a/nshlib/nsh_parse.c +++ b/nshlib/nsh_parse.c @@ -616,6 +616,7 @@ static int nsh_execute(FAR struct nsh_vtbl_s *vtbl, { nsh_error(vtbl, g_fmtcmdoutofmemory, sh_cmd); ret = -errno; + goto close_redir; } sh_arg2[0] = '\0'; From 4685ca557bb7d9ee85fd6edee9af057940b67851 Mon Sep 17 00:00:00 2001 From: zhangshoukui Date: Thu, 16 Jan 2025 10:24:29 +0800 Subject: [PATCH 140/391] lp503x_main: Minor fix Signed-off-by: zhangshoukui --- examples/lp503x/lp503x_main.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/examples/lp503x/lp503x_main.c b/examples/lp503x/lp503x_main.c index 4ab99803fd5..5a43da39cea 100644 --- a/examples/lp503x/lp503x_main.c +++ b/examples/lp503x/lp503x_main.c @@ -625,20 +625,19 @@ static int lp503x_cmd_help(FAR char *parg) int main(int argc, FAR char *argv[]) { - bool running; char buffer[LINE_MAX]; + FAR char *cmd; + FAR char *arg; + bool running; int len; int x; - char *cmd; - char *arg; fd = open(CONFIG_EXAMPLES_LP503X_DEVPATH, O_CREAT); if (fd < 0) { fprintf(stderr, "ERROR: Failed to open %s: %d\n", CONFIG_EXAMPLES_LP503X_DEVPATH, errno); - close(fd); - return ENODEV; + return -ENODEV; } running = true; From 339eeaa087efcd24d64235f0c4f0f2267e6b0b2f Mon Sep 17 00:00:00 2001 From: zhangshoukui Date: Thu, 12 Dec 2024 17:10:01 +0800 Subject: [PATCH 141/391] Use lib_get_tempbuffer Saving stack Signed-off-by: zhangshoukui --- nshlib/nsh_mmcmds.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/nshlib/nsh_mmcmds.c b/nshlib/nsh_mmcmds.c index 81427a00baa..9cbd01ce030 100644 --- a/nshlib/nsh_mmcmds.c +++ b/nshlib/nsh_mmcmds.c @@ -26,6 +26,7 @@ #include +#include #include #include "nsh.h" @@ -58,9 +59,18 @@ int cmd_free(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv) int cmd_memdump(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv) { - char arg[LINE_MAX] = ""; + FAR char *arg; + int ret; int i; + arg = lib_get_tempbuffer(LINE_MAX); + if (arg == NULL) + { + return -ENOMEM; + } + + arg[0] = '\0'; + if (argc == 1) { strlcpy(arg, "used", LINE_MAX); @@ -68,8 +78,10 @@ int cmd_memdump(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv) else if (argc >= 2 && (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "help") == 0)) { - return nsh_catfile(vtbl, argv[0], - CONFIG_NSH_PROC_MOUNTPOINT "/memdump"); + ret = nsh_catfile(vtbl, argv[0], + CONFIG_NSH_PROC_MOUNTPOINT "/memdump"); + lib_put_tempbuffer(arg); + return ret; } else { @@ -83,8 +95,10 @@ int cmd_memdump(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv) } } - return nsh_writefile(vtbl, argv[0], arg, strlen(arg), - CONFIG_NSH_PROC_MOUNTPOINT "/memdump"); + ret = nsh_writefile(vtbl, argv[0], arg, strlen(arg), + CONFIG_NSH_PROC_MOUNTPOINT "/memdump"); + lib_put_tempbuffer(arg); + return ret; } #endif /* !CONFIG_NSH_DISABLE_MEMDUMP && NSH_HAVE_WRITEFILE */ From f6462111b7a293b301b5b8305da5996af1afd5dd Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Thu, 16 Jan 2025 22:59:29 +0800 Subject: [PATCH 142/391] apps/nshlib: Reuse local variable for cmd_memdump Signed-off-by: wangjianyu3 --- nshlib/nsh_mmcmds.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/nshlib/nsh_mmcmds.c b/nshlib/nsh_mmcmds.c index 9cbd01ce030..b11067098fa 100644 --- a/nshlib/nsh_mmcmds.c +++ b/nshlib/nsh_mmcmds.c @@ -60,7 +60,6 @@ int cmd_free(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv) int cmd_memdump(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv) { FAR char *arg; - int ret; int i; arg = lib_get_tempbuffer(LINE_MAX); @@ -78,10 +77,10 @@ int cmd_memdump(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv) else if (argc >= 2 && (strcmp(argv[1], "-h") == 0 || strcmp(argv[1], "help") == 0)) { - ret = nsh_catfile(vtbl, argv[0], - CONFIG_NSH_PROC_MOUNTPOINT "/memdump"); + i = nsh_catfile(vtbl, argv[0], + CONFIG_NSH_PROC_MOUNTPOINT "/memdump"); lib_put_tempbuffer(arg); - return ret; + return i; } else { @@ -95,10 +94,10 @@ int cmd_memdump(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv) } } - ret = nsh_writefile(vtbl, argv[0], arg, strlen(arg), - CONFIG_NSH_PROC_MOUNTPOINT "/memdump"); + i = nsh_writefile(vtbl, argv[0], arg, strlen(arg), + CONFIG_NSH_PROC_MOUNTPOINT "/memdump"); lib_put_tempbuffer(arg); - return ret; + return i; } #endif /* !CONFIG_NSH_DISABLE_MEMDUMP && NSH_HAVE_WRITEFILE */ From 6669372415b8720becbd5d1d193ddbefda45f523 Mon Sep 17 00:00:00 2001 From: Huang Qi Date: Thu, 16 Jan 2025 21:04:27 +0800 Subject: [PATCH 143/391] wamr: Map armv7a/thumbv7a to armv7/thumbv7 for wamrc Summary: - Added explicit mapping of thumbv7a architecture to thumbv7 in the WAMR toolchain definitions - WAMR's AOT compiler uses armv7/thumbv7 as the target architecture for all ARMv7-A processors - This includes Cortex-A series processors like Cortex-A9 which use the armv7a/thumbv7a ISA Impact: - Fixes AOT compilation for ARM Cortex-A processors using thumbv7a architecture - Maintains compatibility with WAMR's expected target architecture naming - Ensures consistent architecture targeting across all ARMv7-A processors - No impact on other architectures or build configurations Signed-off-by: Huang Qi --- interpreters/wamr/Toolchain.defs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/interpreters/wamr/Toolchain.defs b/interpreters/wamr/Toolchain.defs index c0a6c5b362f..7417282771c 100644 --- a/interpreters/wamr/Toolchain.defs +++ b/interpreters/wamr/Toolchain.defs @@ -39,12 +39,16 @@ else ifeq ($(CONFIG_ARCH_SIM),y) else WTARGET = x86_64 endif +else ifeq ($(LLVM_ARCHTYPE),thumbv7a) + WTARGET = thumbv7 else ifeq ($(findstring thumb,$(LLVM_ARCHTYPE)),thumb) # target triple of thumb may very complex, such as thumbv8m.main+dsp+mve.fp+fp.dp # so we just use the target name before the first plus sign WTARGET = $(shell echo $(LLVM_ARCHTYPE) | cut -d'+' -f1) +else ifeq ($(LLVM_ARCHTYPE),armv7a) + WTARGET = armv7 endif # If WTARGET is not defined, then use the same as LLVM_ARCHTYPE From 9b6de015bc69f3c30159a1b967db25fb5c59b8bc Mon Sep 17 00:00:00 2001 From: Huang Qi Date: Sun, 19 Jan 2025 11:26:07 +0800 Subject: [PATCH 144/391] rust/hello: Optimize the build flags Summary: - Added `codegen-units = 1` and `opt-level = 'z'` to the release profile in `Cargo.toml` - These changes optimize the build for minimal binary size Impact: - Reduces the final binary size by ~7% (244316 -> 228380 bytes) - Improves resource utilization for embedded systems - No functional changes to the application behavior Signed-off-by: Huang Qi --- examples/rust/hello/Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/rust/hello/Cargo.toml b/examples/rust/hello/Cargo.toml index d6cba821792..0741516b909 100644 --- a/examples/rust/hello/Cargo.toml +++ b/examples/rust/hello/Cargo.toml @@ -9,11 +9,11 @@ crate-type = ["staticlib"] [profile.dev] panic = "abort" -# Special hanlding for the panic! macro, can be removed once -# the libstd port for NuttX is complete. [profile.release] panic = "abort" lto = true +codegen-units = 1 +opt-level = 'z' [dependencies] serde = { version = "1.0", features = ["derive"] } From bdb0fcd71bc1d1191a5b3692d5f3be3dc721c9eb Mon Sep 17 00:00:00 2001 From: tengshuangshuang Date: Mon, 20 Jan 2025 11:07:25 +0800 Subject: [PATCH 145/391] apps/testing: move himem_test,mtetest and x86-64-ABI folders to the new arhc folder Signed-off-by: tengshuangshuang --- testing/arch/.gitignore | 1 + testing/arch/CMakeLists.txt | 24 ++++++++++++++++++ testing/arch/Make.defs | 23 +++++++++++++++++ testing/arch/Makefile | 25 +++++++++++++++++++ testing/{ => arch}/himem_test/Kconfig | 0 testing/{ => arch}/himem_test/LibIncludes.mk | 2 +- testing/{ => arch}/himem_test/Make.defs | 4 +-- testing/{ => arch}/himem_test/Makefile | 4 +-- .../himem_test/himem_chardev_test.c | 2 +- testing/{ => arch}/mtetest/CMakeLists.txt | 2 +- testing/{ => arch}/mtetest/Kconfig | 0 testing/{ => arch}/mtetest/Make.defs | 4 +-- testing/{ => arch}/mtetest/Makefile | 2 +- testing/{ => arch}/mtetest/mtetest.c | 2 +- testing/{ => arch}/x86-64-ABI/.gitignore | 0 ...lve-the-issue-of-compilation-failure.patch | 0 testing/{ => arch}/x86-64-ABI/Kconfig | 0 testing/{ => arch}/x86-64-ABI/Make.defs | 4 +-- testing/{ => arch}/x86-64-ABI/Makefile | 2 +- 19 files changed, 87 insertions(+), 14 deletions(-) create mode 100644 testing/arch/.gitignore create mode 100644 testing/arch/CMakeLists.txt create mode 100644 testing/arch/Make.defs create mode 100644 testing/arch/Makefile rename testing/{ => arch}/himem_test/Kconfig (100%) rename testing/{ => arch}/himem_test/LibIncludes.mk (96%) rename testing/{ => arch}/himem_test/Make.defs (91%) rename testing/{ => arch}/himem_test/Makefile (93%) rename testing/{ => arch}/himem_test/himem_chardev_test.c (99%) rename testing/{ => arch}/mtetest/CMakeLists.txt (96%) rename testing/{ => arch}/mtetest/Kconfig (100%) rename testing/{ => arch}/mtetest/Make.defs (92%) rename testing/{ => arch}/mtetest/Makefile (96%) rename testing/{ => arch}/mtetest/mtetest.c (99%) rename testing/{ => arch}/x86-64-ABI/.gitignore (100%) rename testing/{ => arch}/x86-64-ABI/0001-app-testing-Resolve-the-issue-of-compilation-failure.patch (100%) rename testing/{ => arch}/x86-64-ABI/Kconfig (100%) rename testing/{ => arch}/x86-64-ABI/Make.defs (91%) rename testing/{ => arch}/x86-64-ABI/Makefile (98%) diff --git a/testing/arch/.gitignore b/testing/arch/.gitignore new file mode 100644 index 00000000000..9e1d2593ee8 --- /dev/null +++ b/testing/arch/.gitignore @@ -0,0 +1 @@ +/Kconfig diff --git a/testing/arch/CMakeLists.txt b/testing/arch/CMakeLists.txt new file mode 100644 index 00000000000..8aba6b9ccdc --- /dev/null +++ b/testing/arch/CMakeLists.txt @@ -0,0 +1,24 @@ +# ############################################################################## +# apps/testing/arch/CMakeLists.txt +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +nuttx_add_subdirectory() +nuttx_generate_kconfig(MENUDESC "arch") diff --git a/testing/arch/Make.defs b/testing/arch/Make.defs new file mode 100644 index 00000000000..07be33aec9c --- /dev/null +++ b/testing/arch/Make.defs @@ -0,0 +1,23 @@ +############################################################################ +# apps/testing/arch/Make.defs +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +include $(wildcard $(APPDIR)/testing/arch/*/Make.defs) diff --git a/testing/arch/Makefile b/testing/arch/Makefile new file mode 100644 index 00000000000..bbf6c42804b --- /dev/null +++ b/testing/arch/Makefile @@ -0,0 +1,25 @@ +############################################################################ +# apps/testing/arch/Makefile +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +MENUDESC = "arch" + +include $(APPDIR)/Directory.mk diff --git a/testing/himem_test/Kconfig b/testing/arch/himem_test/Kconfig similarity index 100% rename from testing/himem_test/Kconfig rename to testing/arch/himem_test/Kconfig diff --git a/testing/himem_test/LibIncludes.mk b/testing/arch/himem_test/LibIncludes.mk similarity index 96% rename from testing/himem_test/LibIncludes.mk rename to testing/arch/himem_test/LibIncludes.mk index 3ad3e8cedc2..5f404389c07 100644 --- a/testing/himem_test/LibIncludes.mk +++ b/testing/arch/himem_test/LibIncludes.mk @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/himem_test/LibIncludes.mk +# apps/testing/arch/himem_test/LibIncludes.mk # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/himem_test/Make.defs b/testing/arch/himem_test/Make.defs similarity index 91% rename from testing/himem_test/Make.defs rename to testing/arch/himem_test/Make.defs index 2e2b03d6378..8a692df3664 100644 --- a/testing/himem_test/Make.defs +++ b/testing/arch/himem_test/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/himem_test/Make.defs +# apps/testing/arch/himem_test/Make.defs # # SPDX-License-Identifier: Apache-2.0 # @@ -22,5 +22,5 @@ ifneq ($(CONFIG_TESTING_HIMEM_TEST),) -CONFIGURED_APPS += $(APPDIR)/testing/himem_test +CONFIGURED_APPS += $(APPDIR)/testing/arch/himem_test endif diff --git a/testing/himem_test/Makefile b/testing/arch/himem_test/Makefile similarity index 93% rename from testing/himem_test/Makefile rename to testing/arch/himem_test/Makefile index 76568df31f5..ae6ab8d83c2 100644 --- a/testing/himem_test/Makefile +++ b/testing/arch/himem_test/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/himem_test/Makefile +# apps/testing/arch/himem_test/Makefile # # SPDX-License-Identifier: Apache-2.0 # @@ -22,7 +22,7 @@ include $(APPDIR)/Make.defs -include $(APPDIR)/testing/himem_test/LibIncludes.mk +include $(APPDIR)/testing/arch/himem_test/LibIncludes.mk # built-in application info diff --git a/testing/himem_test/himem_chardev_test.c b/testing/arch/himem_test/himem_chardev_test.c similarity index 99% rename from testing/himem_test/himem_chardev_test.c rename to testing/arch/himem_test/himem_chardev_test.c index 118a9ca69e2..80c74e4656b 100644 --- a/testing/himem_test/himem_chardev_test.c +++ b/testing/arch/himem_test/himem_chardev_test.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/himem_test/himem_chardev_test.c + * apps/testing/arch/himem_test/himem_chardev_test.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/mtetest/CMakeLists.txt b/testing/arch/mtetest/CMakeLists.txt similarity index 96% rename from testing/mtetest/CMakeLists.txt rename to testing/arch/mtetest/CMakeLists.txt index fed326f2210..33d20d9131d 100644 --- a/testing/mtetest/CMakeLists.txt +++ b/testing/arch/mtetest/CMakeLists.txt @@ -1,5 +1,5 @@ # ############################################################################## -# apps/testing/mtetest/CMakeLists.txt +# apps/testing/arch/mtetest/CMakeLists.txt # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/mtetest/Kconfig b/testing/arch/mtetest/Kconfig similarity index 100% rename from testing/mtetest/Kconfig rename to testing/arch/mtetest/Kconfig diff --git a/testing/mtetest/Make.defs b/testing/arch/mtetest/Make.defs similarity index 92% rename from testing/mtetest/Make.defs rename to testing/arch/mtetest/Make.defs index 94339a5ce1e..5e2717ee08a 100644 --- a/testing/mtetest/Make.defs +++ b/testing/arch/mtetest/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/mtetest/Make.defs +# apps/testing/arch/mtetest/Make.defs # # SPDX-License-Identifier: Apache-2.0 # @@ -21,5 +21,5 @@ ############################################################################ ifneq ($(CONFIG_TESTING_MTE),) -CONFIGURED_APPS += $(APPDIR)/testing/mtetest +CONFIGURED_APPS += $(APPDIR)/testing/arch/mtetest endif diff --git a/testing/mtetest/Makefile b/testing/arch/mtetest/Makefile similarity index 96% rename from testing/mtetest/Makefile rename to testing/arch/mtetest/Makefile index 73599309f3d..22693446b1c 100644 --- a/testing/mtetest/Makefile +++ b/testing/arch/mtetest/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/mtetest/Makefile +# apps/testing/arch/mtetest/Makefile # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/mtetest/mtetest.c b/testing/arch/mtetest/mtetest.c similarity index 99% rename from testing/mtetest/mtetest.c rename to testing/arch/mtetest/mtetest.c index ac2f0bf1a8f..b6df5357de3 100644 --- a/testing/mtetest/mtetest.c +++ b/testing/arch/mtetest/mtetest.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/mtetest/mtetest.c + * apps/testing/arch/mtetest/mtetest.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/x86-64-ABI/.gitignore b/testing/arch/x86-64-ABI/.gitignore similarity index 100% rename from testing/x86-64-ABI/.gitignore rename to testing/arch/x86-64-ABI/.gitignore diff --git a/testing/x86-64-ABI/0001-app-testing-Resolve-the-issue-of-compilation-failure.patch b/testing/arch/x86-64-ABI/0001-app-testing-Resolve-the-issue-of-compilation-failure.patch similarity index 100% rename from testing/x86-64-ABI/0001-app-testing-Resolve-the-issue-of-compilation-failure.patch rename to testing/arch/x86-64-ABI/0001-app-testing-Resolve-the-issue-of-compilation-failure.patch diff --git a/testing/x86-64-ABI/Kconfig b/testing/arch/x86-64-ABI/Kconfig similarity index 100% rename from testing/x86-64-ABI/Kconfig rename to testing/arch/x86-64-ABI/Kconfig diff --git a/testing/x86-64-ABI/Make.defs b/testing/arch/x86-64-ABI/Make.defs similarity index 91% rename from testing/x86-64-ABI/Make.defs rename to testing/arch/x86-64-ABI/Make.defs index 4c5f32cdd01..b37e54f9575 100644 --- a/testing/x86-64-ABI/Make.defs +++ b/testing/arch/x86-64-ABI/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/system/uorb/Make.defs +# apps/testing/arch/x86-64-ABI/Make.defs # # SPDX-License-Identifier: Apache-2.0 # @@ -21,5 +21,5 @@ ############################################################################ ifneq ($(CONFIG_TESTING_X86_64_ABI),) -CONFIGURED_APPS += $(APPDIR)/testing/x86-64-ABI +CONFIGURED_APPS += $(APPDIR)/testing/arch/x86-64-ABI endif diff --git a/testing/x86-64-ABI/Makefile b/testing/arch/x86-64-ABI/Makefile similarity index 98% rename from testing/x86-64-ABI/Makefile rename to testing/arch/x86-64-ABI/Makefile index 927008f33c8..d5dea4abf5f 100644 --- a/testing/x86-64-ABI/Makefile +++ b/testing/arch/x86-64-ABI/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/x86-64-ABI/Makefile +# apps/testing/arch/x86-64-ABI/Makefile # # SPDX-License-Identifier: Apache-2.0 # From efcfd87b4400dbeba832704097fbc281774741c7 Mon Sep 17 00:00:00 2001 From: Huang Qi Date: Mon, 20 Jan 2025 14:36:29 +0800 Subject: [PATCH 146/391] tools/Rust: Add support for panic_immediate_abort Summary: - Added support for `panic_immediate_abort` in Rust builds, which causes the system to abort immediately on panic instead of unwinding the stack - Enabled `-Zbuild-std-features=panic_immediate_abort` flag for release builds when `CONFIG_DEBUG_FULLOPT` is set - Updated both CMake and Makefile build systems to include the new flag Impact: - Significantly reduces binary size (e.g., from 2270605 to 84987 bytes for riscv64imc) - Changes panic behavior to immediate abort, which may be preferred for embedded systems - Improves system reliability by preventing undefined behavior from stack unwinding in constrained environments - Maintains compatibility with existing Rust code while providing a more deterministic panic handling mechanism For example, if it is enabled, the system will panic immediately: ``` NuttShell (NSH) NuttX-12.8.0 nsh> hello_rust_cargo {"name":"John","age":30} {"name":"Jane","age":25} Deserialized: Alice is 28 years old Pretty JSON: { "name": "Alice", "age": 28 } riscv_exception: EXCEPTION: Illegal instruction. MCAUSE: 0000000000000002, EPC: 0000000080027df6, MTVAL: 0000000000000000 riscv_exception: PANIC!!! Exception = 0000000000000002 dump_assert_info: Current Version: NuttX 12.8.0 8e3621e059 Jan 20 2025 14:45:00 risc-v dump_assert_info: Assertion failed panic: at file: :0 task: hello_rust_cargo process: hello_rust_cargo 0x80020588 /* Stack dump from NuttX */ ``` vs the default behavior: ``` NuttShell (NSH) NuttX-12.8.0 nsh> hello_rust_cargo {"name":"John","age":30} {"name":"Jane","age":25} Deserialized: Alice is 28 years old Pretty JSON: { "name": "Alice", "age": 28 } thread '' panicked at /home/huang/Work/rust/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/src/rust/library/std/src/sys/random/unix_legacy.rs:19:10: failed to generate random data: Os { code: 2, kind: NotFound, message: "No such file or directory" } note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace nsh> ``` Signed-off-by: Huang Qi --- cmake/nuttx_add_rust.cmake | 8 +++++--- tools/Rust.mk | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cmake/nuttx_add_rust.cmake b/cmake/nuttx_add_rust.cmake index e590a3fdcbb..776f2161604 100644 --- a/cmake/nuttx_add_rust.cmake +++ b/cmake/nuttx_add_rust.cmake @@ -122,8 +122,10 @@ function(nuttx_add_rust) # Determine build profile based on CONFIG_DEBUG_FULLOPT if(CONFIG_DEBUG_FULLOPT) set(RUST_PROFILE "release") + set(RUST_DEBUG_FLAGS "-Zbuild-std-features=panic_immediate_abort") else() set(RUST_PROFILE "debug") + set(RUST_DEBUG_FLAGS "") endif() # Get the Rust target triple @@ -142,9 +144,9 @@ function(nuttx_add_rust) add_custom_command( OUTPUT ${RUST_LIB_PATH} COMMAND - cargo build --${RUST_PROFILE} -Zbuild-std=std,panic_abort --manifest-path - ${CRATE_PATH}/Cargo.toml --target ${RUST_TARGET} --target-dir - ${RUST_BUILD_DIR} + cargo build --${RUST_PROFILE} -Zbuild-std=std,panic_abort + ${RUST_DEBUG_FLAGS} --manifest-path ${CRATE_PATH}/Cargo.toml --target + ${RUST_TARGET} --target-dir ${RUST_BUILD_DIR} COMMENT "Building Rust crate ${CRATE_NAME}" VERBATIM) diff --git a/tools/Rust.mk b/tools/Rust.mk index f62d51e7bdc..935508fa1b8 100644 --- a/tools/Rust.mk +++ b/tools/Rust.mk @@ -82,6 +82,7 @@ endef ifeq ($(CONFIG_DEBUG_FULLOPT),y) define RUST_CARGO_BUILD cargo build --release -Zbuild-std=std,panic_abort \ + -Zbuild-std-features=panic_immediate_abort \ --manifest-path $(2)/$(1)/Cargo.toml \ --target $(call RUST_TARGET_TRIPLE) endef From e59ab2b3af2b3ad9dacc25b20d815d60269c8fb0 Mon Sep 17 00:00:00 2001 From: Neo Xu Date: Mon, 20 Jan 2025 16:41:08 +0800 Subject: [PATCH 147/391] gdbstub: change send buffer to const char Signed-off-by: Neo Xu --- system/gdbstub/gdbstub.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/system/gdbstub/gdbstub.c b/system/gdbstub/gdbstub.c index e928c7b14dd..8565efce322 100644 --- a/system/gdbstub/gdbstub.c +++ b/system/gdbstub/gdbstub.c @@ -70,15 +70,14 @@ static int gdb_monitor(FAR struct gdb_state_s *state, FAR const char *cmd) #endif } -static ssize_t gdb_send(FAR void *priv, FAR void *buf, - size_t len) +static ssize_t gdb_send(FAR void *priv, FAR const char *buf, size_t len) { int fd = *(FAR int *)priv; size_t i = 0; while (i < len) { - ssize_t ret = write(fd, (FAR char *)buf + i, len - i); + ssize_t ret = write(fd, buf + i, len - i); if (ret < 0) { return -errno; From 903fbe41e9841ce582b1e54cc359a8fb223a7fd1 Mon Sep 17 00:00:00 2001 From: tengshuangshuang Date: Mon, 20 Jan 2025 17:56:13 +0800 Subject: [PATCH 148/391] apps/testing: move cxxsize,cxxtest and uclibcxx_test folders to the new cxx folder Signed-off-by: tengshuangshuang --- testing/cxx/.gitignore | 1 + testing/cxx/CMakeLists.txt | 24 ++++++++++++++++++ testing/cxx/Make.defs | 23 +++++++++++++++++ testing/cxx/Makefile | 25 +++++++++++++++++++ testing/{ => cxx}/cxxsize/CMakeLists.txt | 2 +- testing/{ => cxx}/cxxsize/Kconfig | 0 testing/{ => cxx}/cxxsize/Make.defs | 4 +-- testing/{ => cxx}/cxxsize/Makefile | 2 +- testing/{ => cxx}/cxxsize/README.md | 0 testing/{ => cxx}/cxxsize/array.cxx | 2 +- .../{ => cxx}/cxxsize/condition_variable.cxx | 2 +- testing/{ => cxx}/cxxsize/deque.cxx | 2 +- testing/{ => cxx}/cxxsize/exception.cxx | 2 +- testing/{ => cxx}/cxxsize/forward_list.cxx | 2 +- testing/{ => cxx}/cxxsize/future.cxx | 2 +- testing/{ => cxx}/cxxsize/iostream.cxx | 2 +- testing/{ => cxx}/cxxsize/list.cxx | 2 +- testing/{ => cxx}/cxxsize/map.cxx | 2 +- testing/{ => cxx}/cxxsize/multiset.cxx | 2 +- testing/{ => cxx}/cxxsize/mutex.cxx | 2 +- testing/{ => cxx}/cxxsize/rtti.cxx | 2 +- testing/{ => cxx}/cxxsize/semaphore.cxx | 2 +- testing/{ => cxx}/cxxsize/set.cxx | 2 +- testing/{ => cxx}/cxxsize/shared_ptr.cxx | 2 +- testing/{ => cxx}/cxxsize/string.cxx | 2 +- testing/{ => cxx}/cxxsize/string_view.cxx | 2 +- testing/{ => cxx}/cxxsize/thread.cxx | 2 +- testing/{ => cxx}/cxxsize/unordered_map.cxx | 2 +- .../{ => cxx}/cxxsize/unordered_multimap.cxx | 2 +- .../{ => cxx}/cxxsize/unordered_multiset.cxx | 2 +- testing/{ => cxx}/cxxsize/unordered_set.cxx | 2 +- testing/{ => cxx}/cxxsize/vector.cxx | 2 +- testing/{ => cxx}/cxxsize/weak_ptr.cxx | 2 +- testing/{ => cxx}/cxxtest/CMakeLists.txt | 2 +- testing/{ => cxx}/cxxtest/Kconfig | 0 testing/{ => cxx}/cxxtest/Make.defs | 4 +-- testing/{ => cxx}/cxxtest/Makefile | 2 +- testing/{ => cxx}/cxxtest/cxxtest_main.cxx | 2 +- testing/{ => cxx}/uclibcxx_test/Kconfig | 0 testing/{ => cxx}/uclibcxx_test/Make.defs | 4 +-- testing/{ => cxx}/uclibcxx_test/Makefile | 2 +- 41 files changed, 109 insertions(+), 36 deletions(-) create mode 100644 testing/cxx/.gitignore create mode 100644 testing/cxx/CMakeLists.txt create mode 100644 testing/cxx/Make.defs create mode 100644 testing/cxx/Makefile rename testing/{ => cxx}/cxxsize/CMakeLists.txt (96%) rename testing/{ => cxx}/cxxsize/Kconfig (100%) rename testing/{ => cxx}/cxxsize/Make.defs (92%) rename testing/{ => cxx}/cxxsize/Makefile (97%) rename testing/{ => cxx}/cxxsize/README.md (100%) rename testing/{ => cxx}/cxxsize/array.cxx (98%) rename testing/{ => cxx}/cxxsize/condition_variable.cxx (97%) rename testing/{ => cxx}/cxxsize/deque.cxx (98%) rename testing/{ => cxx}/cxxsize/exception.cxx (98%) rename testing/{ => cxx}/cxxsize/forward_list.cxx (97%) rename testing/{ => cxx}/cxxsize/future.cxx (98%) rename testing/{ => cxx}/cxxsize/iostream.cxx (98%) rename testing/{ => cxx}/cxxsize/list.cxx (98%) rename testing/{ => cxx}/cxxsize/map.cxx (98%) rename testing/{ => cxx}/cxxsize/multiset.cxx (98%) rename testing/{ => cxx}/cxxsize/mutex.cxx (98%) rename testing/{ => cxx}/cxxsize/rtti.cxx (98%) rename testing/{ => cxx}/cxxsize/semaphore.cxx (97%) rename testing/{ => cxx}/cxxsize/set.cxx (98%) rename testing/{ => cxx}/cxxsize/shared_ptr.cxx (98%) rename testing/{ => cxx}/cxxsize/string.cxx (98%) rename testing/{ => cxx}/cxxsize/string_view.cxx (97%) rename testing/{ => cxx}/cxxsize/thread.cxx (98%) rename testing/{ => cxx}/cxxsize/unordered_map.cxx (97%) rename testing/{ => cxx}/cxxsize/unordered_multimap.cxx (97%) rename testing/{ => cxx}/cxxsize/unordered_multiset.cxx (97%) rename testing/{ => cxx}/cxxsize/unordered_set.cxx (97%) rename testing/{ => cxx}/cxxsize/vector.cxx (98%) rename testing/{ => cxx}/cxxsize/weak_ptr.cxx (98%) rename testing/{ => cxx}/cxxtest/CMakeLists.txt (96%) rename testing/{ => cxx}/cxxtest/Kconfig (100%) rename testing/{ => cxx}/cxxtest/Make.defs (92%) rename testing/{ => cxx}/cxxtest/Makefile (97%) rename testing/{ => cxx}/cxxtest/cxxtest_main.cxx (99%) rename testing/{ => cxx}/uclibcxx_test/Kconfig (100%) rename testing/{ => cxx}/uclibcxx_test/Make.defs (91%) rename testing/{ => cxx}/uclibcxx_test/Makefile (97%) diff --git a/testing/cxx/.gitignore b/testing/cxx/.gitignore new file mode 100644 index 00000000000..9e1d2593ee8 --- /dev/null +++ b/testing/cxx/.gitignore @@ -0,0 +1 @@ +/Kconfig diff --git a/testing/cxx/CMakeLists.txt b/testing/cxx/CMakeLists.txt new file mode 100644 index 00000000000..4a2f10a2096 --- /dev/null +++ b/testing/cxx/CMakeLists.txt @@ -0,0 +1,24 @@ +# ############################################################################## +# apps/testing/cxx/CMakeLists.txt +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +nuttx_add_subdirectory() +nuttx_generate_kconfig(MENUDESC "cxx") diff --git a/testing/cxx/Make.defs b/testing/cxx/Make.defs new file mode 100644 index 00000000000..62a3e9f18ac --- /dev/null +++ b/testing/cxx/Make.defs @@ -0,0 +1,23 @@ +############################################################################ +# apps/testing/cxx/Make.defs +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +include $(wildcard $(APPDIR)/testing/cxx/*/Make.defs) diff --git a/testing/cxx/Makefile b/testing/cxx/Makefile new file mode 100644 index 00000000000..28a4c2420e9 --- /dev/null +++ b/testing/cxx/Makefile @@ -0,0 +1,25 @@ +############################################################################ +# apps/testing/cxx/Makefile +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +MENUDESC = "cxx" + +include $(APPDIR)/Directory.mk diff --git a/testing/cxxsize/CMakeLists.txt b/testing/cxx/cxxsize/CMakeLists.txt similarity index 96% rename from testing/cxxsize/CMakeLists.txt rename to testing/cxx/cxxsize/CMakeLists.txt index ddf8f43fd82..6fa2b7ab91f 100644 --- a/testing/cxxsize/CMakeLists.txt +++ b/testing/cxx/cxxsize/CMakeLists.txt @@ -1,5 +1,5 @@ # ############################################################################## -# apps/testing/cxxsize/CMakeLists.txt +# apps/testing/cxx/cxxsize/CMakeLists.txt # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/cxxsize/Kconfig b/testing/cxx/cxxsize/Kconfig similarity index 100% rename from testing/cxxsize/Kconfig rename to testing/cxx/cxxsize/Kconfig diff --git a/testing/cxxsize/Make.defs b/testing/cxx/cxxsize/Make.defs similarity index 92% rename from testing/cxxsize/Make.defs rename to testing/cxx/cxxsize/Make.defs index 4b3c7cb95be..73798f27519 100644 --- a/testing/cxxsize/Make.defs +++ b/testing/cxx/cxxsize/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/cxxtest/Make.defs +# apps/testing/cxx/cxxtest/Make.defs # # SPDX-License-Identifier: Apache-2.0 # @@ -21,5 +21,5 @@ ############################################################################ ifneq ($(CONFIG_TESTING_CXXSIZE),) -CONFIGURED_APPS += $(APPDIR)/testing/cxxsize +CONFIGURED_APPS += $(APPDIR)/testing/cxx/cxxsize endif diff --git a/testing/cxxsize/Makefile b/testing/cxx/cxxsize/Makefile similarity index 97% rename from testing/cxxsize/Makefile rename to testing/cxx/cxxsize/Makefile index 04560e0654f..59e57fd71b5 100644 --- a/testing/cxxsize/Makefile +++ b/testing/cxx/cxxsize/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/cxxtest/Makefile +# apps/testing/cxx/cxxtest/Makefile # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/cxxsize/README.md b/testing/cxx/cxxsize/README.md similarity index 100% rename from testing/cxxsize/README.md rename to testing/cxx/cxxsize/README.md diff --git a/testing/cxxsize/array.cxx b/testing/cxx/cxxsize/array.cxx similarity index 98% rename from testing/cxxsize/array.cxx rename to testing/cxx/cxxsize/array.cxx index 6b4deb2cf4b..f3efca45ce8 100644 --- a/testing/cxxsize/array.cxx +++ b/testing/cxx/cxxsize/array.cxx @@ -1,5 +1,5 @@ //*************************************************************************** -// apps/testing/cxxsize/array.cxx +// apps/testing/cxx/cxxsize/array.cxx // // SPDX-License-Identifier: Apache-2.0 // diff --git a/testing/cxxsize/condition_variable.cxx b/testing/cxx/cxxsize/condition_variable.cxx similarity index 97% rename from testing/cxxsize/condition_variable.cxx rename to testing/cxx/cxxsize/condition_variable.cxx index a9ddf12883d..a094046d2ca 100644 --- a/testing/cxxsize/condition_variable.cxx +++ b/testing/cxx/cxxsize/condition_variable.cxx @@ -1,5 +1,5 @@ //*************************************************************************** -// apps/testing/cxxsize/condition_variable.cxx +// apps/testing/cxx/cxxsize/condition_variable.cxx // // SPDX-License-Identifier: Apache-2.0 // diff --git a/testing/cxxsize/deque.cxx b/testing/cxx/cxxsize/deque.cxx similarity index 98% rename from testing/cxxsize/deque.cxx rename to testing/cxx/cxxsize/deque.cxx index 2fbffc1bdc4..eb5d00c9df3 100644 --- a/testing/cxxsize/deque.cxx +++ b/testing/cxx/cxxsize/deque.cxx @@ -1,5 +1,5 @@ //*************************************************************************** -// apps/testing/cxxsize/deque.cxx +// apps/testing/cxx/cxxsize/deque.cxx // // SPDX-License-Identifier: Apache-2.0 // diff --git a/testing/cxxsize/exception.cxx b/testing/cxx/cxxsize/exception.cxx similarity index 98% rename from testing/cxxsize/exception.cxx rename to testing/cxx/cxxsize/exception.cxx index baa07dc80d4..83cf0dae753 100644 --- a/testing/cxxsize/exception.cxx +++ b/testing/cxx/cxxsize/exception.cxx @@ -1,5 +1,5 @@ //*************************************************************************** -// apps/testing/cxxsize/exception.cxx +// apps/testing/cxx/cxxsize/exception.cxx // // SPDX-License-Identifier: Apache-2.0 // diff --git a/testing/cxxsize/forward_list.cxx b/testing/cxx/cxxsize/forward_list.cxx similarity index 97% rename from testing/cxxsize/forward_list.cxx rename to testing/cxx/cxxsize/forward_list.cxx index 02512e35a45..577d8061a2e 100644 --- a/testing/cxxsize/forward_list.cxx +++ b/testing/cxx/cxxsize/forward_list.cxx @@ -1,5 +1,5 @@ //*************************************************************************** -// apps/testing/cxxsize/forward_list.cxx +// apps/testing/cxx/cxxsize/forward_list.cxx // // SPDX-License-Identifier: Apache-2.0 // diff --git a/testing/cxxsize/future.cxx b/testing/cxx/cxxsize/future.cxx similarity index 98% rename from testing/cxxsize/future.cxx rename to testing/cxx/cxxsize/future.cxx index 3ecb8cb093f..40d31b97966 100644 --- a/testing/cxxsize/future.cxx +++ b/testing/cxx/cxxsize/future.cxx @@ -1,5 +1,5 @@ //*************************************************************************** -// apps/testing/cxxsize/future.cxx +// apps/testing/cxx/cxxsize/future.cxx // // SPDX-License-Identifier: Apache-2.0 // diff --git a/testing/cxxsize/iostream.cxx b/testing/cxx/cxxsize/iostream.cxx similarity index 98% rename from testing/cxxsize/iostream.cxx rename to testing/cxx/cxxsize/iostream.cxx index 2b57140c387..396609c2c58 100644 --- a/testing/cxxsize/iostream.cxx +++ b/testing/cxx/cxxsize/iostream.cxx @@ -1,5 +1,5 @@ //*************************************************************************** -// apps/testing/cxxsize/iostream.cxx +// apps/testing/cxx/cxxsize/iostream.cxx // // SPDX-License-Identifier: Apache-2.0 // diff --git a/testing/cxxsize/list.cxx b/testing/cxx/cxxsize/list.cxx similarity index 98% rename from testing/cxxsize/list.cxx rename to testing/cxx/cxxsize/list.cxx index 9a83eca727d..76a4888c06e 100644 --- a/testing/cxxsize/list.cxx +++ b/testing/cxx/cxxsize/list.cxx @@ -1,5 +1,5 @@ //*************************************************************************** -// apps/testing/cxxsize/list.cxx +// apps/testing/cxx/cxxsize/list.cxx // // SPDX-License-Identifier: Apache-2.0 // diff --git a/testing/cxxsize/map.cxx b/testing/cxx/cxxsize/map.cxx similarity index 98% rename from testing/cxxsize/map.cxx rename to testing/cxx/cxxsize/map.cxx index f4c5cd09576..9c76e04f191 100644 --- a/testing/cxxsize/map.cxx +++ b/testing/cxx/cxxsize/map.cxx @@ -1,5 +1,5 @@ //*************************************************************************** -// apps/testing/cxxsize/map.cxx +// apps/testing/cxx/cxxsize/map.cxx // // SPDX-License-Identifier: Apache-2.0 // diff --git a/testing/cxxsize/multiset.cxx b/testing/cxx/cxxsize/multiset.cxx similarity index 98% rename from testing/cxxsize/multiset.cxx rename to testing/cxx/cxxsize/multiset.cxx index a859ec214c2..c7413814304 100644 --- a/testing/cxxsize/multiset.cxx +++ b/testing/cxx/cxxsize/multiset.cxx @@ -1,5 +1,5 @@ //*************************************************************************** -// apps/testing/cxxsize/multiset.cxx +// apps/testing/cxx/cxxsize/multiset.cxx // // SPDX-License-Identifier: Apache-2.0 // diff --git a/testing/cxxsize/mutex.cxx b/testing/cxx/cxxsize/mutex.cxx similarity index 98% rename from testing/cxxsize/mutex.cxx rename to testing/cxx/cxxsize/mutex.cxx index 4d7b5162db9..e16fc044edf 100644 --- a/testing/cxxsize/mutex.cxx +++ b/testing/cxx/cxxsize/mutex.cxx @@ -1,5 +1,5 @@ //*************************************************************************** -// apps/testing/cxxsize/mutex.cxx +// apps/testing/cxx/cxxsize/mutex.cxx // // SPDX-License-Identifier: Apache-2.0 // diff --git a/testing/cxxsize/rtti.cxx b/testing/cxx/cxxsize/rtti.cxx similarity index 98% rename from testing/cxxsize/rtti.cxx rename to testing/cxx/cxxsize/rtti.cxx index 39590e92578..2935267c101 100644 --- a/testing/cxxsize/rtti.cxx +++ b/testing/cxx/cxxsize/rtti.cxx @@ -1,5 +1,5 @@ //*************************************************************************** -// apps/testing/cxxsize/rtti.cxx +// apps/testing/cxx/cxxsize/rtti.cxx // // SPDX-License-Identifier: Apache-2.0 // diff --git a/testing/cxxsize/semaphore.cxx b/testing/cxx/cxxsize/semaphore.cxx similarity index 97% rename from testing/cxxsize/semaphore.cxx rename to testing/cxx/cxxsize/semaphore.cxx index a1b3a29a8cc..cf716f536c6 100644 --- a/testing/cxxsize/semaphore.cxx +++ b/testing/cxx/cxxsize/semaphore.cxx @@ -1,5 +1,5 @@ //*************************************************************************** -// apps/testing/cxxsize/semaphore.cxx +// apps/testing/cxx/cxxsize/semaphore.cxx // // SPDX-License-Identifier: Apache-2.0 // diff --git a/testing/cxxsize/set.cxx b/testing/cxx/cxxsize/set.cxx similarity index 98% rename from testing/cxxsize/set.cxx rename to testing/cxx/cxxsize/set.cxx index 1285a12fbfc..4ed94f55d12 100644 --- a/testing/cxxsize/set.cxx +++ b/testing/cxx/cxxsize/set.cxx @@ -1,5 +1,5 @@ //*************************************************************************** -// apps/testing/cxxsize/set.cxx +// apps/testing/cxx/cxxsize/set.cxx // // SPDX-License-Identifier: Apache-2.0 // diff --git a/testing/cxxsize/shared_ptr.cxx b/testing/cxx/cxxsize/shared_ptr.cxx similarity index 98% rename from testing/cxxsize/shared_ptr.cxx rename to testing/cxx/cxxsize/shared_ptr.cxx index 9e519e11a16..b365daaea36 100644 --- a/testing/cxxsize/shared_ptr.cxx +++ b/testing/cxx/cxxsize/shared_ptr.cxx @@ -1,5 +1,5 @@ //*************************************************************************** -// apps/testing/cxxsize/shared_ptr.cxx +// apps/testing/cxx/cxxsize/shared_ptr.cxx // // SPDX-License-Identifier: Apache-2.0 // diff --git a/testing/cxxsize/string.cxx b/testing/cxx/cxxsize/string.cxx similarity index 98% rename from testing/cxxsize/string.cxx rename to testing/cxx/cxxsize/string.cxx index 04988820fd0..b77ec45f25f 100644 --- a/testing/cxxsize/string.cxx +++ b/testing/cxx/cxxsize/string.cxx @@ -1,5 +1,5 @@ //*************************************************************************** -// apps/testing/cxxsize/string.cxx +// apps/testing/cxx/cxxsize/string.cxx // // SPDX-License-Identifier: Apache-2.0 // diff --git a/testing/cxxsize/string_view.cxx b/testing/cxx/cxxsize/string_view.cxx similarity index 97% rename from testing/cxxsize/string_view.cxx rename to testing/cxx/cxxsize/string_view.cxx index c415262d064..fd9a69c3e72 100644 --- a/testing/cxxsize/string_view.cxx +++ b/testing/cxx/cxxsize/string_view.cxx @@ -1,5 +1,5 @@ //*************************************************************************** -// apps/testing/cxxsize/string_view.cxx +// apps/testing/cxx/cxxsize/string_view.cxx // // SPDX-License-Identifier: Apache-2.0 // diff --git a/testing/cxxsize/thread.cxx b/testing/cxx/cxxsize/thread.cxx similarity index 98% rename from testing/cxxsize/thread.cxx rename to testing/cxx/cxxsize/thread.cxx index e646c22eb2e..7a8902157ec 100644 --- a/testing/cxxsize/thread.cxx +++ b/testing/cxx/cxxsize/thread.cxx @@ -1,5 +1,5 @@ //*************************************************************************** -// apps/testing/cxxsize/thread.cxx +// apps/testing/cxx/cxxsize/thread.cxx // // SPDX-License-Identifier: Apache-2.0 // diff --git a/testing/cxxsize/unordered_map.cxx b/testing/cxx/cxxsize/unordered_map.cxx similarity index 97% rename from testing/cxxsize/unordered_map.cxx rename to testing/cxx/cxxsize/unordered_map.cxx index 2d604070116..aa8979aff6f 100644 --- a/testing/cxxsize/unordered_map.cxx +++ b/testing/cxx/cxxsize/unordered_map.cxx @@ -1,5 +1,5 @@ //*************************************************************************** -// apps/testing/cxxsize/unordered_map.cxx +// apps/testing/cxx/cxxsize/unordered_map.cxx // // SPDX-License-Identifier: Apache-2.0 // diff --git a/testing/cxxsize/unordered_multimap.cxx b/testing/cxx/cxxsize/unordered_multimap.cxx similarity index 97% rename from testing/cxxsize/unordered_multimap.cxx rename to testing/cxx/cxxsize/unordered_multimap.cxx index 153b5f60a7a..0c4fcfdfaf8 100644 --- a/testing/cxxsize/unordered_multimap.cxx +++ b/testing/cxx/cxxsize/unordered_multimap.cxx @@ -1,5 +1,5 @@ //*************************************************************************** -// apps/testing/cxxsize/unordered_multimap.cxx +// apps/testing/cxx/cxxsize/unordered_multimap.cxx // // SPDX-License-Identifier: Apache-2.0 // diff --git a/testing/cxxsize/unordered_multiset.cxx b/testing/cxx/cxxsize/unordered_multiset.cxx similarity index 97% rename from testing/cxxsize/unordered_multiset.cxx rename to testing/cxx/cxxsize/unordered_multiset.cxx index f19ae3fcbba..a35a3a9c9c5 100644 --- a/testing/cxxsize/unordered_multiset.cxx +++ b/testing/cxx/cxxsize/unordered_multiset.cxx @@ -1,5 +1,5 @@ //*************************************************************************** -// apps/testing/cxxsize/unordered_multiset.cxx +// apps/testing/cxx/cxxsize/unordered_multiset.cxx // // SPDX-License-Identifier: Apache-2.0 // diff --git a/testing/cxxsize/unordered_set.cxx b/testing/cxx/cxxsize/unordered_set.cxx similarity index 97% rename from testing/cxxsize/unordered_set.cxx rename to testing/cxx/cxxsize/unordered_set.cxx index c5b606509e7..95940676484 100644 --- a/testing/cxxsize/unordered_set.cxx +++ b/testing/cxx/cxxsize/unordered_set.cxx @@ -1,5 +1,5 @@ //*************************************************************************** -// apps/testing/cxxsize/unordered_set.cxx +// apps/testing/cxx/cxxsize/unordered_set.cxx // // SPDX-License-Identifier: Apache-2.0 // diff --git a/testing/cxxsize/vector.cxx b/testing/cxx/cxxsize/vector.cxx similarity index 98% rename from testing/cxxsize/vector.cxx rename to testing/cxx/cxxsize/vector.cxx index 5f916d928ec..a40299d868d 100644 --- a/testing/cxxsize/vector.cxx +++ b/testing/cxx/cxxsize/vector.cxx @@ -1,5 +1,5 @@ //*************************************************************************** -// apps/testing/cxxsize/vector.cxx +// apps/testing/cxx/cxxsize/vector.cxx // // SPDX-License-Identifier: Apache-2.0 // diff --git a/testing/cxxsize/weak_ptr.cxx b/testing/cxx/cxxsize/weak_ptr.cxx similarity index 98% rename from testing/cxxsize/weak_ptr.cxx rename to testing/cxx/cxxsize/weak_ptr.cxx index 1ccd95bd2b7..65a5625652e 100644 --- a/testing/cxxsize/weak_ptr.cxx +++ b/testing/cxx/cxxsize/weak_ptr.cxx @@ -1,5 +1,5 @@ //*************************************************************************** -// apps/testing/cxxsize/weak_ptr.cxx +// apps/testing/cxx/cxxsize/weak_ptr.cxx // // SPDX-License-Identifier: Apache-2.0 // diff --git a/testing/cxxtest/CMakeLists.txt b/testing/cxx/cxxtest/CMakeLists.txt similarity index 96% rename from testing/cxxtest/CMakeLists.txt rename to testing/cxx/cxxtest/CMakeLists.txt index 962b7f09798..323e112b882 100644 --- a/testing/cxxtest/CMakeLists.txt +++ b/testing/cxx/cxxtest/CMakeLists.txt @@ -1,5 +1,5 @@ # ############################################################################## -# apps/testing/cxxtest/CMakeLists.txt +# apps/testing/cxx/cxxtest/CMakeLists.txt # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/cxxtest/Kconfig b/testing/cxx/cxxtest/Kconfig similarity index 100% rename from testing/cxxtest/Kconfig rename to testing/cxx/cxxtest/Kconfig diff --git a/testing/cxxtest/Make.defs b/testing/cxx/cxxtest/Make.defs similarity index 92% rename from testing/cxxtest/Make.defs rename to testing/cxx/cxxtest/Make.defs index 5a06bbbf901..b50f6a9137f 100644 --- a/testing/cxxtest/Make.defs +++ b/testing/cxx/cxxtest/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/cxxtest/Make.defs +# apps/testing/cxx/cxxtest/Make.defs # # SPDX-License-Identifier: Apache-2.0 # @@ -21,5 +21,5 @@ ############################################################################ ifneq ($(CONFIG_TESTING_CXXTEST),) -CONFIGURED_APPS += $(APPDIR)/testing/cxxtest +CONFIGURED_APPS += $(APPDIR)/testing/cxx/cxxtest endif diff --git a/testing/cxxtest/Makefile b/testing/cxx/cxxtest/Makefile similarity index 97% rename from testing/cxxtest/Makefile rename to testing/cxx/cxxtest/Makefile index 5690c59f9e4..2c7d7244e02 100644 --- a/testing/cxxtest/Makefile +++ b/testing/cxx/cxxtest/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/cxxtest/Makefile +# apps/testing/cxx/cxxtest/Makefile # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/cxxtest/cxxtest_main.cxx b/testing/cxx/cxxtest/cxxtest_main.cxx similarity index 99% rename from testing/cxxtest/cxxtest_main.cxx rename to testing/cxx/cxxtest/cxxtest_main.cxx index 48e0d014187..f33da9eed28 100644 --- a/testing/cxxtest/cxxtest_main.cxx +++ b/testing/cxx/cxxtest/cxxtest_main.cxx @@ -1,5 +1,5 @@ //*************************************************************************** -// apps/testing/cxxtest/cxxtest_main.cxx +// apps/testing/cxx/cxxtest/cxxtest_main.cxx // // SPDX-License-Identifier: Apache-2.0 // diff --git a/testing/uclibcxx_test/Kconfig b/testing/cxx/uclibcxx_test/Kconfig similarity index 100% rename from testing/uclibcxx_test/Kconfig rename to testing/cxx/uclibcxx_test/Kconfig diff --git a/testing/uclibcxx_test/Make.defs b/testing/cxx/uclibcxx_test/Make.defs similarity index 91% rename from testing/uclibcxx_test/Make.defs rename to testing/cxx/uclibcxx_test/Make.defs index 2b995217380..a5d5f455ba2 100644 --- a/testing/uclibcxx_test/Make.defs +++ b/testing/cxx/uclibcxx_test/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/uclibcxx_test/Make.defs +# apps/testing/cxx/uclibcxx_test/Make.defs # # SPDX-License-Identifier: Apache-2.0 # @@ -21,5 +21,5 @@ ############################################################################ ifneq ($(CONFIG_TESTING_UCLIBCXXTEST),) -CONFIGURED_APPS += $(APPDIR)/testing/uclibcxx_test +CONFIGURED_APPS += $(APPDIR)/testing//cxx/uclibcxx_test endif diff --git a/testing/uclibcxx_test/Makefile b/testing/cxx/uclibcxx_test/Makefile similarity index 97% rename from testing/uclibcxx_test/Makefile rename to testing/cxx/uclibcxx_test/Makefile index 464d7b8fec2..88d960aef30 100644 --- a/testing/uclibcxx_test/Makefile +++ b/testing/cxx/uclibcxx_test/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/uclibcxx_test/Makefile +# apps/testing/cxx/uclibcxx_test/Makefile # # SPDX-License-Identifier: Apache-2.0 # From 131d50ae9d76e479d89886d1136585ffb365cde3 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Sun, 19 Jan 2025 09:58:40 +0800 Subject: [PATCH 149/391] nshlib: Remove the unnecessary temp path buffer Signed-off-by: Xiang Xiao --- nshlib/nsh_fscmds.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nshlib/nsh_fscmds.c b/nshlib/nsh_fscmds.c index 60b88e6ddd0..3eb41c377bd 100644 --- a/nshlib/nsh_fscmds.c +++ b/nshlib/nsh_fscmds.c @@ -2191,7 +2191,6 @@ int cmd_rm(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv) bool recursive = false; bool force = false; FAR char *fullpath; - char buf[PATH_MAX]; struct stat stat; int ret = ERROR; int c; @@ -2234,8 +2233,7 @@ int cmd_rm(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv) { if (recursive) { - strlcpy(buf, fullpath, PATH_MAX); - ret = unlink_recursive(buf, &stat); + ret = unlink_recursive(fullpath, &stat); } else { From 533096676239c729aee7b6f788bde16b8902a495 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Sun, 19 Jan 2025 10:00:11 +0800 Subject: [PATCH 150/391] nshlib: Replace the big temp buffer with lib_get_[path|temp]buffer to save the stack consumption Signed-off-by: Xiang Xiao --- nshlib/nsh_fsutils.c | 14 +++++++++++--- nshlib/nsh_timcmds.c | 9 ++++++++- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/nshlib/nsh_fsutils.c b/nshlib/nsh_fsutils.c index 99e9487848d..c3793b20619 100644 --- a/nshlib/nsh_fsutils.c +++ b/nshlib/nsh_fsutils.c @@ -73,7 +73,7 @@ static int getpid_callback(FAR struct nsh_vtbl_s *vtbl, FAR struct dirent *entryp, FAR void *pvarg) { FAR struct getpid_arg_s *arg = (FAR struct getpid_arg_s *)pvarg; - char buffer[PATH_MAX]; + FAR char *buffer; int fd; int len; @@ -82,13 +82,19 @@ static int getpid_callback(FAR struct nsh_vtbl_s *vtbl, return -E2BIG; } - /* Match the name of the process */ + buffer = lib_get_pathbuffer(); + if (buffer == NULL) + { + return -errno; + } - snprintf(buffer, sizeof(buffer), "%s/%s/cmdline", dirpath, entryp->d_name); + /* Match the name of the process */ + snprintf(buffer, PATH_MAX, "%s/%s/cmdline", dirpath, entryp->d_name); fd = open(buffer, O_RDONLY | O_CLOEXEC); if (fd < 0) { + lib_put_pathbuffer(buffer); return 0; } @@ -96,6 +102,7 @@ static int getpid_callback(FAR struct nsh_vtbl_s *vtbl, close(fd); if (len < 0) { + lib_put_pathbuffer(buffer); return -errno; } @@ -107,6 +114,7 @@ static int getpid_callback(FAR struct nsh_vtbl_s *vtbl, arg->pids[arg->next++] = atoi(entryp->d_name); } + lib_put_pathbuffer(buffer); return OK; } #endif diff --git a/nshlib/nsh_timcmds.c b/nshlib/nsh_timcmds.c index 732bb512e9a..a0952acc1b0 100644 --- a/nshlib/nsh_timcmds.c +++ b/nshlib/nsh_timcmds.c @@ -26,6 +26,7 @@ #include +#include #include #include #include @@ -552,7 +553,6 @@ int cmd_timedatectl(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv) #ifndef CONFIG_NSH_DISABLE_WATCH int cmd_watch(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv) { - char buffer[LINE_MAX]; int interval = 2; int count = -1; FAR char *cmd; @@ -595,8 +595,15 @@ int cmd_watch(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv) for (i = 0; i < count; i++) { + FAR char *buffer = lib_get_tempbuffer(LINE_MAX); + if (buffer == NULL) + { + return ERROR; + } + strlcpy(buffer, cmd, LINE_MAX); ret = nsh_parse(vtbl, buffer); + lib_put_tempbuffer(buffer); if (ret < 0) { nsh_error(vtbl, g_fmtcmdfailed, argv[0], cmd, NSH_ERRNO); From dca032ab18f29804399027a9e66e0092510d1b83 Mon Sep 17 00:00:00 2001 From: Eren Terzioglu Date: Fri, 17 Jan 2025 11:08:38 +0100 Subject: [PATCH 151/391] examples/i2schar: Make tx/rx count value generic on transmit/recieve operations --- examples/i2schar/i2schar_receiver.c | 2 +- examples/i2schar/i2schar_transmitter.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/i2schar/i2schar_receiver.c b/examples/i2schar/i2schar_receiver.c index 164635779db..843381ccc5a 100644 --- a/examples/i2schar/i2schar_receiver.c +++ b/examples/i2schar/i2schar_receiver.c @@ -99,7 +99,7 @@ pthread_addr_t i2schar_receiver(pthread_addr_t arg) /* Loop for the requested number of times */ - for (i = 0; i < CONFIG_EXAMPLES_I2SCHAR_TXBUFFERS; i++) + for (i = 0; i < g_i2schar.rxcount; i++) { /* Allocate an audio buffer of the configured size */ diff --git a/examples/i2schar/i2schar_transmitter.c b/examples/i2schar/i2schar_transmitter.c index aa5c59db9ff..2fb9ded0f9b 100644 --- a/examples/i2schar/i2schar_transmitter.c +++ b/examples/i2schar/i2schar_transmitter.c @@ -102,7 +102,7 @@ pthread_addr_t i2schar_transmitter(pthread_addr_t arg) /* Loop for the requested number of times */ - for (i = 0, crap = 0; i < CONFIG_EXAMPLES_I2SCHAR_TXBUFFERS; i++) + for (i = 0, crap = 0; i < g_i2schar.txcount; i++) { /* Allocate an audio buffer of the configured size */ From 6bc2b3c933141e02c87c68f304a915db011b8408 Mon Sep 17 00:00:00 2001 From: tengshuangshuang Date: Tue, 21 Jan 2025 09:18:45 +0800 Subject: [PATCH 152/391] apps/testing:move {drivertest fftest irtest monkey nand_sim pcitest sd_bench sd_stress sensortest} folders to the new driver folder Signed-off-by: tengshuangshuang --- testing/drivers/.gitignore | 1 + testing/drivers/CMakeLists.txt | 24 ++++++++++++++++++ testing/drivers/Make.defs | 23 +++++++++++++++++ testing/drivers/Makefile | 25 +++++++++++++++++++ .../{ => drivers}/drivertest/CMakeLists.txt | 2 +- testing/{ => drivers}/drivertest/Kconfig | 0 testing/{ => drivers}/drivertest/Make.defs | 4 +-- testing/{ => drivers}/drivertest/Makefile | 2 +- .../{ => drivers}/drivertest/drivertest_adc.c | 2 +- .../drivertest/drivertest_audio.c | 2 +- .../drivertest/drivertest_block.c | 2 +- .../drivertest/drivertest_framebuffer.c | 2 +- .../drivertest/drivertest_gpio.c | 2 +- .../drivertest/drivertest_i2c_read.c | 2 +- .../drivertest/drivertest_i2c_spi.c | 2 +- .../drivertest/drivertest_i2c_write.c | 2 +- .../{ => drivers}/drivertest/drivertest_lcd.c | 2 +- .../drivertest/drivertest_mps2.c | 2 +- .../drivertest/drivertest_mps2_isr_signal.c | 2 +- .../drivertest_mps2_zerointerrupt.c | 2 +- .../drivertest/drivertest_oneshot.c | 2 +- .../{ => drivers}/drivertest/drivertest_pm.c | 2 +- .../drivertest/drivertest_pm_runtime.c | 2 +- .../drivertest/drivertest_pm_smp.c | 2 +- .../drivertest/drivertest_posix_timer.c | 2 +- .../{ => drivers}/drivertest/drivertest_pwm.c | 2 +- .../drivertest/drivertest_regulator.c | 2 +- .../drivertest/drivertest_relay.c | 2 +- .../{ => drivers}/drivertest/drivertest_rtc.c | 2 +- .../drivertest/drivertest_simple.c | 2 +- .../drivertest/drivertest_timer.c | 2 +- .../drivertest/drivertest_touchpanel.c | 2 +- .../drivertest/drivertest_uart.c | 2 +- .../drivertest/drivertest_watchdog.c | 2 +- .../drivertest/test_content_gen.py | 2 +- testing/{ => drivers}/fftest/CMakeLists.txt | 2 +- testing/{ => drivers}/fftest/Kconfig | 0 testing/{ => drivers}/fftest/Make.defs | 4 +-- testing/{ => drivers}/fftest/Makefile | 2 +- testing/{ => drivers}/fftest/fftest.c | 2 +- testing/{ => drivers}/nand_sim/CMakeLists.txt | 2 +- testing/{ => drivers}/nand_sim/Kconfig | 0 testing/{ => drivers}/nand_sim/Make.defs | 4 +-- testing/{ => drivers}/nand_sim/Makefile | 2 +- .../{ => drivers}/nand_sim/nand_sim_main.c | 2 +- testing/{ => drivers}/pcitest/Kconfig | 0 testing/{ => drivers}/pcitest/Make.defs | 4 +-- testing/{ => drivers}/pcitest/Makefile | 2 +- testing/{ => drivers}/pcitest/pcitest.c | 2 +- testing/{ => drivers}/sd_stress/Kconfig | 0 testing/{ => drivers}/sd_stress/Make.defs | 4 +-- testing/{ => drivers}/sd_stress/Makefile | 2 +- .../{ => drivers}/sd_stress/sd_stress_main.c | 6 ++--- 53 files changed, 124 insertions(+), 51 deletions(-) create mode 100644 testing/drivers/.gitignore create mode 100644 testing/drivers/CMakeLists.txt create mode 100644 testing/drivers/Make.defs create mode 100644 testing/drivers/Makefile rename testing/{ => drivers}/drivertest/CMakeLists.txt (99%) rename testing/{ => drivers}/drivertest/Kconfig (100%) rename testing/{ => drivers}/drivertest/Make.defs (91%) rename testing/{ => drivers}/drivertest/Makefile (98%) rename testing/{ => drivers}/drivertest/drivertest_adc.c (99%) rename testing/{ => drivers}/drivertest/drivertest_audio.c (99%) rename testing/{ => drivers}/drivertest/drivertest_block.c (99%) rename testing/{ => drivers}/drivertest/drivertest_framebuffer.c (99%) rename testing/{ => drivers}/drivertest/drivertest_gpio.c (99%) rename testing/{ => drivers}/drivertest/drivertest_i2c_read.c (99%) rename testing/{ => drivers}/drivertest/drivertest_i2c_spi.c (98%) rename testing/{ => drivers}/drivertest/drivertest_i2c_write.c (99%) rename testing/{ => drivers}/drivertest/drivertest_lcd.c (99%) rename testing/{ => drivers}/drivertest/drivertest_mps2.c (99%) rename testing/{ => drivers}/drivertest/drivertest_mps2_isr_signal.c (98%) rename testing/{ => drivers}/drivertest/drivertest_mps2_zerointerrupt.c (99%) rename testing/{ => drivers}/drivertest/drivertest_oneshot.c (99%) rename testing/{ => drivers}/drivertest/drivertest_pm.c (99%) rename testing/{ => drivers}/drivertest/drivertest_pm_runtime.c (99%) rename testing/{ => drivers}/drivertest/drivertest_pm_smp.c (99%) rename testing/{ => drivers}/drivertest/drivertest_posix_timer.c (99%) rename testing/{ => drivers}/drivertest/drivertest_pwm.c (99%) rename testing/{ => drivers}/drivertest/drivertest_regulator.c (99%) rename testing/{ => drivers}/drivertest/drivertest_relay.c (99%) rename testing/{ => drivers}/drivertest/drivertest_rtc.c (99%) rename testing/{ => drivers}/drivertest/drivertest_simple.c (97%) rename testing/{ => drivers}/drivertest/drivertest_timer.c (99%) rename testing/{ => drivers}/drivertest/drivertest_touchpanel.c (99%) rename testing/{ => drivers}/drivertest/drivertest_uart.c (99%) rename testing/{ => drivers}/drivertest/drivertest_watchdog.c (99%) rename testing/{ => drivers}/drivertest/test_content_gen.py (98%) rename testing/{ => drivers}/fftest/CMakeLists.txt (96%) rename testing/{ => drivers}/fftest/Kconfig (100%) rename testing/{ => drivers}/fftest/Make.defs (91%) rename testing/{ => drivers}/fftest/Makefile (96%) rename testing/{ => drivers}/fftest/fftest.c (99%) rename testing/{ => drivers}/nand_sim/CMakeLists.txt (96%) rename testing/{ => drivers}/nand_sim/Kconfig (100%) rename testing/{ => drivers}/nand_sim/Make.defs (91%) rename testing/{ => drivers}/nand_sim/Makefile (96%) rename testing/{ => drivers}/nand_sim/nand_sim_main.c (99%) rename testing/{ => drivers}/pcitest/Kconfig (100%) rename testing/{ => drivers}/pcitest/Make.defs (91%) rename testing/{ => drivers}/pcitest/Makefile (96%) rename testing/{ => drivers}/pcitest/pcitest.c (99%) rename testing/{ => drivers}/sd_stress/Kconfig (100%) rename testing/{ => drivers}/sd_stress/Make.defs (91%) rename testing/{ => drivers}/sd_stress/Makefile (96%) rename testing/{ => drivers}/sd_stress/sd_stress_main.c (99%) diff --git a/testing/drivers/.gitignore b/testing/drivers/.gitignore new file mode 100644 index 00000000000..9e1d2593ee8 --- /dev/null +++ b/testing/drivers/.gitignore @@ -0,0 +1 @@ +/Kconfig diff --git a/testing/drivers/CMakeLists.txt b/testing/drivers/CMakeLists.txt new file mode 100644 index 00000000000..e796e074acf --- /dev/null +++ b/testing/drivers/CMakeLists.txt @@ -0,0 +1,24 @@ +# ############################################################################## +# apps/testing/drivers/CMakeLists.txt +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +nuttx_add_subdirectory() +nuttx_generate_kconfig(MENUDESC "drivers") diff --git a/testing/drivers/Make.defs b/testing/drivers/Make.defs new file mode 100644 index 00000000000..4da87143940 --- /dev/null +++ b/testing/drivers/Make.defs @@ -0,0 +1,23 @@ +############################################################################ +# apps/testing/drivers/Make.defs +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +include $(wildcard $(APPDIR)/testing/drivers/*/Make.defs) diff --git a/testing/drivers/Makefile b/testing/drivers/Makefile new file mode 100644 index 00000000000..a0da405f43b --- /dev/null +++ b/testing/drivers/Makefile @@ -0,0 +1,25 @@ +############################################################################ +# apps/testing/drivers/Makefile +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +MENUDESC = "dirvers" + +include $(APPDIR)/Directory.mk diff --git a/testing/drivertest/CMakeLists.txt b/testing/drivers/drivertest/CMakeLists.txt similarity index 99% rename from testing/drivertest/CMakeLists.txt rename to testing/drivers/drivertest/CMakeLists.txt index a3add4dca40..2492842304b 100644 --- a/testing/drivertest/CMakeLists.txt +++ b/testing/drivers/drivertest/CMakeLists.txt @@ -1,5 +1,5 @@ # ############################################################################## -# apps/testing/drivertest/CMakeLists.txt +# apps/testing/drivers/drivertest/CMakeLists.txt # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/drivertest/Kconfig b/testing/drivers/drivertest/Kconfig similarity index 100% rename from testing/drivertest/Kconfig rename to testing/drivers/drivertest/Kconfig diff --git a/testing/drivertest/Make.defs b/testing/drivers/drivertest/Make.defs similarity index 91% rename from testing/drivertest/Make.defs rename to testing/drivers/drivertest/Make.defs index a68b7e050e6..5e6a005340f 100644 --- a/testing/drivertest/Make.defs +++ b/testing/drivers/drivertest/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/drivertest/Make.defs +# apps/testing/drivers/drivertest/Make.defs # # SPDX-License-Identifier: Apache-2.0 # @@ -21,5 +21,5 @@ ############################################################################ ifneq ($(CONFIG_TESTING_DRIVER_TEST),) -CONFIGURED_APPS += $(APPDIR)/testing/drivertest +CONFIGURED_APPS += $(APPDIR)/testing/drivers/drivertest endif diff --git a/testing/drivertest/Makefile b/testing/drivers/drivertest/Makefile similarity index 98% rename from testing/drivertest/Makefile rename to testing/drivers/drivertest/Makefile index aa25dfa8381..470c9151297 100644 --- a/testing/drivertest/Makefile +++ b/testing/drivers/drivertest/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/drivertest/Makefile +# apps/testing/drivers/drivertest/Makefile # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/drivertest/drivertest_adc.c b/testing/drivers/drivertest/drivertest_adc.c similarity index 99% rename from testing/drivertest/drivertest_adc.c rename to testing/drivers/drivertest/drivertest_adc.c index 267ed770ac4..d9360b3793b 100644 --- a/testing/drivertest/drivertest_adc.c +++ b/testing/drivers/drivertest/drivertest_adc.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/drivertest/drivertest_adc.c + * apps/testing/drivers/drivertest/drivertest_adc.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/drivertest/drivertest_audio.c b/testing/drivers/drivertest/drivertest_audio.c similarity index 99% rename from testing/drivertest/drivertest_audio.c rename to testing/drivers/drivertest/drivertest_audio.c index 5ce08329f15..9ab9ebb6ae9 100644 --- a/testing/drivertest/drivertest_audio.c +++ b/testing/drivers/drivertest/drivertest_audio.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/drivertest/drivertest_audio.c + * apps/testing/drivers/drivertest/drivertest_audio.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/drivertest/drivertest_block.c b/testing/drivers/drivertest/drivertest_block.c similarity index 99% rename from testing/drivertest/drivertest_block.c rename to testing/drivers/drivertest/drivertest_block.c index daa655378d2..6dc70925d58 100644 --- a/testing/drivertest/drivertest_block.c +++ b/testing/drivers/drivertest/drivertest_block.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/drivertest/drivertest_block.c + * apps/testing/drivers/drivertest/drivertest_block.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/drivertest/drivertest_framebuffer.c b/testing/drivers/drivertest/drivertest_framebuffer.c similarity index 99% rename from testing/drivertest/drivertest_framebuffer.c rename to testing/drivers/drivertest/drivertest_framebuffer.c index 2d84567eb26..04ee135f3d1 100644 --- a/testing/drivertest/drivertest_framebuffer.c +++ b/testing/drivers/drivertest/drivertest_framebuffer.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/drivertest/drivertest_framebuffer.c + * apps/testing/drivers/drivertest/drivertest_framebuffer.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/drivertest/drivertest_gpio.c b/testing/drivers/drivertest/drivertest_gpio.c similarity index 99% rename from testing/drivertest/drivertest_gpio.c rename to testing/drivers/drivertest/drivertest_gpio.c index 32a0afd3d48..d5e917976ba 100644 --- a/testing/drivertest/drivertest_gpio.c +++ b/testing/drivers/drivertest/drivertest_gpio.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/drivertest/drivertest_gpio.c + * apps/testing/drivers/drivertest/drivertest_gpio.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/drivertest/drivertest_i2c_read.c b/testing/drivers/drivertest/drivertest_i2c_read.c similarity index 99% rename from testing/drivertest/drivertest_i2c_read.c rename to testing/drivers/drivertest/drivertest_i2c_read.c index 9e87b0bdf56..5b13b3c5ef8 100644 --- a/testing/drivertest/drivertest_i2c_read.c +++ b/testing/drivers/drivertest/drivertest_i2c_read.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/drivertest/drivertest_i2c_read.c + * apps/testing/drivers/drivertest/drivertest_i2c_read.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/drivertest/drivertest_i2c_spi.c b/testing/drivers/drivertest/drivertest_i2c_spi.c similarity index 98% rename from testing/drivertest/drivertest_i2c_spi.c rename to testing/drivers/drivertest/drivertest_i2c_spi.c index 1faaef177a5..b9a37afcfd8 100644 --- a/testing/drivertest/drivertest_i2c_spi.c +++ b/testing/drivers/drivertest/drivertest_i2c_spi.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/drivertest/drivertest_i2c_spi.c + * apps/testing/drivers/drivertest/drivertest_i2c_spi.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/drivertest/drivertest_i2c_write.c b/testing/drivers/drivertest/drivertest_i2c_write.c similarity index 99% rename from testing/drivertest/drivertest_i2c_write.c rename to testing/drivers/drivertest/drivertest_i2c_write.c index 959e8b62fcd..2e7b2fbe993 100644 --- a/testing/drivertest/drivertest_i2c_write.c +++ b/testing/drivers/drivertest/drivertest_i2c_write.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/drivertest/drivertest_i2c_write.c + * apps/testing/drivers/drivertest/drivertest_i2c_write.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/drivertest/drivertest_lcd.c b/testing/drivers/drivertest/drivertest_lcd.c similarity index 99% rename from testing/drivertest/drivertest_lcd.c rename to testing/drivers/drivertest/drivertest_lcd.c index 39530f79e20..32cbaa30a05 100644 --- a/testing/drivertest/drivertest_lcd.c +++ b/testing/drivers/drivertest/drivertest_lcd.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/drivertest/drivertest_lcd.c + * apps/testing/drivers/drivertest/drivertest_lcd.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/drivertest/drivertest_mps2.c b/testing/drivers/drivertest/drivertest_mps2.c similarity index 99% rename from testing/drivertest/drivertest_mps2.c rename to testing/drivers/drivertest/drivertest_mps2.c index 7ccbc1f2142..9d33b4143b3 100644 --- a/testing/drivertest/drivertest_mps2.c +++ b/testing/drivers/drivertest/drivertest_mps2.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/drivertest/drivertest_mps2.c + * apps/testing/drivers/drivertest/drivertest_mps2.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/drivertest/drivertest_mps2_isr_signal.c b/testing/drivers/drivertest/drivertest_mps2_isr_signal.c similarity index 98% rename from testing/drivertest/drivertest_mps2_isr_signal.c rename to testing/drivers/drivertest/drivertest_mps2_isr_signal.c index 5157b679a35..b274b6bd04c 100644 --- a/testing/drivertest/drivertest_mps2_isr_signal.c +++ b/testing/drivers/drivertest/drivertest_mps2_isr_signal.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/drivertest/drivertest_mps2_isr_signal.c + * apps/testing/drivers/drivertest/drivertest_mps2_isr_signal.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/drivertest/drivertest_mps2_zerointerrupt.c b/testing/drivers/drivertest/drivertest_mps2_zerointerrupt.c similarity index 99% rename from testing/drivertest/drivertest_mps2_zerointerrupt.c rename to testing/drivers/drivertest/drivertest_mps2_zerointerrupt.c index 852404dec5d..6a15ee91dc8 100644 --- a/testing/drivertest/drivertest_mps2_zerointerrupt.c +++ b/testing/drivers/drivertest/drivertest_mps2_zerointerrupt.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/drivertest/drivertest_mps2_zerointerrupt.c + * apps/testing/drivers/drivertest/drivertest_mps2_zerointerrupt.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/drivertest/drivertest_oneshot.c b/testing/drivers/drivertest/drivertest_oneshot.c similarity index 99% rename from testing/drivertest/drivertest_oneshot.c rename to testing/drivers/drivertest/drivertest_oneshot.c index 6d7afcc75ca..f950c0ada1b 100644 --- a/testing/drivertest/drivertest_oneshot.c +++ b/testing/drivers/drivertest/drivertest_oneshot.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/drivertest/drivertest_oneshot.c + * apps/testing/drivers/drivertest/drivertest_oneshot.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/drivertest/drivertest_pm.c b/testing/drivers/drivertest/drivertest_pm.c similarity index 99% rename from testing/drivertest/drivertest_pm.c rename to testing/drivers/drivertest/drivertest_pm.c index fc8ee4bdc38..a616b4227c3 100644 --- a/testing/drivertest/drivertest_pm.c +++ b/testing/drivers/drivertest/drivertest_pm.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/drivertest/drivertest_pm.c + * apps/testing/drivers/drivertest/drivertest_pm.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/drivertest/drivertest_pm_runtime.c b/testing/drivers/drivertest/drivertest_pm_runtime.c similarity index 99% rename from testing/drivertest/drivertest_pm_runtime.c rename to testing/drivers/drivertest/drivertest_pm_runtime.c index a0db9947c9f..8cef500d38f 100644 --- a/testing/drivertest/drivertest_pm_runtime.c +++ b/testing/drivers/drivertest/drivertest_pm_runtime.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/drivertest/drivertest_pm_runtime.c + * apps/testing/drivers/drivertest/drivertest_pm_runtime.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/drivertest/drivertest_pm_smp.c b/testing/drivers/drivertest/drivertest_pm_smp.c similarity index 99% rename from testing/drivertest/drivertest_pm_smp.c rename to testing/drivers/drivertest/drivertest_pm_smp.c index 6edbb66948a..5de71e546a3 100644 --- a/testing/drivertest/drivertest_pm_smp.c +++ b/testing/drivers/drivertest/drivertest_pm_smp.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/drivertest/drivertest_pm_smp.c + * apps/testing/drivers/drivertest/drivertest_pm_smp.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/drivertest/drivertest_posix_timer.c b/testing/drivers/drivertest/drivertest_posix_timer.c similarity index 99% rename from testing/drivertest/drivertest_posix_timer.c rename to testing/drivers/drivertest/drivertest_posix_timer.c index b52b1887de1..e87dd7a3374 100644 --- a/testing/drivertest/drivertest_posix_timer.c +++ b/testing/drivers/drivertest/drivertest_posix_timer.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/drivertest/drivertest_posix_timer.c + * apps/testing/drivers/drivertest/drivertest_posix_timer.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/drivertest/drivertest_pwm.c b/testing/drivers/drivertest/drivertest_pwm.c similarity index 99% rename from testing/drivertest/drivertest_pwm.c rename to testing/drivers/drivertest/drivertest_pwm.c index 18475184d5e..5869db08f88 100644 --- a/testing/drivertest/drivertest_pwm.c +++ b/testing/drivers/drivertest/drivertest_pwm.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/drivertest/drivertest_pwm.c + * apps/testing/drivers/drivertest/drivertest_pwm.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/drivertest/drivertest_regulator.c b/testing/drivers/drivertest/drivertest_regulator.c similarity index 99% rename from testing/drivertest/drivertest_regulator.c rename to testing/drivers/drivertest/drivertest_regulator.c index bff19677c6e..19de21928ea 100644 --- a/testing/drivertest/drivertest_regulator.c +++ b/testing/drivers/drivertest/drivertest_regulator.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/drivertest/drivertest_regulator.c + * apps/testing/drivers/drivertest/drivertest_regulator.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/drivertest/drivertest_relay.c b/testing/drivers/drivertest/drivertest_relay.c similarity index 99% rename from testing/drivertest/drivertest_relay.c rename to testing/drivers/drivertest/drivertest_relay.c index 7a1671f88fc..53871d94758 100644 --- a/testing/drivertest/drivertest_relay.c +++ b/testing/drivers/drivertest/drivertest_relay.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/drivertest/drivertest_relay.c + * apps/testing/drivers/drivertest/drivertest_relay.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/drivertest/drivertest_rtc.c b/testing/drivers/drivertest/drivertest_rtc.c similarity index 99% rename from testing/drivertest/drivertest_rtc.c rename to testing/drivers/drivertest/drivertest_rtc.c index 53ed2a5d11f..e4cd03301f2 100644 --- a/testing/drivertest/drivertest_rtc.c +++ b/testing/drivers/drivertest/drivertest_rtc.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/drivertest/drivertest_rtc.c + * apps/testing/drivers/drivertest/drivertest_rtc.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/drivertest/drivertest_simple.c b/testing/drivers/drivertest/drivertest_simple.c similarity index 97% rename from testing/drivertest/drivertest_simple.c rename to testing/drivers/drivertest/drivertest_simple.c index 485b592e203..eea6c86d16f 100644 --- a/testing/drivertest/drivertest_simple.c +++ b/testing/drivers/drivertest/drivertest_simple.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/drivertest/drivertest_simple.c + * apps/testing/drivers/drivertest/drivertest_simple.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/drivertest/drivertest_timer.c b/testing/drivers/drivertest/drivertest_timer.c similarity index 99% rename from testing/drivertest/drivertest_timer.c rename to testing/drivers/drivertest/drivertest_timer.c index 4478eda0f4e..55f05425754 100644 --- a/testing/drivertest/drivertest_timer.c +++ b/testing/drivers/drivertest/drivertest_timer.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/drivertest/drivertest_timer.c + * apps/testing/drivers/drivertest/drivertest_timer.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/drivertest/drivertest_touchpanel.c b/testing/drivers/drivertest/drivertest_touchpanel.c similarity index 99% rename from testing/drivertest/drivertest_touchpanel.c rename to testing/drivers/drivertest/drivertest_touchpanel.c index 9f0255ec6ce..b354760c6ac 100644 --- a/testing/drivertest/drivertest_touchpanel.c +++ b/testing/drivers/drivertest/drivertest_touchpanel.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/drivertest/drivertest_touchpanel.c + * apps/testing/drivers/drivertest/drivertest_touchpanel.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/drivertest/drivertest_uart.c b/testing/drivers/drivertest/drivertest_uart.c similarity index 99% rename from testing/drivertest/drivertest_uart.c rename to testing/drivers/drivertest/drivertest_uart.c index cbe127b7c77..23875b17628 100644 --- a/testing/drivertest/drivertest_uart.c +++ b/testing/drivers/drivertest/drivertest_uart.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/drivertest/drivertest_uart.c + * apps/testing/drivers/drivertest/drivertest_uart.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/drivertest/drivertest_watchdog.c b/testing/drivers/drivertest/drivertest_watchdog.c similarity index 99% rename from testing/drivertest/drivertest_watchdog.c rename to testing/drivers/drivertest/drivertest_watchdog.c index 8efa41eb2b2..a9240479ef9 100644 --- a/testing/drivertest/drivertest_watchdog.c +++ b/testing/drivers/drivertest/drivertest_watchdog.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/drivertest/drivertest_watchdog.c + * apps/testing/drivers/drivertest/drivertest_watchdog.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/drivertest/test_content_gen.py b/testing/drivers/drivertest/test_content_gen.py similarity index 98% rename from testing/drivertest/test_content_gen.py rename to testing/drivers/drivertest/test_content_gen.py index 3045252d1e9..77ebeb38f8d 100644 --- a/testing/drivertest/test_content_gen.py +++ b/testing/drivers/drivertest/test_content_gen.py @@ -1,6 +1,6 @@ #!/bin/python3 ############################################################################# -# apps/testing/drivertest/cmocka_driver_uart/test_content_gen.py +# apps/testing/drivers/drivertest/cmocka_driver_uart/test_content_gen.py # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/fftest/CMakeLists.txt b/testing/drivers/fftest/CMakeLists.txt similarity index 96% rename from testing/fftest/CMakeLists.txt rename to testing/drivers/fftest/CMakeLists.txt index 77513c6012b..bf5fca5cadf 100644 --- a/testing/fftest/CMakeLists.txt +++ b/testing/drivers/fftest/CMakeLists.txt @@ -1,5 +1,5 @@ # ############################################################################## -# apps/testing/fftest/CMakeLists.txt +# apps/testing/drivers/fftest/CMakeLists.txt # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/fftest/Kconfig b/testing/drivers/fftest/Kconfig similarity index 100% rename from testing/fftest/Kconfig rename to testing/drivers/fftest/Kconfig diff --git a/testing/fftest/Make.defs b/testing/drivers/fftest/Make.defs similarity index 91% rename from testing/fftest/Make.defs rename to testing/drivers/fftest/Make.defs index 0190fb4f21e..a02bc75dddf 100644 --- a/testing/fftest/Make.defs +++ b/testing/drivers/fftest/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/fftest/Make.defs +# apps/testing/drivers/fftest/Make.defs # # SPDX-License-Identifier: Apache-2.0 # @@ -21,5 +21,5 @@ ############################################################################ ifneq ($(CONFIG_TESTING_FF),) -CONFIGURED_APPS += $(APPDIR)/testing/fftest +CONFIGURED_APPS += $(APPDIR)/testing/drivers/fftest endif diff --git a/testing/fftest/Makefile b/testing/drivers/fftest/Makefile similarity index 96% rename from testing/fftest/Makefile rename to testing/drivers/fftest/Makefile index 981d502f136..56e8fc56fe0 100644 --- a/testing/fftest/Makefile +++ b/testing/drivers/fftest/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/fftest/Makefile +# apps/testing/drivers/fftest/Makefile # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/fftest/fftest.c b/testing/drivers/fftest/fftest.c similarity index 99% rename from testing/fftest/fftest.c rename to testing/drivers/fftest/fftest.c index 51700914ab9..67871195c7e 100644 --- a/testing/fftest/fftest.c +++ b/testing/drivers/fftest/fftest.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/fftest/fftest.c + * apps/testing/drivers/fftest/fftest.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/nand_sim/CMakeLists.txt b/testing/drivers/nand_sim/CMakeLists.txt similarity index 96% rename from testing/nand_sim/CMakeLists.txt rename to testing/drivers/nand_sim/CMakeLists.txt index 4f9b4021c60..e3c00504cb8 100644 --- a/testing/nand_sim/CMakeLists.txt +++ b/testing/drivers/nand_sim/CMakeLists.txt @@ -1,5 +1,5 @@ # ############################################################################## -# apps/testing/nand_sim/CMakeLists.txt +# apps/testing/drivers/nand_sim/CMakeLists.txt # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/nand_sim/Kconfig b/testing/drivers/nand_sim/Kconfig similarity index 100% rename from testing/nand_sim/Kconfig rename to testing/drivers/nand_sim/Kconfig diff --git a/testing/nand_sim/Make.defs b/testing/drivers/nand_sim/Make.defs similarity index 91% rename from testing/nand_sim/Make.defs rename to testing/drivers/nand_sim/Make.defs index 05557f6de6c..6e573c87bf1 100644 --- a/testing/nand_sim/Make.defs +++ b/testing/drivers/nand_sim/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/nand_sim/Make.defs +# apps/testing/drivers/nand_sim/Make.defs # # SPDX-License-Identifier: Apache-2.0 # @@ -21,5 +21,5 @@ ############################################################################ ifneq ($(CONFIG_TESTING_NAND_SIM),) -CONFIGURED_APPS += $(APPDIR)/testing/nand_sim +CONFIGURED_APPS += $(APPDIR)/testing/drivers/nand_sim endif diff --git a/testing/nand_sim/Makefile b/testing/drivers/nand_sim/Makefile similarity index 96% rename from testing/nand_sim/Makefile rename to testing/drivers/nand_sim/Makefile index a665792095e..1aecf0d36d5 100644 --- a/testing/nand_sim/Makefile +++ b/testing/drivers/nand_sim/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/nand_sim/Makefile +# apps/testing/drivers/nand_sim/Makefile # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/nand_sim/nand_sim_main.c b/testing/drivers/nand_sim/nand_sim_main.c similarity index 99% rename from testing/nand_sim/nand_sim_main.c rename to testing/drivers/nand_sim/nand_sim_main.c index 63e64b91faf..9e91227a4ad 100644 --- a/testing/nand_sim/nand_sim_main.c +++ b/testing/drivers/nand_sim/nand_sim_main.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/nand_sim/nand_sim_main.c + * apps/testing/drivers/nand_sim/nand_sim_main.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/pcitest/Kconfig b/testing/drivers/pcitest/Kconfig similarity index 100% rename from testing/pcitest/Kconfig rename to testing/drivers/pcitest/Kconfig diff --git a/testing/pcitest/Make.defs b/testing/drivers/pcitest/Make.defs similarity index 91% rename from testing/pcitest/Make.defs rename to testing/drivers/pcitest/Make.defs index 985276be2d4..a939dbf46be 100644 --- a/testing/pcitest/Make.defs +++ b/testing/drivers/pcitest/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/pcitest/Make.defs +# apps/testing/drivers/pcitest/Make.defs # # SPDX-License-Identifier: Apache-2.0 # @@ -21,5 +21,5 @@ ############################################################################ ifneq ($(CONFIG_TESTING_PCITEST),) -CONFIGURED_APPS += $(APPDIR)/testing/pcitest +CONFIGURED_APPS += $(APPDIR)/testing/drivers/pcitest endif diff --git a/testing/pcitest/Makefile b/testing/drivers/pcitest/Makefile similarity index 96% rename from testing/pcitest/Makefile rename to testing/drivers/pcitest/Makefile index 46c7050bf56..e16e66f89dd 100644 --- a/testing/pcitest/Makefile +++ b/testing/drivers/pcitest/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/pcitest/Makefile +# apps/testing/drivers/pcitest/Makefile # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/pcitest/pcitest.c b/testing/drivers/pcitest/pcitest.c similarity index 99% rename from testing/pcitest/pcitest.c rename to testing/drivers/pcitest/pcitest.c index 2814c0c517e..684498d24fe 100644 --- a/testing/pcitest/pcitest.c +++ b/testing/drivers/pcitest/pcitest.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/pcitest/pcitest.c + * apps/testing/drivers/pcitest/pcitest.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/sd_stress/Kconfig b/testing/drivers/sd_stress/Kconfig similarity index 100% rename from testing/sd_stress/Kconfig rename to testing/drivers/sd_stress/Kconfig diff --git a/testing/sd_stress/Make.defs b/testing/drivers/sd_stress/Make.defs similarity index 91% rename from testing/sd_stress/Make.defs rename to testing/drivers/sd_stress/Make.defs index 1da23f092af..4d184b4d0b3 100644 --- a/testing/sd_stress/Make.defs +++ b/testing/drivers/sd_stress/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/sd_stress/Make.defs +# apps/testing/drivers/sd_stress/Make.defs # # SPDX-License-Identifier: Apache-2.0 # @@ -21,5 +21,5 @@ ############################################################################ ifneq ($(CONFIG_TESTING_SD_STRESS),) -CONFIGURED_APPS += $(APPDIR)/testing/sd_stress +CONFIGURED_APPS += $(APPDIR)/testing/drivers/sd_stress endif diff --git a/testing/sd_stress/Makefile b/testing/drivers/sd_stress/Makefile similarity index 96% rename from testing/sd_stress/Makefile rename to testing/drivers/sd_stress/Makefile index a70d6857d7b..a4f162186ee 100644 --- a/testing/sd_stress/Makefile +++ b/testing/drivers/sd_stress/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/sd_stress/Makefile +# apps/testing/drivers/sd_stress/Makefile # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/sd_stress/sd_stress_main.c b/testing/drivers/sd_stress/sd_stress_main.c similarity index 99% rename from testing/sd_stress/sd_stress_main.c rename to testing/drivers/sd_stress/sd_stress_main.c index ddb598e804f..afcf528a01f 100644 --- a/testing/sd_stress/sd_stress_main.c +++ b/testing/drivers/sd_stress/sd_stress_main.c @@ -1,9 +1,9 @@ /**************************************************************************** - * apps/testing/sd_stress/sd_stress_main.c + * apps/testing/drivers/sd_stress/sd_stress_main.c * * SPDX-License-Identifier: BSD-3-Clause - * SPDX-FileCopyrightText: 2016-2021 PX4 Development Team. All rights reserved. - * + * SPDX-FileCopyrightText: 2016-2021 PX4 Development Team. All rights + * reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: From 8141e35f99f97f806201cf558522245b9e595ca5 Mon Sep 17 00:00:00 2001 From: tengshuangshuang Date: Tue, 21 Jan 2025 17:50:45 +0800 Subject: [PATCH 153/391] apps/testing:move epoll, fatutf8 ... folders to the new fs folder Signed-off-by: tengshuangshuang --- testing/fs/.gitignore | 1 + testing/fs/CMakeLists.txt | 24 ++++++++++++++++++ testing/fs/Make.defs | 23 +++++++++++++++++ testing/fs/Makefile | 25 +++++++++++++++++++ testing/{ => fs}/epoll/CMakeLists.txt | 2 +- testing/{ => fs}/epoll/Kconfig | 0 testing/{ => fs}/epoll/Make.defs | 4 +-- testing/{ => fs}/epoll/Makefile | 2 +- testing/{ => fs}/epoll/epoll.c | 2 +- testing/{ => fs}/fatutf8/CMakeLists.txt | 2 +- testing/{ => fs}/fatutf8/Kconfig | 0 testing/{ => fs}/fatutf8/Make.defs | 4 +-- testing/{ => fs}/fatutf8/Makefile | 2 +- testing/{ => fs}/fatutf8/fatutf8_main.c | 2 +- testing/{ => fs}/fdsantest/CMakeLists.txt | 2 +- testing/{ => fs}/fdsantest/Kconfig | 2 +- testing/{ => fs}/fdsantest/Make.defs | 4 +-- testing/{ => fs}/fdsantest/Makefile | 2 +- testing/{ => fs}/fdsantest/fdsantest_simple.c | 2 +- testing/{ => fs}/fopencookie/Kconfig | 0 testing/{ => fs}/fopencookie/Make.defs | 4 +-- testing/{ => fs}/fopencookie/Makefile | 2 +- testing/{ => fs}/fopencookie/fopencookie.c | 2 +- testing/{ => fs}/fstest/CMakeLists.txt | 2 +- testing/{ => fs}/fstest/Kconfig | 0 testing/{ => fs}/fstest/Make.defs | 4 +-- testing/{ => fs}/fstest/Makefile | 2 +- testing/{ => fs}/fstest/fstest_main.c | 2 +- testing/{ => fs}/mtd_config_fs/CMakeLists.txt | 2 +- testing/{ => fs}/mtd_config_fs/Kconfig | 0 testing/{ => fs}/mtd_config_fs/Make.defs | 4 +-- testing/{ => fs}/mtd_config_fs/Makefile | 2 +- .../mtd_config_fs/mtd_config_fs_test_main.c | 2 +- testing/{ => fs}/nxffs/CMakeLists.txt | 2 +- testing/{ => fs}/nxffs/Kconfig | 0 testing/{ => fs}/nxffs/Make.defs | 4 +-- testing/{ => fs}/nxffs/Makefile | 2 +- testing/{ => fs}/nxffs/nxffs_main.c | 2 +- testing/{ => fs}/smart/CMakeLists.txt | 2 +- testing/{ => fs}/smart/Kconfig | 0 testing/{ => fs}/smart/Make.defs | 4 +-- testing/{ => fs}/smart/Makefile | 2 +- testing/{ => fs}/smart/smart_main.c | 2 +- testing/{ => fs}/smart_test/CMakeLists.txt | 2 +- testing/{ => fs}/smart_test/Kconfig | 0 testing/{ => fs}/smart_test/Make.defs | 4 +-- testing/{ => fs}/smart_test/Makefile | 2 +- testing/{ => fs}/smart_test/smart_test.c | 2 +- 48 files changed, 118 insertions(+), 45 deletions(-) create mode 100644 testing/fs/.gitignore create mode 100644 testing/fs/CMakeLists.txt create mode 100644 testing/fs/Make.defs create mode 100644 testing/fs/Makefile rename testing/{ => fs}/epoll/CMakeLists.txt (96%) rename testing/{ => fs}/epoll/Kconfig (100%) rename testing/{ => fs}/epoll/Make.defs (92%) rename testing/{ => fs}/epoll/Makefile (97%) rename testing/{ => fs}/epoll/epoll.c (99%) rename testing/{ => fs}/fatutf8/CMakeLists.txt (96%) rename testing/{ => fs}/fatutf8/Kconfig (100%) rename testing/{ => fs}/fatutf8/Make.defs (92%) rename testing/{ => fs}/fatutf8/Makefile (97%) rename testing/{ => fs}/fatutf8/fatutf8_main.c (99%) rename testing/{ => fs}/fdsantest/CMakeLists.txt (96%) rename testing/{ => fs}/fdsantest/Kconfig (93%) rename testing/{ => fs}/fdsantest/Make.defs (92%) rename testing/{ => fs}/fdsantest/Makefile (97%) rename testing/{ => fs}/fdsantest/fdsantest_simple.c (98%) rename testing/{ => fs}/fopencookie/Kconfig (100%) rename testing/{ => fs}/fopencookie/Make.defs (91%) rename testing/{ => fs}/fopencookie/Makefile (96%) rename testing/{ => fs}/fopencookie/fopencookie.c (99%) rename testing/{ => fs}/fstest/CMakeLists.txt (96%) rename testing/{ => fs}/fstest/Kconfig (100%) rename testing/{ => fs}/fstest/Make.defs (92%) rename testing/{ => fs}/fstest/Makefile (97%) rename testing/{ => fs}/fstest/fstest_main.c (99%) rename testing/{ => fs}/mtd_config_fs/CMakeLists.txt (96%) rename testing/{ => fs}/mtd_config_fs/Kconfig (100%) rename testing/{ => fs}/mtd_config_fs/Make.defs (91%) rename testing/{ => fs}/mtd_config_fs/Makefile (97%) rename testing/{ => fs}/mtd_config_fs/mtd_config_fs_test_main.c (99%) rename testing/{ => fs}/nxffs/CMakeLists.txt (96%) rename testing/{ => fs}/nxffs/Kconfig (100%) rename testing/{ => fs}/nxffs/Make.defs (92%) rename testing/{ => fs}/nxffs/Makefile (97%) rename testing/{ => fs}/nxffs/nxffs_main.c (99%) rename testing/{ => fs}/smart/CMakeLists.txt (96%) rename testing/{ => fs}/smart/Kconfig (100%) rename testing/{ => fs}/smart/Make.defs (92%) rename testing/{ => fs}/smart/Makefile (97%) rename testing/{ => fs}/smart/smart_main.c (99%) rename testing/{ => fs}/smart_test/CMakeLists.txt (96%) rename testing/{ => fs}/smart_test/Kconfig (100%) rename testing/{ => fs}/smart_test/Make.defs (91%) rename testing/{ => fs}/smart_test/Makefile (96%) rename testing/{ => fs}/smart_test/smart_test.c (99%) diff --git a/testing/fs/.gitignore b/testing/fs/.gitignore new file mode 100644 index 00000000000..9e1d2593ee8 --- /dev/null +++ b/testing/fs/.gitignore @@ -0,0 +1 @@ +/Kconfig diff --git a/testing/fs/CMakeLists.txt b/testing/fs/CMakeLists.txt new file mode 100644 index 00000000000..186ef20ef9c --- /dev/null +++ b/testing/fs/CMakeLists.txt @@ -0,0 +1,24 @@ +# ############################################################################## +# apps/testing/fs/CMakeLists.txt +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +nuttx_add_subdirectory() +nuttx_generate_kconfig(MENUDESC "fs") diff --git a/testing/fs/Make.defs b/testing/fs/Make.defs new file mode 100644 index 00000000000..fd956a02603 --- /dev/null +++ b/testing/fs/Make.defs @@ -0,0 +1,23 @@ +############################################################################ +# apps/testing/fs/Make.defs +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +include $(wildcard $(APPDIR)/testing/fs/*/Make.defs) diff --git a/testing/fs/Makefile b/testing/fs/Makefile new file mode 100644 index 00000000000..75783de891a --- /dev/null +++ b/testing/fs/Makefile @@ -0,0 +1,25 @@ +############################################################################ +# apps/testing/fs/Makefile +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +MENUDESC = "fs" + +include $(APPDIR)/Directory.mk diff --git a/testing/epoll/CMakeLists.txt b/testing/fs/epoll/CMakeLists.txt similarity index 96% rename from testing/epoll/CMakeLists.txt rename to testing/fs/epoll/CMakeLists.txt index 3839141e1d4..2428f36125d 100644 --- a/testing/epoll/CMakeLists.txt +++ b/testing/fs/epoll/CMakeLists.txt @@ -1,5 +1,5 @@ # ############################################################################## -# apps/testing/epoll/CMakeLists.txt +# apps/testing/fs/epoll/CMakeLists.txt # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/epoll/Kconfig b/testing/fs/epoll/Kconfig similarity index 100% rename from testing/epoll/Kconfig rename to testing/fs/epoll/Kconfig diff --git a/testing/epoll/Make.defs b/testing/fs/epoll/Make.defs similarity index 92% rename from testing/epoll/Make.defs rename to testing/fs/epoll/Make.defs index fbabd40594a..d9f822e36ec 100644 --- a/testing/epoll/Make.defs +++ b/testing/fs/epoll/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/epoll/Make.defs +# apps/testing/fs/epoll/Make.defs # # SPDX-License-Identifier: Apache-2.0 # @@ -21,5 +21,5 @@ ############################################################################ ifneq ($(CONFIG_TESTING_EPOLL),) -CONFIGURED_APPS += $(APPDIR)/testing/epoll +CONFIGURED_APPS += $(APPDIR)/testing/fs/epoll endif diff --git a/testing/epoll/Makefile b/testing/fs/epoll/Makefile similarity index 97% rename from testing/epoll/Makefile rename to testing/fs/epoll/Makefile index 2a78ea7ac8f..a03158421e3 100644 --- a/testing/epoll/Makefile +++ b/testing/fs/epoll/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/epoll/Makefile +# apps/testing/fs/epoll/Makefile # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/epoll/epoll.c b/testing/fs/epoll/epoll.c similarity index 99% rename from testing/epoll/epoll.c rename to testing/fs/epoll/epoll.c index 970a7ad4cbb..cd1d6cc0f4e 100644 --- a/testing/epoll/epoll.c +++ b/testing/fs/epoll/epoll.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/epoll/epoll.c + * apps/testing/fs/epoll/epoll.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/fatutf8/CMakeLists.txt b/testing/fs/fatutf8/CMakeLists.txt similarity index 96% rename from testing/fatutf8/CMakeLists.txt rename to testing/fs/fatutf8/CMakeLists.txt index 276ae93a91a..cc7a803224a 100644 --- a/testing/fatutf8/CMakeLists.txt +++ b/testing/fs/fatutf8/CMakeLists.txt @@ -1,5 +1,5 @@ # ############################################################################## -# apps/testing/fatutf8/CMakeLists.txt +# apps/testing/fs/fatutf8/CMakeLists.txt # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/fatutf8/Kconfig b/testing/fs/fatutf8/Kconfig similarity index 100% rename from testing/fatutf8/Kconfig rename to testing/fs/fatutf8/Kconfig diff --git a/testing/fatutf8/Make.defs b/testing/fs/fatutf8/Make.defs similarity index 92% rename from testing/fatutf8/Make.defs rename to testing/fs/fatutf8/Make.defs index 2c62dc1fa8d..be545cf31d3 100644 --- a/testing/fatutf8/Make.defs +++ b/testing/fs/fatutf8/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/fatutf8/Make.defs +# apps/testing/fs/fatutf8/Make.defs # # SPDX-License-Identifier: Apache-2.0 # @@ -21,5 +21,5 @@ ############################################################################ ifneq ($(CONFIG_TESTING_FATUTF8),) -CONFIGURED_APPS += $(APPDIR)/testing/fatutf8 +CONFIGURED_APPS += $(APPDIR)/testing/fs/fatutf8 endif diff --git a/testing/fatutf8/Makefile b/testing/fs/fatutf8/Makefile similarity index 97% rename from testing/fatutf8/Makefile rename to testing/fs/fatutf8/Makefile index e43198ec30a..97064eedfcd 100644 --- a/testing/fatutf8/Makefile +++ b/testing/fs/fatutf8/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/fatutf8/Makefile +# apps/testing/fs/fatutf8/Makefile # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/fatutf8/fatutf8_main.c b/testing/fs/fatutf8/fatutf8_main.c similarity index 99% rename from testing/fatutf8/fatutf8_main.c rename to testing/fs/fatutf8/fatutf8_main.c index 6975294e83c..11a3daca40e 100644 --- a/testing/fatutf8/fatutf8_main.c +++ b/testing/fs/fatutf8/fatutf8_main.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/fatutf8/fatutf8_main.c + * apps/testing/fs/fatutf8/fatutf8_main.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/fdsantest/CMakeLists.txt b/testing/fs/fdsantest/CMakeLists.txt similarity index 96% rename from testing/fdsantest/CMakeLists.txt rename to testing/fs/fdsantest/CMakeLists.txt index f6a5f7be15e..f2da2d6ba7d 100644 --- a/testing/fdsantest/CMakeLists.txt +++ b/testing/fs/fdsantest/CMakeLists.txt @@ -1,5 +1,5 @@ # ############################################################################## -# apps/testing/fdsantest/CMakeLists.txt +# apps/testing/fs/fdsantest/CMakeLists.txt # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/fdsantest/Kconfig b/testing/fs/fdsantest/Kconfig similarity index 93% rename from testing/fdsantest/Kconfig rename to testing/fs/fdsantest/Kconfig index 97d82510cfc..063f7092c7f 100644 --- a/testing/fdsantest/Kconfig +++ b/testing/fs/fdsantest/Kconfig @@ -4,7 +4,7 @@ # config TESTING_FDSAN_TEST - tristate "vela cmocka fdsan test" + tristate "Nuttx cmocka fdsan test" default n depends on TESTING_CMOCKA ---help--- diff --git a/testing/fdsantest/Make.defs b/testing/fs/fdsantest/Make.defs similarity index 92% rename from testing/fdsantest/Make.defs rename to testing/fs/fdsantest/Make.defs index 4be99c97550..a6e03ba8034 100644 --- a/testing/fdsantest/Make.defs +++ b/testing/fs/fdsantest/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/fdsantest/Make.defs +# apps/testing/fs/fdsantest/Make.defs # # SPDX-License-Identifier: Apache-2.0 # @@ -21,5 +21,5 @@ ############################################################################ ifneq ($(CONFIG_TESTING_FDSAN_TEST),) -CONFIGURED_APPS += $(APPDIR)/testing/fdsantest +CONFIGURED_APPS += $(APPDIR)/testing/fs/fdsantest endif diff --git a/testing/fdsantest/Makefile b/testing/fs/fdsantest/Makefile similarity index 97% rename from testing/fdsantest/Makefile rename to testing/fs/fdsantest/Makefile index cddf85651f5..ee2df0850d6 100644 --- a/testing/fdsantest/Makefile +++ b/testing/fs/fdsantest/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/fdsantest/Makefile +# apps/testing/fs/fdsantest/Makefile # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/fdsantest/fdsantest_simple.c b/testing/fs/fdsantest/fdsantest_simple.c similarity index 98% rename from testing/fdsantest/fdsantest_simple.c rename to testing/fs/fdsantest/fdsantest_simple.c index ab4068c7f8b..128e2878bff 100644 --- a/testing/fdsantest/fdsantest_simple.c +++ b/testing/fs/fdsantest/fdsantest_simple.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/fdsantest/fdsantest_simple.c + * apps/testing/fs/fdsantest/fdsantest_simple.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/fopencookie/Kconfig b/testing/fs/fopencookie/Kconfig similarity index 100% rename from testing/fopencookie/Kconfig rename to testing/fs/fopencookie/Kconfig diff --git a/testing/fopencookie/Make.defs b/testing/fs/fopencookie/Make.defs similarity index 91% rename from testing/fopencookie/Make.defs rename to testing/fs/fopencookie/Make.defs index 778de83a9e2..70ab59fee93 100644 --- a/testing/fopencookie/Make.defs +++ b/testing/fs/fopencookie/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/fopencookie/Make.defs +# apps/testing/fs/fopencookie/Make.defs # # SPDX-License-Identifier: Apache-2.0 # @@ -21,5 +21,5 @@ ############################################################################ ifneq ($(CONFIG_TESTING_FOPENCOOKIE_TEST),) -CONFIGURED_APPS += $(APPDIR)/testing/fopencookie +CONFIGURED_APPS += $(APPDIR)/testing/fs/fopencookie endif diff --git a/testing/fopencookie/Makefile b/testing/fs/fopencookie/Makefile similarity index 96% rename from testing/fopencookie/Makefile rename to testing/fs/fopencookie/Makefile index 4af65d1f923..6ad0d6d9364 100644 --- a/testing/fopencookie/Makefile +++ b/testing/fs/fopencookie/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/fopencookie/Makefile +# apps/testing/fs/fopencookie/Makefile # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/fopencookie/fopencookie.c b/testing/fs/fopencookie/fopencookie.c similarity index 99% rename from testing/fopencookie/fopencookie.c rename to testing/fs/fopencookie/fopencookie.c index 0c35a40da6c..02d943c2639 100644 --- a/testing/fopencookie/fopencookie.c +++ b/testing/fs/fopencookie/fopencookie.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/fopencookie/fopencookie.c + * apps/testing/fs/fopencookie/fopencookie.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/fstest/CMakeLists.txt b/testing/fs/fstest/CMakeLists.txt similarity index 96% rename from testing/fstest/CMakeLists.txt rename to testing/fs/fstest/CMakeLists.txt index 5b938a337dd..0228a8109dd 100644 --- a/testing/fstest/CMakeLists.txt +++ b/testing/fs/fstest/CMakeLists.txt @@ -1,5 +1,5 @@ # ############################################################################## -# apps/testing/fstest/CMakeLists.txt +# apps/testing/fs/fstest/CMakeLists.txt # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/fstest/Kconfig b/testing/fs/fstest/Kconfig similarity index 100% rename from testing/fstest/Kconfig rename to testing/fs/fstest/Kconfig diff --git a/testing/fstest/Make.defs b/testing/fs/fstest/Make.defs similarity index 92% rename from testing/fstest/Make.defs rename to testing/fs/fstest/Make.defs index 4545509e9a4..905a947d8c5 100644 --- a/testing/fstest/Make.defs +++ b/testing/fs/fstest/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/fstest/Make.defs +# apps/testing/fs/fstest/Make.defs # # SPDX-License-Identifier: Apache-2.0 # @@ -21,5 +21,5 @@ ############################################################################ ifneq ($(CONFIG_TESTING_FSTEST),) -CONFIGURED_APPS += $(APPDIR)/testing/fstest +CONFIGURED_APPS += $(APPDIR)/testing/fs/fstest endif diff --git a/testing/fstest/Makefile b/testing/fs/fstest/Makefile similarity index 97% rename from testing/fstest/Makefile rename to testing/fs/fstest/Makefile index 4a845eb7995..ab2cecd69df 100644 --- a/testing/fstest/Makefile +++ b/testing/fs/fstest/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/fstest/Makefile +# apps/testing/fs/fstest/Makefile # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/fstest/fstest_main.c b/testing/fs/fstest/fstest_main.c similarity index 99% rename from testing/fstest/fstest_main.c rename to testing/fs/fstest/fstest_main.c index 0579dff36b1..68ea1f71914 100644 --- a/testing/fstest/fstest_main.c +++ b/testing/fs/fstest/fstest_main.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/fstest/fstest_main.c + * apps/testing/fs/fstest/fstest_main.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/mtd_config_fs/CMakeLists.txt b/testing/fs/mtd_config_fs/CMakeLists.txt similarity index 96% rename from testing/mtd_config_fs/CMakeLists.txt rename to testing/fs/mtd_config_fs/CMakeLists.txt index 30056c35f7d..70201dca934 100644 --- a/testing/mtd_config_fs/CMakeLists.txt +++ b/testing/fs/mtd_config_fs/CMakeLists.txt @@ -1,5 +1,5 @@ # ############################################################################## -# apps/testing/mtd_config_fs/CMakeLists.txt +# apps/testing/fs/mtd_config_fs/CMakeLists.txt # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/mtd_config_fs/Kconfig b/testing/fs/mtd_config_fs/Kconfig similarity index 100% rename from testing/mtd_config_fs/Kconfig rename to testing/fs/mtd_config_fs/Kconfig diff --git a/testing/mtd_config_fs/Make.defs b/testing/fs/mtd_config_fs/Make.defs similarity index 91% rename from testing/mtd_config_fs/Make.defs rename to testing/fs/mtd_config_fs/Make.defs index 424b907fd0b..0c8bde14c0f 100644 --- a/testing/mtd_config_fs/Make.defs +++ b/testing/fs/mtd_config_fs/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/mtd_config_fs/Make.defs +# apps/testing/fs/mtd_config_fs/Make.defs # # SPDX-License-Identifier: Apache-2.0 # @@ -21,5 +21,5 @@ ############################################################################ ifneq ($(CONFIG_TESTING_MTD_CONFIG_FAIL_SAFE),) -CONFIGURED_APPS += $(APPDIR)/testing/mtd_config_fs +CONFIGURED_APPS += $(APPDIR)/testing/fs/mtd_config_fs endif diff --git a/testing/mtd_config_fs/Makefile b/testing/fs/mtd_config_fs/Makefile similarity index 97% rename from testing/mtd_config_fs/Makefile rename to testing/fs/mtd_config_fs/Makefile index 601e42f616a..c3ad88386ea 100644 --- a/testing/mtd_config_fs/Makefile +++ b/testing/fs/mtd_config_fs/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/mtd_config_fs/Makefile +# apps/testing/fs/mtd_config_fs/Makefile # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/mtd_config_fs/mtd_config_fs_test_main.c b/testing/fs/mtd_config_fs/mtd_config_fs_test_main.c similarity index 99% rename from testing/mtd_config_fs/mtd_config_fs_test_main.c rename to testing/fs/mtd_config_fs/mtd_config_fs_test_main.c index 5ebc2f99057..5c44a6a1dcb 100644 --- a/testing/mtd_config_fs/mtd_config_fs_test_main.c +++ b/testing/fs/mtd_config_fs/mtd_config_fs_test_main.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/mtd_config_fs/mtd_config_fs_test_main.c + * apps/testing/fs/mtd_config_fs/mtd_config_fs_test_main.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/nxffs/CMakeLists.txt b/testing/fs/nxffs/CMakeLists.txt similarity index 96% rename from testing/nxffs/CMakeLists.txt rename to testing/fs/nxffs/CMakeLists.txt index 493b2c29e7e..337c19e025c 100644 --- a/testing/nxffs/CMakeLists.txt +++ b/testing/fs/nxffs/CMakeLists.txt @@ -1,5 +1,5 @@ # ############################################################################## -# apps/testing/nxffs/CMakeLists.txt +# apps/testing/fs/nxffs/CMakeLists.txt # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/nxffs/Kconfig b/testing/fs/nxffs/Kconfig similarity index 100% rename from testing/nxffs/Kconfig rename to testing/fs/nxffs/Kconfig diff --git a/testing/nxffs/Make.defs b/testing/fs/nxffs/Make.defs similarity index 92% rename from testing/nxffs/Make.defs rename to testing/fs/nxffs/Make.defs index 6fb1fd54e6d..89ae6c92507 100644 --- a/testing/nxffs/Make.defs +++ b/testing/fs/nxffs/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/nxffs/Make.defs +# apps/testing/fs/nxffs/Make.defs # # SPDX-License-Identifier: Apache-2.0 # @@ -21,5 +21,5 @@ ############################################################################ ifneq ($(CONFIG_TESTING_NXFFS),) -CONFIGURED_APPS += $(APPDIR)/testing/nxffs +CONFIGURED_APPS += $(APPDIR)/testing/fs/nxffs endif diff --git a/testing/nxffs/Makefile b/testing/fs/nxffs/Makefile similarity index 97% rename from testing/nxffs/Makefile rename to testing/fs/nxffs/Makefile index c03d5d05dec..14a7cac6f31 100644 --- a/testing/nxffs/Makefile +++ b/testing/fs/nxffs/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/nxffs/Makefile +# apps/testing/fs/nxffs/Makefile # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/nxffs/nxffs_main.c b/testing/fs/nxffs/nxffs_main.c similarity index 99% rename from testing/nxffs/nxffs_main.c rename to testing/fs/nxffs/nxffs_main.c index 46f2fb2a582..25c15513a2e 100644 --- a/testing/nxffs/nxffs_main.c +++ b/testing/fs/nxffs/nxffs_main.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/nxffs/nxffs_main.c + * apps/testing/fs/nxffs/nxffs_main.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/smart/CMakeLists.txt b/testing/fs/smart/CMakeLists.txt similarity index 96% rename from testing/smart/CMakeLists.txt rename to testing/fs/smart/CMakeLists.txt index 091f1fdf39b..fc136b91e8e 100644 --- a/testing/smart/CMakeLists.txt +++ b/testing/fs/smart/CMakeLists.txt @@ -1,5 +1,5 @@ # ############################################################################## -# apps/testing/smart/CMakeLists.txt +# apps/testing/fs/smart/CMakeLists.txt # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/smart/Kconfig b/testing/fs/smart/Kconfig similarity index 100% rename from testing/smart/Kconfig rename to testing/fs/smart/Kconfig diff --git a/testing/smart/Make.defs b/testing/fs/smart/Make.defs similarity index 92% rename from testing/smart/Make.defs rename to testing/fs/smart/Make.defs index 771631a8b91..099ab8f5c29 100644 --- a/testing/smart/Make.defs +++ b/testing/fs/smart/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/smart/Make.defs +# apps/testing/fs/smart/Make.defs # # SPDX-License-Identifier: Apache-2.0 # @@ -21,5 +21,5 @@ ############################################################################ ifneq ($(CONFIG_TESTING_SMART),) -CONFIGURED_APPS += $(APPDIR)/testing/smart +CONFIGURED_APPS += $(APPDIR)/testing/fs/smart endif diff --git a/testing/smart/Makefile b/testing/fs/smart/Makefile similarity index 97% rename from testing/smart/Makefile rename to testing/fs/smart/Makefile index deebbc53589..9618f6a7ac6 100644 --- a/testing/smart/Makefile +++ b/testing/fs/smart/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/smart/Makefile +# apps/testing/fs/smart/Makefile # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/smart/smart_main.c b/testing/fs/smart/smart_main.c similarity index 99% rename from testing/smart/smart_main.c rename to testing/fs/smart/smart_main.c index 03dd897bb0c..671f5b5cbd0 100644 --- a/testing/smart/smart_main.c +++ b/testing/fs/smart/smart_main.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/smart/smart_main.c + * apps/testing/fs/smart/smart_main.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/smart_test/CMakeLists.txt b/testing/fs/smart_test/CMakeLists.txt similarity index 96% rename from testing/smart_test/CMakeLists.txt rename to testing/fs/smart_test/CMakeLists.txt index 057e56282dd..a9a6a72807d 100644 --- a/testing/smart_test/CMakeLists.txt +++ b/testing/fs/smart_test/CMakeLists.txt @@ -1,5 +1,5 @@ # ############################################################################## -# apps/testing/smart_test/CMakeLists.txt +# apps/testing/fs/smart_test/CMakeLists.txt # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/smart_test/Kconfig b/testing/fs/smart_test/Kconfig similarity index 100% rename from testing/smart_test/Kconfig rename to testing/fs/smart_test/Kconfig diff --git a/testing/smart_test/Make.defs b/testing/fs/smart_test/Make.defs similarity index 91% rename from testing/smart_test/Make.defs rename to testing/fs/smart_test/Make.defs index e02270134ff..4b866a3ac0d 100644 --- a/testing/smart_test/Make.defs +++ b/testing/fs/smart_test/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/smart_test/Make.defs +# apps/testing/fs/smart_test/Make.defs # # SPDX-License-Identifier: Apache-2.0 # @@ -21,5 +21,5 @@ ############################################################################ ifneq ($(CONFIG_TESTING_SMART_TEST),) -CONFIGURED_APPS += $(APPDIR)/testing/smart_test +CONFIGURED_APPS += $(APPDIR)/testing/fs/smart_test endif diff --git a/testing/smart_test/Makefile b/testing/fs/smart_test/Makefile similarity index 96% rename from testing/smart_test/Makefile rename to testing/fs/smart_test/Makefile index 835a1751ee1..524c2b41d58 100644 --- a/testing/smart_test/Makefile +++ b/testing/fs/smart_test/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/smart_test/Makefile +# apps/testing/fs/smart_test/Makefile # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/smart_test/smart_test.c b/testing/fs/smart_test/smart_test.c similarity index 99% rename from testing/smart_test/smart_test.c rename to testing/fs/smart_test/smart_test.c index 1650ba7acd1..13bd393c891 100644 --- a/testing/smart_test/smart_test.c +++ b/testing/fs/smart_test/smart_test.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/smart_test/smart_test.c + * apps/testing/fs/smart_test/smart_test.c * * SPDX-License-Identifier: Apache-2.0 * From 57c8a62e1e7a5230f79bc460859940f063b72c25 Mon Sep 17 00:00:00 2001 From: tengshuangshuang Date: Wed, 22 Jan 2025 09:19:43 +0800 Subject: [PATCH 154/391] apps/testing:move arch_libc, fmemopen, scanftest folders to the new lib folder Signed-off-by: tengshuangshuang --- testing/libc/.gitignore | 1 + testing/libc/CMakeLists.txt | 24 ++++++++++++++++++ testing/libc/Make.defs | 23 +++++++++++++++++ testing/libc/Makefile | 25 +++++++++++++++++++ testing/{ => libc}/arch_libc/CMakeLists.txt | 2 +- testing/{ => libc}/arch_libc/Kconfig | 0 testing/{ => libc}/arch_libc/Make.defs | 4 +-- testing/{ => libc}/arch_libc/Makefile | 2 +- .../arch_libc/arch_libc_test_main.c | 2 +- testing/{ => libc}/fmemopen/CMakeLists.txt | 2 +- testing/{ => libc}/fmemopen/Kconfig | 0 testing/{ => libc}/fmemopen/Make.defs | 4 +-- testing/{ => libc}/fmemopen/Makefile | 2 +- testing/{ => libc}/fmemopen/fmemopen.c | 2 +- testing/{ => libc}/scanftest/CMakeLists.txt | 2 +- testing/{ => libc}/scanftest/Kconfig | 0 testing/{ => libc}/scanftest/Make.defs | 4 +-- testing/{ => libc}/scanftest/Makefile | 2 +- testing/{ => libc}/scanftest/scanftest_main.c | 3 ++- 19 files changed, 89 insertions(+), 15 deletions(-) create mode 100644 testing/libc/.gitignore create mode 100644 testing/libc/CMakeLists.txt create mode 100644 testing/libc/Make.defs create mode 100644 testing/libc/Makefile rename testing/{ => libc}/arch_libc/CMakeLists.txt (96%) rename testing/{ => libc}/arch_libc/Kconfig (100%) rename testing/{ => libc}/arch_libc/Make.defs (91%) rename testing/{ => libc}/arch_libc/Makefile (97%) rename testing/{ => libc}/arch_libc/arch_libc_test_main.c (99%) rename testing/{ => libc}/fmemopen/CMakeLists.txt (96%) rename testing/{ => libc}/fmemopen/Kconfig (100%) rename testing/{ => libc}/fmemopen/Make.defs (91%) rename testing/{ => libc}/fmemopen/Makefile (96%) rename testing/{ => libc}/fmemopen/fmemopen.c (99%) rename testing/{ => libc}/scanftest/CMakeLists.txt (96%) rename testing/{ => libc}/scanftest/Kconfig (100%) rename testing/{ => libc}/scanftest/Make.defs (91%) rename testing/{ => libc}/scanftest/Makefile (97%) rename testing/{ => libc}/scanftest/scanftest_main.c (99%) diff --git a/testing/libc/.gitignore b/testing/libc/.gitignore new file mode 100644 index 00000000000..9e1d2593ee8 --- /dev/null +++ b/testing/libc/.gitignore @@ -0,0 +1 @@ +/Kconfig diff --git a/testing/libc/CMakeLists.txt b/testing/libc/CMakeLists.txt new file mode 100644 index 00000000000..fd0631c9b72 --- /dev/null +++ b/testing/libc/CMakeLists.txt @@ -0,0 +1,24 @@ +# ############################################################################## +# apps/testing/libc/CMakeLists.txt +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +nuttx_add_subdirectory() +nuttx_generate_kconfig(MENUDESC "libc") diff --git a/testing/libc/Make.defs b/testing/libc/Make.defs new file mode 100644 index 00000000000..b2f87925816 --- /dev/null +++ b/testing/libc/Make.defs @@ -0,0 +1,23 @@ +############################################################################ +# apps/testing/libc/Make.defs +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +include $(wildcard $(APPDIR)/testing/libc/*/Make.defs) diff --git a/testing/libc/Makefile b/testing/libc/Makefile new file mode 100644 index 00000000000..ffea1e8c3c8 --- /dev/null +++ b/testing/libc/Makefile @@ -0,0 +1,25 @@ +############################################################################ +# apps/testing/libc/Makefile +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +MENUDESC = "libc" + +include $(APPDIR)/Directory.mk diff --git a/testing/arch_libc/CMakeLists.txt b/testing/libc/arch_libc/CMakeLists.txt similarity index 96% rename from testing/arch_libc/CMakeLists.txt rename to testing/libc/arch_libc/CMakeLists.txt index 38224f1752e..89e26e78485 100644 --- a/testing/arch_libc/CMakeLists.txt +++ b/testing/libc/arch_libc/CMakeLists.txt @@ -1,5 +1,5 @@ # ############################################################################## -# apps/testing/arch_libc/CMakeLists.txt +# apps/testing/libc/arch_libc/CMakeLists.txt # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/arch_libc/Kconfig b/testing/libc/arch_libc/Kconfig similarity index 100% rename from testing/arch_libc/Kconfig rename to testing/libc/arch_libc/Kconfig diff --git a/testing/arch_libc/Make.defs b/testing/libc/arch_libc/Make.defs similarity index 91% rename from testing/arch_libc/Make.defs rename to testing/libc/arch_libc/Make.defs index 38c935ec2da..5804fc1300b 100644 --- a/testing/arch_libc/Make.defs +++ b/testing/libc/arch_libc/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/arch_libc/Make.defs +# apps/testing/libc/arch_libc/Make.defs # # SPDX-License-Identifier: Apache-2.0 # @@ -21,5 +21,5 @@ ############################################################################ ifneq ($(CONFIG_TESTING_ARCH_LIBC),) -CONFIGURED_APPS += $(APPDIR)/testing/arch_libc +CONFIGURED_APPS += $(APPDIR)/testing/libc/arch_libc endif diff --git a/testing/arch_libc/Makefile b/testing/libc/arch_libc/Makefile similarity index 97% rename from testing/arch_libc/Makefile rename to testing/libc/arch_libc/Makefile index ecd4f543474..610e10fa9d6 100644 --- a/testing/arch_libc/Makefile +++ b/testing/libc/arch_libc/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/arch_libc/Makefile +# apps/testing/libc/arch_libc/Makefile # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/arch_libc/arch_libc_test_main.c b/testing/libc/arch_libc/arch_libc_test_main.c similarity index 99% rename from testing/arch_libc/arch_libc_test_main.c rename to testing/libc/arch_libc/arch_libc_test_main.c index a053b7a1a9f..47cfe65bccd 100644 --- a/testing/arch_libc/arch_libc_test_main.c +++ b/testing/libc/arch_libc/arch_libc_test_main.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/arch_libc/arch_libc_test_main.c + * apps/testing/libc/arch_libc/arch_libc_test_main.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/fmemopen/CMakeLists.txt b/testing/libc/fmemopen/CMakeLists.txt similarity index 96% rename from testing/fmemopen/CMakeLists.txt rename to testing/libc/fmemopen/CMakeLists.txt index 28f688dc123..b36d1c2409d 100644 --- a/testing/fmemopen/CMakeLists.txt +++ b/testing/libc/fmemopen/CMakeLists.txt @@ -1,5 +1,5 @@ # ############################################################################## -# apps/testing/fmemopen/CMakeLists.txt +# apps/testing/libc/fmemopen/CMakeLists.txt # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/fmemopen/Kconfig b/testing/libc/fmemopen/Kconfig similarity index 100% rename from testing/fmemopen/Kconfig rename to testing/libc/fmemopen/Kconfig diff --git a/testing/fmemopen/Make.defs b/testing/libc/fmemopen/Make.defs similarity index 91% rename from testing/fmemopen/Make.defs rename to testing/libc/fmemopen/Make.defs index 8082235174a..f96bb49c834 100644 --- a/testing/fmemopen/Make.defs +++ b/testing/libc/fmemopen/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/fmemopen/Make.defs +# apps/testing/libc/fmemopen/Make.defs # # SPDX-License-Identifier: Apache-2.0 # @@ -21,5 +21,5 @@ ############################################################################ ifneq ($(CONFIG_TESTING_FMEMOPEN_TEST),) -CONFIGURED_APPS += $(APPDIR)/testing/fmemopen +CONFIGURED_APPS += $(APPDIR)/testing/libc/fmemopen endif diff --git a/testing/fmemopen/Makefile b/testing/libc/fmemopen/Makefile similarity index 96% rename from testing/fmemopen/Makefile rename to testing/libc/fmemopen/Makefile index e62c0c9ad7f..6bcfd61ab1e 100644 --- a/testing/fmemopen/Makefile +++ b/testing/libc/fmemopen/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/fmemopen/Makefile +# apps/testing/libc/fmemopen/Makefile # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/fmemopen/fmemopen.c b/testing/libc/fmemopen/fmemopen.c similarity index 99% rename from testing/fmemopen/fmemopen.c rename to testing/libc/fmemopen/fmemopen.c index 06b396e038b..101914f1958 100644 --- a/testing/fmemopen/fmemopen.c +++ b/testing/libc/fmemopen/fmemopen.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/fmemopen/fmemopen.c + * apps/testing/libc/fmemopen/fmemopen.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/scanftest/CMakeLists.txt b/testing/libc/scanftest/CMakeLists.txt similarity index 96% rename from testing/scanftest/CMakeLists.txt rename to testing/libc/scanftest/CMakeLists.txt index dc6827bd06b..a85e490115a 100644 --- a/testing/scanftest/CMakeLists.txt +++ b/testing/libc/scanftest/CMakeLists.txt @@ -1,5 +1,5 @@ # ############################################################################## -# apps/testing/scanftest/CMakeLists.txt +# apps/testing/libc/scanftest/CMakeLists.txt # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/scanftest/Kconfig b/testing/libc/scanftest/Kconfig similarity index 100% rename from testing/scanftest/Kconfig rename to testing/libc/scanftest/Kconfig diff --git a/testing/scanftest/Make.defs b/testing/libc/scanftest/Make.defs similarity index 91% rename from testing/scanftest/Make.defs rename to testing/libc/scanftest/Make.defs index ebeffd59060..bac5c96f501 100644 --- a/testing/scanftest/Make.defs +++ b/testing/libc/scanftest/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/scanftest/Make.defs +# apps/testing/libc/scanftest/Make.defs # # SPDX-License-Identifier: Apache-2.0 # @@ -21,5 +21,5 @@ ############################################################################ ifneq ($(CONFIG_TESTING_SCANFTEST),) -CONFIGURED_APPS += $(APPDIR)/testing/scanftest +CONFIGURED_APPS += $(APPDIR)/testing/libc/scanftest endif diff --git a/testing/scanftest/Makefile b/testing/libc/scanftest/Makefile similarity index 97% rename from testing/scanftest/Makefile rename to testing/libc/scanftest/Makefile index 155b32ae437..6052ffed631 100644 --- a/testing/scanftest/Makefile +++ b/testing/libc/scanftest/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/scanftest/Makefile +# apps/testing/libc/scanftest/Makefile # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/scanftest/scanftest_main.c b/testing/libc/scanftest/scanftest_main.c similarity index 99% rename from testing/scanftest/scanftest_main.c rename to testing/libc/scanftest/scanftest_main.c index 2ec1f420fdb..6334c3074aa 100644 --- a/testing/scanftest/scanftest_main.c +++ b/testing/libc/scanftest/scanftest_main.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/scanftest/scanftest_main.c + * apps/testing/libc/scanftest/scanftest_main.c * * SPDX-License-Identifier: BSD-3-Clause * SPDX-FileCopyrightText: 2005-01-26, Greg King (https://github.com/cc65) @@ -55,6 +55,7 @@ * * Modified: Johannes Schock */ + /**************************************************************************** * Included Files ****************************************************************************/ From dfb3fc9acf54943216ab0be0658f1179108b132b Mon Sep 17 00:00:00 2001 From: chao an Date: Wed, 22 Jan 2025 22:37:08 +0800 Subject: [PATCH 155/391] system/cu: remove canonical input mode from termios flag ASCII_DEL will unable to handle after below change: https://github.com/apache/nuttx/pull/14037 | commit df5c876932c4c82e8aee32adca651bb99d9d6200 | Author: zhangwenjian | Date: Thu May 23 13:13:48 2024 +0800 | | libc:getline support backspace | | Signed-off-by: zhangwenjian remove canonical input mode to support backspace in cu Signed-off-by: chao an --- system/cu/cu_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/cu/cu_main.c b/system/cu/cu_main.c index 2b8fabda181..a3a0f2d61e5 100644 --- a/system/cu/cu_main.c +++ b/system/cu/cu_main.c @@ -194,7 +194,7 @@ static int set_termios(FAR struct cu_globals_s *cu, int nocrlf) tio.c_iflag = 0; tio.c_oflag = 0; - tio.c_lflag &= ~ECHO; + tio.c_lflag &= ~(ECHO | ICANON); ret = tcsetattr(cu->stdfd, TCSANOW, &tio); if (ret) From 2ad162d27dc52453b78e160feeefc051eb2b22de Mon Sep 17 00:00:00 2001 From: chao an Date: Wed, 22 Jan 2025 22:46:36 +0800 Subject: [PATCH 156/391] system/cu: fix nxstyle error $ ../nuttx/tools/checkpatch.sh -g HEAD~1 apps/system/cu/cu_main.c:5:78: error: Long line found Signed-off-by: chao an --- system/cu/cu_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/system/cu/cu_main.c b/system/cu/cu_main.c index a3a0f2d61e5..20cd101b51b 100644 --- a/system/cu/cu_main.c +++ b/system/cu/cu_main.c @@ -2,7 +2,8 @@ * apps/system/cu/cu_main.c * * SPDX-License-Identifier: BSD-3-Clause - * SPDX-FileCopyrightText: 2014 sysmocom - s.f.m.c. GmbH. All rights reserved. + * SPDX-FileCopyrightText: + * 2014 sysmocom - s.f.m.c. GmbH. All rights reserved. * SPDX-FileContributor: Harald Welte * * Redistribution and use in source and binary forms, with or without From fb367c9792388a8bf3257115bd9b7f7c6bb83f23 Mon Sep 17 00:00:00 2001 From: xuxin19 Date: Tue, 26 Nov 2024 17:21:29 +0800 Subject: [PATCH 157/391] cmake(enhance):Enhanced full WASM library and application compilation 1.add complete compilation FLAGS for wasm toolchain 2.wasm build no longer traverses the native directory, saving build time 3.implement OPT and AOT process actions for wasm files 4.create a bridge interface for navtie build and wasm build Signed-off-by: xuxin19 --- CMakeLists.txt | 3 +- cmake/nuttx_wasm_interface.cmake | 58 +++++++ tools/CMakeLists.txt | 24 ++- tools/Wasm/CMakeLists.txt | 57 +++---- tools/Wasm/WASI-SDK.cmake | 269 ++++++++++++++++++++++++++++++- 5 files changed, 364 insertions(+), 47 deletions(-) create mode 100644 cmake/nuttx_wasm_interface.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 225c354d16c..8641d690b2b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,6 +34,7 @@ if(CONFIG_APPS_DIR) include(nuttx_add_luamod) include(nuttx_add_wamrmod) include(nuttx_add_rust) + include(nuttx_wasm_interface) nuttx_add_library(apps) if(NOT EXISTS {NUTTX_APPS_BINDIR}/dummy.c) file(TOUCH ${NUTTX_APPS_BINDIR}/dummy.c) @@ -66,7 +67,6 @@ add_subdirectory(platform) add_subdirectory(sdr) add_subdirectory(system) add_subdirectory(testing) -add_subdirectory(tools) add_subdirectory(videoutils) add_subdirectory(wireless) @@ -76,6 +76,7 @@ if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/external) add_subdirectory(external) endif() +add_subdirectory(tools) # after traversing all subdirectories add_subdirectory(builtin) # must be last nuttx_generate_kconfig() diff --git a/cmake/nuttx_wasm_interface.cmake b/cmake/nuttx_wasm_interface.cmake new file mode 100644 index 00000000000..4e746f7641f --- /dev/null +++ b/cmake/nuttx_wasm_interface.cmake @@ -0,0 +1,58 @@ +# ############################################################################## +# cmake/nuttx_wasm_interface.cmake +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +# This is NuttX native wrapper for the WAMR interface. + +if(NOT TARGET wasm_interface) + add_custom_target(wasm_interface) +endif() + +# declare WAMS build directory and add INSTALL path +function(wasm_add_application) + + cmake_parse_arguments( + APP "" "NAME;STACK_SIZE;INITIAL_MEMORY_SIZE;WAMR_MODE;INSTALL_NAME" + "SRCS;WLDFLAGS;WCFLAGS;WINCLUDES" ${ARGN}) + + set_property( + TARGET wasm_interface + APPEND + PROPERTY WASM_DIR ${CMAKE_CURRENT_LIST_DIR}) + + if(APP_INSTALL_NAME) + add_custom_command( + OUTPUT ${CMAKE_BINARY_DIR}/wasm/${APP_INSTALL_NAME} + COMMAND ${CMAKE_COMMAND} -E touch_nocreate + ${CMAKE_BINARY_DIR}/wasm/${APP_INSTALL_NAME} + DEPENDS apps) + add_custom_target(wasm_gen_${APP_NAME} + DEPENDS ${CMAKE_BINARY_DIR}/wasm/${APP_INSTALL_NAME}) + add_dynamic_rcraws(RAWS ${CMAKE_BINARY_DIR}/wasm/${APP_INSTALL_NAME} + DEPENDS wasm_gen_${APP_NAME}) + endif() + +endfunction() + +function(wasm_add_library) + set_property( + TARGET wasm_interface + APPEND + PROPERTY WASM_DIR ${CMAKE_CURRENT_LIST_DIR}) +endfunction() diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 48204653a41..d53a8192950 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -20,17 +20,7 @@ # # ############################################################################## -# Fake wasm_add_application function to suppress error from native build process -function(wasm_add_application) - -endfunction() - -# Fake wasm_add_library function to suppress error from native build process -function(wasm_add_library) - -endfunction() - -if(CONFIG_TOOLS_WASM_BUILD) +if(CONFIG_TOOLS_WASM_BUILD OR CONFIG_INTERPRETERS_WAMR_BUILD_MODULES_FOR_NUTTX) include(ExternalProject) @@ -45,14 +35,22 @@ if(CONFIG_TOOLS_WASM_BUILD) # Get parent dir of CMAKE_CURRENT_SOURCE_DIR get_filename_component(APPDIR ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY) + # Get the Wasm build dirs from the wasm_interface target + get_property( + WASM_DIRS + TARGET wasm_interface + PROPERTY WASM_DIR) + + # ensure the Wasm build dirs are unique + list(REMOVE_DUPLICATES WASM_DIRS) # Configure and build the Wasm based application add_custom_target( configure_wasm_build COMMAND ${CMAKE_COMMAND} -B${CMAKE_BINARY_DIR}/Wasm ${CMAKE_CURRENT_SOURCE_DIR}/Wasm -DAPPDIR=${APPDIR} -DTOPDIR=${TOPDIR} - -DKCONFIG_FILE_PATH=${KCONFIG_FILE_PATH} - -DWASI_SDK_PATH=$ENV{WASI_SDK_PATH}) + -DTOPBINDIR=${CMAKE_BINARY_DIR} -DKCONFIG_FILE_PATH=${KCONFIG_FILE_PATH} + -DWASI_SDK_PATH=$ENV{WASI_SDK_PATH} -DWASM_DIRS=${WASM_DIRS}) add_custom_target(wasm_build COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR}/Wasm) diff --git a/tools/Wasm/CMakeLists.txt b/tools/Wasm/CMakeLists.txt index ca7fe114c75..29c66a7245a 100644 --- a/tools/Wasm/CMakeLists.txt +++ b/tools/Wasm/CMakeLists.txt @@ -32,10 +32,24 @@ cmake_minimum_required(VERSION 3.5) +cmake_policy(SET CMP0079 NEW) + +# Include the NuttX kconfig parser to shared the configuration between the NuttX +# build and the Wasm build. And then parse the input KCONFIG_FILE_PATH to get +# the configuration. +include(${TOPDIR}/cmake/nuttx_kconfig.cmake) + +# Parse the input KCONFIG_FILE_PATH to get the configuration. +nuttx_export_kconfig(${KCONFIG_FILE_PATH}) + +# Include the WASI-SDK.cmake file to setup the necessary flags for building include(WASI-SDK.cmake) project(WasmApps) +# Add the wasm_interface library to hold all the Wasm libraries. +add_library(wasm_interface INTERFACE) + # Check whether the APPDIR is defined or not. If not, then set it to the parent # directory of the current CMakeLists.txt file. if(NOT DEFINED APPDIR) @@ -47,18 +61,21 @@ if(NOT DEFINED TOPDIR) message(FATAL_ERROR "TOPDIR is not defined") endif() +# Check wether the TOPBINDIR is defined or not. If not, then raise an error. +if(NOT DEFINED TOPBINDIR) + message(FATAL_ERROR "TOPBINDIR is not defined") +endif() + +if(NOT EXISTS ${TOPBINDIR}/wasm) + file(MAKE_DIRECTORY ${TOPBINDIR}/wasm) +endif() + # Check wether the KCONFIG_FILE_PATH is defined or not. If not, then raise an # error. if(NOT DEFINED KCONFIG_FILE_PATH) message(FATAL_ERROR "KCONFIG_FILE_PATH is not defined") endif() -# Include the NuttX kconfig parser to shared the configuration between the NuttX -# build and the Wasm build. And then parse the input KCONFIG_FILE_PATH to get -# the configuration. -include(${TOPDIR}/cmake/nuttx_kconfig.cmake) -nuttx_export_kconfig(${KCONFIG_FILE_PATH}) - # Provide FAR macro from command line since it is not supported in wasi-sdk, but # it is used in NuttX code. # ~~~ @@ -78,25 +95,11 @@ function(nuttx_add_library) endfunction() -# Recursively find all the CMakeLists.txt files in the ${APPDIR} and add it by -# add_subdirectory, but exclude the CMakeLists.txt file in the ${APPDIR}/tools -# directory. -file(GLOB_RECURSE WASM_APPS ${APPDIR}/*/CMakeLists.txt) -list(FILTER WASM_APPS EXCLUDE REGEX ".*/tools/.*") - -# Read and check if wasm_add_application is called in the CMakeLists.txt file in -# WASM_APPS If true, then add the directory to the build process -foreach(WASM_APP ${WASM_APPS}) - file(READ ${WASM_APP} WASM_APP_CONTENTS) - string(FIND "${WASM_APP_CONTENTS}" "wasm_add_application" WASM_APP_FOUND) - string(FIND "${WASM_APP_CONTENTS}" "wasm_add_library" WASM_LIB_FOUND) - if(WASM_APP_FOUND GREATER -1 OR WASM_LIB_FOUND GREATER -1) - get_filename_component(WASM_APP_DIR ${WASM_APP} DIRECTORY) - # Add subdirectory to the build process and put the build directory in the - # current build directory with the name same as the relative path of the - # ${APPDIR} - string(REPLACE ${APPDIR} "" WASM_APP_BUILD_DIR ${WASM_APP_DIR}) - add_subdirectory(${WASM_APP_DIR} - ${CMAKE_CURRENT_BINARY_DIR}/Wasm/${WASM_APP_BUILD_DIR}) - endif() +# ~~~ +# Add all the Wasm apps to the build process. +foreach(WASM_APP ${WASM_DIRS}) + string(REPLACE ${APPDIR} "" WASM_APP_BUILD_DIR ${WASM_APP}) + add_subdirectory(${WASM_APP} + ${CMAKE_CURRENT_BINARY_DIR}/Wasm/${WASM_APP_BUILD_DIR}) endforeach() +# ~~~ diff --git a/tools/Wasm/WASI-SDK.cmake b/tools/Wasm/WASI-SDK.cmake index 5f5309e3fa8..ca340d06e6d 100644 --- a/tools/Wasm/WASI-SDK.cmake +++ b/tools/Wasm/WASI-SDK.cmake @@ -46,6 +46,43 @@ set(CMAKE_SYSTEM_PROCESSOR wasm32) set(CMAKE_C_COMPILER ${WASI_SDK_PATH}/bin/clang) set(CMAKE_CXX_COMPILER ${WASI_SDK_PATH}/bin/clang++) +# setup the flags for the compiler and linker + +include_directories(${TOPDIR}/include ${TOPBINDIR}/include) + +if(CONFIG_DEBUG_FULLOPT) + add_compile_options(-Oz) +elseif(CONFIG_DEBUG_CUSTOMOPT) + add_compile_options(${CONFIG_DEBUG_OPTLEVEL}) +endif() + +if(CONFIG_LTO_FULL OR CONFIG_LTO_THIN) + add_compile_options(-flto) + add_link_options(-flto) +endif() + +add_compile_options(--sysroot=${TOPDIR}) +add_compile_options(-nostdlib) +add_compile_options(-D__NuttX__) + +if(NOT CONFIG_LIBM) + add_compile_options(-DCONFIG_LIBM=1) + include_directories(${APPDIR}/include/wasm) +endif() + +add_link_options(-Wl,--export=main) +add_link_options(-Wl,--export=__main_argc_argv) +add_link_options(-Wl,--export=__heap_base) +add_link_options(-Wl,--export=__data_end) +add_link_options(-Wl,--no-entry) +add_link_options(-Wl,--strip-all) +add_link_options(-Wl,--allow-undefined) + +execute_process( + COMMAND ${CMAKE_C_COMPILER} --print-libgcc-file-name + OUTPUT_STRIP_TRAILING_WHITESPACE + OUTPUT_VARIABLE WCC_COMPILER_RT_LIB) + # ~~~ # Function "wasm_add_application" to add a WebAssembly application to the # build system. @@ -71,11 +108,17 @@ function(wasm_add_application) # Parse the APP_NAME and APP_SRCS from the arguments set(APP_NAME "") set(APP_SRCS "") - set(APP_STACK_SIZE 2048) - set(APP_INITIAL_MEMORY_SIZE 65536) + set(APP_STACK_SIZE "") + set(APP_INITIAL_MEMORY_SIZE "") + set(APP_INSTALL_NAME "") + set(APP_WAMR_MODE INT) + set(APP_WCFLAGS "") + set(APP_WLDFLAGS "") + set(APP_WINCLUDES "") - cmake_parse_arguments(APP "" "NAME;STACK_SIZE;INITIAL_MEMORY_SIZE" "SRCS" - ${ARGN}) + cmake_parse_arguments( + APP "" "NAME;STACK_SIZE;INITIAL_MEMORY_SIZE;WAMR_MODE;INSTALL_NAME" + "SRCS;WLDFLAGS;WCFLAGS;WINCLUDES" ${ARGN}) # Check if the APP_NAME (NAME) is provided if(NOT APP_NAME) @@ -87,12 +130,219 @@ function(wasm_add_application) message(FATAL_ERROR "SRCS is not provided.") endif() + if(NOT APP_STACK_SIZE) + set(APP_STACK_SIZE 2048) + endif() + + if(NOT APP_INITIAL_MEMORY_SIZE) + set(APP_INITIAL_MEMORY_SIZE 65536) + endif() + # Create the executable target for the application add_executable(${APP_NAME} ${APP_SRCS}) + target_link_libraries(${APP_NAME} PRIVATE wasm_interface) + target_include_directories(${APP_NAME} PRIVATE ${APP_WINCLUDES}) + target_compile_options(${APP_NAME} PRIVATE ${APP_WCFLAGS}) + target_link_options(${APP_NAME} PRIVATE -z stack-size=${APP_STACK_SIZE}) + target_link_options(${APP_NAME} PRIVATE + -Wl,--initial-memory=${APP_INITIAL_MEMORY_SIZE}) + target_link_options(${APP_NAME} PRIVATE ${APP_WLD_FLAGS}) + + target_link_libraries(${APP_NAME} PRIVATE ${WCC_COMPILER_RT_LIB}) # Set the target properties set_target_properties(${APP_NAME} PROPERTIES OUTPUT_NAME ${APP_NAME}.wasm) + # do WASM OPTIMIZATION + add_custom_target( + ${APP_NAME}_OPT ALL + COMMAND ${WASI_SDK_PATH}/wasm-opt -Oz --enable-bulk-memory -o + ${APP_NAME}.wasm ${APP_NAME}.wasm + DEPENDS ${APP_NAME} + COMMENT "WASM build:Optimizing ${APP_NAME}") + + # armv7a + if(CONFIG_ARCH_ARMV7A) + if(CONFIG_ARCH_CORTEXA5) + set(LLVM_CPUTYPE cortex-a5) + elseif(CONFIG_ARCH_CORTEXA7) + set(LLVM_CPUTYPE cortex-a7) + elseif(CONFIG_ARCH_CORTEXA8) + set(LLVM_CPUTYPE cortex-a8) + elseif(CONFIG_ARCH_CORTEXA9) + set(LLVM_CPUTYPE cortex-a9) + endif() + if(CONFIG_ARM_THUMB) + set(LLVM_ARCHTYPE thumbv7) + else() + set(LLVM_ARCHTYPE armv7a) + endif() + if(CONFIG_ARCH_FPU) + set(LLVM_ABITYPE eabihf) + else() + set(LLVM_ABITYPE eabi) + endif() + endif() + + # armv7m + if(CONFIG_ARCH_ARMV7M) + if(CONFIG_ARCH_CORTEXM4) + set(LLVM_CPUTYPE cortex-m4) + elseif(CONFIG_ARCH_CORTEXM7) + set(LLVM_CPUTYPE cortex-m7) + else() + set(LLVM_CPUTYPE cortex-m3) + endif() + if(CONFIG_ARCH_CORTEXM3) + set(LLVM_ARCHTYPE thumbv7m) + else() + set(LLVM_ARCHTYPE thumbv7em) + endif() + if(CONFIG_ARCH_FPU) + set(LLVM_ABITYPE eabihf) + else() + set(LLVM_ABITYPE eabi) + endif() + endif() + + # armv8m + if(CONFIG_ARCH_ARMV8M) + if(CONFIG_ARM_DS) + set(EXTCPUFLAGS +dsp) + endif() + if(CONFIG_ARM_PACBTI) + set(EXTCPUFLAGS ${EXTCPUFLAGS}+pacbti) + endif() + if(CONFIG_ARM_HAVE_MVE) + set(EXTCPUFLAGS ${EXTCPUFLAGS}+mve.fp+fp.dp) + endif() + if(CONFIG_ARCH_CORTEXM23) + set(LLVM_CPUTYPE cortex-m23) + elseif(CONFIG_ARCH_CORTEXM33) + set(LLVM_CPUTYPE cortex-m33) + elseif(CONFIG_ARCH_CORTEXM35P) + set(LLVM_CPUTYPE cortex-m35p) + elseif(CONFIG_ARCH_CORTEXM55) + set(LLVM_CPUTYPE cortex-m55) + elseif(CONFIG_ARCH_CORTEXM85) + set(LLVM_CPUTYPE cortex-m85) + endif() + set(LLVM_ARCHTYPE thumbv8m.main${EXTCPUFLAGS}) + if(CONFIG_ARCH_FPU) + set(LLVM_ABITYPE eabihf) + else() + set(LLVM_ABITYPE eabi) + endif() + endif() + + # armv7r + if(CONFIG_ARCH_ARMV7R) + if(CONFIG_ARCH_CORTEXR4) + set(LLVM_CPUTYPE cortex-r4) + elseif(CONFIG_ARCH_CORTEXR5) + set(LLVM_CPUTYPE cortex-r5) + elseif(CONFIG_ARCH_CORTEXR7) + set(LLVM_CPUTYPE cortex-r7) + endif() + + if(CONFIG_ARM_THUMB) + set(LLVM_ARCHTYPE thumbv7r) + else() + set(LLVM_ARCHTYPE armv7r) + endif() + if(CONFIG_ARCH_FPU) + set(LLVM_ABITYPE eabihf) + else() + set(LLVM_ABITYPE eabi) + endif() + endif() + + # armv6m + if(CONFIG_ARCH_ARMV6M) + set(LLVM_CPUTYPE cortex-m0) + set(LLVM_ARCHTYPE thumbv6m) + set(LLVM_ABITYPE eabi) + endif() + + set(RCFLAGS) + set(WRC wamrc) + + if(CONFIG_ARCH_XTENSA) + set(WTARGET "xtensa") + elseif(CONFIG_ARCH_X86_64) + set(WTARGET "x86_64") + elseif(CONFIG_ARCH_X86) + set(WTARGET "i386") + elseif(CONFIG_ARCH_MIPS) + set(WTARGET "mips") + elseif(CONFIG_ARCH_SIM) + list(APPEND RCFLAGS --disable-simd) + if(CONFIG_SIM_M32) + set(WTARGET "i386") + else() + set(WTARGET "x86_64") + endif() + elseif(LLVM_ARCHTYPE MATCHES "thumb") + string(FIND "${LLVM_ARCHTYPE}" "+" PLUS_INDEX) + if(PLUS_INDEX EQUAL -1) + set(WTARGET "${LLVM_ARCHTYPE}") + else() + string(SUBSTRING "${LLVM_ARCHTYPE}" 0 ${PLUS_INDEX} WTARGET) + endif() + else() + set(WTARGET ${LLVM_ARCHTYPE}) + endif() + + set(WCPU ${LLVM_CPUTYPE}) + + if("${LLVM_ABITYPE}" STREQUAL "eabihf") + set(WABITYPE "gnueabihf") + else() + set(WABITYPE "${LLVM_ABITYPE}") + endif() + + list(APPEND RCFLAGS --target=${WTARGET}) + list(APPEND RCFLAGS --cpu=${WCPU}) + list(APPEND RCFLAGS --target-abi=${WABITYPE}) + + if(CONFIG_INTERPRETERS_WAMR_AOT) + if("${APP_WAMR_MODE}" STREQUAL "AOT") + # generate AoT + add_custom_target( + ${APP_NAME}_AOT ALL + COMMAND ${WRC} ${RCFLAGS} -o ${APP_NAME}.aot ${APP_NAME}.wasm + DEPENDS ${APP_NAME}_OPT + COMMENT "Wamrc Generate AoT: ${APP_NAME}.aot") + set(APP_INSTALL_BIN ${APP_NAME}.aot) + if(NOT APP_INSTALL_NAME) + set(APP_INSTALL_NAME ${APP_NAME}.aot) + endif() + elseif("${APP_WAMR_MODE}" STREQUAL "XIP") + # generate XIP + add_custom_target( + ${APP_NAME}_AOT ALL + COMMAND ${WRC} ${RCFLAGS} --enable-indirect-mode + --disable-llvm-intrinsics -o ${APP_NAME}.xip ${APP_NAME}.wasm + DEPENDS ${APP_NAME}_OPT + COMMENT "Wamrc Generate XIP: ${APP_NAME}.xip") + set(APP_INSTALL_BIN ${APP_NAME}.xip) + if(NOT APP_INSTALL_NAME) + set(APP_INSTALL_NAME ${APP_NAME}.xip) + endif() + endif() + else() + set(APP_INSTALL_BIN ${APP_NAME}.wasm) + if(NOT APP_INSTALL_NAME) + set(APP_INSTALL_NAME ${APP_NAME}.wasm) + endif() + endif() + # install WASM BIN + add_custom_target( + ${APP_NAME}_INSTALL ALL + COMMAND ${CMAKE_COMMAND} -E copy ${APP_INSTALL_BIN} + ${TOPBINDIR}/wasm/${APP_INSTALL_NAME} + DEPENDS ${APP_NAME}_OPT + COMMENT "Install WASM BIN: ${APP_INSTALL_NAME}") endfunction() # ~~~ @@ -115,8 +365,10 @@ function(wasm_add_library) # Parse the LIB_NAME and LIB_SRCS from the arguments set(LIB_NAME "") set(LIB_SRCS "") + set(APP_WCFLAGS "") + set(APP_WINCLUDES "") - cmake_parse_arguments(LIB "" "NAME" "SRCS" ${ARGN}) + cmake_parse_arguments(LIB "" "NAME" "SRCS;WCFLAGS;WINCLUDES" ${ARGN}) # Check if the LIB_NAME (NAME) is provided if(NOT LIB_NAME) @@ -131,7 +383,12 @@ function(wasm_add_library) # Create the static library target for the library add_library(${LIB_NAME} STATIC ${LIB_SRCS}) + target_include_directories(${LIB_NAME} PRIVATE ${LIB_WINCLUDES}) + target_compile_options(${LIB_NAME} PRIVATE ${LIB_WCFLAGS}) + + add_dependencies(wasm_interface ${LIB_NAME}) + target_link_libraries(wasm_interface INTERFACE ${LIB_NAME}) # Set the target properties - set_target_properties(${LIB_NAME} PROPERTIES OUTPUT_NAME lib${LIB_NAME}.a) + set_target_properties(${LIB_NAME} PROPERTIES OUTPUT_NAME ${LIB_NAME}) endfunction() From aa7c63bfe1598d476b0fde08e5960e7c28dd1590 Mon Sep 17 00:00:00 2001 From: xuxin19 Date: Tue, 10 Dec 2024 19:45:02 +0800 Subject: [PATCH 158/391] cmake(bugfix):fix WASM install bin do not define error Signed-off-by: xuxin19 --- tools/Wasm/WASI-SDK.cmake | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/Wasm/WASI-SDK.cmake b/tools/Wasm/WASI-SDK.cmake index ca340d06e6d..9230d844c29 100644 --- a/tools/Wasm/WASI-SDK.cmake +++ b/tools/Wasm/WASI-SDK.cmake @@ -330,11 +330,13 @@ function(wasm_add_application) set(APP_INSTALL_NAME ${APP_NAME}.xip) endif() endif() - else() + endif() + + if(NOT APP_INSTALL_BIN) set(APP_INSTALL_BIN ${APP_NAME}.wasm) - if(NOT APP_INSTALL_NAME) - set(APP_INSTALL_NAME ${APP_NAME}.wasm) - endif() + endif() + if(NOT APP_INSTALL_NAME) + set(APP_INSTALL_NAME ${APP_NAME}.wasm) endif() # install WASM BIN add_custom_target( From 0b0a220c52a7f059b87466919474c3a6ee4b60b4 Mon Sep 17 00:00:00 2001 From: xuxin19 Date: Wed, 11 Dec 2024 18:17:45 +0800 Subject: [PATCH 159/391] cmake(bugfix):fix wasm bin link entry missing issue Signed-off-by: xuxin19 --- tools/Wasm/WASI-SDK.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/Wasm/WASI-SDK.cmake b/tools/Wasm/WASI-SDK.cmake index 9230d844c29..34ffd4ff753 100644 --- a/tools/Wasm/WASI-SDK.cmake +++ b/tools/Wasm/WASI-SDK.cmake @@ -63,6 +63,7 @@ endif() add_compile_options(--sysroot=${TOPDIR}) add_compile_options(-nostdlib) +add_link_options(-nostdlib) add_compile_options(-D__NuttX__) if(NOT CONFIG_LIBM) @@ -147,7 +148,7 @@ function(wasm_add_application) target_link_options(${APP_NAME} PRIVATE -z stack-size=${APP_STACK_SIZE}) target_link_options(${APP_NAME} PRIVATE -Wl,--initial-memory=${APP_INITIAL_MEMORY_SIZE}) - target_link_options(${APP_NAME} PRIVATE ${APP_WLD_FLAGS}) + target_link_options(${APP_NAME} PRIVATE ${APP_WLDFLAGS}) target_link_libraries(${APP_NAME} PRIVATE ${WCC_COMPILER_RT_LIB}) # Set the target properties From add50b3bd5dcdf35987041f6c6b1d459c3cbad0b Mon Sep 17 00:00:00 2001 From: xuxin19 Date: Wed, 18 Dec 2024 11:39:38 +0800 Subject: [PATCH 160/391] cmake(bugfix):fix NuttX CMake Wasm build multi dirs cannot be identified System is unknown to cmake, create: Platform/WASI to use this system, please post your config file on discourse.cmake.org so it can be added to cmake Your CMakeCache.txt file was copied to CopyOfCMakeCache.txt. Please post that file on discourse.cmake.org. CMake Error at CMakeLists.txt:100 (add_subdirectory): add_subdirectory given source /home/data/vela/tmp/apps/frameworks/security/ta/hello_world /home/data/vela/tmp/apps/frameworks/security/ta/" which is not an existing directory. Signed-off-by: xuxin19 --- tools/CMakeLists.txt | 2 +- tools/Wasm/CMakeLists.txt | 2 ++ tools/Wasm/WASI-SDK.cmake | 7 +++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index d53a8192950..640b597e11b 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -50,7 +50,7 @@ if(CONFIG_TOOLS_WASM_BUILD OR CONFIG_INTERPRETERS_WAMR_BUILD_MODULES_FOR_NUTTX) ${CMAKE_COMMAND} -B${CMAKE_BINARY_DIR}/Wasm ${CMAKE_CURRENT_SOURCE_DIR}/Wasm -DAPPDIR=${APPDIR} -DTOPDIR=${TOPDIR} -DTOPBINDIR=${CMAKE_BINARY_DIR} -DKCONFIG_FILE_PATH=${KCONFIG_FILE_PATH} - -DWASI_SDK_PATH=$ENV{WASI_SDK_PATH} -DWASM_DIRS=${WASM_DIRS}) + -DWASI_SDK_PATH=$ENV{WASI_SDK_PATH} -DWASM_DIRS="${WASM_DIRS}") add_custom_target(wasm_build COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR}/Wasm) diff --git a/tools/Wasm/CMakeLists.txt b/tools/Wasm/CMakeLists.txt index 29c66a7245a..9272c20c5e9 100644 --- a/tools/Wasm/CMakeLists.txt +++ b/tools/Wasm/CMakeLists.txt @@ -95,6 +95,8 @@ function(nuttx_add_library) endfunction() +separate_arguments(WASM_DIRS) + # ~~~ # Add all the Wasm apps to the build process. foreach(WASM_APP ${WASM_DIRS}) diff --git a/tools/Wasm/WASI-SDK.cmake b/tools/Wasm/WASI-SDK.cmake index 34ffd4ff753..4785e0ec0e5 100644 --- a/tools/Wasm/WASI-SDK.cmake +++ b/tools/Wasm/WASI-SDK.cmake @@ -378,6 +378,13 @@ function(wasm_add_library) message(FATAL_ERROR "NAME is not provided.") endif() + # Check if the LIB_NAME (NAME) is already declared If it is, then skip the + # rest of the function + if(TARGET ${LIB_NAME}) + message(STATUS "Target ${LIB_NAME} already declared.") + return() + endif() + # Check if the LIB_SRCS (SRCS) is provided if(NOT LIB_SRCS) message(FATAL_ERROR "SRCS is not provided.") From acc2b390c3dbceed2e247b3733534b2e38b58f7a Mon Sep 17 00:00:00 2001 From: Matteo Golin Date: Wed, 22 Jan 2025 19:44:05 -0500 Subject: [PATCH 161/391] examples/gps: Allow GPS serial port to be specified as command line argument, mark MINMEA dependency in Kconfig. --- .gitignore | 1 + examples/gps/Kconfig | 2 +- examples/gps/gps_main.c | 13 +++++++++++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index d183a413f57..5bf6033a628 100644 --- a/.gitignore +++ b/.gitignore @@ -47,3 +47,4 @@ build .ccls-cache compile_commands.json .aider* +.clang-format diff --git a/examples/gps/Kconfig b/examples/gps/Kconfig index c69d0549ce2..0d3ac394391 100644 --- a/examples/gps/Kconfig +++ b/examples/gps/Kconfig @@ -6,7 +6,7 @@ config EXAMPLES_GPS tristate "GPS example" default n - select GPSUTILS_MINMEA_LIB + depends on GNSSUTILS_MINMEA_LIB ---help--- Enable the gps test example diff --git a/examples/gps/gps_main.c b/examples/gps/gps_main.c index a79cd65c2da..596efb5bd9b 100644 --- a/examples/gps/gps_main.c +++ b/examples/gps/gps_main.c @@ -54,13 +54,22 @@ int main(int argc, FAR char *argv[]) int cnt; char ch; char line[MINMEA_MAX_LENGTH]; + char *port = "/dev/ttyS1"; + + /* Get the GPS serial port argument. If none specified, default to ttyS1 */ + + if (argc > 1) + { + port = argv[1]; + } /* Open the GPS serial port */ - fd = open("/dev/ttyS1", O_RDONLY); + fd = open(port, O_RDONLY); if (fd < 0) { - printf("Unable to open file /dev/ttyS1\n"); + fprintf(stderr, "Unable to open file %s\n", port); + return 1; } /* Run forever */ From 077c3461db38ab666fc4f012701b9e164ca9d50c Mon Sep 17 00:00:00 2001 From: tengshuangshuang Date: Wed, 22 Jan 2025 09:29:45 +0800 Subject: [PATCH 162/391] apps/testing:merge case folder to the new mm folder 1.rename original mm folder to heaptest and move it to mm folder 2.move the following folders into the new mm folder: cachetest, heaptest, iob, kasantest, memstress, memtester, ramtest, stressapptest Signed-off-by: tengshuangshuang --- testing/mm/.gitignore | 1 + testing/mm/CMakeLists.txt | 17 +-------- testing/mm/Make.defs | 4 +- testing/mm/Makefile | 15 +------- testing/{ => mm}/cachetest/CMakeLists.txt | 2 +- testing/{ => mm}/cachetest/Kconfig | 0 testing/{ => mm}/cachetest/Make.defs | 4 +- testing/{ => mm}/cachetest/Makefile | 2 +- testing/{ => mm}/cachetest/cachetest_main.c | 2 +- testing/mm/heaptest/CMakeLists.txt | 37 +++++++++++++++++++ testing/mm/{ => heaptest}/Kconfig | 14 +++---- testing/mm/heaptest/Make.defs | 25 +++++++++++++ testing/mm/heaptest/Makefile | 36 ++++++++++++++++++ .../mm/{mm_main.c => heaptest/heap_main.c} | 2 +- testing/{ => mm}/iob/CMakeLists.txt | 2 +- testing/{ => mm}/iob/Kconfig | 0 testing/{ => mm}/iob/Make.defs | 4 +- testing/{ => mm}/iob/Makefile | 2 +- testing/{ => mm}/iob/iob_main.c | 2 +- testing/{ => mm}/kasantest/CMakeLists.txt | 2 +- testing/{ => mm}/kasantest/Kconfig | 0 testing/{ => mm}/kasantest/Make.defs | 4 +- testing/{ => mm}/kasantest/Makefile | 2 +- testing/{ => mm}/kasantest/kasantest.c | 2 +- testing/{ => mm}/memstress/CMakeLists.txt | 2 +- testing/{ => mm}/memstress/Kconfig | 0 testing/{ => mm}/memstress/Make.defs | 4 +- testing/{ => mm}/memstress/Makefile | 2 +- .../{ => mm}/memstress/memorystress_main.c | 2 +- testing/{ => mm}/memtester/.gitignore | 0 testing/{ => mm}/memtester/CMakeLists.txt | 2 +- testing/{ => mm}/memtester/Kconfig | 0 testing/{ => mm}/memtester/Make.defs | 4 +- testing/{ => mm}/memtester/Makefile | 2 +- testing/{ => mm}/ramtest/CMakeLists.txt | 2 +- testing/{ => mm}/ramtest/Kconfig | 0 testing/{ => mm}/ramtest/Make.defs | 4 +- testing/{ => mm}/ramtest/Makefile | 2 +- testing/{ => mm}/ramtest/ramtest.c | 2 +- testing/{ => mm}/stressapptest/.gitignore | 0 testing/{ => mm}/stressapptest/CMakeLists.txt | 2 +- testing/{ => mm}/stressapptest/Kconfig | 0 testing/{ => mm}/stressapptest/Make.defs | 4 +- testing/{ => mm}/stressapptest/Makefile | 2 +- 44 files changed, 145 insertions(+), 72 deletions(-) create mode 100644 testing/mm/.gitignore rename testing/{ => mm}/cachetest/CMakeLists.txt (96%) rename testing/{ => mm}/cachetest/Kconfig (100%) rename testing/{ => mm}/cachetest/Make.defs (92%) rename testing/{ => mm}/cachetest/Makefile (97%) rename testing/{ => mm}/cachetest/cachetest_main.c (99%) create mode 100644 testing/mm/heaptest/CMakeLists.txt rename testing/mm/{ => heaptest}/Kconfig (75%) create mode 100644 testing/mm/heaptest/Make.defs create mode 100644 testing/mm/heaptest/Makefile rename testing/mm/{mm_main.c => heaptest/heap_main.c} (99%) rename testing/{ => mm}/iob/CMakeLists.txt (97%) rename testing/{ => mm}/iob/Kconfig (100%) rename testing/{ => mm}/iob/Make.defs (93%) rename testing/{ => mm}/iob/Makefile (97%) rename testing/{ => mm}/iob/iob_main.c (99%) rename testing/{ => mm}/kasantest/CMakeLists.txt (96%) rename testing/{ => mm}/kasantest/Kconfig (100%) rename testing/{ => mm}/kasantest/Make.defs (92%) rename testing/{ => mm}/kasantest/Makefile (97%) rename testing/{ => mm}/kasantest/kasantest.c (99%) rename testing/{ => mm}/memstress/CMakeLists.txt (96%) rename testing/{ => mm}/memstress/Kconfig (100%) rename testing/{ => mm}/memstress/Make.defs (92%) rename testing/{ => mm}/memstress/Makefile (97%) rename testing/{ => mm}/memstress/memorystress_main.c (99%) rename testing/{ => mm}/memtester/.gitignore (100%) rename testing/{ => mm}/memtester/CMakeLists.txt (98%) rename testing/{ => mm}/memtester/Kconfig (100%) rename testing/{ => mm}/memtester/Make.defs (92%) rename testing/{ => mm}/memtester/Makefile (97%) rename testing/{ => mm}/ramtest/CMakeLists.txt (96%) rename testing/{ => mm}/ramtest/Kconfig (100%) rename testing/{ => mm}/ramtest/Make.defs (92%) rename testing/{ => mm}/ramtest/Makefile (97%) rename testing/{ => mm}/ramtest/ramtest.c (99%) rename testing/{ => mm}/stressapptest/.gitignore (100%) rename testing/{ => mm}/stressapptest/CMakeLists.txt (98%) rename testing/{ => mm}/stressapptest/Kconfig (100%) rename testing/{ => mm}/stressapptest/Make.defs (91%) rename testing/{ => mm}/stressapptest/Makefile (98%) diff --git a/testing/mm/.gitignore b/testing/mm/.gitignore new file mode 100644 index 00000000000..9e1d2593ee8 --- /dev/null +++ b/testing/mm/.gitignore @@ -0,0 +1 @@ +/Kconfig diff --git a/testing/mm/CMakeLists.txt b/testing/mm/CMakeLists.txt index 043685f330f..ca97570aeee 100644 --- a/testing/mm/CMakeLists.txt +++ b/testing/mm/CMakeLists.txt @@ -20,18 +20,5 @@ # # ############################################################################## -if(CONFIG_TESTING_MM) - nuttx_add_application( - NAME - ${CONFIG_TESTING_MM_PROGNAME} - PRIORITY - ${CONFIG_TESTING_MM_PRIORITY} - STACKSIZE - ${CONFIG_TESTING_MM_STACKSIZE} - MODULE - ${CONFIG_TESTING_MM} - INCLUDE_DIRECTORIES - ${NUTTX_DIR}/mm/mm_heap - SRCS - mm_main.c) -endif() +nuttx_add_subdirectory() +nuttx_generate_kconfig(MENUDESC "mm") diff --git a/testing/mm/Make.defs b/testing/mm/Make.defs index a82b81f5655..c34a91b81fd 100644 --- a/testing/mm/Make.defs +++ b/testing/mm/Make.defs @@ -20,6 +20,4 @@ # ############################################################################ -ifneq ($(CONFIG_TESTING_MM),) -CONFIGURED_APPS += $(APPDIR)/testing/mm -endif +include $(wildcard $(APPDIR)/testing/mm/*/Make.defs) diff --git a/testing/mm/Makefile b/testing/mm/Makefile index bf202717c68..28307d2e383 100644 --- a/testing/mm/Makefile +++ b/testing/mm/Makefile @@ -20,17 +20,6 @@ # ############################################################################ -include $(APPDIR)/Make.defs +MENUDESC = "mm" -# Memory Management Test - -PROGNAME = $(CONFIG_TESTING_MM_PROGNAME) -PRIORITY = $(CONFIG_TESTING_MM_PRIORITY) -STACKSIZE = $(CONFIG_TESTING_MM_STACKSIZE) -MODULE = $(CONFIG_TESTING_MM) - -MAINSRC = mm_main.c - -CFLAGS += -I$(TOPDIR)/mm/mm_heap - -include $(APPDIR)/Application.mk +include $(APPDIR)/Directory.mk diff --git a/testing/cachetest/CMakeLists.txt b/testing/mm/cachetest/CMakeLists.txt similarity index 96% rename from testing/cachetest/CMakeLists.txt rename to testing/mm/cachetest/CMakeLists.txt index 5eb87601db2..1858d957f2f 100644 --- a/testing/cachetest/CMakeLists.txt +++ b/testing/mm/cachetest/CMakeLists.txt @@ -1,5 +1,5 @@ # ############################################################################## -# apps/testing/cachetest/CMakeLists.txt +# apps/testing/mm/cachetest/CMakeLists.txt # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/cachetest/Kconfig b/testing/mm/cachetest/Kconfig similarity index 100% rename from testing/cachetest/Kconfig rename to testing/mm/cachetest/Kconfig diff --git a/testing/cachetest/Make.defs b/testing/mm/cachetest/Make.defs similarity index 92% rename from testing/cachetest/Make.defs rename to testing/mm/cachetest/Make.defs index 70bbd75aa43..ccad027be63 100644 --- a/testing/cachetest/Make.defs +++ b/testing/mm/cachetest/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/cachetest/Make.defs +# apps/testing/mm/cachetest/Make.defs # # SPDX-License-Identifier: Apache-2.0 # @@ -21,5 +21,5 @@ ############################################################################ ifneq ($(CONFIG_TESTING_CACHETEST),) -CONFIGURED_APPS += $(APPDIR)/testing/cachetest +CONFIGURED_APPS += $(APPDIR)/testing/mm/cachetest endif diff --git a/testing/cachetest/Makefile b/testing/mm/cachetest/Makefile similarity index 97% rename from testing/cachetest/Makefile rename to testing/mm/cachetest/Makefile index 544e1da4894..45d1378fdd2 100644 --- a/testing/cachetest/Makefile +++ b/testing/mm/cachetest/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/cachetest/Makefile +# apps/testing/mm/cachetest/Makefile # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/cachetest/cachetest_main.c b/testing/mm/cachetest/cachetest_main.c similarity index 99% rename from testing/cachetest/cachetest_main.c rename to testing/mm/cachetest/cachetest_main.c index ec1653a5904..ff7fe645ddf 100644 --- a/testing/cachetest/cachetest_main.c +++ b/testing/mm/cachetest/cachetest_main.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/cachetest/cachetest_main.c + * apps/testing/mm/cachetest/cachetest_main.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/mm/heaptest/CMakeLists.txt b/testing/mm/heaptest/CMakeLists.txt new file mode 100644 index 00000000000..9bf6aebb579 --- /dev/null +++ b/testing/mm/heaptest/CMakeLists.txt @@ -0,0 +1,37 @@ +# ############################################################################## +# apps/testing/mm/heaptest/CMakeLists.txt +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_TESTING_HEAP) + nuttx_add_application( + NAME + ${CONFIG_TESTING_HEAP_PROGNAME} + PRIORITY + ${CONFIG_TESTING_HEAP_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_HEAP_STACKSIZE} + MODULE + ${CONFIG_TESTING_HEAP} + INCLUDE_DIRECTORIES + ${NUTTX_DIR}/mm/mm_heap + SRCS + heap_main.c) +endif() diff --git a/testing/mm/Kconfig b/testing/mm/heaptest/Kconfig similarity index 75% rename from testing/mm/Kconfig rename to testing/mm/heaptest/Kconfig index a3fc91ded46..194e5ee99be 100644 --- a/testing/mm/Kconfig +++ b/testing/mm/heaptest/Kconfig @@ -3,30 +3,30 @@ # see the file kconfig-language.txt in the NuttX tools repository. # -config TESTING_MM +config TESTING_HEAP tristate "Memory management test" default n ---help--- Enable the memory management test -if TESTING_MM +if TESTING_HEAP -config TESTING_MM_PROGNAME +config TESTING_HEAP_PROGNAME string "Program name" - default "mm" + default "heap" ---help--- This is the name of the program that will be used when the NSH ELF program is installed. -config TESTING_MM_PRIORITY +config TESTING_HEAP_PRIORITY int "Task priority" default 100 -config TESTING_MM_STACKSIZE +config TESTING_HEAP_STACKSIZE int "Stack size" default DEFAULT_TASK_STACKSIZE -config TESTING_MM_POWEROFF +config TESTING_HEAP_POWEROFF bool "Terminate on test completion" default n depends on BOARDCTL_POWEROFF diff --git a/testing/mm/heaptest/Make.defs b/testing/mm/heaptest/Make.defs new file mode 100644 index 00000000000..529dc87d2ec --- /dev/null +++ b/testing/mm/heaptest/Make.defs @@ -0,0 +1,25 @@ +############################################################################ +# apps/testing/mm/heaptest/Make.defs +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +ifneq ($(CONFIG_TESTING_HEAP),) +CONFIGURED_APPS += $(APPDIR)/testing/mm/heaptest +endif diff --git a/testing/mm/heaptest/Makefile b/testing/mm/heaptest/Makefile new file mode 100644 index 00000000000..d2077eb66b4 --- /dev/null +++ b/testing/mm/heaptest/Makefile @@ -0,0 +1,36 @@ +############################################################################ +# apps/testing/mm/heaptest/Makefile +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +include $(APPDIR)/Make.defs + +# Memory Management Test + +PROGNAME = $(CONFIG_TESTING_HEAP_PROGNAME) +PRIORITY = $(CONFIG_TESTING_HEAP_PRIORITY) +STACKSIZE = $(CONFIG_TESTING_HEAP_STACKSIZE) +MODULE = $(CONFIG_TESTING_HEAP) + +MAINSRC = heap_main.c + +CFLAGS += -I$(TOPDIR)/mm/mm_heap + +include $(APPDIR)/Application.mk diff --git a/testing/mm/mm_main.c b/testing/mm/heaptest/heap_main.c similarity index 99% rename from testing/mm/mm_main.c rename to testing/mm/heaptest/heap_main.c index d1d8367ca4d..e0625f9b11e 100644 --- a/testing/mm/mm_main.c +++ b/testing/mm/heaptest/heap_main.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/mm/mm_main.c + * apps/testing/mm/heaptest/heap_main.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/iob/CMakeLists.txt b/testing/mm/iob/CMakeLists.txt similarity index 97% rename from testing/iob/CMakeLists.txt rename to testing/mm/iob/CMakeLists.txt index e569423b9e3..8698d4163c1 100644 --- a/testing/iob/CMakeLists.txt +++ b/testing/mm/iob/CMakeLists.txt @@ -1,5 +1,5 @@ # ############################################################################## -# apps/testing/iob/CMakeLists.txt +# apps/testing/mm/iob/CMakeLists.txt # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/iob/Kconfig b/testing/mm/iob/Kconfig similarity index 100% rename from testing/iob/Kconfig rename to testing/mm/iob/Kconfig diff --git a/testing/iob/Make.defs b/testing/mm/iob/Make.defs similarity index 93% rename from testing/iob/Make.defs rename to testing/mm/iob/Make.defs index 3c51ff18f9a..805cbebecd6 100644 --- a/testing/iob/Make.defs +++ b/testing/mm/iob/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/iob/Make.defs +# apps/testing/mm/iob/Make.defs # # SPDX-License-Identifier: Apache-2.0 # @@ -21,5 +21,5 @@ ############################################################################ ifneq ($(CONFIG_TESTING_IOB),) -CONFIGURED_APPS += $(APPDIR)/testing/iob +CONFIGURED_APPS += $(APPDIR)/testing/mm/iob endif diff --git a/testing/iob/Makefile b/testing/mm/iob/Makefile similarity index 97% rename from testing/iob/Makefile rename to testing/mm/iob/Makefile index 3ebb8a27fb9..226bc6ef7b1 100644 --- a/testing/iob/Makefile +++ b/testing/mm/iob/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/iob/Makefile +# apps/testing/mm/iob/Makefile # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/iob/iob_main.c b/testing/mm/iob/iob_main.c similarity index 99% rename from testing/iob/iob_main.c rename to testing/mm/iob/iob_main.c index 7e6e1991d76..69cfa08cbb8 100644 --- a/testing/iob/iob_main.c +++ b/testing/mm/iob/iob_main.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/iob/iob_main.c + * apps/testing/mm/iob/iob_main.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/kasantest/CMakeLists.txt b/testing/mm/kasantest/CMakeLists.txt similarity index 96% rename from testing/kasantest/CMakeLists.txt rename to testing/mm/kasantest/CMakeLists.txt index ff1c65a4ada..ee58fa8ac4d 100644 --- a/testing/kasantest/CMakeLists.txt +++ b/testing/mm/kasantest/CMakeLists.txt @@ -1,5 +1,5 @@ # ############################################################################## -# apps/testing/kasantest/CMakeLists.txt +# apps/testing/mm/kasantest/CMakeLists.txt # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/kasantest/Kconfig b/testing/mm/kasantest/Kconfig similarity index 100% rename from testing/kasantest/Kconfig rename to testing/mm/kasantest/Kconfig diff --git a/testing/kasantest/Make.defs b/testing/mm/kasantest/Make.defs similarity index 92% rename from testing/kasantest/Make.defs rename to testing/mm/kasantest/Make.defs index 6760568e9c3..4cd7a76c7d7 100644 --- a/testing/kasantest/Make.defs +++ b/testing/mm/kasantest/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/kasantest/Make.defs +# apps/testing/mm/kasantest/Make.defs # # SPDX-License-Identifier: Apache-2.0 # @@ -21,5 +21,5 @@ ############################################################################ ifneq ($(CONFIG_TESTING_KASAN),) -CONFIGURED_APPS += $(APPDIR)/testing/kasantest +CONFIGURED_APPS += $(APPDIR)/testing/mm/kasantest endif diff --git a/testing/kasantest/Makefile b/testing/mm/kasantest/Makefile similarity index 97% rename from testing/kasantest/Makefile rename to testing/mm/kasantest/Makefile index 5f2669ebe6a..82edc831504 100644 --- a/testing/kasantest/Makefile +++ b/testing/mm/kasantest/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/kasantest/Makefile +# apps/testing/mm/kasantest/Makefile # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/kasantest/kasantest.c b/testing/mm/kasantest/kasantest.c similarity index 99% rename from testing/kasantest/kasantest.c rename to testing/mm/kasantest/kasantest.c index cdb8b5cecdc..72f1353a10e 100644 --- a/testing/kasantest/kasantest.c +++ b/testing/mm/kasantest/kasantest.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/kasantest/kasantest.c + * apps/testing/mm/kasantest/kasantest.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/memstress/CMakeLists.txt b/testing/mm/memstress/CMakeLists.txt similarity index 96% rename from testing/memstress/CMakeLists.txt rename to testing/mm/memstress/CMakeLists.txt index 5247fbd5739..c3854e15e4a 100644 --- a/testing/memstress/CMakeLists.txt +++ b/testing/mm/memstress/CMakeLists.txt @@ -1,5 +1,5 @@ # ############################################################################## -# apps/testing/memstress/CMakeLists.txt +# apps/testing/mm/memstress/CMakeLists.txt # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/memstress/Kconfig b/testing/mm/memstress/Kconfig similarity index 100% rename from testing/memstress/Kconfig rename to testing/mm/memstress/Kconfig diff --git a/testing/memstress/Make.defs b/testing/mm/memstress/Make.defs similarity index 92% rename from testing/memstress/Make.defs rename to testing/mm/memstress/Make.defs index 583cf30668e..b9b8cb9235a 100644 --- a/testing/memstress/Make.defs +++ b/testing/mm/memstress/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/memstress/Make.defs +# apps/testing/mm/memstress/Make.defs # # SPDX-License-Identifier: Apache-2.0 # @@ -21,5 +21,5 @@ ############################################################################ ifneq ($(CONFIG_TESTING_MEMORY_STRESS),) -CONFIGURED_APPS += $(APPDIR)/testing/memstress +CONFIGURED_APPS += $(APPDIR)/testing/mm/memstress endif diff --git a/testing/memstress/Makefile b/testing/mm/memstress/Makefile similarity index 97% rename from testing/memstress/Makefile rename to testing/mm/memstress/Makefile index ae4729d146e..380f026501d 100644 --- a/testing/memstress/Makefile +++ b/testing/mm/memstress/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/memstress/Makefile +# apps/testing/mm/memstress/Makefile # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/memstress/memorystress_main.c b/testing/mm/memstress/memorystress_main.c similarity index 99% rename from testing/memstress/memorystress_main.c rename to testing/mm/memstress/memorystress_main.c index ca43636cb90..6d9b2d98dc6 100644 --- a/testing/memstress/memorystress_main.c +++ b/testing/mm/memstress/memorystress_main.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/memstress/memorystress_main.c + * apps/testing/mm/memstress/memorystress_main.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/memtester/.gitignore b/testing/mm/memtester/.gitignore similarity index 100% rename from testing/memtester/.gitignore rename to testing/mm/memtester/.gitignore diff --git a/testing/memtester/CMakeLists.txt b/testing/mm/memtester/CMakeLists.txt similarity index 98% rename from testing/memtester/CMakeLists.txt rename to testing/mm/memtester/CMakeLists.txt index e7a1d72df41..c60eeb69a8c 100644 --- a/testing/memtester/CMakeLists.txt +++ b/testing/mm/memtester/CMakeLists.txt @@ -1,5 +1,5 @@ # ############################################################################## -# apps/testing/memtester/CMakeLists.txt +# apps/testing/mm/memtester/CMakeLists.txt # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/memtester/Kconfig b/testing/mm/memtester/Kconfig similarity index 100% rename from testing/memtester/Kconfig rename to testing/mm/memtester/Kconfig diff --git a/testing/memtester/Make.defs b/testing/mm/memtester/Make.defs similarity index 92% rename from testing/memtester/Make.defs rename to testing/mm/memtester/Make.defs index 315646b8b06..0de51e5da83 100644 --- a/testing/memtester/Make.defs +++ b/testing/mm/memtester/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/memtester/Make.defs +# apps/testing/mm/memtester/Make.defs # # SPDX-License-Identifier: Apache-2.0 # @@ -21,5 +21,5 @@ ############################################################################ ifneq ($(CONFIG_UTILS_MEMTESTER),) -CONFIGURED_APPS += $(APPDIR)/testing/memtester +CONFIGURED_APPS += $(APPDIR)/testing/mm/memtester endif diff --git a/testing/memtester/Makefile b/testing/mm/memtester/Makefile similarity index 97% rename from testing/memtester/Makefile rename to testing/mm/memtester/Makefile index e577d5829e0..8f7056e97ad 100644 --- a/testing/memtester/Makefile +++ b/testing/mm/memtester/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/memtester/Makefile +# apps/testing/mm/memtester/Makefile # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/ramtest/CMakeLists.txt b/testing/mm/ramtest/CMakeLists.txt similarity index 96% rename from testing/ramtest/CMakeLists.txt rename to testing/mm/ramtest/CMakeLists.txt index 796f818773f..56de353f4fb 100644 --- a/testing/ramtest/CMakeLists.txt +++ b/testing/mm/ramtest/CMakeLists.txt @@ -1,5 +1,5 @@ # ############################################################################## -# apps/testing/ramtest/CMakeLists.txt +# apps/testing/mm/ramtest/CMakeLists.txt # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/ramtest/Kconfig b/testing/mm/ramtest/Kconfig similarity index 100% rename from testing/ramtest/Kconfig rename to testing/mm/ramtest/Kconfig diff --git a/testing/ramtest/Make.defs b/testing/mm/ramtest/Make.defs similarity index 92% rename from testing/ramtest/Make.defs rename to testing/mm/ramtest/Make.defs index b521135d6bb..e42ae25872e 100644 --- a/testing/ramtest/Make.defs +++ b/testing/mm/ramtest/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/ramtest/Make.defs +# apps/testing/mm/ramtest/Make.defs # # SPDX-License-Identifier: Apache-2.0 # @@ -21,5 +21,5 @@ ############################################################################ ifneq ($(CONFIG_TESTING_RAMTEST),) -CONFIGURED_APPS += $(APPDIR)/testing/ramtest +CONFIGURED_APPS += $(APPDIR)/testing/mm/ramtest endif diff --git a/testing/ramtest/Makefile b/testing/mm/ramtest/Makefile similarity index 97% rename from testing/ramtest/Makefile rename to testing/mm/ramtest/Makefile index 977f0838acf..44ac4ab6268 100644 --- a/testing/ramtest/Makefile +++ b/testing/mm/ramtest/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/ramtest/Makefile +# apps/testing/mm/ramtest/Makefile # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/ramtest/ramtest.c b/testing/mm/ramtest/ramtest.c similarity index 99% rename from testing/ramtest/ramtest.c rename to testing/mm/ramtest/ramtest.c index 77989c42145..500e94251d7 100644 --- a/testing/ramtest/ramtest.c +++ b/testing/mm/ramtest/ramtest.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/ramtest/ramtest.c + * apps/testing/mm/ramtest/ramtest.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/stressapptest/.gitignore b/testing/mm/stressapptest/.gitignore similarity index 100% rename from testing/stressapptest/.gitignore rename to testing/mm/stressapptest/.gitignore diff --git a/testing/stressapptest/CMakeLists.txt b/testing/mm/stressapptest/CMakeLists.txt similarity index 98% rename from testing/stressapptest/CMakeLists.txt rename to testing/mm/stressapptest/CMakeLists.txt index 4a618c2a012..11fb3788fc6 100644 --- a/testing/stressapptest/CMakeLists.txt +++ b/testing/mm/stressapptest/CMakeLists.txt @@ -1,5 +1,5 @@ # ############################################################################## -# apps/testing/stressapptest/CMakeLists.txt +# apps/testing/mm/stressapptest/CMakeLists.txt # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/stressapptest/Kconfig b/testing/mm/stressapptest/Kconfig similarity index 100% rename from testing/stressapptest/Kconfig rename to testing/mm/stressapptest/Kconfig diff --git a/testing/stressapptest/Make.defs b/testing/mm/stressapptest/Make.defs similarity index 91% rename from testing/stressapptest/Make.defs rename to testing/mm/stressapptest/Make.defs index 1b0f51ce594..ce1a15a9b20 100644 --- a/testing/stressapptest/Make.defs +++ b/testing/mm/stressapptest/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/stressapptest/Make.defs +# apps/testing/mm/stressapptest/Make.defs # # SPDX-License-Identifier: Apache-2.0 # @@ -21,5 +21,5 @@ ############################################################################ ifneq ($(CONFIG_TESTING_STRESSAPPTEST),) -CONFIGURED_APPS += $(APPDIR)/testing/stressapptest +CONFIGURED_APPS += $(APPDIR)/testing/mm/stressapptest endif diff --git a/testing/stressapptest/Makefile b/testing/mm/stressapptest/Makefile similarity index 98% rename from testing/stressapptest/Makefile rename to testing/mm/stressapptest/Makefile index e124860436d..0e08acba2c0 100644 --- a/testing/stressapptest/Makefile +++ b/testing/mm/stressapptest/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/stressapptest/Makefile +# apps/testing/mm/stressapptest/Makefile # # SPDX-License-Identifier: Apache-2.0 # From 048b3e6f7b530dee5c7eabe3f7af64f6957d9bfd Mon Sep 17 00:00:00 2001 From: Yanfeng Liu Date: Thu, 23 Jan 2025 16:15:47 +0800 Subject: [PATCH 163/391] examples/module: add hostfs support This allows loading the kernel module from a hostfs file system. Signed-off-by: Yanfeng Liu --- examples/module/main/Kconfig | 8 ++++++++ examples/module/main/module_main.c | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/examples/module/main/Kconfig b/examples/module/main/Kconfig index 28a9c5f2638..b3a8889e6a9 100644 --- a/examples/module/main/Kconfig +++ b/examples/module/main/Kconfig @@ -115,6 +115,14 @@ config EXAMPLES_MODULE_BINDIR The full, absolute path to the location for the binaries can be located in a pre-mounted external file system. +config EXAMPLES_MODULE_FSDATA + string "Additional data passed to mount" + default "" + depends on EXAMPLES_MODULE_FSMOUNT + ---help--- + Additional data needed by mount. For example, when hostfs + is used, this can be "fs=../apps/bin" + config EXAMPLES_MODULE_LIBC bool "Link with LIBC" default n diff --git a/examples/module/main/module_main.c b/examples/module/main/module_main.c index 74dc98b7c3e..37da14fee16 100644 --- a/examples/module/main/module_main.c +++ b/examples/module/main/module_main.c @@ -253,7 +253,8 @@ int main(int argc, FAR char *argv[]) CONFIG_EXAMPLES_MODULE_FSTYPE, MOUNTPT); ret = mount(CONFIG_EXAMPLES_MODULE_DEVPATH, MOUNTPT, - CONFIG_EXAMPLES_MODULE_FSTYPE, MS_RDONLY, NULL); + CONFIG_EXAMPLES_MODULE_FSTYPE, MS_RDONLY, + CONFIG_EXAMPLES_MODULE_FSDATA); if (ret < 0) { printf("ERROR: mount(%s, %s, %s) failed: %d\n", From 1d1a8ba92ebb8b5e412260fdd3ee96d3698a9910 Mon Sep 17 00:00:00 2001 From: xuxingliang Date: Tue, 24 Dec 2024 19:52:00 +0800 Subject: [PATCH 164/391] system/coredump: move coredump info to note Signed-off-by: xuxingliang --- system/coredump/coredump.c | 105 +++++++++++++++++++++++++++++-------- 1 file changed, 84 insertions(+), 21 deletions(-) diff --git a/system/coredump/coredump.c b/system/coredump/coredump.c index d859e074563..3b4db4bcfdf 100644 --- a/system/coredump/coredump.c +++ b/system/coredump/coredump.c @@ -108,7 +108,7 @@ static int dumpfile_iterate(FAR char *path, dumpfile_cb_t cb, FAR void *arg) ret = mkdir(path, 0777); if (ret < 0) { - return ret; + return -errno; } } @@ -155,6 +155,61 @@ static void dumpfile_delete(FAR char *path, FAR const char *filename, } } +/**************************************************************************** + * dumpfile_get_info + ****************************************************************************/ + +static int dumpfile_get_info(int fd, FAR struct coredump_info_s *info) +{ + Elf_Ehdr ehdr; + Elf_Phdr phdr; + Elf_Nhdr nhdr; + char name[COREDUMP_INFONAME_SIZE]; + + if (read(fd, &ehdr, sizeof(ehdr)) != sizeof(ehdr) || + memcmp(ehdr.e_ident, ELFMAG, EI_MAGIC_SIZE) != 0) + { + return -EINVAL; + } + + /* The last program header is for NuttX core info note. */ + + if (lseek(fd, ehdr.e_phoff + ehdr.e_phentsize * (ehdr.e_phnum - 1), + SEEK_SET) < 0) + { + return -errno; + } + + if (read(fd, &phdr, sizeof(phdr)) != sizeof(phdr) || + lseek(fd, phdr.p_offset, SEEK_SET) < 0) + { + return -errno; + } + + /* The note header must match exactly. */ + + if (read(fd, &nhdr, sizeof(nhdr)) != sizeof(nhdr) || + nhdr.n_type != COREDUMP_MAGIC || + nhdr.n_namesz != COREDUMP_INFONAME_SIZE || + nhdr.n_descsz != sizeof(struct coredump_info_s)) + { + return -EINVAL; + } + + if (read(fd, name, nhdr.n_namesz) != nhdr.n_namesz || + strcmp(name, "NuttX") != 0) + { + return -EINVAL; + } + + if (read(fd, info, sizeof(*info)) != sizeof(*info)) + { + return -errno; + } + + return 0; +} + /**************************************************************************** * coredump_restore ****************************************************************************/ @@ -172,6 +227,10 @@ static void coredump_restore(FAR char *savepath, size_t maxfile) int blkfd; off_t off; int ret; + Elf_Nhdr nhdr = + { + 0 + }; blkfd = open(CONFIG_SYSTEM_COREDUMP_DEVPATH, O_RDWR); if (blkfd < 0) @@ -179,23 +238,10 @@ static void coredump_restore(FAR char *savepath, size_t maxfile) return; } - off = lseek(blkfd, -(off_t)sizeof(info), SEEK_END); - if (off < 0) - { - printf("Seek %s fail\n", CONFIG_SYSTEM_COREDUMP_DEVPATH); - goto blkfd_err; - } - - readsize = read(blkfd, &info, sizeof(info)); - if (readsize != sizeof(info)) - { - printf("Read %s fail\n", CONFIG_SYSTEM_COREDUMP_DEVPATH); - goto blkfd_err; - } - - if (info.magic != COREDUMP_MAGIC) + ret = dumpfile_get_info(blkfd, &info); + if (ret < 0) { - printf("%s coredump not found!\n", CONFIG_SYSTEM_COREDUMP_DEVPATH); + printf("No core data in %s\n", CONFIG_SYSTEM_COREDUMP_DEVPATH); goto blkfd_err; } @@ -277,16 +323,33 @@ static void coredump_restore(FAR char *savepath, size_t maxfile) printf("Coredump finish [%s][%zu]\n", dumppath, info.size); } - info.magic = 0; - off = lseek(blkfd, -(off_t)sizeof(info), SEEK_END); + off = info.size - sizeof(info); + off -= COREDUMP_INFONAME_SIZE; + off -= sizeof(Elf_Nhdr); + off = lseek(blkfd, off, SEEK_SET); + if (off < 0) + { + printf("Seek %s fail\n", CONFIG_SYSTEM_COREDUMP_DEVPATH); + goto swap_err; + } + + writesize = write(blkfd, &nhdr, sizeof(nhdr)); + if (writesize != sizeof(nhdr)) + { + printf("Write %s fail\n", CONFIG_SYSTEM_COREDUMP_DEVPATH); + } + + /* Erase the core file header too */ + + off = lseek(blkfd, 0, SEEK_SET); if (off < 0) { printf("Seek %s fail\n", CONFIG_SYSTEM_COREDUMP_DEVPATH); goto swap_err; } - writesize = write(blkfd, &info, sizeof(info)); - if (writesize != sizeof(info)) + writesize = write(blkfd, "\0\0\0\0", EI_MAGIC_SIZE); + if (writesize != EI_MAGIC_SIZE) { printf("Write %s fail\n", CONFIG_SYSTEM_COREDUMP_DEVPATH); } From d3a1f803088eb264259c8ec0bb2e90964bd576f5 Mon Sep 17 00:00:00 2001 From: yintao Date: Fri, 3 Jan 2025 19:39:53 +0800 Subject: [PATCH 165/391] coredump: add error print So we know if coredump exits with error, or there's no coredump. Signed-off-by: yintao --- system/coredump/coredump.c | 1 + 1 file changed, 1 insertion(+) diff --git a/system/coredump/coredump.c b/system/coredump/coredump.c index 3b4db4bcfdf..22a1f15d2ba 100644 --- a/system/coredump/coredump.c +++ b/system/coredump/coredump.c @@ -108,6 +108,7 @@ static int dumpfile_iterate(FAR char *path, dumpfile_cb_t cb, FAR void *arg) ret = mkdir(path, 0777); if (ret < 0) { + printf("Coredump mkdir %s fail\n", path); return -errno; } } From 0406e6734a2478a4211a73b7c7d92875fe2b40aa Mon Sep 17 00:00:00 2001 From: tengshuangshuang Date: Fri, 24 Jan 2025 14:27:50 +0800 Subject: [PATCH 166/391] apps/testing:move atomic,cpuload,getprime,smp and timerjitter folders to the new sched folder Signed-off-by: tengshuangshuang --- {testing => system}/cpuload/CMakeLists.txt | 6 ++--- {testing => system}/cpuload/Kconfig | 2 +- {testing => system}/cpuload/Make.defs | 6 ++--- {testing => system}/cpuload/Makefile | 4 +-- {testing => system}/cpuload/cpuload_main.c | 2 +- testing/{ => libc}/atomic/CMakeLists.txt | 2 +- testing/{ => libc}/atomic/Kconfig | 0 testing/{ => libc}/atomic/Make.defs | 4 +-- testing/{ => libc}/atomic/Makefile | 2 +- testing/{ => libc}/atomic/atomic_main.c | 2 +- testing/sched/.gitignore | 1 + testing/sched/CMakeLists.txt | 24 ++++++++++++++++++ testing/sched/Make.defs | 23 +++++++++++++++++ testing/sched/Makefile | 25 +++++++++++++++++++ testing/{ => sched}/getprime/CMakeLists.txt | 2 +- testing/{ => sched}/getprime/Kconfig | 0 testing/{ => sched}/getprime/Make.defs | 4 +-- testing/{ => sched}/getprime/Makefile | 2 +- testing/{ => sched}/getprime/getprime_main.c | 2 +- testing/{ => sched}/smp/CMakeLists.txt | 2 +- testing/{ => sched}/smp/Kconfig | 0 testing/{ => sched}/smp/Make.defs | 4 +-- testing/{ => sched}/smp/Makefile | 2 +- testing/{ => sched}/smp/smp_main.c | 2 +- .../{ => sched}/timerjitter/CMakeLists.txt | 2 +- testing/{ => sched}/timerjitter/Kconfig | 0 testing/{ => sched}/timerjitter/Make.defs | 4 +-- testing/{ => sched}/timerjitter/Makefile | 2 +- testing/{ => sched}/timerjitter/timerjitter.c | 2 +- 29 files changed, 103 insertions(+), 30 deletions(-) rename {testing => system}/cpuload/CMakeLists.txt (92%) rename {testing => system}/cpuload/Kconfig (88%) rename {testing => system}/cpuload/Make.defs (89%) rename {testing => system}/cpuload/Makefile (94%) rename {testing => system}/cpuload/cpuload_main.c (98%) rename testing/{ => libc}/atomic/CMakeLists.txt (96%) rename testing/{ => libc}/atomic/Kconfig (100%) rename testing/{ => libc}/atomic/Make.defs (92%) rename testing/{ => libc}/atomic/Makefile (97%) rename testing/{ => libc}/atomic/atomic_main.c (99%) create mode 100644 testing/sched/.gitignore create mode 100644 testing/sched/CMakeLists.txt create mode 100644 testing/sched/Make.defs create mode 100644 testing/sched/Makefile rename testing/{ => sched}/getprime/CMakeLists.txt (96%) rename testing/{ => sched}/getprime/Kconfig (100%) rename testing/{ => sched}/getprime/Make.defs (91%) rename testing/{ => sched}/getprime/Makefile (97%) rename testing/{ => sched}/getprime/getprime_main.c (99%) rename testing/{ => sched}/smp/CMakeLists.txt (96%) rename testing/{ => sched}/smp/Kconfig (100%) rename testing/{ => sched}/smp/Make.defs (92%) rename testing/{ => sched}/smp/Makefile (97%) rename testing/{ => sched}/smp/smp_main.c (99%) rename testing/{ => sched}/timerjitter/CMakeLists.txt (96%) rename testing/{ => sched}/timerjitter/Kconfig (100%) rename testing/{ => sched}/timerjitter/Make.defs (91%) rename testing/{ => sched}/timerjitter/Makefile (96%) rename testing/{ => sched}/timerjitter/timerjitter.c (99%) diff --git a/testing/cpuload/CMakeLists.txt b/system/cpuload/CMakeLists.txt similarity index 92% rename from testing/cpuload/CMakeLists.txt rename to system/cpuload/CMakeLists.txt index 60d8e2e6444..eb3d5a5565d 100644 --- a/testing/cpuload/CMakeLists.txt +++ b/system/cpuload/CMakeLists.txt @@ -1,5 +1,5 @@ # ############################################################################## -# apps/testing/cpuload/CMakeLists.txt +# apps/system/cpuload/CMakeLists.txt # # SPDX-License-Identifier: Apache-2.0 # @@ -20,7 +20,7 @@ # # ############################################################################## -if(CONFIG_TESTING_CPULOAD) +if(CONFIG_SYSTEM_CPULOAD) nuttx_add_application( NAME cpuload @@ -29,7 +29,7 @@ if(CONFIG_TESTING_CPULOAD) STACKSIZE ${CONFIG_DEFAULT_TASK_STACKSIZE} MODULE - ${CONFIG_TESTING_CPULOAD} + ${CONFIG_SYSTEM_CPULOAD} SRCS cpuload_main.c) endif() diff --git a/testing/cpuload/Kconfig b/system/cpuload/Kconfig similarity index 88% rename from testing/cpuload/Kconfig rename to system/cpuload/Kconfig index aab20e614d0..f0b895b4324 100644 --- a/testing/cpuload/Kconfig +++ b/system/cpuload/Kconfig @@ -3,6 +3,6 @@ # see the file kconfig-language.txt in the NuttX tools repository. # -config TESTING_CPULOAD +config SYSTEM_CPULOAD tristate "cpuload test" default n diff --git a/testing/cpuload/Make.defs b/system/cpuload/Make.defs similarity index 89% rename from testing/cpuload/Make.defs rename to system/cpuload/Make.defs index c43feb47912..e73223175b0 100644 --- a/testing/cpuload/Make.defs +++ b/system/cpuload/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/cpuload/Make.defs +# apps/system/cpuload/Make.defs # # SPDX-License-Identifier: Apache-2.0 # @@ -20,6 +20,6 @@ # ############################################################################ -ifneq ($(CONFIG_TESTING_CPULOAD),) -CONFIGURED_APPS += $(APPDIR)/testing/cpuload +ifneq ($(CONFIG_SYSTEM_CPULOAD),) +CONFIGURED_APPS += $(APPDIR)/testing/sched/cpuload endif diff --git a/testing/cpuload/Makefile b/system/cpuload/Makefile similarity index 94% rename from testing/cpuload/Makefile rename to system/cpuload/Makefile index 45fcb82c266..5d7058e1c78 100644 --- a/testing/cpuload/Makefile +++ b/system/cpuload/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/cpuload/Makefile +# apps/system/cpuload/Makefile # # SPDX-License-Identifier: Apache-2.0 # @@ -25,7 +25,7 @@ include $(APPDIR)/Make.defs PROGNAME = cpuload PRIORITY = 253 STACKSIZE = $(CONFIG_DEFAULT_TASK_STACKSIZE) -MODULE = $(CONFIG_TESTING_CPULOAD) +MODULE = $(CONFIG_SYSTEM_CPULOAD) MAINSRC = cpuload_main.c diff --git a/testing/cpuload/cpuload_main.c b/system/cpuload/cpuload_main.c similarity index 98% rename from testing/cpuload/cpuload_main.c rename to system/cpuload/cpuload_main.c index daa56dd8567..25d5f549b3c 100644 --- a/testing/cpuload/cpuload_main.c +++ b/system/cpuload/cpuload_main.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/cpuload/cpuload_main.c + * apps/system/cpuload/cpuload_main.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/atomic/CMakeLists.txt b/testing/libc/atomic/CMakeLists.txt similarity index 96% rename from testing/atomic/CMakeLists.txt rename to testing/libc/atomic/CMakeLists.txt index 5ae8d006b33..e63ad4bc835 100644 --- a/testing/atomic/CMakeLists.txt +++ b/testing/libc/atomic/CMakeLists.txt @@ -1,5 +1,5 @@ # ############################################################################## -# apps/testing/atomic/CMakeLists.txt +# apps/testing/libc/atomic/CMakeLists.txt # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/atomic/Kconfig b/testing/libc/atomic/Kconfig similarity index 100% rename from testing/atomic/Kconfig rename to testing/libc/atomic/Kconfig diff --git a/testing/atomic/Make.defs b/testing/libc/atomic/Make.defs similarity index 92% rename from testing/atomic/Make.defs rename to testing/libc/atomic/Make.defs index be5f4eb465c..ab66bcb1968 100644 --- a/testing/atomic/Make.defs +++ b/testing/libc/atomic/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/atomic/Make.defs +# apps/testing/libc/atomic/Make.defs # # SPDX-License-Identifier: Apache-2.0 # @@ -21,5 +21,5 @@ ############################################################################ ifneq ($(CONFIG_TESTING_ATOMIC),) -CONFIGURED_APPS += $(APPDIR)/testing/atomic +CONFIGURED_APPS += $(APPDIR)/testing/sched/atomic endif diff --git a/testing/atomic/Makefile b/testing/libc/atomic/Makefile similarity index 97% rename from testing/atomic/Makefile rename to testing/libc/atomic/Makefile index 19f4d48a3fd..2219ec39c3b 100644 --- a/testing/atomic/Makefile +++ b/testing/libc/atomic/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/atomic/Makefile +# apps/testing/libc/atomic/Makefile # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/atomic/atomic_main.c b/testing/libc/atomic/atomic_main.c similarity index 99% rename from testing/atomic/atomic_main.c rename to testing/libc/atomic/atomic_main.c index 7d3985fd99e..2ab64bf9dbf 100644 --- a/testing/atomic/atomic_main.c +++ b/testing/libc/atomic/atomic_main.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/atomic/atomic_main.c + * apps/testing/libc/atomic/atomic_main.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/sched/.gitignore b/testing/sched/.gitignore new file mode 100644 index 00000000000..9e1d2593ee8 --- /dev/null +++ b/testing/sched/.gitignore @@ -0,0 +1 @@ +/Kconfig diff --git a/testing/sched/CMakeLists.txt b/testing/sched/CMakeLists.txt new file mode 100644 index 00000000000..08657891bca --- /dev/null +++ b/testing/sched/CMakeLists.txt @@ -0,0 +1,24 @@ +# ############################################################################## +# apps/testing/sched/CMakeLists.txt +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +nuttx_add_subdirectory() +nuttx_generate_kconfig(MENUDESC "sched") diff --git a/testing/sched/Make.defs b/testing/sched/Make.defs new file mode 100644 index 00000000000..f557eb75d8d --- /dev/null +++ b/testing/sched/Make.defs @@ -0,0 +1,23 @@ +############################################################################ +# apps/testing/sched/Make.defs +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +include $(wildcard $(APPDIR)/testing/sched/*/Make.defs) diff --git a/testing/sched/Makefile b/testing/sched/Makefile new file mode 100644 index 00000000000..0e8113b0669 --- /dev/null +++ b/testing/sched/Makefile @@ -0,0 +1,25 @@ +############################################################################ +# apps/testing/sched/Makefile +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +MENUDESC = "sched" + +include $(APPDIR)/Directory.mk diff --git a/testing/getprime/CMakeLists.txt b/testing/sched/getprime/CMakeLists.txt similarity index 96% rename from testing/getprime/CMakeLists.txt rename to testing/sched/getprime/CMakeLists.txt index 407ae9649f8..7cafff8250f 100644 --- a/testing/getprime/CMakeLists.txt +++ b/testing/sched/getprime/CMakeLists.txt @@ -1,5 +1,5 @@ # ############################################################################## -# apps/testing/getprime/CMakeLists.txt +# apps/testing/sched/getprime/CMakeLists.txt # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/getprime/Kconfig b/testing/sched/getprime/Kconfig similarity index 100% rename from testing/getprime/Kconfig rename to testing/sched/getprime/Kconfig diff --git a/testing/getprime/Make.defs b/testing/sched/getprime/Make.defs similarity index 91% rename from testing/getprime/Make.defs rename to testing/sched/getprime/Make.defs index d990dc0ba81..7591f4bb17a 100644 --- a/testing/getprime/Make.defs +++ b/testing/sched/getprime/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/getprime/Make.defs +# apps/testing/sched/getprime/Make.defs # # SPDX-License-Identifier: Apache-2.0 # @@ -21,5 +21,5 @@ ############################################################################ ifneq ($(CONFIG_TESTING_GETPRIME),) -CONFIGURED_APPS += $(APPDIR)/testing/getprime +CONFIGURED_APPS += $(APPDIR)/testing/sched/getprime endif diff --git a/testing/getprime/Makefile b/testing/sched/getprime/Makefile similarity index 97% rename from testing/getprime/Makefile rename to testing/sched/getprime/Makefile index b7605743c21..3a728b04d77 100644 --- a/testing/getprime/Makefile +++ b/testing/sched/getprime/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/getprime/Makefile +# apps/testing/sched/getprime/Makefile # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/getprime/getprime_main.c b/testing/sched/getprime/getprime_main.c similarity index 99% rename from testing/getprime/getprime_main.c rename to testing/sched/getprime/getprime_main.c index 710f07dac28..bee2509be4b 100644 --- a/testing/getprime/getprime_main.c +++ b/testing/sched/getprime/getprime_main.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/getprime/getprime_main.c + * apps/testing/sched/getprime/getprime_main.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/smp/CMakeLists.txt b/testing/sched/smp/CMakeLists.txt similarity index 96% rename from testing/smp/CMakeLists.txt rename to testing/sched/smp/CMakeLists.txt index ada0bceb154..0848fc605dc 100644 --- a/testing/smp/CMakeLists.txt +++ b/testing/sched/smp/CMakeLists.txt @@ -1,5 +1,5 @@ # ############################################################################## -# apps/testing/smp/CMakeLists.txt +# apps/testing/sched/smp/CMakeLists.txt # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/smp/Kconfig b/testing/sched/smp/Kconfig similarity index 100% rename from testing/smp/Kconfig rename to testing/sched/smp/Kconfig diff --git a/testing/smp/Make.defs b/testing/sched/smp/Make.defs similarity index 92% rename from testing/smp/Make.defs rename to testing/sched/smp/Make.defs index 78a315d54c8..2f6d49e7af1 100644 --- a/testing/smp/Make.defs +++ b/testing/sched/smp/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/smp/Make.defs +# apps/testing/sched/smp/Make.defs # # SPDX-License-Identifier: Apache-2.0 # @@ -21,5 +21,5 @@ ############################################################################ ifneq ($(CONFIG_TESTING_SMP),) -CONFIGURED_APPS += $(APPDIR)/testing/smp +CONFIGURED_APPS += $(APPDIR)/testing/sched/smp endif diff --git a/testing/smp/Makefile b/testing/sched/smp/Makefile similarity index 97% rename from testing/smp/Makefile rename to testing/sched/smp/Makefile index dd36b1c38bd..e9287d0dd61 100644 --- a/testing/smp/Makefile +++ b/testing/sched/smp/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/smp/Makefile +# apps/testing/sched/smp/Makefile # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/smp/smp_main.c b/testing/sched/smp/smp_main.c similarity index 99% rename from testing/smp/smp_main.c rename to testing/sched/smp/smp_main.c index c5fedcb740d..8c3b94e7e6c 100644 --- a/testing/smp/smp_main.c +++ b/testing/sched/smp/smp_main.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/smp/smp_main.c + * apps/testing/sched/smp/smp_main.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/timerjitter/CMakeLists.txt b/testing/sched/timerjitter/CMakeLists.txt similarity index 96% rename from testing/timerjitter/CMakeLists.txt rename to testing/sched/timerjitter/CMakeLists.txt index 41a369aa2f0..dc84086eb4e 100644 --- a/testing/timerjitter/CMakeLists.txt +++ b/testing/sched/timerjitter/CMakeLists.txt @@ -1,5 +1,5 @@ # ############################################################################## -# apps/testing/timerjitter/CMakeLists.txt +# apps/testing/sched/timerjitter/CMakeLists.txt # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/timerjitter/Kconfig b/testing/sched/timerjitter/Kconfig similarity index 100% rename from testing/timerjitter/Kconfig rename to testing/sched/timerjitter/Kconfig diff --git a/testing/timerjitter/Make.defs b/testing/sched/timerjitter/Make.defs similarity index 91% rename from testing/timerjitter/Make.defs rename to testing/sched/timerjitter/Make.defs index f5ee5351890..a27647e4d28 100644 --- a/testing/timerjitter/Make.defs +++ b/testing/sched/timerjitter/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/timerjitter/Make.defs +# apps/testing/sched/timerjitter/Make.defs # # SPDX-License-Identifier: Apache-2.0 # @@ -21,5 +21,5 @@ ############################################################################ ifneq ($(CONFIG_TESTING_TIMERJITTER),) -CONFIGURED_APPS += $(APPDIR)/testing/timerjitter +CONFIGURED_APPS += $(APPDIR)/testing/sched/timerjitter endif diff --git a/testing/timerjitter/Makefile b/testing/sched/timerjitter/Makefile similarity index 96% rename from testing/timerjitter/Makefile rename to testing/sched/timerjitter/Makefile index 993f06fff7f..65052cabb0a 100644 --- a/testing/timerjitter/Makefile +++ b/testing/sched/timerjitter/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/timerjitter/Makefile +# apps/testing/sched/timerjitter/Makefile # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/timerjitter/timerjitter.c b/testing/sched/timerjitter/timerjitter.c similarity index 99% rename from testing/timerjitter/timerjitter.c rename to testing/sched/timerjitter/timerjitter.c index 3e335339127..ad956cd4ca9 100644 --- a/testing/timerjitter/timerjitter.c +++ b/testing/sched/timerjitter/timerjitter.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/timerjitter/timerjitter.c + * apps/testing/sched/timerjitter/timerjitter.c * * SPDX-License-Identifier: Apache-2.0 * From b7f05e89ba81b5b6185bfb09e2713b18be0cf339 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Sat, 25 Jan 2025 20:46:26 +0800 Subject: [PATCH 167/391] testing: Move crypto/setest to drivers and open_memstream to libc follow the dissusion from: https://github.com/apache/nuttx-apps/pull/2931 Signed-off-by: Xiang Xiao --- testing/{ => drivers}/crypto/3descbc.c | 2 +- testing/{ => drivers}/crypto/CMakeLists.txt | 2 +- testing/{ => drivers}/crypto/Kconfig | 0 testing/{ => drivers}/crypto/Make.defs | 4 ++-- testing/{ => drivers}/crypto/Makefile | 2 +- testing/{ => drivers}/crypto/aescbc.c | 2 +- testing/{ => drivers}/crypto/aescmac.c | 2 +- testing/{ => drivers}/crypto/aesctr.c | 2 +- testing/{ => drivers}/crypto/aesxts.c | 2 +- testing/{ => drivers}/crypto/crc32.c | 2 +- testing/{ => drivers}/crypto/dhm.c | 2 +- testing/{ => drivers}/crypto/ecdsa.c | 2 +- testing/{ => drivers}/crypto/hash.c | 2 +- testing/{ => drivers}/crypto/hmac.c | 2 +- testing/{ => drivers}/crypto/rsa.c | 2 +- testing/{ => drivers}/setest/CMakeLists.txt | 2 +- testing/{ => drivers}/setest/Kconfig | 0 testing/{ => drivers}/setest/Make.defs | 4 ++-- testing/{ => drivers}/setest/Makefile | 2 +- testing/{ => drivers}/setest/setest.c | 2 +- testing/{ => libc}/open_memstream/CMakeLists.txt | 2 +- testing/{ => libc}/open_memstream/Kconfig | 0 testing/{ => libc}/open_memstream/Make.defs | 4 ++-- testing/{ => libc}/open_memstream/Makefile | 2 +- testing/{ => libc}/open_memstream/open_memstream.c | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) rename testing/{ => drivers}/crypto/3descbc.c (99%) rename testing/{ => drivers}/crypto/CMakeLists.txt (98%) rename testing/{ => drivers}/crypto/Kconfig (100%) rename testing/{ => drivers}/crypto/Make.defs (91%) rename testing/{ => drivers}/crypto/Makefile (98%) rename testing/{ => drivers}/crypto/aescbc.c (99%) rename testing/{ => drivers}/crypto/aescmac.c (99%) rename testing/{ => drivers}/crypto/aesctr.c (99%) rename testing/{ => drivers}/crypto/aesxts.c (99%) rename testing/{ => drivers}/crypto/crc32.c (99%) rename testing/{ => drivers}/crypto/dhm.c (99%) rename testing/{ => drivers}/crypto/ecdsa.c (99%) rename testing/{ => drivers}/crypto/hash.c (99%) rename testing/{ => drivers}/crypto/hmac.c (99%) rename testing/{ => drivers}/crypto/rsa.c (99%) rename testing/{ => drivers}/setest/CMakeLists.txt (96%) rename testing/{ => drivers}/setest/Kconfig (100%) rename testing/{ => drivers}/setest/Make.defs (91%) rename testing/{ => drivers}/setest/Makefile (96%) rename testing/{ => drivers}/setest/setest.c (99%) rename testing/{ => libc}/open_memstream/CMakeLists.txt (95%) rename testing/{ => libc}/open_memstream/Kconfig (100%) rename testing/{ => libc}/open_memstream/Make.defs (90%) rename testing/{ => libc}/open_memstream/Makefile (96%) rename testing/{ => libc}/open_memstream/open_memstream.c (99%) diff --git a/testing/crypto/3descbc.c b/testing/drivers/crypto/3descbc.c similarity index 99% rename from testing/crypto/3descbc.c rename to testing/drivers/crypto/3descbc.c index 7bf1c836fc6..7966e34bb09 100644 --- a/testing/crypto/3descbc.c +++ b/testing/drivers/crypto/3descbc.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/crypto/3descbc.c + * apps/testing/drivers/crypto/3descbc.c * * SPDX-License-Identifier: BSD-2-Clause * SPDX-FileCopyrightText: 2002 Markus Friedl. All rights reserved. diff --git a/testing/crypto/CMakeLists.txt b/testing/drivers/crypto/CMakeLists.txt similarity index 98% rename from testing/crypto/CMakeLists.txt rename to testing/drivers/crypto/CMakeLists.txt index 76df6e7a63d..3918043a134 100644 --- a/testing/crypto/CMakeLists.txt +++ b/testing/drivers/crypto/CMakeLists.txt @@ -1,5 +1,5 @@ # ############################################################################## -# apps/testing/crypto/CMakeLists.txt +# apps/testing/drivers/crypto/CMakeLists.txt # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/crypto/Kconfig b/testing/drivers/crypto/Kconfig similarity index 100% rename from testing/crypto/Kconfig rename to testing/drivers/crypto/Kconfig diff --git a/testing/crypto/Make.defs b/testing/drivers/crypto/Make.defs similarity index 91% rename from testing/crypto/Make.defs rename to testing/drivers/crypto/Make.defs index 5d0dee36116..d75daad959f 100644 --- a/testing/crypto/Make.defs +++ b/testing/drivers/crypto/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/crypto/Make.defs +# apps/testing/drivers/crypto/Make.defs # # SPDX-License-Identifier: Apache-2.0 # @@ -21,5 +21,5 @@ ############################################################################ ifneq ($(CONFIG_TESTING_CRYPTO),) -CONFIGURED_APPS += $(APPDIR)/testing/crypto +CONFIGURED_APPS += $(APPDIR)/testing/drivers/crypto endif diff --git a/testing/crypto/Makefile b/testing/drivers/crypto/Makefile similarity index 98% rename from testing/crypto/Makefile rename to testing/drivers/crypto/Makefile index 825eac40782..64c6dfac744 100644 --- a/testing/crypto/Makefile +++ b/testing/drivers/crypto/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/crypto/Makefile +# apps/testing/drivers/crypto/Makefile # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/crypto/aescbc.c b/testing/drivers/crypto/aescbc.c similarity index 99% rename from testing/crypto/aescbc.c rename to testing/drivers/crypto/aescbc.c index 0c9f464ebdb..c807cb151ac 100644 --- a/testing/crypto/aescbc.c +++ b/testing/drivers/crypto/aescbc.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/crypto/aescbc.c + * apps/testing/drivers/crypto/aescbc.c * * SPDX-License-Identifier: ISC * SPDX-FileCopyrightText: 2005 Markus Friedl. All rights reserved. diff --git a/testing/crypto/aescmac.c b/testing/drivers/crypto/aescmac.c similarity index 99% rename from testing/crypto/aescmac.c rename to testing/drivers/crypto/aescmac.c index 0e0f57838ba..0874e99580f 100644 --- a/testing/crypto/aescmac.c +++ b/testing/drivers/crypto/aescmac.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/crypto/aescmac.c + * apps/testing/drivers/crypto/aescmac.c * * SPDX-License-Identifier: ISC * diff --git a/testing/crypto/aesctr.c b/testing/drivers/crypto/aesctr.c similarity index 99% rename from testing/crypto/aesctr.c rename to testing/drivers/crypto/aesctr.c index bf1d9914488..25bbc8600ad 100644 --- a/testing/crypto/aesctr.c +++ b/testing/drivers/crypto/aesctr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/crypto/aesctr.c + * apps/testing/drivers/crypto/aesctr.c * * SPDX-License-Identifier: ISC * SPDX-FileCopyrightText: 2005 Markus Friedl diff --git a/testing/crypto/aesxts.c b/testing/drivers/crypto/aesxts.c similarity index 99% rename from testing/crypto/aesxts.c rename to testing/drivers/crypto/aesxts.c index 1692af6bf32..bcae79ad43b 100644 --- a/testing/crypto/aesxts.c +++ b/testing/drivers/crypto/aesxts.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/crypto/aesxts.c + * apps/testing/drivers/crypto/aesxts.c * * SPDX-License-Identifier: BSD-2-Clause * SPDX-FileCopyrightText: 2002 Markus Friedl. All rights reserved. diff --git a/testing/crypto/crc32.c b/testing/drivers/crypto/crc32.c similarity index 99% rename from testing/crypto/crc32.c rename to testing/drivers/crypto/crc32.c index 9fa227c5d3d..f21fd8d2899 100644 --- a/testing/crypto/crc32.c +++ b/testing/drivers/crypto/crc32.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/crypto/crc32.c + * apps/testing/drivers/crypto/crc32.c * * SPDX-License-Identifier: ISC * diff --git a/testing/crypto/dhm.c b/testing/drivers/crypto/dhm.c similarity index 99% rename from testing/crypto/dhm.c rename to testing/drivers/crypto/dhm.c index 038376104d3..f1eafa2d786 100644 --- a/testing/crypto/dhm.c +++ b/testing/drivers/crypto/dhm.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/crypto/dhm.c + * apps/testing/drivers/crypto/dhm.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/crypto/ecdsa.c b/testing/drivers/crypto/ecdsa.c similarity index 99% rename from testing/crypto/ecdsa.c rename to testing/drivers/crypto/ecdsa.c index 007b93b778f..d97f7308bac 100644 --- a/testing/crypto/ecdsa.c +++ b/testing/drivers/crypto/ecdsa.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/crypto/ecdsa.c + * apps/testing/drivers/crypto/ecdsa.c * * SPDX-License-Identifier: ISC * diff --git a/testing/crypto/hash.c b/testing/drivers/crypto/hash.c similarity index 99% rename from testing/crypto/hash.c rename to testing/drivers/crypto/hash.c index 1c3d6e6eecd..a4688124e61 100644 --- a/testing/crypto/hash.c +++ b/testing/drivers/crypto/hash.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/crypto/hash.c + * apps/testing/drivers/crypto/hash.c * * SPDX-License-Identifier: ISC * diff --git a/testing/crypto/hmac.c b/testing/drivers/crypto/hmac.c similarity index 99% rename from testing/crypto/hmac.c rename to testing/drivers/crypto/hmac.c index 48ea6ae460f..10f0f12acf6 100644 --- a/testing/crypto/hmac.c +++ b/testing/drivers/crypto/hmac.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/crypto/hmac.c + * apps/testing/drivers/crypto/hmac.c * * SPDX-License-Identifier: ISC * SPDX-FileCopyrightText: 2008 Damien Bergamini diff --git a/testing/crypto/rsa.c b/testing/drivers/crypto/rsa.c similarity index 99% rename from testing/crypto/rsa.c rename to testing/drivers/crypto/rsa.c index e4fe7778a10..462aa2fc12d 100644 --- a/testing/crypto/rsa.c +++ b/testing/drivers/crypto/rsa.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/crypto/rsa.c + * apps/testing/drivers/crypto/rsa.c * * SPDX-License-Identifier: ISC * diff --git a/testing/setest/CMakeLists.txt b/testing/drivers/setest/CMakeLists.txt similarity index 96% rename from testing/setest/CMakeLists.txt rename to testing/drivers/setest/CMakeLists.txt index 27235b4351a..7f06251a020 100644 --- a/testing/setest/CMakeLists.txt +++ b/testing/drivers/setest/CMakeLists.txt @@ -1,5 +1,5 @@ # ############################################################################## -# apps/testing/setest/CMakeLists.txt +# apps/testing/drivers/setest/CMakeLists.txt # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/setest/Kconfig b/testing/drivers/setest/Kconfig similarity index 100% rename from testing/setest/Kconfig rename to testing/drivers/setest/Kconfig diff --git a/testing/setest/Make.defs b/testing/drivers/setest/Make.defs similarity index 91% rename from testing/setest/Make.defs rename to testing/drivers/setest/Make.defs index 701bb5f0aac..e2f7213d226 100644 --- a/testing/setest/Make.defs +++ b/testing/drivers/setest/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/setest/Make.defs +# apps/testing/drivers/setest/Make.defs # # SPDX-License-Identifier: Apache-2.0 # @@ -21,5 +21,5 @@ ############################################################################ ifneq ($(CONFIG_TESTING_SETEST),) -CONFIGURED_APPS += $(APPDIR)/testing/setest +CONFIGURED_APPS += $(APPDIR)/testing/drivers/setest endif diff --git a/testing/setest/Makefile b/testing/drivers/setest/Makefile similarity index 96% rename from testing/setest/Makefile rename to testing/drivers/setest/Makefile index 594455749f4..627bc5dc74e 100644 --- a/testing/setest/Makefile +++ b/testing/drivers/setest/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/setest/Makefile +# apps/testing/drivers/setest/Makefile # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/setest/setest.c b/testing/drivers/setest/setest.c similarity index 99% rename from testing/setest/setest.c rename to testing/drivers/setest/setest.c index f16fca4a18d..4ac3e3c8840 100644 --- a/testing/setest/setest.c +++ b/testing/drivers/setest/setest.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/setest/setest.c + * apps/testing/drivers/setest/setest.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/open_memstream/CMakeLists.txt b/testing/libc/open_memstream/CMakeLists.txt similarity index 95% rename from testing/open_memstream/CMakeLists.txt rename to testing/libc/open_memstream/CMakeLists.txt index 67a764030ff..b4bc301b268 100644 --- a/testing/open_memstream/CMakeLists.txt +++ b/testing/libc/open_memstream/CMakeLists.txt @@ -1,5 +1,5 @@ # ############################################################################## -# apps/testing/open_memstream/CMakeLists.txt +# apps/testing/libc/open_memstream/CMakeLists.txt # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/open_memstream/Kconfig b/testing/libc/open_memstream/Kconfig similarity index 100% rename from testing/open_memstream/Kconfig rename to testing/libc/open_memstream/Kconfig diff --git a/testing/open_memstream/Make.defs b/testing/libc/open_memstream/Make.defs similarity index 90% rename from testing/open_memstream/Make.defs rename to testing/libc/open_memstream/Make.defs index f16c7d494fd..f381082cc52 100644 --- a/testing/open_memstream/Make.defs +++ b/testing/libc/open_memstream/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/open_memstream/Make.defs +# apps/testing/libc/open_memstream/Make.defs # # SPDX-License-Identifier: Apache-2.0 # @@ -21,5 +21,5 @@ ############################################################################ ifneq ($(CONFIG_TESTING_OPEN_MEMSTREAM),) -CONFIGURED_APPS += $(APPDIR)/testing/open_memstream +CONFIGURED_APPS += $(APPDIR)/testing/libc/open_memstream endif diff --git a/testing/open_memstream/Makefile b/testing/libc/open_memstream/Makefile similarity index 96% rename from testing/open_memstream/Makefile rename to testing/libc/open_memstream/Makefile index 5759cac9f21..2882fb01079 100644 --- a/testing/open_memstream/Makefile +++ b/testing/libc/open_memstream/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/open_memstream/Makefile +# apps/testing/libc/open_memstream/Makefile # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/open_memstream/open_memstream.c b/testing/libc/open_memstream/open_memstream.c similarity index 99% rename from testing/open_memstream/open_memstream.c rename to testing/libc/open_memstream/open_memstream.c index b6f9d59c925..2c6e59177ca 100644 --- a/testing/open_memstream/open_memstream.c +++ b/testing/libc/open_memstream/open_memstream.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/open_memstream/open_memstream.c + * apps/testing/libc/open_memstream/open_memstream.c * * SPDX-License-Identifier: Apache-2.0 * From d7be1bd6727ce199e2fd1d516bdf8c6949ae806e Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Sun, 26 Jan 2025 16:04:09 +0800 Subject: [PATCH 168/391] testing: Move fs/fopencookie to libc Signed-off-by: Xiang Xiao --- testing/{fs => libc}/fopencookie/Kconfig | 0 testing/{fs => libc}/fopencookie/Make.defs | 4 ++-- testing/{fs => libc}/fopencookie/Makefile | 2 +- testing/{fs => libc}/fopencookie/fopencookie.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) rename testing/{fs => libc}/fopencookie/Kconfig (100%) rename testing/{fs => libc}/fopencookie/Make.defs (91%) rename testing/{fs => libc}/fopencookie/Makefile (96%) rename testing/{fs => libc}/fopencookie/fopencookie.c (99%) diff --git a/testing/fs/fopencookie/Kconfig b/testing/libc/fopencookie/Kconfig similarity index 100% rename from testing/fs/fopencookie/Kconfig rename to testing/libc/fopencookie/Kconfig diff --git a/testing/fs/fopencookie/Make.defs b/testing/libc/fopencookie/Make.defs similarity index 91% rename from testing/fs/fopencookie/Make.defs rename to testing/libc/fopencookie/Make.defs index 70ab59fee93..b83a28cde75 100644 --- a/testing/fs/fopencookie/Make.defs +++ b/testing/libc/fopencookie/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/fs/fopencookie/Make.defs +# apps/testing/libc/fopencookie/Make.defs # # SPDX-License-Identifier: Apache-2.0 # @@ -21,5 +21,5 @@ ############################################################################ ifneq ($(CONFIG_TESTING_FOPENCOOKIE_TEST),) -CONFIGURED_APPS += $(APPDIR)/testing/fs/fopencookie +CONFIGURED_APPS += $(APPDIR)/testing/libc/fopencookie endif diff --git a/testing/fs/fopencookie/Makefile b/testing/libc/fopencookie/Makefile similarity index 96% rename from testing/fs/fopencookie/Makefile rename to testing/libc/fopencookie/Makefile index 6ad0d6d9364..a9752816085 100644 --- a/testing/fs/fopencookie/Makefile +++ b/testing/libc/fopencookie/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/fs/fopencookie/Makefile +# apps/testing/libc/fopencookie/Makefile # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/fs/fopencookie/fopencookie.c b/testing/libc/fopencookie/fopencookie.c similarity index 99% rename from testing/fs/fopencookie/fopencookie.c rename to testing/libc/fopencookie/fopencookie.c index 02d943c2639..46ce595fdd3 100644 --- a/testing/fs/fopencookie/fopencookie.c +++ b/testing/libc/fopencookie/fopencookie.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/fs/fopencookie/fopencookie.c + * apps/testing/libc/fopencookie/fopencookie.c * * SPDX-License-Identifier: Apache-2.0 * From 4e9d907677e5be7049ce3453a53c890d5a2d4592 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Sun, 26 Jan 2025 16:05:36 +0800 Subject: [PATCH 169/391] testing: Move rpmsgdev to drivers/rpmsgdev Signed-off-by: Xiang Xiao --- testing/{ => drivers}/rpmsgdev/CMakeLists.txt | 2 +- testing/{ => drivers}/rpmsgdev/Kconfig | 0 testing/{ => drivers}/rpmsgdev/Make.defs | 4 ++-- testing/{ => drivers}/rpmsgdev/Makefile | 2 +- testing/{ => drivers}/rpmsgdev/testdev.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) rename testing/{ => drivers}/rpmsgdev/CMakeLists.txt (96%) rename testing/{ => drivers}/rpmsgdev/Kconfig (100%) rename testing/{ => drivers}/rpmsgdev/Make.defs (91%) rename testing/{ => drivers}/rpmsgdev/Makefile (96%) rename testing/{ => drivers}/rpmsgdev/testdev.c (99%) diff --git a/testing/rpmsgdev/CMakeLists.txt b/testing/drivers/rpmsgdev/CMakeLists.txt similarity index 96% rename from testing/rpmsgdev/CMakeLists.txt rename to testing/drivers/rpmsgdev/CMakeLists.txt index 1f6dcb0d1eb..7a90ece3e55 100644 --- a/testing/rpmsgdev/CMakeLists.txt +++ b/testing/drivers/rpmsgdev/CMakeLists.txt @@ -1,5 +1,5 @@ # ############################################################################## -# apps/testing/rpmsgdev/CMakeLists.txt +# apps/testing/drivers/rpmsgdev/CMakeLists.txt # # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for diff --git a/testing/rpmsgdev/Kconfig b/testing/drivers/rpmsgdev/Kconfig similarity index 100% rename from testing/rpmsgdev/Kconfig rename to testing/drivers/rpmsgdev/Kconfig diff --git a/testing/rpmsgdev/Make.defs b/testing/drivers/rpmsgdev/Make.defs similarity index 91% rename from testing/rpmsgdev/Make.defs rename to testing/drivers/rpmsgdev/Make.defs index 686d1e63975..5fcf07d5688 100644 --- a/testing/rpmsgdev/Make.defs +++ b/testing/drivers/rpmsgdev/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/rpmsgdev/Make.defs +# apps/testing/drivers/rpmsgdev/Make.defs # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with @@ -19,5 +19,5 @@ ############################################################################ ifneq ($(CONFIG_RPMSGDEV_TEST),) -CONFIGURED_APPS += $(APPDIR)/testing/rpmsgdev +CONFIGURED_APPS += $(APPDIR)/testing/drivers/rpmsgdev endif diff --git a/testing/rpmsgdev/Makefile b/testing/drivers/rpmsgdev/Makefile similarity index 96% rename from testing/rpmsgdev/Makefile rename to testing/drivers/rpmsgdev/Makefile index 771e9ef8545..464a9cf6d6f 100644 --- a/testing/rpmsgdev/Makefile +++ b/testing/drivers/rpmsgdev/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/rpmsgdev/Makefile +# apps/testing/drivers/rpmsgdev/Makefile # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with diff --git a/testing/rpmsgdev/testdev.c b/testing/drivers/rpmsgdev/testdev.c similarity index 99% rename from testing/rpmsgdev/testdev.c rename to testing/drivers/rpmsgdev/testdev.c index f370c4302a3..15a618a2468 100644 --- a/testing/rpmsgdev/testdev.c +++ b/testing/drivers/rpmsgdev/testdev.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/rpmsgdev/testdev.c + * apps/testing/drivers/rpmsgdev/testdev.c * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with From 85a6aaa32234b9cff0e7a1b14408ff07da98c110 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Sun, 26 Jan 2025 15:46:38 +0800 Subject: [PATCH 170/391] apps/testing: Move irtest/sensortest/resmonitor/monkey to apps/system Signed-off-by: Xiang Xiao --- {testing => system}/irtest/CMakeLists.txt | 12 ++--- {testing => system}/irtest/Kconfig | 14 ++--- {testing => system}/irtest/Make.defs | 4 +- {testing => system}/irtest/Makefile | 10 ++-- {testing => system}/irtest/cmd.cxx | 54 +++++++++---------- {testing => system}/irtest/cmd.hpp | 8 +-- {testing => system}/irtest/enum.cxx | 2 +- {testing => system}/irtest/enum.hpp | 8 +-- {testing => system}/irtest/main.cxx | 2 +- {testing => system}/monkey/CMakeLists.txt | 10 ++-- {testing => system}/monkey/Kconfig | 10 ++-- {testing => system}/monkey/Make.defs | 6 +-- {testing => system}/monkey/Makefile | 8 +-- {testing => system}/monkey/monkey.c | 2 +- {testing => system}/monkey/monkey.h | 8 +-- {testing => system}/monkey/monkey_assert.h | 8 +-- {testing => system}/monkey/monkey_dev.c | 2 +- {testing => system}/monkey/monkey_dev.h | 8 +-- {testing => system}/monkey/monkey_event.c | 2 +- {testing => system}/monkey/monkey_event.h | 8 +-- {testing => system}/monkey/monkey_log.c | 2 +- {testing => system}/monkey/monkey_log.h | 8 +-- {testing => system}/monkey/monkey_main.c | 4 +- {testing => system}/monkey/monkey_proc.c | 2 +- {testing => system}/monkey/monkey_recorder.c | 2 +- {testing => system}/monkey/monkey_recorder.h | 8 +-- {testing => system}/monkey/monkey_type.h | 8 +-- {testing => system}/monkey/monkey_utils.c | 2 +- {testing => system}/monkey/monkey_utils.h | 8 +-- {testing => system}/resmonitor/CMakeLists.txt | 22 ++++---- {testing => system}/resmonitor/Kconfig | 10 ++-- .../resmonitor}/Make.defs | 6 +-- {testing => system}/resmonitor/Makefile | 10 ++-- {testing => system}/resmonitor/fillcpu.c | 2 +- {testing => system}/resmonitor/filldisk.c | 2 +- {testing => system}/resmonitor/fillmem.c | 2 +- {testing => system}/resmonitor/showinfo.c | 2 +- {testing => system}/sensortest/CMakeLists.txt | 12 ++--- {testing => system}/sensortest/Kconfig | 10 ++-- .../sensortest}/Make.defs | 6 +-- {testing => system}/sensortest/Makefile | 10 ++-- {testing => system}/sensortest/sensortest.c | 2 +- 42 files changed, 163 insertions(+), 163 deletions(-) rename {testing => system}/irtest/CMakeLists.txt (85%) rename {testing => system}/irtest/Kconfig (76%) rename {testing => system}/irtest/Make.defs (93%) rename {testing => system}/irtest/Makefile (84%) rename {testing => system}/irtest/cmd.cxx (88%) rename {testing => system}/irtest/cmd.hpp (97%) rename {testing => system}/irtest/enum.cxx (98%) rename {testing => system}/irtest/enum.hpp (94%) rename {testing => system}/irtest/main.cxx (98%) rename {testing => system}/monkey/CMakeLists.txt (87%) rename {testing => system}/monkey/Kconfig (72%) rename {testing => system}/monkey/Make.defs (89%) rename {testing => system}/monkey/Makefile (88%) rename {testing => system}/monkey/monkey.c (99%) rename {testing => system}/monkey/monkey.h (95%) rename {testing => system}/monkey/monkey_assert.h (89%) rename {testing => system}/monkey/monkey_dev.c (99%) rename {testing => system}/monkey/monkey_dev.h (95%) rename {testing => system}/monkey/monkey_event.c (99%) rename {testing => system}/monkey/monkey_event.h (94%) rename {testing => system}/monkey/monkey_log.c (98%) rename {testing => system}/monkey/monkey_log.h (95%) rename {testing => system}/monkey/monkey_main.c (99%) rename {testing => system}/monkey/monkey_proc.c (99%) rename {testing => system}/monkey/monkey_recorder.c (99%) rename {testing => system}/monkey/monkey_recorder.h (95%) rename {testing => system}/monkey/monkey_type.h (94%) rename {testing => system}/monkey/monkey_utils.c (99%) rename {testing => system}/monkey/monkey_utils.h (95%) rename {testing => system}/resmonitor/CMakeLists.txt (75%) rename {testing => system}/resmonitor/Kconfig (74%) rename {testing/sensortest => system/resmonitor}/Make.defs (88%) rename {testing => system}/resmonitor/Makefile (85%) rename {testing => system}/resmonitor/fillcpu.c (99%) rename {testing => system}/resmonitor/filldisk.c (99%) rename {testing => system}/resmonitor/fillmem.c (99%) rename {testing => system}/resmonitor/showinfo.c (99%) rename {testing => system}/sensortest/CMakeLists.txt (82%) rename {testing => system}/sensortest/Kconfig (77%) rename {testing/resmonitor => system/sensortest}/Make.defs (88%) rename {testing => system}/sensortest/Makefile (82%) rename {testing => system}/sensortest/sensortest.c (99%) diff --git a/testing/irtest/CMakeLists.txt b/system/irtest/CMakeLists.txt similarity index 85% rename from testing/irtest/CMakeLists.txt rename to system/irtest/CMakeLists.txt index 6975046ff2f..991352bf20d 100644 --- a/testing/irtest/CMakeLists.txt +++ b/system/irtest/CMakeLists.txt @@ -1,5 +1,5 @@ # ############################################################################## -# apps/testing/irtest/CMakeLists.txt +# apps/system/irtest/CMakeLists.txt # # SPDX-License-Identifier: Apache-2.0 # @@ -20,19 +20,19 @@ # # ############################################################################## -if(CONFIG_TESTING_IRTEST) +if(CONFIG_SYSTEM_IRTEST) file(GLOB CURRENT_SRCS *.cxx) list(REMOVE_ITEM CURRENT_SRCS main.cxx) set(SRCS main.cxx ${CURRENT_SRCS}) nuttx_add_application( NAME - ${CONFIG_TESTING_IRTEST_PROGNAME} + ${CONFIG_SYSTEM_IRTEST_PROGNAME} PRIORITY - ${CONFIG_TESTING_IRTEST_PRIORITY} + ${CONFIG_SYSTEM_IRTEST_PRIORITY} STACKSIZE - ${CONFIG_TESTING_IRTEST_STACKSIZE} + ${CONFIG_SYSTEM_IRTEST_STACKSIZE} MODULE - ${CONFIG_TESTING_IRTEST} + ${CONFIG_SYSTEM_IRTEST} SRCS ${SRCS}) endif() diff --git a/testing/irtest/Kconfig b/system/irtest/Kconfig similarity index 76% rename from testing/irtest/Kconfig rename to system/irtest/Kconfig index 01e23d368ae..34743bb87bc 100644 --- a/testing/irtest/Kconfig +++ b/system/irtest/Kconfig @@ -3,35 +3,35 @@ # see the file kconfig-language.txt in the NuttX tools repository. # -config TESTING_IRTEST +config SYSTEM_IRTEST tristate "IR driver test" default n depends on DRIVERS_RC ---help--- Enable the IR driver test -if TESTING_IRTEST +if SYSTEM_IRTEST -config TESTING_IRTEST_PROGNAME +config SYSTEM_IRTEST_PROGNAME string "Program name" default "irtest" ---help--- This is the name of the program that will be used when the NSH ELF program is installed. -config TESTING_IRTEST_PRIORITY +config SYSTEM_IRTEST_PRIORITY int "IR driver test task priority" default 100 -config TESTING_IRTEST_STACKSIZE +config SYSTEM_IRTEST_STACKSIZE int "IR driver test stack size" default DEFAULT_TASK_STACKSIZE -config TESTING_IRTEST_MAX_NIRDEV +config SYSTEM_IRTEST_MAX_NIRDEV int "The Maximum number of IR devices supported" default 2 -config TESTING_IRTEST_MAX_SIRDATA +config SYSTEM_IRTEST_MAX_SIRDATA int "The Maximum size of sending data in unsigned int" default 64 diff --git a/testing/irtest/Make.defs b/system/irtest/Make.defs similarity index 93% rename from testing/irtest/Make.defs rename to system/irtest/Make.defs index 4bd5f37e7da..f5588fcb22f 100644 --- a/testing/irtest/Make.defs +++ b/system/irtest/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/irtest/Make.defs +# apps/system/irtest/Make.defs # # SPDX-License-Identifier: Apache-2.0 # @@ -20,6 +20,6 @@ # ############################################################################ -ifneq ($(CONFIG_TESTING_IRTEST),) +ifneq ($(CONFIG_SYSTEM_IRTEST),) CONFIGURED_APPS += $(APPDIR)/testing/irtest endif diff --git a/testing/irtest/Makefile b/system/irtest/Makefile similarity index 84% rename from testing/irtest/Makefile rename to system/irtest/Makefile index 28d7b20c11d..a4dc50a9ca3 100644 --- a/testing/irtest/Makefile +++ b/system/irtest/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/irtest/Makefile +# apps/system/irtest/Makefile # # SPDX-License-Identifier: Apache-2.0 # @@ -22,10 +22,10 @@ include $(APPDIR)/Make.defs -PROGNAME = $(CONFIG_TESTING_IRTEST_PROGNAME) -PRIORITY = $(CONFIG_TESTING_IRTEST_PRIORITY) -STACKSIZE = $(CONFIG_TESTING_IRTEST_STACKSIZE) -MODULE = $(CONFIG_TESTING_IRTEST) +PROGNAME = $(CONFIG_SYSTEM_IRTEST_PROGNAME) +PRIORITY = $(CONFIG_SYSTEM_IRTEST_PRIORITY) +STACKSIZE = $(CONFIG_SYSTEM_IRTEST_STACKSIZE) +MODULE = $(CONFIG_SYSTEM_IRTEST) MAINSRC = main.cxx CXXSRCS = $(filter-out $(MAINSRC), $(wildcard *.cxx)) diff --git a/testing/irtest/cmd.cxx b/system/irtest/cmd.cxx similarity index 88% rename from testing/irtest/cmd.cxx rename to system/irtest/cmd.cxx index 867864a47b0..d61527df7d8 100644 --- a/testing/irtest/cmd.cxx +++ b/system/irtest/cmd.cxx @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/irtest/cmd.cxx + * apps/system/irtest/cmd.cxx * * SPDX-License-Identifier: Apache-2.0 * @@ -46,7 +46,7 @@ static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; static pthread_cond_t cond = PTHREAD_COND_INITIALIZER; -static int g_irdevs[CONFIG_TESTING_IRTEST_MAX_NIRDEV]; +static int g_irdevs[CONFIG_SYSTEM_IRTEST_MAX_NIRDEV]; /**************************************************************************** * Private Functions @@ -190,7 +190,7 @@ CMD1(open_device, const char *, file_name) } int index = 0; - for (; index < CONFIG_TESTING_IRTEST_MAX_NIRDEV; index++) + for (; index < CONFIG_SYSTEM_IRTEST_MAX_NIRDEV; index++) { if (g_irdevs[index] == -1) { @@ -199,7 +199,7 @@ CMD1(open_device, const char *, file_name) } } - if (index == CONFIG_TESTING_IRTEST_MAX_NIRDEV) + if (index == CONFIG_SYSTEM_IRTEST_MAX_NIRDEV) { return ERROR; } @@ -209,7 +209,7 @@ CMD1(open_device, const char *, file_name) CMD1(close_device, size_t, index) { - if (index >= CONFIG_TESTING_IRTEST_MAX_NIRDEV) + if (index >= CONFIG_SYSTEM_IRTEST_MAX_NIRDEV) { return ERROR; } @@ -226,15 +226,15 @@ CMD1(close_device, size_t, index) CMD1(write_data, size_t, index) { - unsigned int data[CONFIG_TESTING_IRTEST_MAX_SIRDATA]; + unsigned int data[CONFIG_SYSTEM_IRTEST_MAX_SIRDATA]; - if (index >= CONFIG_TESTING_IRTEST_MAX_NIRDEV) + if (index >= CONFIG_SYSTEM_IRTEST_MAX_NIRDEV) { return ERROR; } int size = 0; - for (; size < CONFIG_TESTING_IRTEST_MAX_SIRDATA; size++) + for (; size < CONFIG_SYSTEM_IRTEST_MAX_SIRDATA; size++) { unsigned int tmp = get_next_arg < unsigned int > (); if (tmp == 0) @@ -263,7 +263,7 @@ CMD1(write_data, size_t, index) CMD2(read_data, size_t, index, size_t, size) { - if (index >= CONFIG_TESTING_IRTEST_MAX_NIRDEV) + if (index >= CONFIG_SYSTEM_IRTEST_MAX_NIRDEV) { return ERROR; } @@ -291,7 +291,7 @@ CMD2(read_data, size_t, index, size_t, size) CMD1(get_features, size_t, index) { - if (index >= CONFIG_TESTING_IRTEST_MAX_NIRDEV) + if (index >= CONFIG_SYSTEM_IRTEST_MAX_NIRDEV) { return ERROR; } @@ -308,7 +308,7 @@ CMD1(get_features, size_t, index) CMD1(get_send_mode, size_t, index) { - if (index >= CONFIG_TESTING_IRTEST_MAX_NIRDEV) + if (index >= CONFIG_SYSTEM_IRTEST_MAX_NIRDEV) { return ERROR; } @@ -325,7 +325,7 @@ CMD1(get_send_mode, size_t, index) CMD1(get_rec_mode, size_t, index) { - if (index >= CONFIG_TESTING_IRTEST_MAX_NIRDEV) + if (index >= CONFIG_SYSTEM_IRTEST_MAX_NIRDEV) { return ERROR; } @@ -342,7 +342,7 @@ CMD1(get_rec_mode, size_t, index) CMD1(get_rec_resolution, size_t, index) { - if (index >= CONFIG_TESTING_IRTEST_MAX_NIRDEV) + if (index >= CONFIG_SYSTEM_IRTEST_MAX_NIRDEV) { return ERROR; } @@ -359,7 +359,7 @@ CMD1(get_rec_resolution, size_t, index) CMD1(get_min_timeout, size_t, index) { - if (index >= CONFIG_TESTING_IRTEST_MAX_NIRDEV) + if (index >= CONFIG_SYSTEM_IRTEST_MAX_NIRDEV) { return ERROR; } @@ -376,7 +376,7 @@ CMD1(get_min_timeout, size_t, index) CMD1(get_max_timeout, size_t, index) { - if (index >= CONFIG_TESTING_IRTEST_MAX_NIRDEV) + if (index >= CONFIG_SYSTEM_IRTEST_MAX_NIRDEV) { return ERROR; } @@ -393,7 +393,7 @@ CMD1(get_max_timeout, size_t, index) CMD1(get_length, size_t, index) { - if (index >= CONFIG_TESTING_IRTEST_MAX_NIRDEV) + if (index >= CONFIG_SYSTEM_IRTEST_MAX_NIRDEV) { return ERROR; } @@ -410,7 +410,7 @@ CMD1(get_length, size_t, index) CMD2(set_send_mode, size_t, index, unsigned int, mode) { - if (index >= CONFIG_TESTING_IRTEST_MAX_NIRDEV) + if (index >= CONFIG_SYSTEM_IRTEST_MAX_NIRDEV) { return ERROR; } @@ -420,7 +420,7 @@ CMD2(set_send_mode, size_t, index, unsigned int, mode) CMD2(set_rec_mode, size_t, index, unsigned int, mode) { - if (index >= CONFIG_TESTING_IRTEST_MAX_NIRDEV) + if (index >= CONFIG_SYSTEM_IRTEST_MAX_NIRDEV) { return ERROR; } @@ -430,7 +430,7 @@ CMD2(set_rec_mode, size_t, index, unsigned int, mode) CMD2(set_send_carrier, size_t, index, unsigned int, carrier) { - if (index >= CONFIG_TESTING_IRTEST_MAX_NIRDEV) + if (index >= CONFIG_SYSTEM_IRTEST_MAX_NIRDEV) { return ERROR; } @@ -440,7 +440,7 @@ CMD2(set_send_carrier, size_t, index, unsigned int, carrier) CMD2(set_rec_carrier, size_t, index, unsigned int, carrier) { - if (index >= CONFIG_TESTING_IRTEST_MAX_NIRDEV) + if (index >= CONFIG_SYSTEM_IRTEST_MAX_NIRDEV) { return ERROR; } @@ -450,7 +450,7 @@ CMD2(set_rec_carrier, size_t, index, unsigned int, carrier) CMD2(set_send_duty_cycle, size_t, index, unsigned int, duty_cycle) { - if (index >= CONFIG_TESTING_IRTEST_MAX_NIRDEV) + if (index >= CONFIG_SYSTEM_IRTEST_MAX_NIRDEV) { return ERROR; } @@ -460,7 +460,7 @@ CMD2(set_send_duty_cycle, size_t, index, unsigned int, duty_cycle) CMD2(set_transmitter_mask, size_t, index, unsigned int, mask) { - if (index >= CONFIG_TESTING_IRTEST_MAX_NIRDEV) + if (index >= CONFIG_SYSTEM_IRTEST_MAX_NIRDEV) { return ERROR; } @@ -470,7 +470,7 @@ CMD2(set_transmitter_mask, size_t, index, unsigned int, mask) CMD2(set_rec_timeout, size_t, index, unsigned int, timeout) { - if (index >= CONFIG_TESTING_IRTEST_MAX_NIRDEV) + if (index >= CONFIG_SYSTEM_IRTEST_MAX_NIRDEV) { return ERROR; } @@ -480,7 +480,7 @@ CMD2(set_rec_timeout, size_t, index, unsigned int, timeout) CMD2(set_rec_timeout_reports, size_t, index, unsigned int, enable) { - if (index >= CONFIG_TESTING_IRTEST_MAX_NIRDEV) + if (index >= CONFIG_SYSTEM_IRTEST_MAX_NIRDEV) { return ERROR; } @@ -490,7 +490,7 @@ CMD2(set_rec_timeout_reports, size_t, index, unsigned int, enable) CMD2(set_measure_carrier_mode, size_t, index, unsigned int, enable) { - if (index >= CONFIG_TESTING_IRTEST_MAX_NIRDEV) + if (index >= CONFIG_SYSTEM_IRTEST_MAX_NIRDEV) { return ERROR; } @@ -500,7 +500,7 @@ CMD2(set_measure_carrier_mode, size_t, index, unsigned int, enable) CMD2(set_rec_carrier_range, size_t, index, unsigned int, carrier) { - if (index >= CONFIG_TESTING_IRTEST_MAX_NIRDEV) + if (index >= CONFIG_SYSTEM_IRTEST_MAX_NIRDEV) { return ERROR; } @@ -514,7 +514,7 @@ CMD2(set_rec_carrier_range, size_t, index, unsigned int, carrier) void init_device() { - for (int i = 0; i < CONFIG_TESTING_IRTEST_MAX_NIRDEV; i++) + for (int i = 0; i < CONFIG_SYSTEM_IRTEST_MAX_NIRDEV; i++) g_irdevs[i] = -1; } diff --git a/testing/irtest/cmd.hpp b/system/irtest/cmd.hpp similarity index 97% rename from testing/irtest/cmd.hpp rename to system/irtest/cmd.hpp index d1f96fcdf74..da4b07f571b 100644 --- a/testing/irtest/cmd.hpp +++ b/system/irtest/cmd.hpp @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/irtest/cmd.hpp + * apps/system/irtest/cmd.hpp * * SPDX-License-Identifier: Apache-2.0 * @@ -20,8 +20,8 @@ * ****************************************************************************/ -#ifndef __APPS_TESTING_IRTEST_CMD_HPP -#define __APPS_TESTING_IRTEST_CMD_HPP +#ifndef __APPS_SYSTEM_IRTEST_CMD_HPP +#define __APPS_SYSTEM_IRTEST_CMD_HPP /**************************************************************************** * Included Files @@ -179,4 +179,4 @@ inline float get_next_arg() void init_device(); -#endif /* __APPS_TESTING_IRTEST_CMD_H */ +#endif /* __APPS_SYSTEM_IRTEST_CMD_H */ diff --git a/testing/irtest/enum.cxx b/system/irtest/enum.cxx similarity index 98% rename from testing/irtest/enum.cxx rename to system/irtest/enum.cxx index 1c3b58afdf4..912817c0f63 100644 --- a/testing/irtest/enum.cxx +++ b/system/irtest/enum.cxx @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/irtest/enum.cxx + * apps/system/irtest/enum.cxx * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/irtest/enum.hpp b/system/irtest/enum.hpp similarity index 94% rename from testing/irtest/enum.hpp rename to system/irtest/enum.hpp index 77c7120216b..98788000a73 100644 --- a/testing/irtest/enum.hpp +++ b/system/irtest/enum.hpp @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/irtest/enum.hpp + * apps/system/irtest/enum.hpp * * SPDX-License-Identifier: Apache-2.0 * @@ -20,8 +20,8 @@ * ****************************************************************************/ -#ifndef __APPS_TESTING_IRTEST_ENUM_HPP -#define __APPS_TESTING_IRTEST_ENUM_HPP +#ifndef __APPS_SYSTEM_IRTEST_ENUM_HPP +#define __APPS_SYSTEM_IRTEST_ENUM_HPP /**************************************************************************** * Included Files @@ -71,4 +71,4 @@ struct enum_type extern const struct enum_type *g_enum_table[]; -#endif /* __APPS_TESTING_IRTEST_ENUM_H */ +#endif /* __APPS_SYSTEM_IRTEST_ENUM_H */ diff --git a/testing/irtest/main.cxx b/system/irtest/main.cxx similarity index 98% rename from testing/irtest/main.cxx rename to system/irtest/main.cxx index 9ea7a144745..d8534aae6a7 100644 --- a/testing/irtest/main.cxx +++ b/system/irtest/main.cxx @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/irtest/main.cxx + * apps/system/irtest/main.cxx * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/monkey/CMakeLists.txt b/system/monkey/CMakeLists.txt similarity index 87% rename from testing/monkey/CMakeLists.txt rename to system/monkey/CMakeLists.txt index d3649c24f90..ec7ab1e9184 100644 --- a/testing/monkey/CMakeLists.txt +++ b/system/monkey/CMakeLists.txt @@ -1,5 +1,5 @@ # ############################################################################## -# apps/testing/monkey/CMakeLists.txt +# apps/system/monkey/CMakeLists.txt # # SPDX-License-Identifier: Apache-2.0 # @@ -20,7 +20,7 @@ # # ############################################################################## -if(CONFIG_TESTING_MONKEY) +if(CONFIG_SYSTEM_MONKEY) file(GLOB CURRENT_SRCS *.c) list(REMOVE_ITEM CURRENT_SRCS monkey_main.c) set(SRCS monkey_main.c ${CURRENT_SRCS}) @@ -28,11 +28,11 @@ if(CONFIG_TESTING_MONKEY) NAME monkey PRIORITY - ${CONFIG_TESTING_MONKEY_PRIORITY} + ${CONFIG_SYSTEM_MONKEY_PRIORITY} STACKSIZE - ${CONFIG_TESTING_MONKEY_STACKSIZE} + ${CONFIG_SYSTEM_MONKEY_STACKSIZE} MODULE - ${CONFIG_TESTING_MONKEY} + ${CONFIG_SYSTEM_MONKEY} SRCS ${SRCS}) endif() diff --git a/testing/monkey/Kconfig b/system/monkey/Kconfig similarity index 72% rename from testing/monkey/Kconfig rename to system/monkey/Kconfig index 10f511a85bc..9c84a040f7d 100644 --- a/testing/monkey/Kconfig +++ b/system/monkey/Kconfig @@ -3,24 +3,24 @@ # see the file kconfig-language.txt in the NuttX tools repository. # -menuconfig TESTING_MONKEY +menuconfig SYSTEM_MONKEY tristate "Monkey test" select UINPUT_TOUCH select UINPUT_BUTTONS select LIBC_PRINT_EXTENSION default n -if TESTING_MONKEY +if SYSTEM_MONKEY -config TESTING_MONKEY_PRIORITY +config SYSTEM_MONKEY_PRIORITY int "Task priority" default 110 -config TESTING_MONKEY_STACKSIZE +config SYSTEM_MONKEY_STACKSIZE int "Stack size" default 4096 -config TESTING_MONKEY_REC_DIR_PATH +config SYSTEM_MONKEY_REC_DIR_PATH string "Recorder directory path" default "/data/monkey" diff --git a/testing/monkey/Make.defs b/system/monkey/Make.defs similarity index 89% rename from testing/monkey/Make.defs rename to system/monkey/Make.defs index dbad681de85..21e780a7713 100644 --- a/testing/monkey/Make.defs +++ b/system/monkey/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/monkey/Make.defs +# apps/system/monkey/Make.defs # # SPDX-License-Identifier: Apache-2.0 # @@ -20,6 +20,6 @@ # ############################################################################ -ifneq ($(CONFIG_TESTING_MONKEY),) -CONFIGURED_APPS += $(APPDIR)/testing/monkey +ifneq ($(CONFIG_SYSTEM_MONKEY),) +CONFIGURED_APPS += $(APPDIR)/system/monkey endif diff --git a/testing/monkey/Makefile b/system/monkey/Makefile similarity index 88% rename from testing/monkey/Makefile rename to system/monkey/Makefile index 0f572a3545f..e7a26a16f18 100644 --- a/testing/monkey/Makefile +++ b/system/monkey/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/monkey/Makefile +# apps/system/monkey/Makefile # # SPDX-License-Identifier: Apache-2.0 # @@ -25,9 +25,9 @@ include $(APPDIR)/Make.defs # Monkey test example PROGNAME = monkey -PRIORITY = $(CONFIG_TESTING_MONKEY_PRIORITY) -STACKSIZE = $(CONFIG_TESTING_MONKEY_STACKSIZE) -MODULE = $(CONFIG_TESTING_MONKEY) +PRIORITY = $(CONFIG_SYSTEM_MONKEY_PRIORITY) +STACKSIZE = $(CONFIG_SYSTEM_MONKEY_STACKSIZE) +MODULE = $(CONFIG_SYSTEM_MONKEY) MAINSRC = monkey_main.c diff --git a/testing/monkey/monkey.c b/system/monkey/monkey.c similarity index 99% rename from testing/monkey/monkey.c rename to system/monkey/monkey.c index 770c59d51e0..30a92aaa6fc 100644 --- a/testing/monkey/monkey.c +++ b/system/monkey/monkey.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/monkey/monkey.c + * apps/system/monkey/monkey.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/monkey/monkey.h b/system/monkey/monkey.h similarity index 95% rename from testing/monkey/monkey.h rename to system/monkey/monkey.h index b53771a1c2b..b86c0d122f4 100644 --- a/testing/monkey/monkey.h +++ b/system/monkey/monkey.h @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/monkey/monkey.h + * apps/system/monkey/monkey.h * * SPDX-License-Identifier: Apache-2.0 * @@ -20,8 +20,8 @@ * ****************************************************************************/ -#ifndef __APPS_TESTING_MONKEY_MONKEY_H -#define __APPS_TESTING_MONKEY_MONKEY_H +#ifndef __APPS_SYSTEM_MONKEY_MONKEY_H +#define __APPS_SYSTEM_MONKEY_MONKEY_H /**************************************************************************** * Included Files @@ -97,4 +97,4 @@ bool monkey_set_recorder_path(FAR struct monkey_s *monkey, } #endif -#endif /* __APPS_TESTING_MONKEY_MONKEY_H */ +#endif /* __APPS_SYSTEM_MONKEY_MONKEY_H */ diff --git a/testing/monkey/monkey_assert.h b/system/monkey/monkey_assert.h similarity index 89% rename from testing/monkey/monkey_assert.h rename to system/monkey/monkey_assert.h index 51d4fd07ced..e11773b858e 100644 --- a/testing/monkey/monkey_assert.h +++ b/system/monkey/monkey_assert.h @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/monkey/monkey_assert.h + * apps/system/monkey/monkey_assert.h * * SPDX-License-Identifier: Apache-2.0 * @@ -20,8 +20,8 @@ * ****************************************************************************/ -#ifndef __APPS_TESTING_MONKEY_MONKEY_ASSERT_H -#define __APPS_TESTING_MONKEY_MONKEY_ASSERT_H +#ifndef __APPS_SYSTEM_MONKEY_MONKEY_ASSERT_H +#define __APPS_SYSTEM_MONKEY_MONKEY_ASSERT_H /**************************************************************************** * Included Files @@ -36,4 +36,4 @@ #define MONKEY_ASSERT(expr) DEBUGASSERT(expr) #define MONKEY_ASSERT_NULL(ptr) MONKEY_ASSERT(ptr != NULL) -#endif /* __APPS_TESTING_MONKEY_MONKEY_ASSERT_H */ +#endif /* __APPS_SYSTEM_MONKEY_MONKEY_ASSERT_H */ diff --git a/testing/monkey/monkey_dev.c b/system/monkey/monkey_dev.c similarity index 99% rename from testing/monkey/monkey_dev.c rename to system/monkey/monkey_dev.c index 7f196684028..ce3d8e05be6 100644 --- a/testing/monkey/monkey_dev.c +++ b/system/monkey/monkey_dev.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/monkey/monkey_dev.c + * apps/system/monkey/monkey_dev.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/monkey/monkey_dev.h b/system/monkey/monkey_dev.h similarity index 95% rename from testing/monkey/monkey_dev.h rename to system/monkey/monkey_dev.h index b7b61944e4f..dc5dfb7c29b 100644 --- a/testing/monkey/monkey_dev.h +++ b/system/monkey/monkey_dev.h @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/monkey/monkey_dev.h + * apps/system/monkey/monkey_dev.h * * SPDX-License-Identifier: Apache-2.0 * @@ -20,8 +20,8 @@ * ****************************************************************************/ -#ifndef __APPS_TESTING_MONKEY_MONKEY_DEV_H -#define __APPS_TESTING_MONKEY_MONKEY_DEV_H +#ifndef __APPS_SYSTEM_MONKEY_MONKEY_DEV_H +#define __APPS_SYSTEM_MONKEY_MONKEY_DEV_H /**************************************************************************** * Included Files @@ -96,4 +96,4 @@ int monkey_dev_get_available(FAR struct monkey_dev_s *devs[], int dev_num); } #endif -#endif /* __APPS_TESTING_MONKEY_MONKEY_DEV_H */ +#endif /* __APPS_SYSTEM_MONKEY_MONKEY_DEV_H */ diff --git a/testing/monkey/monkey_event.c b/system/monkey/monkey_event.c similarity index 99% rename from testing/monkey/monkey_event.c rename to system/monkey/monkey_event.c index 745d452468a..fc0149bf312 100644 --- a/testing/monkey/monkey_event.c +++ b/system/monkey/monkey_event.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/monkey/monkey_event.c + * apps/system/monkey/monkey_event.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/monkey/monkey_event.h b/system/monkey/monkey_event.h similarity index 94% rename from testing/monkey/monkey_event.h rename to system/monkey/monkey_event.h index 60ff88ac072..905b4fe6149 100644 --- a/testing/monkey/monkey_event.h +++ b/system/monkey/monkey_event.h @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/monkey/monkey_event.h + * apps/system/monkey/monkey_event.h * * SPDX-License-Identifier: Apache-2.0 * @@ -20,8 +20,8 @@ * ****************************************************************************/ -#ifndef __APPS_TESTING_MONKEY_EVENT_H -#define __APPS_TESTING_MONKEY_EVENT_H +#ifndef __APPS_SYSTEM_MONKEY_EVENT_H +#define __APPS_SYSTEM_MONKEY_EVENT_H /**************************************************************************** * Included Files @@ -76,4 +76,4 @@ bool monkey_event_exec(FAR struct monkey_s *monkey, } #endif -#endif /* __APPS_TESTING_MONKEY_EVENT_H */ +#endif /* __APPS_SYSTEM_MONKEY_EVENT_H */ diff --git a/testing/monkey/monkey_log.c b/system/monkey/monkey_log.c similarity index 98% rename from testing/monkey/monkey_log.c rename to system/monkey/monkey_log.c index cd3aaa3d653..2eab51d2a5b 100644 --- a/testing/monkey/monkey_log.c +++ b/system/monkey/monkey_log.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/monkey/monkey_log.c + * apps/system/monkey/monkey_log.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/monkey/monkey_log.h b/system/monkey/monkey_log.h similarity index 95% rename from testing/monkey/monkey_log.h rename to system/monkey/monkey_log.h index 4071e4c95f8..e798d887cc4 100644 --- a/testing/monkey/monkey_log.h +++ b/system/monkey/monkey_log.h @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/monkey/monkey_log.h + * apps/system/monkey/monkey_log.h * * SPDX-License-Identifier: Apache-2.0 * @@ -20,8 +20,8 @@ * ****************************************************************************/ -#ifndef __APPS_TESTING_MONKEY_MONKEY_LOG_H -#define __APPS_TESTING_MONKEY_MONKEY_LOG_H +#ifndef __APPS_SYSTEM_MONKEY_MONKEY_LOG_H +#define __APPS_SYSTEM_MONKEY_MONKEY_LOG_H /**************************************************************************** * Included Files @@ -105,4 +105,4 @@ enum monkey_log_level_type_e monkey_log_get_level(void); } #endif -#endif /* __APPS_TESTING_MONKEY_MONKEY_LOG_H */ +#endif /* __APPS_SYSTEM_MONKEY_MONKEY_LOG_H */ diff --git a/testing/monkey/monkey_main.c b/system/monkey/monkey_main.c similarity index 99% rename from testing/monkey/monkey_main.c rename to system/monkey/monkey_main.c index 1ee6945deff..f3d665c4f25 100644 --- a/testing/monkey/monkey_main.c +++ b/system/monkey/monkey_main.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/monkey/monkey_main.c + * apps/system/monkey/monkey_main.c * * SPDX-License-Identifier: Apache-2.0 * @@ -330,7 +330,7 @@ static FAR struct monkey_s *monkey_init( { monkey_set_mode(monkey, MONKEY_MODE_RECORD); if (!monkey_set_recorder_path(monkey, - CONFIG_TESTING_MONKEY_REC_DIR_PATH)) + CONFIG_SYSTEM_MONKEY_REC_DIR_PATH)) { goto failed; } diff --git a/testing/monkey/monkey_proc.c b/system/monkey/monkey_proc.c similarity index 99% rename from testing/monkey/monkey_proc.c rename to system/monkey/monkey_proc.c index 8040401fee4..d410e025e33 100644 --- a/testing/monkey/monkey_proc.c +++ b/system/monkey/monkey_proc.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/monkey/monkey_proc.c + * apps/system/monkey/monkey_proc.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/monkey/monkey_recorder.c b/system/monkey/monkey_recorder.c similarity index 99% rename from testing/monkey/monkey_recorder.c rename to system/monkey/monkey_recorder.c index cc497e8f8c1..500ec95e668 100644 --- a/testing/monkey/monkey_recorder.c +++ b/system/monkey/monkey_recorder.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/monkey/monkey_recorder.c + * apps/system/monkey/monkey_recorder.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/monkey/monkey_recorder.h b/system/monkey/monkey_recorder.h similarity index 95% rename from testing/monkey/monkey_recorder.h rename to system/monkey/monkey_recorder.h index 756e1a870c0..2848538f28d 100644 --- a/testing/monkey/monkey_recorder.h +++ b/system/monkey/monkey_recorder.h @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/monkey/monkey_recorder.h + * apps/system/monkey/monkey_recorder.h * * SPDX-License-Identifier: Apache-2.0 * @@ -20,8 +20,8 @@ * ****************************************************************************/ -#ifndef __APPS_TESTING_MONKEY_MONKEY_RECORDER_H -#define __APPS_TESTING_MONKEY_MONKEY_RECORDER_H +#ifndef __APPS_SYSTEM_MONKEY_MONKEY_RECORDER_H +#define __APPS_SYSTEM_MONKEY_MONKEY_RECORDER_H /**************************************************************************** * Included Files @@ -109,4 +109,4 @@ enum monkey_recorder_res_e monkey_recorder_reset( } #endif -#endif /* __APPS_TESTING_MONKEY_MONKEY_RECORDER_H */ +#endif /* __APPS_SYSTEM_MONKEY_MONKEY_RECORDER_H */ diff --git a/testing/monkey/monkey_type.h b/system/monkey/monkey_type.h similarity index 94% rename from testing/monkey/monkey_type.h rename to system/monkey/monkey_type.h index ed4f8684f99..e919f67d929 100644 --- a/testing/monkey/monkey_type.h +++ b/system/monkey/monkey_type.h @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/monkey/monkey_type.h + * apps/system/monkey/monkey_type.h * * SPDX-License-Identifier: Apache-2.0 * @@ -20,8 +20,8 @@ * ****************************************************************************/ -#ifndef __APPS_TESTING_MONKEY_MONKEY_TYPE_H -#define __APPS_TESTING_MONKEY_MONKEY_TYPE_H +#ifndef __APPS_SYSTEM_MONKEY_MONKEY_TYPE_H +#define __APPS_SYSTEM_MONKEY_MONKEY_TYPE_H /**************************************************************************** * Included Files @@ -131,4 +131,4 @@ struct monkey_s } playback_ctx; }; -#endif /* __APPS_TESTING_MONKEY_MONKEY_TYPE_H */ +#endif /* __APPS_SYSTEM_MONKEY_MONKEY_TYPE_H */ diff --git a/testing/monkey/monkey_utils.c b/system/monkey/monkey_utils.c similarity index 99% rename from testing/monkey/monkey_utils.c rename to system/monkey/monkey_utils.c index 5e54731ac3d..c785b504301 100644 --- a/testing/monkey/monkey_utils.c +++ b/system/monkey/monkey_utils.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/monkey/monkey_utils.c + * apps/system/monkey/monkey_utils.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/monkey/monkey_utils.h b/system/monkey/monkey_utils.h similarity index 95% rename from testing/monkey/monkey_utils.h rename to system/monkey/monkey_utils.h index d559600a366..618c0c3a562 100644 --- a/testing/monkey/monkey_utils.h +++ b/system/monkey/monkey_utils.h @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/monkey/monkey_utils.h + * apps/system/monkey/monkey_utils.h * * SPDX-License-Identifier: Apache-2.0 * @@ -20,8 +20,8 @@ * ****************************************************************************/ -#ifndef __APPS_TESTING_MONKEY_MONKEY_UTILS_H -#define __APPS_TESTING_MONKEY_MONKEY_UTILS_H +#ifndef __APPS_SYSTEM_MONKEY_MONKEY_UTILS_H +#define __APPS_SYSTEM_MONKEY_MONKEY_UTILS_H /**************************************************************************** * Included Files @@ -105,4 +105,4 @@ FAR const char *monkey_event_type2name(enum monkey_event_e event); } #endif -#endif /* __APPS_TESTING_MONKEY_MONKEY_UTILS_H */ +#endif /* __APPS_SYSTEM_MONKEY_MONKEY_UTILS_H */ diff --git a/testing/resmonitor/CMakeLists.txt b/system/resmonitor/CMakeLists.txt similarity index 75% rename from testing/resmonitor/CMakeLists.txt rename to system/resmonitor/CMakeLists.txt index ca110234196..57fb3ece8ee 100644 --- a/testing/resmonitor/CMakeLists.txt +++ b/system/resmonitor/CMakeLists.txt @@ -1,5 +1,5 @@ # ############################################################################## -# apps/testing/resmonitor/CMakeLists.txt +# apps/system/resmonitor/CMakeLists.txt # # SPDX-License-Identifier: Apache-2.0 # @@ -20,27 +20,27 @@ # # ############################################################################## -if(CONFIG_TESTING_RESMONITOR) +if(CONFIG_SYSTEM_RESMONITOR) nuttx_add_application( NAME showinfo SRCS showinfo.c STACKSIZE - ${CONFIG_TESTING_RESMONITOR_STACKSIZE} + ${CONFIG_SYSTEM_RESMONITOR_STACKSIZE} PRIORITY - ${CONFIG_TESTING_RESMONITOR_PRIORITY}) + ${CONFIG_SYSTEM_RESMONITOR_PRIORITY}) - if(CONFIG_TESTING_RESMONITOR_FILL) + if(CONFIG_SYSTEM_RESMONITOR_FILL) nuttx_add_application( NAME filldisk SRCS filldisk.c STACKSIZE - ${CONFIG_TESTING_RESMONITOR_STACKSIZE} + ${CONFIG_SYSTEM_RESMONITOR_STACKSIZE} PRIORITY - ${CONFIG_TESTING_RESMONITOR_PRIORITY}) + ${CONFIG_SYSTEM_RESMONITOR_PRIORITY}) nuttx_add_application( NAME @@ -48,9 +48,9 @@ if(CONFIG_TESTING_RESMONITOR) SRCS fillcpu.c STACKSIZE - ${CONFIG_TESTING_RESMONITOR_STACKSIZE} + ${CONFIG_SYSTEM_RESMONITOR_STACKSIZE} PRIORITY - ${CONFIG_TESTING_RESMONITOR_PRIORITY}) + ${CONFIG_SYSTEM_RESMONITOR_PRIORITY}) nuttx_add_application( NAME @@ -58,8 +58,8 @@ if(CONFIG_TESTING_RESMONITOR) SRCS fillmem.c STACKSIZE - ${CONFIG_TESTING_RESMONITOR_STACKSIZE} + ${CONFIG_SYSTEM_RESMONITOR_STACKSIZE} PRIORITY - ${CONFIG_TESTING_RESMONITOR_PRIORITY}) + ${CONFIG_SYSTEM_RESMONITOR_PRIORITY}) endif() endif() diff --git a/testing/resmonitor/Kconfig b/system/resmonitor/Kconfig similarity index 74% rename from testing/resmonitor/Kconfig rename to system/resmonitor/Kconfig index 5b577bf5859..3cfaf617c3b 100644 --- a/testing/resmonitor/Kconfig +++ b/system/resmonitor/Kconfig @@ -3,24 +3,24 @@ # see the file kconfig-language.txt in the NuttX tools repository. # -config TESTING_RESMONITOR +config SYSTEM_RESMONITOR bool "enable resource monitor [showinfo]" default n ---help--- Enable resource show with specific duration. Should not use with LOW_RESOURCE_TEST at the same time. -if TESTING_RESMONITOR +if SYSTEM_RESMONITOR -config TESTING_RESMONITOR_PRIORITY +config SYSTEM_RESMONITOR_PRIORITY int "Task priority" default 100 -config TESTING_RESMONITOR_STACKSIZE +config SYSTEM_RESMONITOR_STACKSIZE int "Stack size" default 4096 -config TESTING_RESMONITOR_FILL +config SYSTEM_RESMONITOR_FILL bool "[filldisk/fillcpu/fillmem]" default n diff --git a/testing/sensortest/Make.defs b/system/resmonitor/Make.defs similarity index 88% rename from testing/sensortest/Make.defs rename to system/resmonitor/Make.defs index 50603af5cb2..6e1285f41b5 100644 --- a/testing/sensortest/Make.defs +++ b/system/resmonitor/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/sensortest/Make.defs +# apps/system/resmonitor/Make.defs # # SPDX-License-Identifier: Apache-2.0 # @@ -20,6 +20,6 @@ # ############################################################################ -ifneq ($(CONFIG_TESTING_SENSORTEST),) -CONFIGURED_APPS += $(APPDIR)/testing/sensortest +ifneq ($(CONFIG_SYSTEM_RESMONITOR),) +CONFIGURED_APPS += $(APPDIR)/system/resmonitor endif diff --git a/testing/resmonitor/Makefile b/system/resmonitor/Makefile similarity index 85% rename from testing/resmonitor/Makefile rename to system/resmonitor/Makefile index b61abd1f34e..366cdefc384 100644 --- a/testing/resmonitor/Makefile +++ b/system/resmonitor/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/resmonitor/Makefile +# apps/system/resmonitor/Makefile # # SPDX-License-Identifier: Apache-2.0 # @@ -22,14 +22,14 @@ include $(APPDIR)/Make.defs -PRIORITY = $(CONFIG_TESTING_RESMONITOR_PRIORITY) -STACKSIZE = $(CONFIG_TESTING_RESMONITOR_STACKSIZE) -MODULE = $(CONFIG_TESTING_RESMONITOR) +PRIORITY = $(CONFIG_SYSTEM_RESMONITOR_PRIORITY) +STACKSIZE = $(CONFIG_SYSTEM_RESMONITOR_STACKSIZE) +MODULE = $(CONFIG_SYSTEM_RESMONITOR) PROGNAME += showinfo MAINSRC += $(CURDIR)/showinfo.c -ifeq ($(CONFIG_TESTING_RESMONITOR_FILL),y) +ifeq ($(CONFIG_SYSTEM_RESMONITOR_FILL),y) PROGNAME += filldisk MAINSRC += $(CURDIR)/filldisk.c PROGNAME += fillcpu diff --git a/testing/resmonitor/fillcpu.c b/system/resmonitor/fillcpu.c similarity index 99% rename from testing/resmonitor/fillcpu.c rename to system/resmonitor/fillcpu.c index dddf9da5c38..f7101a5b78e 100644 --- a/testing/resmonitor/fillcpu.c +++ b/system/resmonitor/fillcpu.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/resmonitor/fillcpu.c + * apps/system/resmonitor/fillcpu.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/resmonitor/filldisk.c b/system/resmonitor/filldisk.c similarity index 99% rename from testing/resmonitor/filldisk.c rename to system/resmonitor/filldisk.c index 4e7b9e618a7..de550b47e36 100644 --- a/testing/resmonitor/filldisk.c +++ b/system/resmonitor/filldisk.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/resmonitor/filldisk.c + * apps/system/resmonitor/filldisk.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/resmonitor/fillmem.c b/system/resmonitor/fillmem.c similarity index 99% rename from testing/resmonitor/fillmem.c rename to system/resmonitor/fillmem.c index c301d401f01..c97ddde43d0 100644 --- a/testing/resmonitor/fillmem.c +++ b/system/resmonitor/fillmem.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/resmonitor/fillmem.c + * apps/system/resmonitor/fillmem.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/resmonitor/showinfo.c b/system/resmonitor/showinfo.c similarity index 99% rename from testing/resmonitor/showinfo.c rename to system/resmonitor/showinfo.c index fe535334beb..27f016dee45 100644 --- a/testing/resmonitor/showinfo.c +++ b/system/resmonitor/showinfo.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/resmonitor/showinfo.c + * apps/system/resmonitor/showinfo.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/testing/sensortest/CMakeLists.txt b/system/sensortest/CMakeLists.txt similarity index 82% rename from testing/sensortest/CMakeLists.txt rename to system/sensortest/CMakeLists.txt index a95134c8838..79e016850a6 100644 --- a/testing/sensortest/CMakeLists.txt +++ b/system/sensortest/CMakeLists.txt @@ -1,5 +1,5 @@ # ############################################################################## -# apps/testing/sensortest/CMakeLists.txt +# apps/system/sensortest/CMakeLists.txt # # SPDX-License-Identifier: Apache-2.0 # @@ -20,16 +20,16 @@ # # ############################################################################## -if(CONFIG_TESTING_SENSORTEST) +if(CONFIG_SYSTEM_SENSORTEST) nuttx_add_application( NAME - ${CONFIG_TESTING_SENSORTEST_PROGNAME} + ${CONFIG_SYSTEM_SENSORTEST_PROGNAME} PRIORITY - ${CONFIG_TESTING_SENSORTEST_PRIORITY} + ${CONFIG_SYSTEM_SENSORTEST_PRIORITY} STACKSIZE - ${CONFIG_TESTING_SENSORTEST_STACKSIZE} + ${CONFIG_SYSTEM_SENSORTEST_STACKSIZE} MODULE - ${CONFIG_TESTING_SENSORTEST} + ${CONFIG_SYSTEM_SENSORTEST} SRCS sensortest.c) endif() diff --git a/testing/sensortest/Kconfig b/system/sensortest/Kconfig similarity index 77% rename from testing/sensortest/Kconfig rename to system/sensortest/Kconfig index 7344ebe2e41..8f54695ed70 100644 --- a/testing/sensortest/Kconfig +++ b/system/sensortest/Kconfig @@ -3,27 +3,27 @@ # see the file kconfig-language.txt in the NuttX tools repository. # -config TESTING_SENSORTEST +config SYSTEM_SENSORTEST tristate "Sensor driver test" default n depends on SENSORS ---help--- Enable the Sensor driver test -if TESTING_SENSORTEST +if SYSTEM_SENSORTEST -config TESTING_SENSORTEST_PROGNAME +config SYSTEM_SENSORTEST_PROGNAME string "Program name" default "sensortest" ---help--- This is the name of the program that will be used when the NSH ELF program is installed. -config TESTING_SENSORTEST_PRIORITY +config SYSTEM_SENSORTEST_PRIORITY int "Sensor driver test task priority" default 100 -config TESTING_SENSORTEST_STACKSIZE +config SYSTEM_SENSORTEST_STACKSIZE int "Sensor driver test stack size" default DEFAULT_TASK_STACKSIZE diff --git a/testing/resmonitor/Make.defs b/system/sensortest/Make.defs similarity index 88% rename from testing/resmonitor/Make.defs rename to system/sensortest/Make.defs index 886d7b0e9d2..b34f28028cd 100644 --- a/testing/resmonitor/Make.defs +++ b/system/sensortest/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/resmonitor/Make.defs +# apps/system/sensortest/Make.defs # # SPDX-License-Identifier: Apache-2.0 # @@ -20,6 +20,6 @@ # ############################################################################ -ifneq ($(CONFIG_TESTING_RESMONITOR),) -CONFIGURED_APPS += $(APPDIR)/testing/resmonitor +ifneq ($(CONFIG_SYSTEM_SENSORTEST),) +CONFIGURED_APPS += $(APPDIR)/system/sensortest endif diff --git a/testing/sensortest/Makefile b/system/sensortest/Makefile similarity index 82% rename from testing/sensortest/Makefile rename to system/sensortest/Makefile index 6ecde141018..34631a86357 100644 --- a/testing/sensortest/Makefile +++ b/system/sensortest/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/sensortest/Makefile +# apps/system/sensortest/Makefile # # SPDX-License-Identifier: Apache-2.0 # @@ -22,10 +22,10 @@ include $(APPDIR)/Make.defs -PROGNAME = $(CONFIG_TESTING_SENSORTEST_PROGNAME) -PRIORITY = $(CONFIG_TESTING_SENSORTEST_PRIORITY) -STACKSIZE = $(CONFIG_TESTING_SENSORTEST_STACKSIZE) -MODULE = $(CONFIG_TESTING_SENSORTEST) +PROGNAME = $(CONFIG_SYSTEM_SENSORTEST_PROGNAME) +PRIORITY = $(CONFIG_SYSTEM_SENSORTEST_PRIORITY) +STACKSIZE = $(CONFIG_SYSTEM_SENSORTEST_STACKSIZE) +MODULE = $(CONFIG_SYSTEM_SENSORTEST) MAINSRC = sensortest.c diff --git a/testing/sensortest/sensortest.c b/system/sensortest/sensortest.c similarity index 99% rename from testing/sensortest/sensortest.c rename to system/sensortest/sensortest.c index 8576862e2f0..925dac24030 100644 --- a/testing/sensortest/sensortest.c +++ b/system/sensortest/sensortest.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/sensortest/sensortest.c + * apps/system/sensortest/sensortest.c * * SPDX-License-Identifier: Apache-2.0 * From cf46792554aeed73bd4db7c6de03c8b800559580 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Sun, 26 Jan 2025 15:57:17 +0800 Subject: [PATCH 171/391] apps/testing: Move sd_bench to apps/bechmarks Signed-off-by: Xiang Xiao --- {testing => benchmarks}/sd_bench/Kconfig | 12 ++++++------ {testing => benchmarks}/sd_bench/Make.defs | 6 +++--- {testing => benchmarks}/sd_bench/Makefile | 10 +++++----- {testing => benchmarks}/sd_bench/sd_bench_main.c | 9 +++++---- 4 files changed, 19 insertions(+), 18 deletions(-) rename {testing => benchmarks}/sd_bench/Kconfig (81%) rename {testing => benchmarks}/sd_bench/Make.defs (88%) rename {testing => benchmarks}/sd_bench/Makefile (82%) rename {testing => benchmarks}/sd_bench/sd_bench_main.c (98%) diff --git a/testing/sd_bench/Kconfig b/benchmarks/sd_bench/Kconfig similarity index 81% rename from testing/sd_bench/Kconfig rename to benchmarks/sd_bench/Kconfig index 00ab74e1406..440e17064f1 100644 --- a/testing/sd_bench/Kconfig +++ b/benchmarks/sd_bench/Kconfig @@ -3,31 +3,31 @@ # see the file kconfig-language.txt in the NuttX tools repository. # -config TESTING_SD_BENCH +config BENCHMARK_SD_BENCH tristate "SD benchmark program" depends on ALLOW_BSD_COMPONENTS default n ---help--- SD benchmark application based on https://github.com/PX4/PX4-Autopilot/blob/main/src/systemcmds/sd_bench/sd_bench.cpp -if TESTING_SD_BENCH +if BENCHMARK_SD_BENCH -config TESTING_SD_BENCH_PROGNAME +config BENCHMARK_SD_BENCH_PROGNAME string "Program name" default "sdbench" ---help--- This is the name of the program that will be used when the NSH ELF program is installed. -config TESTING_SD_BENCH_PRIORITY +config BENCHMARK_SD_BENCH_PRIORITY int "SD bench task priority" default 100 -config TESTING_SD_BENCH_STACKSIZE +config BENCHMARK_SD_BENCH_STACKSIZE int "SD bench stack size" default DEFAULT_TASK_STACKSIZE -config TESTING_SD_BENCH_DEVICE +config BENCHMARK_SD_BENCH_DEVICE string "SD / MMC mount point" default "/mnt" diff --git a/testing/sd_bench/Make.defs b/benchmarks/sd_bench/Make.defs similarity index 88% rename from testing/sd_bench/Make.defs rename to benchmarks/sd_bench/Make.defs index b9e2b9bb018..cb9a0381927 100644 --- a/testing/sd_bench/Make.defs +++ b/benchmarks/sd_bench/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/sd_bench/Make.defs +# apps/benchmarks/sd_bench/Make.defs # # SPDX-License-Identifier: Apache-2.0 # @@ -20,6 +20,6 @@ # ############################################################################ -ifneq ($(CONFIG_TESTING_SD_BENCH),) -CONFIGURED_APPS += $(APPDIR)/testing/sd_bench +ifneq ($(CONFIG_BENCHMARK_SD_BENCH),) +CONFIGURED_APPS += $(APPDIR)/benchmarks/sd_bench endif diff --git a/testing/sd_bench/Makefile b/benchmarks/sd_bench/Makefile similarity index 82% rename from testing/sd_bench/Makefile rename to benchmarks/sd_bench/Makefile index ddd1789947c..072a87c2eea 100644 --- a/testing/sd_bench/Makefile +++ b/benchmarks/sd_bench/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/sd_bench/Makefile +# apps/benchmarks/sd_bench/Makefile # # SPDX-License-Identifier: Apache-2.0 # @@ -22,10 +22,10 @@ include $(APPDIR)/Make.defs -PROGNAME = $(CONFIG_TESTING_SD_BENCH_PROGNAME) -PRIORITY = $(CONFIG_TESTING_SD_BENCH_PRIORITY) -STACKSIZE = $(CONFIG_TESTING_SD_BENCH_STACKSIZE) -MODULE = $(CONFIG_TESTING_SD_BENCH) +PROGNAME = $(CONFIG_BENCHMARK_SD_BENCH_PROGNAME) +PRIORITY = $(CONFIG_BENCHMARK_SD_BENCH_PRIORITY) +STACKSIZE = $(CONFIG_BENCHMARK_SD_BENCH_STACKSIZE) +MODULE = $(CONFIG_BENCHMARK_SD_BENCH) MAINSRC = sd_bench_main.c diff --git a/testing/sd_bench/sd_bench_main.c b/benchmarks/sd_bench/sd_bench_main.c similarity index 98% rename from testing/sd_bench/sd_bench_main.c rename to benchmarks/sd_bench/sd_bench_main.c index e2ae7472280..8a48a9128bc 100644 --- a/testing/sd_bench/sd_bench_main.c +++ b/benchmarks/sd_bench/sd_bench_main.c @@ -1,8 +1,9 @@ /**************************************************************************** - * apps/testing/sd_bench/sd_bench_main.c + * apps/benchmarks/sd_bench/sd_bench_main.c * * SPDX-License-Identifier: BSD-3-Clause - * SPDX-FileCopyrightText: 2016-2021 PX4 Development Team. All rights reserved. + * SPDX-FileCopyrightText: 2016-2021 PX4 Development Team. + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -77,7 +78,7 @@ typedef struct sdb_config ****************************************************************************/ static const char *BENCHMARK_FILE = - CONFIG_TESTING_SD_BENCH_DEVICE "/sd_bench"; + CONFIG_BENCHMARK_SD_BENCH_DEVICE "/sd_bench"; static const size_t max_block = 65536; static const size_t min_block = 1; @@ -350,7 +351,7 @@ static int read_test(int fd, sdb_config_t *cfg, uint8_t *block, static void usage(void) { printf("Test the speed of an SD card or mount point\n"); - printf(CONFIG_TESTING_SD_BENCH_PROGNAME + printf(CONFIG_BENCHMARK_SD_BENCH_PROGNAME ": [-b] [-r] [-d] [-k] [-s] [-a] [-v]\n"); printf(" -b Block size per write (%zu-%zu), default %zu\n", min_block, max_block, default_block); From 285607608e181665676e5f2e33ca63be2c1e019f Mon Sep 17 00:00:00 2001 From: Huang Qi Date: Tue, 28 Jan 2025 09:50:22 +0800 Subject: [PATCH 172/391] tools/Rust: Add support for x86 platform Summary: - Added support for x86 and x86_64 architectures in the Rust build system - Updated `nuttx_rust_target_triple` function in `cmake/nuttx_add_rust.cmake` to handle x86 and x86_64 target triples - Updated `RUST_TARGET_TRIPLE` macro in `tools/Rust.mk` to include x86 and x86_64 target triples Impact: - Enables Rust crate compilation for x86 and x86_64 platforms - No functional changes for existing architectures (ARM, RISC-V, etc.) - Improves platform compatibility and expands Rust support in NuttX Signed-off-by: Huang Qi --- cmake/nuttx_add_rust.cmake | 8 +++++++- tools/Rust.mk | 8 ++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/cmake/nuttx_add_rust.cmake b/cmake/nuttx_add_rust.cmake index 776f2161604..742bc3be5dc 100644 --- a/cmake/nuttx_add_rust.cmake +++ b/cmake/nuttx_add_rust.cmake @@ -33,6 +33,8 @@ include(nuttx_parse_function_args) # - thumbv8m.base: thumbv8m.base-nuttx-eabi, thumbv8m.base-nuttx-eabihf # - riscv32: riscv32imc/imac/imafc-unknown-nuttx-elf # - riscv64: riscv64imac/imafdc-unknown-nuttx-elf +# - x86: i686-unknown-nuttx +# - x86_64: x86_64-unknown-nuttx # # Inputs: # ARCHTYPE - Architecture type (e.g. thumbv7m, riscv32) @@ -45,7 +47,11 @@ include(nuttx_parse_function_args) # ~~~ function(nuttx_rust_target_triple ARCHTYPE ABITYPE CPUTYPE OUTPUT) - if(ARCHTYPE MATCHES "thumb") + if(ARCHTYPE STREQUAL "x86_64") + set(TARGET_TRIPLE "x86_64-unknown-nuttx") + elseif(ARCHTYPE STREQUAL "x86") + set(TARGET_TRIPLE "i686-unknown-nuttx") + elseif(ARCHTYPE MATCHES "thumb") if(ARCHTYPE MATCHES "thumbv8m") # Extract just the base architecture type (thumbv8m.main or thumbv8m.base) if(ARCHTYPE MATCHES "thumbv8m.main") diff --git a/tools/Rust.mk b/tools/Rust.mk index 935508fa1b8..337d323ddf0 100644 --- a/tools/Rust.mk +++ b/tools/Rust.mk @@ -26,6 +26,8 @@ # - LLVM_CPUTYPE: CPU type (e.g. cortex-m23, sifive-e20) # # Supported architectures and their target triples: +# - x86: i686-unknown-nuttx +# - x86_64: x86_64-unknown-nuttx # - armv7a: armv7a-nuttx-eabi, armv7a-nuttx-eabihf # - thumbv6m: thumbv6m-nuttx-eabi # - thumbv7a: thumbv7a-nuttx-eabi, thumbv7a-nuttx-eabihf @@ -44,6 +46,12 @@ define RUST_TARGET_TRIPLE $(or \ + $(and $(filter x86_64,$(LLVM_ARCHTYPE)), \ + x86_64-unknown-nuttx \ + ), \ + $(and $(filter x86,$(LLVM_ARCHTYPE)), \ + i686-unknown-nuttx \ + ), \ $(and $(filter thumb%,$(LLVM_ARCHTYPE)), \ $(if $(filter thumbv8m%,$(LLVM_ARCHTYPE)), \ $(if $(filter cortex-m23,$(LLVM_CPUTYPE)),thumbv8m.base,thumbv8m.main)-nuttx-$(LLVM_ABITYPE), \ From 18838d23bff52e9e15627abcb54e7a4085489673 Mon Sep 17 00:00:00 2001 From: Huang Qi Date: Wed, 22 Jan 2025 16:06:47 +0800 Subject: [PATCH 173/391] examples/rust: Add basic Slint example Summary: - Added a basic Slint example for NuttX, demonstrating how to integrate Slint UI framework with Rust on NuttX - Includes a simple UI with a counter and touchscreen input handling - Provides CMake, Kconfig, and Makefile configurations for building the example Impact: - Introduces a new example showcasing Slint UI framework usage on NuttX - Enables developers to explore Rust-based UI development on embedded systems - Demonstrates integration with NuttX framebuffer and touchscreen drivers Signed-off-by: Huang Qi --- examples/rust/slint/.gitignore | 1 + examples/rust/slint/CMakeLists.txt | 31 ++++++ examples/rust/slint/Cargo.toml | 24 ++++ examples/rust/slint/Kconfig | 29 +++++ examples/rust/slint/Make.defs | 26 +++++ examples/rust/slint/Makefile | 34 ++++++ examples/rust/slint/build.rs | 28 +++++ examples/rust/slint/src/lib.rs | 171 +++++++++++++++++++++++++++++ examples/rust/slint/ui/app.slint | 25 +++++ 9 files changed, 369 insertions(+) create mode 100644 examples/rust/slint/.gitignore create mode 100644 examples/rust/slint/CMakeLists.txt create mode 100644 examples/rust/slint/Cargo.toml create mode 100644 examples/rust/slint/Kconfig create mode 100644 examples/rust/slint/Make.defs create mode 100644 examples/rust/slint/Makefile create mode 100644 examples/rust/slint/build.rs create mode 100644 examples/rust/slint/src/lib.rs create mode 100644 examples/rust/slint/ui/app.slint diff --git a/examples/rust/slint/.gitignore b/examples/rust/slint/.gitignore new file mode 100644 index 00000000000..eb5a316cbd1 --- /dev/null +++ b/examples/rust/slint/.gitignore @@ -0,0 +1 @@ +target diff --git a/examples/rust/slint/CMakeLists.txt b/examples/rust/slint/CMakeLists.txt new file mode 100644 index 00000000000..6ed088aea01 --- /dev/null +++ b/examples/rust/slint/CMakeLists.txt @@ -0,0 +1,31 @@ +# ############################################################################## +# apps/examples/rust/slint/CMakeLists.txt +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_EXAMPLES_RUST_SLINT) + + # Build the Rust crate using nuttx_add_rust + nuttx_add_rust(CRATE_NAME slint CRATE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) + + nuttx_add_application( + NAME ${CONFIG_EXAMPLES_RUST_SLINT_PROGNAME} STACKSIZE + ${CONFIG_EXAMPLES_RUST_SLINT_STACKSIZE} PRIORITY + ${CONFIG_EXAMPLES_RUST_SLINT_PRIORITY}) + +endif() # CONFIG_EXAMPLES_RUST_SLINT diff --git a/examples/rust/slint/Cargo.toml b/examples/rust/slint/Cargo.toml new file mode 100644 index 00000000000..4600f2220b2 --- /dev/null +++ b/examples/rust/slint/Cargo.toml @@ -0,0 +1,24 @@ +[package] +name = "slint" +version = "0.1.0" +edition = "2021" + +[lib] +crate-type = ["staticlib"] + +[profile.dev] +panic = "abort" + +[profile.release] +panic = "abort" +lto = true +codegen-units = 1 +opt-level = 'z' + +[dependencies] +libc = "0.2" +slint = { version = "1.9", default-features = false, features = ["compat-1-2", "renderer-software", "libm", "unsafe-single-threaded"] } +nuttx = { git = "https://github.com/no1wudi/nuttx-rs.git", branch = "master" } + +[build-dependencies] +slint-build = { version = "1.9" } diff --git a/examples/rust/slint/Kconfig b/examples/rust/slint/Kconfig new file mode 100644 index 00000000000..babc19d0495 --- /dev/null +++ b/examples/rust/slint/Kconfig @@ -0,0 +1,29 @@ +# +# For a description of the syntax of this configuration file, +# see the file kconfig-language.txt in the NuttX tools repository. +# + +config EXAMPLES_RUST_SLINT + tristate "Slint Basic Example" + default n + ---help--- + Enable the basic Slint example. + +if EXAMPLES_RUST_SLINT + +config EXAMPLES_RUST_SLINT_PROGNAME + string "Program name" + default "slint" + ---help--- + This is the name of the program that will be used when the + program is installed. + +config EXAMPLES_RUST_SLINT_PRIORITY + int "Task priority" + default 100 + +config EXAMPLES_RUST_SLINT_STACKSIZE + int "Stack size" + default DEFAULT_TASK_STACKSIZE + +endif diff --git a/examples/rust/slint/Make.defs b/examples/rust/slint/Make.defs new file mode 100644 index 00000000000..9259913fcda --- /dev/null +++ b/examples/rust/slint/Make.defs @@ -0,0 +1,26 @@ +############################################################################ +# apps/examples/rust/slint/Make.defs +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +include $(APPDIR)/tools/Rust.mk + +ifneq ($(CONFIG_EXAMPLES_RUST_SLINT),) +CONFIGURED_APPS += $(APPDIR)/examples/rust/slint +EXTRA_LIBS += $(call RUST_GET_BINDIR,slint,$(APPDIR)/examples/rust) +endif diff --git a/examples/rust/slint/Makefile b/examples/rust/slint/Makefile new file mode 100644 index 00000000000..34b444e9d80 --- /dev/null +++ b/examples/rust/slint/Makefile @@ -0,0 +1,34 @@ +############################################################################ +# apps/examples/rust/slint/Makefile +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +include $(APPDIR)/Make.defs + +PROGNAME = $(CONFIG_EXAMPLES_RUST_SLINT_PROGNAME) +PRIORITY = $(CONFIG_EXAMPLES_RUST_SLINT_PRIORITY) +STACKSIZE = $(CONFIG_EXAMPLES_RUST_SLINT_STACKSIZE) +MODULE = $(CONFIG_EXAMPLES_RUST_SLINT) + +context:: + $(call RUST_CARGO_BUILD,slint,$(APPDIR)/examples/rust) + +clean:: + $(call RUST_CARGO_CLEAN,slint,$(APPDIR)/examples/rust) + +include $(APPDIR)/Application.mk diff --git a/examples/rust/slint/build.rs b/examples/rust/slint/build.rs new file mode 100644 index 00000000000..6142de92a05 --- /dev/null +++ b/examples/rust/slint/build.rs @@ -0,0 +1,28 @@ +// ############################################################################## +// examples/rust/slint/build.rs +// +// Licensed to the Apache Software Foundation (ASF) under one or more contributor +// license agreements. See the NOTICE file distributed with this work for +// additional information regarding copyright ownership. The ASF licenses this +// file to you under the Apache License, Version 2.0 (the "License"); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. +// +// ############################################################################## + +fn main() { + slint_build::compile_with_config( + "ui/app.slint", + slint_build::CompilerConfiguration::new() + .embed_resources(slint_build::EmbedResourcesKind::EmbedForSoftwareRenderer), + ) + .unwrap(); +} diff --git a/examples/rust/slint/src/lib.rs b/examples/rust/slint/src/lib.rs new file mode 100644 index 00000000000..043274cbc64 --- /dev/null +++ b/examples/rust/slint/src/lib.rs @@ -0,0 +1,171 @@ +// ############################################################################## +// examples/rust/slint/src/lib.rs +// +// Licensed to the Apache Software Foundation (ASF) under one or more contributor +// license agreements. See the NOTICE file distributed with this work for +// additional information regarding copyright ownership. The ASF licenses this +// file to you under the Apache License, Version 2.0 (the "License"); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. +// +// ############################################################################## + +use std::rc::Rc; +use std::{cell::RefCell, ffi::CStr}; + +use slint::platform::software_renderer::{LineBufferProvider, Rgb565Pixel}; + +use nuttx::input::touchscreen::*; +use nuttx::video::fb::*; +use slint::platform::WindowEvent; + +slint::include_modules!(); + +struct NuttXPlatform { + window: Rc, +} + +impl slint::platform::Platform for NuttXPlatform { + fn create_window_adapter( + &self, + ) -> Result, slint::PlatformError> { + Ok(self.window.clone()) + } + fn duration_since_start(&self) -> std::time::Duration { + std::time::SystemTime::now() + .duration_since(std::time::UNIX_EPOCH) + .unwrap() + } +} + +fn create_slint_app() -> AppWindow { + AppWindow::new().expect("Failed to load UI") +} + +#[derive(Debug, Clone)] +struct NuttXRenderer { + frame_buffer: *mut u8, + line_buffer: Rc>>, + stride: usize, + lines: usize, +} + +impl LineBufferProvider for NuttXRenderer { + type TargetPixel = Rgb565Pixel; + fn process_line( + &mut self, + line: usize, + range: std::ops::Range, + render_fn: impl FnOnce(&mut [Self::TargetPixel]), + ) { + let fb_size = self.stride * self.lines; + let frame = unsafe { + std::slice::from_raw_parts_mut(self.frame_buffer as *mut Rgb565Pixel, fb_size) + }; + let mut buffer = self.line_buffer.borrow_mut(); + render_fn(&mut buffer[range.clone()]); + let offset = line * self.stride; + frame[offset..offset + range.end - range.start].copy_from_slice(&buffer[range]); + } +} + +#[no_mangle] +pub extern "C" fn slint_main() { + // Open the framebuffer device and get its information + let fbdev = match FrameBuffer::new(CStr::from_bytes_with_nul(b"/dev/fb0\0").unwrap()) { + Ok(fb) => fb, + Err(_) => { + println!("Failed to open framebuffer device"); + return; + } + }; + + let planeinfo = fbdev.get_plane_info().unwrap(); + let videoinfo = fbdev.get_video_info().unwrap(); + + println!("{:?}", planeinfo); + println!("{:?}", videoinfo); + + if videoinfo.fmt != Format::RGB565 as u8 { + println!("Unsupported pixel format, only RGB565 is supported for now"); + return; + } + + // Open the touchscreen device + let mut tsdev = match TouchScreen::open(CStr::from_bytes_with_nul(b"/dev/input0\0").unwrap()) { + Ok(ts) => ts, + Err(_) => { + println!("Failed to open touchscreen device"); + return; + } + }; + + // Setup the Slint backend + let window = slint::platform::software_renderer::MinimalSoftwareWindow::new(Default::default()); + window.set_size(slint::PhysicalSize::new( + videoinfo.xres.into(), + videoinfo.yres.into(), + )); + + // Set the platform + slint::platform::set_platform(Box::new(NuttXPlatform { + window: window.clone(), + })) + .unwrap(); + + // Configure the UI + let _ui = create_slint_app(); + + // Create the renderer for NuttX + let nxrender = NuttXRenderer { + frame_buffer: planeinfo.fbmem as *mut u8, + line_buffer: Rc::new(RefCell::new(vec![ + Rgb565Pixel::default(); + videoinfo.xres as usize + ])), + stride: videoinfo.xres.into(), + lines: videoinfo.yres.into(), + }; + + let button = slint::platform::PointerEventButton::Left; + let mut last_touch_down = false; + let mut last_position = Default::default(); + + loop { + slint::platform::update_timers_and_animations(); + window.draw_if_needed(|renderer| { + renderer.render_by_line(nxrender.clone()); + }); + + if let Ok(sample) = tsdev.read_sample() { + if sample.npoints > 0 { + let point = sample.point[0]; + if point.is_pos_valid() { + let position = slint::PhysicalPosition::new(point.x.into(), point.y.into()) + .to_logical(window.scale_factor()); + last_position = position; + if point.is_touch_down() || point.is_touch_move() { + last_touch_down = true; + window.dispatch_event(WindowEvent::PointerPressed { position, button }); + } + } + } + } else { + if last_touch_down { + window.dispatch_event(WindowEvent::PointerReleased { + position: last_position, + button, + }); + last_touch_down = false; + } + } + } +} diff --git a/examples/rust/slint/ui/app.slint b/examples/rust/slint/ui/app.slint new file mode 100644 index 00000000000..29c14af0622 --- /dev/null +++ b/examples/rust/slint/ui/app.slint @@ -0,0 +1,25 @@ +import { Button, VerticalBox, HorizontalBox , AboutSlint } from "std-widgets.slint"; + +export component AppWindow inherits Window { + property counter: 0; + + timer := Timer { + interval: 1s; + running: true; + triggered() => { + counter += 1; + } + } + + VerticalBox { + Text { + horizontal-alignment: center; + vertical-alignment: center; + text: "Times since start on NuttX: \n\{root.counter}"; + font-size: 24px; + } + + AboutSlint { } + + } +} From b43fd50ff02bbc39de34b1fa6fbdc2e2da225ac6 Mon Sep 17 00:00:00 2001 From: Hiroki Noda Date: Wed, 29 Jan 2025 23:25:31 +0900 Subject: [PATCH 174/391] examples:hello_nim: fix comment syntax --- examples/hello_nim/hello_nim_async.nim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/hello_nim/hello_nim_async.nim b/examples/hello_nim/hello_nim_async.nim index 664fe7d9bd3..08e5a3b86cc 100644 --- a/examples/hello_nim/hello_nim_async.nim +++ b/examples/hello_nim/hello_nim_async.nim @@ -1,4 +1,5 @@ -/**************************************************************************** +#[ + **************************************************************************** * apps/examples/hello_nim/hello_nim_async.c * * SPDX-License-Identifier: Apache-2.0 @@ -19,6 +20,7 @@ * under the License. * ****************************************************************************/ +]# import std/asyncdispatch import std/strformat From e1e28eb88ad153711223cab612f5d5bd019f8dd4 Mon Sep 17 00:00:00 2001 From: Neo Xu Date: Mon, 27 Jan 2025 17:10:23 +0800 Subject: [PATCH 175/391] ostest: fix cmake build break /nuttx/apps/testing/ostest/ostest_main.c:322:(.text.user_main+0x3c3): undefined reference to `sched_thread_local_test' collect2: error: ld returned 1 exit status ninja: build stopped: subcommand failed. Signed-off-by: Neo Xu --- testing/ostest/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/testing/ostest/CMakeLists.txt b/testing/ostest/CMakeLists.txt index d3286f02366..2bbe6a730a3 100644 --- a/testing/ostest/CMakeLists.txt +++ b/testing/ostest/CMakeLists.txt @@ -85,6 +85,10 @@ if(CONFIG_TESTING_OSTEST) list(APPEND SRCS specific.c) endif() + if(CONFIG_SCHED_THREAD_LOCAL) + list(APPEND SRCS sched_thread_local.c) + endif() + if(NOT CONFIG_TLS_NCLEANUP EQUAL 0) list(APPEND SRCS pthread_cleanup.c) endif() From 5a7661a9284af1e49ecd5158c05dd652cc0179fc Mon Sep 17 00:00:00 2001 From: Tiago Medicci Date: Fri, 24 Jan 2025 09:02:57 -0300 Subject: [PATCH 176/391] interpreters/python: add patch to set `_PyRuntime` section By setting a specific region for the `_PyRuntime` structure, it is possible to move it to the external memory, for instance, freeing the internal memory (this structure occupies around 140KiB). --- interpreters/python/Makefile | 1 + ...ntime-structure-into-PSRAM-bss-regio.patch | 54 +++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 interpreters/python/patch/0012-hack-place-_PyRuntime-structure-into-PSRAM-bss-regio.patch diff --git a/interpreters/python/Makefile b/interpreters/python/Makefile index 4b6c42eac39..c478ec1e420 100644 --- a/interpreters/python/Makefile +++ b/interpreters/python/Makefile @@ -80,6 +80,7 @@ $(CPYTHON_UNPACKNAME): $(CPYTHON_ZIP) $(Q) patch -p1 -d $(CPYTHON_UNPACKNAME) < patch$(DELIM)0009-include-nuttx-sys-select-header-to-define-FD_SETSIZE.patch $(Q) patch -p1 -d $(CPYTHON_UNPACKNAME) < patch$(DELIM)0010-check-for-the-d_ino-member-of-the-structure-dirent.patch $(Q) patch -p1 -d $(CPYTHON_UNPACKNAME) < patch$(DELIM)0011-avoid-redefinition-warning-if-UNUSED-is-already-defi.patch + $(Q) patch -p1 -d $(CPYTHON_UNPACKNAME) < patch$(DELIM)0012-hack-place-_PyRuntime-structure-into-PSRAM-bss-regio.patch $(HOSTPYTHON): mkdir -p $(HOSTBUILD) diff --git a/interpreters/python/patch/0012-hack-place-_PyRuntime-structure-into-PSRAM-bss-regio.patch b/interpreters/python/patch/0012-hack-place-_PyRuntime-structure-into-PSRAM-bss-regio.patch new file mode 100644 index 00000000000..d64342e551c --- /dev/null +++ b/interpreters/python/patch/0012-hack-place-_PyRuntime-structure-into-PSRAM-bss-regio.patch @@ -0,0 +1,54 @@ +From d1e903f516849c535455904b3c3f8a33665c1a88 Mon Sep 17 00:00:00 2001 +From: Ivan Grokhotkov +Date: Wed, 23 Oct 2024 16:52:52 +0200 +Subject: [PATCH 12/12] hack: place _PyRuntime structure into PSRAM bss region, + initialize later + +_PyRuntime occupies around 100kB of RAM in .data region, making it +hard to fit the interpreter into the available static RAM. +This patch moves it into PSRAM using section attribute. Normally +we shouldn't need this as we can specify placements in ldfragments, +however in this specific case I couldn't get it to work. +Since the structure is now in .bss, add a function which will assign +it the initial value. + +The proper fix might be to support .data segment on PSRAM in IDF, +as well as to fix whatever ldgen issue prevents this variable from +being moved to PSRAM. + +Co-authored-by: Tiago Medicci Serrano +--- + Python/pylifecycle.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c +index 1701a1cd217..2a8e544f0ac 100644 +--- a/Python/pylifecycle.c ++++ b/Python/pylifecycle.c +@@ -102,12 +102,23 @@ __attribute__(( + _PyRuntimeState _PyRuntime + #if defined(__linux__) && (defined(__GNUC__) || defined(__clang__)) + __attribute__ ((section (".PyRuntime"))) ++#elif defined(ESP_PLATFORM) ++__attribute__ ((section (".PyRuntime"))) + #endif + = _PyRuntimeState_INIT(_PyRuntime, _Py_Debug_Cookie); + _Py_COMP_DIAG_POP + + static int runtime_initialized = 0; + ++void _PyRuntime_Early_Init(void) { ++#if defined(ESP_PLATFORM) ++ // Normally, _PyRuntime is in .data and is initialized by the C runtime. ++ // This function allows us to place it into external RAM .bss section ++ // and initialize it manually, saving some internal RAM. ++ _PyRuntime = (struct pyruntimestate) _PyRuntimeState_INIT(_PyRuntime, _Py_Debug_Cookie); ++#endif ++} ++ + PyStatus + _PyRuntime_Initialize(void) + { +-- +2.47.1 + From 4c6a6c7b162dde00e163a9e8766779e2a3c1e503 Mon Sep 17 00:00:00 2001 From: Tiago Medicci Date: Tue, 21 Jan 2025 17:32:37 -0300 Subject: [PATCH 177/391] interpreters/python: create Python's config files dynamically The `Setup.local` and the `config.site` files are used by Python's build system to, respectively, enable or disable Python's modules and set/unset available functions in the target system. These files are now set according to NuttX's configs, enabling or disabling Python's features according to the configs set on NuttX. --- interpreters/python/.gitignore | 2 ++ interpreters/python/Makefile | 34 ++++++++++++++++++- .../python/{Setup.local => Setup.local.in} | 0 .../python/{config.site => config.site.in} | 4 +-- 4 files changed, 37 insertions(+), 3 deletions(-) rename interpreters/python/{Setup.local => Setup.local.in} (100%) rename interpreters/python/{config.site => config.site.in} (95%) diff --git a/interpreters/python/.gitignore b/interpreters/python/.gitignore index ad58719cdd4..33efb9cbe30 100644 --- a/interpreters/python/.gitignore +++ b/interpreters/python/.gitignore @@ -4,3 +4,5 @@ /Python/ /romfs_cpython_modules.h /romfs_cpython_modules.img +/config.site +/Setup.local diff --git a/interpreters/python/Makefile b/interpreters/python/Makefile index c478ec1e420..810904f502b 100644 --- a/interpreters/python/Makefile +++ b/interpreters/python/Makefile @@ -32,6 +32,7 @@ UNPACK ?= unzip -q -o MACHDEP=nuttx CONFIG_SITE=${CURDIR}/config.site +SETUP_LOCAL=${CURDIR}/Setup.local CPYTHON_PATH=$(CURDIR)/$(CPYTHON_UNPACKNAME) BUILDIR=$(CURDIR)/build @@ -92,6 +93,35 @@ $(HOSTPYTHON): ) $(MAKE) -C $(HOSTBUILD) install +# The `config.site` file contains settings that override the configuration +# settings provided by the `configure` script. Depending on the features +# enabled on NuttX, this file may need to be adjusted. + +$(CONFIG_SITE): + $(Q) ( cp $(CONFIG_SITE).in $(CONFIG_SITE)) +ifeq ($(CONFIG_ARCH_HAVE_FORK),y) + @echo "export ac_cv_func_fork=\"yes\"" >> $@ +else + @echo "export ac_cv_func_fork=\"no\"" >> $@ +endif +ifeq ($(CONFIG_SYSTEM_SYSTEM),y) + @echo "export ac_cv_func_system=\"yes\"" >> $@ +else + @echo "export ac_cv_func_system=\"no\"" >> $@ +endif + +# The `Setup.local` file enables or disables Python modules. +# Depending on the features enabled on NuttX, this file may need to be +# adjusted. Please note that the base `Setup.local.in` file only contains +# a section to disable Python modules. Inserting lines to it will disable +# such modules. + +$(SETUP_LOCAL): + $(Q) ( cp $(SETUP_LOCAL).in $(SETUP_LOCAL)) +ifneq ($(CONFIG_ARCH_HAVE_FORK),y) + @echo "_posixsubprocess" >> $@ +endif + # For the Python's `configure` script, please consider the following # when building for NuttX: # @@ -103,7 +133,7 @@ $(HOSTPYTHON): # Python/Modules/getpath.c (issue will be filed soon to track this # problem). -$(TARGETBUILD)/Makefile: $(HOSTPYTHON) +$(TARGETBUILD)/Makefile: $(HOSTPYTHON) $(CONFIG_SITE) $(SETUP_LOCAL) $(Q) mkdir -p $(TARGETBUILD)/Modules $(Q) mkdir -p $(TARGETMODULES)/python$(CPYTHON_VERSION_MINOR) $(Q) ( cp Setup.local $(TARGETBUILD)/Modules/Setup.local ) @@ -177,5 +207,7 @@ distclean:: $(call DELFILE, $(CPYTHON_ZIP)) $(call DELFILE, romfs_cpython_modules.img) $(call DELFILE, romfs_cpython_modules.h) + $(call DELFILE, config.site) + $(call DELFILE, Setup.local) include $(APPDIR)/Application.mk diff --git a/interpreters/python/Setup.local b/interpreters/python/Setup.local.in similarity index 100% rename from interpreters/python/Setup.local rename to interpreters/python/Setup.local.in diff --git a/interpreters/python/config.site b/interpreters/python/config.site.in similarity index 95% rename from interpreters/python/config.site rename to interpreters/python/config.site.in index 28313d75e7e..eb37e5a88c9 100644 --- a/interpreters/python/config.site +++ b/interpreters/python/config.site.in @@ -1,3 +1,4 @@ +export MODULE_BUILDTYPE="static" export ac_cv_file__dev_ptmx="no" export ac_cv_file__dev_ptc="no" export ac_cv_buggy_getaddrinfo="no" @@ -15,10 +16,9 @@ export ac_cv_func_clock_gettime="yes" export ac_cv_header_sys_syscall_h="no" export ac_cv_func_timegm="yes" export ac_cv_func_clock="yes" -export ac_cv_func_fork="yes" export ac_cv_func_waitpid="yes" export ac_cv_func_pipe="yes" export ac_cv_enable_strict_prototypes_warning="no" export ac_cv_func_getnameinfo="yes" export ac_cv_func_poll="yes" -export MODULE_BUILDTYPE="static" +export ac_cv_func_gethostname="yes" \ No newline at end of file From 87f4eb80215a0162193fa8be3610384da35a31ac Mon Sep 17 00:00:00 2001 From: Tiago Medicci Date: Wed, 29 Jan 2025 17:10:49 -0300 Subject: [PATCH 178/391] interpreters/python: add wrapper to initialize Python This wrapper application checks if the Python's modules are already mounted (and mounts them, if not), sets the necessary environment variables and, then, runs the Python interpreter. --- interpreters/python/Kconfig | 20 +--- interpreters/python/Makefile | 9 +- ...functions-used-by-NuttX-to-lowercase.patch | 33 +++++++ .../{mount_modules.c => python_wrapper.c} | 92 ++++++++++++++++--- 4 files changed, 116 insertions(+), 38 deletions(-) create mode 100644 interpreters/python/patch/0013-transform-functions-used-by-NuttX-to-lowercase.patch rename interpreters/python/{mount_modules.c => python_wrapper.c} (72%) diff --git a/interpreters/python/Kconfig b/interpreters/python/Kconfig index da20c8ec43f..947a71e6de2 100644 --- a/interpreters/python/Kconfig +++ b/interpreters/python/Kconfig @@ -27,7 +27,7 @@ config INTERPRETER_CPYTHON_STACKSIZE config INTERPRETER_CPYTHON_PRIORITY int "CPython task priority" - default 150 + default 100 ---help--- This is the priority of the CPython task. @@ -37,22 +37,4 @@ config INTERPRETER_CPYTHON_PROGNAME ---help--- This is the name of the program that will be used from the nsh. -config INTERPRETER_CPYTHON_MOUNT_MODULES_STACKSIZE - int "CPython's Modules Mount stack size" - default 4096 - ---help--- - This is the stack size allocated when the CPython's Modules Mount task runs. - -config INTERPRETER_CPYTHON_MOUNT_MODULES_PRIORITY - int "CPython's Modules Mount task priority" - default 150 - ---help--- - This is the priority of the CPython's Modules Mount task. - -config INTERPRETER_CPYTHON_MOUNT_MODULES_PROGNAME - string "CPython's Modules Mount app name" - default "python_mount_modules" - ---help--- - This is the name of the program that will be used from the nsh. - endif diff --git a/interpreters/python/Makefile b/interpreters/python/Makefile index 810904f502b..b6130af5f74 100644 --- a/interpreters/python/Makefile +++ b/interpreters/python/Makefile @@ -82,6 +82,7 @@ $(CPYTHON_UNPACKNAME): $(CPYTHON_ZIP) $(Q) patch -p1 -d $(CPYTHON_UNPACKNAME) < patch$(DELIM)0010-check-for-the-d_ino-member-of-the-structure-dirent.patch $(Q) patch -p1 -d $(CPYTHON_UNPACKNAME) < patch$(DELIM)0011-avoid-redefinition-warning-if-UNUSED-is-already-defi.patch $(Q) patch -p1 -d $(CPYTHON_UNPACKNAME) < patch$(DELIM)0012-hack-place-_PyRuntime-structure-into-PSRAM-bss-regio.patch + $(Q) patch -p1 -d $(CPYTHON_UNPACKNAME) < patch$(DELIM)0013-transform-functions-used-by-NuttX-to-lowercase.patch $(HOSTPYTHON): mkdir -p $(HOSTBUILD) @@ -175,13 +176,7 @@ PROGNAME += $(CONFIG_INTERPRETER_CPYTHON_PROGNAME) PRIORITY += $(CONFIG_INTERPRETER_CPYTHON_PRIORITY) STACKSIZE += $(CONFIG_INTERPRETER_CPYTHON_STACKSIZE) -MAINSRC += python.c - -PROGNAME += $(CONFIG_INTERPRETER_CPYTHON_MOUNT_MODULES_PROGNAME) -PRIORITY += $(CONFIG_INTERPRETER_CPYTHON_MOUNT_MODULES_PRIORITY) -STACKSIZE += $(CONFIG_INTERPRETER_CPYTHON_MOUNT_MODULES_STACKSIZE) - -MAINSRC += mount_modules.c +MAINSRC += python_wrapper.c checkgenromfs: @genromfs -h 1>/dev/null 2>&1 || { \ diff --git a/interpreters/python/patch/0013-transform-functions-used-by-NuttX-to-lowercase.patch b/interpreters/python/patch/0013-transform-functions-used-by-NuttX-to-lowercase.patch new file mode 100644 index 00000000000..c1e83aad640 --- /dev/null +++ b/interpreters/python/patch/0013-transform-functions-used-by-NuttX-to-lowercase.patch @@ -0,0 +1,33 @@ +From 914c80b7969d73840bc1b573b478d9148999b7d0 Mon Sep 17 00:00:00 2001 +From: Tiago Medicci +Date: Fri, 31 Jan 2025 14:06:21 -0300 +Subject: [PATCH 13/13] transform functions used by NuttX to lowercase + +--- + Include/pylifecycle.h | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/Include/pylifecycle.h b/Include/pylifecycle.h +index de1bcb1d2cb..044780ee188 100644 +--- a/Include/pylifecycle.h ++++ b/Include/pylifecycle.h +@@ -33,6 +33,16 @@ PyAPI_FUNC(void) _Py_NO_RETURN Py_Exit(int); + PyAPI_FUNC(int) Py_Main(int argc, wchar_t **argv); + PyAPI_FUNC(int) Py_BytesMain(int argc, char **argv); + ++#if defined(__NuttX__) ++#define py_bytesmain Py_BytesMain ++#endif ++ ++void _PyRuntime_Early_Init(void); ++ ++#if defined(__NuttX__) ++#define _pyruntime_early_init _PyRuntime_Early_Init ++#endif ++ + /* In pathconfig.c */ + Py_DEPRECATED(3.11) PyAPI_FUNC(void) Py_SetProgramName(const wchar_t *); + Py_DEPRECATED(3.13) PyAPI_FUNC(wchar_t *) Py_GetProgramName(void); +-- +2.47.1 + diff --git a/interpreters/python/mount_modules.c b/interpreters/python/python_wrapper.c similarity index 72% rename from interpreters/python/mount_modules.c rename to interpreters/python/python_wrapper.c index 681031579c4..1eb1d3cc3e0 100644 --- a/interpreters/python/mount_modules.c +++ b/interpreters/python/python_wrapper.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/interpreters/python/mount_modules.c + * apps/interpreters/python/python_wrapper.c * * SPDX-License-Identifier: Apache-2.0 * @@ -41,11 +41,14 @@ #include #include #include +#include #include #include "romfs_cpython_modules.h" +#include "Python.h" + /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ @@ -61,7 +64,7 @@ #endif #ifndef CONFIG_CPYTHON_ROMFS_MOUNTPOINT -# define CONFIG_CPYTHON_ROMFS_MOUNTPOINT "/usr/local/lib/" +# define CONFIG_CPYTHON_ROMFS_MOUNTPOINT "/usr/local/lib" #endif #ifdef CONFIG_DISABLE_MOUNTPOINT @@ -90,19 +93,57 @@ ****************************************************************************/ /**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: mount_modules + * Name: check_and_mount_romfs + * + * Description: + * Check if the ROMFS is already mounted, and if not, mount it. + * + * Input Parameters: + * None + * + * Returned Value: + * 0 on success, 1 on failure + * ****************************************************************************/ -int main(int argc, FAR char *argv[]) +static int check_and_mount_romfs(void) { - int ret; + int ret = OK; struct boardioc_romdisk_s desc; + FILE *fp; + char line[256]; + int is_mounted = 0; - /* Create a RAM disk for the test */ + /* Check if the device is already mounted */ + + fp = fopen("/proc/fs/mount", "r"); + if (fp == NULL) + { + printf("ERROR: Failed to open /proc/fs/mount\n"); + UNUSED(desc); + return ret = ERROR; + } + + while (fgets(line, sizeof(line), fp)) + { + if (strstr(line, CONFIG_CPYTHON_ROMFS_MOUNTPOINT) != NULL) + { + is_mounted = 1; + break; + } + } + + fclose(fp); + + if (is_mounted) + { + _info("Device is already mounted at %s\n", + CONFIG_CPYTHON_ROMFS_MOUNTPOINT); + UNUSED(desc); + return ret; + } + + /* Create a RAM disk */ desc.minor = CONFIG_CPYTHON_ROMFS_RAMDEVNO; /* Minor device number of the ROM disk. */ desc.nsectors = NSECTORS(romfs_cpython_modules_img_len); /* The number of sectors in the ROM disk */ @@ -119,8 +160,8 @@ int main(int argc, FAR char *argv[]) /* Mount the test file system */ - printf("Mounting ROMFS filesystem at target=%s with source=%s\n", - CONFIG_CPYTHON_ROMFS_MOUNTPOINT, MOUNT_DEVNAME); + _info("Mounting ROMFS filesystem at target=%s with source=%s\n", + CONFIG_CPYTHON_ROMFS_MOUNTPOINT, MOUNT_DEVNAME); ret = mount(MOUNT_DEVNAME, CONFIG_CPYTHON_ROMFS_MOUNTPOINT, "romfs", MS_RDONLY, NULL); @@ -132,3 +173,30 @@ int main(int argc, FAR char *argv[]) return 0; } + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: python_wrapper_main + ****************************************************************************/ + +int main(int argc, FAR char *argv[]) +{ + int ret; + + ret = check_and_mount_romfs(); + if (ret != 0) + { + return ret; + } + + _pyruntime_early_init(); + + setenv("PYTHONHOME", "/usr/local", 1); + + setenv("PYTHON_BASIC_REPL", "1", 1); + + return py_bytesmain(argc, argv); +} From 43439a6b16a435bce7d9ac85f05c3a6013f91348 Mon Sep 17 00:00:00 2001 From: Tiago Medicci Date: Thu, 23 Jan 2025 16:43:01 -0300 Subject: [PATCH 179/391] interpreters/python: set ROMFS-generated data to const char This allows the data to be placed in the .rodata section, which can be allocated in the flash or other read-only storage, freeing the internal memory. --- interpreters/python/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interpreters/python/Makefile b/interpreters/python/Makefile index b6130af5f74..af5c8b89f6a 100644 --- a/interpreters/python/Makefile +++ b/interpreters/python/Makefile @@ -189,7 +189,7 @@ romfs_cpython_modules.img : $(TARGETLIBPYTHON) checkgenromfs @genromfs -f $@ -d $(TARGETMODULES) -V "ROMFS_Test" || { echo "genromfs failed" ; exit 1 ; } romfs_cpython_modules.h : romfs_cpython_modules.img - @xxd -i $< >$@ || { echo "xxd of $< failed" ; exit 1 ; } + @xxd -i $< | sed -e "s/^unsigned/static const unsigned/g" >$@ || { echo "xxd of $< failed" ; exit 1 ; } context:: $(CPYTHON_UNPACKNAME) From 5d7ff307c2cb61059522c3a6aec3e790bbf58b3d Mon Sep 17 00:00:00 2001 From: Luchian Mihai Date: Mon, 3 Feb 2025 12:31:53 +0200 Subject: [PATCH 180/391] examples/amg88xx: fix kconfig fix amg88xx kconfig EXAMPLES_AMG88XX_STACKSIZE option name add depends on SENSORS_AMG88XX to hide the example is the driver is not enabled --- examples/amg88xx/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/amg88xx/Kconfig b/examples/amg88xx/Kconfig index 53e663f0022..c79092881b0 100644 --- a/examples/amg88xx/Kconfig +++ b/examples/amg88xx/Kconfig @@ -1,6 +1,7 @@ config EXAMPLES_AMG88XX tristate "AMG88xx sensor example" default n + depends on SENSORS_AMG88XX ---help--- Enable the AMG88xx sensor example @@ -17,7 +18,7 @@ config EXAMPLES_AMG88XX_PRIORITY int "AMG88xx task priority" default 100 -config EXAMPLES_DHTXX_STACKSIZE +config EXAMPLES_AMG88XX_STACKSIZE int "AMG88xx stack size" default DEFAULT_TASK_STACKSIZE From f139e56cd62a30d6edcd7207c7e4cbc6e9b8b7d1 Mon Sep 17 00:00:00 2001 From: Tiago Medicci Date: Wed, 5 Feb 2025 10:39:19 -0300 Subject: [PATCH 181/391] testing/libc/wcstombs: Add testing application for wcstombs This application test the libc's `wcstombs` function for different len sizes (bigger than the converted string, exactly the size of it and smaller than it). --- testing/libc/wcstombs/CMakeLists.txt | 35 ++++ testing/libc/wcstombs/Kconfig | 30 ++++ testing/libc/wcstombs/Make.defs | 25 +++ testing/libc/wcstombs/Makefile | 36 +++++ testing/libc/wcstombs/wcstombs_main.c | 224 ++++++++++++++++++++++++++ 5 files changed, 350 insertions(+) create mode 100644 testing/libc/wcstombs/CMakeLists.txt create mode 100644 testing/libc/wcstombs/Kconfig create mode 100644 testing/libc/wcstombs/Make.defs create mode 100644 testing/libc/wcstombs/Makefile create mode 100644 testing/libc/wcstombs/wcstombs_main.c diff --git a/testing/libc/wcstombs/CMakeLists.txt b/testing/libc/wcstombs/CMakeLists.txt new file mode 100644 index 00000000000..c58cc1f2db6 --- /dev/null +++ b/testing/libc/wcstombs/CMakeLists.txt @@ -0,0 +1,35 @@ +# ############################################################################## +# apps/testing/libc/wcstombs/CMakeLists.txt +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_TESTING_WCSTOMBS) + nuttx_add_application( + NAME + ${CONFIG_TESTING_WCSTOMBS_PROGNAME} + PRIORITY + ${CONFIG_TESTING_WCSTOMBS_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_WCSTOMBS_STACKSIZE} + MODULE + ${CONFIG_TESTING_WCSTOMBS} + SRCS + wcstombs_main.c) +endif() diff --git a/testing/libc/wcstombs/Kconfig b/testing/libc/wcstombs/Kconfig new file mode 100644 index 00000000000..41d72b50778 --- /dev/null +++ b/testing/libc/wcstombs/Kconfig @@ -0,0 +1,30 @@ +# +# For a description of the syntax of this configuration file, +# see the file kconfig-language.txt in the NuttX tools repository. +# + +config TESTING_WCSTOMBS + tristate "wcstombs() test" + default n + depends on LIBC_LOCALE + ---help--- + Enable wcstombs() test + +if TESTING_WCSTOMBS + +config TESTING_WCSTOMBS_PROGNAME + string "Program name" + default "wcstombs" + ---help--- + This is the name of the program that will be used when the NSH ELF + program is installed. + +config TESTING_WCSTOMBS_PRIORITY + int "wcstombs task priority" + default 100 + +config TESTING_WCSTOMBS_STACKSIZE + int "wcstombs stack size" + default DEFAULT_TASK_STACKSIZE + +endif diff --git a/testing/libc/wcstombs/Make.defs b/testing/libc/wcstombs/Make.defs new file mode 100644 index 00000000000..3c1ac4c832e --- /dev/null +++ b/testing/libc/wcstombs/Make.defs @@ -0,0 +1,25 @@ +############################################################################ +# apps/testing/libc/wcstombs/Make.defs +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +ifneq ($(CONFIG_TESTING_WCSTOMBS),) +CONFIGURED_APPS += $(APPDIR)/testing/libc/wcstombs +endif diff --git a/testing/libc/wcstombs/Makefile b/testing/libc/wcstombs/Makefile new file mode 100644 index 00000000000..a5fb15ddc1d --- /dev/null +++ b/testing/libc/wcstombs/Makefile @@ -0,0 +1,36 @@ +############################################################################ +# apps/testing/libc/wcstombs/Makefile +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +include $(APPDIR)/Make.defs + +# wcstombs() test built-in application info + +PROGNAME = $(CONFIG_TESTING_WCSTOMBS_PROGNAME) +PRIORITY = $(CONFIG_TESTING_WCSTOMBS_PRIORITY) +STACKSIZE = $(CONFIG_TESTING_WCSTOMBS_STACKSIZE) +MODULE = $(CONFIG_TESTING_WCSTOMBS) + +# wcstombs test files + +MAINSRC = wcstombs_main.c + +include $(APPDIR)/Application.mk diff --git a/testing/libc/wcstombs/wcstombs_main.c b/testing/libc/wcstombs/wcstombs_main.c new file mode 100644 index 00000000000..73f5e504e46 --- /dev/null +++ b/testing/libc/wcstombs/wcstombs_main.c @@ -0,0 +1,224 @@ +/**************************************************************************** + * apps/testing/libc/wcstombs/wcstombs_main.c + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +#include +#include +#include +#include + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +int main(void) +{ + /* Local variable declarations */ + + const wchar_t *src; + size_t dst_size; + char *dst; + size_t ret; + size_t i; + + printf("wcstombs Test application:\n"); + + /* Set the locale to the user's default locale */ + + setlocale(LC_ALL, ""); + + /* Example wide character array (source) */ + + src = L"Hello, world!"; + + /* Calculate the required size for the dst buffer */ + + dst_size = wcstombs(NULL, src, 0) + 1; /* +1 for the null terminator */ + dst = (char *)malloc(dst_size); + + if (dst == NULL) + { + printf("ERROR: malloc failed.\n"); + return EXIT_FAILURE; + } + + printf("\nTest Scenario: len is bigger than the size of the converted " + "string. Expected the null-terminator at the end of the converted " + "string.\n"); + + /* Initialize dst with a known value (0xaa) */ + + memset(dst, 0xaa, dst_size); + + /* Convert wide characters to multibyte characters */ + + ret = wcstombs(dst, src, dst_size); + + /* Check if the conversion was successful */ + + if (ret == (size_t)-1) + { + printf("ERROR: wcstombs failed.\n"); + free(dst); + return EXIT_FAILURE; + } + + /* Print the return code */ + + printf("Return code: %zu\n", ret); + + /* Print the dst buffer as an array of uint8_t elements */ + + printf("dst buffer (as uint8_t array): "); + for (i = 0; i < dst_size; i++) /* Include the null terminator in the output */ + { + printf("%02x ", (uint8_t)dst[i]); + } + + printf("\n"); + + /* Check if the dst value just after the return value is as expected */ + + if (dst[ret] == '\0') + { + printf("The character just after the return value is the null " + "terminating character.\n"); + } + else + { + printf("The character just after the return value is not the expected " + "null-terminator (value: %02x). This is a bug!\n", dst[ret]); + free(dst); + return EXIT_FAILURE; + } + + printf("\nTest Scenario: len is exactly the size of the converted string. " + "Do not expected the null-terminator at the end of the converted " + "string.\n"); + + /* Initialize dst with a known value (0xaa) */ + + memset(dst, 0xaa, dst_size); + + /* Convert wide characters to multibyte characters */ + + ret = wcstombs(dst, src, dst_size - 1); + + /* Check if the conversion was successful */ + + if (ret == (size_t)-1) + { + printf("ERROR: wcstombs failed.\n"); + free(dst); + return EXIT_FAILURE; + } + + /* Print the return code */ + + printf("Return code: %zu\n", ret); + + /* Print the dst buffer as an array of uint8_t elements */ + + printf("dst buffer (as uint8_t array): "); + for (i = 0; i < dst_size; i++) /* Include the null terminator in the output */ + { + printf("%02x ", (uint8_t)dst[i]); + } + + printf("\n"); + + /* Check if the dst value just after the return value is as expected */ + + if ((uint8_t)dst[ret] == 0xaa) + { + printf("The character just after the return value is the expected " + "0xaa value. No null-terminator.\n"); + } + else + { + printf("The character just after the return value is not the expected " + "0xaa (value: %02x). This is a bug!\n", dst[ret]); + free(dst); + return EXIT_FAILURE; + } + + printf("\nTest Scenario: len is smaller than the size of the converted " + " string. Do not expected the null-terminator at the end of the " + "converted string.\n"); + + /* Initialize dst with a known value (0xaa) */ + + memset(dst, 0xaa, dst_size); + + /* Convert wide characters to multibyte characters */ + + ret = wcstombs(dst, src, dst_size - 2); + + /* Check if the conversion was successful */ + + if (ret == (size_t)-1) + { + printf("ERROR: wcstombs failed.\n"); + free(dst); + return EXIT_FAILURE; + } + + /* Print the return code */ + + printf("Return code: %zu\n", ret); + + /* Print the dst buffer as an array of uint8_t elements */ + + printf("dst buffer (as uint8_t array): "); + for (i = 0; i < dst_size; i++) /* Include the null terminator in the output */ + { + printf("%02x ", (uint8_t)dst[i]); + } + + printf("\n"); + + /* Check if the dst value just after the return value is as expected */ + + if ((uint8_t)dst[ret] == 0xaa) + { + printf("The character just after the return value is the expected " + "0xaa value. No null-terminator.\n"); + } + else + { + printf("The character just after the return value is not the expected " + "0xaa (value: %02x). This is a bug!\n", dst[ret]); + free(dst); + return EXIT_FAILURE; + } + + /* Free the allocated memory */ + + free(dst); + + return EXIT_SUCCESS; +} From fb0c1e10ded2a6fb9f066b9893662cbcc86e4646 Mon Sep 17 00:00:00 2001 From: Matteo Golin Date: Thu, 6 Feb 2025 15:36:30 -0500 Subject: [PATCH 182/391] system/uorb: require that LIBC_FLOATINGPOINT be enabled for DEBUG_UORB This change prevents users from trying to use the `uorb_listener` application without having floating point printing enabled on systems that do not have an FPU (systems with FPUs have `LIBC_FLOATINGPOINT`) enabled by default. Solution dicussed and agreed in: https://github.com/apache/nuttx/issues/15599. --- system/uorb/Kconfig | 1 + system/uorb/listener.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/system/uorb/Kconfig b/system/uorb/Kconfig index 576751abb0a..8457c136239 100644 --- a/system/uorb/Kconfig +++ b/system/uorb/Kconfig @@ -41,6 +41,7 @@ endif # UORB_TESTS config DEBUG_UORB bool "uorb debug output" select LIBC_PRINT_EXTENSION + depends on LIBC_FLOATINGPOINT default n if DEBUG_UORB diff --git a/system/uorb/listener.c b/system/uorb/listener.c index 08b57e6e128..4897c63ec51 100644 --- a/system/uorb/listener.c +++ b/system/uorb/listener.c @@ -49,6 +49,10 @@ #define ORB_TOP_WAIT_TIME 1000 #define ORB_DATA_DIR "/data/uorb/" +#if defined(CONFIG_DEBUG_UORB) && !defined(CONFIG_LIBC_FLOATINGPOINT) +#error "Enable CONFIG_LIBC_FLOATINGPOINT, required to see debug output" +#endif + /**************************************************************************** * Private Types ****************************************************************************/ From 7f424c3e8ddaa0a6a828175b8e4205c1cc0a2a8a Mon Sep 17 00:00:00 2001 From: chao an Date: Fri, 7 Feb 2025 22:49:17 +0800 Subject: [PATCH 183/391] nshlib/builtin: check background task before restore the signal fix crash if: CONFIG_SCHED_WAITPID=n CONFIG_SCHED_CHILD_STATUS=y The old signal will be restored only when sigaction is saved to avoid invaild access. Signed-off-by: chao an --- nshlib/nsh_builtin.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nshlib/nsh_builtin.c b/nshlib/nsh_builtin.c index 6ff8f99a6be..196220f41fa 100644 --- a/nshlib/nsh_builtin.c +++ b/nshlib/nsh_builtin.c @@ -234,7 +234,13 @@ int nsh_builtin(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd, /* Restore the old actions */ - sigaction(SIGCHLD, &old, NULL); +# ifndef CONFIG_SCHED_WAITPID + if (vtbl->np.np_bg == true) +# endif + { + sigaction(SIGCHLD, &old, NULL); + } + # endif struct sched_param sched; sched_getparam(ret, &sched); From db8542d2b12a93c39a154ef5d100daecceeb9863 Mon Sep 17 00:00:00 2001 From: Tiago Medicci Date: Wed, 12 Feb 2025 15:46:20 -0300 Subject: [PATCH 184/391] interpreters/python: fix patch to set `_PyRuntime` attribute This commit also adds the check for the `__NuttX__` macro to the patch file that allows setting an attribute to the `_PyRuntime` structure. The `__NuttX__` macro is guaranteed to be present when building any application for NuttX. --- ...e-_PyRuntime-structure-into-PSRAM-bss-regio.patch | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/interpreters/python/patch/0012-hack-place-_PyRuntime-structure-into-PSRAM-bss-regio.patch b/interpreters/python/patch/0012-hack-place-_PyRuntime-structure-into-PSRAM-bss-regio.patch index d64342e551c..2cda0d5887e 100644 --- a/interpreters/python/patch/0012-hack-place-_PyRuntime-structure-into-PSRAM-bss-regio.patch +++ b/interpreters/python/patch/0012-hack-place-_PyRuntime-structure-into-PSRAM-bss-regio.patch @@ -1,7 +1,7 @@ -From d1e903f516849c535455904b3c3f8a33665c1a88 Mon Sep 17 00:00:00 2001 +From 79b6142580bad5235588faf38c0a22c7280a2d1b Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Wed, 23 Oct 2024 16:52:52 +0200 -Subject: [PATCH 12/12] hack: place _PyRuntime structure into PSRAM bss region, +Subject: [PATCH 12/13] hack: place _PyRuntime structure into PSRAM bss region, initialize later _PyRuntime occupies around 100kB of RAM in .data region, making it @@ -22,14 +22,14 @@ Co-authored-by: Tiago Medicci Serrano 1 file changed, 11 insertions(+) diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c -index 1701a1cd217..2a8e544f0ac 100644 +index 1701a1cd217..93aa808bc03 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -102,12 +102,23 @@ __attribute__(( _PyRuntimeState _PyRuntime #if defined(__linux__) && (defined(__GNUC__) || defined(__clang__)) __attribute__ ((section (".PyRuntime"))) -+#elif defined(ESP_PLATFORM) ++#elif defined(ESP_PLATFORM) || defined(__NuttX__) +__attribute__ ((section (".PyRuntime"))) #endif = _PyRuntimeState_INIT(_PyRuntime, _Py_Debug_Cookie); @@ -38,7 +38,7 @@ index 1701a1cd217..2a8e544f0ac 100644 static int runtime_initialized = 0; +void _PyRuntime_Early_Init(void) { -+#if defined(ESP_PLATFORM) ++#if defined(ESP_PLATFORM) || defined(__NuttX__) + // Normally, _PyRuntime is in .data and is initialized by the C runtime. + // This function allows us to place it into external RAM .bss section + // and initialize it manually, saving some internal RAM. @@ -50,5 +50,5 @@ index 1701a1cd217..2a8e544f0ac 100644 _PyRuntime_Initialize(void) { -- -2.47.1 +2.48.1 From 62894b9baf2978815ceec454e53118e6d83c84f6 Mon Sep 17 00:00:00 2001 From: Felipe Moura Date: Sun, 16 Feb 2025 20:57:45 -0300 Subject: [PATCH 185/391] examples/spislave_test: Add user data receive Improve example, now it can receive commands / data from user; Fixed indentation issues. Signed-off-by: Felipe Moura --- examples/spislv_test/spislv_test.c | 563 ++++++++++++++++++++++++++--- 1 file changed, 520 insertions(+), 43 deletions(-) diff --git a/examples/spislv_test/spislv_test.c b/examples/spislv_test/spislv_test.c index 763bee76f7d..2ad13c236e0 100644 --- a/examples/spislv_test/spislv_test.c +++ b/examples/spislv_test/spislv_test.c @@ -24,81 +24,558 @@ * Included Files ****************************************************************************/ -#include #include +#include +#include #include -#include #include -#include -#include +#include +#include +#include -#define SOURCE_FILE "/dev/spislv2" -#define BUFFER_SIZE 256 +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* Define buffer sizes */ +#define RX_BUFFER_SIZE 64 +#define TX_BUFFER_SIZE 64 +#define SOURCE_FILE "dev/spislv2" /* SPI device path */ + +/* Enumeration for operation modes */ + +typedef enum +{ + MODE_WRITE, + MODE_LISTEN, + MODE_ECHO, + MODE_INVALID +} operation_mode_t; /**************************************************************************** - * Public Functions + * Structure to hold program configurations ****************************************************************************/ +typedef struct +{ + operation_mode_t mode; + int num_bytes; /* Applicable for write mode */ + int timeout_seconds; /* Applicable for all modes */ + unsigned char tx_buffer[TX_BUFFER_SIZE]; +} program_config_t; + /**************************************************************************** - * spislv_test + * Private Functions ****************************************************************************/ -int main(int argc, FAR char *argv[]) +/** + * @brief Converts a single hexadecimal character to its byte value. + * + * @param c The hexadecimal character. + * @return The byte value of the hexadecimal character, or -1 if invalid. + */ + +static int hexchar_to_byte(char c) { - int fd; - char buffer[BUFFER_SIZE]; - ssize_t bytes_read; - ssize_t i; + if (c >= '0' && c <= '9') + { + return c - '0'; + } - printf("Slave started!!\n"); - fd = open(SOURCE_FILE, O_RDWR); + c = tolower(c); - if (fd < 0) + if (c >= 'a' && c <= 'f') { - printf("Failed to open %s: %s\n", SOURCE_FILE, strerror(errno)); - return 0; + return c - 'a' + 10; } - while (1) + return -1; +} + +/** + * @brief Converts a hexadecimal string to a byte array. + * + * @param hexstr The input hexadecimal string. + * @param bytes The output byte array. + * @param max_bytes The maximum number of bytes to convert. + * @return The number of bytes converted, or -1 on error. + */ + +static int hexstr_to_bytes(const char *hexstr, unsigned char *bytes, + size_t max_bytes) +{ + int len; + int i; + + len = strlen(hexstr); + if (len % 2 != 0 || len / 2 > max_bytes) + { + return -1; + } + + for (i = 0; i < len / 2; i++) + { + int high = hexchar_to_byte(hexstr[2 * i]); + int low = hexchar_to_byte(hexstr[2 * i + 1]); + + if (high == -1 || low == -1) + { + return -1; + } + + bytes[i] = (high << 4) | low; + } + + return len / 2; +} + +/** + * @brief Parses and validates command-line arguments. + * + * @param argc Argument count. + * @param argv Argument vector. + * @param config Pointer to the program configuration structure. + * @return 0 on success, -1 on failure. + */ + +static int parse_arguments(int argc, char *argv[], + program_config_t *config) +{ + int opt; + + /* Set default configurations */ + + config->mode = MODE_INVALID; + config->num_bytes = 0; + config->timeout_seconds = 10; /* Default timeout */ + + /* Parse command-line options */ + + while ((opt = getopt(argc, argv, "x:t:le")) != -1) + { + switch (opt) + { + case 'x': + if (config->mode != MODE_INVALID) + { + fprintf(stderr, + "Error: Multiple operation modes specified.\n"); + return -1; + } + + config->mode = MODE_WRITE; + config->num_bytes = atoi(optarg); + if (config->num_bytes <= 0 || + config->num_bytes > TX_BUFFER_SIZE) + { + fprintf(stderr, + "Error: Invalid number of bytes for write mode.\n"); + return -1; + } + + break; + + case 't': + config->timeout_seconds = atoi(optarg); + if (config->timeout_seconds <= 0) + { + fprintf(stderr, + "Error: Timeout must be a positive integer.\n"); + return -1; + } + break; + + case 'l': + if (config->mode != MODE_INVALID) + { + fprintf(stderr, + "Error: Multiple operation modes specified.\n"); + return -1; + } + + config->mode = MODE_LISTEN; + break; + + case 'e': + if (config->mode != MODE_INVALID) + { + fprintf(stderr, + "Error: Multiple operation modes specified.\n"); + return -1; + } + + config->mode = MODE_ECHO; + break; + + default: + fprintf(stderr, "Usage:\n"); + fprintf(stderr, + " %s -x [-t ] \n", + argv[0]); + fprintf(stderr, + " %s -l [-t ]\n", argv[0]); + fprintf(stderr, + " %s -e [-t ]\n", argv[0]); + printf("Examples:\n"); + printf(" spislv -x 2 abba\n"); + printf(" spislv -l -t 5\n"); + printf(" spislv -e -t 10\n\n"); + return -1; + } + } + + /* Validate mutual exclusivity and required arguments */ + + if (config->mode == MODE_WRITE) { - /* Read the number from the source file */ + if (optind >= argc) + { + fprintf(stderr, + "Error: Missing hexadecimal bytes to send.\n"); + fprintf(stderr, + "Usage: %s -x [-t ] \n", + argv[0]); + return -1; + } + + char *hex_input = argv[optind]; - printf("Slave: Reading from %s\n", SOURCE_FILE); - bytes_read = read(fd, buffer, BUFFER_SIZE - 1); + /* Verify the hexadecimal string length */ - if (bytes_read < 0) + if (strlen(hex_input) != (size_t)(config->num_bytes * 2)) { - printf("Failed to read from %s: %s\n", - SOURCE_FILE, strerror(errno)); - close(fd); - return 0; + fprintf(stderr, + "Error: Hex string length must be %d characters\n" + "for %d bytes.\n", + config->num_bytes * 2, config->num_bytes); + return -1; } - else if (bytes_read > 0) + + /* Convert hexadecimal string to byte array */ + + int converted = hexstr_to_bytes(hex_input, config->tx_buffer, + TX_BUFFER_SIZE); + if (converted != config->num_bytes) { - buffer[bytes_read] = '\0'; + fprintf(stderr, "Error: Invalid hexadecimal string.\n"); + return -1; + } + } - /* Print buffer in hexadecimal format */ + else if (config->mode == MODE_INVALID) + { + fprintf(stderr, "Error: No operation mode specified.\n"); + fprintf(stderr, "Usage:\n"); + fprintf(stderr, + " %s -x [-t ] \n", + argv[0]); + fprintf(stderr, + " %s -l [-t ]\n", argv[0]); + fprintf(stderr, + " %s -e [-t ]\n", argv[0]); + printf("Examples:\n"); + printf(" spislv -x 2 abba\n"); + printf(" spislv -l -t 5\n"); + printf(" spislv -e -t 10\n"); + return -1; + } + + return 0; +} + +/** + * @brief Executes the write mode: sends specified bytes to the master. + * + * @param config Pointer to the program configuration structure. + * @param fd File descriptor for the SPI device. + * @return 0 on success, -1 on failure. + */ + +static int write_mode(program_config_t *config, int fd) +{ + ssize_t bytes_written; + char data_str[3 * TX_BUFFER_SIZE + 1]; /* Buffer for debug string */ + char *ptr = data_str; + int len; + int i; + + for (i = 0; i < config->num_bytes; i++) + { + len = snprintf(ptr, sizeof(data_str) - (ptr - data_str), + "%02X ", config->tx_buffer[i]); + if (len < 0 || len >= (int)(sizeof(data_str) - (ptr - data_str))) + { + break; + } + + ptr += len; + } - printf("Slave: Read value in hex: "); - for (i = 0; i < bytes_read; ++i) + *ptr = '\0'; + + printf("Slave: Queuing %d bytes for sending to master: %s\n", + config->num_bytes, data_str); + + bytes_written = write(fd, config->tx_buffer, config->num_bytes); + if (bytes_written < 0) + { + fprintf(stderr, "Error: Failed to write to %s: %s\n", + SOURCE_FILE, strerror(errno)); + return -1; + } + + else if (bytes_written != config->num_bytes) + { + fprintf(stderr, "Error: Incomplete write. Expected %d, got %zd\n", + config->num_bytes, bytes_written); + return -1; + } + + return 0; +} + +/** + * @brief Executes the listen-only mode: waits for data from the master. + * + * @param config Pointer to the program configuration structure. + * @param fd File descriptor for the SPI device. + * @return 0 on success, -1 on failure. + */ + +static int listen_mode(program_config_t *config, int fd) +{ + printf("Slave: Listen-only mode activated. Waiting for data\n" + " from master.\n"); + + return 0; +} + +/** + * @brief Executes the echo mode: continuously echoes received data to + * the master. + * + * @param config Pointer to the program configuration structure. + * @param fd File descriptor for the SPI device. + * @return 0 on success, -1 on failure. + */ + +static int echo_mode_func(program_config_t *config, int fd) +{ + printf("Slave: Echo mode activated. Will echo received data until\n" + " timeout.\n"); + + return 0; +} + +/** + * @brief Reads data from the SPI device with a specified timeout. + * Depending on the mode, it either exits after the first read or + * continues (echo mode). + * + * @param config Pointer to the program configuration structure. + * @param fd File descriptor for the SPI device. + * @return 0 on success, -1 on failure or timeout. + */ + +static int read_with_timeout(program_config_t *config, int fd) +{ + unsigned char buffer_rx[RX_BUFFER_SIZE]; + ssize_t bytes_read; + ssize_t bytes_written; + int select_ret; + + while (1) + { + fd_set read_fds; + struct timeval timeout; + + FD_ZERO(&read_fds); + FD_SET(fd, &read_fds); + + timeout.tv_sec = config->timeout_seconds; + timeout.tv_usec = 0; + + select_ret = select(fd + 1, &read_fds, + NULL, NULL, &timeout); + if (select_ret == -1) + { + fprintf(stderr, "Error: Select failed: %s\n", + strerror(errno)); + return -1; + } + else if (select_ret == 0) + { + if (config->mode == MODE_ECHO) + { + printf("Communication timeout after %d seconds. No more\n" + "data received from master.\n", + config->timeout_seconds); + } + else { - printf("%02x ", (unsigned char)buffer[i]); + printf("Communication timeout after %d seconds. No data\n" + "received from master.\n", + config->timeout_seconds); } - printf("\n"); + return -1; + } + else + { + bytes_read = read(fd, buffer_rx, RX_BUFFER_SIZE); + if (bytes_read < 0) + { + fprintf(stderr, "Error: Failed to read from %s: %s\n", + SOURCE_FILE, strerror(errno)); + return -1; + } - /* Write the same value back */ + else if (bytes_read == 0) + { + printf("No data received from master.\n"); + } - printf("Slave: Writing %d bytes back to %s\n", - bytes_read, SOURCE_FILE); - ssize_t bytes_written = write(fd, buffer, bytes_read); - if (bytes_written < 0) + else { - printf("Failed to write to %s: %s\n", - SOURCE_FILE, strerror(errno)); - close(fd); - return 0; + printf("Data received from master (%zd bytes): ", + bytes_read); + for (int i = 0; i < bytes_read; i++) + { + printf("%02X ", buffer_rx[i]); + } + + printf("\n"); + if (config->mode == MODE_ECHO) + { + bytes_written = write(fd, buffer_rx, + bytes_read); + if (bytes_written < 0) + { + fprintf(stderr, + "Error: Failed to write to %s: %s\n", + SOURCE_FILE, strerror(errno)); + return -1; + } + else if (bytes_written != bytes_read) + { + printf("Error: Incomplete write during echo. "); + fprintf(stderr, "Expected %zd, got %zd\n", + bytes_read, bytes_written); + return -1; + } + + printf("Echoed back %zd bytes to master.\n", + bytes_written); + } + + if (config->mode != MODE_ECHO) + { + break; + } } } } + + return 0; +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/** + * @brief Main function orchestrating the SPI slave operations based on + * user input. + * + * @param argc Argument count. + * @param argv Argument vector. + * @return 0 on success, -1 on failure. + */ + +int main(int argc, char *argv[]) +{ + program_config_t config; + int fd; + int ret = 0; + + if (parse_arguments(argc, argv, &config) != 0) + { + return -1; + } + + fd = open(SOURCE_FILE, O_RDWR); + if (fd < 0) + { + fprintf(stderr, "Error: Failed to open %s: %s\n", + SOURCE_FILE, strerror(errno)); + return -1; + } + + /* Ensure the file descriptor is in blocking mode */ + + int flags = fcntl(fd, F_GETFL, 0); + if (flags == -1) + { + fprintf(stderr, "Error: Failed to get file flags: %s\n", + strerror(errno)); + close(fd); + return -1; + } + + flags &= ~O_NONBLOCK; + if (fcntl(fd, F_SETFL, flags) == -1) + { + fprintf(stderr, "Error: Failed to set blocking mode: %s\n", + strerror(errno)); + close(fd); + return -1; + } + + /* Execute the selected mode */ + + switch (config.mode) + { + case MODE_WRITE: + ret = write_mode(&config, fd); + if (ret != 0) + { + close(fd); + return -1; + } + break; + + case MODE_LISTEN: + ret = listen_mode(&config, fd); + if (ret != 0) + { + close(fd); + return -1; + } + break; + + case MODE_ECHO: + ret = echo_mode_func(&config, fd); + if (ret != 0) + { + close(fd); + return -1; + } + break; + + default: + fprintf(stderr, "Error: Invalid operation mode.\n"); + close(fd); + return -1; + } + + ret = read_with_timeout(&config, fd); + if (ret != 0) + { + close(fd); + return -1; + } + + printf("\n"); + close(fd); + return 0; } From 5de75adfb4413c161845f0ef7cee81535756bf2c Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Thu, 13 Feb 2025 21:04:02 +0800 Subject: [PATCH 186/391] system/fastboot: Add prefix "SYSTEM" for USB boardctl configuration - FASTBOOTD_USB_BOARDCTL + SYSTEM_FASTBOOTD_USB_BOARDCTL Signed-off-by: wangjianyu3 --- system/fastboot/Kconfig | 3 ++- system/fastboot/fastboot.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/system/fastboot/Kconfig b/system/fastboot/Kconfig index 181405ee4e4..75e464d99ad 100644 --- a/system/fastboot/Kconfig +++ b/system/fastboot/Kconfig @@ -24,8 +24,9 @@ config SYSTEM_FASTBOOTD_DOWNLOAD_MAX int "USB-fastboot download buffer size" default 40960 -config FASTBOOTD_USB_BOARDCTL +config SYSTEM_FASTBOOTD_USB_BOARDCTL bool "USB Board Control" + default n depends on BOARDCTL depends on BOARDCTL_USBDEVCTRL ---help--- diff --git a/system/fastboot/fastboot.c b/system/fastboot/fastboot.c index 550ea18c25c..e5846f87ef8 100644 --- a/system/fastboot/fastboot.c +++ b/system/fastboot/fastboot.c @@ -958,7 +958,7 @@ int main(int argc, FAR char **argv) FAR void *buffer = NULL; int ret = OK; -#ifdef CONFIG_FASTBOOTD_USB_BOARDCTL +#ifdef CONFIG_SYSTEM_FASTBOOTD_USB_BOARDCTL struct boardioc_usbdev_ctrl_s ctrl; # ifdef CONFIG_USBDEV_COMPOSITE uint8_t dev = BOARDIOC_USBDEV_COMPOSITE; @@ -992,7 +992,7 @@ int main(int argc, FAR char **argv) fb_err("boardctl(BOARDIOC_USBDEV_CONTROL) failed: %d\n", ret); return ret; } -#endif /* FASTBOOTD_USB_BOARDCTL */ +#endif /* SYSTEM_FASTBOOTD_USB_BOARDCTL */ if (argc > 1) { From ece14800e17a66ad021e4f1f6a7db5d63425a6ff Mon Sep 17 00:00:00 2001 From: Tiago Medicci Date: Wed, 19 Feb 2025 16:05:04 -0300 Subject: [PATCH 187/391] system/cpuload: Fix application's Make.defs location The PR https://github.com/apache/nuttx-apps/pull/2974 first moved it to `testing/sched/cpuload` and the Make.defs was adjusted accordingly. However, during the review process, it was moved to `system/cpuload` folder, but its Make.defs wasn't updated. This commit fixes it. Signed-off-by: Tiago Medicci --- system/cpuload/Make.defs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/cpuload/Make.defs b/system/cpuload/Make.defs index e73223175b0..bcbda06843d 100644 --- a/system/cpuload/Make.defs +++ b/system/cpuload/Make.defs @@ -21,5 +21,5 @@ ############################################################################ ifneq ($(CONFIG_SYSTEM_CPULOAD),) -CONFIGURED_APPS += $(APPDIR)/testing/sched/cpuload +CONFIGURED_APPS += $(APPDIR)/system/cpuload endif From 0fb063f329443fd5abb8f46cd1715ae949743538 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20=C5=81yszczek?= Date: Fri, 14 Feb 2025 18:54:00 +0100 Subject: [PATCH 188/391] logging/embedlog: bump version to v0.7.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit v0.7.2 fixes few minor bug fixes during compilation Signed-off-by: Michał Łyszczek --- logging/embedlog/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/logging/embedlog/Makefile b/logging/embedlog/Makefile index e4e6f2b4c38..ef7b306f7d0 100644 --- a/logging/embedlog/Makefile +++ b/logging/embedlog/Makefile @@ -28,8 +28,8 @@ PACKEXT = .tar.gz NXTOOLSDIR = $(APPDIR)/tools EMBEDLOG_URL = https://distfiles.bofc.pl/embedlog -EMBEDLOG_VERSION = 0.7.0 -EMBEDLOG_SRC_SHA256 = 154cbcb9a14809f14c5c4a5e11a3b6da23be2858a1d7a2b4054bb05f062f41c5 +EMBEDLOG_VERSION = 0.7.2 +EMBEDLOG_SRC_SHA256 = 561021ab825584ac7cdf88adb639950ab9fddb474fd52fc8950bc4c70d8d9960 EMBEDLOG_EXT = tar.gz EMBEDLOG_SOURCES = embedlog-$(EMBEDLOG_VERSION) EMBEDLOG_TARBALL = $(EMBEDLOG_SOURCES).$(EMBEDLOG_EXT) From da9dade71f79b93e8f1367b84aa83d52aa82e629 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20=C5=81yszczek?= Date: Fri, 14 Feb 2025 18:49:02 +0100 Subject: [PATCH 189/391] system/psmq: bump version to v0.2.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michał Łyszczek --- system/psmq/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/psmq/Makefile b/system/psmq/Makefile index b414da61e48..1175a9a88cf 100644 --- a/system/psmq/Makefile +++ b/system/psmq/Makefile @@ -28,8 +28,8 @@ PACKEXT = .tar.gz NXTOOLSDIR = $(APPDIR)/tools PSMQ_URL = https://distfiles.bofc.pl/psmq -PSMQ_VERSION = 0.2.1 -PSMQ_SRC_SHA256 = b029fa06752ad7dce89f6b899f27a08a1bd1ee0a4e1d9df407274f0322bf1946 +PSMQ_VERSION = 0.2.2 +PSMQ_SRC_SHA256 = eeef94b348c70ec54e0a36e3baf7740cf34d7525eb185604cef4dd9ab7ef25b5 PSMQ_EXT = tar.gz PSMQ_SOURCES = psmq-$(PSMQ_VERSION) PSMQ_TARBALL = $(PSMQ_SOURCES).$(PSMQ_EXT) From 751c4efe7f10d1450bd636e88b10994a3cdbf857 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20=C5=81yszczek?= Date: Fri, 14 Feb 2025 18:52:50 +0100 Subject: [PATCH 190/391] system/psmq: add proper include path for embedlog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit embedlog.h were residing in include/system path, but has been moved to include/logging. This causes psmq to not be able to find include, which results in compilation error Signed-off-by: Michał Łyszczek --- system/psmq/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/system/psmq/Makefile b/system/psmq/Makefile index 1175a9a88cf..5517278e220 100644 --- a/system/psmq/Makefile +++ b/system/psmq/Makefile @@ -35,6 +35,7 @@ PSMQ_SOURCES = psmq-$(PSMQ_VERSION) PSMQ_TARBALL = $(PSMQ_SOURCES).$(PSMQ_EXT) CFLAGS += ${INCDIR_PREFIX}$(APPDIR)$(DELIM)include$(DELIM)system +CFLAGS += ${INCDIR_PREFIX}$(APPDIR)$(DELIM)include$(DELIM)logging CFLAGS += ${INCDIR_PREFIX}$(APPDIR)$(DELIM)system$(DELIM)psmq$(DELIM)$(PSMQ_SOURCES) # mandatory source files to compile From 71ff60753c6110ef7fa394d009e947268e25a780 Mon Sep 17 00:00:00 2001 From: simbit18 <101105604+simbit18@users.noreply.github.com> Date: Wed, 12 Feb 2025 14:52:43 +0100 Subject: [PATCH 191/391] interpreters/quickjs/Makefile: fix the build with Make QUICKJS_URL_BASE in Cmakefile and Makefile was not the same. Updated the correct url in Makefile. fix https://github.com/apache/nuttx/issues/15712 To avoid future breakage, used the URL with last commit ID Current version 2024-02-14 as found in the VERSION file https://github.com/bellard/quickjs/blob/master/VERSION Signed-off-by: simbit18 --- interpreters/quickjs/Makefile | 50 ++++++++++++++++------------------- 1 file changed, 23 insertions(+), 27 deletions(-) diff --git a/interpreters/quickjs/Makefile b/interpreters/quickjs/Makefile index fb522ebcbf0..7b84a08bb4e 100644 --- a/interpreters/quickjs/Makefile +++ b/interpreters/quickjs/Makefile @@ -22,11 +22,11 @@ include $(APPDIR)/Make.defs -QUICKJS_VERSION = 2020-11-08 -QUICKJS_UNPACK = quickjs -QUICKJS_TARBALL = quickjs-$(QUICKJS_VERSION).tar.xz -QUICKJS_URL_BASE = https://bellard.org/quickjs/ -QUICKJS_URL = $(QUICKJS_URL_BASE)/$(QUICKJS_TARBALL) +QUICKJS_VERSION = 2024-02-14 +QUICKJS_COMMIT_ID = 6e2e68fd0896957f92eb6c242a2e048c1ef3cae0 +QUICKJS_UNPACK = quickjs +QUICKJS_ARCHIVE = $(QUICKJS_COMMIT_ID).zip +QUICKJS_URL = https://github.com/bellard/quickjs/archive/$(QUICKJS_ARCHIVE) CSRCS = quickjs.c libregexp.c libbf.c libunicode.c cutils.c @@ -63,27 +63,16 @@ STACKSIZE = $(CONFIG_INTERPRETERS_QUICKJS_STACKSIZE) MODULE = $(CONFIG_INTERPRETERS_QUICKJS) endif -$(QUICKJS_TARBALL): - $(Q) echo "Downloading $(QUICKJS_TARBALL)" - $(Q) curl -O -L $(QUICKJS_URL) +$(QUICKJS_ARCHIVE): + $(Q) echo "Downloading $(QUICKJS_ARCHIVE)" + $(Q) curl -L $(QUICKJS_URL) -o quickjs-$(QUICKJS_ARCHIVE) -$(QUICKJS_UNPACK): $(QUICKJS_TARBALL) - $(Q) echo "Unpacking $(QUICKJS_TARBALL) to $(QUICKJS_UNPACK)" - $(Q) tar -Jxf $(QUICKJS_TARBALL) - $(Q) mv quickjs-$(QUICKJS_VERSION) $(QUICKJS_UNPACK) +$(QUICKJS_UNPACK): $(QUICKJS_ARCHIVE) + $(Q) echo "Unpacking quickjs-$(QUICKJS_ARCHIVE) to $(QUICKJS_UNPACK)" + $(Q) unzip -q -o quickjs-$(QUICKJS_ARCHIVE) + $(Q) mv quickjs-$(QUICKJS_COMMIT_ID) $(QUICKJS_UNPACK) $(Q) patch -d $(QUICKJS_UNPACK) -p1 < 0001-Disabled-unsupported-feature-on-NuttX.patch -$(QUICKJS_UNPACK)/.patch: $(QUICKJS_UNPACK) - $(Q) touch $(QUICKJS_UNPACK)/.patch - -# Download and unpack tarball if no git repo found -ifeq ($(wildcard $(QUICKJS_UNPACK)/.git),) -QUICKJS_DOWNLOAD=$(QUICKJS_UNPACK)/.patch -distclean:: - $(call DELDIR, $(QUICKJS_UNPACK)) - $(call DELFILE, $(QUICKJS_TARBALL)) -endif - ifeq ($(CONFIG_INTERPRETERS_QUICKJS_MINI),y) MAINSRC = qjsmini.c endif @@ -91,14 +80,21 @@ endif ifeq ($(CONFIG_INTERPRETERS_QUICKJS_FULL),y) CSRCS += quickjs-libc.c repl.c MAINSRC = qjs.c -context:: $(QUICKJS_DOWNLOAD) +endif + +# Download and unpack zipball if no archive found +ifeq ($(wildcard $(QUICKJS_UNPACK)/.*),) +ifeq ($(CONFIG_INTERPRETERS_QUICKJS_FULL),y) +context:: $(QUICKJS_UNPACK) $(MAKE) -C $(QUICKJS_UNPACK) \ CONFIG_BIGNUM=$(CONFIG_INTERPRETERS_QUICKJS_BIGNUM) else -context:: $(QUICKJS_DOWNLOAD) +context:: $(QUICKJS_UNPACK) +endif endif -clean:: - $(Q) test ! -d $(QUICKJS_UNPACK) || $(MAKE) -C $(QUICKJS_UNPACK) clean +distclean:: + $(call DELDIR, $(QUICKJS_UNPACK)) + $(call DELFILE, $(QUICKJS_ARCHIVE)) include $(APPDIR)/Application.mk From 4315a1c8ccbb5c29ccc006a809123787e2cc3109 Mon Sep 17 00:00:00 2001 From: simbit18 Date: Fri, 21 Feb 2025 12:46:19 +0100 Subject: [PATCH 192/391] [nxstyle] fix Relative file path fix Relative file path does not match actual file. Signed-off-by: simbit18 --- examples/rust/hello/Make.defs | 2 +- examples/spislv_test/Make.defs | 2 +- mlearning/cmsis-nn/Make.defs | 2 +- system/sensorscope/Make.defs | 2 +- testing/cxx/cxxsize/Make.defs | 2 +- testing/cxx/cxxsize/Makefile | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/rust/hello/Make.defs b/examples/rust/hello/Make.defs index aaacb0efa96..829b1c507a3 100644 --- a/examples/rust/hello/Make.defs +++ b/examples/rust/hello/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/examples/hello_rust_cargo/Make.defs +# apps/examples/rust/hello/Make.defs # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with diff --git a/examples/spislv_test/Make.defs b/examples/spislv_test/Make.defs index 14bb4852a9f..039cba10615 100644 --- a/examples/spislv_test/Make.defs +++ b/examples/spislv_test/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/examples/spislv/Make.defs +# apps/examples/spislv_test/Make.defs # # SPDX-License-Identifier: Apache-2.0 # diff --git a/mlearning/cmsis-nn/Make.defs b/mlearning/cmsis-nn/Make.defs index 760173037f1..1f14dc09071 100644 --- a/mlearning/cmsis-nn/Make.defs +++ b/mlearning/cmsis-nn/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/mlearning/cmsis/Make.defs +# apps/mlearning/cmsis-nn/Make.defs # # SPDX-License-Identifier: Apache-2.0 # diff --git a/system/sensorscope/Make.defs b/system/sensorscope/Make.defs index d4b84a72152..31ad1d6cf4f 100644 --- a/system/sensorscope/Make.defs +++ b/system/sensorscope/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/systen/sensorscope/Make.defs +# apps/system/sensorscope/Make.defs # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/cxx/cxxsize/Make.defs b/testing/cxx/cxxsize/Make.defs index 73798f27519..61f0d9068d0 100644 --- a/testing/cxx/cxxsize/Make.defs +++ b/testing/cxx/cxxsize/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/cxx/cxxtest/Make.defs +# apps/testing/cxx/cxxsize/Make.defs # # SPDX-License-Identifier: Apache-2.0 # diff --git a/testing/cxx/cxxsize/Makefile b/testing/cxx/cxxsize/Makefile index 59e57fd71b5..2bdb3d7cfcd 100644 --- a/testing/cxx/cxxsize/Makefile +++ b/testing/cxx/cxxsize/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# apps/testing/cxx/cxxtest/Makefile +# apps/testing/cxx/cxxsize/Makefile # # SPDX-License-Identifier: Apache-2.0 # From a8b8a7320c7f820c10d957f2e948d83f1efa0301 Mon Sep 17 00:00:00 2001 From: simbit18 Date: Thu, 20 Feb 2025 12:50:46 +0100 Subject: [PATCH 193/391] system/irtest/Make.defs: fixed the wrong path fix this error make[3] *** /nuttxspace/nuttx/apps/testing/irtest: No such file or directory. Stop. error due to this change apps/testing: Move irtest/sensortest/resmonitor/monkey to apps/system #2976 Signed-off-by: simbit18 --- system/irtest/Make.defs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/irtest/Make.defs b/system/irtest/Make.defs index f5588fcb22f..841a9953e9d 100644 --- a/system/irtest/Make.defs +++ b/system/irtest/Make.defs @@ -21,5 +21,5 @@ ############################################################################ ifneq ($(CONFIG_SYSTEM_IRTEST),) -CONFIGURED_APPS += $(APPDIR)/testing/irtest +CONFIGURED_APPS += $(APPDIR)/system/irtest endif From d05ecafc4b7fea5b68abe7a53d3c35e1a0d8b174 Mon Sep 17 00:00:00 2001 From: simbit18 Date: Mon, 17 Feb 2025 19:10:42 +0100 Subject: [PATCH 194/391] interpreters/quickjs/CMakeLists.txt: Sync of build Cmake with build Make Setting the right version 2024-02-14 To avoid future breakage, used the URL with last commit ID Signed-off-by: simbit18 --- interpreters/quickjs/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/interpreters/quickjs/CMakeLists.txt b/interpreters/quickjs/CMakeLists.txt index 38c4b26e8f4..e64c2d0c761 100644 --- a/interpreters/quickjs/CMakeLists.txt +++ b/interpreters/quickjs/CMakeLists.txt @@ -28,8 +28,8 @@ if(CONFIG_INTERPRETERS_QUICKJS) FetchContent_Declare( quickjs_fetch - URL ${QUICKJS_URL_BASE}/refs/heads/master.zip SOURCE_DIR - ${CMAKE_CURRENT_LIST_DIR}/quickjs BINARY_DIR + URL ${QUICKJS_URL_BASE}/6e2e68fd0896957f92eb6c242a2e048c1ef3cae0.zip + SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/quickjs BINARY_DIR ${CMAKE_BINARY_DIR}/apps/interpreters/quickjs/quickjs PATCH_COMMAND patch -p1 -d ${CMAKE_CURRENT_LIST_DIR}/quickjs < @@ -56,7 +56,7 @@ if(CONFIG_INTERPRETERS_QUICKJS) TARGET nuttx APPEND PROPERTY NUTTX_INCLUDE_DIRECTORIES ${NUTTX_APPS_DIR}/interpreters/quickjs) - set(QUICKJS_VERSION "\"2020-11-08\"") + set(QUICKJS_VERSION "\"2024-02-14\"") set(QUICKJS_FLAGS) set(QUICKJS_INCDIR) set(QUICKJS_CSRCS) From 2eb18712d3e0e4c8bcf6dbd9bbfdceb7e11b44aa Mon Sep 17 00:00:00 2001 From: Felipe Moura Date: Sun, 23 Feb 2025 12:26:24 -0300 Subject: [PATCH 195/391] netutils/pppd/ppp.h: Fix build issue when network debug is enabled This commit add include necessary when we enable network debug feature using ppp feature. Signed-off-by: Felipe Moura de Oliveira --- netutils/pppd/ppp.h | 1 + 1 file changed, 1 insertion(+) diff --git a/netutils/pppd/ppp.h b/netutils/pppd/ppp.h index b908446805c..f436a120672 100644 --- a/netutils/pppd/ppp.h +++ b/netutils/pppd/ppp.h @@ -51,6 +51,7 @@ #include "netutils/chat.h" +#include "debug.h" #include "ppp_conf.h" #include "ahdlc.h" #include "lcp.h" From 89c784188e7f763fa979d97b9278dc95ce563e42 Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Thu, 20 Feb 2025 15:57:57 +0800 Subject: [PATCH 196/391] system/fastboot: Add format string support for fastboot_fail() Add support for producing output according to a format like printf(). Signed-off-by: wangjianyu3 --- system/fastboot/fastboot.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/system/fastboot/fastboot.c b/system/fastboot/fastboot.c index e5846f87ef8..72f27e18d3e 100644 --- a/system/fastboot/fastboot.c +++ b/system/fastboot/fastboot.c @@ -260,9 +260,15 @@ static void fastboot_ack(FAR struct fastboot_ctx_s *context, } static void fastboot_fail(FAR struct fastboot_ctx_s *context, - FAR const char *reason) + FAR const char *fmt, ...) { + char reason[FASTBOOT_MSG_LEN]; + va_list ap; + + va_start(ap, fmt); + vsnprintf(reason, sizeof(reason), fmt, ap); fastboot_ack(context, "FAIL", reason); + va_end(ap); } static void fastboot_okay(FAR struct fastboot_ctx_s *context, From 536e2ccac6d04b983dfaf34f45ca5ec383e76ac3 Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Thu, 20 Feb 2025 11:28:10 +0800 Subject: [PATCH 197/391] system/fastboot: Add support for fastboot oem shell To support executing custom commands. Usage fastboot oem shell Tests # Configuration "esp32s3-devkit:fastboot" with `SYSTEM_FASTBOOTD_SHELL` enabled $ fastboot --version fastboot version 35.0.2-12147458 $ fastboot oem shell ls /FILE_NOT_EXISTS FAILED (remote: 'error detected 0xff00 4') fastboot: error: Command failed $ fastboot oem shell ps PID GROUP PRI POLICY TYPE NPX STATE EVENT SIGMASK STACK COMMAND 0 0 0 FIFO Kthread - Ready 0000000000000000 0003056 Idle_Task 1 0 224 RR Kthread - Waiting Semaphore 0000000000000000 0001976 hpwork 0x3fc8bd50 0x3fc8bd80 2 2 100 RR Task - Waiting Semaphore 0000000000000000 0004048 nsh_main 3 3 100 RR Task - Ready 0000000000000000 0001992 fastbootd 4 4 100 RR Task - Running 0000000000000000 0001992 popen -c ps OKAY [ 0.010s] Finished. Total time: 0.010s Signed-off-by: wangjianyu3 --- system/fastboot/Kconfig | 10 ++++++++++ system/fastboot/fastboot.c | 41 +++++++++++++++++++++++++++++++++++++- 2 files changed, 50 insertions(+), 1 deletion(-) diff --git a/system/fastboot/Kconfig b/system/fastboot/Kconfig index 75e464d99ad..eb5edcfd91f 100644 --- a/system/fastboot/Kconfig +++ b/system/fastboot/Kconfig @@ -32,4 +32,14 @@ config SYSTEM_FASTBOOTD_USB_BOARDCTL ---help--- Connect usbdev before running fastboot daemon. +config SYSTEM_FASTBOOTD_SHELL + bool "Execute custom commands" + default n + depends on SCHED_CHILD_STATUS + depends on SYSTEM_POPEN + ---help--- + Enable to support executing custom commands. + e.g. fastboot oem shell ps + e.g. fastboot oem shell "mkrd -m 10 -s 512 640" + endif # SYSTEM_FASTBOOTD diff --git a/system/fastboot/fastboot.c b/system/fastboot/fastboot.c index 72f27e18d3e..4fa882eee55 100644 --- a/system/fastboot/fastboot.c +++ b/system/fastboot/fastboot.c @@ -46,6 +46,7 @@ #include #include #include +#include /**************************************************************************** * Pre-processor Definitions @@ -180,6 +181,10 @@ static void fastboot_memdump(FAR struct fastboot_ctx_s *context, FAR const char *arg); static void fastboot_filedump(FAR struct fastboot_ctx_s *context, FAR const char *arg); +#ifdef CONFIG_SYSTEM_FASTBOOTD_SHELL +static void fastboot_shell(FAR struct fastboot_ctx_s *context, + FAR const char *arg); +#endif /**************************************************************************** * Private Data @@ -200,7 +205,10 @@ static const struct fastboot_cmd_s g_fast_cmd[] = static const struct fastboot_cmd_s g_oem_cmd[] = { { "filedump", fastboot_filedump }, - { "memdump", fastboot_memdump } + { "memdump", fastboot_memdump }, +#ifdef CONFIG_SYSTEM_FASTBOOTD_SHELL + { "shell", fastboot_shell }, +#endif }; /**************************************************************************** @@ -776,6 +784,37 @@ static void fastboot_filedump(FAR struct fastboot_ctx_s *context, fastboot_okay(context, ""); } +#ifdef CONFIG_SYSTEM_FASTBOOTD_SHELL +static void fastboot_shell(FAR struct fastboot_ctx_s *context, + FAR const char *arg) +{ + char response[FASTBOOT_MSG_LEN - 4]; + FILE *fp; + int ret; + + fp = popen(arg, "r"); + if (fp == NULL) + { + fastboot_fail(context, "popen() fails %d", errno); + return; + } + + while (fgets(response, sizeof(response), fp)) + { + fastboot_ack(context, "TEXT", response); + } + + ret = pclose(fp); + if (WIFEXITED(ret) && WEXITSTATUS(ret) == 0) + { + fastboot_okay(context, ""); + return; + } + + fastboot_fail(context, "error detected 0x%x %d", ret, errno); +} +#endif + static void fastboot_upload(FAR struct fastboot_ctx_s *context, FAR const char *arg) { From a0dfd187d8650618809082579a586083dc59313a Mon Sep 17 00:00:00 2001 From: simbit18 Date: Mon, 24 Feb 2025 12:44:36 +0100 Subject: [PATCH 198/391] [Kconfig style] Fix Kconfig style Remove spaces from Kconfig files Add TABs Replace help => ---help--- Remove extra TABs Signed-off-by: simbit18 --- crypto/mbedtls/Kconfig | 6 +++--- examples/rmtchar/Kconfig | 10 +++++----- system/settings/Kconfig | 2 +- system/zlib/Kconfig | 20 ++++++++++---------- testing/mm/stressapptest/Kconfig | 2 +- testing/sched/timerjitter/Kconfig | 2 +- 6 files changed, 21 insertions(+), 21 deletions(-) diff --git a/crypto/mbedtls/Kconfig b/crypto/mbedtls/Kconfig index c843bda7f4f..1bee06c899d 100644 --- a/crypto/mbedtls/Kconfig +++ b/crypto/mbedtls/Kconfig @@ -399,7 +399,7 @@ config MBEDTLS_SSL_PROTO_TLS1_2 depends on (MBEDTLS_USE_PSA_CRYPTO ||\ (MBEDTLS_MD_C && (MBEDTLS_SHA256_C || MBEDTLS_SHA384_C))) default y - help + ---help--- If MBEDTLS_USE_PSA_CRYPTO is set, then PSA_WANT_ALG_SHA_256 or PSA_WANT_ALG_SHA_384 must be defined. @@ -421,7 +421,7 @@ config MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED depends on MBEDTLS_X509_CRT_PARSE_C && \ (MBEDTLS_ECDSA_C || MBEDTLS_USE_PSA_CRYPTO || MBEDTLS_PKCS1_V21) default y - help + ---help--- Requires PSA_WANT_ALG_ECDH or PSA_WANT_ALG_FFDH to be defined. Also, if MBEDTLS_USE_PSA_CRYPTO is used to satisfy its dependencies, then PSA_WANT_ALG_ECDSA must also be defined. @@ -429,7 +429,7 @@ config MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED config MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED bool "Enable TLS 1.3 PSK ephemeral key exchange mode." default y - help + ---help--- Requires PSA_WANT_ALG_ECDH or PSA_WANT_ALG_FFDH. config MBEDTLS_SSL_SESSION_TICKETS diff --git a/examples/rmtchar/Kconfig b/examples/rmtchar/Kconfig index 8831f56a2e6..e88da638afb 100644 --- a/examples/rmtchar/Kconfig +++ b/examples/rmtchar/Kconfig @@ -44,11 +44,11 @@ config EXAMPLES_RMTCHAR_RX if EXAMPLES_RMTCHAR_RX config EXAMPLES_RMTCHAR_RX_DEVPATH - string "RMT receiver character device path" - default "/dev/rmt1" - ---help--- - The default path to the RMT receiver character device. - Default: /dev/rmt1 + string "RMT receiver character device path" + default "/dev/rmt1" + ---help--- + The default path to the RMT receiver character device. + Default: /dev/rmt1 config EXAMPLES_RMTCHAR_RXSTACKSIZE int "Receiver thread stack size" diff --git a/system/settings/Kconfig b/system/settings/Kconfig index 351897ce9e4..f2ca841f2de 100644 --- a/system/settings/Kconfig +++ b/system/settings/Kconfig @@ -5,7 +5,7 @@ config SYSTEM_SETTINGS bool "Settings Functions" default n - ---help--- + ---help--- The settings storage can be used to store and retrieve various configurable parameters. This storage is a RAM-based map (for fast access) but one or more files can be used too (so values can persist across system diff --git a/system/zlib/Kconfig b/system/zlib/Kconfig index 637fbff615a..f5dec2bfb8e 100644 --- a/system/zlib/Kconfig +++ b/system/zlib/Kconfig @@ -91,17 +91,17 @@ config UTILS_UNZIP_STACKSIZE endif # UTILS_UNZIP config LIB_ZLIB_MAX_WBITS - int "Zlib max wbits" - default 15 - range 8 15 - ---help--- - Default windowBits. memory usage (1 << (windowBits+2)) bytes. + int "Zlib max wbits" + default 15 + range 8 15 + ---help--- + Default windowBits. memory usage (1 << (windowBits+2)) bytes. config LIB_ZLIB_MAX_MEM_LEVEL - int "Zlib max mem level" - default 8 - range 1 9 - ---help--- - Default memLevel. memory usage (1 << (memLevel+9)) bytes. + int "Zlib max mem level" + default 8 + range 1 9 + ---help--- + Default memLevel. memory usage (1 << (memLevel+9)) bytes. endif # LIB_ZLIB diff --git a/testing/mm/stressapptest/Kconfig b/testing/mm/stressapptest/Kconfig index c56aeeae5a1..91750dcd72d 100644 --- a/testing/mm/stressapptest/Kconfig +++ b/testing/mm/stressapptest/Kconfig @@ -6,7 +6,7 @@ config TESTING_STRESSAPPTEST bool "stressapptest" default n - help + ---help--- stressapptest is a userspace memory and CPU stress test tool. It exercises the memory and CPU subsystem stressing for cache misses, TLB misses, memory allocation, memory freeing, etc. It has been diff --git a/testing/sched/timerjitter/Kconfig b/testing/sched/timerjitter/Kconfig index 38f1e2ed8d8..23bbc4fae3d 100644 --- a/testing/sched/timerjitter/Kconfig +++ b/testing/sched/timerjitter/Kconfig @@ -6,7 +6,7 @@ config TESTING_TIMERJITTER bool "timerjitter testing" default n - help + ---help--- timerjitter helps profiling timer accuracy and real-time performance. if TESTING_TIMERJITTER From b84f93c4df4d52a2d93134d91223e8c757106d9f Mon Sep 17 00:00:00 2001 From: simbit18 Date: Mon, 24 Feb 2025 12:17:15 +0100 Subject: [PATCH 199/391] [nxstyle] fix Relative file path fix Relative file path does not match actual file. EOL Conversion -> Unix (LF) Adding the message header to the Kconfig file Signed-off-by: simbit18 --- benchmarks/superpi/CMakeLists.txt | 2 +- examples/charger/Kconfig | 4 ++++ examples/udpblaster/udpblaster_host.cmake | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/benchmarks/superpi/CMakeLists.txt b/benchmarks/superpi/CMakeLists.txt index c15a98ff033..7ab8ed611ca 100644 --- a/benchmarks/superpi/CMakeLists.txt +++ b/benchmarks/superpi/CMakeLists.txt @@ -1,5 +1,5 @@ # ############################################################################## -# apps/benchmarks/superpi/CMakeList.txt +# apps/benchmarks/superpi/CMakeLists.txt # # SPDX-License-Identifier: Apache-2.0 # diff --git a/examples/charger/Kconfig b/examples/charger/Kconfig index 94629bed39d..ae95d4a659a 100644 --- a/examples/charger/Kconfig +++ b/examples/charger/Kconfig @@ -1,3 +1,7 @@ +# +# For a description of the syntax of this configuration file, +# see the file kconfig-language.txt in the NuttX tools repository. +# config EXAMPLES_CHARGER bool "Battery charger example" diff --git a/examples/udpblaster/udpblaster_host.cmake b/examples/udpblaster/udpblaster_host.cmake index 2b132a694d1..769c8ded937 100644 --- a/examples/udpblaster/udpblaster_host.cmake +++ b/examples/udpblaster/udpblaster_host.cmake @@ -1,5 +1,5 @@ # ############################################################################## -# apps/examples/udpblaster/udpblaster.cmake +# apps/examples/udpblaster/udpblaster_host.cmake # # SPDX-License-Identifier: Apache-2.0 # From 0da270d9d66a7cabacdbf902a67942451793d8ce Mon Sep 17 00:00:00 2001 From: chenxiaoyi Date: Mon, 24 Feb 2025 17:46:33 +0800 Subject: [PATCH 200/391] system/debugpoint: fix bug the length option parsing error The debugpoint program has an option "-l" which requires an argument, which means the optstring to getopt() should be "l:". Signed-off-by: chenxiaoyi --- system/debugpoint/debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/debugpoint/debug.c b/system/debugpoint/debug.c index b9696f6f51d..d3861c451fe 100644 --- a/system/debugpoint/debug.c +++ b/system/debugpoint/debug.c @@ -289,7 +289,7 @@ static bool parse_options(int argc, FAR char *argv[], struct debug_option *opt) { int cmd; - while ((cmd = getopt(argc, argv, "r:w:b:x:cl")) != -1) + while ((cmd = getopt(argc, argv, "r:w:b:x:cl:")) != -1) { switch (cmd) { From 9c7e29809791bbb9e72d3d244c3a8d22ae494c81 Mon Sep 17 00:00:00 2001 From: Eren Terzioglu Date: Wed, 29 Jan 2025 20:45:43 +0100 Subject: [PATCH 201/391] games/brickmatch: Add GPIO input option Add gpio input option for brickmatch example Signed-off-by: Eren Terzioglu --- games/brickmatch/Kconfig | 30 +++++ games/brickmatch/bm_input_gpio.h | 202 +++++++++++++++++++++++++++++++ games/brickmatch/bm_inputs.h | 4 + games/brickmatch/bm_main.c | 4 + 4 files changed, 240 insertions(+) create mode 100644 games/brickmatch/bm_input_gpio.h diff --git a/games/brickmatch/Kconfig b/games/brickmatch/Kconfig index 9d2d7d5c15e..d88cbe12058 100644 --- a/games/brickmatch/Kconfig +++ b/games/brickmatch/Kconfig @@ -53,6 +53,36 @@ config GAMES_BRICKMATCH_USE_GESTURE bool "Gesture Sensor APDS-9960 as Input" depends on SENSORS_APDS9960 +config GAMES_BRICKMATCH_USE_GPIO + bool "GPIO pins as Input" endchoice +if GAMES_BRICKMATCH_USE_GPIO + +config GAMES_BRICKMATCH_UP_KEY_PATH + string "Up key path" + default "/dev/gpio0" + ---help--- + Path of the up key to read + +config GAMES_BRICKMATCH_DOWN_KEY_PATH + string "Down key path" + default "/dev/gpio1" + ---help--- + Path of the down key to read + +config GAMES_BRICKMATCH_LEFT_KEY_PATH + string "Left key path" + default "/dev/gpio2" + ---help--- + Path of the left key to read + +config GAMES_BRICKMATCH_RIGHT_KEY_PATH + string "Right key path" + default "/dev/gpio3" + ---help--- + Path of the right key to read + +endif #GAMES_BRICKMATCH_USE_GPIO + endif diff --git a/games/brickmatch/bm_input_gpio.h b/games/brickmatch/bm_input_gpio.h new file mode 100644 index 00000000000..27428d35d48 --- /dev/null +++ b/games/brickmatch/bm_input_gpio.h @@ -0,0 +1,202 @@ +/**************************************************************************** + * apps/games/brickmatch/bm_input_gpio.h + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "bm_inputs.h" + +/**************************************************************************** + * Preprocessor Definitions + ****************************************************************************/ + +struct gpio_struct_fd_s +{ + int fd_up; /* File descriptor value to read up arrow key */ + int fd_down; /* File descriptor value to read down arrow key */ + int fd_left; /* File descriptor value to read left arrow key */ + int fd_right; /* File descriptor value to read right arrow key */ +}; + +struct gpio_struct_fd_s fd_list; + +/**************************************************************************** + * Name: dev_input_init + * + * Description: + * Initialize input method. + * + * Parameters: + * dev - Input state data + * + * Returned Value: + * Zero (OK) is returned on success. A negated errno value is returned on + * failure. + * + ****************************************************************************/ + +int dev_input_init(FAR struct input_state_s *dev) +{ + /* Open the up key gpio device */ + + fd_list.fd_up = open(CONFIG_GAMES_BRICKMATCH_UP_KEY_PATH, O_RDONLY); + if (fd_list.fd_up < 0) + { + fprintf(stderr, "ERROR: Failed to open %s: %d\n", + CONFIG_GAMES_BRICKMATCH_UP_KEY_PATH, errno); + return -ENODEV; + } + + /* Open the down key gpio device */ + + fd_list.fd_down = open(CONFIG_GAMES_BRICKMATCH_DOWN_KEY_PATH, O_RDONLY); + if (fd_list.fd_down < 0) + { + fprintf(stderr, "ERROR: Failed to open %s: %d\n", + CONFIG_GAMES_BRICKMATCH_DOWN_KEY_PATH, errno); + return -ENODEV; + } + + /* Open the left key gpio device */ + + fd_list.fd_left = open(CONFIG_GAMES_BRICKMATCH_LEFT_KEY_PATH, O_RDONLY); + if (fd_list.fd_down < 0) + { + fprintf(stderr, "ERROR: Failed to open %s: %d\n", + CONFIG_GAMES_BRICKMATCH_LEFT_KEY_PATH, errno); + return -ENODEV; + } + + /* Open the right key gpio device */ + + fd_list.fd_right = open(CONFIG_GAMES_BRICKMATCH_RIGHT_KEY_PATH, O_RDONLY); + if (fd_list.fd_down < 0) + { + fprintf(stderr, "ERROR: Failed to open %s: %d\n", + CONFIG_GAMES_BRICKMATCH_RIGHT_KEY_PATH, errno); + return -ENODEV; + } + + dev->fd_gpio = (int)&fd_list; + + return OK; +} + +/**************************************************************************** + * Name: dev_read_input + * + * Description: + * Read inputs and returns result in input state data. + * + * Parameters: + * dev - Input state data + * + * Returned Value: + * Zero (OK) + * + ****************************************************************************/ + +int dev_read_input(FAR struct input_state_s *dev) +{ + struct gpio_struct_fd_s *fd = (struct gpio_struct_fd_s *)dev->fd_gpio; + int invalue = 0; + int ret; + + ret = ioctl(fd->fd_up, GPIOC_READ, (unsigned long)((uintptr_t)&invalue)); + if (ret < 0) + { + int errcode = errno; + fprintf(stderr, "ERROR: Failed to read value from %s: %d\n", + CONFIG_GAMES_BRICKMATCH_UP_KEY_PATH, errcode); + } + else + { + if (invalue != 0) + { + dev->dir = DIR_UP; + } + } + + ret = ioctl(fd->fd_down, GPIOC_READ, (unsigned long)((uintptr_t)&invalue)); + if (ret < 0) + { + int errcode = errno; + fprintf(stderr, "ERROR: Failed to read value from %s: %d\n", + CONFIG_GAMES_BRICKMATCH_DOWN_KEY_PATH, errcode); + } + else + { + if (invalue != 0) + { + dev->dir = DIR_DOWN; + } + } + + ret = ioctl(fd->fd_left, GPIOC_READ, (unsigned long)((uintptr_t)&invalue)); + if (ret < 0) + { + int errcode = errno; + fprintf(stderr, "ERROR: Failed to read value from %s: %d\n", + CONFIG_GAMES_BRICKMATCH_LEFT_KEY_PATH, errcode); + } + else + { + if (invalue != 0) + { + dev->dir = DIR_LEFT; + } + } + + ret = ioctl(fd->fd_right, GPIOC_READ, + (unsigned long)((uintptr_t)&invalue)); + if (ret < 0) + { + int errcode = errno; + fprintf(stderr, "ERROR: Failed to read value from %s: %d\n", + CONFIG_GAMES_BRICKMATCH_RIGHT_KEY_PATH, errcode); + } + else + { + if (invalue != 0) + { + dev->dir = DIR_RIGHT; + } + } + + return OK; +} + diff --git a/games/brickmatch/bm_inputs.h b/games/brickmatch/bm_inputs.h index 0426677705e..9497b313599 100644 --- a/games/brickmatch/bm_inputs.h +++ b/games/brickmatch/bm_inputs.h @@ -61,6 +61,10 @@ struct input_state_s #ifdef CONFIG_GAMES_BRICKMATCH_USE_GESTURE int fd_gest; #endif +#ifdef CONFIG_GAMES_BRICKMATCH_USE_GPIO + int fd_gpio; +#endif + int dir; /* Direction to move the blocks */ }; diff --git a/games/brickmatch/bm_main.c b/games/brickmatch/bm_main.c index b9155c7a734..094f411d03a 100644 --- a/games/brickmatch/bm_main.c +++ b/games/brickmatch/bm_main.c @@ -50,6 +50,10 @@ #include "bm_input_gesture.h" #endif +#ifdef CONFIG_GAMES_BRICKMATCH_USE_GPIO +#include "bm_input_gpio.h" +#endif + /**************************************************************************** * Preprocessor Definitions ****************************************************************************/ From 8fcff3e88c75425d2f9414ef4ddd5eec8956b121 Mon Sep 17 00:00:00 2001 From: Eren Terzioglu Date: Wed, 29 Jan 2025 21:58:45 +0100 Subject: [PATCH 202/391] games/brickmatch: Add led matrix output option Add led matrix output option for brickmatch game example Signed-off-by: Eren Terzioglu --- games/brickmatch/Kconfig | 33 ++++ games/brickmatch/bm_main.c | 310 +++++++++++++++++++++++++++++++++---- 2 files changed, 309 insertions(+), 34 deletions(-) diff --git a/games/brickmatch/Kconfig b/games/brickmatch/Kconfig index d88cbe12058..1567a4ebccf 100644 --- a/games/brickmatch/Kconfig +++ b/games/brickmatch/Kconfig @@ -33,6 +33,39 @@ config GAMES_BRICKMATCH_STACKSIZE int "Brickmatch Game stack size" default DEFAULT_TASK_STACKSIZE +# +# Output Device Selection +# + +choice + prompt "Output Device (LED Matrix, LCD Screen, etc)" + default GAMES_BRICKMATCH_USE_LCD_SCREEN + +config GAMES_BRICKMATCH_USE_LCD_SCREEN + bool "LCD Screen as Output (Also APA102 Matrix as LCD Interface)" + +config GAMES_BRICKMATCH_USE_LED_MATRIX + bool "LED Matrix as Output" +endchoice + +if GAMES_BRICKMATCH_USE_LED_MATRIX + +config GAMES_BRICKMATCH_LED_MATRIX_PATH + string "LED matrix path" + default "/dev/leds0" + ---help--- + Path of the led matrix + +config GAMES_BRICKMATCH_LED_MATRIX_ROWS + int "LED Matrix row count" + default 8 + +config GAMES_BRICKMATCH_LED_MATRIX_COLS + int "LED Matrix column count" + default 8 + +endif #GAMES_BRICKMATCH_LED_MATRIX_PATH + # # Input Device Selection # diff --git a/games/brickmatch/bm_main.c b/games/brickmatch/bm_main.c index 094f411d03a..b9e63ca5d92 100644 --- a/games/brickmatch/bm_main.c +++ b/games/brickmatch/bm_main.c @@ -38,6 +38,10 @@ #include #include +#ifdef CONFIG_GAMES_BRICKMATCH_USE_LED_MATRIX +#include +#endif + #ifdef CONFIG_GAMES_BRICKMATCH_USE_CONSOLEKEY #include "bm_input_console.h" #endif @@ -58,11 +62,17 @@ * Preprocessor Definitions ****************************************************************************/ +#ifndef CONFIG_GAMES_BRICKMATCH_USE_LED_MATRIX #define BOARDX_SIZE 6 #define BOARDY_SIZE 6 +#else +#define BOARDX_SIZE CONFIG_GAMES_BRICKMATCH_LED_MATRIX_ROWS +#define BOARDY_SIZE CONFIG_GAMES_BRICKMATCH_LED_MATRIX_COLS +#define N_LEDS BOARDX_SIZE * BOARDY_SIZE +#endif -#define ROW 8 -#define COL 8 +#define ROW BOARDX_SIZE + 2 +#define COL BOARDY_SIZE + 2 /* Difficult mode: 4, 5, 6 */ @@ -102,32 +112,23 @@ struct game_screen_s * Private Data ****************************************************************************/ +#ifndef CONFIG_GAMES_BRICKMATCH_USE_LED_MATRIX static const char g_default_fbdev[] = "/dev/fb0"; +#else +static const char g_default_fbdev[] = + CONFIG_GAMES_BRICKMATCH_LED_MATRIX_PATH; +#endif /* The edge of the board is invisible to user */ int board[ROW][COL] = { - {1, 1, 1, 1, 1, 1, 1, 1}, - {1, 0, 0, 0, 0, 0, 0, 1}, - {1, 0, 0, 0, 0, 0, 0, 1}, - {1, 0, 0, 0, 0, 0, 0, 1}, - {1, 0, 0, 0, 0, 0, 0, 1}, - {1, 0, 0, 0, 0, 0, 0, 1}, - {1, 0, 0, 0, 0, 0, 0, 1}, - {1, 1, 1, 1, 1, 1, 1, 1} + 0 }; int prev_board[ROW][COL] = { - {1, 1, 1, 1, 1, 1, 1, 1}, - {1, 0, 0, 0, 0, 0, 0, 1}, - {1, 0, 0, 0, 0, 0, 0, 1}, - {1, 0, 0, 0, 0, 0, 0, 1}, - {1, 0, 0, 0, 0, 0, 0, 1}, - {1, 0, 0, 0, 0, 0, 0, 1}, - {1, 0, 0, 0, 0, 0, 0, 1}, - {1, 1, 1, 1, 1, 1, 1, 1} + 0 }; /* Colors used in the game plus Black */ @@ -147,6 +148,23 @@ static const uint16_t pallete[NCOLORS + 1] = * Private Functions ****************************************************************************/ +#ifndef CONFIG_GAMES_BRICKMATCH_USE_LED_MATRIX +/**************************************************************************** + * Name: draw_rect + * + * Description: + * Draw a rectangular. + * + * Parameters: + * state - Reference to the game screen state structure + * area - Reference to the valid area structure + * color - Color of the rectangular + * + * Returned Value: + * None. + * + ****************************************************************************/ + static void draw_rect(FAR struct screen_state_s *state, FAR struct fb_area_s *area, int color) { @@ -168,6 +186,21 @@ static void draw_rect(FAR struct screen_state_s *state, } } +/**************************************************************************** + * Name: update_screen + * + * Description: + * Refresh screen. + * + * Parameters: + * state - Reference to the game screen state structure + * area - Reference to the valid area structure + * + * Returned Value: + * None. + * + ****************************************************************************/ + void update_screen(FAR struct screen_state_s *state, FAR struct fb_area_s *area) { @@ -185,7 +218,21 @@ void update_screen(FAR struct screen_state_s *state, #endif } -/* Draw the user board without the edges */ +/**************************************************************************** + * Name: draw_board + * + * Description: + * Draw the user board without the edges. + * + * Parameters: + * state - Reference to the game screen state structure + * area - Reference to the valid area structure + * screen - Reference to the information structure of game screen + * + * Returned Value: + * None. + * + ****************************************************************************/ void draw_board(FAR struct screen_state_s *state, FAR struct fb_area_s *area, @@ -300,12 +347,100 @@ void draw_board(FAR struct screen_state_s *state, usleep(100000); } } +#else + +/**************************************************************************** + * Name: dim_color + * + * Description: + * Dim led color to handle brightness. + * + * Parameters: + * val - RGB24 value of the led + * dim - Percentage of brightness + * + * Returned Value: + * Dimmed RGB24 value. + * + ****************************************************************************/ + +uint32_t dim_color(uint32_t val, float dim) +{ + uint16_t r = RGB24RED(val); + uint16_t g = RGB24GREEN(val); + uint16_t b = RGB24BLUE(val); + + float sat = dim; + + r *= sat; + g *= sat; + b *= sat; + + return RGBTO24(r, g, b); +} + +/**************************************************************************** + * Name: draw_board + * + * Description: + * Draw the user board without the edges. + * + * Parameters: + * state - Reference to the game screen state structure + * area - Reference to the valid area structure + * screen - Reference to the information structure of game screen + * + * Returned Value: + * None. + * + ****************************************************************************/ + +void draw_board(FAR struct screen_state_s *state, + FAR struct fb_area_s *area, + FAR struct game_screen_s *screen) +{ + int result; + uint32_t *bp = state->fbmem; + int x; + int y; + int rgb_val; + int tmp; + + for (x = 1; x <= BOARDX_SIZE; x++) + { + for (y = 1; y <= BOARDY_SIZE; y++) + { + rgb_val = RGB16TO24(pallete[board[x][y]]); + tmp = dim_color(rgb_val, 0.15); + *bp++ = ws2812_gamma_correct(tmp); + } + } + + lseek(state->fd_fb, 0, SEEK_SET); + + result = write(state->fd_fb, state->fbmem, 4 * N_LEDS); + if (result != 4 * N_LEDS) + { + fprintf(stderr, + "ws2812_main: write failed: %d %d\n", + result, + errno); + } +} +#endif /* CONFIG_GAMES_BRICKMATCH_USE_LED_MATRIX */ /**************************************************************************** * Name: print_board * * Description: * Draw the board including the user non-visible border for debugging. + * + * Parameters: + * None + * + * Returned Value: + * None. + * ****************************************************************************/ #ifdef DEBUG_BRICKMATCH_GAME @@ -313,11 +448,16 @@ void print_board(void) { int row; int col; + int tmp; for (row = 0; row < ROW; row++) { - printf("+---+---+---+---+---+---+---+---+\n"); + for (tmp = 0; tmp < COL; tmp++) + { + printf("+---"); + } + printf("+\n"); for (col = 0; col < COL; col++) { if (row == 0 || col == 0 || row == ROW - 1 || col == COL - 1) @@ -333,7 +473,12 @@ void print_board(void) printf("|\n"); } - printf("+---+---+---+---+---+---+---+---+\n\n\n"); + for (tmp = 0; tmp < COL; tmp++) + { + printf("+---"); + } + + printf("+\n\n\n"); } #endif @@ -342,20 +487,27 @@ void print_board(void) * * Description: * Move the blocks (represented by numbers) to 'dir' direction (L,R,U,D). + * + * Parameters: + * dir - Direction to move + * + * Returned Value: + * None. + * ****************************************************************************/ void move_board(int dir) { - int row; - int row_ini; - int col; - int col_ini; - int row_dir; - int row_pos; - int col_dir; - int col_pos; - int row_lim; - int col_lim; + int row = 0; + int row_ini = 0; + int col = 0; + int col_ini = 0; + int row_dir = 0; + int row_pos = 0; + int col_dir = 0; + int col_pos = 0; + int row_lim = 0; + int col_lim = 0; if (dir == DIR_UP) { @@ -430,11 +582,55 @@ void move_board(int dir) } } +/**************************************************************************** + * Name: init_board + * + * Description: + * Initialize board to start the game properly + * + * Parameters: + * None + * + * Returned Value: + * None. + * + ****************************************************************************/ + +void init_board(void) +{ + int i; + int j; + + for (i = 0; i < ROW; i++) + { + for (j = 0; j < COL; j++) + { + if (i == 0 || i == ROW - 1 || j == 0 || j == COL - 1) + { + board[i][j] = 1; + prev_board[i][j] = 1; + } + else + { + board[i][j] = 0; + prev_board[i][j] = 0; + } + } + } +} + /**************************************************************************** * Name: fill_edge * * Description: * Fill the invisible border with "colored" blocks + * + * Parameters: + * None + * + * Returned Value: + * None. + * ****************************************************************************/ void fill_edge(void) @@ -459,6 +655,13 @@ void fill_edge(void) * * Description: * Fill the visible border with "colored" blocks + * + * Parameters: + * None + * + * Returned Value: + * None. + * ****************************************************************************/ void fill_border(void) @@ -483,6 +686,13 @@ void fill_border(void) * * Description: * Search for squares or triples of same colors. + * + * Parameters: + * None + * + * Returned Value: + * True(1) if there are squares or triples, False(0) if not. + * ****************************************************************************/ int search_board_squares(void) @@ -601,10 +811,17 @@ int search_board_squares(void) } /**************************************************************************** - * Name: search_board_squares + * Name: search_board_lines * * Description: * Search for vertical/horizontal lines of same colours. + * + * Parameters: + * None + * + * Returned Value: + * True(1) if there are same colours, False(0) if not. + * ****************************************************************************/ int search_board_lines(void) @@ -724,6 +941,13 @@ int search_board_lines(void) * * Description: * Verify if there are match lines/squares and remove them + * + * Parameters: + * None + * + * Returned Value: + * True(1) if there is a match, False(0) if not. + * ****************************************************************************/ int check_board(void) @@ -768,6 +992,8 @@ int main(int argc, FAR char *argv[]) struct fb_area_s area; int ret; + init_board(); + /* Open the framebuffer driver */ state.fd_fb = open(fbdev, O_RDWR); @@ -778,6 +1004,7 @@ int main(int argc, FAR char *argv[]) return EXIT_FAILURE; } +#ifndef CONFIG_GAMES_BRICKMATCH_USE_LED_MATRIX /* Get the characteristics of the framebuffer */ ret = ioctl(state.fd_fb, FBIOGET_VIDEOINFO, @@ -842,6 +1069,15 @@ int main(int argc, FAR char *argv[]) } printf("Mapped FB: %p\n", state.fbmem); +#else + state.fbmem = calloc(4, N_LEDS); + + if (state.fbmem == NULL) + { + fprintf(stderr, "ws2812_main: buffer allocation failed: %d\n", errno); + return ERROR; + } +#endif /* CONFIG_GAMES_BRICKMATCH_USE_LED_MATRIX */ /* Fill the edge with random values */ @@ -854,9 +1090,14 @@ int main(int argc, FAR char *argv[]) dev_input_init(&input); + input.dir = DIR_NONE; + while (1) { - ret = dev_read_input(&input); + while (input.dir == DIR_NONE) + { + ret = dev_read_input(&input); + } screen.dir = input.dir; @@ -885,6 +1126,7 @@ int main(int argc, FAR char *argv[]) memcpy(prev_board, board, (sizeof(int) * ROW * COL)); screen.dir = DIR_NONE; + input.dir = DIR_NONE; /* If we found bricks with same colors */ @@ -919,7 +1161,7 @@ int main(int argc, FAR char *argv[]) usleep(1000000); #endif - usleep(1000000); + usleep(1000); /* Add random pieces in the not visible border */ From 31daca45ba2d5c7ff31280742c463331870c3eb3 Mon Sep 17 00:00:00 2001 From: Stepan Pressl Date: Thu, 7 Nov 2024 19:27:07 +0100 Subject: [PATCH 203/391] benchmarks/cyclictest: the rt-tests cyclictest NuttX Port Despite the existence of the patch in benchmarks/rt-tests, this commit adds the NuttX Official cyclictest utility. The main difference is the introduction of different waiting methods next to POSIX clock_nanosleep: - The thread can wait for a g_waitsem, posted by board_timerhook() if CONFIG_SYSTEMTICK_HOOK is defined. Since the semaphore is only one, only one thread can wait. - The thread can wait for a Timer Device to timeout. The timer's timeout determines the waiting time of the thread. Since the timer is only one, again, only one thread can wait. The user can measure the elapsed time using clock_gettime or the timer device itself. The different waiting and measuring methods were introduced because NuttX, by default, does not offer fine measuring capabilities using POSIX time functions (as of Feb 25). Signed-off-by: Stepan Pressl --- benchmarks/cyclictest/CMakeLists.txt | 55 ++ benchmarks/cyclictest/Kconfig | 29 + benchmarks/cyclictest/Make.defs | 23 + benchmarks/cyclictest/Makefile | 39 + benchmarks/cyclictest/cyclictest.c | 1083 ++++++++++++++++++++++++++ 5 files changed, 1229 insertions(+) create mode 100644 benchmarks/cyclictest/CMakeLists.txt create mode 100644 benchmarks/cyclictest/Kconfig create mode 100644 benchmarks/cyclictest/Make.defs create mode 100644 benchmarks/cyclictest/Makefile create mode 100644 benchmarks/cyclictest/cyclictest.c diff --git a/benchmarks/cyclictest/CMakeLists.txt b/benchmarks/cyclictest/CMakeLists.txt new file mode 100644 index 00000000000..59cfd2cf876 --- /dev/null +++ b/benchmarks/cyclictest/CMakeLists.txt @@ -0,0 +1,55 @@ +# ############################################################################## +# apps/benchmarks/cyclictest/CMakeLists.txt +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_BENCHMARK_CYCLICTEST) + + # ############################################################################ + # Config and Fetch Coremark application + # ############################################################################ + + set(CYCLICTEST_DIR ${CMAKE_CURRENT_LIST_DIR}) + + # ############################################################################ + # Sources + # ############################################################################ + + set(CSRCS ${CYCLICTEST_DIR}/cyclictest.c) + + # ############################################################################ + # Applications Configuration + # ############################################################################ + + nuttx_add_application( + NAME + cyclictest + PRIORITY + ${CONFIG_CYCLICTEST_PRIORITY} + STACKSIZE + ${CONFIG_CYCLICTEST_STACKSIZE} + MODULE + ${CONFIG_BENCHMARK_CYCLICTEST} + COMPILE_FLAGS + ${CFLAGS} + SRCS + ${CSRCS} + INCLUDE_DIRECTORIES + ${INCDIR}) + +endif() diff --git a/benchmarks/cyclictest/Kconfig b/benchmarks/cyclictest/Kconfig new file mode 100644 index 00000000000..10f80734b87 --- /dev/null +++ b/benchmarks/cyclictest/Kconfig @@ -0,0 +1,29 @@ +# +# For a description of the syntax of this configuration file, +# see the file kconfig-language.txt in the NuttX tools repository. +# + +menuconfig BENCHMARK_CYCLICTEST + bool "Cyclictest" + default n + ---help--- + Enable the cyclictest application. + +if BENCHMARK_CYCLICTEST + +config BENCHMARK_CYCLICTEST_PROGNAME + string "Cyclictest App Name" + default "cyclictest" + ---help--- + This is the name of the program that will be used when the NSH ELF + program is installed. + +config BENCHMARK_CYCLICTEST_PRIORITY + int "Cyclictest task priority" + default 100 + +config BENCHMARK_CYCLICTEST_STACKSIZE + int "Cyclictest task stack size" + default 4096 + +endif # BENCHMARK_CYCLICTEST diff --git a/benchmarks/cyclictest/Make.defs b/benchmarks/cyclictest/Make.defs new file mode 100644 index 00000000000..ecfced80f2b --- /dev/null +++ b/benchmarks/cyclictest/Make.defs @@ -0,0 +1,23 @@ +############################################################################ +# apps/benchmarks/cyclictest/Make.defs +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +ifneq ($(CONFIG_BENCHMARK_CYCLICTEST),) +CONFIGURED_APPS += $(APPDIR)/benchmarks/cyclictest +endif diff --git a/benchmarks/cyclictest/Makefile b/benchmarks/cyclictest/Makefile new file mode 100644 index 00000000000..b7f51691996 --- /dev/null +++ b/benchmarks/cyclictest/Makefile @@ -0,0 +1,39 @@ +############################################################################ +# apps/benchmarks/cyclictest/Makefile +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +include $(APPDIR)/Make.defs + +# spinlock_bench application + +############################################################################ +# Applications Configuration +############################################################################ + +MODULE = $(CONFIG_BENCHMARK_CYCLICTEST) + +PROGNAME += $(CONFIG_BENCHMARK_CYCLICTEST_PROGNAME) +PRIORITY += $(CONFIG_BENCHMARK_CYCLICTEST_PRIORITY) +STACKSIZE += $(CONFIG_BENCHMARK_CYCLICTEST_STACKSIZE) + +MAINSRC += cyclictest.c + +# Build with WebAssembly when CONFIG_INTERPRETERS_WAMR is enabled + +include $(APPDIR)/Application.mk diff --git a/benchmarks/cyclictest/cyclictest.c b/benchmarks/cyclictest/cyclictest.c new file mode 100644 index 00000000000..2ab0f1208be --- /dev/null +++ b/benchmarks/cyclictest/cyclictest.c @@ -0,0 +1,1083 @@ +/**************************************************************************** + * apps/benchmarks/cyclictest/cyclictest.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + * A NuttX port of the cyclictest rt-tests utility for Linux. + * As of writing this piece of software (Feb 2025), clock_gettime + * and clock_nanosleep are tightly tied to systemtick by default. + * Yes, the time resolution can be achieved by using TICKLESS, but for high + * resolution waiting and measurement we can use other methods. + * + * This piece of software includes configurable waiting methods: + * - clock_nanosleep + * - systemtick hook: it is assumed your BSP supports a board_timerhook + * function where a sem_t g_waitsem is posted. + * - WARNING: only one task (thread) can wait for the semaphore. + * - NuttX Timer API: waiting for the timer to expire. + * - WARNING: only one task (thread) can wait for the timer to expire. + * + * Available time measuring methods: + * - clock_gettime + * - NuttX Timer API + * + * Authors of the NuttX port: Stepan Pressl + * + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Types + ****************************************************************************/ + +enum meas_method_e +{ + M_GETTIME = 0, + M_TIMER_API, + M_COUNT +}; + +enum wait_method_e +{ + W_NANOSLEEP = 0, + W_DEVTIMER, + W_COUNT +}; + +struct cyclictest_config_s +{ + int clock; + int distance; + int duration; + int histogram; + int histofall; + unsigned long interval; + unsigned long loops; + int threads; + int policy; + int prio; + char *timer_dev; + enum meas_method_e meas_method; + enum wait_method_e wait_method; +}; + +struct thread_param_s +{ + int prio; + int policy; + unsigned long interval; + unsigned long max_cycles; + struct thread_stats_s *stats; + int clock; +}; + +struct thread_stats_s +{ + long *hist_array; + long hist_overflow; + long min; + long max; + double avg; + unsigned long cycles; + pthread_t id; + bool ended; +}; + +static bool running; +static struct cyclictest_config_s config; +static int timerfd; +static struct pollfd polltimer[1]; + +static const struct option optargs[] = +{ + {"clock", optional_argument, 0, 'c'}, + {"distance", optional_argument, 0, 'd'}, + {"duration", optional_argument, 0, 'D'}, + {"help", optional_argument, 0, 'e'}, + {"histogram", optional_argument, 0, 'h'}, + {"histofall", optional_argument, 0, 'H'}, + {"interval", optional_argument, 0, 'i'}, + {"loops", optional_argument, 0, 'l'}, + {"measurement", optional_argument, 0, 'm'}, + {"nanosleep", optional_argument, 0, 'n'}, + {"prio", optional_argument, 0, 'p'}, + {"threads", optional_argument, 0, 't'}, + {"timer-device", optional_argument, 0, 'T'}, + {"policy", optional_argument, 0, 'y'}, +}; + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +static void print_help(void) +{ + puts( + "The Cyclictest Benchmark Utility\n" + "Usage:\n" + " -c --clock [CLOCK]: selects the clock: 0 selects CLOCK_REALTIME, " + "1 selects CLOCK_MONOTONIC (default).\n" + " -d --distance [US]: The distance of thread intervals. " + "Default is 500us.\n" + " -D --duration [TIME]: Test duration length in seconds. " + "Default is 0 (endless).\n" + " -e --help: Display this help and quit.\n" + " -h --histogram [US]: Output the histogram data to stdout. " + "US is the maximum value to be printed.\n" + " -H --histofall: Same as -h except that an additional histogram " + "column\n" + " is displayed at the right that contains summary data of all thread" + " histograms.\n" + " If cyclictest runs a single thread only, the -H option is " + "equivalent to -h.\n" + " -i --interval [US]: The thread interval. Default is 1000us.\n" + " -l --loops [N]: The number of measurement loops. Default is 0 " + "(endless).\n" + " -m --measurement [METHOD]: Set the time measurement method:\n" + " 0 selects clock_gettime, 1 uses the NuttX timer API.\n" + " WARNING:\n" + " If METHOD 1 is selected, you need to specify a timer device " + "(e.g. /dev/timer0) in -T.\n" + " -n --nanosleep [METHOD]: Set the waiting method: 0 selects " + "clock_nanosleep,\n" + " 1 waits for the POLLIN flag on a timer device. Default is 0.\n" + " WARNING:\n" + " Choosing 1 works only with one thread, " + "the -t value is therefore set to 1.\n" + " If METHOD 1 is selected, you need to specify a timer device " + "(e.g. /dev/timer0) in -T.\n" + " -p --prio: Set the priority of the first thread.\n" + " -t --threads [N]: The number of test threads to be created. " + "Default is 1.\n" + " -T --timer-device [DEV]: The measuring timer device.\n" + " Must be specified when -m=1 or -n=1.\n" + " -y --policy [NAME]: Set the scheduler policy, where NAME is \n" + " fifo, rr, batch, idle, normal, other.\n" + ); +} + +static long arg_decimal(char *arg) +{ + long ret; + char *endptr; + ret = strtol(arg, &endptr, 10); + if (endptr == arg) + { + return -1; + } + + return ret; +} + +static bool parse_args(int argc, char * const argv[]) +{ + int longindex; + int opt; + long decimal; + while ((opt = getopt_long(argc, argv, "c:d:D:h:Hi:l:m:n:p:t:T:", + optargs, &longindex)) != -1) + { + switch (opt) + { + case 'c': + decimal = arg_decimal(optarg); + if (decimal < 0) + { + return false; + } + else if (decimal == CLOCK_MONOTONIC || decimal == CLOCK_REALTIME) + { + config.clock = decimal; + } + break; + case 'd': + decimal = arg_decimal(optarg); + if (decimal >= 0) + { + config.distance = decimal; + } + else + { + return false; + } + break; + case 'D': + decimal = arg_decimal(optarg); + if (decimal >= 0) + { + config.duration = decimal; + } + else + { + return false; + } + break; + case 'e': + return true; + case 'h': + decimal = arg_decimal(optarg); + if (decimal >= 0) + { + config.histogram = decimal; + } + else + { + return false; + } + break; + case 'H': + config.histofall = true; + break; + case 'i': + decimal = arg_decimal(optarg); + if (decimal >= 0) + { + config.interval = decimal; + } + else + { + return false; + } + break; + case 'l': + decimal = arg_decimal(optarg); + if (decimal >= 0) + { + config.loops = decimal; + } + else + { + return false; + } + break; + case 'm': + decimal = arg_decimal(optarg); + if (decimal >= 0) + { + config.meas_method = decimal; + } + else + { + return false; + } + break; + case 'n': + decimal = arg_decimal(optarg); + if (decimal >= 0) + { + config.wait_method = decimal; + } + else + { + return false; + } + break; + case 'p': + decimal = arg_decimal(optarg); + if (decimal >= 0 && decimal <= 255) + { + config.prio = decimal; + } + else + { + return false; + } + break; + case 't': + decimal = arg_decimal(optarg); + if (decimal > 0) + { + config.threads = decimal; + } + else + { + return false; + } + break; + case 'T': + config.timer_dev = optarg; + break; + case 'y': + if (strcmp(optarg, "other") == 0) + { + config.policy = SCHED_OTHER; + } + else if (strcmp(optarg, "normal") == 0) + { + config.policy = SCHED_NORMAL; + } + else if (strcmp(optarg, "batch") == 0) + { + config.policy = SCHED_BATCH; + } + else if (strcmp(optarg, "idle") == 0) + { + config.policy = SCHED_IDLE; + } + else if (strcmp(optarg, "fifo") == 0) + { + config.policy = SCHED_FIFO; + } + else if (strcmp(optarg, "rr") == 0) + { + config.policy = SCHED_RR; + } + else + { + return false; + } + break; + case '?': + return false; + default: + break; + } + } + + if (optind < argc) + { + return false; + } + + return true; +} + +static bool check_args_logic(void) +{ + /* Check if -T option was passed */ + + if (config.wait_method == W_DEVTIMER || config.meas_method == M_TIMER_API) + { + if (config.timer_dev == NULL) + { + fprintf(stderr, "Specify timer device!\n"); + return false; + } + } + + /* Works only with one thread */ + + if (config.wait_method == W_DEVTIMER) + { + config.threads = 1; + } + + /* If the priority was not loaded, default to number of threads. */ + + if (config.prio == 0) + { + config.prio = config.threads; + } + + if (config.wait_method >= W_COUNT) + { + return false; + } + + if (config.meas_method >= M_COUNT) + { + return false; + } + + return true; +} + +static inline void tsnorm(struct timespec *ts) +{ + while (ts->tv_nsec >= NSEC_PER_SEC) + { + ts->tv_nsec -= NSEC_PER_SEC; + ts->tv_sec++; + } +} + +static inline int64_t timediff_us(struct timespec t1, struct timespec t2) +{ + int64_t ret; + ret = 1000000 * (int64_t) ((int) t1.tv_sec - (int) t2.tv_sec); + ret += (int64_t) ((int) t1.tv_nsec - (int) t2.tv_nsec) / 1000; + return ret; +} + +static inline int64_t timediff_us_timer(struct timer_status_s after, + struct timer_status_s before) +{ + int64_t ret = 0; + uint32_t t1; + uint32_t t2; + t1 = before.timeleft; + t2 = after.timeleft; + if (t2 < t1) + { + ret = (int64_t) (t1 - t2); + } + else + { + ret = (int64_t) (after.timeout - (t2 - t1)); + } + + return ret; +} + +static inline int timerdev_getstatus(struct timer_status_s *st) +{ + return ioctl(timerfd, TCIOC_GETSTATUS, (unsigned long)((uintptr_t)st)); +} + +static void *testthread(void *arg) +{ + int ret; + int32_t newint; + int64_t diff = 0; + struct timer_status_s stamp1; + struct timer_status_s stamp2; + struct timespec now; + struct timespec next; + struct timespec interval; + struct timespec endtime; + struct sched_param schedp; + struct thread_param_s *param = (struct thread_param_s *)arg; + struct thread_stats_s *stats = param->stats; + + stats->min = LONG_MAX; + interval.tv_sec = param->interval / 1000000; + interval.tv_nsec = (param->interval % 1000000) * 1000; + + /* Set priority and policy */ + + schedp.sched_priority = param->prio; + ret = pthread_setschedparam(pthread_self(), param->policy, &schedp); + if (ret < 0) + { + goto threadend; + } + + if (config.wait_method == W_DEVTIMER) + { + /* Start the timer here (we know the thread is only one) */ + + ret = ioctl(timerfd, TCIOC_START); + if (ret < 0) + { + perror("TCIOC_START"); + goto threadend; + } + } + + /* We can use clock_gettime for the endtime. */ + + if ((ret = clock_gettime(param->clock, &now)) < 0) + { + goto threadend; + } + + endtime.tv_sec = now.tv_sec + config.duration; + endtime.tv_nsec = now.tv_nsec; + + while (running) + { + /* This inicializes the stamp1.timeout field */ + + if (config.meas_method == M_TIMER_API) + { + ret = timerdev_getstatus(&stamp1); + if (ret < 0) + { + perror("TCIOC_GETSTAUS"); + goto threadend; + } + } + + switch (config.wait_method) + { + case W_NANOSLEEP: + if (config.meas_method == M_TIMER_API) + { + /* If we measure using the TIMER_API, compute + * the expected timestamp when the thread should wake up. + */ + + newint = stamp1.timeleft - param->interval; + if (newint < 0) + { + stamp1.timeleft = stamp1.timeout + newint; + } + } + + next = now; + next.tv_sec += interval.tv_sec; + next.tv_nsec += interval.tv_nsec; + tsnorm(&next); + ret = clock_nanosleep(param->clock, TIMER_ABSTIME, &next, NULL); + if (ret < 0) + { + goto threadend; + } + break; + case W_DEVTIMER: + if (config.meas_method == M_TIMER_API) + { + /* We suppose the timer resets itself when it + * overflows. So the first timestamp is timeout. + */ + + stamp1.timeleft = stamp1.timeout; + } + else if (config.meas_method == M_GETTIME) + { + /* If we measure using the POSIX API, we must get the + * microseconds in which the currently running timer + * is supposed to timeout. We then convert this + * to the timespec struct, indicating the start. + */ + + ret = timerdev_getstatus(&stamp1); + if (ret < 0) + { + perror("TCIOC_GETSTATUS"); + goto threadend; + } + + ret = clock_gettime(param->clock, &next); + if (ret < 0) + { + goto threadend; + } + + next.tv_sec += (stamp1.timeleft) / 1000000; + next.tv_nsec += (stamp1.timeleft % 1000000) * 1000; + tsnorm(&next); + } + + if ((ret = poll(polltimer, 1, -1)) < 0) + { + goto threadend; + } + break; + default: + break; + } + + /* Time Stamp 2 */ + + switch (config.meas_method) + { + case M_GETTIME: + if ((ret = clock_gettime(param->clock, &now)) < 0) + { + goto threadend; + } + + diff = timediff_us(now, next); + break; + case M_TIMER_API: + ret = timerdev_getstatus(&stamp2); + if (ret < 0) + { + perror("TCIOC_GETSTAUS"); + goto threadend; + } + + diff = timediff_us_timer(stamp2, stamp1); + break; + default: + break; + } + + if (diff < stats->min) + { + stats->min = diff; + } + + if (diff > stats->max) + { + stats->max = diff; + } + + stats->avg += (double) diff; + + if (config.histogram) + { + if (diff < config.histogram && diff >= 0) + { + stats->hist_array[diff] += 1; + } + else + { + stats->hist_overflow += 1; + } + } + + ++stats->cycles; + if (param->max_cycles != 0 && stats->cycles >= param->max_cycles) + { + stats->ended = true; + break; + } + + if (config.duration != 0) + { + if ((ret = clock_gettime(param->clock, &now)) < 0) + { + goto threadend; + } + + if (timediff_us(now, endtime) >= 0) + { + stats->ended = true; + break; + } + } + } + +threadend: + return NULL; +} + +static inline void init_thread_param(struct thread_param_s *param, + unsigned long interval, + unsigned long max_cycles, + int policy, + int prio, + struct thread_stats_s *stats, + int clock) +{ + stats->avg = 0.0; + stats->cycles = 0; + stats->max = -LONG_MAX; + stats->min = LONG_MAX; + stats->hist_overflow = 0; + stats->ended = false; + + param->interval = interval; + param->max_cycles = max_cycles; + param->policy = policy; + param->prio = prio; + param->stats = stats; + param->clock = clock; +} + +/* Copied from the original rt-tests/cyclictest. + * This way, the output is compatible with the original cyclictest. + */ + +static void print_hist(struct thread_param_s *par[], int nthreads) +{ + int i; + int j; + unsigned long long int log_entries[nthreads + 1]; + unsigned long maxmax; + unsigned long alloverflows; + + bzero(log_entries, sizeof(log_entries)); + + printf("# Histogram\n"); + for (i = 0; i < config.histogram; i++) + { + unsigned long long int allthreads = 0; + + printf("%06d ", i); + + for (j = 0; j < nthreads; j++) + { + unsigned long curr_latency = par[j]->stats->hist_array[i]; + printf("%06lu", curr_latency); + if (j < nthreads - 1) + { + printf("\t"); + } + + log_entries[j] += curr_latency; + allthreads += curr_latency; + } + + if (config.histofall && nthreads > 1) + { + printf("\t%06llu", allthreads); + log_entries[nthreads] += allthreads; + } + + printf("\n"); + } + + printf("# Total:"); + + for (j = 0; j < nthreads; j++) + { + printf(" %09llu", log_entries[j]); + } + + if (config.histofall && nthreads > 1) + { + printf(" %09llu", log_entries[nthreads]); + } + + printf("\n"); + printf("# Min Latencies:"); + + for (j = 0; j < nthreads; j++) + { + printf(" %05lu", par[j]->stats->min); + } + + printf("\n"); + printf("# Avg Latencies:"); + + for (j = 0; j < nthreads; j++) + { + printf(" %05lu", par[j]->stats->cycles ? + (long)(par[j]->stats->avg / par[j]->stats->cycles) : 0); + } + + printf("\n"); + printf("# Max Latencies:"); + + maxmax = 0; + for (j = 0; j < nthreads; j++) + { + printf(" %05lu", par[j]->stats->max); + if (par[j]->stats->max > maxmax) + { + maxmax = par[j]->stats->max; + } + } + + if (config.histofall && nthreads > 1) + { + printf(" %05lu", maxmax); + } + + printf("\n"); + printf("# Histogram Overflows:"); + + alloverflows = 0; + for (j = 0; j < nthreads; j++) + { + printf(" %05lu", par[j]->stats->hist_overflow); + alloverflows += par[j]->stats->hist_overflow; + } + + if (config.histofall && nthreads > 1) + { + printf(" %05lu", alloverflows); + } + + printf("\n"); +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +int main(int argc, char *argv[]) +{ + int i; + int ret; + struct thread_param_s **params = NULL; + struct thread_stats_s **stats = NULL; + struct sigevent event; + struct timer_notify_s tnotify; + uint32_t maxtimeout_timer; + uint32_t reqtimeout_timer; + + running = true; + config.clock = CLOCK_MONOTONIC; + config.distance = 500; + config.duration = 0; + config.histogram = 0; + config.histofall = 0; + config.interval = 1000; + config.loops = 0; + config.threads = 1; + config.prio = 0; + config.policy = SCHED_FIFO; + config.meas_method = M_GETTIME; + config.wait_method = W_NANOSLEEP; + config.timer_dev = NULL; + + if (!parse_args(argc, argv)) + { + print_help(); + return ERROR; + } + + if (!check_args_logic()) + { + print_help(); + return ERROR; + } + + /* Timer must be configured */ + + if (config.wait_method == W_DEVTIMER || config.meas_method == M_TIMER_API) + { + timerfd = open(config.timer_dev, O_RDWR); + if (timerfd < 0) + { + perror("Failed to open the device timer"); + return ERROR; + } + + /* Configure the timer notification */ + + polltimer[0].fd = timerfd; + polltimer[0].events = POLLIN; + + /* Fill in the notify struct + * We do not want any signalling. But we must configure it, + * because without the timer will not start. + */ + + memset(&event, 0, sizeof(event)); + event.sigev_notify = SIGEV_NONE; + + tnotify.periodic = true; + tnotify.pid = getpid(); + tnotify.event = event; + + /* Now set timeout of the timer. + * This depends on several factors. + * + * If wait_method == W_DEVTIMER, the timeout is set to config.interval + * (to achieve periodic operation). The extra time is measured by + * NANOSLEEP or the timer itself. If the timer is used, the timer + * zeroes itself when the timeout is reached, so we just get + * the timer value after poll has stopped blocking. + * + * If wait_method != W_DEVTIMER, we must set the timeout to at least + * the double of the maximum of all thread intervals + * (if you're not sure, please consult Claude Shannon). + * + * This raises the question: what if wait_method == W_DEVTIMER + * and meas_method == W_TIMER_API and the thread wakes up later + * then the timer's timeout? The solution is to have a different + * timer which runs slower and can measure overruns. + * But this would overcomplicate things. + */ + + if (config.wait_method == W_DEVTIMER) + { + reqtimeout_timer = config.interval; + } + else if (config.wait_method == W_NANOSLEEP) + { + /* Multiply by 3 instead of 2, just to be sure */ + + reqtimeout_timer = 3 * (config.interval + + (config.threads - 1) * config.distance); + } + else + { + reqtimeout_timer = 2 * CONFIG_USEC_PER_TICK; + } + + ret = ioctl(timerfd, TCIOC_MAXTIMEOUT, + (unsigned long)((uintptr_t)&maxtimeout_timer)); + if (ret < 0) + { + perror("TCIOC_MAXTIMEOUT"); + goto errtimer; + } + + if (reqtimeout_timer > maxtimeout_timer) + { + fprintf(stderr, "The timer cannot measure such periods!\n"); + goto errtimer; + } + + ret = ioctl(timerfd, TCIOC_SETTIMEOUT, + (unsigned long)reqtimeout_timer); + if (ret < 0) + { + perror("TCIOC_SETTIMEOUT"); + goto errtimer; + } + + ret = ioctl(timerfd, TCIOC_NOTIFICATION, + (unsigned long)((uintptr_t)&tnotify)); + if (ret < 0) + { + perror("TCIOC_NOTIFICATION"); + goto errtimer; + } + + /* If the timer is used only for measurement, start it here, otherwise + * start it only in one thread. + */ + + if (config.wait_method != W_DEVTIMER) + { + ret = ioctl(timerfd, TCIOC_START); + if (ret < 0) + { + perror("TCIOC_START"); + goto errtimer; + } + } + } + + params = calloc(config.threads, sizeof(struct thread_param_s *)); + if (params == NULL) + { + perror("params"); + ret = ERROR; + goto main_error; + } + + stats = calloc(config.threads, sizeof(struct thread_stats_s *)); + if (stats == NULL) + { + perror("stats"); + ret = ERROR; + goto main_error; + } + + for (i = 0; i < config.threads; ++i) + { + params[i] = malloc(sizeof(struct thread_param_s)); + if (params == NULL) + { + perror("params[i]"); + ret = ERROR; + goto main_error; + } + + stats[i] = malloc(sizeof(struct thread_stats_s)); + if (params == NULL) + { + perror("stats[i]"); + ret = ERROR; + goto main_error; + } + + stats[i]->hist_array = calloc(config.histogram, sizeof(long)); + if (stats[i]->hist_array == NULL) + { + perror("hist_array"); + ret = ERROR; + goto main_error; + } + + init_thread_param(params[i], config.interval, config.loops, + config.policy, config.prio, stats[i], config.clock); + + pthread_create(&stats[i]->id, NULL, testthread, params[i]); + config.interval += config.distance; + if (config.prio > 1) + { + config.prio--; + } + } + + while (running) + { + /* Periodically update the output */ + + usleep(100 * 1000); + int ended = 0; + for (i = 0; i < config.threads; ++i) + { + if (stats[i]->ended) + { + ended += 1; + } + } + + if (ended == config.threads) + { + running = false; + } + } + + for (i = 0; i < config.threads; ++i) + { + pthread_join(stats[i]->id, NULL); + } + + if (config.histogram) + { + print_hist(params, config.threads); + } + + ret = OK; + if (config.wait_method == W_DEVTIMER || config.meas_method == M_TIMER_API) + { + ret = ioctl(timerfd, TCIOC_STOP); + if (ret < 0) + { + perror("TCIOC_STOP"); + ret = ERROR; + } + + close(timerfd); + } + +main_error: + if (stats != NULL) + { + for (i = 0; i < config.threads; ++i) + { + if (params[i] != NULL) + { + free(params[i]); + } + + if (stats[i] != NULL) + { + if (stats[i]->hist_array != NULL) + { + free(stats[i]->hist_array); + } + + free(stats[i]); + } + } + } + + free(stats); + return ret; + +errtimer: + close(timerfd); + return ERROR; +} From 322c81bd8a3f158e42e079ccf0c5490706cad528 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Sun, 16 Feb 2025 15:18:30 +0900 Subject: [PATCH 204/391] toywasm: bump to v66.0.0 the included changes are: ```shell spacetanuki% git log --pretty=oneline v65.0.0..v66.0.0 b0e100a4ebd666f02b2bb9222d402a9f399a740b (tag: v66.0.0) wapm.toml: bump the version 7604b9b896d7f48c46e484f560bbc679a87b0241 LICENSE: new year c674c030025aab4cac94962328ae69590c5f1367 test/spectest.wat: update to match the spec harness a5cf6bda2b2e022775d4d2d54aa11afc2e1295c2 test/fetch-spec-test.sh: update wasm-spec-test c97f2d8e9e19d586d46b5db48a0582f374796d12 test/prepare-spec-test.sh: bump https://github.com/WebAssembly/multi-memory b5f75600df812c421855ab7008b13113658af1c4 test/prepare-spec-test.sh: bump https://github.com/WebAssembly/spec version 1bfdc750dc18d085ac739a629b8b12b7ed9d9f6b escape.c: fix an integer overflow issue, especially on 32-bit archs e15be49961d32e1878bfea399fd9cd609ff94045 escape.c: fix a comment spacetanuki% ``` for nuttx-apps, only the escape.c fix is important. Signed-off-by: YAMAMOTO Takashi --- interpreters/toywasm/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interpreters/toywasm/Makefile b/interpreters/toywasm/Makefile index 9de01ccc968..b36604b0408 100644 --- a/interpreters/toywasm/Makefile +++ b/interpreters/toywasm/Makefile @@ -146,7 +146,7 @@ CFLAGS += ${INCDIR_PREFIX}$(APPDIR)/interpreters/toywasm/toywasm/libdyld CFLAGS += -Wno-unknown-warning-option -Wno-unused-but-set-variable -Wno-unused-variable -Wno-return-type -TOYWASM_VERSION = e972e94fa427c3371fb21ad4bb9f238a1cca7795 +TOYWASM_VERSION = b0e100a4ebd666f02b2bb9222d402a9f399a740b TOYWASM_UNPACK = toywasm TOYWASM_TARBALL = $(TOYWASM_VERSION).zip TOYWASM_URL_BASE = https://github.com/yamt/toywasm/archive/ From 036fe7668d81a02a9dc32cc18c31a8d74ee6fa4a Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Sun, 16 Feb 2025 15:19:17 +0900 Subject: [PATCH 205/391] toywasm: regen for v66.0.0 ``` REF=b0e100a4ebd666f02b2bb9222d402a9f399a740b ./regen.sh ``` Signed-off-by: YAMAMOTO Takashi --- interpreters/toywasm/include/toywasm_version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interpreters/toywasm/include/toywasm_version.h b/interpreters/toywasm/include/toywasm_version.h index c069030f507..b2f1cc77aec 100644 --- a/interpreters/toywasm/include/toywasm_version.h +++ b/interpreters/toywasm/include/toywasm_version.h @@ -23,6 +23,6 @@ #if !defined(_TOYWASM_VERSION_H) #define _TOYWASM_VERSION_H -#define TOYWASM_VERSION "v65.0.0" +#define TOYWASM_VERSION "v66.0.0" #endif /* !defined(_TOYWASM_VERSION_H) */ From 844b9c657dff153cde82373c19c65f046a4a7f26 Mon Sep 17 00:00:00 2001 From: tengshuangshuang Date: Mon, 3 Mar 2025 17:08:36 +0800 Subject: [PATCH 206/391] apps/testing:fix uclibc atomic make.defs error In the previous changes to the apps/testing folder, I added an extra slash in the make.defs of uclibcxx, atomic. Signed-off-by: tengshuangshuang --- testing/cxx/uclibcxx_test/Make.defs | 2 +- testing/libc/atomic/Make.defs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/testing/cxx/uclibcxx_test/Make.defs b/testing/cxx/uclibcxx_test/Make.defs index a5d5f455ba2..e4907b4a6eb 100644 --- a/testing/cxx/uclibcxx_test/Make.defs +++ b/testing/cxx/uclibcxx_test/Make.defs @@ -21,5 +21,5 @@ ############################################################################ ifneq ($(CONFIG_TESTING_UCLIBCXXTEST),) -CONFIGURED_APPS += $(APPDIR)/testing//cxx/uclibcxx_test +CONFIGURED_APPS += $(APPDIR)/testing/cxx/uclibcxx_test endif diff --git a/testing/libc/atomic/Make.defs b/testing/libc/atomic/Make.defs index ab66bcb1968..70f49d851a5 100644 --- a/testing/libc/atomic/Make.defs +++ b/testing/libc/atomic/Make.defs @@ -21,5 +21,5 @@ ############################################################################ ifneq ($(CONFIG_TESTING_ATOMIC),) -CONFIGURED_APPS += $(APPDIR)/testing/sched/atomic +CONFIGURED_APPS += $(APPDIR)/testing/libc/atomic endif From 91aa0b8ae85e4f279ebc28dc2991f93caa01b82e Mon Sep 17 00:00:00 2001 From: Stepan Pressl Date: Sat, 1 Mar 2025 12:22:13 +0100 Subject: [PATCH 207/391] benchmarks/cyclictest/cyclictest.c: periodic output and -q option Without the -q (--quiet) option, the program outputs the thread stats every 100ms, which is compatible with the original rt-tests/cyclictest utility. Signed-off-by: Stepan Pressl --- benchmarks/cyclictest/cyclictest.c | 43 +++++++++++++++++++++++++----- 1 file changed, 37 insertions(+), 6 deletions(-) diff --git a/benchmarks/cyclictest/cyclictest.c b/benchmarks/cyclictest/cyclictest.c index 2ab0f1208be..92bad1eb085 100644 --- a/benchmarks/cyclictest/cyclictest.c +++ b/benchmarks/cyclictest/cyclictest.c @@ -96,6 +96,7 @@ struct cyclictest_config_s int threads; int policy; int prio; + bool quiet; char *timer_dev; enum meas_method_e meas_method; enum wait_method_e wait_method; @@ -117,9 +118,11 @@ struct thread_stats_s long hist_overflow; long min; long max; + long act; double avg; unsigned long cycles; pthread_t id; + int tid; bool ended; }; @@ -141,6 +144,7 @@ static const struct option optargs[] = {"measurement", optional_argument, 0, 'm'}, {"nanosleep", optional_argument, 0, 'n'}, {"prio", optional_argument, 0, 'p'}, + {"quiet", optional_argument, 0, 'q'}, {"threads", optional_argument, 0, 't'}, {"timer-device", optional_argument, 0, 'T'}, {"policy", optional_argument, 0, 'y'}, @@ -187,6 +191,7 @@ static void print_help(void) " If METHOD 1 is selected, you need to specify a timer device " "(e.g. /dev/timer0) in -T.\n" " -p --prio: Set the priority of the first thread.\n" + " -q --quiet: Print a summary only on exit.\n" " -t --threads [N]: The number of test threads to be created. " "Default is 1.\n" " -T --timer-device [DEV]: The measuring timer device.\n" @@ -214,7 +219,7 @@ static bool parse_args(int argc, char * const argv[]) int longindex; int opt; long decimal; - while ((opt = getopt_long(argc, argv, "c:d:D:h:Hi:l:m:n:p:t:T:", + while ((opt = getopt_long(argc, argv, "c:d:D:h:Hi:l:m:n:p:qt:T:", optargs, &longindex)) != -1) { switch (opt) @@ -323,6 +328,9 @@ static bool parse_args(int argc, char * const argv[]) return false; } break; + case 'q': + config.quiet = true; + break; case 't': decimal = arg_decimal(optarg); if (decimal > 0) @@ -479,6 +487,7 @@ static void *testthread(void *arg) struct thread_param_s *param = (struct thread_param_s *)arg; struct thread_stats_s *stats = param->stats; + stats->tid = gettid(); stats->min = LONG_MAX; interval.tv_sec = param->interval / 1000000; interval.tv_nsec = (param->interval % 1000000) * 1000; @@ -624,6 +633,7 @@ static void *testthread(void *arg) break; } + stats->act = diff; if (diff < stats->min) { stats->min = diff; @@ -805,6 +815,21 @@ static void print_hist(struct thread_param_s *par[], int nthreads) printf("\n"); } +/* Copied from the original rt-tests/cyclictest. + * This way, the output is compatible with the original cyclictest. + */ + +static void print_stat(struct thread_param_s *par, int index) +{ + struct thread_stats_s *stat = par->stats; + char *fmt; + fmt = "T:%2d (%5d) P:%2d I:%ld C:%7lu " + "Min:%7ld Act:%5ld Avg:%5ld Max:%8ld\n"; + printf(fmt, index, stat->tid, par->prio, par->interval, stat->cycles, + stat->min, stat->act, + stat->cycles ? (long)(stat->avg / stat->cycles) : 0, stat->max); +} + /**************************************************************************** * Public Functions ****************************************************************************/ @@ -834,6 +859,7 @@ int main(int argc, char *argv[]) config.meas_method = M_GETTIME; config.wait_method = W_NANOSLEEP; config.timer_dev = NULL; + config.quiet = false; if (!parse_args(argc, argv)) { @@ -865,7 +891,7 @@ int main(int argc, char *argv[]) /* Fill in the notify struct * We do not want any signalling. But we must configure it, - * because without the timer will not start. + * because without it the timer will not start. */ memset(&event, 0, sizeof(event)); @@ -906,10 +932,6 @@ int main(int argc, char *argv[]) reqtimeout_timer = 3 * (config.interval + (config.threads - 1) * config.distance); } - else - { - reqtimeout_timer = 2 * CONFIG_USEC_PER_TICK; - } ret = ioctl(timerfd, TCIOC_MAXTIMEOUT, (unsigned long)((uintptr_t)&maxtimeout_timer)); @@ -1017,6 +1039,11 @@ int main(int argc, char *argv[]) int ended = 0; for (i = 0; i < config.threads; ++i) { + if (!config.quiet) + { + print_stat(params[i], i); + } + if (stats[i]->ended) { ended += 1; @@ -1027,6 +1054,10 @@ int main(int argc, char *argv[]) { running = false; } + else if (!config.quiet) + { + printf("\x1B[%dA", config.threads); + } } for (i = 0; i < config.threads; ++i) From 2e61c6bff87064140d9d104b6874adb8a53bc4cc Mon Sep 17 00:00:00 2001 From: chenrun1 Date: Mon, 13 Jan 2025 14:53:26 +0800 Subject: [PATCH 208/391] examples/romfs:add EXAMPLES_ROMFS_RAMDEVNO Summary: add EXAMPLES_ROMFS_RAMDEVNO for custom initliaze ramdisk number Signed-off-by: chenrun1 --- examples/romfs/Kconfig | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/examples/romfs/Kconfig b/examples/romfs/Kconfig index 6284a201381..260d4d453e8 100644 --- a/examples/romfs/Kconfig +++ b/examples/romfs/Kconfig @@ -11,4 +11,11 @@ config EXAMPLES_ROMFS Enable the ROMFS example if EXAMPLES_ROMFS + +config EXAMPLES_ROMFS_RAMDEVNO + int "ROMFS example ramdevno" + default 10 + ---help--- + Custom RAMDisk number + endif From a0f05d0c620492b259296780d9c1490eaa1f8794 Mon Sep 17 00:00:00 2001 From: chenrun1 Date: Tue, 11 Feb 2025 20:22:09 +0800 Subject: [PATCH 209/391] ostest:Fix the issue that nxevent pthread was not executed, causing case failed Summary: In the case of slow overall system response (such as when MM_KASAN is turned on), the nxevent case work thread will not be executed and will be switched back to the main thread, so that the event does not get the expected result and the case fails. By adjusting the thread priority, the work thread can be scheduled to avoid the expected result failure Signed-off-by: chenrun1 --- testing/ostest/nxevent.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testing/ostest/nxevent.c b/testing/ostest/nxevent.c index e77309d16b6..545fca40839 100644 --- a/testing/ostest/nxevent.c +++ b/testing/ostest/nxevent.c @@ -281,7 +281,7 @@ void nxevent_test(void) /* Lower priority */ - sparam.sched_priority = PTHREAD_DEFAULT_PRIORITY - 1; + sparam.sched_priority = PTHREAD_DEFAULT_PRIORITY; pthread_attr_setschedparam(&attr, &sparam); /* Create thread */ @@ -304,7 +304,7 @@ void nxevent_test(void) /* Lower priority */ - sparam.sched_priority = PTHREAD_DEFAULT_PRIORITY - 1; + sparam.sched_priority = PTHREAD_DEFAULT_PRIORITY; pthread_attr_setschedparam(&attr, &sparam); /* Create thread */ From a7020e45cc21ad01ab31439fa2586dd2a538f9aa Mon Sep 17 00:00:00 2001 From: chenrun1 Date: Wed, 25 Dec 2024 11:32:14 +0800 Subject: [PATCH 210/391] benchmarks/osperf: fix warning maybe-uninitialized Summary: In function 'performance_gettime', inlined from 'hpwork_performance' at osperf.c:245:10: osperf.c:123:3: error: 'result.end' may be used uninitialized [-Werror=maybe-uninitialized] 123 | up_perf_convert(result->end - result->start, &ts); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ osperf.c: In function 'hpwork_performance': osperf.c:228:29: note: 'result.end' was declared here 228 | struct performance_time_s result; | ^~~~~~ CC: audio/lib_buffer.c CC: common/arm64_initialize.c CC: builtin/lib_builtin_getname.c Signed-off-by: chenrun1 --- benchmarks/osperf/osperf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/benchmarks/osperf/osperf.c b/benchmarks/osperf/osperf.c index 36c1f4914e9..c5b680613d7 100644 --- a/benchmarks/osperf/osperf.c +++ b/benchmarks/osperf/osperf.c @@ -239,6 +239,7 @@ static size_t hpwork_performance(void) (FAR void *)&result }; + memset(&result, 0, sizeof(result)); memset(&work, 0, sizeof(work)); performance_start(&result); ret = work_queue(HPWORK, &work, work_handle, args, 0); From 9c829f66507165b61df67dd0ec251184bbfb5a06 Mon Sep 17 00:00:00 2001 From: chenrun1 Date: Mon, 6 Jan 2025 19:52:20 +0800 Subject: [PATCH 211/391] examples: Add depends to different test cases Summary: 1.ftpd 2.unionfs 3.userfs 4.nxffs 5.smart Signed-off-by: chenrun1 --- examples/unionfs/Kconfig | 2 +- examples/userfs/Kconfig | 1 + testing/fs/nxffs/Kconfig | 1 + testing/fs/smart/Kconfig | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/unionfs/Kconfig b/examples/unionfs/Kconfig index 00e04c3d793..c6df6e185f1 100644 --- a/examples/unionfs/Kconfig +++ b/examples/unionfs/Kconfig @@ -6,7 +6,7 @@ config EXAMPLES_UNIONFS tristate "Union file system example" default n - depends on (FS_ROMFS || FS_UNIONFS) && BUILD_FLAT + depends on FS_ROMFS && FS_UNIONFS && BUILD_FLAT ---help--- Enable the Union File System example diff --git a/examples/userfs/Kconfig b/examples/userfs/Kconfig index b1d868f5a3f..c49764c5f1f 100644 --- a/examples/userfs/Kconfig +++ b/examples/userfs/Kconfig @@ -5,6 +5,7 @@ config EXAMPLES_USERFS tristate "UserFS test" + depends on FS_USERFS default n ---help--- Enables a simple test of the UserFS diff --git a/testing/fs/nxffs/Kconfig b/testing/fs/nxffs/Kconfig index 759b7744d19..fc263b8778e 100644 --- a/testing/fs/nxffs/Kconfig +++ b/testing/fs/nxffs/Kconfig @@ -5,6 +5,7 @@ config TESTING_NXFFS tristate "NXFFS file system example" + depends on FS_NXFFS && RAMMTD default n ---help--- Enable the NXFFS file system example diff --git a/testing/fs/smart/Kconfig b/testing/fs/smart/Kconfig index ed30bdb9a80..0ad79cf3662 100644 --- a/testing/fs/smart/Kconfig +++ b/testing/fs/smart/Kconfig @@ -5,6 +5,7 @@ config TESTING_SMART tristate "SMART file system example" + depends on SMART_DEV_LOOP && RAMMTD && FS_SMARTFS default n ---help--- Enable the SMART file system example From 3b03636e95f6202b512d8af32629da4c0dc4af2c Mon Sep 17 00:00:00 2001 From: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com> Date: Thu, 6 Mar 2025 22:36:11 +0900 Subject: [PATCH 212/391] examples/bmi160: Fix typo of depends on Fix SENSORS_BMG160 to SENSORS_BMI160. Signed-off-by: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com> --- examples/bmi160/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/bmi160/Kconfig b/examples/bmi160/Kconfig index f97b18f44f3..1d93fdecc2c 100644 --- a/examples/bmi160/Kconfig +++ b/examples/bmi160/Kconfig @@ -6,7 +6,7 @@ config EXAMPLES_SIXAXIS bool "BMI160 sensor example" default n - depends on SENSORS_BMG160 + depends on SENSORS_BMI160 ---help--- Enable the 6 axis sensor example From 0639a2ad7ba473463923ce377b0227763bf051f9 Mon Sep 17 00:00:00 2001 From: Michal Lenc Date: Mon, 10 Mar 2025 13:16:25 +0100 Subject: [PATCH 213/391] boot/nxboot: enhance bootloader capabilities and decision logic This commit enhances the bootloader capabilities. The image's header is extended with header version, size, platform identifier and pointer to optional next header. CRC32 now includes part of the header in its calculation as well. The change also avoids having two different magics for image uploaded over programmer and update image. Both these images have the same magic and this magic is changed internally by the bootloader's logic. The change is needed because image with standard magic is automatically considered as a confirmed image (uploaded with programmer). The current implementation avoids tails at all, therefore the user application uploading the image does not have to erase the tail before new upload. The image is considered as confirmed if it has standard magic or its recovery is present. This means the bootloader has to erase the header of the update image after the update is done (to avoid update loop and to mark the image as unstable). This page is written back during the confirmation. This is a breaking change, but necessary for the future development of the bootloader. The added header version field will allow to add minor/major updates while keeping the backwards compatibility. Signed-off-by: Michal Lenc Co-authored-by: Pavel Pisa Co-authored-by: Karel Koci --- boot/nxboot/Kconfig | 11 +- boot/nxboot/include/nxboot.h | 86 ++++-- boot/nxboot/loader/boot.c | 499 ++++++++++++++++++++--------------- boot/nxboot/loader/flash.c | 15 +- boot/nxboot/loader/flash.h | 7 +- boot/nxboot/tools/nximage.py | 62 +++-- 6 files changed, 409 insertions(+), 271 deletions(-) diff --git a/boot/nxboot/Kconfig b/boot/nxboot/Kconfig index cbf596a180e..f8e817b5ac5 100644 --- a/boot/nxboot/Kconfig +++ b/boot/nxboot/Kconfig @@ -43,6 +43,15 @@ config NXBOOT_HEADER_SIZE Note that this size should be aligned with the program memory write page size! +config NXBOOT_PLATFORM_IDENTIFIER + hex "A unique platform identifier" + default 0x0 + ---help--- + This is a unique platform identifier used by the bootloader to + verify whether the image should be run on a given platform. An update + (or even a firmware uploaded via a programmer) is rejected if the + value in image's header doesn't match this option. + config NXBOOT_BOOTLOADER bool "Build nxboot bootloader application" default n @@ -80,7 +89,7 @@ config NXBOOT_PREVENT_DOWNGRADE performed only for newer versions (according to Semantic Version preference rules). - WARNING: NXboot currently implementes preferences only for + WARNING: NXboot currently implements preferences only for MAJOR.MINOR.PATCH and ignores prerelease. endif # NXBOOT_BOOTLOADER diff --git a/boot/nxboot/include/nxboot.h b/boot/nxboot/include/nxboot.h index 2ecf961c766..5370c2ee6f8 100644 --- a/boot/nxboot/include/nxboot.h +++ b/boot/nxboot/include/nxboot.h @@ -39,26 +39,32 @@ #define NXBOOT_SECONDARY_SLOT_NUM (1) #define NXBOOT_TERTIARY_SLOT_NUM (2) -/* Offsets to write pages containing confirmed and updated flags. These - * pages are located at the end of the partition, therefore index 0 means - * the first page from the end. - */ - -#define NXBOOT_CONFIRMED_PAGE_INDEX (0) -#define NXBOOT_UPDATED_PAGE_INDEX (1) - -#define NXBOOT_HEADER_MAGIC 0x534f584e /* NXOS. */ -#define NXBOOT_HEADER_MAGIC_INV 0xaca0abb1 /* NXOS inverted. This is used - * for images uploaded directly - * to the primary flash with - * the debugger. These images - * does not have precalculated - * CRC and flags at the - * end of the partition, but - * are considered to be valid. +#define NXBOOT_HEADER_MAGIC 0x534f584e /* NXOS. The NX images, both + * uploaded directly to primary + * partition via debugger and to + * update via some application + * are used with this magic. If + * this image is uploaded to + * primary flash, it is considered + * valid. */ +#define NXBOOT_HEADER_MAGIC_INT 0xaca0abb0 /* NXOS internal. This is used + * for internal bootloader + * handling and operations. It is + * switch internally to distinguish + * between images uploaded via + * debugger or the ones updated + * after the bootloader performed + * its operation. The first two + * bits are reserved to point + * what partition is a recovery + * for this image. + */ + +#define NXBOOT_HEADER_MAGIC_INT_MASK 0xfffffff0 +#define NXBOOT_RECOVERY_PTR_MASK 0x3 -#define NXBOOT_HEADER_PRERELEASE_MAXLEN 110 +#define NXBOOT_HEADER_PRERELEASE_MAXLEN 94 /**************************************************************************** * Public Types @@ -84,11 +90,30 @@ struct nxboot_img_version char pre_release[NXBOOT_HEADER_PRERELEASE_MAXLEN]; /* Additional pre-release version */ }; +struct nxboot_hdr_version +{ + uint8_t major; + uint8_t minor; +}; + struct nxboot_img_header { - uint32_t magic; /* Header magic */ - uint32_t size; /* Image size (excluding the header) */ - uint32_t crc; /* CRC32 of image (excluding the header). */ + uint32_t magic; /* Header magic */ + struct nxboot_hdr_version hdr_version; /* Version of the header */ + + uint16_t header_size; /* Length of the header in bytes */ + uint32_t crc; /* CRC32 of image (excluding the previous + * fields in header, but including the following + * ones). + */ + uint32_t size; /* Image size (excluding the header) */ + uint64_t identifier; /* Platform identifier. An image is rejected + * if it does not match the one set for + * the bootloader in NXBOOT_PLATFORM_IDENTIFIER. + */ + uint32_t extd_hdr_ptr; /* Address of the next extended header. + * This is a hook for future additional headers. + */ struct nxboot_img_version img_version; /* Image version */ }; @@ -101,8 +126,9 @@ struct nxboot_state int update; /* Number of update slot */ int recovery; /* Number of recovery slot */ bool recovery_valid; /* True if recovery image contains valid recovery */ + bool recovery_present; /* True if the image in primary has a recovery */ bool primary_confirmed; /* True if primary slot is confirmed */ - enum nxboot_update_type next_boot; /* True if update slot has a valid image */ + enum nxboot_update_type next_boot; /* nxboot_update_type with next operation */ }; /**************************************************************************** @@ -128,6 +154,22 @@ struct nxboot_state int nxboot_get_state(struct nxboot_state *state); +/**************************************************************************** + * Name: nxboot_open_update_partition + * + * Description: + * Gets the current bootloader state and opens the partition to which an + * update image should be stored. It returns the valid file descriptor to + * this partition, the user is responsible for writing to it and closing + * if afterwards. + * + * Returned Value: + * Valid file descriptor on success, -1 and sets errno on failure. + * + ****************************************************************************/ + +int nxboot_open_update_partition(void); + /**************************************************************************** * Name: nxboot_get_confirm * diff --git a/boot/nxboot/loader/boot.c b/boot/nxboot/loader/boot.c index ec1ec3c659d..9a43f4cb67e 100644 --- a/boot/nxboot/loader/boot.c +++ b/boot/nxboot/loader/boot.c @@ -45,44 +45,13 @@ # warning "Downgrade prevention currently ignores prerelease." #endif +#define IS_INTERNAL_MAGIC(magic) ((magic & NXBOOT_HEADER_MAGIC_INT_MASK) \ + == NXBOOT_HEADER_MAGIC_INT) + /**************************************************************************** * Private Functions ****************************************************************************/ -static inline bool get_image_flag(int fd, int index) -{ - uint8_t flag; - struct flash_partition_info info; - - if (flash_partition_info(fd, &info) < 0) - { - return false; - } - - if (flash_partition_read(fd, &flag, 1, - info.size - info.blocksize * (index + 1)) < 0) - { - return false; - } - - return flag == 0xfe; -} - -static inline int set_image_flag(int fd, int index) -{ - uint8_t flag; - struct flash_partition_info info; - - if (flash_partition_info(fd, &info) < 0) - { - return ERROR; - } - - flag = 0xfe; - return flash_partition_write(fd, &flag, 1, - info.size - (info.blocksize * (index + 1))); -} - static inline void get_image_header(int fd, struct nxboot_img_header *header) { int ret; @@ -97,8 +66,9 @@ static inline void get_image_header(int fd, struct nxboot_img_header *header) static inline bool validate_image_header(struct nxboot_img_header *header) { - return header->magic == NXBOOT_HEADER_MAGIC || - header->magic == NXBOOT_HEADER_MAGIC_INV; + return (header->magic == NXBOOT_HEADER_MAGIC || + IS_INTERNAL_MAGIC(header->magic)) && + header->identifier == CONFIG_NXBOOT_PLATFORM_IDENTIFIER; } static uint32_t calculate_crc(int fd, struct nxboot_img_header *header) @@ -122,8 +92,8 @@ static uint32_t calculate_crc(int fd, struct nxboot_img_header *header) } crc = 0xffffffff; - remain = header->size; - off = CONFIG_NXBOOT_HEADER_SIZE; + off = offsetof(struct nxboot_img_header, crc) + sizeof crc; + remain = header->size + header->header_size - off; while (remain > 0) { readsiz = remain > info.blocksize ? info.blocksize : remain; @@ -142,12 +112,12 @@ static uint32_t calculate_crc(int fd, struct nxboot_img_header *header) return ~crc; } -static int copy_partition(int from, int where) +static int copy_partition(int from, int where, struct nxboot_state *state, + bool update) { struct nxboot_img_header header; struct flash_partition_info info_from; struct flash_partition_info info_where; - uint32_t crc; uint32_t magic; int readsiz; int remain; @@ -167,7 +137,8 @@ static int copy_partition(int from, int where) return ERROR; } - if ((header.size + CONFIG_NXBOOT_HEADER_SIZE) > info_where.size) + remain = header.size + header.header_size; + if (remain > info_where.size) { return ERROR; } @@ -180,43 +151,40 @@ static int copy_partition(int from, int where) return ERROR; } - if (flash_partition_erase_last_sector(where) < 0) - { - return ERROR; - } + /* Flip header's magic. We go from standard to internal in case of + * image update and from internal to standard in case of recovery + * creation or revert operation. + */ - remain = header.size + CONFIG_NXBOOT_HEADER_SIZE; - off = 0; - if (header.magic == NXBOOT_HEADER_MAGIC_INV) + magic = IS_INTERNAL_MAGIC(header.magic) ? + NXBOOT_HEADER_MAGIC : NXBOOT_HEADER_MAGIC_INT; + + if (update) { - /* This means we are doing a recovery of a primary image - * without the precalculated CRC. Calculate CRC and insert it - * into the recovery image header. Also flip header's magic to - * indicate this is an image with valid CRC. + /* This is update operation, add pointer to recovery image to the + * image's magic. */ - magic = NXBOOT_HEADER_MAGIC; - crc = calculate_crc(from, &header); - if (flash_partition_read(from, buf, blocksize, 0) < 0) - { - free(buf); - return ERROR; - } + magic |= state->update; + } - memcpy(buf + offsetof(struct nxboot_img_header, magic), &magic, - sizeof magic); - memcpy(buf + offsetof(struct nxboot_img_header, crc), &crc, - sizeof crc); - if (flash_partition_write(where, buf, blocksize, 0) < 0) - { - free(buf); - return ERROR; - } + if (flash_partition_read(from, buf, blocksize, 0) < 0) + { + free(buf); + return ERROR; + } - off += blocksize; - remain -= blocksize; + memcpy(buf + offsetof(struct nxboot_img_header, magic), &magic, + sizeof magic); + if (flash_partition_write(where, buf, blocksize, 0) < 0) + { + free(buf); + return ERROR; } + off = blocksize; + remain -= blocksize; + while (remain > 0) { readsiz = remain > blocksize ? blocksize : remain; @@ -236,27 +204,6 @@ static int copy_partition(int from, int where) remain -= readsiz; } - if (header.magic != NXBOOT_HEADER_MAGIC_INV) - { - /* Copy currently set flags but only if the image has - * precalculated CRC. - */ - - if (get_image_flag(from, NXBOOT_UPDATED_PAGE_INDEX)) - { - set_image_flag(where, NXBOOT_UPDATED_PAGE_INDEX); - } - - if (get_image_flag(from, NXBOOT_CONFIRMED_PAGE_INDEX)) - { - set_image_flag(where, NXBOOT_CONFIRMED_PAGE_INDEX); - } - } - else - { - set_image_flag(where, NXBOOT_CONFIRMED_PAGE_INDEX); - } - free(buf); return OK; } @@ -271,21 +218,7 @@ static bool validate_image(int fd) return false; } - if (header.magic == NXBOOT_HEADER_MAGIC_INV) - { - /* Images with no precalculated CRC are considered valid. These - * should be the images that are uploaded directly to the primary - * paritition with debugger/flasher and are not uploaded by the - * bootloader. These images also don't have confirmed flags, - * altough they are considered stable. - */ - - return true; - } - else - { - return calculate_crc(fd, &header) == header.crc; - } + return calculate_crc(fd, &header) == header.crc; } static bool compare_versions(struct nxboot_img_version *v1, @@ -329,31 +262,29 @@ static bool compare_versions(struct nxboot_img_version *v1, } static enum nxboot_update_type - get_update_type(int primary, int update, int recovery, + get_update_type(struct nxboot_state *state, + int primary, int update, int recovery, struct nxboot_img_header *primary_header, - struct nxboot_img_header *update_header) + struct nxboot_img_header *update_header, + struct nxboot_img_header *recovery_header) { - if (get_image_flag(recovery, NXBOOT_CONFIRMED_PAGE_INDEX) && - get_image_flag(update, NXBOOT_UPDATED_PAGE_INDEX) && - ((!get_image_flag(primary, NXBOOT_CONFIRMED_PAGE_INDEX) && - primary_header->magic != NXBOOT_HEADER_MAGIC_INV) || - !validate_image(primary)) && validate_image(recovery)) - { - return NXBOOT_UPDATE_TYPE_REVERT; - } + bool primary_valid = validate_image(primary); - if (!get_image_flag(update, NXBOOT_CONFIRMED_PAGE_INDEX) && - !get_image_flag(update, NXBOOT_UPDATED_PAGE_INDEX) && - validate_image(update)) + if (update_header->magic == NXBOOT_HEADER_MAGIC && validate_image(update)) { - if (compare_versions(&primary_header->img_version, - &update_header->img_version) && - validate_image(primary)) + if (primary_header->crc != update_header->crc || + !compare_versions(&primary_header->img_version, + &update_header->img_version) || !primary_valid) { - return NXBOOT_UPDATE_TYPE_NONE; + return NXBOOT_UPDATE_TYPE_UPDATE; } + } - return NXBOOT_UPDATE_TYPE_UPDATE; + if (IS_INTERNAL_MAGIC(recovery_header->magic) && state->recovery_valid && + ((IS_INTERNAL_MAGIC(primary_header->magic) && + !state->primary_confirmed) || !primary_valid)) + { + return NXBOOT_UPDATE_TYPE_REVERT; } return NXBOOT_UPDATE_TYPE_NONE; @@ -369,13 +300,25 @@ static int perform_update(struct nxboot_state *state, bool check_only) bool primary_valid; primary = flash_partition_open(CONFIG_NXBOOT_PRIMARY_SLOT_PATH); - assert(primary >= 0); + if (primary < 0) + { + return ERROR; + } secondary = flash_partition_open(CONFIG_NXBOOT_SECONDARY_SLOT_PATH); - assert(secondary >= 0); + if (secondary < 0) + { + flash_partition_close(primary); + return ERROR; + } tertiary = flash_partition_open(CONFIG_NXBOOT_TERTIARY_SLOT_PATH); - assert(tertiary >= 0); + if (tertiary < 0) + { + flash_partition_close(primary); + flash_partition_close(secondary); + return ERROR; + } if (state->update == NXBOOT_SECONDARY_SLOT_NUM) { @@ -391,10 +334,10 @@ static int perform_update(struct nxboot_state *state, bool check_only) if (state->next_boot == NXBOOT_UPDATE_TYPE_REVERT && (!check_only || !validate_image(primary))) { - if (validate_image(recovery)) + if (state->recovery_valid) { syslog(LOG_INFO, "Reverting image to recovery.\n"); - copy_partition(recovery, primary); + copy_partition(recovery, primary, state, false); } } else @@ -409,8 +352,8 @@ static int perform_update(struct nxboot_state *state, bool check_only) goto perform_update_done; } - if (!state->recovery_valid && state->primary_confirmed && - primary_valid) + if ((!state->recovery_present || !state->recovery_valid) && + state->primary_confirmed && primary_valid) { /* Save current image as recovery only if it is valid and * confirmed. We have to check this in case of restart @@ -425,10 +368,10 @@ static int perform_update(struct nxboot_state *state, bool check_only) */ syslog(LOG_INFO, "Creating recovery image.\n"); - copy_partition(primary, recovery); + copy_partition(primary, recovery, state, false); if (!validate_image(recovery)) { - syslog(LOG_INFO, "New recovery is not valid, stop update\n"); + syslog(LOG_INFO, "New recovery is not valid, stop update.\n"); goto perform_update_done; } @@ -440,13 +383,16 @@ static int perform_update(struct nxboot_state *state, bool check_only) /* Perform update only if update slot contains valid image. */ syslog(LOG_INFO, "Updating from update image.\n"); - copy_partition(update, primary); - - /* Mark update slot as updated. This is to prevent repeated - * updates. - */ + if (copy_partition(update, primary, state, true) >= 0) + { + /* Erase the first sector of update partition. This marks the + * partition as updated so we don't end up in an update loop. + * The sector is written back again during the image + * confirmation. + */ - set_image_flag(update, NXBOOT_UPDATED_PAGE_INDEX); + flash_partition_erase_first_sector(update); + } } } @@ -485,10 +431,12 @@ int nxboot_get_state(struct nxboot_state *state) int tertiary; int update; int recovery; + int recovery_pointer; struct nxboot_img_header primary_header; struct nxboot_img_header secondary_header; struct nxboot_img_header tertiary_header; struct nxboot_img_header *update_header; + struct nxboot_img_header *recovery_header; memset(state, 0, sizeof *state); @@ -517,44 +465,98 @@ int nxboot_get_state(struct nxboot_state *state) get_image_header(secondary, &secondary_header); get_image_header(tertiary, &tertiary_header); + /* Determine which partition is for update and which is a recovery. + * This depends on many factors, but in general a partition with + * NXBOOT_HEADER_MAGIC is an update partition and partition with + * NXBOOT_HEADER_MAGIC_INT is a recovery. + * + * A special case is when both partitions have NXBOOT_HEADER_MAGIC_INT, + * then we look into a recovery pointer in primary header magic and + * determine the recovery from it. + */ + update = secondary; recovery = tertiary; update_header = &secondary_header; + recovery_header = &tertiary_header; state->update = NXBOOT_SECONDARY_SLOT_NUM; state->recovery = NXBOOT_TERTIARY_SLOT_NUM; - if (get_image_flag(secondary, NXBOOT_CONFIRMED_PAGE_INDEX) && - validate_image(secondary)) - { - /* Secondary image is confirmed and valid, use this as - * a potential recovery. - */ + if (tertiary_header.magic == NXBOOT_HEADER_MAGIC) + { update = tertiary; recovery = secondary; + update_header = &tertiary_header; + recovery_header = &secondary_header; state->recovery = NXBOOT_SECONDARY_SLOT_NUM; state->update = NXBOOT_TERTIARY_SLOT_NUM; - update_header = &tertiary_header; - - if (secondary_header.crc == primary_header.crc) + } + else if (IS_INTERNAL_MAGIC(secondary_header.magic) && + IS_INTERNAL_MAGIC(tertiary_header.magic)) + { + if (IS_INTERNAL_MAGIC(primary_header.magic)) + { + recovery_pointer = primary_header.magic & NXBOOT_RECOVERY_PTR_MASK; + if (recovery_pointer == NXBOOT_SECONDARY_SLOT_NUM && + primary_header.crc == secondary_header.crc) + { + update = tertiary; + recovery = secondary; + update_header = &tertiary_header; + recovery_header = &secondary_header; + state->recovery = NXBOOT_SECONDARY_SLOT_NUM; + state->update = NXBOOT_TERTIARY_SLOT_NUM; + } + } + else if (primary_header.crc == secondary_header.crc) { - state->recovery_valid = true; + update = tertiary; + recovery = secondary; + update_header = &tertiary_header; + recovery_header = &secondary_header; + state->recovery = NXBOOT_SECONDARY_SLOT_NUM; + state->update = NXBOOT_TERTIARY_SLOT_NUM; } } - else if (get_image_flag(tertiary, NXBOOT_CONFIRMED_PAGE_INDEX) && - tertiary_header.crc == primary_header.crc && - validate_image(tertiary)) + else if (IS_INTERNAL_MAGIC(secondary_header.magic)) { - state->recovery_valid = true; + update = tertiary; + recovery = secondary; + update_header = &tertiary_header; + recovery_header = &secondary_header; + state->recovery = NXBOOT_SECONDARY_SLOT_NUM; + state->update = NXBOOT_TERTIARY_SLOT_NUM; } - if (get_image_flag(primary, NXBOOT_CONFIRMED_PAGE_INDEX) || - primary_header.magic == NXBOOT_HEADER_MAGIC_INV) + state->recovery_valid = validate_image(recovery); + state->recovery_present = primary_header.crc == recovery_header->crc; + + /* The image is confirmed if it has either NXBOOT_HEADER_MAGIC or a + * recovery exists. + */ + + if (primary_header.magic == NXBOOT_HEADER_MAGIC) { state->primary_confirmed = true; } + else if (IS_INTERNAL_MAGIC(primary_header.magic)) + { + recovery_pointer = primary_header.magic & NXBOOT_RECOVERY_PTR_MASK; + if (recovery_pointer == NXBOOT_SECONDARY_SLOT_NUM) + { + state->primary_confirmed = + primary_header.crc == secondary_header.crc; + } + else if (recovery_pointer == NXBOOT_TERTIARY_SLOT_NUM) + { + state->primary_confirmed = + primary_header.crc == tertiary_header.crc; + } + } - state->next_boot = get_update_type(primary, update, recovery, - &primary_header, update_header); + state->next_boot = get_update_type(state, primary, update, recovery, + &primary_header, update_header, + recovery_header); flash_partition_close(primary); flash_partition_close(secondary); @@ -562,6 +564,33 @@ int nxboot_get_state(struct nxboot_state *state) return OK; } +/**************************************************************************** + * Name: nxboot_open_update_partition + * + * Description: + * Gets the current bootloader state and opens the partition to which an + * update image should be stored. It returns the valid file descriptor to + * this partition, the user is responsible for writing to it and closing + * if afterwards. + * + * Returned Value: + * Valid file descriptor on success, -1 and sets errno on failure. + * + ****************************************************************************/ + +int nxboot_open_update_partition(void) +{ + char *path; + struct nxboot_state state; + + nxboot_get_state(&state); + + path = state.update == NXBOOT_SECONDARY_SLOT_NUM ? + CONFIG_NXBOOT_SECONDARY_SLOT_PATH : CONFIG_NXBOOT_TERTIARY_SLOT_PATH; + + return flash_partition_open(path); +} + /**************************************************************************** * Name: nxboot_get_confirm * @@ -579,7 +608,12 @@ int nxboot_get_state(struct nxboot_state *state) int nxboot_get_confirm(void) { int primary; + int recovery; + int recovery_pointer; + char *path; + int ret = 0; struct nxboot_img_header primary_header; + struct nxboot_img_header recovery_header; primary = flash_partition_open(CONFIG_NXBOOT_PRIMARY_SLOT_PATH); if (primary < 0) @@ -588,13 +622,40 @@ int nxboot_get_confirm(void) } get_image_header(primary, &primary_header); - if (get_image_flag(primary, NXBOOT_CONFIRMED_PAGE_INDEX) || - primary_header.magic == NXBOOT_HEADER_MAGIC_INV) + + if (primary_header.magic == NXBOOT_HEADER_MAGIC) { + close(primary); return 1; } + else if (IS_INTERNAL_MAGIC(primary_header.magic)) + { + recovery_pointer = primary_header.magic & NXBOOT_RECOVERY_PTR_MASK; + if (recovery_pointer != 0) + { + path = recovery_pointer == NXBOOT_SECONDARY_SLOT_NUM ? + CONFIG_NXBOOT_SECONDARY_SLOT_PATH : + CONFIG_NXBOOT_TERTIARY_SLOT_PATH; - return 0; + recovery = flash_partition_open(path); + if (recovery < 0) + { + close(primary); + return ERROR; + } + + get_image_header(recovery, &recovery_header); + if (primary_header.crc == recovery_header.crc) + { + ret = 1; + } + + close(recovery); + } + } + + close(primary); + return ret; } /**************************************************************************** @@ -614,87 +675,81 @@ int nxboot_confirm(void) int ret; int update; int primary; - int secondary; - int tertiary; - int recovery; + int remain; + int readsiz; + char *path; + char *buf; + off_t off; struct nxboot_state state; + struct flash_partition_info info_update; + ret = OK; nxboot_get_state(&state); if (state.primary_confirmed) { return OK; } + path = state.update == NXBOOT_SECONDARY_SLOT_NUM ? + CONFIG_NXBOOT_SECONDARY_SLOT_PATH : CONFIG_NXBOOT_TERTIARY_SLOT_PATH; + primary = flash_partition_open(CONFIG_NXBOOT_PRIMARY_SLOT_PATH); if (primary < 0) { return ERROR; } - secondary = flash_partition_open(CONFIG_NXBOOT_SECONDARY_SLOT_PATH); - if (secondary < 0) - { - flash_partition_close(primary); - return ERROR; - } - - tertiary = flash_partition_open(CONFIG_NXBOOT_TERTIARY_SLOT_PATH); - if (tertiary < 0) + update = flash_partition_open(path); + if (update < 0) { flash_partition_close(primary); - flash_partition_close(secondary); return ERROR; } - if (state.update == NXBOOT_SECONDARY_SLOT_NUM) - { - update = secondary; - recovery = tertiary; - } - else - { - update = tertiary; - recovery = secondary; - } - - /* We need to mark both primary and update partitions as confirmed - * (update partition will become recovery once confirmed) and - * we have to remove confirmed flag from old recovery and set updated - * flag there. This is to prevent old recovery still identify as - * recovery and not to look as possible update. Therefore remove the - * entire last sector (clears confirmed flag) and write updated - * flag. + /* Confirm the image by creating a recovery. The recovery image is + * already present in the update slot, but without the first erase + * page. Therefore, just copy the first erase page to the update slot. */ - ret = OK; - if (set_image_flag(primary, NXBOOT_CONFIRMED_PAGE_INDEX) < 0) + if (flash_partition_info(update, &info_update) < 0) { ret = ERROR; goto confirm_done; } - if (set_image_flag(update, NXBOOT_CONFIRMED_PAGE_INDEX) < 0) - { - ret = ERROR; - goto confirm_done; - } + /* Write by write pages to avoid large array buffering. */ - if (flash_partition_erase_last_sector(recovery) < 0) - { - ret = ERROR; - goto confirm_done; - } + buf = malloc(info_update.blocksize); + remain = info_update.erasesize; + off = 0; - if (set_image_flag(recovery, NXBOOT_UPDATED_PAGE_INDEX) < 0) + while (remain > 0) { - ret = ERROR; - goto confirm_done; + readsiz = remain > info_update.blocksize ? + info_update.blocksize : remain; + if (flash_partition_read(primary, buf, readsiz, off) < 0) + { + free(buf); + ret = ERROR; + goto confirm_done; + } + + if (flash_partition_write(update, buf, readsiz, off) < 0) + { + free(buf); + ret = ERROR; + goto confirm_done; + } + + off += readsiz; + remain -= readsiz; } + free(buf); + confirm_done: flash_partition_close(primary); - flash_partition_close(secondary); - flash_partition_close(tertiary); + flash_partition_close(update); return ret; } @@ -722,7 +777,9 @@ int nxboot_confirm(void) int nxboot_perform_update(bool check_only) { int ret; + int primary; struct nxboot_state state; + struct nxboot_img_header header; ret = nxboot_get_state(&state); if (ret < 0) @@ -737,10 +794,32 @@ int nxboot_perform_update(bool check_only) ret = perform_update(&state, check_only); if (ret < 0) { - syslog(LOG_ERR, "Update process failed. %s\n", - strerror(errno)); + /* Update process failed, raise error and try to boot into + * primary. + */ + + syslog(LOG_ERR, "Update process failed: %s\n", strerror(errno)); } } + /* Check whether there is a valid image in the primary slot. This just + * checks whether the header is valid, but does not calculate the CRC + * of the image as this would prolong the boot process. + */ + + primary = flash_partition_open(CONFIG_NXBOOT_PRIMARY_SLOT_PATH); + if (primary < 0) + { + return ERROR; + } + + get_image_header(primary, &header); + if (!validate_image_header(&header)) + { + ret = ERROR; + } + + flash_partition_close(primary); + return ret; } diff --git a/boot/nxboot/loader/flash.c b/boot/nxboot/loader/flash.c index 4c32a8831be..e7a53b83c16 100644 --- a/boot/nxboot/loader/flash.c +++ b/boot/nxboot/loader/flash.c @@ -240,10 +240,10 @@ int flash_partition_erase(int fd) } /**************************************************************************** - * Name: flash_partition_erase_last_sector + * Name: flash_partition_erase_first_sector * * Description: - * Erases the last sector of the partition + * Erases the first sector of the partition * * Input parameters: * fd: Valid file descriptor. @@ -253,18 +253,12 @@ int flash_partition_erase(int fd) * ****************************************************************************/ -int flash_partition_erase_last_sector(int fd) +int flash_partition_erase_first_sector(int fd) { int ret; struct mtd_erase_s erase; - struct flash_partition_info info; - if (flash_partition_info(fd, &info) < 0) - { - return ERROR; - } - - erase.startblock = info.neraseblocks - 1; + erase.startblock = 0; erase.nblocks = 1; ret = ioctl(fd, MTDIOC_ERASESECTORS, &erase); @@ -308,6 +302,7 @@ int flash_partition_info(int fd, struct flash_partition_info *info) info->blocksize = geometry.blocksize; info->size = geometry.erasesize * geometry.neraseblocks; info->neraseblocks = geometry.neraseblocks; + info->erasesize = geometry.erasesize; return OK; } diff --git a/boot/nxboot/loader/flash.h b/boot/nxboot/loader/flash.h index 653c4c8b974..ef1dee09d06 100644 --- a/boot/nxboot/loader/flash.h +++ b/boot/nxboot/loader/flash.h @@ -39,6 +39,7 @@ struct flash_partition_info int size; int blocksize; int neraseblocks; + int erasesize; }; /**************************************************************************** @@ -135,10 +136,10 @@ int flash_partition_read(int fd, void *buf, size_t count, off_t off); int flash_partition_erase(int fd); /**************************************************************************** - * Name: flash_partition_erase_last_sector + * Name: flash_partition_erase_first_sector * * Description: - * Erases the last sector of the partition + * Erases the first sector of the partition * * Input parameters: * fd: Valid file descriptor. @@ -148,7 +149,7 @@ int flash_partition_erase(int fd); * ****************************************************************************/ -int flash_partition_erase_last_sector(int fd); +int flash_partition_erase_first_sector(int fd); /**************************************************************************** * Name: flash_partition_info diff --git a/boot/nxboot/tools/nximage.py b/boot/nxboot/tools/nximage.py index 1a9d68a1f16..e086c67e58d 100644 --- a/boot/nxboot/tools/nximage.py +++ b/boot/nxboot/tools/nximage.py @@ -33,58 +33,65 @@ class NxImage: def __init__( - self, path: str, result: str, version: str, header_size: int, primary: bool + self, + path: str, + result: str, + version: str, + header_size: int, + identifier: int, ) -> None: self.path = path self.result = result self.size = os.stat(path).st_size self.version = semantic_version.Version(version) self.header_size = header_size - self.primary = primary + self.identifier = identifier self.crc = 0 + self.extd_hdr_ptr = 0 - with open(path, "rb") as f: - while data := f.read(io.DEFAULT_BUFFER_SIZE): - self.crc = zlib.crc32(data, self.crc) - - def __repr__(self): + def __repr__(self) -> str: repr = ( "" ) return repr - def add_header(self): + def add_header(self) -> None: with open(self.path, "r+b") as src, open(self.result, "w+b") as dest: - if self.primary: - dest.write(b"\xb1\xab\xa0\xac") - else: - dest.write(b"\x4e\x58\x4f\x53") + dest.write(b"\x4e\x58\x4f\x53") + dest.write(struct.pack(" argparse.Namespace: """Parse passed arguments and return result.""" @@ -101,9 +108,10 @@ def parse_args() -> argparse.Namespace: help="Size of the image header.", ) parser.add_argument( - "--primary", - action="store_true", - help="Primary image intended to be uploaded directly to primary memory.", + "--identifier", + type=lambda x: int(x, 0), + default=0x0, + help="Platform identifier. An image is rejected if its identifier doesn't match the one set in bootloader.", ) parser.add_argument( "-v", @@ -126,7 +134,11 @@ def parse_args() -> argparse.Namespace: def main() -> None: args = parse_args() image = NxImage( - args.PATH, args.RESULT, args.version, args.header_size, args.primary + args.PATH, + args.RESULT, + args.version, + args.header_size, + args.identifier, ) image.add_header() if args.v: From 60e4052f816703461a82968fdca45cfa323541de Mon Sep 17 00:00:00 2001 From: Eren Terzioglu Date: Sat, 1 Mar 2025 17:14:52 +0100 Subject: [PATCH 214/391] games/snake: Add snake game Add snake game support to have more demo games to show Signed-off-by: Eren Terzioglu --- games/snake/Kconfig | 90 +++++ games/snake/Make.defs | 25 ++ games/snake/Makefile | 36 ++ games/snake/snake_input_console.h | 203 ++++++++++ games/snake/snake_input_gpio.h | 201 ++++++++++ games/snake/snake_inputs.h | 64 +++ games/snake/snake_main.c | 628 ++++++++++++++++++++++++++++++ 7 files changed, 1247 insertions(+) create mode 100644 games/snake/Kconfig create mode 100644 games/snake/Make.defs create mode 100644 games/snake/Makefile create mode 100644 games/snake/snake_input_console.h create mode 100644 games/snake/snake_input_gpio.h create mode 100644 games/snake/snake_inputs.h create mode 100644 games/snake/snake_main.c diff --git a/games/snake/Kconfig b/games/snake/Kconfig new file mode 100644 index 00000000000..35be6003512 --- /dev/null +++ b/games/snake/Kconfig @@ -0,0 +1,90 @@ +# +# For a description of the syntax of this configuration file, +# see the file kconfig-language.txt in the NuttX tools repository. +# + +config GAMES_SNAKE + bool "Snake Game" + default n + ---help--- + Enable Snake game. + +if GAMES_SNAKE + +config GAMES_SNAKE_PROGNAME + string "Program name" + default "snake" + ---help--- + This is the name of the program that will be used when the NSH ELF + program is installed. + +config GAMES_SNAKE_PRIORITY + int "Snake Game task priority" + default 100 + +config GAMES_SNAKE_STACKSIZE + int "Snake Game stack size" + default DEFAULT_TASK_STACKSIZE + +config DEBUG_SNAKE_GAME + bool "Print board status to the serial console for debugging" + default n + +config GAMES_SNAKE_LED_MATRIX_PATH + string "LED matrix path" + default "/dev/leds0" + ---help--- + Path of the led matrix + +config GAMES_SNAKE_LED_MATRIX_ROWS + int "LED Matrix row count" + default 8 + +config GAMES_SNAKE_LED_MATRIX_COLS + int "LED Matrix column count" + default 8 + +# +# Input Device Selection +# + +choice INPUT_METHOD + prompt "Input Device (Serial Console, GPIO, etc)" + default GAMES_SNAKE_USE_CONSOLEKEY + +config GAMES_SNAKE_USE_CONSOLEKEY + bool "Serial Console as Input" + +config GAMES_SNAKE_USE_GPIO + bool "GPIO pins as Input" +endchoice + +if GAMES_SNAKE_USE_GPIO + +config GAMES_SNAKE_UP_KEY_PATH + string "Up key path" + default "/dev/gpio0" + ---help--- + Path of the up key to read + +config GAMES_SNAKE_DOWN_KEY_PATH + string "Down key path" + default "/dev/gpio1" + ---help--- + Path of the down key to read + +config GAMES_SNAKE_LEFT_KEY_PATH + string "Left key path" + default "/dev/gpio2" + ---help--- + Path of the left key to read + +config GAMES_SNAKE_RIGHT_KEY_PATH + string "Right key path" + default "/dev/gpio3" + ---help--- + Path of the right key to read + +endif #GAMES_SNAKE_USE_GPIO + +endif diff --git a/games/snake/Make.defs b/games/snake/Make.defs new file mode 100644 index 00000000000..8656d46ca44 --- /dev/null +++ b/games/snake/Make.defs @@ -0,0 +1,25 @@ +############################################################################ +# apps/games/snake/Make.defs +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +ifneq ($(CONFIG_GAMES_SNAKE),) +CONFIGURED_APPS += $(APPDIR)/games/snake +endif diff --git a/games/snake/Makefile b/games/snake/Makefile new file mode 100644 index 00000000000..fcdfd15d3a3 --- /dev/null +++ b/games/snake/Makefile @@ -0,0 +1,36 @@ +############################################################################ +# apps/games/snake/Makefile +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +include $(APPDIR)/Make.defs + +# Snake game info + +PROGNAME = $(CONFIG_GAMES_SNAKE_PROGNAME) +PRIORITY = $(CONFIG_GAMES_SNAKE_PRIORITY) +STACKSIZE = $(CONFIG_GAMES_SNAKE_STACKSIZE) +MODULE = $(CONFIG_GAMES_SNAKE) + +# Snake game application + +MAINSRC = snake_main.c + +include $(APPDIR)/Application.mk diff --git a/games/snake/snake_input_console.h b/games/snake/snake_input_console.h new file mode 100644 index 00000000000..468989d2a3c --- /dev/null +++ b/games/snake/snake_input_console.h @@ -0,0 +1,203 @@ +/**************************************************************************** + * apps/games/snake/snake_input_console.h + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include + +#include "snake_inputs.h" + +/**************************************************************************** + * Preprocessor Definitions + ****************************************************************************/ + +/* Termios functions to have getch on Linux/NuttX */ + +static struct termios g_old; +static struct termios g_new; + +/**************************************************************************** + * Name: init_termios + * + * Description: + * Initialize g_new terminal I/O settings. + * + * Parameters: + * echo - Enable echo flag + * + * Returned Value: + * None. + * + ****************************************************************************/ + +void init_termios(int echo) +{ + tcgetattr(0, &g_old); /* grab old terminal i/o settings */ + g_new = g_old; /* use old settings as starting */ + g_new.c_lflag &= ~ICANON; /* disable buffered I/O */ + g_new.c_lflag &= ~ECHO; /* disable ECHO bit */ + g_new.c_lflag |= echo ? ECHO : 0; /* set echo mode if requested */ + tcsetattr(0, TCSANOW, &g_new); /* apply terminal I/O settings */ + fcntl(STDIN_FILENO, F_SETFL, O_NONBLOCK); /* set non-blocking mode */ +} + +/**************************************************************************** + * Name: reset_termios + * + * Description: + * Restore g_old terminal i/o settings. + * + * Parameters: + * None + * + * Returned Value: + * None. + * + ****************************************************************************/ + +void reset_termios(void) +{ + tcsetattr(0, TCSANOW, &g_old); +} + +/**************************************************************************** + * Name: getch_ + * + * Description: + * Read 1 character. + * + * Parameters: + * echo - Enable echo mode flag + * + * Returned Value: + * Read character. + * + ****************************************************************************/ + +char getch_(int echo) +{ + char ch; + + init_termios(echo); + ch = getchar(); + reset_termios(); + + return ch; +} + +/**************************************************************************** + * Name: getch + * + * Description: + * Read 1 character without echo. + * + * Parameters: + * None + * + * Returned Value: + * Read character. + * + ****************************************************************************/ + +char getch(void) +{ + return getch_(0); +} + +/**************************************************************************** + * Name: dev_input_init + * + * Description: + * Initialize input method. + * + * Parameters: + * dev - Input state data + * + * Returned Value: + * Zero (OK) + * + ****************************************************************************/ + +int dev_input_init(FAR struct input_state_s *dev) +{ + init_termios(0); + + return OK; +} + +/**************************************************************************** + * Name: dev_read_input + * + * Description: + * Read inputs and returns result in input state data. + * + * Parameters: + * dev - Input state data + * + * Returned Value: + * Zero (OK) + * + ****************************************************************************/ + +int dev_read_input(FAR struct input_state_s *dev) +{ + char ch; + + /* Arrows keys return three bytes: 27 91 [65-68] */ + + if ((ch = getch()) == 27) + { + if ((ch = getch()) == 91) + { + ch = getch(); + if (ch == 65) + { + dev->dir = DIR_UP; + } + else if (ch == 66) + { + dev->dir = DIR_DOWN; + } + else if (ch == 67) + { + dev->dir = DIR_RIGHT; + } + else if (ch == 68) + { + dev->dir = DIR_LEFT; + } + } + else + { + dev->dir = DIR_NONE; + } + } + else + { + dev->dir = DIR_NONE; + } + + return OK; +} diff --git a/games/snake/snake_input_gpio.h b/games/snake/snake_input_gpio.h new file mode 100644 index 00000000000..cb2e7329cda --- /dev/null +++ b/games/snake/snake_input_gpio.h @@ -0,0 +1,201 @@ +/**************************************************************************** + * apps/games/snake/snake_input_gpio.h + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "snake_inputs.h" + +/**************************************************************************** + * Preprocessor Definitions + ****************************************************************************/ + +struct gpio_struct_fd_s +{ + int fd_up; /* File descriptor value to read up arrow key */ + int fd_down; /* File descriptor value to read down arrow key */ + int fd_left; /* File descriptor value to read left arrow key */ + int fd_right; /* File descriptor value to read right arrow key */ +}; + +struct gpio_struct_fd_s fd_list; + +/**************************************************************************** + * Name: dev_input_init + * + * Description: + * Initialize input method. + * + * Parameters: + * dev - Input state data + * + * Returned Value: + * Zero (OK) is returned on success. A negated errno value is returned on + * failure. + * + ****************************************************************************/ + +int dev_input_init(FAR struct input_state_s *dev) +{ + /* Open the up key gpio device */ + + fd_list.fd_up = open(CONFIG_GAMES_SNAKE_UP_KEY_PATH, O_RDONLY); + if (fd_list.fd_up < 0) + { + fprintf(stderr, "ERROR: Failed to open %s: %d\n", + CONFIG_GAMES_SNAKE_UP_KEY_PATH, errno); + return -ENODEV; + } + + /* Open the down key gpio device */ + + fd_list.fd_down = open(CONFIG_GAMES_SNAKE_DOWN_KEY_PATH, O_RDONLY); + if (fd_list.fd_down < 0) + { + fprintf(stderr, "ERROR: Failed to open %s: %d\n", + CONFIG_GAMES_SNAKE_DOWN_KEY_PATH, errno); + return -ENODEV; + } + + /* Open the left key gpio device */ + + fd_list.fd_left = open(CONFIG_GAMES_SNAKE_LEFT_KEY_PATH, O_RDONLY); + if (fd_list.fd_down < 0) + { + fprintf(stderr, "ERROR: Failed to open %s: %d\n", + CONFIG_GAMES_SNAKE_LEFT_KEY_PATH, errno); + return -ENODEV; + } + + /* Open the right key gpio device */ + + fd_list.fd_right = open(CONFIG_GAMES_SNAKE_RIGHT_KEY_PATH, O_RDONLY); + if (fd_list.fd_down < 0) + { + fprintf(stderr, "ERROR: Failed to open %s: %d\n", + CONFIG_GAMES_SNAKE_RIGHT_KEY_PATH, errno); + return -ENODEV; + } + + dev->fd_gpio = (int)&fd_list; + + return OK; +} + +/**************************************************************************** + * Name: dev_read_input + * + * Description: + * Read inputs and returns result in input state data. + * + * Parameters: + * dev - Input state data + * + * Returned Value: + * Zero (OK) + * + ****************************************************************************/ + +int dev_read_input(FAR struct input_state_s *dev) +{ + struct gpio_struct_fd_s *fd = (struct gpio_struct_fd_s *)dev->fd_gpio; + int invalue = 0; + int ret; + + ret = ioctl(fd->fd_up, GPIOC_READ, (unsigned long)((uintptr_t)&invalue)); + if (ret < 0) + { + int errcode = errno; + fprintf(stderr, "ERROR: Failed to read value from %s: %d\n", + CONFIG_GAMES_SNAKE_UP_KEY_PATH, errcode); + } + else + { + if (invalue != 0) + { + dev->dir = DIR_UP; + } + } + + ret = ioctl(fd->fd_down, GPIOC_READ, (unsigned long)((uintptr_t)&invalue)); + if (ret < 0) + { + int errcode = errno; + fprintf(stderr, "ERROR: Failed to read value from %s: %d\n", + CONFIG_GAMES_SNAKE_DOWN_KEY_PATH, errcode); + } + else + { + if (invalue != 0) + { + dev->dir = DIR_DOWN; + } + } + + ret = ioctl(fd->fd_left, GPIOC_READ, (unsigned long)((uintptr_t)&invalue)); + if (ret < 0) + { + int errcode = errno; + fprintf(stderr, "ERROR: Failed to read value from %s: %d\n", + CONFIG_GAMES_SNAKE_LEFT_KEY_PATH, errcode); + } + else + { + if (invalue != 0) + { + dev->dir = DIR_LEFT; + } + } + + ret = ioctl(fd->fd_right, GPIOC_READ, + (unsigned long)((uintptr_t)&invalue)); + if (ret < 0) + { + int errcode = errno; + fprintf(stderr, "ERROR: Failed to read value from %s: %d\n", + CONFIG_GAMES_SNAKE_RIGHT_KEY_PATH, errcode); + } + else + { + if (invalue != 0) + { + dev->dir = DIR_RIGHT; + } + } + + return OK; +} diff --git a/games/snake/snake_inputs.h b/games/snake/snake_inputs.h new file mode 100644 index 00000000000..6303494599c --- /dev/null +++ b/games/snake/snake_inputs.h @@ -0,0 +1,64 @@ +/**************************************************************************** + * apps/games/snake/snake_inputs.h + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Preprocessor Definitions + ****************************************************************************/ + +#ifndef DIR_NONE +# define DIR_NONE 0 +#endif + +#ifndef DIR_LEFT +# define DIR_LEFT 1 +#endif + +#ifndef DIR_RIGHT +# define DIR_RIGHT 2 +#endif + +#ifndef DIR_UP +# define DIR_UP 3 +#endif + +#ifndef DIR_DOWN +# define DIR_DOWN 4 +#endif + +struct input_state_s +{ +#ifdef CONFIG_GAMES_SNAKE_USE_CONSOLEKEY + int fd_con; +#endif +#ifdef CONFIG_GAMES_SNAKE_USE_GPIO + int fd_gpio; +#endif + + int dir; /* Direction to move the blocks */ +}; + diff --git a/games/snake/snake_main.c b/games/snake/snake_main.c new file mode 100644 index 00000000000..8b65d80bdeb --- /dev/null +++ b/games/snake/snake_main.c @@ -0,0 +1,628 @@ +/**************************************************************************** + * apps/games/snake/snake_main.c + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#ifdef CONFIG_GAMES_SNAKE_USE_CONSOLEKEY +#include "snake_input_console.h" +#endif + +#ifdef CONFIG_GAMES_SNAKE_USE_GPIO +#include "snake_input_gpio.h" +#endif + +/**************************************************************************** + * Preprocessor Definitions + ****************************************************************************/ + +#ifdef CONFIG_DEBUG_SNAKE_GAME +# define DEBUG_SNAKE_GAME 1 +#endif + +#define BOARDX_SIZE CONFIG_GAMES_SNAKE_LED_MATRIX_ROWS +#define BOARDY_SIZE CONFIG_GAMES_SNAKE_LED_MATRIX_COLS + +#define N_LEDS BOARDX_SIZE * BOARDY_SIZE + +/* ID numbers of game items */ + +#define BLANK_PLACE 0 +#define SNAKE_TAIL 1 +#define SNAKE_HEAD 2 +#define FOOD 3 +#define BLINK 4 + +/**************************************************************************** + * Private Types + ****************************************************************************/ + +/* Game item struct to repesent in board */ + +struct game_item +{ + int pos_x; + int pos_y; +}; + +/* Snake item struct to repesent in board */ + +struct snake_item +{ + struct game_item tail[BOARDX_SIZE * BOARDY_SIZE]; + int tail_len; +}; + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +static const char g_board_path[] = + CONFIG_GAMES_SNAKE_LED_MATRIX_PATH; + +struct snake_item snake = +{ + 0 +}; + +struct game_item food = +{ + 0 +}; + +/* Game board to show */ + +uint32_t board[BOARDX_SIZE][BOARDY_SIZE] = +{ + 0 +}; + +/* Colors used in the game plus Black */ + +static const uint32_t pallete[] = +{ + RGB24_BLACK, + RGB24_BLUE, + RGB24_CYAN, + RGB24_RED, + RGB24_WHITE, +}; + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: dim_color + * + * Description: + * Dim led color to handle brightness. + * + * Parameters: + * val - RGB24 value of the led + * dim - Percentage of brightness + * + * Returned Value: + * Dimmed RGB24 value. + * + ****************************************************************************/ + +static uint32_t dim_color(uint32_t val, float dim) +{ + uint16_t r = RGB24RED(val); + uint16_t g = RGB24GREEN(val); + uint16_t b = RGB24BLUE(val); + + float sat = dim; + + r *= sat; + g *= sat; + b *= sat; + + return RGBTO24(r, g, b); +} + +/**************************************************************************** + * Name: draw_board + * + * Description: + * Draw the user board. + * + * Parameters: + * fd - File descriptor for screen + * + * Returned Value: + * None. + * + ****************************************************************************/ + +static void draw_board(int fd) +{ + uint32_t buffer[N_LEDS] = + { + 0 + }; + + int result; + uint32_t *bp = buffer; + int x; + int y; + int rgb_val; + int tmp; + + for (x = 0; x < BOARDX_SIZE; x++) + { + for (y = 0; y < BOARDY_SIZE; y++) + { + rgb_val = pallete[board[x][y]]; + tmp = dim_color(rgb_val, 0.15); + *bp++ = ws2812_gamma_correct(tmp); + } + } + + lseek(fd, 0, SEEK_SET); + + result = write(fd, buffer, 4 * N_LEDS); + if (result != 4 * N_LEDS) + { + fprintf(stderr, + "ws2812_main: write failed: %d %d\n", + result, + errno); + } +} + +/**************************************************************************** + * Name: print_board + * + * Description: + * Draw the board for debugging. + * + * Parameters: + * None + * + * Returned Value: + * None. + * + ****************************************************************************/ + +#ifdef DEBUG_SNAKE_GAME +static void print_board(void) +{ + const char board_icons[] = + { + ' ', + 'o', + 'O', + 'X' + }; + + int row; + int col; + int tmp; + int tmp_idx; + + /* Clear screen */ + + printf("\e[1;1H\e[2J"); + + /* Print board */ + + for (row = 0; row < BOARDY_SIZE; row++) + { + for (tmp = 0; tmp < BOARDX_SIZE; tmp++) + { + printf("+--"); + } + + printf("-+\n"); + printf("|"); + for (col = 0; col < BOARDX_SIZE; col++) + { + tmp_idx = board[row][col]; + printf(" %c ", board_icons[tmp_idx]); + } + + printf("|\n"); + } + + for (tmp = 0; tmp < BOARDX_SIZE; tmp++) + { + printf("+--"); + } + + printf("-+\n\n\n"); +} +#endif + +/**************************************************************************** + * Name: move_snake + * + * Description: + * Move the snake to 'dir' direction (L,R,U,D). + * + * Parameters: + * dir - Direction to move + * + * Returned Value: + * None. + * + ****************************************************************************/ + +static void move_snake(int dir) +{ + int prev_x = snake.tail[0].pos_x; + int prev_y = snake.tail[0].pos_y; + int prev_2x; + int prev_2y; + int i; + + board[prev_x][prev_y] = SNAKE_TAIL; + for (i = 1; i < snake.tail_len; i++) + { + prev_2x = snake.tail[i].pos_x; + prev_2y = snake.tail[i].pos_y; + snake.tail[i].pos_x = prev_x; + snake.tail[i].pos_y = prev_y; + prev_x = prev_2x; + prev_y = prev_2y; + } + + board[prev_x][prev_y] = 0; + + if (dir == DIR_LEFT) + { + snake.tail[0].pos_y--; + } + + if (dir == DIR_RIGHT) + { + snake.tail[0].pos_y++; + } + + if (dir == DIR_UP) + { + snake.tail[0].pos_x--; + } + + if (dir == DIR_DOWN) + { + snake.tail[0].pos_x++; + } + + /* Wrap around screen borders */ + + if (snake.tail[0].pos_x >= BOARDX_SIZE) + { + snake.tail[0].pos_x = 0; + } + + if (snake.tail[0].pos_x < 0) + { + snake.tail[0].pos_x = BOARDX_SIZE - 1; + } + + if (snake.tail[0].pos_y >= BOARDY_SIZE) + { + snake.tail[0].pos_y = 0; + } + + if (snake.tail[0].pos_y < 0) + { + snake.tail[0].pos_y = BOARDY_SIZE - 1; + } + + board[snake.tail[0].pos_x][snake.tail[0].pos_y] = SNAKE_HEAD; +} + +/**************************************************************************** + * Name: clear_board + * + * Description: + * Clears the board + * + * Parameters: + * None + * + * Returned Value: + * None. + * + ****************************************************************************/ + +static void clear_board(void) +{ + int i; + int j; + + for (i = 0; i < BOARDX_SIZE; i++) + { + for (j = 0; j < BOARDY_SIZE; j++) + { + board[i][j] = 0; + } + } +} + +/**************************************************************************** + * Name: init_game + * + * Description: + * Initializes game to start properly + * + * Parameters: + * None + * + * Returned Value: + * None. + * + ****************************************************************************/ + +static void init_game(void) +{ + snake.tail_len = 1; + snake.tail[0].pos_x = BOARDX_SIZE / 2; + snake.tail[0].pos_y = BOARDY_SIZE / 2; + food.pos_x = rand() % BOARDX_SIZE; + food.pos_y = rand() % BOARDY_SIZE; + clear_board(); + + board[BOARDX_SIZE / 2][BOARDY_SIZE / 2] = SNAKE_HEAD; +} + +/**************************************************************************** + * Name: check_food_snake_collision + * + * Description: + * Check if there is any collision between food or snake + * + * Parameters: + * None + * + * Returned Value: + * True(1) if there is collision, False(0) if not. + * + ****************************************************************************/ + +static bool check_food_snake_collision(void) +{ + int i = 0; + + for (i = 0; i < snake.tail_len; i++) + { + if (snake.tail[i].pos_x == food.pos_x && + snake.tail[i].pos_y == food.pos_y) + { + return true; + } + } + + return false; +} + +/**************************************************************************** + * Name: check_collisions + * + * Description: + * Check if there is any collision between food or snake itself + * + * Parameters: + * None + * + * Returned Value: + * True(1) if there is collision itself, False(0) if not. + * + ****************************************************************************/ + +static int check_collisions(void) +{ + int i = 0; + bool end_game = false; + bool food_col = false; + + /* Collision with itself (game over) */ + + for (i = 1; i < snake.tail_len; i++) + { + if (snake.tail[i].pos_x == snake.tail[0].pos_x && + snake.tail[i].pos_y == snake.tail[0].pos_y) + { + end_game = true; + } + } + + /* Collision with food (eating food) */ + + food_col = check_food_snake_collision(); + if (food_col) + { + snake.tail_len++; + + while (food_col) + { + food.pos_x = rand() % BOARDX_SIZE; + food.pos_y = rand() % BOARDY_SIZE; + food_col = check_food_snake_collision(); + } + } + + board[food.pos_x][food.pos_y] = FOOD; + return end_game; +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * snake_main + ****************************************************************************/ + +int main(int argc, FAR char *argv[]) +{ + bool game_over; + struct input_state_s input_st; + int board_fd = -1; + int last_dir = DIR_NONE; + int ret = ERROR; + int i; + int idx; + int board_x; + int board_y; + struct snake_item prev_snake = + { + 0 + }; + + srand(time(NULL)); + + /* Open the output device driver */ + + board_fd = open(g_board_path, O_RDWR); + if (board_fd < 0) + { + int errcode = errno; + fprintf(stderr, "ERROR: Failed to open %s: %d\n", + g_board_path, errcode); + return EXIT_FAILURE; + } + + dev_input_init(&input_st); + + /* Draw the empty board to user */ + +restart: + init_game(); + draw_board(board_fd); + + input_st.dir = DIR_NONE; + game_over = false; + + while (!game_over) + { +#ifdef DEBUG_SNAKE_GAME + print_board(); +#endif + draw_board(board_fd); + + last_dir = input_st.dir; + ret = ERROR; + + while (ret == ERROR) + { + ret = dev_read_input(&input_st); + } + + /* Check if input creates collision */ + + if ((last_dir == DIR_LEFT && input_st.dir == DIR_RIGHT) || + (last_dir == DIR_RIGHT && input_st.dir == DIR_LEFT) || + (last_dir == DIR_UP && input_st.dir == DIR_DOWN) || + (last_dir == DIR_DOWN && input_st.dir == DIR_UP)) + { + input_st.dir = last_dir; + } + + if (input_st.dir == DIR_NONE) + { + input_st.dir = last_dir; + } + + memcpy(&prev_snake, &snake, sizeof(struct snake_item)); + + move_snake(input_st.dir); + + game_over = check_collisions(); + + if (game_over) + { + /* Lets do a blinking effect */ + + for (i = 0; i < 3; i++) + { + /* Draw the board with the pieces */ + + for (idx = 0; idx < prev_snake.tail_len; idx++) + { + board_x = prev_snake.tail[idx].pos_x; + board_y = prev_snake.tail[idx].pos_y; + board[board_x][board_y] = BLINK; + } + + draw_board(board_fd); + usleep(100000); + + /* Draw the board without the pieces */ + + board[prev_snake.tail[0].pos_x][prev_snake.tail[0].pos_y] = + SNAKE_HEAD; + for (idx = 1; idx < snake.tail_len; idx++) + { + board_x = prev_snake.tail[idx].pos_x; + board_y = prev_snake.tail[idx].pos_y; + board[board_x][board_y] = SNAKE_TAIL; + } + + draw_board(board_fd); + usleep(100000); + } + + usleep(500000); + } + + usleep(85000); + } + + printf("Game Over! Score: %d", (snake.tail_len * 10)); + + printf("Please press left key to exit or other keys to restart\n"); + usleep(1000000); + + input_st.dir = DIR_NONE; + ret = ERROR; + while (ret == ERROR && input_st.dir == DIR_NONE) + { + ret = dev_read_input(&input_st); + } + + if (input_st.dir != DIR_LEFT) + { + goto restart; + } + + return 0; +} From 3e37dd25175d8b30adedfbe4c21b9729b750dbb6 Mon Sep 17 00:00:00 2001 From: Tim Hardisty <56726697+TimJTi@users.noreply.github.com> Date: Sun, 23 Feb 2025 17:44:35 +0000 Subject: [PATCH 215/391] Add Framebuffer Console Example App --- examples/fbcon/CMakeLists.txt | 34 + examples/fbcon/Kconfig | 205 +++ examples/fbcon/Make.defs | 25 + examples/fbcon/Makefile | 36 + examples/fbcon/fbcon_main.c | 2655 +++++++++++++++++++++++++++++++++ 5 files changed, 2955 insertions(+) create mode 100644 examples/fbcon/CMakeLists.txt create mode 100644 examples/fbcon/Kconfig create mode 100644 examples/fbcon/Make.defs create mode 100644 examples/fbcon/Makefile create mode 100644 examples/fbcon/fbcon_main.c diff --git a/examples/fbcon/CMakeLists.txt b/examples/fbcon/CMakeLists.txt new file mode 100644 index 00000000000..0af45b1b9a6 --- /dev/null +++ b/examples/fbcon/CMakeLists.txt @@ -0,0 +1,34 @@ +# ############################################################################## +# apps/examples/fbcon/CMakeLists.txt +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_EXAMPLES_FBCON) + nuttx_add_application( + NAME + fbcon + STACKSIZE + ${CONFIG_EXAMPLES_FBCON_STACKSIZE} + MODULE + ${CONFIG_EXAMPLES_FBCON} + SRCS + fbcon_main.c) + target_sources(apps PRIVATE fbcon_main.c) +endif() diff --git a/examples/fbcon/Kconfig b/examples/fbcon/Kconfig new file mode 100644 index 00000000000..eedf2213df4 --- /dev/null +++ b/examples/fbcon/Kconfig @@ -0,0 +1,205 @@ +# +# For a description of the syntax of this configuration file, +# see the file kconfig-language.txt in the NuttX tools repository. +# + +config EXAMPLES_FBCON + tristate "Framebuffer console example" + default n + ---help--- + Enable the Framebuffer console example. + This example allows STDOUT and/or STDERR to be redirected and displayed + on a framebuffer character device. + + A chosen builtin app can be spawned - such as "nsh" - to create a + console and, if required, STDIN can be intercepted to allow input + characters to be interpreted and pre-processed before passing them + on to the spawned app. + + Relies on and uses NX and NXFONTS + +if EXAMPLES_FBCON + +comment "Console STDIN and/or STDOUT setup" + +config EXAMPLES_FBCON_PIPE_STDOUT + bool "Pipe stdout to this console" + default y + +config EXAMPLES_FBCON_PIPE_STDERR + bool "Pipe stderr to this console" + default y + +config EXAMPLES_FBCON_PIPE_STDIN + bool "Pipe stdin via this console" + default y + ---help--- + This is usually needed if the spawned App is "nsh" as we need to + intercept input characters in some cases + +comment "Console Framebuffer setup" + +config EXAMPLES_FBCON_DEF_FB + string "Default framebuffer driver" + default "/dev/fb0" + ---help--- + Default framebuffer drivers. This selection can be overridden from + the command line. + +comment "BPP setup" + +choice EXAMPLES_FBCON_BPP_SELECTION + prompt "BPP Configuration" + default EXAMPLES_FBCON_BPP_NX_DEFAULT + +config EXAMPLES_FBCON_BPP_NX_DEFAULT + bool "Use smallest BPP as enabled via NXFONTS setup" + +config EXAMPLES_FBCON_CUSTOM_BPP + bool "Choose custom BPP (must not be disabled in NX)" + +choice EXAMPLES_FBCON_CUSTOM_BPP + prompt "Custom Font pixel depth (BPP - Bits Per Pixel)" + depends on EXAMPLES_FBCON_CUSTOM_BPP + ---help--- + Note: The required BPP must not be disabled via the NXFONT setup + +config EXAMPLES_FBCON_1BPP + bool "1 BPP" + depends on !NX_DISABLE_1BPP + +config EXAMPLES_FBCON_2BPP + bool "2 BPP" + depends on !NX_DISABLE_2BPP + +config EXAMPLES_FBCON_4BPP + bool "4 BPP" + depends on !NX_DISABLE_4BPP + +config EXAMPLES_FBCON_8BPP + bool "8 BPP" + depends on !NX_DISABLE_8BPP + +config EXAMPLES_FBCON_16BPP + bool "16 BPP" + depends on !NX_DISABLE_16BPP + +config EXAMPLES_FBCON_24BPP + bool "24 BPP" + depends on !NX_DISABLE_24BPP + +config EXAMPLES_FBCON_32BPP + bool "32 BPP" + depends on !NX_DISABLE_32BPP + +endchoice # EXAMPLES_FBCON_CUSTOM_BPP +endchoice # EXAMPLES_FBCON_BPP_SELECTION + +comment "Console appearance" + +config EXAMPLES_FBCON_SHOW_WELCOME + bool "Display welcome messages on stdout and/or stdin" + default y + +config EXAMPLES_FBCON_DEFAULT_COLORS + bool "Use Default Colors (white characters on black background)" + default y + +if !EXAMPLES_FBCON_DEFAULT_COLORS + +config EXAMPLES_FBCON_BGCOLOR + hex "Background color" + default 0x0 + ---help--- + The color of the background. Default depends on config + EXAMPLES_FBCON_BPP. + +config EXAMPLES_FBCON_FCOLOR + hex "Console font color" + default 0x0 + ---help--- + The color of the fonts used by the console. +endif # !EXAMPLES_FBCON_DEFAULT_COLORS + +config EXAMPLES_FBCON_LINESPACING + int "Line spacing" + default 0 + range 0 4 + ---help--- + The vertical distance between lines is the sum of (1) the vertical + bounding box dimension of the font, and (2) this additional line + space. This value may be zero, but not negative. + +config EXAMPLES_FBCON_NOWRAP + bool "No wrap" + default n + ---help--- + By default, lines will wrap when the test reaches the right hand side + of the window. This setting can be defining to change this behavior so + that the text is simply truncated until a new line is encountered. + +choice EXAMPLES_FBCON_FONT + prompt "Font Configuration" + default EXAMPLES_FBCON_DEFAULT_FONT + +config EXAMPLES_FBCON_DEFAULT_FONT + bool "Use Default Font" + +config EXAMPLES_FBCON_CUSTOM_FONTID + bool "Use Custom Font ID" + +config EXAMPLES_FBCON_FONTID + int "Custom font ID" + depends on EXAMPLES_FBCON_CUSTOM_FONTID + default 0 + ---help--- + Selects the font used by the console (see font ID numbers + in include/nuttx/nx/nxfonts.h) + +endchoice # EXAMPLES_FBCON_FONT + +config EXAMPLES_FBCON_CURSORCHAR + int "Character code to use as the cursor" + default 95 + ---help--- + The bitmap code to use as the cursor. Default '_' (95) + +comment "FB Console App Escape code decoding" + +config EXAMPLES_FBCON_VT100_DECODE + bool "Decode VT100 Escape Codes" + default y + ---help-- + Decode VT100 ESC codes - only minimal supporting functions + +comment "FB Console spawn task configuration" + +config EXAMPLES_FBCON_SPAWN_TASK + string "Built-in application, or task, to spawn after console setup" + default "nsh" + ---help--- + The required App must be enabled via Kconfig, of course. Its + priority and stack size will be determined by this example and passed + on during the spawn of the chosen app. + +comment "FB Console App stack and priority options and glyph cache size" + +config EXAMPLES_FBCON_STACKSIZE + int "Stack Size" + default DEFAULT_TASK_STACKSIZE + ---help--- + The stacksize to use when starting the example. + +config EXAMPLES_FBCON_PRIORITY + int "Task Priority" + default 100 + ---help--- + The priority of the example. + +config EXAMPLES_FBCON_GLCACHE + int "Glyph cache size" + default 94 + ---help--- + Size of the glyph cache. Default allows all usual ASCII characters to be cached + +endif # EXAMPLES_FBCON diff --git a/examples/fbcon/Make.defs b/examples/fbcon/Make.defs new file mode 100644 index 00000000000..21336dda1c1 --- /dev/null +++ b/examples/fbcon/Make.defs @@ -0,0 +1,25 @@ +############################################################################ +# apps/examples/fbcon/Make.defs +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +ifneq ($(CONFIG_EXAMPLES_FBCON),) +CONFIGURED_APPS += $(APPDIR)/examples/fbcon +endif diff --git a/examples/fbcon/Makefile b/examples/fbcon/Makefile new file mode 100644 index 00000000000..f5795ce1773 --- /dev/null +++ b/examples/fbcon/Makefile @@ -0,0 +1,36 @@ +############################################################################ +# apps/examples/fbcon/Makefile +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +include $(APPDIR)/Make.defs + +# NuttX NX Framebuffer Console Example. + +MAINSRC = fbcon_main.c + +# NXTEXT built-in application info + +PROGNAME = fbcon +PRIORITY = $(CONFIG_EXAMPLES_FBCON_PRIORITY) +STACKSIZE = $(CONFIG_EXAMPLES_FBCON_STACKSIZE) +MODULE = $(CONFIG_EXAMPLES_FBCON) + +include $(APPDIR)/Application.mk diff --git a/examples/fbcon/fbcon_main.c b/examples/fbcon/fbcon_main.c new file mode 100644 index 00000000000..2aa95e0c5de --- /dev/null +++ b/examples/fbcon/fbcon_main.c @@ -0,0 +1,2655 @@ +/**************************************************************************** + * apps/examples/fbcon/fbcon_main.c + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef CONFIG_NX +# error This application requires NX Graphics +#endif + +/* NSH Redirection requires Pipes */ + +#ifndef CONFIG_DEV_PIPE_SIZE +# error FIFO and Named Pipe Drivers should be enabled in the configuration +#endif + +#ifdef CONFIG_NSH_CLE +# warning FBCON console does not support much VT100/EMACS/CLE type functionality yet +#endif + +#if !defined(CONFIG_EXAMPLES_FBCON_PIPE_STDOUT) && \ + !defined(CONFIG_EXAMPLES_FBCON_PIPE_STDOUT) +# warning FBCON is not configured for either stdout or stderr! +#endif + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* stdout and stderr configuration */ + +#define READ_PIPE 0 +#define WRITE_PIPE 1 +#define POLL_BUFSIZE 64 +#define VT100_MAX_SEQUENCE 6 /* Max length of VT100 sequence to check */ + +/* VT100 codes that can be decoded */ + +#define VT100_CLEAREOL {ASCII_ESC, '[', 'K'} /* Clear line from cursor right */ +#define VT100_CLEARLINE {ASCII_ESC, '[', '2', 'K'} /* Clear entire line */ +#define VT100_CURSOROFF {ASCII_ESC, '[', '?', '2', '5', 'l'} /* Cursor OFF */ +#define VT100_CURSORON {ASCII_ESC, '[', '?', '2', '5', 'h'} /* Cursor ON */ +#define VT100_CURSORL {ASCII_ESC, '[', '*', 'D'} /* Move cursor left (* = [1...99]) columns */ + +/* Configuration ************************************************************/ + +/* Pixel depth. If none provided, pick the smallest enabled pixel depth */ + +#ifdef CONFIG_EXAMPLES_FBCON_BPP_NX_DEFAULT +# if !defined(CONFIG_NX_DISABLE_1BPP) +# define FBCON_BPP 1 +# elif !defined(CONFIG_NX_DISABLE_2BPP) +# define FBCON_BPP 2 +# elif !defined(CONFIG_NX_DISABLE_4BPP) +# define FBCON_BPP 4 +# elif !defined(CONFIG_NX_DISABLE_8BPP) +# define FBCON_BPP 8 +# elif !defined(CONFIG_NX_DISABLE_16BPP) +# define FBCON_BPP 16 +# elif !defined(CONFIG_NX_DISABLE_24BPP) +# define FBCON_BPP 24 +# elif !defined(CONFIG_NX_DISABLE_32BPP) +# define FBCON_BPP 32 +# else +# error "No pixel depth enabled" +# endif +#elif defined(CONFIG_EXAMPLES_FBCON_1BPP) +# define FBCON_BPP 1 +#elif defined(CONFIG_EXAMPLES_FBCON_2BPP) +# define FBCON_BPP 2 +#elif defined(CONFIG_EXAMPLES_FBCON_4BPP) +# define FBCON_BPP 4 +#elif defined(CONFIG_EXAMPLES_FBCON_8BPP) +# define FBCON_BPP 8 +#elif defined(CONFIG_EXAMPLES_FBCON_16BPP) +# define FBCON_BPP 16 +#elif defined(CONFIG_EXAMPLES_FBCON_24BPP) +# define FBCON_BPP 24 +#elif defined(CONFIG_EXAMPLES_FBCON_32BPP) +# define FBCON_BPP 32 +#endif + +/* Select renderer */ + +#if (FBCON_BPP == 1) +# define RENDERER nxf_convert_1bpp +#elif (FBCON_BPP == 2) +# define RENDERER nxf_convert_2bpp +#elif (FBCON_BPP == 4) +# define RENDERER nxf_convert_4bpp +#elif (FBCON_BPP == 8) +# define RENDERER nxf_convert_8bpp +#elif (FBCON_BPP == 16) +# define RENDERER nxf_convert_16bpp +#elif (FBCON_BPP == 24) +# define RENDERER nxf_convert_24bpp +#elif (FBCON_BPP == 32) +# define RENDERER nxf_convert_32bpp +#else +# error "Unsupported CONFIG_EXAMPLES_FBCON_BPP" +#endif + +/* Background and font color, if defaults chosen */ + +#ifndef CONFIG_EXAMPLES_FBCON_BGCOLOR +# if (FBCON_BPP == 24) || (FBCON_BPP == 32) +# define FBCON_BGCOLOR 0x00000000 +# elif FBCON_BPP == 16 +# define FBCON_BGCOLOR 0x0000 +# else +# define FBCON_BGCOLOR 0x0 +# endif +#else +# define FBCON_BGCOLOR CONFIG_EXAMPLES_FBCON_BGCOLOR +#endif + +#ifndef CONFIG_EXAMPLES_FBCON_FCOLOR +# if (FBCON_BPP == 32) || (FBCON_BPP == 24) +# define FBCON_FCOLOR 0xffffff +# elif FBCON_BPP == 16 +# define FBCON_FCOLOR 0xffff +# else +# define FBCON_FCOLOR 0xff +# endif +#else +# define FBCON_FCOLOR CONFIG_EXAMPLES_FBCON_FCOLOR +#endif + +/* Console font ID */ + +#ifndef CONFIG_EXAMPLES_FBCON_FONTID +# ifndef NXFONT_DEFAULT +# error NXFONT_DEFAULT not defined +# endif +# define FBCON_FONTID NXFONT_DEFAULT +#else +# define FBCON_FONTID CONFIG_EXAMPLES_FBCON_FONTID +#endif + +/* Font glyph caching */ + +#ifndef CONFIG_EXAMPLES_FBCON_GLCACHE +# define FBCON_GLCACHE 16 +#else +# define FBCON_GLCACHE CONFIG_EXAMPLES_FBCON_GLCACHE +#endif + +/* Bitmap flags */ + +#define BMFLAGS_NOGLYPH (1 << 0) /* No glyph available, use space */ +#define BM_ISSPACE(bm) (((bm)->flags & BMFLAGS_NOGLYPH) != 0) + +/* Sizes and maximums */ + +#define MAX_USECNT 255 /* Limit to range of a uint8_t */ + +/* Line spacing. Space (in rows) between lines. */ + +#define FBCON_LINESPACING CONFIG_EXAMPLES_FBCON_LINESPACING + +/* Cursor character */ + +#define FBCON_CURSORCHAR CONFIG_EXAMPLES_FBCON_CURSORCHAR + +/* Spawn task */ + +#define SPAWN_TASK CONFIG_EXAMPLES_FBCON_SPAWN_TASK + +/**************************************************************************** + * Private Types + ****************************************************************************/ + +enum exitcode_e +{ + FBCON_EXIT_SUCCESS = 0, + FBCON_EXIT_FAIL, + FBCON_EXIT_FD, + FBCON_EXIT_GETVINFO, + FBCON_EXIT_GETPINFO, + FBCON_EXIT_FBMEM, + FBCON_EXIT_FBMEM2, + FBCON_EXIT_FBIO_OVERLAY_INFO, + FBCON_EXIT_FBIO_SELECT_OVERLAY, + FBCON_EXIT_FONTOPEN, + FBCON_EXIT_SETBGCOLOR, + FBCON_EXIT_STDOUT_PIPE_FAILED, + FBCON_EXIT_STDERR_PIPE_FAILED, + FBCON_EXIT_STDIN_PIPE_FAILED, + FBCON_EXIT_LOCAL_STDERR_PIPE_FAILED, + FBCON_EXIT_LOCAL_STDOUT_PIPE_FAILED, + FBCON_EXIT_POSIX_SPAWN_ACTIONS_INIT_FAILED, + FBCON_EXIT_POSIX_SPAWN_FAILED, + FBCON_EXIT_APP_INDEX_UNAVAILABLE, + FBCON_EXIT_APP_POSIX_ATTRIB_INIT_FAILED, +}; + +/* Describes one cached glyph bitmap */ + +struct fbcon_glyph_s +{ + uint8_t code; /* Character code */ + uint8_t height; /* Height of this glyph (in rows) */ + uint8_t width; /* Width of this glyph (in pixels) */ + uint8_t stride; /* Width of the glyph row (bytes) */ + uint8_t usecnt; /* Use count */ + FAR uint8_t *bitmap; /* Allocated bitmap memory */ +}; + +/* Describes on character on the display */ + +struct fbcon_bitmap_s +{ + uint8_t code; /* Character code */ + uint8_t flags; /* See BMFLAGS_* */ + struct nxgl_point_s pos; /* Character position */ +}; + +/* Describes the state of one text display */ + +struct fbcon_state_s +{ + int fd_fb; + FAR void *fbcon_font; + struct fb_videoinfo_s *vinfo; + struct fb_planeinfo_s *pinfo; +#ifdef CONFIG_FB_OVERLAY + struct fb_overlayinfo_s oinfo; +#endif + FAR void *fbmem; +#if 0 + /* Revisit needed - no support got dual framebuffers as yet */ + + FAR void *fbmem2; + FAR void *act_fbmem; +#endif + uint32_t mem2_yoffset; + + /* The following describe the console */ + + nxgl_mxpixel_t bcolor; /* Console background color */ + nxgl_mxpixel_t fcolor; /* Console font color */ + struct nxgl_size_s wsize; /* Console size */ + uint8_t fheight; /* Max height of a font in pixels */ + uint8_t fwidth; /* Max width of a font in pixels */ + uint8_t spwidth; /* The width of a space */ + + /* These describe all text already added to the display */ + + uint8_t maxglyphs; /* Size of the glyph[] array */ + uint16_t maxchars; /* Size of the bm[] array */ + uint32_t nchars; /* Numb of chars in the bm[] array */ + + FAR struct fbcon_bitmap_s *bm; /* List of bitmaps on the display */ + FAR struct fbcon_glyph_s *glyph; /* Cache of rendered fonts in use */ + FAR struct fbcon_bitmap_s cursor; /* Character to use for cursor */ + + /* VT100 escape sequence processing */ + + char seq[VT100_MAX_SEQUENCE]; /* Buffered chars */ + uint8_t nseq; /* Num buffered chars */ + int nwild; /* Num wild collected */ + int wildval; /* Wildcard value */ +}; + +typedef void (*seqhandler_t)(FAR struct fbcon_state_s *st); + +/* Identifies the state of the VT100 escape sequence processing */ + +enum fbcon_vt100state_e +{ + VT100_NOT_CONSUMED = 0, /* Character is not part of a VT100 escape sequence */ + VT100_CONSUMED, /* Character was consumed as part of the VT100 escape processing */ + VT100_PROCESSED, /* The full VT100 escape sequence was processed */ + VT100_ABORT /* Invalid/unsupported character in buffered escape sequence */ +}; + +struct vt100_sequence_s +{ + FAR const char *seq; + seqhandler_t handler; + uint8_t size; +}; + +/**************************************************************************** + * Private Function Prototypes + ****************************************************************************/ +#if 0 +/* Revisit needed = no support for dual framebuffers yet */ + +static int fb_init_mem2(FAR struct fbcon_state_s *st); +#endif +static int fbdev_get_pinfo(int fd, FAR struct fb_planeinfo_s *pinfo); +static int fbcon_initialize(FAR struct fbcon_state_s *st); +static void fbcon_newline(FAR struct fbcon_state_s *st); +static int fbcon_hidechar(FAR FAR struct fbcon_state_s *st, + FAR const struct fbcon_bitmap_s *bm); +static enum fbcon_vt100state_e fbcon_vt100(FAR struct fbcon_state_s *st, + char ch); +static void fbcon_fillchar(FAR struct fbcon_state_s *st, + FAR const struct nxgl_rect_s *rect, + FAR const struct fbcon_bitmap_s *bm); +static int fbcon_fill(FAR struct fbcon_state_s *st, + FAR struct nxgl_rect_s *rect, + FAR nxgl_mxpixel_t *color); +static void fbcon_fillspace(FAR struct fbcon_state_s *st, + FAR const struct nxgl_rect_s *rect, + FAR const struct fbcon_bitmap_s *bm); +static int fbcon_bitmap(FAR struct fbcon_state_s *st, + FAR const struct nxgl_rect_s *dest, + FAR const uint32_t *src, + unsigned int stride); +static int fbcon_backspace(FAR struct fbcon_state_s *st); +static void fbcon_home(FAR struct fbcon_state_s *st); +static inline void fbcon_movedisplay(FAR struct fbcon_state_s *st, + int bottom, int scrollheight); +static inline void fbcon_scroll(FAR struct fbcon_state_s *st, + int scrollheight); +static void fbcon_freeglyph(FAR struct fbcon_glyph_s *glyph); +static inline FAR struct fbcon_glyph_s * + fbcon_allocglyph(FAR struct fbcon_state_s *st); +static FAR struct fbcon_glyph_s * + fbcon_findglyph(FAR struct fbcon_state_s *st, uint8_t ch); +static inline FAR struct fbcon_glyph_s * + fbcon_renderglyph(FAR struct fbcon_state_s *st, + FAR const struct nx_fontbitmap_s *fbm, uint8_t ch); +static int fbcon_fontsize(FAR void *hfont, uint8_t ch, + FAR struct nxgl_size_s *size); +static FAR struct fbcon_glyph_s * + fbcon_getglyph(FAR struct fbcon_state_s *st, uint8_t ch); +static FAR const struct fbcon_bitmap_s * + fbcon_addchar(FAR struct fbcon_state_s *st, uint8_t ch); +static void fbcon_write(FAR struct fbcon_state_s *st, + FAR char *buffer, size_t buflen); +static bool has_input(int fd); +static void poll_std_streams(FAR struct fbcon_state_s *st); +static void fbcon_putc(FAR struct fbcon_state_s *st, uint8_t ch); +static enum fbcon_vt100state_e fbcon_vt100seq( + FAR struct fbcon_state_s *st, int seqsize); +static FAR const struct vt100_sequence_s * + fbcon_vt100part(FAR struct fbcon_state_s *st, int seqsize); +static enum fbcon_vt100state_e fbcon_vt100(FAR struct fbcon_state_s *st, + char ch); +static void fbcon_erasetoeol(FAR struct fbcon_state_s *st); +static void fbcon_clearline(FAR struct fbcon_state_s *st); +static void fbcon_showcursor(FAR struct fbcon_state_s *st); +static void fbcon_hidecursor(FAR struct fbcon_state_s *st); +static void fbcon_cursorl(FAR struct fbcon_state_s *st); + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +/* Pipes for NSH Shell: stdin, stdout, stderr */ + +#ifdef CONFIG_EXAMPLES_FBCON_PIPE_STDIN +static int g_nsh_stdin[2]; +#endif +static int g_nsh_stdout[2]; +static int g_nsh_stderr[2]; + +/* The VT100 sequences supported by FBCON */ + +static const char g_erasetoeol[] = VT100_CLEAREOL; +static const char g_clearline[] = VT100_CLEARLINE; +static const char g_cursoroff[] = VT100_CURSOROFF; +static const char g_cursoron[] = VT100_CURSORON; +static const char g_cursorl[] = VT100_CURSORL; + +static const struct vt100_sequence_s g_vt100sequences[] = +{ + {g_erasetoeol, fbcon_erasetoeol, sizeof(g_erasetoeol)}, + {g_clearline, fbcon_clearline, sizeof(g_clearline)}, + {g_cursoroff, fbcon_hidecursor, sizeof(g_cursoroff)}, + {g_cursoron, fbcon_showcursor, sizeof(g_cursoroff)}, + {g_cursorl, fbcon_cursorl, sizeof(g_cursorl)}, + {NULL, NULL, 0} +}; + +#ifdef CONFIG_EXAMPLES_FBCON_SHOW_WELCOME +# ifdef CONFIG_EXAMPLES_FBCON_PIPE_STDOUT +static const char g_stdout_hello[] = "Hello FBCON stdout fprintf output!"; +# endif +# ifdef CONFIG_EXAMPLES_FBCON_PIPE_STDERR +static const char g_stderr_hello[] = "Hello FBCON stderr fprintf output!"; +# endif +#endif + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: fbcon_showcursor + * + * Description: + * Render the cursor character at the current display position. + * + * Input Parameters: + * st - pointer to FBCON status structure + * + * Returned Value: + * None + * + ****************************************************************************/ + +static void fbcon_showcursor(FAR struct fbcon_state_s *st) +{ + int lineheight; + + if ((st->cursor.pos.x + st->fwidth) > st->wsize.w) + { +#ifndef CONFIG_EXAMPLES_FBCON_NOWRAP + /* No.. move to the next line */ + + fbcon_newline(st); +#else + return OK; +#endif + } + + /* Check if we need to scroll up */ + + lineheight = st->fheight + FBCON_LINESPACING; + while (st->cursor.pos.y >= st->wsize.h + lineheight) + { + fbcon_scroll(st, lineheight); + } + + /* Render the cursor glyph onto the display. */ + + fbcon_fillchar(st, NULL, &st->cursor); +} + +/**************************************************************************** + * Name: fbcon_hidecursor + * + * Description: + * Remove the cursor character at the current display position. + * + * Input Parameters: + * st - pointer to FBCON status structure + * + * Returned Value: + * None + * + ****************************************************************************/ + +static void fbcon_hidecursor(FAR struct fbcon_state_s *st) +{ + fbcon_hidechar(st, &st->cursor); +} + +/**************************************************************************** + * Name: fbcon_cursorl + * + * Description: + * Move the cursor position to the left n characters. + * + * Input Parameters: + * st - pointer to FBCON status structure + * + * Returned Value: + * None + * + ****************************************************************************/ + +static void fbcon_cursorl(FAR struct fbcon_state_s *st) +{ + int i; + + /* Revisit needed. It seems backspace 1 less than calculated. + * This is illogical and yet to be explained and is perhaps related to + * nsh itself when nsh is the spawned app/task. + */ + + for (i = 1; i < st->wildval; i++) + { + fbcon_backspace(st); + } +} + +/**************************************************************************** + * Name: fbcon_erasetoeol + * + * Description: + * Handle the erase-to-eol VT100 escape sequence. + * Erase from and including cursor position + * + * Input Parameters: + * st - pointer to FBCON status structure + * + * Returned Value: + * None + * + ****************************************************************************/ + +static void fbcon_erasetoeol(FAR struct fbcon_state_s *st) +{ + struct nxgl_rect_s rect; + + /* Create a bounding box the size of the remaining iine */ + + rect.pt1.x = st->cursor.pos.x; + rect.pt2.x = st->wsize.w - 1; + rect.pt1.y = st->cursor.pos.y; + rect.pt2.y = rect.pt1.y + st->fheight + FBCON_LINESPACING - 1; + + /* Clear the region */ + + if (fbcon_fill(st, &rect, &st->bcolor) < 0) + { + gerr("ERROR: fbcon_fill failed: %d\n", errno); + } + + /* Because we were clearing from the cursor position, there's no need + * to modify st->nchar as there are no characters after the cursor. + */ +} + +/**************************************************************************** + * Name: fbcon_clearline + * + * Description: + * Handle the clearline VT100 escape sequence + * + * Input Parameters: + * st - pointer to FBCON status structure + * + * Returned Value: + * The index of the match in g_vt100sequences[] + * + ****************************************************************************/ + +static void fbcon_clearline(FAR struct fbcon_state_s *st) +{ + int i; + FAR struct fbcon_bitmap_s *bm; + struct nxgl_rect_s rect; + + /* Create a bounding box the size of the iine */ + + rect.pt1.x = 0; + rect.pt2.x = st->wsize.w - 1; + rect.pt1.y = st->cursor.pos.y + FBCON_LINESPACING; + rect.pt2.y = st->cursor.pos.y + st->fheight + FBCON_LINESPACING - 1; + + /* Clear the region */ + + if (fbcon_fill(st, &rect, &st->bcolor) < 0) + { + gerr("ERROR: fbcon_fill failed: %d\n", errno); + } + + st->cursor.pos.x = st->spwidth; + + /* Decrement nchar for each character within in the bounding box */ + + i = st->nchars; + while (--i > 0) + { + bm = &st->bm[i]; + if (bm->pos.y <= rect.pt1.y && + bm->pos.y + st->fheight >= rect.pt2.y) + { + st->nchars--; + } + } +} + +/**************************************************************************** + * Name: fbcon_bitmap + * + * Description: + * Copy a rectangular region of a larger image into the rectangle in the + * specified window. + * + * Input Parameters: + * st - pointer to FBCON status structure + * dest - Describes the rectangular region on the display that will + * receive the bit map. + * src - The start of the source image. + * stride - The width of the full source image in pixels. + * + * Returned Value: + * OK on success; ERROR on failure with errno set appropriately + * + ****************************************************************************/ + +static int fbcon_bitmap(FAR struct fbcon_state_s *st, + FAR const struct nxgl_rect_s *dest, + FAR const uint32_t *src, + unsigned int stride) +{ + FAR uint32_t *dst; + FAR uint8_t *row; + struct fb_area_s area; + int x; + int y; + + area.h = dest->pt2.y - dest->pt1.y + 1; + area.w = dest->pt2.x - dest->pt1.x + 1; + area.x = dest->pt1.x; + area.y = dest->pt1.y; + + row = (FAR uint8_t *)st->fbmem + st->pinfo->stride * area.y; + for (y = 0; y < area.h; y++) + { + dst = ((FAR uint32_t *)row) + area.x; + for (x = 0; x < area.w; x++) + { + *dst++ = *(uint32_t *)src++; + } + + row += st->pinfo->stride; + } + + return OK; +} + +/**************************************************************************** + * Name: fbcon_movedisplay + * + * Description: + * This function implements the data movement for the scroll operation. + * + * Input Parameters: + * st - pointer to FBCON status structure + * bottom - Start of the vacated area at the bottom to be cleared + * scrollheight - The distance the display must be scrolled + * + * Returned Value: + * OK on success; ERROR on failure with errno set appropriately + * + ****************************************************************************/ + +static inline void fbcon_movedisplay(struct fbcon_state_s *st, int bottom, + int scrollheight) +{ + FAR struct fbcon_bitmap_s *bm; + struct nxgl_rect_s rect; + nxgl_coord_t row; + int ret; + int i; + + /* Move each row, one at a time. They could all be moved at once but since + * the region is cleared, then re-written, the effect would not be good. + * Below the region is also cleared and re-written, + * however, in much smaller chunks. + */ + + rect.pt1.x = 0; + rect.pt2.x = st->wsize.w - 1; + + for (row = FBCON_LINESPACING; row < bottom; row += scrollheight) + { + /* Create a bounding box the size of one row of characters */ + + rect.pt1.y = row; + rect.pt2.y = row + scrollheight - 1; + + /* Clear the region */ + + ret = fbcon_fill(st, &rect, &st->bcolor); + if (ret < 0) + { + gerr("ERROR: fbcon_fill failed: %d\n", errno); + } + + /* Fill each character that might lie within in the bounding box */ + + for (i = 0; i < st->nchars; i++) + { + bm = &st->bm[i]; + if (bm->pos.y <= rect.pt1.y && + bm->pos.y + st->fheight >= rect.pt2.y) + { + fbcon_fillchar(st, &rect, bm); + } + } + } + + /* Finally, clear the vacated part of the display */ + + rect.pt1.y = bottom; + rect.pt2.y = st->wsize.h - 1; + + ret = fbcon_fill(st, &rect, &st->bcolor); + if (ret < 0) + { + fprintf(stderr, "fbcon_movedisplay: fbcon_fill failed: %d\n", errno); + } +} + +/**************************************************************************** + * Name: fbcon_scroll + * + * Description: + * Scroll the display up by a certain amount + * + * Input Parameters: + * st - pointer to FBCON status structure + * scrollheight - The distance the display must be scrolled + * + * Returned Value: + * OK on success; ERROR on failure with errno set appropriately + * + ****************************************************************************/ + +static inline void fbcon_scroll(struct fbcon_state_s *st, int scrollheight) +{ + int i; + int j; + + /* Adjust the vertical position of each character */ + + for (i = 0; i < st->nchars; ) + { + FAR struct fbcon_bitmap_s *bm = &st->bm[i]; + + /* Has any part of this character scrolled off the screen? */ + + if (bm->pos.y < scrollheight + FBCON_LINESPACING) + { + /* Yes... Delete the character by moving all of the data */ + + for (j = i; j < st->nchars - 1; j++) + { + memcpy(&st->bm[j], &st->bm[j + 1], + sizeof(struct fbcon_bitmap_s)); + } + + /* Decrement the number of cached characters ('i' is not + * incremented in this case because it already points to the next + * character) + */ + + st->nchars--; + } + + /* No.. just decrement its vertical position (moving it "up" the + * display by one line). + */ + + else + { + bm->pos.y -= scrollheight; + + /* We are keeping this one so increment to the next character */ + + i++; + } + } + + /* And move the next display position up by one line as well */ + + st->cursor.pos.y -= scrollheight; + + /* Move the display in the range of 0-height up one scrollheight. */ + + fbcon_movedisplay(st, st->cursor.pos.y, scrollheight); +} + +/**************************************************************************** + * Name: fbcon_freeglyph + * + * Description: + * Clear the specified glyph structure + * + * Input Parameters: + * glyph - pointer to glyph structure to be freed + * + * Returned Value: + * None + * + ****************************************************************************/ + +static void fbcon_freeglyph(FAR struct fbcon_glyph_s *glyph) +{ + if (glyph->bitmap) + { + free(glyph->bitmap); + } + + memset(glyph, 0, sizeof(struct fbcon_glyph_s)); +} + +/**************************************************************************** + * Name: fbcon_allocglyph + * + * Description: + * Allocate a glyph structure + * + * Input Parameters: + * glyph - pointer to glyph structure to be allocated + * + * Returned Value: + * None + * + ****************************************************************************/ + +static inline FAR struct fbcon_glyph_s * + fbcon_allocglyph(FAR struct fbcon_state_s *st) +{ + FAR struct fbcon_glyph_s *glyph = NULL; + FAR struct fbcon_glyph_s *luglyph = NULL; + uint8_t luusecnt; + int i; + + /* Search through the glyph cache looking for an unused glyph. Also, keep + * track of the least used glyph as well. We need that if we have to + * replace a glyph in the cache. + */ + + for (i = 0; i < st->maxglyphs; i++) + { + /* Is this glyph in use? */ + + glyph = &st->glyph[i]; + if (!glyph->usecnt) + { + /* No.. return this glyph with a use count of one */ + + glyph->usecnt = 1; + return glyph; + } + + /* Yes.. check for the least recently used */ + + if (!luglyph || glyph->usecnt < luglyph->usecnt) + { + luglyph = glyph; + } + } + + /* If we get here, the glyph cache is full. We replace the least used + * glyph with the one we need now. (luglyph can't be NULL). + */ + + luusecnt = luglyph->usecnt; + fbcon_freeglyph(luglyph); + + /* But lets decrement all of the usecnts so that the new one one be so + * far behind in the counts as the older ones. + */ + + if (luusecnt > 1) + { + uint8_t decr = luusecnt - 1; + + for (i = 0; i < st->maxglyphs; i++) + { + /* Is this glyph in use? */ + + glyph = &st->glyph[i]; + if (glyph->usecnt > decr) + { + glyph->usecnt -= decr; + } + } + } + + /* Then return the least used glyph */ + + luglyph->usecnt = 1; + return luglyph; +} + +/**************************************************************************** + * Name: fbcon_findglyph + * + * Description: + * Try and find a glyph in the cache for a given character + * + * Input Parameters: + * st - pointer to FBCON status structure + * ch - the character + * + * Returned Value: + * a pointer to the glyph structure if found or NULL if not + * + ****************************************************************************/ + +static FAR struct fbcon_glyph_s * + fbcon_findglyph(FAR struct fbcon_state_s *st, uint8_t ch) +{ + int i; + + /* Try to find the glyph in the cache of pre-rendered glyphs */ + + for (i = 0; i < st->maxglyphs; i++) + { + FAR struct fbcon_glyph_s *glyph = &st->glyph[i]; + if (glyph->usecnt > 0 && glyph->code == ch) + { + /* Increment the use count (unless it is already at the max) */ + + if (glyph->usecnt < MAX_USECNT) + { + glyph->usecnt++; + } + + /* And return the glyph that we found */ + + return glyph; + } + } + + return NULL; +} + +/**************************************************************************** + * Name: fbcon_renderglyph + * + * Description: + * Render a character as a glyph based on the font bitmap and metrics + * + * Input Parameters: + * st - pointer to FBCON status structure + * fbm - pointer to the character bitmap/metrics + * ch - the character to be rendered + * + * Returned Value: + * a pointer to the rendered glyph structure + * + ****************************************************************************/ + +static inline FAR struct fbcon_glyph_s * + fbcon_renderglyph(FAR struct fbcon_state_s *st, + FAR const struct nx_fontbitmap_s *fbm, uint8_t ch) +{ + FAR struct fbcon_glyph_s *glyph = NULL; + FAR nxgl_mxpixel_t *ptr; +#if FBCON_BPP < 8 + nxgl_mxpixel_t pixel; +#endif + int bmsize; + int row; + int col; + int ret; + + /* Make sure that there is room for another glyph */ + + ginfo("ch=%c [%02x]\n", isprint(ch) ? ch : '.', ch); + + /* Allocate the glyph (always succeeds) */ + + glyph = fbcon_allocglyph(st); + glyph->code = ch; + + /* Get the dimensions of the glyph */ + + glyph->width = fbm->metric.width + fbm->metric.xoffset; + glyph->height = fbm->metric.height + fbm->metric.yoffset; + + /* Allocate memory to hold the glyph with its offsets */ + + glyph->stride = (glyph->width * FBCON_BPP + 7) / 8; + bmsize = glyph->stride * glyph->height; + glyph->bitmap = (FAR uint8_t *)malloc(bmsize); + + if (glyph->bitmap) + { + /* Initialize the glyph memory to the background color */ + +#if FBCON_BPP < 8 + pixel = st->bcolor; +# if FBCON_BPP == 1 + /* Pack 1-bit pixels into a 2-bits */ + + pixel &= 0x01; + pixel = (pixel) << 1 | pixel; +# endif +# if FBCON_BPP < 4 + /* Pack 2-bit pixels into a nibble */ + + pixel &= 0x03; + pixel = (pixel) << 2 | pixel; +# endif + + /* Pack 4-bit nibbles into a byte */ + + pixel &= 0x0f; + pixel = (pixel) << 4 | pixel; + + ptr = (FAR nxgl_mxpixel_t *)glyph->bitmap; + for (row = 0; row < glyph->height; row++) + { + for (col = 0; col < glyph->stride; col++) + { + /* Transfer the packed bytes into the buffer */ + + *ptr++ = pixel; + } + } + +#elif FBCON_BPP == 24 +# error "Additional logic is needed here for 24bpp support" + +#else /* FBCON_BPP = {8,16,32} */ + + ptr = (FAR nxgl_mxpixel_t *)glyph->bitmap; + for (row = 0; row < glyph->height; row++) + { + /* Just copy the color value into the glyph memory */ + + for (col = 0; col < glyph->width; col++) + { + *ptr++ = st->bcolor; + } + } +#endif + + /* Then render the glyph into the allocated memory */ + + ret = RENDERER((FAR nxgl_mxpixel_t *)glyph->bitmap, + glyph->height, glyph->width, glyph->stride, + fbm, st->fcolor); + if (ret < 0) + { + /* Actually, the RENDERER never returns a failure */ + + gerr("ERROR: fbcon_renderglyph: RENDERER failed\n"); + fbcon_freeglyph(glyph); + glyph = NULL; + } + } + + return glyph; +} + +/**************************************************************************** + * Name: fbcon_fontsize + * + * Description: + * Get the size of a given character bitmap + * + * Input Parameters: + * font - the font of interest + * ch - the character of interest + * size _ pointer to the structure to return the character size + * + * Returned Value: + * Success or ERROR + * + ****************************************************************************/ + +static int fbcon_fontsize(FAR void *hfont, uint8_t ch, + FAR struct nxgl_size_s *size) +{ + FAR const struct nx_fontbitmap_s *fbm; + + /* No, it is not cached... Does the code map to a font? */ + + fbm = nxf_getbitmap(hfont, ch); + if (fbm) + { + /* Yes.. return the font size */ + + size->w = fbm->metric.width + fbm->metric.xoffset; + size->h = fbm->metric.height + fbm->metric.yoffset; + return OK; + } + + return ERROR; +} + +/**************************************************************************** + * Name: fbcon_getglyph + * + * Description: + * Get rendered glyph data for a given character + * + * Input Parameters: + * st - pointer to FBCON status structure + * ch - the character to be rendered + * + * Returned Value: + * a pointer to the glyph data + * + ****************************************************************************/ + +static FAR struct fbcon_glyph_s * + fbcon_getglyph(FAR struct fbcon_state_s *st, uint8_t ch) +{ + FAR struct fbcon_glyph_s *glyph; + FAR const struct nx_fontbitmap_s *fbm; + + /* First, try to find the glyph in the cache of pre-rendered glyphs */ + + glyph = fbcon_findglyph(st, ch); + if (!glyph) + { + /* No, it is not cached... Does the code map to a font? */ + + fbm = nxf_getbitmap(st->fbcon_font, ch); + if (fbm) + { + /* Yes.. render the glyph */ + + glyph = fbcon_renderglyph(st, fbm, ch); + } + } + + return glyph; +} + +/**************************************************************************** + * Name: fbcon_hidechar + * + * Description: + * Erase a character from the display. + * + * Input Parameters: + * st - pointer to FBCON status structure + * bm - pointer to the character bitmap to be erased + * + * Returned Value: + * Success or error value + * + ****************************************************************************/ + +static int fbcon_hidechar(FAR struct fbcon_state_s *st, + FAR const struct fbcon_bitmap_s *bm) +{ + struct nxgl_rect_s bounds; + struct nxgl_size_s fsize; + int ret; + + /* Get the size of the font glyph. If fbcon_fontsize, then the + * character will have been rendered as a space, and no display + * modification is required (not an error). + */ + + ret = fbcon_fontsize(st->fbcon_font, bm->code, &fsize); + if (ret < 0) + { + /* It was rendered as a space. */ + + return OK; + } + + /* Construct a bounding box for the glyph */ + + bounds.pt1.x = bm->pos.x; + bounds.pt1.y = bm->pos.y; + bounds.pt2.x = bm->pos.x + fsize.w - 1; + bounds.pt2.y = bm->pos.y + fsize.h - 1; + + /* Fill the bitmap region with the background color, erasing the + * character from the display. + */ + + return fbcon_fill(st, &bounds, &st->bcolor); +} + +/**************************************************************************** + * Name: fbcon_addchar + * + * Description: + * Find or create a bitmap structurefor a character + * + * Input Parameters: + * st - pointer to FBCON status structure + * ch - the character to be rendered + * + * Returned Value: + * Pointer to the character bitmap + * + ****************************************************************************/ + +static FAR const struct fbcon_bitmap_s * + fbcon_addchar(FAR struct fbcon_state_s *st, + uint8_t ch) +{ + FAR struct fbcon_bitmap_s *bm = NULL; + FAR struct fbcon_glyph_s *glyph; + + /* Setup the bitmap information */ + + bm = &st->bm[st->nchars]; + bm->code = ch; + bm->flags = 0; + bm->pos.x = st->cursor.pos.x; + bm->pos.y = st->cursor.pos.y; + + /* Find (or create) the matching glyph */ + + glyph = fbcon_getglyph(st, ch); + if (!glyph) + { + /* No, there is no font for this code. Just mark this as a space. */ + + bm->flags |= BMFLAGS_NOGLYPH; + + /* Set up the next character position */ + + st->cursor.pos.x += st->spwidth; + } + else + { + /* Set up the next character position */ + + st->cursor.pos.x += glyph->width; + } + + /* Increment nchars to retain this character */ + + if (st->nchars < st->maxchars) + { + st->nchars++; + } + + return bm; +} + +/**************************************************************************** + * Name: fbcon_fill + * + * Description: + * Fill a region with a colour. + * + * Input Parameters: + * st - pointer to FBCON status structure + * rect - Describes the rectangular region on the display to be filled + * color - The color to fill the rectangle with + * + * Returned Value: + * OK on success; ERROR on failure with errno set appropriately + * + ****************************************************************************/ + +static int fbcon_fill(FAR struct fbcon_state_s *st, + FAR struct nxgl_rect_s *rect, + FAR nxgl_mxpixel_t *color) +{ + FAR uint32_t *dest; + FAR uint8_t *row; + struct fb_area_s area; + int x; + int y; + + area.h = rect->pt2.y - rect->pt1.y + 1; + area.w = rect->pt2.x - rect->pt1.x + 1; + area.x = rect->pt1.x; + area.y = rect->pt1.y; + + row = (FAR uint8_t *)st->fbmem + st->pinfo->stride * area.y; + for (y = 0; y < area.h; y++) + { + dest = (FAR uint32_t *)row + area.x; + for (x = 0; x < area.w; x++) + { + *dest++ = *color; + } + + row += st->pinfo->stride; + } + + return OK; +} + +/**************************************************************************** + * Name: fbcon_backspace + * + * Description: + * Remove the last character from the window. + * + * Input Parameters: + * st - pointer to FBCON status structure + * + * Returned Value: + * OK on success; ERROR on failure with errno set appropriately + * + ****************************************************************************/ + +static int fbcon_backspace(FAR struct fbcon_state_s *st) +{ + FAR struct fbcon_bitmap_s *bm; + int ndx; + int ret = -ENOENT; + + /* Is there a character on the display? */ + + if (st->nchars > 0) + { + /* Yes.. Get the index to the last bitmap on the display */ + + ndx = st->nchars - 1; + bm = &st->bm[ndx]; + + /* Erase the character from the display */ + + ret = fbcon_hidechar(st, bm); + + /* The current position to the location where the last character was */ + + st->cursor.pos.x = bm->pos.x; + st->cursor.pos.y = bm->pos.y; + + /* Decrement nchars to discard this character */ + + st->nchars = ndx; + } + + return ret; +} + +/**************************************************************************** + * Name: fbcon_home + * + * Description: + * Set the next character position to the top-left corner of the display. + * + * Input Parameters: + * st - pointer to FBCON status structure + * + * Returned Value: + * None + * + ****************************************************************************/ + +static void fbcon_home(FAR struct fbcon_state_s *st) +{ + /* The first character is one space from the left */ + + st->cursor.pos.x = st->spwidth; + + /* And FBCON_LINESPACING lines from the top */ + + st->cursor.pos.y = FBCON_LINESPACING; + + /* And reset number of characters in the bm buffer */ + + st->nchars = 0; +} + +/**************************************************************************** + * Name: fbcon_newline + * + * Description: + * Set the next character position to the beginning of the next line. + * + * Input Parameters: + * st - pointer to FBCON status structure + * + * Returned Value: + * None + * + ****************************************************************************/ + +void fbcon_newline(FAR struct fbcon_state_s *st) +{ + /* Carriage return: The first character is one space from the left */ + + st->cursor.pos.x = st->spwidth; + + /* Linefeed: Down the max font height + FBCON_LINESPACING */ + + st->cursor.pos.y += (st->fheight + FBCON_LINESPACING); +} + +/**************************************************************************** + * Name: fbcon_putc + * + * Description: + * Render the specified character at the current display position. + * + * Input Parameters: + * st - pointer to FBCON status structure + * ch - the character to be rendered + * + * Returned Value: + * None + * + ****************************************************************************/ + +void fbcon_putc(FAR struct fbcon_state_s *st, uint8_t ch) +{ + FAR const struct fbcon_bitmap_s *bm; + int lineheight; + + /* Ignore carriage returns */ + + if (ch == '\r') + { + return; + } + + /* Handle backspace (treating both BS and DEL as backspace) */ + + if (ch == ASCII_BS || ch == ASCII_DEL) + { + fbcon_backspace(st); + return; + } + + /* Will another character fit on this line? */ + + if (st->cursor.pos.x + st->fwidth > st->wsize.w) + { +#ifndef CONFIG_EXAMPLES_FBCON_NOWRAP + /* No.. move to the next line */ + + fbcon_newline(st); + + /* If we were about to output a newline character, then don't */ + + if (ch == ASCII_LF) + { + return; + } +#else + /* No.. Ignore all further characters until a newline is encountered */ + + if (ch != ASCII_LF) + { + return; + } +#endif + } + + /* If it is a newline character, then just perform the logical newline + * operation. + */ + + if (ch == ASCII_LF) + { + fbcon_newline(st); + return; + } + + /* Check if we need to scroll up */ + + lineheight = st->fheight + FBCON_LINESPACING; + while (st->cursor.pos.y > st->wsize.h - lineheight) + { + fbcon_scroll(st, lineheight); + } + + /* Find the glyph associated with the character and render it + * onto the display. + */ + + bm = fbcon_addchar(st, ch); + if (bm) + { + fbcon_fillchar(st, NULL, bm); + } +} + +/**************************************************************************** + * Name: fbcon_fillspace + * + * Description: + * Handle the special case of a space being displayed + * + * Input Parameters: + * st - pointer to FBCON status structure + * rect- Describes the rectangular region on the display that will + * receive the space. + * bm - pointer to the character bitmap structure with the location + * + * Returned Value: + * None + * + ****************************************************************************/ + +static void fbcon_fillspace(FAR struct fbcon_state_s *st, + FAR const struct nxgl_rect_s *rect, + FAR const struct fbcon_bitmap_s *bm) +{ + struct nxgl_rect_s bounds; + struct nxgl_rect_s intersection; + int ret; + + /* Construct a bounding box for the glyph */ + + bounds.pt1.x = bm->pos.x; + bounds.pt1.y = bm->pos.y; + bounds.pt2.x = bm->pos.x + st->spwidth - 1; + bounds.pt2.y = bm->pos.y + st->fheight - 1; + + /* Should this also be clipped to a region in the window? */ + + if (rect != NULL) + { + /* Get the intersection of the redraw region and the character bitmap */ + + nxgl_rectintersect(&intersection, rect, &bounds); + } + else + { + /* The intersection is the whole glyph */ + + nxgl_rectcopy(&intersection, &bounds); + } + + /* Check for empty intersections */ + + if (!nxgl_nullrect(&intersection)) + { + /* Fill the bitmap region with the background color, erasing the + * character from the display. + */ + + ret = fbcon_fill(st, &intersection, &st->bcolor); + if (ret < 0) + { + gerr("ERROR: fill() method failed: %d\n", ret); + } + } +} + +/**************************************************************************** + * Name: fbcon_fillchar + * + * Description: + * Implement the character display + * + * Input Parameters: + * st - pointer to FBCON status structure + * rect- Describes the rectangular region on the display that will + * receive the space. + * bm - pointer to the character bitmap structure with the location + * + * Returned Value: + * None + * + ****************************************************************************/ + +void fbcon_fillchar(FAR struct fbcon_state_s *st, + FAR const struct nxgl_rect_s *rect, + FAR const struct fbcon_bitmap_s *bm) +{ + FAR struct fbcon_glyph_s *glyph; + struct nxgl_rect_s bounds; + struct nxgl_rect_s intersection; + struct nxgl_size_s fsize; + int ret; + + /* Handle the special case of spaces which have no glyph bitmap */ + + if (BM_ISSPACE(bm)) + { + fbcon_fillspace(st, rect, bm); + return; + } + + /* Get the size of the font glyph (which may not have been created yet) */ + + ret = fbcon_fontsize(st->fbcon_font, bm->code, &fsize); + if (ret < 0) + { + /* This would mean that there is no bitmap for the character code and + * that the font would be rendered as a space. But this case should + * never happen here because the BM_ISSPACE() should have already + * found all such cases. + */ + + return; + } + + /* Construct a bounding box for the glyph */ + + bounds.pt1.x = bm->pos.x; + bounds.pt1.y = bm->pos.y; + bounds.pt2.x = bm->pos.x + fsize.w - 1; + bounds.pt2.y = bm->pos.y + fsize.h - 1; + + /* Should this also be clipped to a region in the window? */ + + if (rect != NULL) + { + /* Get the intersection of the redraw region and the character bitmap */ + + nxgl_rectintersect(&intersection, rect, &bounds); + } + else + { + /* The intersection is the whole glyph */ + + nxgl_rectcopy(&intersection, &bounds); + } + + /* Check for empty intersections */ + + if (!nxgl_nullrect(&intersection)) + { + FAR const void *src; + + /* Find (or create) the glyph that goes with this font */ + + glyph = fbcon_getglyph(st, bm->code); + if (!glyph) + { + /* Shouldn't happen */ + + return; + } + + /* Blit the font bitmap into the window */ + + src = (FAR const void *)glyph->bitmap; + + ret = fbcon_bitmap(st, &intersection, src, + (unsigned int)glyph->stride); + if (ret < 0) + { + gerr("ERROR: fbcon_fillchar: fbcon_bitmapwindow failed: %d\n", + ret); + } + } +} + +/**************************************************************************** + * Name: fbcon_vt100part + * + * Description: + * Return the next entry that is a partial match to the sequence. + * + * Input Parameters: + * st - Driver data structure + * seqsize - The number of bytes in the sequence + * + * Returned Value: + * A pointer to the matching sequence in g_vt100sequences[] + * + ****************************************************************************/ + +FAR const struct vt100_sequence_s * + fbcon_vt100part(FAR struct fbcon_state_s *st, int seqsize) +{ + FAR static const struct vt100_sequence_s *seq; + static int ndx; + static int i; + static bool aborted; + static int numw; + static bool collecting; + + /* Search from the beginning of the sequence table */ + + for (ndx = 0; g_vt100sequences[ndx].seq; ndx++) + { + seq = &g_vt100sequences[ndx]; + + /* Is this sequence big enough? */ + + aborted = false; + numw = 0; + st->nwild = 0; + + /* compare characters received to those in the decodable sequences */ + + collecting = false; + for (i = 0; i < seqsize; i++) + { + if (seq->seq[i] == '*') + { + /* This sequence has a wildcard */ + + if ((st->seq[i] < ASCII_0) || (st->seq[i] > ASCII_9)) + { + aborted = true; + break; + } + + if (++numw > 1) + { + /* This logic only allows collection of one wildcard + * per VT100 sequence + */ + + aborted = true; + break; + } + + collecting = true; + st->wildval = st->seq[i] - ASCII_0; /* convert from ASCII */ + } + else if (collecting) + { + if ((st->seq[i] >= ASCII_0) && (st->seq[i] <= ASCII_9)) + { + st->wildval *= 10; + st->wildval += st->seq[i] - ASCII_0; + st->nwild++; + } + else + { + collecting = false; + } + } + else if (st->seq[i] != seq->seq[i]) + { + aborted = true; + break; + } + } + + if (!aborted) + { + return seq; + } + } + + return NULL; +} + +/**************************************************************************** + * Name: fbcon_vt100seq + * + * Description: + * Determine if the new sequence is a part of a supported VT100 escape + * sequence. + * + * Input Parameters: + * st - Driver data structure + * seqsize - The number of bytes in the sequence + * + * Returned Value: + * state - See enum fbcon_vt100state_e; + * + ****************************************************************************/ + +static enum fbcon_vt100state_e fbcon_vt100seq( + FAR struct fbcon_state_s *st, int seqsize) +{ + FAR const struct vt100_sequence_s *seq; + enum fbcon_vt100state_e ret; + + /* Is there any VT100 escape sequence that matches what we have + * buffered so far? + */ + + seq = fbcon_vt100part(st, seqsize); + if (seq) + { + /* Yes.. if the size of that escape sequence is the same as that + * buffered, then we have an exact match. + */ + + if (seqsize >= seq->size + st->nwild) + { + /* Process the VT100 sequence */ + + seq->handler(st); + st->nseq = 0; + return VT100_PROCESSED; + } + + /* The 'seqsize' is still smaller than the potential match(es). We + * will need to collect more characters before we can make a decision. + * Return an indication that we have consumed the character. + */ + + return VT100_CONSUMED; + } + + /* We get here on a failure. The buffer sequence is not part of any + * supported VT100 escape sequence. If seqsize > 1 then we need to + * return a special value because we have to re-process the buffered + * data. + */ + + ret = seqsize > 1 ? VT100_ABORT : VT100_NOT_CONSUMED; + return ret; +} + +/**************************************************************************** + * Name: fbcon_vt100 + * + * Description: + * Test if the newly received byte is part of a VT100 escape sequence + * + * Input Parameters: + * st - Driver data structure + * ch - The newly received character + * + * Returned Value: + * state - See enum fbcon_vt100state_e; + * + ****************************************************************************/ + +static enum fbcon_vt100state_e fbcon_vt100(FAR struct fbcon_state_s *st, + char ch) +{ + enum fbcon_vt100state_e ret; + int seqsize; + + /* If we have no buffered characters, then 'ch' must be the first character + * of an escape sequence. + */ + + if (st->nseq < 1) + { + /* The first character of an escape sequence must be an an escape + * character (!). + */ + + if (ch != ASCII_ESC) + { + return VT100_NOT_CONSUMED; + } + + /* Add the escape character to the buffer but don't bother with any + * further checking. + */ + + st->seq[0] = ASCII_ESC; + st->nseq = 1; + + return VT100_CONSUMED; + } + + /* Temporarily add the next character to the buffer */ + + seqsize = st->nseq; + st->seq[seqsize] = ch; + + /* Then check if this sequence is part of an a valid escape sequence */ + + seqsize++; + ret = fbcon_vt100seq(st, seqsize); + if (ret == VT100_CONSUMED) + { + /* The newly added character is indeed part of a VT100 escape sequence + * (which is still incomplete). Keep it in the buffer. + */ + + st->nseq = seqsize; + } + + return ret; +} + +/**************************************************************************** + * Name: fbcon_write + * + * Description: + * Put a sequence of characters on the display. + * + * Input Parameters: + * st - pointer to FBCON status structure + * buffer - pointer to the character array to be displayed + * buflen - number of characters to be displayed + * + * Returned Value: + * None + * + ****************************************************************************/ + +static void fbcon_write(FAR struct fbcon_state_s *st, + FAR char *buffer, size_t buflen) +{ + char ch; + enum fbcon_vt100state_e state; + ssize_t remaining; + + fbcon_hidecursor(st); + for (remaining = buflen; remaining > 0; remaining--) + { + ch = *buffer++; + +#if CONFIG_EXAMPLES_FBCON_VT100_DECODE + /* Check if this character is part of a VT100 escape sequence */ + + do + { + /* Is the character part of a VT100 escape sequnce? */ + + state = fbcon_vt100(st, ch); + switch (state) + { + /* Character is not part of a VT100 escape sequence (and no + * characters are buffer. + */ + + default: + case VT100_NOT_CONSUMED: + { + /* We can output the character to the window */ + + fbcon_putc(st, (uint8_t)ch); + } + break; + + /* The full VT100 escape sequence was processed (and the new + * character was consumed) + */ + + case VT100_PROCESSED: + + /* Character was consumed as part of the VT100 escape processing + * (but the escape sequence is still incomplete. + */ + + case VT100_CONSUMED: + { + /* Do nothing... the VT100 logic owns the character */ + } + break; + + /* Invalid/unsupported character in escape sequence */ + + case VT100_ABORT: + { + int i; + + /* Add the first unhandled character to the window */ + + fbcon_putc(st, (uint8_t)st->seq[0]); + + /* Move all buffer characters down one */ + + for (i = 1; i < st->nseq; i++) + { + st->seq[i - 1] = st->seq[i]; + } + + st->nseq--; + + /* Then loop again and check if what remains is part of a + * VT100 escape sequence. We could speed this up by + * checking if st->seq[0] == ASCII_ESC. + */ + } + break; + } + } + while (state == VT100_ABORT); +#else + /* Just output the character */ + + fbcon_putc(st, ch); +#endif /* CONFIG_EXAMPLES_FBCON_VT100_DECODE */ + } + + fbcon_showcursor(st); +} + +/**************************************************************************** + * Name: fbdev_get_pinfo + * + * Description: + * Get plane information for a framebuffer + * Note - does not support dual framebuffer memory + * + * Input Parameters: + * fd - file descriptor of the framebuffer + * pinfo - pointer to the3 structure for the plane info + * + * Returned Value: + * OK + * + ****************************************************************************/ + +static int fbdev_get_pinfo(int fd, FAR struct fb_planeinfo_s *pinfo) +{ + if (ioctl(fd, FBIOGET_PLANEINFO, (unsigned long)((uintptr_t)pinfo)) < 0) + { + int errcode = errno; + gerr("ERROR: ioctl(FBIOGET_PLANEINFO) failed: %d\n", errcode); + return EXIT_FAILURE; + } + + /* Only these pixel depths are supported. viinfo.fmt is ignored, only + * certain color formats are supported. + */ + + if (pinfo->bpp != 32 && pinfo->bpp != 24 && + pinfo->bpp != 16 && pinfo->bpp != 8 && + pinfo->bpp != 1) + { + gerr("ERROR: bpp=%u not supported\n", pinfo->bpp); + return EXIT_FAILURE; + } + + return OK; +} + +#if 0 +/* Revisit needed = no support for dual framebuffers yet */ + +/**************************************************************************** + * Name: fb_init_mem2 + * + * Description: + * Initialise the memory for the second framebuffer + * + * Input Parameters: + * st - pointer to FBCON status structure + * + * Returned Value: + * OK + * + ****************************************************************************/ + +static int fb_init_mem2(FAR struct fbcon_state_s *st) +{ + int ret; + uintptr_t buf_offset; + struct fb_planeinfo_s pinfo; + + memset(&pinfo, 0, sizeof(pinfo)); + pinfo.display = st->pinfo->display + 1; + + if ((ret = fbdev_get_pinfo(st->fd_fb, &pinfo)) < 0) + { + return EXIT_FAILURE; + } + + /* Check bpp */ + + if (pinfo.bpp != st->pinfo->bpp) + { + gerr("ERROR: fbmem2 is incorrect"); + return -EINVAL; + } + + /* Check the buffer address offset, + * It needs to be divisible by pinfo->stride + */ + + buf_offset = pinfo.fbmem - st->fbmem; + + if ((buf_offset % st->pinfo->stride) != 0) + { + gerr("ERROR: It is detected that buf_offset(%" PRIuPTR ") " + "and stride(%d) are not divisible, please ensure " + "that the driver handles the address offset by itself.\n", + buf_offset, st->pinfo->stride); + } + + /* Calculate the address and yoffset of fbmem2 */ + + if (buf_offset == 0) + { + /* Use consecutive fbmem2. */ + + st->mem2_yoffset = st->vinfo->yres; + st->fbmem2 = pinfo.fbmem + st->mem2_yoffset * pinfo.stride; + gerr("ERROR: Use consecutive fbmem2 = %p, yoffset = %" PRIu32"\n", + st->fbmem2, st->mem2_yoffset); + } + else + { + /* Use non-consecutive fbmem2. */ + + st->mem2_yoffset = buf_offset / st->pinfo->stride; + st->fbmem2 = pinfo.fbmem; + gerr("ERROR: Use non-consecutive fbmem2 = %p, yoffset = %" PRIu32"\n", + st->fbmem2, st->mem2_yoffset); + } + + return OK; +} +#endif + +/**************************************************************************** + * Name: fbcon_initialize + * + * Description: + * Initialise the Framebuffer Console + * + * Input Parameters: + * st - pointer to FBCON status structure + * + * Returned Value: + * Success or failure code + * + ****************************************************************************/ + +static int fbcon_initialize(FAR struct fbcon_state_s *st) +{ + struct nxgl_rect_s rect; + FAR const struct nx_font_s *fontset; + int ret; + + /* Get the configured font handles */ + + st->fbcon_font = nxf_getfonthandle(FBCON_FONTID); + if (!st->fbcon_font) + { + gerr("ERROR: fbcon_main: Failed to get console font handle: %d\n", + errno); + return FBCON_EXIT_FONTOPEN; + } + + st->bcolor = FBCON_BGCOLOR; + st->fcolor = FBCON_FCOLOR; + + rect.pt1.x = 0; + rect.pt1.y = 0; + rect.pt2.x = st->vinfo->xres - 1; + rect.pt2.y = st->vinfo->yres - 1; + ret = fbcon_fill(st, &rect, &st->bcolor); + if (ret < 0) + { + gerr("ERROR: fbcon_main: fbcon_setbgcolor failed: %d\n", errno); + return FBCON_EXIT_SETBGCOLOR; + } + + fontset = nxf_getfontset(st->fbcon_font); + st->fheight = fontset->mxheight; + st->fwidth = fontset->mxwidth; + st->spwidth = fontset->spwidth; + + /* we use the entire LCD area for the console */ + + st->wsize.h = st->vinfo->yres; + st->wsize.w = st->vinfo->xres; + + st->cursor.code = FBCON_CURSORCHAR; + if (FBCON_CURSORCHAR != ASCII_SPACE) + { + st->cursor.flags = 0; + } + else + { + st->cursor.flags = BMFLAGS_NOGLYPH; + } + + st->nchars = 0; + st->maxglyphs = FBCON_GLCACHE; + + /* The first character is one space from the left + * and FBCON_LINESEPARATION lines from the top + */ + + st->cursor.pos.x = st->spwidth; + st->cursor.pos.y = FBCON_LINESPACING; + st->maxchars = (st->wsize.w / st->fwidth) * + (st->wsize.h / (st->fheight + FBCON_LINESPACING) - 1); + + st->bm = malloc(st->maxchars * sizeof(struct fbcon_bitmap_s)); + if (st->bm == NULL) + { + gerr("ERROR: Unable to allocate display buffer memory"); + return -ENOMEM; + } + + memset(st->bm, 0, st->maxchars * sizeof(struct fbcon_bitmap_s)); + + st->glyph = malloc(FBCON_GLCACHE * (sizeof(struct fbcon_glyph_s))); + if (st->glyph == NULL) + { + gerr("ERROR: Unable to allocate glyph cache memory"); + return -ENOMEM; + } + + memset(st->glyph, 0, FBCON_GLCACHE * (sizeof(struct fbcon_glyph_s))); + + st->nseq = 0; + + return OK; +} + +/**************************************************************************** + * Name: has_input + * + * Description: + * Return true if a File Descriptor has data to be read. + * + * Input Parameters: + * fd - File Descriptor to be checked + * + * Returned Value: + * True if File Descriptor has data to be read; False otherwise + * + ****************************************************************************/ + +static bool has_input(int fd) +{ + int ret; + + /* Poll the File Descriptor for input */ + + struct pollfd fdp; + fdp.fd = fd; + fdp.events = POLLIN; + ret = poll(&fdp, /* File Descriptors */ + 1, /* Number of File Descriptors */ + 0); /* Poll Timeout (Milliseconds) */ + + if (ret > 0) + { + /* If poll is OK and there is input */ + + if ((fdp.revents & POLLIN) != 0) + { + /* Report that there is input */ + + return true; + } + + /* Else report no input */ + + return false; + } + else if (ret == 0) + { + /* If timeout, report no input */ + + return false; + } + else if (ret < 0) + { + /* Handle error */ + + fprintf(stderr, "poll failed: %d, fd=%d\n", ret, fd); + return false; + } + + /* Never comes here */ + + assert(false); + return false; +} + +/**************************************************************************** + * Name: poll_std_streams + * + * Description: + * Poll NSH stdout and stderr for output and display the output. + * + * Input Parameters: + * st - pointer to FBCON status structure + * + * Returned Value: + * None + * + ****************************************************************************/ + +static void poll_std_streams(FAR struct fbcon_state_s *st) +{ + ssize_t num_ch; + static char buf[POLL_BUFSIZE]; + + assert(g_nsh_stdout[READ_PIPE] != 0); + assert(g_nsh_stderr[READ_PIPE] != 0); +#ifdef CONFIG_EXAMPLES_FBCON_PIPE_STDIN + assert(g_nsh_stdin[READ_PIPE] != 0); +#endif + +#ifdef CONFIG_EXAMPLES_FBCON_PIPE_STDERR + /* Poll NSH stderr to check if there's output to be processed */ + + if (has_input(g_nsh_stderr[READ_PIPE])) + { + /* Write it to display */ + + num_ch = read(g_nsh_stderr[READ_PIPE], buf, POLL_BUFSIZE); + if (num_ch > 0) + { + /* display */ + + fbcon_write(st, buf, num_ch); + } + } +#endif /* CONFIG_EXAMPLES_FBCON_PIPE_STDERR */ + +#ifdef CONFIG_EXAMPLES_FBCON_PIPE_STDOUT + /* Poll NSH stdout to check if there's output to be processed */ + + if (has_input(g_nsh_stdout[READ_PIPE])) + { + /* Read the output from NSH stdout */ + + num_ch = read(g_nsh_stdout[READ_PIPE], buf, POLL_BUFSIZE); + if (num_ch > 0) + { + /* Write it to display */ + + fbcon_write(st, buf, num_ch); + } + } +#endif /* CONFIG_EXAMPLES_FBCON_PIPE_STDOUT */ + +#ifdef CONFIG_EXAMPLES_FBCON_PIPE_STDIN + if (has_input(STDIN_FILENO)) + { + /* Get and process a character */ + + ssize_t num = 0; + char ch; + num_ch = read(STDIN_FILENO, &ch, 1); + + if (num_ch != 1) + { + fprintf(stderr, "STDIN read failed\n"); + return; + } + + /* copy it to spawned app/process */ + + num = write(g_nsh_stdin[WRITE_PIPE], &ch, 1); + if (num != num_ch) + { + fprintf(stderr, "STDIN write failed\n"); + return; + } + +# if defined(CONFIG_NSH_READLINE) + fbcon_write(st, buf, num_ch); +# elif defined(CONFIG_NSH_CLE) + if (ch == ASCII_LF) + { + fbcon_write(st, &ch, 1); + } +# endif + } +#endif /* CONFIG_EXAMPLES_FBCON_PIPE_STDIN */ +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: fbcon_main + * + * Description: + * fbcon entry point + * + ****************************************************************************/ + +int main(int argc, FAR char *argv[]) +{ + FAR struct fbcon_state_s *st; + int index; + int ret; + pid_t pid; + posix_spawn_file_actions_t actions; + posix_spawnattr_t attr; + FAR const struct builtin_s *builtin; + int exitcode = FBCON_EXIT_SUCCESS; + FAR const char *fbdev = CONFIG_EXAMPLES_FBCON_DEF_FB; + + /* There is a single optional argument: The path to the framebuffer + * driver. + */ + + if (argc == 2) + { + fbdev = argv[1]; + } + else if (argc != 1) + { + fprintf(stderr, "ERROR: Single argument required\n"); + fprintf(stderr, "USAGE: %s []\n", argv[0]); + return FBCON_EXIT_FAIL; + } + + st = malloc(sizeof(struct fbcon_state_s)); + if (st == NULL) + { + gerr("ERROR: Unable to allocate fbcon_state_s memory"); + return -ENOMEM; + } + + st->pinfo = malloc(sizeof(struct fb_planeinfo_s)); + if (st->pinfo == NULL) + { + gerr("ERROR: Unable to allocate pinfo memory"); + return -ENOMEM; + } + + st->vinfo = malloc(sizeof(struct fb_videoinfo_s)); + if (st->vinfo == NULL) + { + gerr("ERROR: Unable to allocate vinfo memory"); + return -ENOMEM; + } + + /* Open the framebuffer driver */ + + st->fd_fb = open(fbdev, O_RDWR); + if (st->fd_fb < 0) + { + int errcode = errno; + gerr("ERROR: Failed to open %s: %d\n", fbdev, errcode); + return FBCON_EXIT_FD; + } + + /* Get the characteristics of the framebuffer */ + + ret = ioctl(st->fd_fb, FBIOGET_VIDEOINFO, + (unsigned long)((uintptr_t)st->vinfo)); + if (ret < 0) + { + int errcode = errno; + fprintf(stderr, "ERROR: ioctl(FBIOGET_VIDEOINFO) failed: %d\n", + errcode); + exitcode = FBCON_EXIT_GETVINFO; + goto errout; + } + +#ifdef CONFIG_FB_OVERLAY + gerr("ERROR: noverlays: %u\n", st->vinfo->noverlays); + + /* Select the first overlay, which should be the composed framebuffer */ + + ret = ioctl(st->fd_fb, FBIO_SELECT_OVERLAY, 0); + if (ret < 0) + { + int errcode = errno; + gerr("ERROR: ioctl(FBIO_SELECT_OVERLAY) failed: %d\n", errcode); + ret = FBCON_EXIT_FBIO_SELECT_OVERLAY + goto errout; + } + + /* Get the first overlay information */ + + st->oinfo.overlay = 0; + ret = ioctl(st->fd_fb, FBIOGET_OVERLAYINFO, + (unsigned long)((uintptr_t)&st->oinfo)); + if (ret < 0) + { + int errcode = errno; + gerr("ERROR: ioctl(FBIOGET_OVERLAYINFO) failed: %d\n", errcode); + ret = FBCON_EXIT_FBIO_OVERLAY_INFO + goto errout; + } + + /* select default framebuffer layer */ + + ret = ioctl(st->fd_fb, FBIO_SELECT_OVERLAY, FB_NO_OVERLAY); + if (ret < 0) + { + int errcode = errno; + gerr("ERROR: ioctl(FBIO_SELECT_OVERLAY) failed: %d\n", errcode); + ret = FBCON_EXIT_FBIO_SELECT_OVERLAY + goto errout; + } + +#endif + + if ((ret = fbdev_get_pinfo(st->fd_fb, st->pinfo)) < 0) + { + ret = FBCON_EXIT_GETPINFO; + goto errout; + } + + /* mmap() the framebuffer. + * + * NOTE: In the FLAT build the frame buffer address returned by the + * FBIOGET_PLANEINFO IOCTL command will be the same as the framebuffer + * address. mmap(), however, is the preferred way to get the framebuffer + * address because in the KERNEL build, it will perform the necessary + * address mapping to make the memory accessible to the application. + */ + + st->fbmem = mmap(NULL, st->pinfo->fblen, PROT_READ | PROT_WRITE, + MAP_SHARED | MAP_FILE, st->fd_fb, 0); + if (st->fbmem == MAP_FAILED) + { + gerr("ERROR: ioctl(FBIOGET_PLANEINFO) failed: %d\n", errno); + ret = FBCON_EXIT_FBMEM; + goto errout; + } + +#if 0 + /* Revisit needed = no support for dual framebuffers yet */ + + if (st->pinfo->yres_virtual == (st->vinfo->yres * 2)) + { + if ((ret = fb_init_mem2(st)) < 0) + { + ret = FBCON_EXIT_FBMEM2; + goto errout; + } + } + +#endif + ret = fbcon_initialize(st); + if (ret != OK) + { + exitcode = ret; + goto errout; + } + + fbcon_home(st); + fbcon_showcursor(st); + + /* Pipe and duplicate STDOUT and/or STDERR */ + +#ifdef CONFIG_EXAMPLES_FBCON_PIPE_STDOUT + ret = pipe(g_nsh_stdout); + if (ret < 0) + { + _err("stdout pipe failed: %d\n", errno); + return ERROR; + } + + close(STDOUT_FILENO); + dup2(g_nsh_stdout[WRITE_PIPE], 1); +#endif +#ifdef CONFIG_EXAMPLES_FBCON_PIPE_STDERR + ret = pipe(g_nsh_stderr); + if (ret < 0) + { + _err("stderr pipe failed: %d\n", errno); + return ERROR; + } + + close(STDERR_FILENO); + dup2(g_nsh_stderr[WRITE_PIPE], 2); +#endif + + ret = posix_spawn_file_actions_init(&actions); + if (ret != 0) + { + gerr("ERROR: unable to init spawn sctiond for" + "requested task " "\"""%s""\"" ".\n", SPAWN_TASK); + exitcode = FBCON_EXIT_POSIX_SPAWN_ACTIONS_INIT_FAILED; + goto errout; + } + +#ifdef CONFIG_EXAMPLES_FBCON_PIPE_STDIN + /* Spawned app/task may need to intercept and forward STDIN + * otherwise any waiting input characters can be missed if read by the + * spawned app/task first. + */ + + ret = pipe(g_nsh_stdin); + if (ret < 0) + { + gerr("ERROR: stdin pipe failed: %d\n", errno); + exitcode = FBCON_EXIT_STDIN_PIPE_FAILED; + goto errout; + } + + posix_spawn_file_actions_addclose(&actions, STDIN_FILENO); + posix_spawn_file_actions_adddup2(&actions, g_nsh_stdin[READ_PIPE], + STDIN_FILENO); + +#endif /* CONFIG_EXAMPLES_FBCON_PIPE_STDIN */ + + index = builtin_isavail(SPAWN_TASK); + if (index < 0) + { + gerr("ERROR: requested task " "\"""%s""\"" " not available.\n", + SPAWN_TASK); + exitcode = FBCON_EXIT_APP_INDEX_UNAVAILABLE; + goto errout; + } + + builtin = builtin_for_index(index); + if (builtin == NULL) + { + gerr("ERROR: requested task " "\"""%s""\"" + " has no scheduling parameters.\n", SPAWN_TASK); + exitcode = FBCON_EXIT_APP_INDEX_UNAVAILABLE; + goto errout; + } + + /* Set up for app/task spawn */ + + ret = posix_spawnattr_init(&attr); + if (ret != 0) + { + gerr("ERROR: unable to init spawn attributes for" + "requested task " "\"""%s""\"" ".\n", SPAWN_TASK); + exitcode = FBCON_EXIT_APP_POSIX_ATTRIB_INIT_FAILED; + goto errout; + } + + attr.stacksize = builtin->stacksize; + attr.priority = builtin->priority; + + /* Spawn required application */ + + ret = posix_spawn(&pid, /* Returned Task ID */ + SPAWN_TASK, /* Task Path */ + &actions, /* Replace STDIN and/or STDOUT and/or STDIN */ + &attr, /* Attributes of app/task */ + NULL, /* Arguments */ + NULL); /* No environment */ + if (ret < 0) + { + int errcode = errno; + gerr("ERROR: posix_spawn failed: %d\n", errcode); + exitcode = FBCON_EXIT_POSIX_SPAWN_FAILED; + } + +#ifdef CONFIG_EXAMPLES_FBCON_SHOW_WELCOME +# ifdef CONFIG_EXAMPLES_FBCON_PIPE_STDOUT + fprintf(stdout, "%s\n", g_stdout_hello); + fflush(stdout); +# endif +# ifdef CONFIG_EXAMPLES_FBCON_PIPE_STDERR + fprintf(stderr, "%s\n", g_stderr_hello); + fflush(stderr); +# endif +#endif + + for (; ; ) + { + poll_std_streams(st); + usleep(10000); + } + +errout: + close(st->fd_fb); + fprintf(stderr, "FBCON exiting with error %d\n", exitcode); + return exitcode; +} + From 95c99d933a96c92f208493391a750eab4d64a3a2 Mon Sep 17 00:00:00 2001 From: simbit18 Date: Wed, 19 Mar 2025 16:12:15 +0100 Subject: [PATCH 216/391] build.yml: Brought into sync with NuttX repository added CI: Kill CI Test after 2 hours see https://github.com/apache/nuttx/pull/14849 job msvc Windows native see https://github.com/apache/nuttx/pull/13894 https://github.com/apache/nuttx/pull/15989 Signed-off-by: simbit18 --- .github/workflows/build.yml | 53 +++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7c96f1094f5..5061c11c6c5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -179,6 +179,7 @@ jobs: if [ "X${{matrix.boards}}" = "Xcodechecker" ]; then ./cibuild.sh -c -A -N -R --codechecker testlist/${{matrix.boards}}.dat else + ( sleep 7200 ; echo Killing pytest after timeout... ; pkill -f pytest )& ./cibuild.sh -c -A -N -R -S testlist/${{matrix.boards}}.dat fi @@ -330,3 +331,55 @@ jobs: name: msys2-${{matrix.boards}}-builds path: buildartifacts/ continue-on-error: true + + # Select the msvc Builds based on PR Arch Label + msvc-Arch: + uses: apache/nuttx-apps/.github/workflows/arch.yml@master + needs: Fetch-Source + with: + os: msvc + boards: | + ["msvc_placeholder_with_sim_keyword"] + + # Build with MSVC in Windows native + msvc: + needs: msvc-Arch + if: ${{ needs.msvc-Arch.outputs.skip_all_builds != '1' }} + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + # Set up Python environment and install kconfiglib + - name: Set up Python and install kconfiglib + uses: actions/setup-python@v5 + with: + python-version: '3.10' + - name: Install kconfiglib + run: | + pip install kconfiglib + + - run: git config --global core.autocrlf false + + - name: Download Source Artifact + uses: actions/download-artifact@v4 + with: + name: source-bundle + path: . + + - name: Extract sources + run: | + 7z x sources.tar.gz -y + 7z x sources.tar -y + + - name: Run Builds + run: | + "ARTIFACTDIR=${{github.workspace}}\sources\buildartifacts" >> $env:GITHUB_ENV + git config --global --add safe.directory ${{github.workspace}}\sources\nuttx + git config --global --add safe.directory ${{github.workspace}}\sources\apps + cd sources\nuttx\tools\ci + .\cibuild.ps1 -n -i -A -C -N testlist\windows.dat + + - uses: actions/upload-artifact@v4 + with: + name: msvc-builds + path: ./sources/buildartifacts/ + continue-on-error: true \ No newline at end of file From 1e4a952eea2b2a43f31365df55f64ca279a42703 Mon Sep 17 00:00:00 2001 From: Lup Yuen Lee Date: Fri, 21 Mar 2025 08:19:57 +0800 Subject: [PATCH 217/391] examples/fbcon: Fix endchoice and help in Kconfig This PR fixes the `endchoice` and `help` in the Kconfig for fbcon - https://github.com/apache/nuttx-apps/pull/3029#discussion_r2006527306 This patch will fix these build errors: ```text apps/examples/fbcon/Kconfig:62: syntax error apps/examples/fbcon/Kconfig:172: unknown option "---help--" ``` https://github.com/lupyuen/nuttx-riscv64/actions/runs/13981663903/job/39147989438#step:5:158 Signed-off-by: Lup Yuen Lee --- examples/fbcon/Kconfig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/fbcon/Kconfig b/examples/fbcon/Kconfig index eedf2213df4..0c0aac033e0 100644 --- a/examples/fbcon/Kconfig +++ b/examples/fbcon/Kconfig @@ -58,6 +58,8 @@ config EXAMPLES_FBCON_BPP_NX_DEFAULT config EXAMPLES_FBCON_CUSTOM_BPP bool "Choose custom BPP (must not be disabled in NX)" +endchoice # EXAMPLES_FBCON_BPP_SELECTION + choice EXAMPLES_FBCON_CUSTOM_BPP prompt "Custom Font pixel depth (BPP - Bits Per Pixel)" depends on EXAMPLES_FBCON_CUSTOM_BPP @@ -93,7 +95,6 @@ config EXAMPLES_FBCON_32BPP depends on !NX_DISABLE_32BPP endchoice # EXAMPLES_FBCON_CUSTOM_BPP -endchoice # EXAMPLES_FBCON_BPP_SELECTION comment "Console appearance" @@ -169,7 +170,7 @@ comment "FB Console App Escape code decoding" config EXAMPLES_FBCON_VT100_DECODE bool "Decode VT100 Escape Codes" default y - ---help-- + ---help--- Decode VT100 ESC codes - only minimal supporting functions comment "FB Console spawn task configuration" From bbcba55bbc357b3c5f651379f55b2917075e4df9 Mon Sep 17 00:00:00 2001 From: Tomasz 'CeDeROM' CEDRO Date: Mon, 17 Mar 2025 04:58:48 +0100 Subject: [PATCH 218/391] examples/xmlrpc: Fix calls buffers size. * examples/xmlrpc/calls.c used 80 bytes call buffers. * update buffers to CONFIG_XMLRPC_STRINGSIZE+1 that is build time configurable. * this keeps buffers size coherent with configuration. * updated internal variable names to pass lint checks. Signed-off-by: Tomasz 'CeDeROM' CEDRO --- examples/xmlrpc/calls.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/xmlrpc/calls.c b/examples/xmlrpc/calls.c index 41ac1a5fed3..c2d817a5c2d 100644 --- a/examples/xmlrpc/calls.c +++ b/examples/xmlrpc/calls.c @@ -70,10 +70,10 @@ struct xmlrpc_entry_s get_device_stats = static int calls_get_device_stats(struct xmlrpc_s *xmlcall) { - char username[80]; - char password[80]; - char lastCommand[80]; - char curState[80]; + char username[CONFIG_XMLRPC_STRINGSIZE + 1]; + char password[CONFIG_XMLRPC_STRINGSIZE + 1]; + char lastcmd[CONFIG_XMLRPC_STRINGSIZE + 1]; + char curstate[CONFIG_XMLRPC_STRINGSIZE + 1]; int request = 0; int status; int ret; @@ -105,13 +105,13 @@ static int calls_get_device_stats(struct xmlrpc_s *xmlcall) /* Dummy up some data... */ status = 1; - strlcpy(lastCommand, "reboot", sizeof(lastCommand)); - strlcpy(curState, "Normal Operation", sizeof(curState)); + strlcpy(lastcmd, "reboot", sizeof(lastcmd)); + strlcpy(curstate, "Normal Operation", sizeof(curstate)); ret = xmlrpc_buildresponse(xmlcall, "{iss}", "status", status, - "lastCommand", lastCommand, - "currentState", curState); + "lastCommand", lastcmd, + "currentState", curstate); } return ret; From 9e2775de98d1a2110c23fb2adb417199c41810ef Mon Sep 17 00:00:00 2001 From: raiden00pl Date: Wed, 19 Mar 2025 10:59:58 +0100 Subject: [PATCH 219/391] fix build for canutilis/lely-canopen This commit fixes lely-canopen build for make and cmake. It also update lely commit tag to the latest lely master. The required changes are now split into several patches to make it easier to fix any issues in the future. Signed-off-by: raiden00pl --- ...multiple-definitions-of-poll-compile.patch | 55 +++ ...0002-tools-coctl.c-fix-printf-issues.patch | 71 ++++ .../0003-src-co-nmt.c-fix-compilation.patch | 32 ++ ...tools-coctl.c-add-missing-mutex-init.patch | 25 ++ ...ort.patch => 0005-add-NuttX-support.patch} | 317 +++++++++--------- canutils/lely-canopen/CMakeLists.txt | 19 +- canutils/lely-canopen/Kconfig | 2 +- canutils/lely-canopen/Makefile | 13 +- 8 files changed, 375 insertions(+), 159 deletions(-) create mode 100644 canutils/lely-canopen/0001-tools-eliminate-multiple-definitions-of-poll-compile.patch create mode 100644 canutils/lely-canopen/0002-tools-coctl.c-fix-printf-issues.patch create mode 100644 canutils/lely-canopen/0003-src-co-nmt.c-fix-compilation.patch create mode 100644 canutils/lely-canopen/0004-tools-coctl.c-add-missing-mutex-init.patch rename canutils/lely-canopen/{0001-NuttX-port.patch => 0005-add-NuttX-support.patch} (65%) diff --git a/canutils/lely-canopen/0001-tools-eliminate-multiple-definitions-of-poll-compile.patch b/canutils/lely-canopen/0001-tools-eliminate-multiple-definitions-of-poll-compile.patch new file mode 100644 index 00000000000..bba46790b24 --- /dev/null +++ b/canutils/lely-canopen/0001-tools-eliminate-multiple-definitions-of-poll-compile.patch @@ -0,0 +1,55 @@ +From c907795a0856f1a0eb5a250fca7c2e02bbfdf28e Mon Sep 17 00:00:00 2001 +From: raiden00pl +Date: Thu, 6 Oct 2022 15:12:49 +0200 +Subject: [PATCH 1/5] tools: eliminate 'multiple definitions of poll' compiler + errors for flat address space systems + +Signed-off-by: raiden00pl +--- + tools/can2udp.c | 2 +- + tools/cocatd.c | 2 +- + tools/coctl.c | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/tools/can2udp.c b/tools/can2udp.c +index 960c6117..caee9176 100644 +--- a/tools/can2udp.c ++++ b/tools/can2udp.c +@@ -79,7 +79,7 @@ int wtm_send(co_wtm_t *wtm, const void *buf, size_t nbytes, void *data); + + int flags; + int keep = 10000; +-io_poll_t *poll; ++static io_poll_t *poll; + io_handle_t can_handle = IO_HANDLE_ERROR; + io_handle_t send_handle = IO_HANDLE_ERROR; + io_handle_t recv_handle = IO_HANDLE_ERROR; +diff --git a/tools/cocatd.c b/tools/cocatd.c +index 348168d5..ad191b74 100644 +--- a/tools/cocatd.c ++++ b/tools/cocatd.c +@@ -79,7 +79,7 @@ co_unsigned32_t co_1026_up_ind( + #define FLAG_NO_DAEMON 0x02 + + int flags; +-io_poll_t *poll; ++static io_poll_t *poll; + io_handle_t hcan = IO_HANDLE_ERROR; + can_net_t *net; + co_dev_t *dev; +diff --git a/tools/coctl.c b/tools/coctl.c +index 351b81c0..12f4b3aa 100644 +--- a/tools/coctl.c ++++ b/tools/coctl.c +@@ -90,7 +90,7 @@ int io_thrd_start(void *arg); + void co_net_err(struct co_net *net); + + struct co_net net[CO_GW_NUM_NET]; +-io_poll_t *poll; ++static io_poll_t *poll; + + int flags; + int inhibit = INHIBIT; +-- +2.48.1 + diff --git a/canutils/lely-canopen/0002-tools-coctl.c-fix-printf-issues.patch b/canutils/lely-canopen/0002-tools-coctl.c-fix-printf-issues.patch new file mode 100644 index 00000000000..e32745043dd --- /dev/null +++ b/canutils/lely-canopen/0002-tools-coctl.c-fix-printf-issues.patch @@ -0,0 +1,71 @@ +From fa0d7ef4f2ef9f1efff4f79bd69c1b59332ab3ba Mon Sep 17 00:00:00 2001 +From: raiden00pl +Date: Fri, 21 Mar 2025 16:10:50 +0100 +Subject: [PATCH 2/5] tools/coctl.c: fix printf issues + +Signed-off-by: raiden00pl +--- + tools/coctl.c | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +diff --git a/tools/coctl.c b/tools/coctl.c +index 12f4b3aa..594fe699 100644 +--- a/tools/coctl.c ++++ b/tools/coctl.c +@@ -40,6 +40,8 @@ + #include + #include + ++#include ++ + #if _WIN32 + #include + #endif +@@ -358,7 +360,7 @@ main(int argc, char *argv[]) + if (cmd) + printf("... "); + else +- printf("[%u] ", seq); ++ printf("[%" PRIu32 "] ", seq); + fflush(stdout); + } + // Keep reading lines until end-of-file. +@@ -409,7 +411,7 @@ main(int argc, char *argv[]) + free(cmd); + cmd = tmp; + } else { +- if (asprintf(&cmd, "[%u] %s", seq, line) ++ if (asprintf(&cmd, "[%" PRIu32 "] %s", seq, line) + == -1) { + cmd = NULL; + break; +@@ -431,7 +433,7 @@ main(int argc, char *argv[]) + result = asprintf(&tmp, "%s%s%s", + recv_buf, cmd, line); + else +- result = asprintf(&tmp, "%s[%u] %s", ++ result = asprintf(&recv_buf, "%s[%" PRIu32 "] %s", + recv_buf, seq, line); + if (result < 0) { + mtx_unlock(&recv_mtx); +@@ -444,7 +446,7 @@ main(int argc, char *argv[]) + result = asprintf(&recv_buf, "%s%s", + cmd, line); + else +- result = asprintf(&recv_buf, "[%u] %s", ++ result = asprintf(&recv_buf, "[%" PRIu32 "] %s", + seq, line); + if (result < 0) { + recv_buf = NULL; +@@ -561,7 +563,7 @@ gw_rate(co_unsigned16_t id, co_unsigned16_t rate, void *data) + return; + bitrate = rate * 1000; + if (io_can_set_bitrate(net[id - 1].handle, bitrate) == -1) +- diag(DIAG_ERROR, 0, "unable to set bitrate of %s to %u bit/s", ++ diag(DIAG_ERROR, 0, "unable to set bitrate of %s to %" PRIu32 " bit/s", + net[id - 1].can_path, bitrate); + } + +-- +2.48.1 + diff --git a/canutils/lely-canopen/0003-src-co-nmt.c-fix-compilation.patch b/canutils/lely-canopen/0003-src-co-nmt.c-fix-compilation.patch new file mode 100644 index 00000000000..fbe8566e34f --- /dev/null +++ b/canutils/lely-canopen/0003-src-co-nmt.c-fix-compilation.patch @@ -0,0 +1,32 @@ +From ba671d68bde31fc8e4cd893b3634fa6bbd299784 Mon Sep 17 00:00:00 2001 +From: raiden00pl +Date: Wed, 19 Mar 2025 11:18:13 +0100 +Subject: [PATCH 3/5] src/co/nmt.c: fix compilation + +Signed-off-by: raiden00pl +--- + src/co/nmt.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/co/nmt.c b/src/co/nmt.c +index fa943fba..4074e238 100644 +--- a/src/co/nmt.c ++++ b/src/co/nmt.c +@@ -1432,12 +1432,14 @@ co_nmt_on_hb(co_nmt_t *nmt, co_unsigned8_t id, int state, int reason) + if (co_nmt_is_master(nmt)) + return; + #endif ++#if !LELY_NO_CO_EMCY + if (nmt->srv.emcy) { + // Remove the EMCY message from the stack. + ssize_t n = co_emcy_find(nmt->srv.emcy, 0x8130); + if (n >= 0) + co_emcy_remove(nmt->srv.emcy, n); + } ++#endif + } + } + +-- +2.48.1 + diff --git a/canutils/lely-canopen/0004-tools-coctl.c-add-missing-mutex-init.patch b/canutils/lely-canopen/0004-tools-coctl.c-add-missing-mutex-init.patch new file mode 100644 index 00000000000..3d06bcb939b --- /dev/null +++ b/canutils/lely-canopen/0004-tools-coctl.c-add-missing-mutex-init.patch @@ -0,0 +1,25 @@ +From 8d361b53e8a1f238a0b1545d237e4b0e29fba1fe Mon Sep 17 00:00:00 2001 +From: raiden00pl +Date: Thu, 20 Mar 2025 13:58:17 +0100 +Subject: [PATCH 4/5] tools/coctl.c: add missing mutex init + +Signed-off-by: raiden00pl +--- + tools/coctl.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/tools/coctl.c b/tools/coctl.c +index 594fe699..c1d73b21 100644 +--- a/tools/coctl.c ++++ b/tools/coctl.c +@@ -287,6 +287,7 @@ main(int argc, char *argv[]) + co_gw_txt_set_recv_func(gw_txt, &gw_txt_recv, NULL); + co_gw_txt_set_send_func(gw_txt, &gw_txt_send, gw); + ++ mtx_init(&wait_mtx, mtx_plain); + mtx_init(&recv_mtx, mtx_plain); + cnd_init(&wait_cond); + wait = 0; +-- +2.48.1 + diff --git a/canutils/lely-canopen/0001-NuttX-port.patch b/canutils/lely-canopen/0005-add-NuttX-support.patch similarity index 65% rename from canutils/lely-canopen/0001-NuttX-port.patch rename to canutils/lely-canopen/0005-add-NuttX-support.patch index 8216053e82f..11b6198f5db 100644 --- a/canutils/lely-canopen/0001-NuttX-port.patch +++ b/canutils/lely-canopen/0005-add-NuttX-support.patch @@ -1,55 +1,23 @@ -From 2232cb2e64241fd56293a6bcc51365dd220bdd5d Mon Sep 17 00:00:00 2001 +From 3c58cd579a24a1b3ae829173c3fb124b08bb42d4 Mon Sep 17 00:00:00 2001 From: raiden00pl -Date: Thu, 6 Oct 2022 15:12:49 +0200 -Subject: [PATCH] NuttX port tools/coctl.c: eliminate multiple definitions of - poll error for flat address space systems +Date: Wed, 19 Mar 2025 10:44:47 +0100 +Subject: [PATCH 5/5] add NuttX support - tools/coctl.c: use readline instead of getline - - tools/coctl.c: fix printf warnings - - fix compiler warnings related to 'struct __frbuf' - - warning: 'struct __frbuf' declared inside parameter list will not be visible outside of this definition or declaration - warning: 'struct __fwbuf' declared inside parameter list will not be visible outside of this definition or declaration - - src/io/poll.c: NuttX support - - src/util/frbuf.c: NuttX support - - src/util/fwbuf.c: NuttX support - - src/can/socket.c: NuttX support - - src/io/can.c: add support for NuttX +Signed-off-by: raiden00pl --- - include/lely/co/val.h | 2 +- - src/can/socket.c | 7 +++- - src/io/can.c | 93 ++++++++++++++++++++++++++++++++++++++++++- - src/io/poll.c | 2 +- - src/util/frbuf.c | 18 ++++----- - src/util/fwbuf.c | 27 +++++++------ - tools/coctl.c | 22 +++++----- - 7 files changed, 134 insertions(+), 37 deletions(-) + src/can/socket.c | 6 ++- + src/io/can.c | 95 ++++++++++++++++++++++++++++++++++++++++++++++- + src/io/poll.c | 2 +- + src/util/errnum.c | 11 +++--- + src/util/frbuf.c | 24 ++++++------ + src/util/fwbuf.c | 37 +++++++++--------- + 6 files changed, 136 insertions(+), 39 deletions(-) -diff --git a/include/lely/co/val.h b/include/lely/co/val.h -index 2629763d..b5cee564 100644 ---- a/include/lely/co/val.h -+++ b/include/lely/co/val.h -@@ -28,7 +28,7 @@ - #include - #include - --#if !LELY_NO_CO_DCF || !LELY_NO_CO_OBJ_FILE -+#if !LELY_NO_STDIO - // The read file buffer from - struct __frbuf; - // The write file buffer from diff --git a/src/can/socket.c b/src/can/socket.c -index 4fc133dd..b059c849 100644 +index 4fc133dd..a35b281e 100644 --- a/src/can/socket.c +++ b/src/can/socket.c -@@ -39,6 +39,11 @@ +@@ -39,6 +39,10 @@ #include #endif @@ -60,7 +28,7 @@ index 4fc133dd..b059c849 100644 int can_frame_is_error(const struct can_frame *frame, enum can_state *pstate, enum can_error *perror) -@@ -51,7 +56,7 @@ can_frame_is_error(const struct can_frame *frame, enum can_state *pstate, +@@ -51,7 +55,7 @@ can_frame_is_error(const struct can_frame *frame, enum can_state *pstate, enum can_state state = pstate ? *pstate : CAN_STATE_ACTIVE; enum can_error error = perror ? *perror : 0; @@ -70,7 +38,7 @@ index 4fc133dd..b059c849 100644 set_errnum(ERRNUM_INVAL); return -1; diff --git a/src/io/can.c b/src/io/can.c -index ca7e7d95..35d9a9f2 100644 +index ca7e7d95..fed1ae16 100644 --- a/src/io/can.c +++ b/src/io/can.c @@ -26,7 +26,7 @@ @@ -91,7 +59,7 @@ index ca7e7d95..35d9a9f2 100644 #ifdef HAVE_LINUX_CAN_ERROR_H #include -@@ -56,6 +56,13 @@ +@@ -56,6 +56,12 @@ #include #endif @@ -104,7 +72,16 @@ index ca7e7d95..35d9a9f2 100644 /// A CAN device. struct can { /// The I/O device base handle. -@@ -656,6 +663,88 @@ io_can_set_txqlen(io_handle_t handle, size_t txqlen) +@@ -384,6 +390,8 @@ io_can_stop(io_handle_t handle) + + #endif // HAVE_LINUX_CAN_NETLINK_H && HAVE_LINUX_RTNETLINK_H + ++ ++ + int + io_can_get_state(io_handle_t handle) + { +@@ -656,6 +664,89 @@ io_can_set_txqlen(io_handle_t handle, size_t txqlen) #endif // HAVE_LINUX_CAN_NETLINK_H && HAVE_LINUX_RTNETLINK_H @@ -189,6 +166,7 @@ index ca7e7d95..35d9a9f2 100644 +} + +#endif // __NuttX__ ++ + static void can_fini(struct io_handle *handle) @@ -206,10 +184,76 @@ index d474e337..e07b36ce 100644 case IO_TYPE_CAN: #endif #if _POSIX_C_SOURCE >= 200112L +diff --git a/src/util/errnum.c b/src/util/errnum.c +index 39e4b28a..3b295b8e 100644 +--- a/src/util/errnum.c ++++ b/src/util/errnum.c +@@ -27,6 +27,7 @@ + #include + + #include ++#include + + #if _WIN32 + +@@ -38,7 +39,7 @@ + + #endif // _WIN32 + +-#if _POSIX_C_SOURCE >= 200112L && !defined(__NEWLIB__) ++#if _POSIX_C_SOURCE >= 200112L && !defined(__NEWLIB__) && !defined(__NuttX__) + static const char *gai_strerror_r(int ecode, char *strerrbuf, size_t buflen); + #endif + +@@ -545,7 +546,7 @@ errc2num(int errc) + default: return 0; + } + #else +-#if _POSIX_C_SOURCE >= 200112L && !defined(__NEWLIB__) ++#if _POSIX_C_SOURCE >= 200112L && !defined(__NEWLIB__) && !defined(__NuttX__) + switch (errc) { + case -ABS(EAI_AGAIN): return ERRNUM_AI_AGAIN; + case -ABS(EAI_BADFLAGS): return ERRNUM_AI_BADFLAGS; +@@ -910,7 +911,7 @@ errnum2c(errnum_t errnum) + default: return 0; + } + #else +-#if _POSIX_C_SOURCE >= 200112L && !defined(__NEWLIB__) ++#if _POSIX_C_SOURCE >= 200112L && !defined(__NEWLIB__) && !defined(__NuttX__) + switch (errnum) { + case ERRNUM_AI_AGAIN: return -ABS(EAI_AGAIN); + case ERRNUM_AI_BADFLAGS: return -ABS(EAI_BADFLAGS); +@@ -1011,7 +1012,7 @@ errc2str_r(int errc, char *strerrbuf, size_t buflen) + strerrbuf[n - 2] = '\0'; + return strerrbuf; + #else +-#if _POSIX_C_SOURCE >= 200112L && !defined(__NEWLIB__) ++#if _POSIX_C_SOURCE >= 200112L && !defined(__NEWLIB__) && !defined(__NuttX__) + switch (errc) { + case -ABS(EAI_AGAIN): + return gai_strerror_r(EAI_AGAIN, strerrbuf, buflen); +@@ -1036,7 +1037,7 @@ errc2str_r(int errc, char *strerrbuf, size_t buflen) + #endif + } + +-#if _POSIX_C_SOURCE >= 200112L && !defined(__NEWLIB__) ++#if _POSIX_C_SOURCE >= 200112L && !defined(__NEWLIB__) && !defined(__NuttX__) + static const char * + gai_strerror_r(int ecode, char *strerrbuf, size_t buflen) + { diff --git a/src/util/frbuf.c b/src/util/frbuf.c -index 73a15bc8..403901a5 100644 +index e01b7677..7157129b 100644 --- a/src/util/frbuf.c +++ b/src/util/frbuf.c +@@ -41,7 +41,7 @@ + #include + #if _POSIX_C_SOURCE >= 200112L + #include +-#if _POSIX_MAPPED_FILES >= 200112L ++#if _POSIX_MAPPED_FILES >= 200112L && !defined(__NuttX__) + #include + #endif + #include @@ -57,7 +57,7 @@ struct __frbuf { HANDLE hFileMappingObject; /// The base address of the file mapping. @@ -224,7 +268,7 @@ index 73a15bc8..403901a5 100644 __frbuf_alloc(void) { - void *ptr = malloc(sizeof(struct __frbuf)); -+ void *ptr = zalloc(sizeof(struct __frbuf)); ++ void *ptr = zalloc(sizeof(struct __frbuf)); if (!ptr) set_errc(errno2c(errno)); return ptr; @@ -237,7 +281,7 @@ index 73a15bc8..403901a5 100644 buf->fd = open(filename, O_RDONLY | O_CLOEXEC); if (buf->fd == -1) return NULL; -@@ -125,7 +125,7 @@ __frbuf_fini(struct __frbuf *buf) +@@ -127,7 +127,7 @@ __frbuf_fini(struct __frbuf *buf) #if _WIN32 CloseHandle(buf->hFile); @@ -246,7 +290,7 @@ index 73a15bc8..403901a5 100644 close(buf->fd); #else fclose(buf->stream); -@@ -176,7 +176,7 @@ frbuf_get_size(frbuf_t *buf) +@@ -178,7 +178,7 @@ frbuf_get_size(frbuf_t *buf) if (!GetFileSizeEx(buf->hFile, &FileSize)) return -1; return FileSize.QuadPart; @@ -255,7 +299,7 @@ index 73a15bc8..403901a5 100644 #ifdef __linux__ struct stat64 stat; if (fstat64(buf->fd, &stat) == -1) -@@ -221,7 +221,7 @@ frbuf_get_pos(frbuf_t *buf) +@@ -223,7 +223,7 @@ frbuf_get_pos(frbuf_t *buf) if (!SetFilePointerEx(buf->hFile, li, &li, FILE_CURRENT)) return -1; return li.QuadPart; @@ -264,7 +308,7 @@ index 73a15bc8..403901a5 100644 #ifdef __linux__ return lseek64(buf->fd, 0, SEEK_CUR); #else -@@ -250,7 +250,7 @@ frbuf_set_pos(frbuf_t *buf, intmax_t pos) +@@ -252,7 +252,7 @@ frbuf_set_pos(frbuf_t *buf, intmax_t pos) if (!SetFilePointerEx(buf->hFile, li, &li, FILE_BEGIN)) return -1; return li.QuadPart; @@ -273,7 +317,7 @@ index 73a15bc8..403901a5 100644 #ifdef __linux__ return lseek64(buf->fd, pos, SEEK_SET); #else -@@ -283,7 +283,7 @@ frbuf_read(frbuf_t *buf, void *ptr, size_t size) +@@ -285,7 +285,7 @@ frbuf_read(frbuf_t *buf, void *ptr, size_t size) if (!ReadFile(buf->hFile, ptr, size, &nNumberOfBytesRead, NULL)) return -1; return nNumberOfBytesRead; @@ -282,7 +326,7 @@ index 73a15bc8..403901a5 100644 ssize_t result; do result = read(buf->fd, ptr, size); -@@ -347,7 +347,7 @@ error_ReadFile: +@@ -349,7 +349,7 @@ error_ReadFile: error_get_pos: SetLastError(dwErrCode); return result; @@ -291,10 +335,37 @@ index 73a15bc8..403901a5 100644 ssize_t result; #ifdef __linux__ do +@@ -453,7 +453,7 @@ error_CreateFileMapping: + error_size: + SetLastError(dwErrCode); + return NULL; +-#elif _POSIX_MAPPED_FILES >= 200112L ++#elif _POSIX_MAPPED_FILES >= 200112L && !defined(__NuttX__) + long page_size = sysconf(_SC_PAGE_SIZE); + if (page_size <= 0) + return NULL; +@@ -532,7 +532,7 @@ frbuf_unmap(frbuf_t *buf) + buf->hFileMappingObject = INVALID_HANDLE_VALUE; + buf->lpBaseAddress = NULL; + } +-#elif _POSIX_MAPPED_FILES >= 200112L ++#elif _POSIX_MAPPED_FILES >= 200112L && !defined(__NuttX__) + if (buf->addr != MAP_FAILED) { + result = munmap(buf->addr, buf->len); + diff --git a/src/util/fwbuf.c b/src/util/fwbuf.c -index 22c61fd7..26b7e03b 100644 +index 22c61fd7..33ba11c7 100644 --- a/src/util/fwbuf.c +++ b/src/util/fwbuf.c +@@ -48,7 +48,7 @@ + #if _POSIX_C_SOURCE >= 200112L + #include + #include +-#if _POSIX_MAPPED_FILES >= 200112L ++#if _POSIX_MAPPED_FILES >= 200112L && !defined(__NuttX__) + #include + #endif + #include @@ -72,7 +72,7 @@ struct __fwbuf { LPVOID lpBaseAddress; /// The number of bytes mapped at lpBaseAddress. @@ -377,6 +448,42 @@ index 22c61fd7..26b7e03b 100644 ssize_t result; #ifdef __linux__ do +@@ -666,7 +667,7 @@ fwbuf_map(fwbuf_t *buf, intmax_t pos, size_t *psize) + if (pos < 0) { + #if _WIN32 + SetLastError(buf->dwErrCode = ERROR_INVALID_PARAMETER); +-#elif _POSIX_MAPPED_FILES >= 200112L ++#elif _POSIX_MAPPED_FILES >= 200112L && !defined(__NuttX__) + errno = buf->errsv = EINVAL; + #else + set_errnum(buf->errnum = ERRNUM_INVAL); +@@ -676,7 +677,7 @@ fwbuf_map(fwbuf_t *buf, intmax_t pos, size_t *psize) + if (pos > (intmax_t)size) { + #if _WIN32 + SetLastError(buf->dwErrCode = ERROR_INVALID_PARAMETER); +-#elif _POSIX_MAPPED_FILES >= 200112L ++#elif _POSIX_MAPPED_FILES >= 200112L && !defined(__NuttX__) + errno = buf->errsv = EOVERFLOW; + #else + set_errnum(buf->errnum = ERRNUM_OVERFLOW); +@@ -728,7 +729,7 @@ error_CreateFileMapping: + error_size: + SetLastError(buf->dwErrCode); + return NULL; +-#elif _POSIX_MAPPED_FILES >= 200112L ++#elif _POSIX_MAPPED_FILES >= 200112L && !defined(__NuttX__) + long page_size = sysconf(_SC_PAGE_SIZE); + if (page_size <= 0) { + buf->errsv = errno; +@@ -863,7 +864,7 @@ fwbuf_unmap(fwbuf_t *buf) + buf->dwErrCode = dwErrCode; + SetLastError(dwErrCode); + } +-#elif _POSIX_MAPPED_FILES >= 200112L ++#elif _POSIX_MAPPED_FILES >= 200112L && !defined(__NuttX__) + int errsv = 0; + if (buf->errsv) { + result = -1; @@ -931,7 +932,7 @@ fwbuf_clearerr(fwbuf_t *buf) #if _WIN32 @@ -413,98 +520,6 @@ index 22c61fd7..26b7e03b 100644 int errsv = errno; if (buf->fd == -1) -diff --git a/tools/coctl.c b/tools/coctl.c -index 351b81c0..5f851b50 100644 ---- a/tools/coctl.c -+++ b/tools/coctl.c -@@ -39,6 +39,9 @@ - #include - #include - #include -+#include -+ -+#include - - #if _WIN32 - #include -@@ -90,7 +93,7 @@ int io_thrd_start(void *arg); - void co_net_err(struct co_net *net); - - struct co_net net[CO_GW_NUM_NET]; --io_poll_t *poll; -+static io_poll_t *poll; - - int flags; - int inhibit = INHIBIT; -@@ -315,8 +318,8 @@ main(int argc, char *argv[]) - errno = errsv; - int eof = 0; - -- char *line = NULL; -- size_t n = 0; -+#define LINE_SIZE 100 -+ char line[LINE_SIZE]; - co_unsigned32_t seq = 1; - char *cmd = NULL; - while (!done) { -@@ -358,11 +361,11 @@ main(int argc, char *argv[]) - if (cmd) - printf("... "); - else -- printf("[%u] ", seq); -+ printf("[%" PRIu32 "] ", seq); - fflush(stdout); - } - // Keep reading lines until end-of-file. -- if (getline(&line, &n, stdin) == -1) { -+ if (readline(line, LINE_SIZE-1, stdin, stdout) == -1) { - if (tty) - fputc('\n', stdout); - if (ferror(stdin)) { -@@ -409,7 +412,7 @@ main(int argc, char *argv[]) - free(cmd); - cmd = tmp; - } else { -- if (asprintf(&cmd, "[%u] %s", seq, line) -+ if (asprintf(&cmd, "[%" PRIu32 "] %s", seq, line) - == -1) { - cmd = NULL; - break; -@@ -431,7 +434,7 @@ main(int argc, char *argv[]) - result = asprintf(&tmp, "%s%s%s", - recv_buf, cmd, line); - else -- result = asprintf(&tmp, "%s[%u] %s", -+ result = asprintf(&tmp, "%s[%" PRIu32 "] %s", - recv_buf, seq, line); - if (result < 0) { - mtx_unlock(&recv_mtx); -@@ -444,7 +447,7 @@ main(int argc, char *argv[]) - result = asprintf(&recv_buf, "%s%s", - cmd, line); - else -- result = asprintf(&recv_buf, "[%u] %s", -+ result = asprintf(&recv_buf, "[%" PRIu32 "] %s", - seq, line); - if (result < 0) { - recv_buf = NULL; -@@ -466,7 +469,6 @@ main(int argc, char *argv[]) - } - } - free(cmd); -- free(line); - - io_poll_signal(poll, 1); - thrd_join(thr, NULL); -@@ -561,7 +563,7 @@ gw_rate(co_unsigned16_t id, co_unsigned16_t rate, void *data) - return; - bitrate = rate * 1000; - if (io_can_set_bitrate(net[id - 1].handle, bitrate) == -1) -- diag(DIAG_ERROR, 0, "unable to set bitrate of %s to %u bit/s", -+ diag(DIAG_ERROR, 0, "unable to set bitrate of %s to %" PRIu32 " bit/s", - net[id - 1].can_path, bitrate); - } - -- -2.37.2 +2.48.1 diff --git a/canutils/lely-canopen/CMakeLists.txt b/canutils/lely-canopen/CMakeLists.txt index 1211500d7aa..8331511b19f 100644 --- a/canutils/lely-canopen/CMakeLists.txt +++ b/canutils/lely-canopen/CMakeLists.txt @@ -26,18 +26,27 @@ if(CONFIG_CANUTILS_LELYCANOPEN) # Config and Fetch lelycanopen lib # ############################################################################ - set(LELYCANOPEN_DIR ${CMAKE_CURRENT_LIST_DIR}/lely-canopen) + set(LELYCANOPEN_DIR ${CMAKE_CURRENT_LIST_DIR}/lely-core) if(NOT EXISTS ${LELYCANOPEN_DIR}) FetchContent_Declare( lelycanopen_fetch URL ${CONFIG_CANUTILS_LELYCANOPEN_URL}/lely-core-${CONFIG_CANUTILS_LELYCANOPEN_VERSION}.tar.gz SOURCE_DIR - ${CMAKE_CURRENT_LIST_DIR}/lely-canopen + ${CMAKE_CURRENT_LIST_DIR}/lely-core BINARY_DIR - ${CMAKE_BINARY_DIR}/apps/canutils/lely-canopen/lely-canopen - PATCH_COMMAND patch -p1 -d ${CMAKE_CURRENT_LIST_DIR}/lely-canopen < - ${CMAKE_CURRENT_LIST_DIR}/0001-NuttX-port.patch + ${CMAKE_BINARY_DIR}/apps/canutils/lely-canopen/lely-core + PATCH_COMMAND + patch -p1 -d ${CMAKE_CURRENT_LIST_DIR}/lely-core < + ${CMAKE_CURRENT_LIST_DIR}/0001-tools-eliminate-multiple-definitions-of-poll-compile.patch + && patch -p1 -d ${CMAKE_CURRENT_LIST_DIR}/lely-core < + ${CMAKE_CURRENT_LIST_DIR}/0002-tools-coctl.c-fix-printf-issues.patch && + patch -p1 -d ${CMAKE_CURRENT_LIST_DIR}/lely-core < + ${CMAKE_CURRENT_LIST_DIR}/0003-src-co-nmt.c-fix-compilation.patch && + patch -p1 -d ${CMAKE_CURRENT_LIST_DIR}/lely-core < + ${CMAKE_CURRENT_LIST_DIR}/0004-tools-coctl.c-add-missing-mutex-init.patch + && patch -p1 -d ${CMAKE_CURRENT_LIST_DIR}/lely-core < + ${CMAKE_CURRENT_LIST_DIR}/0005-add-NuttX-support.patch DOWNLOAD_NO_PROGRESS true TIMEOUT 30) diff --git a/canutils/lely-canopen/Kconfig b/canutils/lely-canopen/Kconfig index 8dd2acca16c..5718356e60c 100644 --- a/canutils/lely-canopen/Kconfig +++ b/canutils/lely-canopen/Kconfig @@ -12,7 +12,7 @@ config CANUTILS_LELYCANOPEN_URL config CANUTILS_LELYCANOPEN_VERSION string "Version number" - default "a2ecf70b76a42c25c5338d86e85250bf16fd7023" + default "637de61625c9e8af2b9598109d6fb0e3a2829ce6" menu "Lely CANopen configuration" diff --git a/canutils/lely-canopen/Makefile b/canutils/lely-canopen/Makefile index 1985016c471..ca124b8336c 100644 --- a/canutils/lely-canopen/Makefile +++ b/canutils/lely-canopen/Makefile @@ -178,14 +178,23 @@ $(LELYCANOPEN_TARBALL): $(LELYCANOPEN_SRCNAME): $(LELYCANOPEN_TARBALL) @echo "Unpacking: $(LELYCANOPEN_TARBALL) -> $(LELYCANOPEN_UNPACKNAME)" $(Q) $(UNPACK) $(LELYCANOPEN_TARBALL) + +patch_src: $(LELYCANOPEN_SRCNAME) # Get the name of the directory created by the tar command $(eval LELYCANOPEN_UNPACKNAME := $(shell ls -d lely-core-master*)) $(Q) mv $(LELYCANOPEN_UNPACKNAME) $(LELYCANOPEN_SRCNAME) - $(Q) cat 0001-NuttX-port.patch | patch -s -N -d $(LELYCANOPEN_SRCNAME) -p1 + $(Q) cat 0001-tools-eliminate-multiple-definitions-of-poll-compile.patch | patch -s -N -d $(LELYCANOPEN_SRCNAME) -p1 + $(Q) cat 0002-tools-coctl.c-fix-printf-issues.patch | patch -s -N -d $(LELYCANOPEN_SRCNAME) -p1 + $(Q) cat 0003-src-co-nmt.c-fix-compilation.patch | patch -s -N -d $(LELYCANOPEN_SRCNAME) -p1 + $(Q) cat 0004-tools-coctl.c-add-missing-mutex-init.patch | patch -s -N -d $(LELYCANOPEN_SRCNAME) -p1 + $(Q) cat 0005-add-NuttX-support.patch | patch -s -N -d $(LELYCANOPEN_SRCNAME) -p1 $(Q) echo "Patching $(LELYCANOPEN_SRCNAME)" -endif +context:: patch_src +else context:: $(LELYCANOPEN_SRCNAME) +endif + distclean:: ifeq ($(wildcard $(LELYCANOPEN_SRCNAME)/.git),) From e336ebad5e4da1cfd9d99ac04bccaf15cc09249f Mon Sep 17 00:00:00 2001 From: raiden00pl Date: Fri, 14 Mar 2025 14:08:56 +0100 Subject: [PATCH 220/391] cmake: fix cmake build for FreeModBus fix cmake build for FreeModBus: 1. nuttx-apps/modbus/mb.c:50:12: fatal error: mbrtu.h: No such file or directory 50 | # include "mbrtu.h" 2. nuttx-apps/modbus/functions/mbutils.c:41:10: fatal error: port.h: No such file or directory 41 | #include "port.h" 3. various "undefined reference to" errors Signed-off-by: raiden00pl --- modbus/CMakeLists.txt | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/modbus/CMakeLists.txt b/modbus/CMakeLists.txt index ca4f56b5eaf..edba762df58 100644 --- a/modbus/CMakeLists.txt +++ b/modbus/CMakeLists.txt @@ -75,22 +75,27 @@ if(CONFIG_MODBUS) # rtu/Make.defs if(CONFIG_MB_RTU_ENABLED OR CONFIG_MB_RTU_MASTER) - list(APPEND rtu/mbcrc.c) + list(APPEND CSRCS rtu/mbcrc.c) if(CONFIG_MB_RTU_ENABLED) - list(APPEND rtu/mbrtu.c) + list(APPEND CSRCS rtu/mbrtu.c) endif() if(CONFIG_MB_RTU_MASTER) - list(APPEND rtu/mbrtu_m.c) + list(APPEND CSRCS rtu/mbrtu_m.c) endif() endif() # tcp/Make.defs if(CONFIG_MB_TCP_ENABLED) - list(APPEND tcp/mbtcp.c) + list(APPEND CSRCS tcp/mbtcp.c) endif() + # include private headers + + target_include_directories(apps PRIVATE nuttx) + target_include_directories(apps PRIVATE rtu) + target_sources(apps PRIVATE ${CSRCS}) endif() From cc3392452a624d3e8fa5aa9dd64b4d853f48d3f5 Mon Sep 17 00:00:00 2001 From: Roy Feng Date: Wed, 5 Mar 2025 15:04:07 +0800 Subject: [PATCH 221/391] nshlib: typo fixed in Kconfig `NSH_DISABLE_NFSMOUNT` should be `NSH_DISABLE_NFSMOUNT` Signed-off-by: Roy Feng --- nshlib/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nshlib/Kconfig b/nshlib/Kconfig index 77533466e6e..86863ff99e9 100644 --- a/nshlib/Kconfig +++ b/nshlib/Kconfig @@ -506,7 +506,7 @@ config NSH_DISABLE_MW bool "Disable mw" default y -config NSH_DISABLE_NSFMOUNT +config NSH_DISABLE_NFSMOUNT bool "Disable nfsmount" default DEFAULT_SMALL depends on NFS From 99d2de65405b7d2a7fcdd3d5091a91b2428eab94 Mon Sep 17 00:00:00 2001 From: Huang Qi Date: Wed, 5 Mar 2025 19:57:11 +0800 Subject: [PATCH 222/391] tools: Export NUTTX_INCLUDE_DIR for Rust builds Set NUTTX_INCLUDE_DIR in the Rust build commands to include the necessary directories for proper compilation. * Ensured correct include paths for Rust projects * Improved build reliability for Rust components Signed-off-by: Huang Qi --- cmake/nuttx_add_rust.cmake | 2 ++ tools/Rust.mk | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cmake/nuttx_add_rust.cmake b/cmake/nuttx_add_rust.cmake index 742bc3be5dc..97ecdcec73a 100644 --- a/cmake/nuttx_add_rust.cmake +++ b/cmake/nuttx_add_rust.cmake @@ -150,6 +150,8 @@ function(nuttx_add_rust) add_custom_command( OUTPUT ${RUST_LIB_PATH} COMMAND + ${CMAKE_COMMAND} -E env + NUTTX_INCLUDE_DIR=${PROJECT_SOURCE_DIR}/include:${CMAKE_BINARY_DIR}/include:${CMAKE_BINARY_DIR}/include/arch cargo build --${RUST_PROFILE} -Zbuild-std=std,panic_abort ${RUST_DEBUG_FLAGS} --manifest-path ${CRATE_PATH}/Cargo.toml --target ${RUST_TARGET} --target-dir ${RUST_BUILD_DIR} diff --git a/tools/Rust.mk b/tools/Rust.mk index 337d323ddf0..9a77ae57bbd 100644 --- a/tools/Rust.mk +++ b/tools/Rust.mk @@ -89,7 +89,8 @@ endef ifeq ($(CONFIG_DEBUG_FULLOPT),y) define RUST_CARGO_BUILD - cargo build --release -Zbuild-std=std,panic_abort \ + NUTTX_INCLUDE_DIR=$(TOPDIR)/include:$(TOPDIR)/include/arch \ + cargo build --release -Zbuild-std=std,panic_abort \ -Zbuild-std-features=panic_immediate_abort \ --manifest-path $(2)/$(1)/Cargo.toml \ --target $(call RUST_TARGET_TRIPLE) @@ -97,7 +98,8 @@ endef else define RUST_CARGO_BUILD @echo "Building Rust code with cargo..." - cargo build -Zbuild-std=std,panic_abort \ + NUTTX_INCLUDE_DIR=$(TOPDIR)/include:$(TOPDIR)/include/arch \ + cargo build -Zbuild-std=std,panic_abort \ --manifest-path $(2)/$(1)/Cargo.toml \ --target $(call RUST_TARGET_TRIPLE) endef From a8c62307ecb915fb346c799e7427513f44c1cca1 Mon Sep 17 00:00:00 2001 From: Huang Qi Date: Wed, 5 Mar 2025 22:15:35 +0800 Subject: [PATCH 223/391] examples/rust/slint: Update nuttx crate branch from master to main and fix pixel format check. Changed the NUTTX dependency branch to 'main' for consistency with repository updates. Updated pixel format check to use FB_FMT_RGB16_565 for better clarity and accuracy. Signed-off-by: Huang Qi --- examples/rust/slint/Cargo.toml | 2 +- examples/rust/slint/src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/rust/slint/Cargo.toml b/examples/rust/slint/Cargo.toml index 4600f2220b2..af585ceb15d 100644 --- a/examples/rust/slint/Cargo.toml +++ b/examples/rust/slint/Cargo.toml @@ -18,7 +18,7 @@ opt-level = 'z' [dependencies] libc = "0.2" slint = { version = "1.9", default-features = false, features = ["compat-1-2", "renderer-software", "libm", "unsafe-single-threaded"] } -nuttx = { git = "https://github.com/no1wudi/nuttx-rs.git", branch = "master" } +nuttx = { git = "https://github.com/no1wudi/nuttx-rs.git", branch = "main" } [build-dependencies] slint-build = { version = "1.9" } diff --git a/examples/rust/slint/src/lib.rs b/examples/rust/slint/src/lib.rs index 043274cbc64..7f81ce29cd3 100644 --- a/examples/rust/slint/src/lib.rs +++ b/examples/rust/slint/src/lib.rs @@ -94,7 +94,7 @@ pub extern "C" fn slint_main() { println!("{:?}", planeinfo); println!("{:?}", videoinfo); - if videoinfo.fmt != Format::RGB565 as u8 { + if videoinfo.fmt != FB_FMT_RGB16_565 as u8 { println!("Unsupported pixel format, only RGB565 is supported for now"); return; } From 16a16a9543986d12d2da9d21758438f7a3b13491 Mon Sep 17 00:00:00 2001 From: Huang Qi Date: Wed, 12 Mar 2025 21:51:06 +0800 Subject: [PATCH 224/391] ostest: Implement mutex move test functionality Add a new test for moving mutexes to verify behavior when a mutex is relocated. * Introduced mutex_thread_args_t structure for thread arguments * Created moved_mutex_thread_func to handle mutex operations in threads * Updated mutex_test to include mutex_move_test for comprehensive testing Signed-off-by: Huang Qi --- testing/ostest/mutex.c | 222 +++++++++++++++++++++++++++++++---------- 1 file changed, 167 insertions(+), 55 deletions(-) diff --git a/testing/ostest/mutex.c b/testing/ostest/mutex.c index 4e01166eb27..7079838c2b6 100644 --- a/testing/ostest/mutex.c +++ b/testing/ostest/mutex.c @@ -35,103 +35,214 @@ ****************************************************************************/ #define NLOOPS 32 +#define NYIELDS 10 /**************************************************************************** - * Private Data + * Private Types ****************************************************************************/ -static pthread_mutex_t mut; -static volatile int my_mutex = 0; -static unsigned long nloops[2] = - { - 0, - 0 - }; -static unsigned long nerrors[2] = - { - 0, - 0 - }; +typedef struct +{ + pthread_mutex_t *mutex_ptr; + volatile int *mutex_value; + int *nloops; + int *nerrors; + int thread_id; +} mutex_thread_args_t; /**************************************************************************** * Private Functions ****************************************************************************/ -static void *thread_func(FAR void *parameter) +static void *mutex_thread_func(FAR void *parameter) { - int id = (int)((intptr_t)parameter); + FAR mutex_thread_args_t *args = (FAR mutex_thread_args_t *)parameter; + + int id = args->thread_id; int ndx = id - 1; int i; + int local_loops = 0; - for (nloops[ndx] = 0; nloops[ndx] < NLOOPS; nloops[ndx]++) + for (local_loops = 0; local_loops < NLOOPS; local_loops++) { - int status = pthread_mutex_lock(&mut); + int status = pthread_mutex_lock(args->mutex_ptr); if (status != 0) { - printf("ERROR thread %d: pthread_mutex_lock failed, status=%d\n", - id, status); + printf("ERROR thread %d: pthread_mutex_lock failed, " + "status=%d\n", id, status); ASSERT(false); } - if (my_mutex == 1) + if (*(args->mutex_value) == 1) { printf("ERROR thread=%d: " - "my_mutex should be zero, instead my_mutex=%d\n", - id, my_mutex); + "mutex value should be zero, " + "instead mutex value=%d\n", + id, *(args->mutex_value)); ASSERT(false); - nerrors[ndx]++; + args->nerrors[ndx]++; } - my_mutex = 1; - for (i = 0; i < 10; i++) + *(args->mutex_value) = 1; + for (i = 0; i < NYIELDS; i++) { pthread_yield(); } - my_mutex = 0; + *(args->mutex_value) = 0; - status = pthread_mutex_unlock(&mut); + status = pthread_mutex_unlock(args->mutex_ptr); if (status != 0) { - printf("ERROR thread %d: pthread_mutex_unlock failed, status=%d\n", - id, status); + printf("ERROR thread %d: pthread_mutex_unlock failed, " + "status=%d\n", id, status); ASSERT(false); } } + args->nloops[ndx] = local_loops; pthread_exit(NULL); - return NULL; /* Non-reachable -- needed for some compilers */ + return NULL; } /**************************************************************************** - * Public Functions + * Name: mutex_move_test + * + * Description: + * Test the mutex move functionality. This test creates a mutex, moves + * it to a new location, and then starts two threads that use the moved + * mutex. + * POSIX specification does not define the behavior of a mutex that is + * moved. This test is intended to verify that the mutex can be moved, + * which is useful for some cases, see the discussion in + * https://github.com/rust-lang/rust/pull/138400 + * ****************************************************************************/ -void mutex_test(void) +static void mutex_move_test(void) { pthread_t thread1; pthread_t thread2; -#ifdef SDCC - pthread_addr_t result1; - pthread_addr_t result2; - pthread_attr_t attr; -#endif int status; + pthread_mutex_t initial_mutex; + pthread_mutex_t moved_mutex; + volatile int moved_mutex_value = 0; + int moved_nloops[2] = + { + 0, + 0 + }; + + int moved_nerrors[2] = + { + 0, + 0 + }; + + printf("\nTesting moved mutex\n"); + + /* Allocate and initialize first mutex */ + + pthread_mutex_init(&initial_mutex, NULL); + + /* Copy the mutex to new location */ + + memcpy(&moved_mutex, &initial_mutex, sizeof(pthread_mutex_t)); + + /* Destroy the original mutex */ + + pthread_mutex_destroy(&initial_mutex); + + mutex_thread_args_t thread1_args; + mutex_thread_args_t thread2_args; + + thread1_args.mutex_ptr = &moved_mutex; + thread1_args.mutex_value = &moved_mutex_value; + thread1_args.nloops = moved_nloops; + thread1_args.nerrors = moved_nerrors; + thread1_args.thread_id = 1; + + thread2_args.mutex_ptr = &moved_mutex; + thread2_args.mutex_value = &moved_mutex_value; + thread2_args.nloops = moved_nloops; + thread2_args.nerrors = moved_nerrors; + thread2_args.thread_id = 2; + + /* Start two threads using the moved mutex */ + + printf("Starting moved mutex thread 1\n"); + status = pthread_create(&thread1, NULL, mutex_thread_func, + &thread1_args); + if (status != 0) + { + printf("ERROR in moved mutex thread#1 creation\n"); + ASSERT(false); + } + + printf("Starting moved mutex thread 2\n"); + status = pthread_create(&thread2, NULL, mutex_thread_func, + &thread2_args); + if (status != 0) + { + printf("ERROR in moved mutex thread#2 creation\n"); + ASSERT(false); + } + + pthread_join(thread1, NULL); + pthread_join(thread2, NULL); + + pthread_mutex_destroy(&moved_mutex); + + printf("\t\tThread1\tThread2\n"); + printf("\tMoved Loops\t%u\t%u\n", moved_nloops[0], moved_nloops[1]); + printf("\tMoved Errors\t%u\t%u\n", moved_nerrors[0], moved_nerrors[1]); +} + +void mutex_simple_test(void) +{ + pthread_t thread1; + pthread_t thread2; + int status; + mutex_thread_args_t thread1_args; + mutex_thread_args_t thread2_args; + + pthread_mutex_t mut; + volatile int my_mutex = 0; + int nloops[2] = + { + 0, + 0 + }; + + int nerrors[2] = + { + 0, + 0 + }; /* Initialize the mutex */ printf("Initializing mutex\n"); pthread_mutex_init(&mut, NULL); + /* Set up thread arguments */ + + thread1_args.mutex_ptr = &mut; + thread1_args.mutex_value = &my_mutex; + thread1_args.nloops = nloops; + thread1_args.nerrors = nerrors; + thread1_args.thread_id = 1; + + thread2_args.mutex_ptr = &mut; + thread2_args.mutex_value = &my_mutex; + thread2_args.nloops = nloops; + thread2_args.nerrors = nerrors; + thread2_args.thread_id = 2; + /* Start two thread instances */ printf("Starting thread 1\n"); -#ifdef SDCC - pthread_attr_init(&attr); - status = pthread_create(&thread1, &attr, thread_func, (pthread_addr_t)1); -#else - status = pthread_create(&thread1, NULL, thread_func, (pthread_addr_t)1); -#endif + status = pthread_create(&thread1, NULL, mutex_thread_func, &thread1_args); if (status != 0) { printf("ERROR in thread#1 creation\n"); @@ -139,28 +250,29 @@ void mutex_test(void) } printf("Starting thread 2\n"); -#ifdef SDCC - status = pthread_create(&thread2, &attr, thread_func, (pthread_addr_t)2); -#else - status = pthread_create(&thread2, NULL, thread_func, (pthread_addr_t)2); -#endif + status = pthread_create(&thread2, NULL, mutex_thread_func, &thread2_args); if (status != 0) { printf("ERROR in thread#2 creation\n"); ASSERT(false); } -#ifdef SDCC - pthread_join(thread1, &result1); - pthread_join(thread2, &result2); -#else pthread_join(thread1, NULL); pthread_join(thread2, NULL); -#endif pthread_mutex_destroy(&mut); printf("\t\tThread1\tThread2\n"); - printf("\tLoops\t%lu\t%lu\n", nloops[0], nloops[1]); - printf("\tErrors\t%lu\t%lu\n", nerrors[0], nerrors[1]); + printf("\tLoops\t%u\t%u\n", nloops[0], nloops[1]); + printf("\tErrors\t%u\t%u\n", nerrors[0], nerrors[1]); +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +void mutex_test(void) +{ + mutex_simple_test(); + mutex_move_test(); } From fc142045a4dc4c8a36e95f358fb30d3a51e8094d Mon Sep 17 00:00:00 2001 From: zhanghongyu Date: Sun, 23 Mar 2025 21:07:59 +0800 Subject: [PATCH 225/391] mbedtls: add MBEDTLS_SSL_COOKIE_C to Kconfig for manual configuration current defconfig and mbedtls_config.h can not enable the definition of MBEDTLS_SSL_COOKIE_C. Signed-off-by: zhanghongyu --- crypto/mbedtls/Kconfig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crypto/mbedtls/Kconfig b/crypto/mbedtls/Kconfig index 1bee06c899d..9870a1b9ec0 100644 --- a/crypto/mbedtls/Kconfig +++ b/crypto/mbedtls/Kconfig @@ -639,6 +639,10 @@ config MBEDTLS_SSL_CACHE_C bool "Enable simple SSL cache implementation." default y +config MBEDTLS_SSL_COOKIE_C + bool "Enable SSL cookie implementation." + default y + config MBEDTLS_SSL_TICKET_C bool "Enable an implementation of TLS server-side callbacks for session tickets." depends on (MBEDTLS_CIPHER_C || MBEDTLS_USE_PSA_CRYPTO) && \ From cdc5968c67513bbb0558114d8e33123e877a4113 Mon Sep 17 00:00:00 2001 From: Alan Carvalho de Assis Date: Thu, 6 Feb 2025 20:09:21 -0300 Subject: [PATCH 226/391] testing: Add Serial Error Reporting testing app This commit adds support to Serial Error Reporting using the ioctl TIOCGICOUNT. This examples was inspired on this sample code: https://stackoverflow.com/questions/78796301/c-serial-communication-why-does-read-lose-some-data-bytes-at-high-baud-rates/78800245#78800245 Signed-off-by: Alan C. Assis --- testing/drivers/ser/CMakeLists.txt | 33 ++++++++++ testing/drivers/ser/Kconfig | 38 ++++++++++++ testing/drivers/ser/Make.defs | 25 ++++++++ testing/drivers/ser/Makefile | 35 +++++++++++ testing/drivers/ser/ser.c | 99 ++++++++++++++++++++++++++++++ 5 files changed, 230 insertions(+) create mode 100644 testing/drivers/ser/CMakeLists.txt create mode 100644 testing/drivers/ser/Kconfig create mode 100644 testing/drivers/ser/Make.defs create mode 100644 testing/drivers/ser/Makefile create mode 100644 testing/drivers/ser/ser.c diff --git a/testing/drivers/ser/CMakeLists.txt b/testing/drivers/ser/CMakeLists.txt new file mode 100644 index 00000000000..1e17c7a3e39 --- /dev/null +++ b/testing/drivers/ser/CMakeLists.txt @@ -0,0 +1,33 @@ +# ############################################################################## +# apps/testing/drivers/ser/CMakeLists.txt +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_TESTING_SERIAL) + nuttx_add_application( + NAME + ${CONFIG_TESTING_SERIAL_PROGNAME} + PRIORITY + ${CONFIG_TESTING_SERIAL_PRIORITY} + STACKSIZE + ${CONFIG_TESTING_SERIAL_STACKSIZE} + SRCS + ser.c) +endif() diff --git a/testing/drivers/ser/Kconfig b/testing/drivers/ser/Kconfig new file mode 100644 index 00000000000..484df2843c9 --- /dev/null +++ b/testing/drivers/ser/Kconfig @@ -0,0 +1,38 @@ +# +# For a description of the syntax of this configuration file, +# see the file kconfig-language.txt in the NuttX tools repository. +# + +config TESTING_SERIAL + bool "Serial Error Report (ser)" + default n + depends on SERIAL_TIOCGICOUNT + ---help--- + Enable the serial error reporting test. This test + could report U[S]ART erros like frame, overrun, parity, etc + +if TESTING_SERIAL + +config TESTING_SERIAL_PORT + string "Serial Port to Use" + default "/dev/ttyS1" + ---help--- + This is the name of serial port to use. Please avoid using + the ttyS0 because it is used as console. + +config TESTING_SERIAL_PROGNAME + string "Program name" + default "ser" + ---help--- + This is the name of the program that will be used when the NSH ELF + program is installed. + +config TESTING_SERIAL_PRIORITY + int "ser utility task priority" + default 100 + +config TESTING_SERIAL_STACKSIZE + int "ser utility stack size" + default DEFAULT_TASK_STACKSIZE + +endif diff --git a/testing/drivers/ser/Make.defs b/testing/drivers/ser/Make.defs new file mode 100644 index 00000000000..cc03f21465c --- /dev/null +++ b/testing/drivers/ser/Make.defs @@ -0,0 +1,25 @@ +############################################################################ +# apps/testing/drivers/ser/Make.defs +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +ifneq ($(CONFIG_TESTING_SERIAL),) +CONFIGURED_APPS += $(APPDIR)/testing/drivers/ser +endif diff --git a/testing/drivers/ser/Makefile b/testing/drivers/ser/Makefile new file mode 100644 index 00000000000..f1fcea62561 --- /dev/null +++ b/testing/drivers/ser/Makefile @@ -0,0 +1,35 @@ +############################################################################ +# apps/testing/drivers/ser/Makefile +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +include $(APPDIR)/Make.defs + +# ser built-in application info + +PROGNAME = $(CONFIG_TESTING_SERIAL_PROGNAME) +PRIORITY = $(CONFIG_TESTING_SERIAL_PRIORITY) +STACKSIZE = $(CONFIG_TESTING_SERIAL_STACKSIZE) + +# ser main source + +MAINSRC = ser.c + +include $(APPDIR)/Application.mk diff --git a/testing/drivers/ser/ser.c b/testing/drivers/ser/ser.c new file mode 100644 index 00000000000..ca5820c74e8 --- /dev/null +++ b/testing/drivers/ser/ser.c @@ -0,0 +1,99 @@ +/**************************************************************************** + * apps/testing/drivers/ser/ser.c + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +int main(int argc, FAR char *argv[]) +{ + struct serial_icounter_s rcount; + struct serial_icounter_s scount; + + int fd; + int ret; + + fd = open(CONFIG_TESTING_SERIAL_PORT, O_RDONLY); + if (fd < 0) + { + ret = -ENODEV; + goto out; + } + + ret = ioctl(fd, TIOCGICOUNT, &scount); + if (ret < 0) + { + goto out_close; + } + + while (1) + { + ret = ioctl(fd, TIOCGICOUNT, &rcount); + + if (rcount.frame > scount.frame) + { + printf("ERROR: framing %d\n", rcount.frame - scount.frame); + } + + if (rcount.overrun > scount.overrun) + { + printf("ERROR: overrun %d\n", rcount.overrun - scount.overrun); + } + + if (rcount.parity > scount.parity) + { + printf("ERROR: parity %d\n", rcount.parity - scount.parity); + } + + if (rcount.brk > scount.brk) + { + printf("ERROR: break %d\n", rcount.brk - scount.brk); + } + + if (rcount.buf_overrun > scount.buf_overrun) + { + printf("ERROR: buffer overrun %d\n", + rcount.buf_overrun - scount.buf_overrun); + } + + scount = rcount; + usleep(1000000); + } + +out_close: + close(fd); +out: + + return ret; +} From 494554618e89f3a4763c1e3250562454dab1ab4c Mon Sep 17 00:00:00 2001 From: Tiago Medicci Date: Wed, 19 Mar 2025 14:23:27 -0300 Subject: [PATCH 227/391] benchmark/mtd: Add MTD testing/benchmark application This test allows measuring write and read operations on an MTD flash device, evaluating its transfer rates. Signed-off-by: Tiago Medicci --- benchmarks/mtd/CMakeLists.txt | 33 ++++++ benchmarks/mtd/Kconfig | 18 +++ benchmarks/mtd/Make.defs | 25 ++++ benchmarks/mtd/Makefile | 34 ++++++ benchmarks/mtd/mtd.c | 207 ++++++++++++++++++++++++++++++++++ 5 files changed, 317 insertions(+) create mode 100644 benchmarks/mtd/CMakeLists.txt create mode 100644 benchmarks/mtd/Kconfig create mode 100644 benchmarks/mtd/Make.defs create mode 100644 benchmarks/mtd/Makefile create mode 100644 benchmarks/mtd/mtd.c diff --git a/benchmarks/mtd/CMakeLists.txt b/benchmarks/mtd/CMakeLists.txt new file mode 100644 index 00000000000..975ed1001e7 --- /dev/null +++ b/benchmarks/mtd/CMakeLists.txt @@ -0,0 +1,33 @@ +# ############################################################################## +# apps/benchmarks/mtd/CMakeLists.txt +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_BENCHMARK_MTD) + nuttx_add_application( + NAME + mtd + STACKSIZE + ${CONFIG_DEFAULT_TASK_STACKSIZE} + MODULE + ${CONFIG_BENCHMARK_MTD} + SRCS + mtd.c) +endif() diff --git a/benchmarks/mtd/Kconfig b/benchmarks/mtd/Kconfig new file mode 100644 index 00000000000..f5ceadfe04d --- /dev/null +++ b/benchmarks/mtd/Kconfig @@ -0,0 +1,18 @@ +# +# For a description of the syntax of this configuration file, +# see the file kconfig-language.txt in the NuttX tools repository. +# + +config BENCHMARK_MTD + tristate "MTD test and transfer rate benchmark" + default n + depends on BUILD_FLAT && MTD + ---help--- + This testing/benchmark application performs an erase/write + operation to evaluate write transfer rate and then reads the + written content back to evaluate the read transfer rate. Finally, + it compares the read data with the previously written data to + ensure the MTD device is working as expected. + + NOTE: This application uses internal OS interfaces and so it is not + available in the NuttX kernel build. diff --git a/benchmarks/mtd/Make.defs b/benchmarks/mtd/Make.defs new file mode 100644 index 00000000000..9bf77e7b9aa --- /dev/null +++ b/benchmarks/mtd/Make.defs @@ -0,0 +1,25 @@ +############################################################################ +# apps/benchmarks/mtd/Make.defs +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +ifneq ($(CONFIG_BENCHMARK_MTD),) +CONFIGURED_APPS += $(APPDIR)/benchmarks/mtd/ +endif diff --git a/benchmarks/mtd/Makefile b/benchmarks/mtd/Makefile new file mode 100644 index 00000000000..30029efe3f8 --- /dev/null +++ b/benchmarks/mtd/Makefile @@ -0,0 +1,34 @@ +############################################################################ +# apps/benchmarks/mtd/Makefile +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +include $(APPDIR)/Make.defs + +# MTD test and transfer rate benchmark + +PROGNAME = mtd +PRIORITY = SCHED_PRIORITY_DEFAULT +STACKSIZE = $(CONFIG_DEFAULT_TASK_STACKSIZE) +MODULE = $(CONFIG_BENCHMARK_MTD) + +MAINSRC = mtd.c + +include $(APPDIR)/Application.mk diff --git a/benchmarks/mtd/mtd.c b/benchmarks/mtd/mtd.c new file mode 100644 index 00000000000..4d117c60607 --- /dev/null +++ b/benchmarks/mtd/mtd.c @@ -0,0 +1,207 @@ +/**************************************************************************** + * apps/benchmarks/mtd/mtd.c + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private data + ****************************************************************************/ + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +int main(int argc, FAR char *argv[]) +{ + struct inode *inode; + struct timespec start; + struct timespec end; + struct mtd_geometry_s geo; + struct partition_info_s info; + int ret; + int x; + double elapsed_time; + double transfer_rate; + size_t total_bytes_written = 0; + size_t total_bytes_read = 0; + char *buffer; + + /* Argument given? */ + + if (argc < 2) + { + fprintf(stderr, "usage: mtd flash_block_device\n"); + return -1; + } + + /* Find the inode of the block driver identified by 'source' */ + + ret = open_blockdriver(argv[1], 0, &inode); + if (ret < 0) + { + fprintf(stderr, "Failed to open %s\n", argv[1]); + return ret; + } + + /* Get the low-level format from the device. */ + + ret = inode->u.i_bops->ioctl(inode, BIOC_PARTINFO, (unsigned long) &info); + if (ret != OK) + { + fprintf(stderr, "Device is not a block device\n"); + goto errout_with_driver; + } + + /* Get the MTD geometry */ + + ret = inode->u.i_bops->ioctl(inode, MTDIOC_GEOMETRY, (unsigned long) &geo); + if (ret != OK) + { + fprintf(stderr, "Device is not a MTD device\n"); + goto errout_with_driver; + } + + /* Report the device structure */ + + printf("FLASH device parameters:\n"); + printf(" Sector size: %10d\n", info.sectorsize); + printf(" Sector count: %10d\n", info.numsectors); + printf(" Erase block: %10d\n", geo.erasesize); + printf(" Total size: %10d\n", info.sectorsize * info.numsectors); + + if (info.sectorsize != geo.erasesize) + { + fprintf(stderr, "Sector size does not match the erase block size.\n" + "Please adjust the sector size to enable erasing and writing " + "without using an intermediary read buffer.\n"); + goto errout_with_driver; + } + + /* Allocate buffers to use */ + + buffer = (char *)malloc(info.sectorsize); + if (buffer == NULL) + { + fprintf(stderr, "Error allocating buffer\n"); + goto errout_with_driver; + } + + /* Fill the buffer with known data and print it in hex format */ + + for (int i = 0; i < info.sectorsize; i++) + { + buffer[i] = (char)(i & 0xff); + } + + /* Now write some data to the sector */ + + printf("\nStarting write operation...\n"); + + clock_gettime(CLOCK_MONOTONIC, &start); + for (x = 0; x < info.numsectors; x++) + { + inode->u.i_bops->write(inode, (const unsigned char *)buffer, x, 1); + + total_bytes_written += info.sectorsize; + } + + clock_gettime(CLOCK_MONOTONIC, &end); + + elapsed_time = (end.tv_sec - start.tv_sec) + \ + (end.tv_nsec - start.tv_nsec) / 1e9; + transfer_rate = (total_bytes_written / elapsed_time) / 1024; + + printf("\nWrite operation completed in %.2f seconds\n", elapsed_time); + printf("Total bytes written: %zu\n", total_bytes_written); + printf("Transfer rate [write]: %.2f KiB/s\n", transfer_rate); + + /* Now read the data back to validate everything was written and can + * be read. + */ + + printf("\nStarting read operation...\n"); + + clock_gettime(CLOCK_MONOTONIC, &start); + + for (x = 0; x < info.numsectors; x++) + { + inode->u.i_bops->read(inode, (unsigned char *)buffer, x, 1); + + total_bytes_read += info.sectorsize; + } + + clock_gettime(CLOCK_MONOTONIC, &end); + + elapsed_time = (end.tv_sec - start.tv_sec) + \ + (end.tv_nsec - start.tv_nsec) / 1e9; + transfer_rate = (total_bytes_written / elapsed_time) / 1024; + + printf("\nRead operation completed in %.2f seconds\n", elapsed_time); + printf("Total bytes read: %zu\n", total_bytes_read); + printf("Transfer rate [read]: %.2f KiB/s\n", transfer_rate); + + /* Compare the read data with the written data */ + + for (int i = 0; i < info.sectorsize; i++) + { + if (buffer[i] != (char)(i & 0xff)) + { + printf("\nData mismatch at byte %d: expected %02X, got %02X\n", + i, (unsigned char)(i & 0xff), (unsigned char)buffer[i]); + goto errout_with_buffers; + } + } + + printf("\nData verification successful: read data matches written data\n"); + +errout_with_buffers: + + /* Free the allocated buffers */ + + free(buffer); + +errout_with_driver: + + /* Now close the block device and exit */ + + close_blockdriver(inode); + return 0; +} From e280e9bdb45f93b45ef2ae7d6f9c75cea722ec17 Mon Sep 17 00:00:00 2001 From: raiden00pl Date: Fri, 14 Mar 2025 14:10:46 +0100 Subject: [PATCH 228/391] modbus: add an option to disable log Introduce new configuration option that allow disable all logging functionality for FreeModBus. This option is useful for small systems when we don't use any logging features. Signed-off-by: raiden00pl --- modbus/Kconfig | 9 +++++++++ modbus/nuttx/port.h | 4 ++++ modbus/nuttx/portother.c | 2 ++ 3 files changed, 15 insertions(+) diff --git a/modbus/Kconfig b/modbus/Kconfig index 8da277fdfd6..d891d181c38 100644 --- a/modbus/Kconfig +++ b/modbus/Kconfig @@ -251,4 +251,13 @@ config MB_MASTER_FUNC_READWRITE_HOLDING_ENABLED endif # MB_ASCII_MASTER || MB_RTU_MASTER endif # MODBUS + +config MODBUS_DISABLE_LOG + bool "Disable logging for FreeModBus" + default !FILE_STREAM + ---help--- + Disable all logging features for FreeModBus which can be useful + for small optimized systems without console or log file support. + This also must be enabled when fputs() is not supported. + endmenu # FreeModBus diff --git a/modbus/nuttx/port.h b/modbus/nuttx/port.h index aada110ed26..c79dcdd9886 100644 --- a/modbus/nuttx/port.h +++ b/modbus/nuttx/port.h @@ -79,8 +79,12 @@ typedef enum void vMBPortEnterCritical(void); void vMBPortExitCritical(void); +#ifndef CONFIG_MODBUS_DISABLE_LOG void vMBPortLog(eMBPortLogLevel eLevel, const char *szModule, const char *szFmt, ...) printf_like(3, 4); +#else +# define vMBPortLog(l, m, c, ...) +#endif void vMBPortTimerPoll(void); bool xMBPortSerialPoll(void); bool xMBPortSerialSetTimeout(uint32_t dwTimeoutMs); diff --git a/modbus/nuttx/portother.c b/modbus/nuttx/portother.c index 797ede0dc72..3de2a38b5bc 100644 --- a/modbus/nuttx/portother.c +++ b/modbus/nuttx/portother.c @@ -73,6 +73,7 @@ void vMBPortLogFile(FILE * fNewLogFile) fLogFile = fNewLogFile; } +#ifndef CONFIG_MODBUS_DISABLE_LOG void vMBPortLog(eMBPortLogLevel eLevel, const char * szModule, const char * szFmt, ...) { @@ -103,6 +104,7 @@ void vMBPortLog(eMBPortLogLevel eLevel, const char * szModule, } } } +#endif void vMBPortEnterCritical(void) { From 6d0a039cc997e982eaf187ae2eded37b1c9b2935 Mon Sep 17 00:00:00 2001 From: chao an Date: Mon, 10 Mar 2025 10:12:37 +0800 Subject: [PATCH 229/391] system/nxplayer/nxrecorder: move apb buffer instance to stack move apb buffer instance to stack to avoid alloc buffer from heap Signed-off-by: chao an --- system/nxplayer/nxplayer.c | 42 +++++++++------------------------ system/nxrecorder/nxrecorder.c | 43 +++++++++------------------------- 2 files changed, 22 insertions(+), 63 deletions(-) diff --git a/system/nxplayer/nxplayer.c b/system/nxplayer/nxplayer.c index 38f252c1a76..314bdea4049 100644 --- a/system/nxplayer/nxplayer.c +++ b/system/nxplayer/nxplayer.c @@ -796,7 +796,6 @@ static FAR void *nxplayer_playthread(pthread_addr_t pvarg) bool streaming = true; bool failed = false; struct ap_buffer_info_s buf_info; - FAR struct ap_buffer_s **buffers; unsigned int prio; #ifdef CONFIG_DEBUG_FEATURES int outstanding = 0; @@ -819,23 +818,11 @@ static FAR void *nxplayer_playthread(pthread_addr_t pvarg) /* Create array of pointers to buffers */ - buffers = (FAR struct ap_buffer_s **) - malloc(buf_info.nbuffers * sizeof(FAR void *)); - if (buffers == NULL) - { - /* Error allocating memory for buffer storage! */ - - ret = -ENOMEM; - running = false; - goto err_out; - } + FAR struct ap_buffer_s *buffers[buf_info.nbuffers]; /* Create our audio pipeline buffers to use for queueing up data */ - for (x = 0; x < buf_info.nbuffers; x++) - { - buffers[x] = NULL; - } + memset(buffers, 0, sizeof(buffers)); for (x = 0; x < buf_info.nbuffers; x++) { @@ -1145,27 +1132,20 @@ static FAR void *nxplayer_playthread(pthread_addr_t pvarg) err_out: audinfo("Clean-up and exit\n"); - if (buffers != NULL) + audinfo("Freeing buffers\n"); + for (x = 0; x < buf_info.nbuffers; x++) { - audinfo("Freeing buffers\n"); - for (x = 0; x < buf_info.nbuffers; x++) - { - /* Fill in the buffer descriptor struct to issue a free request */ + /* Fill in the buffer descriptor struct to issue a free request */ - if (buffers[x] != NULL) - { + if (buffers[x] != NULL) + { #ifdef CONFIG_AUDIO_MULTI_SESSION - buf_desc.session = pplayer->session; + buf_desc.session = pplayer->session; #endif - buf_desc.u.buffer = buffers[x]; - ioctl(pplayer->dev_fd, AUDIOIOC_FREEBUFFER, - (unsigned long)&buf_desc); - } + buf_desc.u.buffer = buffers[x]; + ioctl(pplayer->dev_fd, AUDIOIOC_FREEBUFFER, + (unsigned long)&buf_desc); } - - /* Free the pointers to the buffers */ - - free(buffers); } /* Unregister the message queue and release the session */ diff --git a/system/nxrecorder/nxrecorder.c b/system/nxrecorder/nxrecorder.c index 882632a3765..98c62486c5a 100644 --- a/system/nxrecorder/nxrecorder.c +++ b/system/nxrecorder/nxrecorder.c @@ -528,7 +528,6 @@ static FAR void *nxrecorder_recordthread(pthread_addr_t pvarg) bool streaming = true; bool failed = false; struct ap_buffer_info_s buf_info; - FAR struct ap_buffer_s **pbuffers; unsigned int prio; #ifdef CONFIG_DEBUG_FEATURES int outstanding = 0; @@ -551,23 +550,11 @@ static FAR void *nxrecorder_recordthread(pthread_addr_t pvarg) /* Create array of pointers to buffers */ - pbuffers = (FAR struct ap_buffer_s **) malloc(buf_info.nbuffers * - sizeof(FAR void *)); - if (pbuffers == NULL) - { - /* Error allocating memory for buffer storage! */ - - ret = -ENOMEM; - running = false; - goto err_out; - } + FAR struct ap_buffer_s *pbuffers[buf_info.nbuffers]; /* Create our audio pipeline buffers to use for queueing up data */ - for (x = 0; x < buf_info.nbuffers; x++) - { - pbuffers[x] = NULL; - } + memset(pbuffers, 0, sizeof(pbuffers)); for (x = 0; x < buf_info.nbuffers; x++) { @@ -820,28 +807,20 @@ static FAR void *nxrecorder_recordthread(pthread_addr_t pvarg) err_out: audinfo("Clean-up and exit\n"); - if (pbuffers != NULL) + audinfo("Freeing buffers\n"); + for (x = 0; x < buf_info.nbuffers; x++) { - audinfo("Freeing buffers\n"); - for (x = 0; x < buf_info.nbuffers; x++) - { - /* Fill in the buffer descriptor struct to issue a free request */ + /* Fill in the buffer descriptor struct to issue a free request */ - if (pbuffers[x] != NULL) - { + if (pbuffers[x] != NULL) + { #ifdef CONFIG_AUDIO_MULTI_SESSION - buf_desc.session = precorder->session; + buf_desc.session = precorder->session; #endif - buf_desc.u.buffer = pbuffers[x]; - ioctl(precorder->dev_fd, - AUDIOIOC_FREEBUFFER, - (uintptr_t)&buf_desc); - } + buf_desc.u.buffer = pbuffers[x]; + ioctl(precorder->dev_fd, AUDIOIOC_FREEBUFFER, + (uintptr_t)&buf_desc); } - - /* Free the pointers to the buffers */ - - free(pbuffers); } /* Unregister the message queue and release the session */ From 83eba58232d6c5c77424dce7c1354d326999bb22 Mon Sep 17 00:00:00 2001 From: chao an Date: Tue, 25 Mar 2025 21:29:02 +0800 Subject: [PATCH 230/391] nxlooper: fix typo in nxlooper replace CONFIG_O_MULTI_SESSION to CONFIG_AUDIO_MULTI_SESSION Signed-off-by: chao an --- system/nxlooper/nxlooper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/nxlooper/nxlooper.c b/system/nxlooper/nxlooper.c index d8a5ec19809..3d8404520bd 100644 --- a/system/nxlooper/nxlooper.c +++ b/system/nxlooper/nxlooper.c @@ -577,7 +577,7 @@ static void *nxlooper_loopthread(pthread_addr_t pvarg) if (ret == OK && plooper->loopstate == NXLOOPER_STATE_RECORDING) { -#ifdef CONFIG_O_MULTI_SESSION +#ifdef CONFIG_AUDIO_MULTI_SESSION ret = ioctl(plooper->playdev_fd, AUDIOIOC_START, (unsigned long)plooper->pplayses); #else From 7b65b2bb41763207dcfb965c3eb2223595986779 Mon Sep 17 00:00:00 2001 From: zhangshoukui Date: Fri, 7 Mar 2025 19:31:34 +0800 Subject: [PATCH 231/391] drivertest_uart: Pass in the specified parameters to test https://github.com/apache/nuttx/blob/master/tools/ci/testrun/script/test_framework/test_cmocka.py cmocka --skip test_case_posix_timer|test_case_oneshot|write_default|read_default|burst_test|gpiotest01 In the CI of the community, this test is skipped because this test will block the terminal, and I think that the test added to cmocka should not be designed this way Signed-off-by: zhangshoukui --- testing/drivers/drivertest/drivertest_uart.c | 46 ++++++++++++++------ 1 file changed, 33 insertions(+), 13 deletions(-) diff --git a/testing/drivers/drivertest/drivertest_uart.c b/testing/drivers/drivertest/drivertest_uart.c index 23875b17628..f888205292e 100644 --- a/testing/drivers/drivertest/drivertest_uart.c +++ b/testing/drivers/drivertest/drivertest_uart.c @@ -64,6 +64,7 @@ struct test_confs_s { FAR const char *dev_path; + int test_case_id; }; struct test_state_s @@ -199,10 +200,10 @@ static int teardown(FAR void **state) } /**************************************************************************** - * Name: write_default + * Name: drivertest_uart_write ****************************************************************************/ -static void write_default(FAR void **state) +static void drivertest_uart_write(FAR void **state) { FAR struct test_state_s *test_state = (FAR struct test_state_s *)*state; int res = write(test_state->fd, @@ -213,10 +214,10 @@ static void write_default(FAR void **state) } /**************************************************************************** - * Name: read_default + * Name: drivertest_uart_read ****************************************************************************/ -static void read_default(FAR void **state) +static void drivertest_uart_read(FAR void **state) { FAR struct test_state_s *test_state = (FAR struct test_state_s *)*state; size_t buffer_size = sizeof(DEFAULT_CONTENT); @@ -245,10 +246,10 @@ static void read_default(FAR void **state) } /**************************************************************************** - * Name: burst_test + * Name: drivertest_uart_burst ****************************************************************************/ -static void burst_test(FAR void **state) +static void drivertest_uart_burst(FAR void **state) { FAR struct test_state_s *test_state = (FAR struct test_state_s *)*state; int res = 0; @@ -303,6 +304,12 @@ static void show_usage(FAR const char *progname, int exitcode) printf("Where:\n"); printf(" -d uart device path " "[default device: /dev/console].\n"); + printf(" -n selects the testcase to uart.\n" + "[default test: drivertest_uart_write].\n" + " Case 0: drivertest_uart_write test\n" + " Case 1: drivertest_uart_read test\n" + " Case 2: drivertest_uart_burst test\n" + ); exit(exitcode); } @@ -315,13 +322,16 @@ static void parse_args(int argc, FAR char **argv, { int option; - while ((option = getopt(argc, argv, "d:")) != ERROR) + while ((option = getopt(argc, argv, "d:n:")) != ERROR) { switch (option) { case 'd': conf->dev_path = optarg; break; + case 'n': + conf->test_case_id = atoi(optarg); + break; case '?': printf("Unknown option: %c\n", optopt); show_usage(argv[0], EXIT_FAILURE); @@ -340,20 +350,30 @@ static void parse_args(int argc, FAR char **argv, int main(int argc, FAR char *argv[]) { + void (*drivertest_uart)(FAR void **state) = NULL; struct test_confs_s confs = { - .dev_path = CONFIG_TESTING_DRIVER_TEST_UART_DEVICE + .dev_path = CONFIG_TESTING_DRIVER_TEST_UART_DEVICE, + .test_case_id = 0 }; parse_args(argc, argv, &confs); + switch (confs.test_case_id) + { + case 1: + drivertest_uart = drivertest_uart_read; + break; + case 2: + drivertest_uart = drivertest_uart_burst; + break; + default: + drivertest_uart = drivertest_uart_write; + break; + } const struct CMUnitTest tests[] = { - cmocka_unit_test_prestate_setup_teardown(write_default, setup, - teardown, &confs), - cmocka_unit_test_prestate_setup_teardown(read_default, setup, - teardown, &confs), - cmocka_unit_test_prestate_setup_teardown(burst_test, setup, + cmocka_unit_test_prestate_setup_teardown(drivertest_uart, setup, teardown, &confs), }; From 940ee9385ce078e9cdaa8b71ae011424a2310042 Mon Sep 17 00:00:00 2001 From: Max Kriegleder Date: Thu, 31 Oct 2024 00:00:28 +0100 Subject: [PATCH 232/391] examples: add blecent and bleprph similar to mynewt-nimble apps These example apps create a BLE central and peripheral based on mynewt-nimBLE and work in companion. The apps are mostly based on their equivalents, which can be found at https://github.com/apache/mynewt-nimble/tree/master/apps Signed-off-by: Max Kriegleder --- examples/nimble_blecent/CMakeLists.txt | 31 + examples/nimble_blecent/Kconfig | 30 + examples/nimble_blecent/Make.defs | 23 + examples/nimble_blecent/Makefile | 38 + examples/nimble_blecent/blecent.h | 126 +++ examples/nimble_blecent/misc.c | 234 +++++ examples/nimble_blecent/nimble_blecent_main.c | 692 +++++++++++++ examples/nimble_blecent/peer.c | 933 ++++++++++++++++++ examples/nimble_bleprph/CMakeLists.txt | 31 + examples/nimble_bleprph/Kconfig | 30 + examples/nimble_bleprph/Make.defs | 23 + examples/nimble_bleprph/Makefile | 38 + examples/nimble_bleprph/bleprph.h | 60 ++ examples/nimble_bleprph/gatt_svr.c | 238 +++++ examples/nimble_bleprph/misc.c | 48 + examples/nimble_bleprph/nimble_bleprph_main.c | 440 +++++++++ 16 files changed, 3015 insertions(+) create mode 100644 examples/nimble_blecent/CMakeLists.txt create mode 100644 examples/nimble_blecent/Kconfig create mode 100644 examples/nimble_blecent/Make.defs create mode 100644 examples/nimble_blecent/Makefile create mode 100644 examples/nimble_blecent/blecent.h create mode 100644 examples/nimble_blecent/misc.c create mode 100644 examples/nimble_blecent/nimble_blecent_main.c create mode 100644 examples/nimble_blecent/peer.c create mode 100644 examples/nimble_bleprph/CMakeLists.txt create mode 100644 examples/nimble_bleprph/Kconfig create mode 100644 examples/nimble_bleprph/Make.defs create mode 100644 examples/nimble_bleprph/Makefile create mode 100644 examples/nimble_bleprph/bleprph.h create mode 100644 examples/nimble_bleprph/gatt_svr.c create mode 100644 examples/nimble_bleprph/misc.c create mode 100644 examples/nimble_bleprph/nimble_bleprph_main.c diff --git a/examples/nimble_blecent/CMakeLists.txt b/examples/nimble_blecent/CMakeLists.txt new file mode 100644 index 00000000000..6b10b76d66b --- /dev/null +++ b/examples/nimble_blecent/CMakeLists.txt @@ -0,0 +1,31 @@ +# ############################################################################## +# apps/examples/nimble_blecent/CMakeLists.txt +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_EXAMPLES_NIMBLE_BLECENT) + nuttx_add_application( + NAME + nimble + SRCS + ${CMAKE_CURRENT_LIST_DIR}/nimble_blecent_main.c + ${CMAKE_CURRENT_LIST_DIR}/misc.c + ${CMAKE_CURRENT_LIST_DIR}/peer.c + DEPENDS + nimble) +endif() diff --git a/examples/nimble_blecent/Kconfig b/examples/nimble_blecent/Kconfig new file mode 100644 index 00000000000..edaa65aa50e --- /dev/null +++ b/examples/nimble_blecent/Kconfig @@ -0,0 +1,30 @@ +# +# For a description of the syntax of this configuration file, +# see the file kconfig-language.txt in the NuttX tools repository. +# + +config EXAMPLES_NIMBLE_BLECENT + tristate "NimBLE peripheral" + default n + ---help--- + Enable the nimble peripheral + +if EXAMPLES_NIMBLE_BLECENT + +config EXAMPLES_NIMBLE_BLECENT_PROGNAME + string "Program name" + default "nimble" + ---help--- + This is the name of the program that will be used when the NSH ELF + program is installed. + +config EXAMPLES_NIMBLE_BLECENT_PRIORITY + int "NimBLE task priority" + default 100 + +config EXAMPLES_NIMBLE_BLECENT_STACKSIZE + int "NimBLE stack size" + default DEFAULT_TASK_STACKSIZE + +endif # EXAMPLES_NIMBLE_BLECENT + diff --git a/examples/nimble_blecent/Make.defs b/examples/nimble_blecent/Make.defs new file mode 100644 index 00000000000..fb8b4456538 --- /dev/null +++ b/examples/nimble_blecent/Make.defs @@ -0,0 +1,23 @@ +############################################################################ +# apps/examples/nimble_blecent/Make.defs +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +ifneq ($(CONFIG_EXAMPLES_NIMBLE_BLECENT),) +CONFIGURED_APPS += $(APPDIR)/examples/nimble +endif diff --git a/examples/nimble_blecent/Makefile b/examples/nimble_blecent/Makefile new file mode 100644 index 00000000000..36f93724e52 --- /dev/null +++ b/examples/nimble_blecent/Makefile @@ -0,0 +1,38 @@ +############################################################################ +# apps/examples/nimble_blecent/Makefile +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +include $(APPDIR)/Make.defs + +# NimBLE built-in application info + +PROGNAME = $(CONFIG_EXAMPLES_NIMBLE_BLECENT_PROGNAME) +PRIORITY = $(CONFIG_EXAMPLES_NIMBLE_BLECENT_PRIORITY) +STACKSIZE = $(CONFIG_EXAMPLES_NIMBLE_BLECENT_STACKSIZE) +MODULE = $(CONFIG_EXAMPLES_NIMBLE_BLECENT) + +# NimBLE Central Example + +CSRCS += misc.c peer.c +MAINSRC = nimble_blecent_main.c + +include $(APPDIR)/wireless/bluetooth/nimble/Makefile.nimble + +include $(APPDIR)/Application.mk + diff --git a/examples/nimble_blecent/blecent.h b/examples/nimble_blecent/blecent.h new file mode 100644 index 00000000000..8ae394ecd29 --- /dev/null +++ b/examples/nimble_blecent/blecent.h @@ -0,0 +1,126 @@ +/**************************************************************************** + * apps/examples/nimble_blecent/blecent.h + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +#ifndef H_BLECENT_ +#define H_BLECENT_ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#ifdef __cplusplus +extern "C" +{ +#endif + +struct ble_hs_adv_fields; +struct ble_gap_conn_desc; +struct ble_hs_cfg; +union ble_store_value; +union ble_store_key; + +#define BLECENT_SVC_ALERT_UUID 0x1811 +#define BLECENT_CHR_SUP_NEW_ALERT_CAT_UUID 0x2A47 +#define BLECENT_CHR_NEW_ALERT 0x2A46 +#define BLECENT_CHR_SUP_UNR_ALERT_CAT_UUID 0x2A48 +#define BLECENT_CHR_UNR_ALERT_STAT_UUID 0x2A45 +#define BLECENT_CHR_ALERT_NOT_CTRL_PT 0x2A44 + +/* Misc. */ + +void print_bytes(const uint8_t *bytes, int len); +void print_mbuf(const struct os_mbuf *om); +char *addr_str(const void *addr); +void print_uuid(const ble_uuid_t *uuid); +void print_conn_desc(const struct ble_gap_conn_desc *desc); +void print_adv_fields(const struct ble_hs_adv_fields *fields); + +/* Peer. */ + +struct peer_dsc +{ + SLIST_ENTRY(peer_dsc) next; + struct ble_gatt_dsc dsc; +}; +SLIST_HEAD(peer_dsc_list, peer_dsc); + +struct peer_chr +{ + SLIST_ENTRY(peer_chr) next; + struct ble_gatt_chr chr; + + struct peer_dsc_list dscs; +}; +SLIST_HEAD(peer_chr_list, peer_chr); + +struct peer_svc +{ + SLIST_ENTRY(peer_svc) next; + struct ble_gatt_svc svc; + + struct peer_chr_list chrs; +}; +SLIST_HEAD(peer_svc_list, peer_svc); + +struct peer; +typedef void peer_disc_fn(const struct peer *peer, int status, void *arg); + +struct peer +{ + SLIST_ENTRY(peer) next; + + uint16_t conn_handle; + + /* List of discovered GATT services. */ + + struct peer_svc_list svcs; + + /* Keeps track of where we are in the service discovery process. */ + + uint16_t disc_prev_chr_val; + struct peer_svc *cur_svc; + + /* Callback that gets executed when service discovery completes. */ + + peer_disc_fn *disc_cb; + void *disc_cb_arg; +}; + +int peer_disc_all(uint16_t conn_handle, peer_disc_fn *disc_cb, + void *disc_cb_arg); +const struct peer_dsc * +peer_dsc_find_uuid(const struct peer *peer, const ble_uuid_t *svc_uuid, + const ble_uuid_t *chr_uuid, const ble_uuid_t *dsc_uuid); +const struct peer_chr * +peer_chr_find_uuid(const struct peer *peer, const ble_uuid_t *svc_uuid, + const ble_uuid_t *chr_uuid); +const struct peer_svc * +peer_svc_find_uuid(const struct peer *peer, const ble_uuid_t *uuid); +int peer_delete(uint16_t conn_handle); +int peer_add(uint16_t conn_handle); +int peer_init(int max_peers, int max_svcs, int max_chrs, int max_dscs); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/examples/nimble_blecent/misc.c b/examples/nimble_blecent/misc.c new file mode 100644 index 00000000000..8ac07677f44 --- /dev/null +++ b/examples/nimble_blecent/misc.c @@ -0,0 +1,234 @@ +/**************************************************************************** + * apps/examples/nimble_blecent/misc.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +#include +#include "host/ble_hs.h" +#include "host/ble_uuid.h" +#include "blecent.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +void print_bytes(FAR const uint8_t *bytes, int len) +{ + int i; + + for (i = 0; i < len; i++) + { + printf("%s0x%02x", i != 0 ? ":" : "", bytes[i]); + } +} + +void print_mbuf(FAR const struct os_mbuf *om) +{ + int colon; + + colon = 0; + while (om != NULL) + { + if (colon) + { + printf(":"); + } + else + { + colon = 1; + } + + print_bytes(om->om_data, om->om_len); + om = SLIST_NEXT(om, om_next); + } +} + +char * addr_str(FAR const void *addr) +{ + static char buf[6 * 2 + 5 + 1]; + const uint8_t *u8p; + + u8p = addr; + sprintf(buf, "%02x:%02x:%02x:%02x:%02x:%02x", + u8p[5], u8p[4], u8p[3], u8p[2], u8p[1], u8p[0]); + + return buf; +} + +void print_uuid(FAR const ble_uuid_t *uuid) +{ + char buf[BLE_UUID_STR_LEN]; + + printf("%s", ble_uuid_to_str(uuid, buf)); +} + +void print_conn_desc(FAR const struct ble_gap_conn_desc *desc) +{ + printf("handle=%d our_ota_addr_type=%d our_ota_addr=%s ", + desc->conn_handle, desc->our_ota_addr.type, + addr_str(desc->our_ota_addr.val)); + printf("our_id_addr_type=%d our_id_addr=%s ", + desc->our_id_addr.type, addr_str(desc->our_id_addr.val)); + printf("peer_ota_addr_type=%d peer_ota_addr=%s ", + desc->peer_ota_addr.type, addr_str(desc->peer_ota_addr.val)); + printf("peer_id_addr_type=%d peer_id_addr=%s ", + desc->peer_id_addr.type, addr_str(desc->peer_id_addr.val)); + printf("conn_itvl=%d conn_latency=%d supervision_timeout=%d " + "encrypted=%d authenticated=%d bonded=%d", + desc->conn_itvl, desc->conn_latency, + desc->supervision_timeout, + desc->sec_state.encrypted, + desc->sec_state.authenticated, + desc->sec_state.bonded); +} + +void print_adv_fields(FAR const struct ble_hs_adv_fields *fields) +{ + char s[BLE_HS_ADV_MAX_SZ]; + const uint8_t *u8p; + int i; + + if (fields->flags != 0) + { + printf(" flags=0x%02x\n", fields->flags); + } + + if (fields->uuids16 != NULL) + { + printf(" uuids16(%scomplete)=", + fields->uuids16_is_complete ? "" : "in"); + for (i = 0; i < fields->num_uuids16; i++) + { + print_uuid(&fields->uuids16[i].u); + printf(" "); + } + + printf("\n"); + } + + if (fields->uuids32 != NULL) + { + printf(" uuids32(%scomplete)=", + fields->uuids32_is_complete ? "" : "in"); + for (i = 0; i < fields->num_uuids32; i++) + { + print_uuid(&fields->uuids32[i].u); + printf(" "); + } + + printf("\n"); + } + + if (fields->uuids128 != NULL) + { + printf(" uuids128(%scomplete)=", + fields->uuids128_is_complete ? "" : "in"); + for (i = 0; i < fields->num_uuids128; i++) + { + print_uuid(&fields->uuids128[i].u); + printf(" "); + } + + printf("\n"); + } + + if (fields->name != NULL) + { + assert(fields->name_len < sizeof s - 1); + memcpy(s, fields->name, fields->name_len); + s[fields->name_len] = '\0'; + printf(" name(%scomplete)=%s\n", + fields->name_is_complete ? "" : "in", s); + } + + if (fields->tx_pwr_lvl_is_present) + { + printf(" tx_pwr_lvl=%d\n", fields->tx_pwr_lvl); + } + + if (fields->slave_itvl_range != NULL) + { + printf(" slave_itvl_range="); + print_bytes(fields->slave_itvl_range, BLE_HS_ADV_SLAVE_ITVL_RANGE_LEN); + printf("\n"); + } + + if (fields->svc_data_uuid16 != NULL) + { + printf(" svc_data_uuid16="); + print_bytes(fields->svc_data_uuid16, fields->svc_data_uuid16_len); + printf("\n"); + } + + if (fields->public_tgt_addr != NULL) + { + printf(" public_tgt_addr="); + u8p = fields->public_tgt_addr; + for (i = 0; i < fields->num_public_tgt_addrs; i++) + { + printf("public_tgt_addr=%s ", addr_str(u8p)); + u8p += BLE_HS_ADV_PUBLIC_TGT_ADDR_ENTRY_LEN; + } + + printf("\n"); + } + + if (fields->appearance_is_present) + { + printf(" appearance=0x%04x\n", fields->appearance); + } + + if (fields->adv_itvl_is_present) + { + printf(" adv_itvl=0x%04x\n", fields->adv_itvl); + } + + if (fields->svc_data_uuid32 != NULL) + { + printf(" svc_data_uuid32="); + print_bytes(fields->svc_data_uuid32, fields->svc_data_uuid32_len); + printf("\n"); + } + + if (fields->svc_data_uuid128 != NULL) + { + printf(" svc_data_uuid128="); + print_bytes(fields->svc_data_uuid128, fields->svc_data_uuid128_len); + printf("\n"); + } + + if (fields->uri != NULL) + { + printf(" uri="); + print_bytes(fields->uri, fields->uri_len); + printf("\n"); + } + + if (fields->mfg_data != NULL) + { + printf(" mfg_data="); + print_bytes(fields->mfg_data, fields->mfg_data_len); + printf("\n"); + } +} diff --git a/examples/nimble_blecent/nimble_blecent_main.c b/examples/nimble_blecent/nimble_blecent_main.c new file mode 100644 index 00000000000..6e2bd0cb61f --- /dev/null +++ b/examples/nimble_blecent/nimble_blecent_main.c @@ -0,0 +1,692 @@ +/**************************************************************************** + * apps/examples/nimble_blecent/nimble_blecent_main.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include + +/* BLE */ + +#include "nimble/ble.h" +#include "nimble/nimble_port.h" +#include "host/ble_hs.h" +#include "host/util/util.h" + +/* Mandatory services. */ + +#include "services/gap/ble_svc_gap.h" +#include "services/gatt/ble_svc_gatt.h" +#include "services/bas/ble_svc_bas.h" + +/* Application-specified header. */ + +#include "blecent.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#define BLECENT_BAS_UUID 0x180f +#define BLECENT_CHR_BAS_BL_UUID 0x2a19 + +/* Not used now */ + +#define TASK_DEFAULT_PRIORITY CONFIG_EXAMPLES_NIMBLE_BLECENT_PRIORITY +#define TASK_DEFAULT_STACK NULL +#define TASK_DEFAULT_STACK_SIZE 0 + +/**************************************************************************** + * External Functions Prototypes + ****************************************************************************/ + +void ble_hci_sock_ack_handler(FAR void *param); +void ble_hci_sock_set_device(int dev); + +/**************************************************************************** + * Private Functions Prototypes + ****************************************************************************/ + +static int blecent_gap_event(FAR struct ble_gap_event *event, FAR void *arg); + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +/**************************************************************************** + * Name: blecent_on_read + ****************************************************************************/ + +static int +blecent_on_read(uint16_t conn_handle, + FAR const struct ble_gatt_error *error, + FAR struct ble_gatt_attr *attr, + FAR void *arg) +{ + printf("Read complete; status=%d conn_handle=%d", error->status, + conn_handle); + if (error->status == 0) + { + printf(" attr_handle=%d value=", attr->handle); + print_mbuf(attr->om); + } + printf("\n"); + + return 0; +} + +/**************************************************************************** + * Name: blecent_on_write + ****************************************************************************/ + +static int +blecent_on_write(uint16_t conn_handle, + FAR const struct ble_gatt_error *error, + FAR struct ble_gatt_attr *attr, + FAR void *arg) +{ + printf("Write complete; status=%d conn_handle=%d attr_handle=%d\n", + error->status, conn_handle, attr->handle); + + return 0; +} + +/** + * Application callback. Called when the attempt to subscribe to + * notifications for the ANS Unread Alert Status characteristic + * has completed. + */ + +static int +blecent_on_subscribe(uint16_t conn_handle, + FAR const struct ble_gatt_error *error, + FAR struct ble_gatt_attr *attr, + FAR void *arg) +{ + printf("Subscribe complete; status=%d conn_handle=%d " + "attr_handle=%d\n", + error->status, conn_handle, attr->handle); + + return 0; +} + +/**************************************************************************** + * Name: blecent_read_write_subscribe + ****************************************************************************/ + +static void +blecent_read_write_subscribe(FAR const struct peer *peer) +{ + const struct peer_chr *chr; + const struct peer_dsc *dsc; + uint8_t value[2]; + int rc; + + /* Read the supported-new-alert-category characteristic. */ + + chr = peer_chr_find_uuid(peer, + BLE_UUID16_DECLARE(BLECENT_SVC_ALERT_UUID), + BLE_UUID16_DECLARE(BLECENT_CHR_SUP_NEW_ALERT_CAT_UUID)); + if (chr == NULL) + { + printf("Error: Peer doesn't support the Supported New " + "Alert Category characteristic\n"); + goto err; + } + + rc = ble_gattc_read(peer->conn_handle, chr->chr.val_handle, + blecent_on_read, NULL); + if (rc != 0) + { + printf("Error: Failed to read characteristic; rc=%d\n", + rc); + goto err; + } + + /* Write two bytes (99, 100) to the alert-notification-control-point + * characteristic. + */ + + chr = peer_chr_find_uuid(peer, + BLE_UUID16_DECLARE(BLECENT_SVC_ALERT_UUID), + BLE_UUID16_DECLARE(BLECENT_CHR_ALERT_NOT_CTRL_PT)); + if (chr == NULL) + { + printf("Error: Peer doesn't support the Alert " + "Notification Control Point characteristic\n"); + goto err; + } + + value[0] = 99; + value[1] = 100; + rc = ble_gattc_write_flat(peer->conn_handle, chr->chr.val_handle, + value, sizeof value, blecent_on_write, NULL); + if (rc != 0) + { + printf("Error: Failed to write characteristic; rc=%d\n", + rc); + } + + /* Subscribe to notifications for the Battery Level characteristic. + * A central enables notifications by writing two bytes (1, 0) to the + * characteristic's client-characteristic-configuration-descriptor (CCCD). + */ + + dsc = peer_dsc_find_uuid(peer, + BLE_UUID16_DECLARE(BLE_SVC_BAS_UUID16), + BLE_UUID16_DECLARE(BLE_SVC_BAS_CHR_UUID16_BATTERY_LEVEL), + BLE_UUID16_DECLARE(BLE_GATT_DSC_CLT_CFG_UUID16)); + if (dsc == NULL) + { + printf("Error: Peer lacks a CCCD for the \ + Battery Level characteristic\n"); + goto err; + } + + value[0] = 1; + value[1] = 0; + rc = ble_gattc_write_flat(peer->conn_handle, dsc->dsc.handle, + value, sizeof value, blecent_on_subscribe, NULL); + if (rc != 0) + { + printf("Error: Failed to subscribe to characteristic; " + "rc=%d\n", + rc); + goto err; + } + + return; + +err: + + /* Terminate the connection. */ + + ble_gap_terminate(peer->conn_handle, BLE_ERR_REM_USER_CONN_TERM); +} + +/**************************************************************************** + * Name: blecent_on_disc_complete + ****************************************************************************/ + +static void +blecent_on_disc_complete(FAR const struct peer *peer, int status, + FAR void *arg) +{ + if (status != 0) + { + /* Service discovery failed. Terminate the connection. */ + + printf("Error: Service discovery failed; status=%d " + "conn_handle=%d\n", + status, peer->conn_handle); + ble_gap_terminate(peer->conn_handle, BLE_ERR_REM_USER_CONN_TERM); + return; + } + + /* Service discovery has completed successfully. Now we have a complete + * list of services, characteristics, and descriptors that the peer + * supports. + */ + + printf("Service discovery complete; status=%d " + "conn_handle=%d\n", + status, peer->conn_handle); + + /* Now perform three concurrent GATT procedures against the peer: read, + * write, and subscribe to notifications. + */ + + blecent_read_write_subscribe(peer); +} + +/**************************************************************************** + * Name: blecent_scan + ****************************************************************************/ + +static void blecent_scan(void) +{ + uint8_t own_addr_type; + struct ble_gap_disc_params disc_params; + int rc; + + /* Figure out address to use while advertising (no privacy for now) */ + + rc = ble_hs_id_infer_auto(0, &own_addr_type); + if (rc != 0) + { + printf("error determining address type; rc=%d\n", rc); + return; + } + + /* Tell the controller to filter duplicates; we don't want to process + * repeated advertisements from the same device. + */ + + disc_params.filter_duplicates = 1; + + /** + * Perform a passive scan. I.e., don't send follow-up scan requests to + * each advertiser. + */ + + disc_params.passive = 1; + + /* Use defaults for the rest of the parameters. */ + + disc_params.itvl = 0; + disc_params.window = 0; + disc_params.filter_policy = 0; + disc_params.limited = 0; + + rc = ble_gap_disc(own_addr_type, BLE_HS_FOREVER, &disc_params, + blecent_gap_event, NULL); + if (rc != 0) + { + printf("Error initiating GAP discovery procedure; rc=%d\n", + rc); + } +} + +/**************************************************************************** + * Name: blecent_should_connect + ****************************************************************************/ + +static int +blecent_should_connect(const struct ble_gap_disc_desc *disc) +{ + struct ble_hs_adv_fields fields; + int rc; + int i; + + /* The device has to be advertising connectability. */ + + if (disc->event_type != BLE_HCI_ADV_RPT_EVTYPE_ADV_IND && + disc->event_type != BLE_HCI_ADV_RPT_EVTYPE_DIR_IND) + { + return 0; + } + + rc = ble_hs_adv_parse_fields(&fields, disc->data, disc->length_data); + if (rc != 0) + { + return 0; + } + + /* The device has to advertise support for the Alert Notification + * service (0x1811). + */ + + for (i = 0; i < fields.num_uuids16; i++) + { + if (ble_uuid_u16(&fields.uuids16[i].u) == BLECENT_SVC_ALERT_UUID) + { + return 1; + } + } + + return 0; +} + +/**************************************************************************** + * Name: blecent_connect_if_interesting + ****************************************************************************/ + +static void +blecent_connect_if_interesting(FAR const struct ble_gap_disc_desc *disc) +{ + uint8_t own_addr_type; + int rc; + + /* Don't do anything if we don't care about this advertiser. */ + + if (!blecent_should_connect(disc)) + { + return; + } + + /* Scanning must be stopped before a connection can be initiated. */ + + rc = ble_gap_disc_cancel(); + if (rc != 0) + { + printf("Failed to cancel scan; rc=%d\n", rc); + return; + } + + /* Figure out address to use for connect (no privacy for now) */ + + rc = ble_hs_id_infer_auto(0, &own_addr_type); + if (rc != 0) + { + printf("error determining address type; rc=%d\n", rc); + return; + } + + /* Try to connect the the advertiser. Allow 30 seconds (30000 ms) for + * timeout. + */ + + rc = ble_gap_connect(own_addr_type, &disc->addr, 30000, NULL, + blecent_gap_event, NULL); + if (rc != 0) + { + printf("Error: Failed to connect to device; addr_type=%d " + "addr=%s\n; rc=%d", + disc->addr.type, addr_str(disc->addr.val), rc); + return; + } +} + +/**************************************************************************** + * Name: blecent_gap_event + ****************************************************************************/ + +static int +blecent_gap_event(FAR struct ble_gap_event *event, FAR void *arg) +{ + struct ble_gap_conn_desc desc; + struct ble_hs_adv_fields fields; + int rc; + + switch (event->type) + { + case BLE_GAP_EVENT_DISC: + rc = ble_hs_adv_parse_fields(&fields, event->disc.data, + event->disc.length_data); + if (rc != 0) + { + return 0; + } + + /* An advertisment report was received during GAP discovery. */ + + print_adv_fields(&fields); + + /* Try to connect to the advertiser if it looks interesting. */ + + blecent_connect_if_interesting(&event->disc); + return 0; + + case BLE_GAP_EVENT_CONNECT: + + /* A new connection was established or a connection attempt failed. */ + + if (event->connect.status == 0) + { + /* Connection successfully established. */ + + printf("Connection established "); + + rc = ble_gap_conn_find(event->connect.conn_handle, &desc); + assert(rc == 0); + print_conn_desc(&desc); + printf("\n"); + + /* Remember peer. */ + + rc = peer_add(event->connect.conn_handle); + if (rc != 0) + { + printf("Failed to add peer; rc=%d\n", rc); + return 0; + } + + /* Perform service discovery. */ + + rc = peer_disc_all(event->connect.conn_handle, + blecent_on_disc_complete, NULL); + if (rc != 0) + { + printf("Failed to discover services; rc=%d\n", rc); + return 0; + } + } + else + { + /* Connection attempt failed; resume scanning. */ + + printf("Error: Connection failed; status=%d\n", + event->connect.status); + blecent_scan(); + } + + return 0; + + case BLE_GAP_EVENT_DISCONNECT: + + /* Connection terminated. */ + + printf("disconnect; reason=%d ", event->disconnect.reason); + print_conn_desc(&event->disconnect.conn); + printf("\n"); + + /* Forget about peer. */ + + peer_delete(event->disconnect.conn.conn_handle); + + /* Resume scanning. */ + + blecent_scan(); + return 0; + + case BLE_GAP_EVENT_DISC_COMPLETE: + printf("discovery complete; reason=%d\n", + event->disc_complete.reason); + return 0; + + case BLE_GAP_EVENT_ENC_CHANGE: + + /* Encryption has been enabled or disabled for this connection. */ + + printf("encryption change event; status=%d ", + event->enc_change.status); + rc = ble_gap_conn_find(event->enc_change.conn_handle, &desc); + assert(rc == 0); + print_conn_desc(&desc); + return 0; + + case BLE_GAP_EVENT_NOTIFY_RX: + + /* Peer sent us a notification or indication. */ + + printf("received %s; conn_handle=%d attr_handle=%d " + "attr_len=%d\n", + event->notify_rx.indication ? "indication" : "notification", + event->notify_rx.conn_handle, + event->notify_rx.attr_handle, + OS_MBUF_PKTLEN(event->notify_rx.om)); + + uint8_t notif_data[100]; /* Size depending on the actual size of the notification data you have */ + uint16_t notif_len; + int offset = 0; + notif_len = OS_MBUF_PKTLEN(event->notify_rx.om); + os_mbuf_copydata(event->notify_rx.om, offset, notif_len, notif_data); + + printf("notification data: "); + for (int i = 0; i < notif_len; i++) + { + printf("%02d ", notif_data[i]); + } + printf("\n"); + + /* Attribute data is contained in event->notify_rx.attr_data. */ + + return 0; + + case BLE_GAP_EVENT_MTU: + printf("mtu update event; conn_handle=%d cid=%d mtu=%d\n", + event->mtu.conn_handle, + event->mtu.channel_id, + event->mtu.value); + return 0; + + case BLE_GAP_EVENT_REPEAT_PAIRING: + /* We already have a bond with the peer, but it is attempting to + * establish a new secure link. This app sacrifices security for + * convenience: just throw away the old bond and accept the new link. + */ + + /* Delete the old bond. */ + + rc = ble_gap_conn_find(event->repeat_pairing.conn_handle, &desc); + assert(rc == 0); + ble_store_util_delete_peer(&desc.peer_id_addr); + + /* Return BLE_GAP_REPEAT_PAIRING_RETRY to indicate that the host should + * continue with the pairing operation. + */ + + return BLE_GAP_REPEAT_PAIRING_RETRY; + + default: + return 0; + } +} + +static void +blecent_on_reset(int reason) +{ + printf("Resetting state; reason=%d\n", reason); +} + +/**************************************************************************** + * Name: blecent_on_sync + ****************************************************************************/ + +static void +blecent_on_sync(void) +{ + int rc; + + /* Make sure we have proper identity address set (public preferred) */ + + rc = ble_hs_util_ensure_addr(0); + assert(rc == 0); + + /* Begin scanning for a peripheral to connect to. */ + + blecent_scan(); +} + +/**************************************************************************** + * Name: nimble_host_task + ****************************************************************************/ + +static void nimble_host_task(FAR void *param) +{ + ble_svc_gap_device_name_set("NuttX NimBLE CENT"); + nimble_port_run(); +} + +/**************************************************************************** + * Name: ble_hci_sock_task + ****************************************************************************/ + +static FAR void *ble_hci_sock_task(FAR void *param) +{ + ble_hci_sock_ack_handler(param); + return NULL; +} + +/**************************************************************************** + * Name: ble_host_task + ****************************************************************************/ + +static FAR void *ble_host_task(FAR void *param) +{ + nimble_host_task(param); + return NULL; +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: nimble_main + ****************************************************************************/ + +int main(int argc, FAR char **argv) +{ + struct ble_npl_task s_task_host; + struct ble_npl_task s_task_hci; + int ret = 0; + + /* allow to specify custom hci */ + + if (argc > 1) + { + ble_hci_sock_set_device(atoi(argv[1])); + } + +#ifndef CONFIG_NSH_ARCHINIT + /* Perform architecture-specific initialization */ + + boardctl(BOARDIOC_INIT, 0); +#endif + +#ifndef CONFIG_NSH_NETINIT + /* Bring up the network */ + + netinit_bringup(); +#endif + + nimble_port_init(); + + /* Configure the host. */ + + ble_hs_cfg.reset_cb = blecent_on_reset; + ble_hs_cfg.sync_cb = blecent_on_sync; + ble_hs_cfg.store_status_cb = ble_store_util_status_rr; + + /* Initialize data structures to track connected peers. */ + + ret = peer_init(MYNEWT_VAL(BLE_MAX_CONNECTIONS), 64, 64, 64); + assert(ret == 0); + + /* Create task which handles HCI socket */ + + ret = ble_npl_task_init(&s_task_hci, "hci_sock", ble_hci_sock_task, + NULL, TASK_DEFAULT_PRIORITY, BLE_NPL_TIME_FOREVER, + TASK_DEFAULT_STACK, TASK_DEFAULT_STACK_SIZE); + if (ret != 0) + { + printf("ERROR: starting hci task: %i\n", ret); + } + + /* Create task which handles default event queue for host stack. */ + + ret = ble_npl_task_init(&s_task_host, "ble_host", ble_host_task, + NULL, TASK_DEFAULT_PRIORITY, BLE_NPL_TIME_FOREVER, + TASK_DEFAULT_STACK, TASK_DEFAULT_STACK_SIZE); + if (ret != 0) + { + printf("ERROR: starting ble task: %i\n", ret); + } + + while (true) + { + sleep(1); + } + + return 0; +} diff --git a/examples/nimble_blecent/peer.c b/examples/nimble_blecent/peer.c new file mode 100644 index 00000000000..3ed07729040 --- /dev/null +++ b/examples/nimble_blecent/peer.c @@ -0,0 +1,933 @@ +/**************************************************************************** + * apps/examples/nimble_blecent/peer.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +#include "host/ble_hs.h" +#include "blecent.h" + +static void *peer_svc_mem; +static struct os_mempool peer_svc_pool; + +static void *peer_chr_mem; +static struct os_mempool peer_chr_pool; + +static void *peer_dsc_mem; +static struct os_mempool peer_dsc_pool; + +static void *peer_mem; +static struct os_mempool peer_pool; +static SLIST_HEAD(, peer) peers; + +static struct peer_svc * +peer_svc_find_range(FAR struct peer *peer, uint16_t attr_handle); +static struct peer_svc * +peer_svc_find(FAR struct peer *peer, uint16_t svc_start_handle, + struct peer_svc **out_prev); +int peer_svc_is_empty(const struct peer_svc *svc); + +uint16_t +chr_end_handle(FAR const struct peer_svc *svc, + FAR const struct peer_chr *chr); +int chr_is_empty(FAR const struct peer_svc *svc, + FAR const struct peer_chr *chr); +static struct peer_chr * +peer_chr_find(FAR const struct peer_svc *svc, uint16_t chr_def_handle, + FAR struct peer_chr **out_prev); +static void +peer_disc_chrs(FAR struct peer *peer); + +static int +peer_dsc_disced(uint16_t conn_handle, FAR const struct ble_gatt_error *error, + uint16_t chr_val_handle, FAR const struct ble_gatt_dsc *dsc, + FAR void *arg); + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +static struct peer *peer_find(uint16_t conn_handle) +{ + struct peer *peer; + + SLIST_FOREACH(peer, &peers, next) + { + if (peer->conn_handle == conn_handle) + { + return peer; + } + } + + return NULL; +} + +static void peer_disc_complete(FAR struct peer *peer, int rc) +{ + peer->disc_prev_chr_val = 0; + + /* Notify caller that discovery has completed. */ + + if (peer->disc_cb != NULL) + { + peer->disc_cb(peer, rc, peer->disc_cb_arg); + } +} + +static struct peer_dsc * +peer_dsc_find_prev(FAR const struct peer_chr *chr, uint16_t dsc_handle) +{ + struct peer_dsc *prev; + struct peer_dsc *dsc; + + prev = NULL; + SLIST_FOREACH(dsc, &chr->dscs, next) + { + if (dsc->dsc.handle >= dsc_handle) + { + break; + } + + prev = dsc; + } + + return prev; +} + +static struct peer_dsc * +peer_dsc_find(FAR const struct peer_chr *chr, uint16_t dsc_handle, + FAR struct peer_dsc **out_prev) +{ + struct peer_dsc *prev; + struct peer_dsc *dsc; + + prev = peer_dsc_find_prev(chr, dsc_handle); + if (prev == NULL) + { + dsc = SLIST_FIRST(&chr->dscs); + } + else + { + dsc = SLIST_NEXT(prev, next); + } + + if (dsc != NULL && dsc->dsc.handle != dsc_handle) + { + dsc = NULL; + } + + if (out_prev != NULL) + { + *out_prev = prev; + } + + return dsc; +} + +static int +peer_dsc_add(FAR struct peer *peer, uint16_t chr_val_handle, + FAR const struct ble_gatt_dsc *gatt_dsc) +{ + struct peer_dsc *prev; + struct peer_dsc *dsc; + struct peer_svc *svc; + struct peer_chr *chr; + + svc = peer_svc_find_range(peer, chr_val_handle); + if (svc == NULL) + { + /* Can't find service for discovered descriptor; + * this shouldn't happen. + */ + + assert(0); + return BLE_HS_EUNKNOWN; + } + + chr = peer_chr_find(svc, chr_val_handle, NULL); + if (chr == NULL) + { + /* Can't find characteristic for discovered descriptor; + * this shouldn't happen. + */ + + assert(0); + return BLE_HS_EUNKNOWN; + } + + dsc = peer_dsc_find(chr, gatt_dsc->handle, &prev); + if (dsc != NULL) + { + /* Descriptor already discovered. */ + + return 0; + } + + dsc = os_memblock_get(&peer_dsc_pool); + if (dsc == NULL) + { + /* Out of memory. */ + + return BLE_HS_ENOMEM; + } + + memset(dsc, 0, sizeof *dsc); + + dsc->dsc = *gatt_dsc; + + if (prev == NULL) + { + SLIST_INSERT_HEAD(&chr->dscs, dsc, next); + } + else + { + SLIST_NEXT(prev, next) = dsc; + } + + return 0; +} + +static void peer_disc_dscs(FAR struct peer *peer) +{ + struct peer_chr *chr; + struct peer_svc *svc; + int rc; + + /* Search through the list of discovered characteristics for the first + * characteristic that contains undiscovered descriptors. + * Then, discover all descriptors belonging to that characteristic. + */ + + SLIST_FOREACH(svc, &peer->svcs, next) + { + SLIST_FOREACH(chr, &svc->chrs, next) + { + if (!chr_is_empty(svc, chr) && + SLIST_EMPTY(&chr->dscs) && + peer->disc_prev_chr_val <= chr->chr.def_handle) + { + rc = ble_gattc_disc_all_dscs(peer->conn_handle, + chr->chr.val_handle, + chr_end_handle(svc, chr), + peer_dsc_disced, peer); + if (rc != 0) + { + peer_disc_complete(peer, rc); + } + + peer->disc_prev_chr_val = chr->chr.val_handle; + return; + } + } + } + + /* All descriptors discovered. */ + + peer_disc_complete(peer, 0); +} + +static int +peer_dsc_disced(uint16_t conn_handle, FAR const struct ble_gatt_error *error, + uint16_t chr_val_handle, FAR const struct ble_gatt_dsc *dsc, + FAR void *arg) +{ + struct peer *peer; + int rc; + + peer = arg; + assert(peer->conn_handle == conn_handle); + + switch (error->status) + { + case 0: + rc = peer_dsc_add(peer, chr_val_handle, dsc); + break; + + case BLE_HS_EDONE: + /* All descriptors in this characteristic discovered; + * start discovering descriptors in the next characteristic. + */ + + if (peer->disc_prev_chr_val > 0) + { + peer_disc_dscs(peer); + } + + rc = 0; + break; + + default: + + /* Error; abort discovery. */ + + rc = error->status; + break; + } + + if (rc != 0) + { + /* Error; abort discovery. */ + + peer_disc_complete(peer, rc); + } + + return rc; +} + +uint16_t +chr_end_handle(FAR const struct peer_svc *svc, + FAR const struct peer_chr *chr) +{ + const struct peer_chr *next_chr; + + next_chr = SLIST_NEXT(chr, next); + if (next_chr != NULL) + { + return next_chr->chr.def_handle - 1; + } + else + { + return svc->svc.end_handle; + } +} + +int chr_is_empty(FAR const struct peer_svc *svc, + FAR const struct peer_chr *chr) +{ + return chr_end_handle(svc, chr) <= chr->chr.val_handle; +} + +static struct peer_chr * +peer_chr_find_prev(const struct peer_svc *svc, uint16_t chr_val_handle) +{ + struct peer_chr *prev; + struct peer_chr *chr; + + prev = NULL; + SLIST_FOREACH(chr, &svc->chrs, next) + { + if (chr->chr.val_handle >= chr_val_handle) + { + break; + } + + prev = chr; + } + + return prev; +} + +static struct peer_chr * +peer_chr_find(FAR const struct peer_svc *svc, uint16_t chr_val_handle, + FAR struct peer_chr **out_prev) +{ + struct peer_chr *prev; + struct peer_chr *chr; + + prev = peer_chr_find_prev(svc, chr_val_handle); + if (prev == NULL) + { + chr = SLIST_FIRST(&svc->chrs); + } + else + { + chr = SLIST_NEXT(prev, next); + } + + if (chr != NULL && chr->chr.val_handle != chr_val_handle) + { + chr = NULL; + } + + if (out_prev != NULL) + { + *out_prev = prev; + } + + return chr; +} + +static void peer_chr_delete(FAR struct peer_chr *chr) +{ + struct peer_dsc *dsc; + + while ((dsc = SLIST_FIRST(&chr->dscs)) != NULL) + { + SLIST_REMOVE_HEAD(&chr->dscs, next); + os_memblock_put(&peer_dsc_pool, dsc); + } + + os_memblock_put(&peer_chr_pool, chr); +} + +static int +peer_chr_add(FAR struct peer *peer, uint16_t svc_start_handle, + FAR const struct ble_gatt_chr *gatt_chr) +{ + struct peer_chr *prev; + struct peer_chr *chr; + struct peer_svc *svc; + + svc = peer_svc_find(peer, svc_start_handle, NULL); + if (svc == NULL) + { + /* Can't find service for discovered characteristic; this shouldn't + * happen. + */ + + assert(0); + return BLE_HS_EUNKNOWN; + } + + chr = peer_chr_find(svc, gatt_chr->def_handle, &prev); + if (chr != NULL) + { + /* Characteristic already discovered. */ + + return 0; + } + + chr = os_memblock_get(&peer_chr_pool); + if (chr == NULL) + { + /* Out of memory. */ + + return BLE_HS_ENOMEM; + } + + memset(chr, 0, sizeof *chr); + + chr->chr = *gatt_chr; + + if (prev == NULL) + { + SLIST_INSERT_HEAD(&svc->chrs, chr, next); + } + else + { + SLIST_NEXT(prev, next) = chr; + } + + return 0; +} + +static int +peer_chr_disced(uint16_t conn_handle, FAR const struct ble_gatt_error *error, + FAR const struct ble_gatt_chr *chr, FAR void *arg) +{ + struct peer *peer; + int rc; + + peer = arg; + assert(peer->conn_handle == conn_handle); + + switch (error->status) + { + case 0: + rc = peer_chr_add(peer, peer->cur_svc->svc.start_handle, chr); + break; + + case BLE_HS_EDONE: + /* All characteristics in this service discovered; start discovering + * characteristics in the next service. + */ + + if (peer->disc_prev_chr_val > 0) + { + peer_disc_chrs(peer); + } + + rc = 0; + break; + + default: + rc = error->status; + break; + } + + if (rc != 0) + { + /* Error; abort discovery. */ + + peer_disc_complete(peer, rc); + } + + return rc; +} + +static void peer_disc_chrs(FAR struct peer *peer) +{ + struct peer_svc *svc; + int rc; + + /* Search through the list of discovered service for the first + * service that contains undiscovered characteristics. + * Then, discover all characteristics belonging to that service. + */ + + SLIST_FOREACH(svc, &peer->svcs, next) + { + if (!peer_svc_is_empty(svc) && SLIST_EMPTY(&svc->chrs)) + { + peer->cur_svc = svc; + rc = ble_gattc_disc_all_chrs(peer->conn_handle, + svc->svc.start_handle, + svc->svc.end_handle, + peer_chr_disced, peer); + if (rc != 0) + { + peer_disc_complete(peer, rc); + } + + return; + } + } + + /* All characteristics discovered. */ + + peer_disc_dscs(peer); +} + +int peer_svc_is_empty(FAR const struct peer_svc *svc) +{ + return svc->svc.end_handle <= svc->svc.start_handle; +} + +static struct peer_svc * +peer_svc_find_prev(FAR struct peer *peer, uint16_t svc_start_handle) +{ + struct peer_svc *prev; + struct peer_svc *svc; + + prev = NULL; + SLIST_FOREACH(svc, &peer->svcs, next) + { + if (svc->svc.start_handle >= svc_start_handle) + { + break; + } + + prev = svc; + } + + return prev; +} + +static struct peer_svc * +peer_svc_find(FAR struct peer *peer, uint16_t svc_start_handle, + FAR struct peer_svc **out_prev) +{ + struct peer_svc *prev; + struct peer_svc *svc; + + prev = peer_svc_find_prev(peer, svc_start_handle); + if (prev == NULL) + { + svc = SLIST_FIRST(&peer->svcs); + } + else + { + svc = SLIST_NEXT(prev, next); + } + + if (svc != NULL && svc->svc.start_handle != svc_start_handle) + { + svc = NULL; + } + + if (out_prev != NULL) + { + *out_prev = prev; + } + + return svc; +} + +static struct peer_svc * +peer_svc_find_range(FAR struct peer *peer, uint16_t attr_handle) +{ + struct peer_svc *svc; + + SLIST_FOREACH(svc, &peer->svcs, next) + { + if (svc->svc.start_handle <= attr_handle && + svc->svc.end_handle >= attr_handle) + { + return svc; + } + } + + return NULL; +} + +const struct peer_svc * +peer_svc_find_uuid(FAR const struct peer *peer, FAR const ble_uuid_t *uuid) +{ + const struct peer_svc *svc; + + SLIST_FOREACH(svc, &peer->svcs, next) + { + if (ble_uuid_cmp(&svc->svc.uuid.u, uuid) == 0) + { + return svc; + } + } + + return NULL; +} + +const struct peer_chr * +peer_chr_find_uuid(FAR const struct peer *peer, + FAR const ble_uuid_t *svc_uuid, + FAR const ble_uuid_t *chr_uuid) +{ + const struct peer_svc *svc; + const struct peer_chr *chr; + + svc = peer_svc_find_uuid(peer, svc_uuid); + if (svc == NULL) + { + return NULL; + } + + SLIST_FOREACH(chr, &svc->chrs, next) + { + if (ble_uuid_cmp(&chr->chr.uuid.u, chr_uuid) == 0) + { + return chr; + } + } + + return NULL; +} + +const struct peer_dsc * +peer_dsc_find_uuid(FAR const struct peer *peer, + FAR const ble_uuid_t *svc_uuid, + FAR const ble_uuid_t *chr_uuid, + FAR const ble_uuid_t *dsc_uuid) +{ + const struct peer_chr *chr; + const struct peer_dsc *dsc; + + chr = peer_chr_find_uuid(peer, svc_uuid, chr_uuid); + if (chr == NULL) + { + return NULL; + } + + SLIST_FOREACH(dsc, &chr->dscs, next) + { + if (ble_uuid_cmp(&dsc->dsc.uuid.u, dsc_uuid) == 0) + { + return dsc; + } + } + + return NULL; +} + +static int +peer_svc_add(FAR struct peer *peer, FAR const struct ble_gatt_svc *gatt_svc) +{ + struct peer_svc *prev; + struct peer_svc *svc; + + svc = peer_svc_find(peer, gatt_svc->start_handle, &prev); + if (svc != NULL) + { + /* Service already discovered. */ + + return 0; + } + + svc = os_memblock_get(&peer_svc_pool); + if (svc == NULL) + { + /* Out of memory. */ + + return BLE_HS_ENOMEM; + } + + memset(svc, 0, sizeof *svc); + + svc->svc = *gatt_svc; + SLIST_INIT(&svc->chrs); + + if (prev == NULL) + { + SLIST_INSERT_HEAD(&peer->svcs, svc, next); + } + else + { + SLIST_INSERT_AFTER(prev, svc, next); + } + + return 0; +} + +static void peer_svc_delete(FAR struct peer_svc *svc) +{ + struct peer_chr *chr; + + while ((chr = SLIST_FIRST(&svc->chrs)) != NULL) + { + SLIST_REMOVE_HEAD(&svc->chrs, next); + peer_chr_delete(chr); + } + + os_memblock_put(&peer_svc_pool, svc); +} + +static int +peer_svc_disced(uint16_t conn_handle, FAR const struct ble_gatt_error *error, + FAR const struct ble_gatt_svc *service, FAR void *arg) +{ + struct peer *peer; + int rc; + + peer = arg; + assert(peer->conn_handle == conn_handle); + + switch (error->status) + { + case 0: + rc = peer_svc_add(peer, service); + break; + + case BLE_HS_EDONE: + + /* All services discovered; start discovering characteristics. */ + + if (peer->disc_prev_chr_val > 0) + { + peer_disc_chrs(peer); + } + + rc = 0; + break; + + default: + rc = error->status; + break; + } + + if (rc != 0) + { + /* Error; abort discovery. */ + + peer_disc_complete(peer, rc); + } + + return rc; +} + +int peer_disc_all(uint16_t conn_handle, FAR peer_disc_fn *disc_cb, + FAR void *disc_cb_arg) +{ + struct peer_svc *svc; + struct peer *peer; + int rc; + + peer = peer_find(conn_handle); + if (peer == NULL) + { + return BLE_HS_ENOTCONN; + } + + /* Undiscover everything first. */ + + while ((svc = SLIST_FIRST(&peer->svcs)) != NULL) + { + SLIST_REMOVE_HEAD(&peer->svcs, next); + peer_svc_delete(svc); + } + + peer->disc_prev_chr_val = 1; + peer->disc_cb = disc_cb; + peer->disc_cb_arg = disc_cb_arg; + + rc = ble_gattc_disc_all_svcs(conn_handle, peer_svc_disced, peer); + if (rc != 0) + { + return rc; + } + + return 0; +} + +int peer_delete(uint16_t conn_handle) +{ + struct peer_svc *svc; + struct peer *peer; + int rc; + + peer = peer_find(conn_handle); + if (peer == NULL) + { + return BLE_HS_ENOTCONN; + } + + SLIST_REMOVE(&peers, peer, peer, next); + + while ((svc = SLIST_FIRST(&peer->svcs)) != NULL) + { + SLIST_REMOVE_HEAD(&peer->svcs, next); + peer_svc_delete(svc); + } + + rc = os_memblock_put(&peer_pool, peer); + if (rc != 0) + { + return BLE_HS_EOS; + } + + return 0; +} + +int peer_add(uint16_t conn_handle) +{ + struct peer *peer; + + /* Make sure the connection handle is unique. */ + + peer = peer_find(conn_handle); + if (peer != NULL) + { + return BLE_HS_EALREADY; + } + + peer = os_memblock_get(&peer_pool); + if (peer == NULL) + { + /* Out of memory. */ + + return BLE_HS_ENOMEM; + } + + memset(peer, 0, sizeof *peer); + peer->conn_handle = conn_handle; + + SLIST_INSERT_HEAD(&peers, peer, next); + + return 0; +} + +static void +peer_free_mem(void) +{ + free(peer_mem); + peer_mem = NULL; + + free(peer_svc_mem); + peer_svc_mem = NULL; + + free(peer_chr_mem); + peer_chr_mem = NULL; + + free(peer_dsc_mem); + peer_dsc_mem = NULL; +} + +int peer_init(int max_peers, int max_svcs, int max_chrs, int max_dscs) +{ + int rc; + + /* Free memory first in case this function gets called more than once. */ + + peer_free_mem(); + + peer_mem = malloc( + OS_MEMPOOL_BYTES(max_peers, sizeof(struct peer))); + if (peer_mem == NULL) + { + rc = BLE_HS_ENOMEM; + goto err; + } + + rc = os_mempool_init(&peer_pool, max_peers, + sizeof(struct peer), peer_mem, + "peer_pool"); + if (rc != 0) + { + rc = BLE_HS_EOS; + goto err; + } + + peer_svc_mem = malloc( + OS_MEMPOOL_BYTES(max_svcs, sizeof(struct peer_svc))); + if (peer_svc_mem == NULL) + { + rc = BLE_HS_ENOMEM; + goto err; + } + + rc = os_mempool_init(&peer_svc_pool, max_svcs, + sizeof(struct peer_svc), peer_svc_mem, + "peer_svc_pool"); + if (rc != 0) + { + rc = BLE_HS_EOS; + goto err; + } + + peer_chr_mem = malloc( + OS_MEMPOOL_BYTES(max_chrs, sizeof(struct peer_chr))); + if (peer_chr_mem == NULL) + { + rc = BLE_HS_ENOMEM; + goto err; + } + + rc = os_mempool_init(&peer_chr_pool, max_chrs, + sizeof(struct peer_chr), peer_chr_mem, + "peer_chr_pool"); + if (rc != 0) + { + rc = BLE_HS_EOS; + goto err; + } + + peer_dsc_mem = malloc( + OS_MEMPOOL_BYTES(max_dscs, sizeof(struct peer_dsc))); + if (peer_dsc_mem == NULL) + { + rc = BLE_HS_ENOMEM; + goto err; + } + + rc = os_mempool_init(&peer_dsc_pool, max_dscs, + sizeof(struct peer_dsc), peer_dsc_mem, + "peer_dsc_pool"); + if (rc != 0) + { + rc = BLE_HS_EOS; + goto err; + } + + return 0; + +err: + peer_free_mem(); + return rc; +} diff --git a/examples/nimble_bleprph/CMakeLists.txt b/examples/nimble_bleprph/CMakeLists.txt new file mode 100644 index 00000000000..1213cc279bc --- /dev/null +++ b/examples/nimble_bleprph/CMakeLists.txt @@ -0,0 +1,31 @@ +# ############################################################################## +# apps/examples/nimble_bleprph/CMakeLists.txt +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_EXAMPLES_NIMBLE_BLEPRPH) + nuttx_add_application( + NAME + nimble + SRCS + ${CMAKE_CURRENT_LIST_DIR}/nimble_bleprph_main.c + ${CMAKE_CURRENT_LIST_DIR}/misc.c + ${CMAKE_CURRENT_LIST_DIR}/gatt_svr.c + DEPENDS + nimble) +endif() diff --git a/examples/nimble_bleprph/Kconfig b/examples/nimble_bleprph/Kconfig new file mode 100644 index 00000000000..7ee88ea6a47 --- /dev/null +++ b/examples/nimble_bleprph/Kconfig @@ -0,0 +1,30 @@ +# +# For a description of the syntax of this configuration file, +# see the file kconfig-language.txt in the NuttX tools repository. +# + +config EXAMPLES_NIMBLE_BLEPRPH + tristate "NimBLE peripheral" + default n + ---help--- + Enable the nimble peripheral + +if EXAMPLES_NIMBLE_BLEPRPH + +config EXAMPLES_NIMBLE_BLEPRPH_PROGNAME + string "Program name" + default "nimble" + ---help--- + This is the name of the program that will be used when the NSH ELF + program is installed. + +config EXAMPLES_NIMBLE_BLEPRPH_PRIORITY + int "NimBLE task priority" + default 100 + +config EXAMPLES_NIMBLE_BLEPRPH_STACKSIZE + int "NimBLE stack size" + default DEFAULT_TASK_STACKSIZE + +endif # EXAMPLES_NIMBLE_BLEPRPH + diff --git a/examples/nimble_bleprph/Make.defs b/examples/nimble_bleprph/Make.defs new file mode 100644 index 00000000000..af5e367d96b --- /dev/null +++ b/examples/nimble_bleprph/Make.defs @@ -0,0 +1,23 @@ +############################################################################ +# apps/examples/nimble_bleprph/Make.defs +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +ifneq ($(CONFIG_EXAMPLES_NIMBLE_BLEPRPH),) +CONFIGURED_APPS += $(APPDIR)/examples/nimble +endif diff --git a/examples/nimble_bleprph/Makefile b/examples/nimble_bleprph/Makefile new file mode 100644 index 00000000000..7e4e76dd756 --- /dev/null +++ b/examples/nimble_bleprph/Makefile @@ -0,0 +1,38 @@ +############################################################################ +# apps/examples/nimble_bleprph/Makefile +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +include $(APPDIR)/Make.defs + +# NimBLE built-in application info + +PROGNAME = $(CONFIG_EXAMPLES_NIMBLE_BLEPRPH_PROGNAME) +PRIORITY = $(CONFIG_EXAMPLES_NIMBLE_BLEPRPH_PRIORITY) +STACKSIZE = $(CONFIG_EXAMPLES_NIMBLE_BLEPRPH_STACKSIZE) +MODULE = $(CONFIG_EXAMPLES_NIMBLE_BLEPRPH) + +# NimBLE Peripheral Example + +CSRCS += misc.c gatt_svr.c +MAINSRC = nimble_bleprph_main.c + +include $(APPDIR)/wireless/bluetooth/nimble/Makefile.nimble + +include $(APPDIR)/Application.mk + diff --git a/examples/nimble_bleprph/bleprph.h b/examples/nimble_bleprph/bleprph.h new file mode 100644 index 00000000000..43995c58942 --- /dev/null +++ b/examples/nimble_bleprph/bleprph.h @@ -0,0 +1,60 @@ +/**************************************************************************** + * apps/examples/nimble_bleprph/bleprph.h + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +#ifndef H_BLEPRPH_ +#define H_BLEPRPH_ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +#include "nimble/ble.h" +#ifdef __cplusplus +extern "C" +{ +#endif + +struct ble_hs_cfg; +struct ble_gatt_register_ctxt; + +/* GATT server. */ + +#define GATT_SVR_SVC_ALERT_UUID 0x1811 +#define GATT_SVR_CHR_SUP_NEW_ALERT_CAT_UUID 0x2A47 +#define GATT_SVR_CHR_NEW_ALERT 0x2A46 +#define GATT_SVR_CHR_SUP_UNR_ALERT_CAT_UUID 0x2A48 +#define GATT_SVR_CHR_UNR_ALERT_STAT_UUID 0x2A45 +#define GATT_SVR_CHR_ALERT_NOT_CTRL_PT 0x2A44 + +void gatt_svr_register_cb(struct ble_gatt_register_ctxt *ctxt, void *arg); +int gatt_svr_init(void); + +/* Misc. */ + +void print_bytes(const uint8_t *bytes, int len); +void print_addr(const void *addr); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/examples/nimble_bleprph/gatt_svr.c b/examples/nimble_bleprph/gatt_svr.c new file mode 100644 index 00000000000..fb03d1943fc --- /dev/null +++ b/examples/nimble_bleprph/gatt_svr.c @@ -0,0 +1,238 @@ +/**************************************************************************** + * apps/examples/nimble_bleprph/gatt_svr.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +#include +#include "host/ble_hs.h" +#include "host/ble_uuid.h" +#include "services/ans/ble_svc_ans.h" +#include "services/bas/ble_svc_bas.h" +#include "bleprph.h" + +/** + * The vendor specific security test service consists of two characteristics: + * o random-number-generator: generates a random 32-bit number each time + * it is read. This characteristic can only be read over an encrypted + * connection. + * o static-value: a single-byte characteristic that can always be read, + * but can only be written over an encrypted connection. + */ + +/* 59462f12-9543-9999-12c8-58b459a2712d */ + +static const ble_uuid128_t gatt_svr_svc_sec_test_uuid = + BLE_UUID128_INIT(0x2d, 0x71, 0xa2, 0x59, 0xb4, 0x58, 0xc8, 0x12, + 0x99, 0x99, 0x43, 0x95, 0x12, 0x2f, 0x46, 0x59); + +/* 5c3a659e-897e-45e1-b016-007107c96df6 */ + +static const ble_uuid128_t gatt_svr_chr_sec_test_rand_uuid = + BLE_UUID128_INIT(0xf6, 0x6d, 0xc9, 0x07, 0x71, 0x00, 0x16, 0xb0, + 0xe1, 0x45, 0x7e, 0x89, 0x9e, 0x65, 0x3a, 0x5c); + +/* 5c3a659e-897e-45e1-b016-007107c96df7 */ + +static const ble_uuid128_t gatt_svr_chr_sec_test_static_uuid = + BLE_UUID128_INIT(0xf7, 0x6d, 0xc9, 0x07, 0x71, 0x00, 0x16, 0xb0, + 0xe1, 0x45, 0x7e, 0x89, 0x9e, 0x65, 0x3a, 0x5c); + +static uint8_t gatt_svr_sec_test_static_val; + +static int +gatt_svr_chr_access_sec_test(uint16_t conn_handle, uint16_t attr_handle, + struct ble_gatt_access_ctxt *ctxt, + void *arg); + +static const struct ble_gatt_svc_def gatt_svr_svcs[] = +{ + { + /* Service: Security test. */ + + .type = BLE_GATT_SVC_TYPE_PRIMARY, + .uuid = &gatt_svr_svc_sec_test_uuid.u, + .characteristics = (struct ble_gatt_chr_def[]) + { + { + /* Characteristic: Random number generator. */ + + .uuid = &gatt_svr_chr_sec_test_rand_uuid.u, + .access_cb = gatt_svr_chr_access_sec_test, + .flags = BLE_GATT_CHR_F_READ, + }, + { + /* Characteristic: Static value. */ + + .uuid = &gatt_svr_chr_sec_test_static_uuid.u, + .access_cb = gatt_svr_chr_access_sec_test, + .flags = BLE_GATT_CHR_F_READ | + BLE_GATT_CHR_F_WRITE, + }, + { + 0, /* No more characteristics in this service. */ + } + }, + }, + + { + 0, /* No more services. */ + }, +}; + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +static int +gatt_svr_chr_write(FAR struct os_mbuf *om, uint16_t min_len, + uint16_t max_len, FAR void *dst, FAR uint16_t *len) +{ + uint16_t om_len; + int rc; + + om_len = OS_MBUF_PKTLEN(om); + if (om_len < min_len || om_len > max_len) + { + return BLE_ATT_ERR_INVALID_ATTR_VALUE_LEN; + } + + rc = ble_hs_mbuf_to_flat(om, dst, max_len, len); + if (rc != 0) + { + return BLE_ATT_ERR_UNLIKELY; + } + + return 0; +} + +static int +gatt_svr_chr_access_sec_test(uint16_t conn_handle, uint16_t attr_handle, + FAR struct ble_gatt_access_ctxt *ctxt, + FAR void *arg) +{ + const ble_uuid_t *uuid; + int rand_num; + int rc; + + uuid = ctxt->chr->uuid; + + /* Determine which characteristic is being accessed by examining its + * 128-bit UUID. + */ + + if (ble_uuid_cmp(uuid, &gatt_svr_chr_sec_test_rand_uuid.u) == 0) + { + assert(ctxt->op == BLE_GATT_ACCESS_OP_READ_CHR); + + /* Respond with a 32-bit random number. */ + + rand_num = rand(); + rc = os_mbuf_append(ctxt->om, &rand_num, sizeof rand_num); + return rc == 0 ? 0 : BLE_ATT_ERR_INSUFFICIENT_RES; + } + + if (ble_uuid_cmp(uuid, &gatt_svr_chr_sec_test_static_uuid.u) == 0) + { + switch (ctxt->op) + { + case BLE_GATT_ACCESS_OP_READ_CHR: + rc = os_mbuf_append(ctxt->om, &gatt_svr_sec_test_static_val, + sizeof gatt_svr_sec_test_static_val); + return rc == 0 ? 0 : BLE_ATT_ERR_INSUFFICIENT_RES; + + case BLE_GATT_ACCESS_OP_WRITE_CHR: + rc = gatt_svr_chr_write(ctxt->om, + sizeof gatt_svr_sec_test_static_val, + sizeof gatt_svr_sec_test_static_val, + &gatt_svr_sec_test_static_val, NULL); + return rc; + + default: + assert(0); + return BLE_ATT_ERR_UNLIKELY; + } + } + + /* Unknown characteristic; the nimble stack should not have called this + * function. + */ + + assert(0); + return BLE_ATT_ERR_UNLIKELY; +} + +void gatt_svr_register_cb(FAR struct ble_gatt_register_ctxt *ctxt, + FAR void *arg) +{ + char buf[BLE_UUID_STR_LEN]; + + switch (ctxt->op) + { + case BLE_GATT_REGISTER_OP_SVC: + printf("registered service %s with handle=%d\n", + ble_uuid_to_str(ctxt->svc.svc_def->uuid, buf), + ctxt->svc.handle); + break; + + case BLE_GATT_REGISTER_OP_CHR: + printf("registering characteristic %s with " + "def_handle=%d val_handle=%d\n", + ble_uuid_to_str(ctxt->chr.chr_def->uuid, buf), + ctxt->chr.def_handle, + ctxt->chr.val_handle); + break; + + case BLE_GATT_REGISTER_OP_DSC: + printf("registering descriptor %s with handle=%d\n", + ble_uuid_to_str(ctxt->dsc.dsc_def->uuid, buf), + ctxt->dsc.handle); + break; + + default: + assert(0); + break; + } +} + +int gatt_svr_init(void) +{ + int rc; + + ble_svc_ans_init(); + ble_svc_bas_init(); + + rc = ble_gatts_count_cfg(gatt_svr_svcs); + if (rc != 0) + { + return rc; + } + + rc = ble_gatts_add_svcs(gatt_svr_svcs); + if (rc != 0) + { + return rc; + } + + return 0; +} diff --git a/examples/nimble_bleprph/misc.c b/examples/nimble_bleprph/misc.c new file mode 100644 index 00000000000..2a0b40a9297 --- /dev/null +++ b/examples/nimble_bleprph/misc.c @@ -0,0 +1,48 @@ +/**************************************************************************** + * apps/examples/nimble_bleprph/misc.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include "bleprph.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +void print_bytes(FAR const uint8_t *bytes, int len) +{ + int i; + + for (i = 0; i < len; i++) + { + printf("%s0x%02x", i != 0 ? ":" : "", bytes[i]); + } +} + +void print_addr(FAR const void *addr) +{ + const uint8_t *u8p; + + u8p = addr; + printf("%02x:%02x:%02x:%02x:%02x:%02x", + u8p[5], u8p[4], u8p[3], u8p[2], u8p[1], u8p[0]); +} diff --git a/examples/nimble_bleprph/nimble_bleprph_main.c b/examples/nimble_bleprph/nimble_bleprph_main.c new file mode 100644 index 00000000000..ad432daa86f --- /dev/null +++ b/examples/nimble_bleprph/nimble_bleprph_main.c @@ -0,0 +1,440 @@ +/**************************************************************************** + * apps/examples/nimble_bleprph/nimble_bleprph_main.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +#include +#include + +/* BLE */ + +#include "nimble/ble.h" +#include "nimble/nimble_port.h" +#include "host/ble_hs.h" +#include "host/util/util.h" +#include "services/gap/ble_svc_gap.h" +#include "services/bas/ble_svc_bas.h" + +/* Application-specified header. */ + +#include "bleprph.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* Not used now */ + +#define TASK_DEFAULT_PRIORITY CONFIG_EXAMPLES_NIMBLE_BLEPRPH_PRIORITY +#define TASK_DEFAULT_STACK NULL +#define TASK_DEFAULT_STACK_SIZE 0 + +/**************************************************************************** + * External Functions Prototypes + ****************************************************************************/ + +void ble_hci_sock_ack_handler(FAR void *param); +void ble_hci_sock_set_device(int dev); + +/**************************************************************************** + * Private Functions Prototypes + ****************************************************************************/ + +static void bleprph_advertise(void); +static void nimble_host_task(FAR void *param); +static FAR void *ble_hci_sock_task(FAR void *param); +static FAR void *ble_host_task(FAR void *param); +static int bleprph_gap_event(FAR struct ble_gap_event *event, FAR void *arg); + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +/**************************************************************************** + * Name: bleprph_print_conn_desc + ****************************************************************************/ + +static void +bleprph_print_conn_desc(FAR struct ble_gap_conn_desc *desc) +{ + printf("handle=%d our_ota_addr_type=%d our_ota_addr=", + desc->conn_handle, desc->our_ota_addr.type); + print_addr(desc->our_ota_addr.val); + printf(" our_id_addr_type=%d our_id_addr=", + desc->our_id_addr.type); + print_addr(desc->our_id_addr.val); + printf(" peer_ota_addr_type=%d peer_ota_addr=", + desc->peer_ota_addr.type); + print_addr(desc->peer_ota_addr.val); + printf(" peer_id_addr_type=%d peer_id_addr=", + desc->peer_id_addr.type); + print_addr(desc->peer_id_addr.val); + printf(" conn_itvl=%d conn_latency=%d supervision_timeout=%d " + "encrypted=%d authenticated=%d bonded=%d\n", + desc->conn_itvl, desc->conn_latency, + desc->supervision_timeout, + desc->sec_state.encrypted, + desc->sec_state.authenticated, + desc->sec_state.bonded); +} + +/**************************************************************************** + * Name: bleprph_advertise + ****************************************************************************/ + +static void bleprph_advertise(void) +{ + uint8_t own_addr_type; + struct ble_gap_adv_params adv_params; + struct ble_hs_adv_fields fields; + const char *name; + int rc; + + /* Figure out address to use while advertising (no privacy for now) */ + + rc = ble_hs_id_infer_auto(0, &own_addr_type); + if (rc != 0) + { + printf("error determining address type; rc=%d\n", rc); + return; + } + + /** + * Set the advertisement data included in our advertisements: + * o Flags (indicates advertisement type and other general info). + * o Advertising tx power. + * o Device name. + * o 16-bit service UUIDs (alert notifications). + */ + + memset(&fields, 0, sizeof fields); + + /* Advertise two flags: + * o Discoverability in forthcoming advertisement (general) + * o BLE-only (BR/EDR unsupported). + */ + + fields.flags = BLE_HS_ADV_F_DISC_GEN | + BLE_HS_ADV_F_BREDR_UNSUP; + + /* Indicate that the TX power level field should be included; have the + * stack fill this value automatically. This is done by assiging the + * special value BLE_HS_ADV_TX_PWR_LVL_AUTO. + */ + + fields.tx_pwr_lvl_is_present = 1; + fields.tx_pwr_lvl = BLE_HS_ADV_TX_PWR_LVL_AUTO; + + name = ble_svc_gap_device_name(); + fields.name = (uint8_t *)name; + fields.name_len = strlen(name); + fields.name_is_complete = 1; + + fields.uuids16 = (ble_uuid16_t[]) + { + BLE_UUID16_INIT(GATT_SVR_SVC_ALERT_UUID) + }; + fields.num_uuids16 = 1; + fields.uuids16_is_complete = 1; + + rc = ble_gap_adv_set_fields(&fields); + if (rc != 0) + { + printf("error setting advertisement data; rc=%d\n", rc); + return; + } + + /* Begin advertising. */ + + memset(&adv_params, 0, sizeof adv_params); + adv_params.conn_mode = BLE_GAP_CONN_MODE_UND; + adv_params.disc_mode = BLE_GAP_DISC_MODE_GEN; + rc = ble_gap_adv_start(own_addr_type, NULL, BLE_HS_FOREVER, + &adv_params, bleprph_gap_event, NULL); + if (rc != 0) + { + printf("error enabling advertisement; rc=%d\n", rc); + return; + } +} + +/**************************************************************************** + * Name: bleprph_gap_event + ****************************************************************************/ + +static int +bleprph_gap_event(FAR struct ble_gap_event *event, FAR void *arg) +{ + struct ble_gap_conn_desc desc; + int rc; + + switch (event->type) + { + case BLE_GAP_EVENT_CONNECT: + + /* A new connection was established or a connection attempt failed. */ + + printf("connection %s; status=%d ", + event->connect.status == 0 ? "established" : "failed", + event->connect.status); + if (event->connect.status == 0) + { + rc = ble_gap_conn_find(event->connect.conn_handle, &desc); + assert(rc == 0); + bleprph_print_conn_desc(&desc); + } + printf("\n"); + + if (event->connect.status != 0) + { + /* Connection failed; resume advertising. */ + + bleprph_advertise(); + } + return 0; + + case BLE_GAP_EVENT_DISCONNECT: + printf("disconnect; reason=%d ", event->disconnect.reason); + bleprph_print_conn_desc(&event->disconnect.conn); + printf("\n"); + + /* Connection terminated; resume advertising. */ + + bleprph_advertise(); + return 0; + + case BLE_GAP_EVENT_CONN_UPDATE: + + /* The central has updated the connection parameters. */ + + printf("connection updated; status=%d ", + event->conn_update.status); + rc = ble_gap_conn_find(event->conn_update.conn_handle, &desc); + assert(rc == 0); + bleprph_print_conn_desc(&desc); + printf("\n"); + return 0; + + case BLE_GAP_EVENT_ADV_COMPLETE: + printf("advertise complete; reason=%d", + event->adv_complete.reason); + bleprph_advertise(); + return 0; + + case BLE_GAP_EVENT_ENC_CHANGE: + + /* Encryption has been enabled or disabled for this connection. */ + + printf("encryption change event; status=%d ", + event->enc_change.status); + rc = ble_gap_conn_find(event->connect.conn_handle, &desc); + assert(rc == 0); + bleprph_print_conn_desc(&desc); + printf("\n"); + return 0; + + case BLE_GAP_EVENT_SUBSCRIBE: + printf("subscribe event; conn_handle=%d attr_handle=%d " + "reason=%d prevn=%d curn=%d previ=%d curi=%d\n", + event->subscribe.conn_handle, + event->subscribe.attr_handle, + event->subscribe.reason, + event->subscribe.prev_notify, + event->subscribe.cur_notify, + event->subscribe.prev_indicate, + event->subscribe.cur_indicate); + return 0; + + case BLE_GAP_EVENT_MTU: + printf("mtu update event; conn_handle=%d cid=%d mtu=%d\n", + event->mtu.conn_handle, + event->mtu.channel_id, + event->mtu.value); + return 0; + + case BLE_GAP_EVENT_REPEAT_PAIRING: + /* We already have a bond with the peer, but it is attempting to + * establish a new secure link. This app sacrifices security for + * convenience: just throw away the old bond and accept the new link. + */ + + /* Delete the old bond. */ + + rc = ble_gap_conn_find(event->repeat_pairing.conn_handle, &desc); + assert(rc == 0); + ble_store_util_delete_peer(&desc.peer_id_addr); + + /* Return BLE_GAP_REPEAT_PAIRING_RETRY to indicate that the host should + * continue with the pairing operation. + */ + + return BLE_GAP_REPEAT_PAIRING_RETRY; + } + + return 0; +} + +/**************************************************************************** + * Name: bleprph_on_reset + ****************************************************************************/ + +static void +bleprph_on_reset(int reason) +{ + printf("Resetting state; reason=%d\n", reason); +} + +/**************************************************************************** + * Name: bleprph_on_sync + ****************************************************************************/ + +static void +bleprph_on_sync(void) +{ + int rc; + + /* Make sure we have proper identity address set (public preferred) */ + + rc = ble_hs_util_ensure_addr(0); + assert(rc == 0); + + /* Begin advertising. */ + + bleprph_advertise(); +} + +/**************************************************************************** + * Name: nimble_host_task + ****************************************************************************/ + +static void nimble_host_task(FAR void *param) +{ + ble_svc_gap_device_name_set("NuttX NimBLE PRPH"); + nimble_port_run(); +} + +/**************************************************************************** + * Name: ble_hci_sock_task + ****************************************************************************/ + +static FAR void *ble_hci_sock_task(FAR void *param) +{ + ble_hci_sock_ack_handler(param); + return NULL; +} + +/**************************************************************************** + * Name: ble_host_task + ****************************************************************************/ + +static FAR void *ble_host_task(FAR void *param) +{ + nimble_host_task(param); + return NULL; +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: nimble_main + ****************************************************************************/ + +int main(int argc, FAR char *argv[]) +{ + struct ble_npl_task s_task_host; + struct ble_npl_task s_task_hci; + int ret = 0; + uint8_t batt_level = 0; + + /* allow to specify custom hci */ + + if (argc > 1) + { + ble_hci_sock_set_device(atoi(argv[1])); + } + +#ifndef CONFIG_NSH_ARCHINIT + /* Perform architecture-specific initialization */ + + boardctl(BOARDIOC_INIT, 0); +#endif + +#ifndef CONFIG_NSH_NETINIT + /* Bring up the network */ + + netinit_bringup(); +#endif + + nimble_port_init(); + + /* Initialize the NimBLE host configuration. */ + + ble_hs_cfg.reset_cb = bleprph_on_reset; + ble_hs_cfg.sync_cb = bleprph_on_sync; + ble_hs_cfg.gatts_register_cb = gatt_svr_register_cb; + ble_hs_cfg.store_status_cb = ble_store_util_status_rr; + + /* Initialize services */ + + ret = gatt_svr_init(); + assert(ret == 0); + + /* Create task which handles HCI socket */ + + ret = ble_npl_task_init(&s_task_hci, "hci_sock", ble_hci_sock_task, + NULL, TASK_DEFAULT_PRIORITY, BLE_NPL_TIME_FOREVER, + TASK_DEFAULT_STACK, TASK_DEFAULT_STACK_SIZE); + if (ret != 0) + { + printf("ERROR: starting hci task: %i\n", ret); + } + + /* Create task which handles default event queue for host stack. */ + + ret = ble_npl_task_init(&s_task_host, "ble_host", ble_host_task, + NULL, TASK_DEFAULT_PRIORITY, BLE_NPL_TIME_FOREVER, + TASK_DEFAULT_STACK, TASK_DEFAULT_STACK_SIZE); + if (ret != 0) + { + printf("ERROR: starting ble task: %i\n", ret); + } + + while (true) + { + /* Simulate battery */ + + batt_level += 1; + if (batt_level > 100) + { + batt_level = 0; + } + + ble_svc_bas_battery_level_set(batt_level); + usleep(100000); + } + + return 0; +} From 0640d3f550f44547d12f6a57a14cc751520aaf17 Mon Sep 17 00:00:00 2001 From: Michal Lenc Date: Wed, 26 Mar 2025 16:49:34 +0100 Subject: [PATCH 233/391] nshlib/nsh_fsutils.c: fix getpid_callback function read size Commit 5330966 replaced local static buffer with malloc allocated lib_get_pathbuffer. This however prevents the usage of sizeof(buffer) in the follow up read function, therefore the read size has to be specified as PATH_MAX - 1. This fixes the functionality of pidof function call (and subsequently pkill call that uses pidof). Signed-off-by: Michal Lenc --- nshlib/nsh_fsutils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nshlib/nsh_fsutils.c b/nshlib/nsh_fsutils.c index c3793b20619..878c1d18e51 100644 --- a/nshlib/nsh_fsutils.c +++ b/nshlib/nsh_fsutils.c @@ -98,7 +98,7 @@ static int getpid_callback(FAR struct nsh_vtbl_s *vtbl, return 0; } - len = read(fd, buffer, sizeof(buffer) - 1); + len = read(fd, buffer, PATH_MAX - 1); close(fd); if (len < 0) { From 369729eea4f18b61ab899f84948acfa4820d0518 Mon Sep 17 00:00:00 2001 From: zhangshoukui Date: Wed, 8 Jan 2025 20:06:25 +0800 Subject: [PATCH 234/391] testing/drivers/drivertest: Uniform test case name 1.Some test functions are named too simply 2.Many driver tests depend on specific configurations and hardware, and the unified specification name facilitates cmocka to skip tests by using the skip parameter for wildcard matching Signed-off-by: zhangshoukui --- testing/drivers/drivertest/drivertest_adc.c | 6 +-- testing/drivers/drivertest/drivertest_audio.c | 4 +- testing/drivers/drivertest/drivertest_block.c | 20 +++++----- .../drivertest/drivertest_framebuffer.c | 36 +++++++++-------- .../drivers/drivertest/drivertest_i2c_spi.c | 6 +-- testing/drivers/drivertest/drivertest_lcd.c | 36 +++++++++-------- testing/drivers/drivertest/drivertest_mps2.c | 4 +- .../drivertest_mps2_zerointerrupt.c | 4 +- .../drivers/drivertest/drivertest_oneshot.c | 6 +-- testing/drivers/drivertest/drivertest_pm.c | 4 +- .../drivertest/drivertest_pm_runtime.c | 4 +- .../drivers/drivertest/drivertest_pm_smp.c | 4 +- .../drivertest/drivertest_posix_timer.c | 7 ++-- testing/drivers/drivertest/drivertest_pwm.c | 4 +- .../drivers/drivertest/drivertest_regulator.c | 40 ++++++++++--------- testing/drivers/drivertest/drivertest_relay.c | 6 +-- testing/drivers/drivertest/drivertest_rtc.c | 18 ++++----- .../drivers/drivertest/drivertest_simple.c | 8 ++-- testing/drivers/drivertest/drivertest_timer.c | 6 +-- .../drivertest/drivertest_touchpanel.c | 6 +-- .../drivers/drivertest/drivertest_watchdog.c | 24 +++++------ 21 files changed, 133 insertions(+), 120 deletions(-) diff --git a/testing/drivers/drivertest/drivertest_adc.c b/testing/drivers/drivertest/drivertest_adc.c index d9360b3793b..269ff23e8f6 100644 --- a/testing/drivers/drivertest/drivertest_adc.c +++ b/testing/drivers/drivertest/drivertest_adc.c @@ -161,10 +161,10 @@ int32_t adc_read_one_sample(int fd, bool soft_trigger) } /**************************************************************************** - * Name: test_case_adc + * Name: drivertest_adc ****************************************************************************/ -static void test_case_adc(FAR void** state) +static void drivertest_adc(FAR void** state) { int fd; bool succ = false; @@ -228,7 +228,7 @@ int main(int argc, FAR char *argv[]) parse_commandline(&adc_state, argc, argv); const struct CMUnitTest tests[] = { - cmocka_unit_test_prestate(test_case_adc, &adc_state), + cmocka_unit_test_prestate(drivertest_adc, &adc_state), }; return cmocka_run_group_tests(tests, NULL, NULL); diff --git a/testing/drivers/drivertest/drivertest_audio.c b/testing/drivers/drivertest/drivertest_audio.c index 9ab9ebb6ae9..491dfec3826 100644 --- a/testing/drivers/drivertest/drivertest_audio.c +++ b/testing/drivers/drivertest/drivertest_audio.c @@ -528,7 +528,7 @@ static int audio_test_cleanup(FAR struct audio_state_s *state, int direction) return 0; } -static void audio_test_case(void **audio_state) +static void drivertest_audio(void **audio_state) { FAR struct audio_state_s *state; FAR struct ap_buffer_s **bufs = NULL; @@ -801,7 +801,7 @@ int main(int argc, FAR char *argv[]) const struct CMUnitTest tests[] = { - cmocka_unit_test_prestate_setup_teardown(audio_test_case, + cmocka_unit_test_prestate_setup_teardown(drivertest_audio, audio_test_setup, audio_test_teardown, &state), diff --git a/testing/drivers/drivertest/drivertest_block.c b/testing/drivers/drivertest/drivertest_block.c index 6dc70925d58..cc88a9d09ab 100644 --- a/testing/drivers/drivertest/drivertest_block.c +++ b/testing/drivers/drivertest/drivertest_block.c @@ -226,10 +226,10 @@ static int setup_driver(FAR void **state) } /**************************************************************************** - * Name: blktest_stress + * Name: drivertest_block_stress ****************************************************************************/ -static void blktest_stress(FAR void **state) +static void drivertest_block_stress(FAR void **state) { FAR struct pre_build_s *pre; FAR void *input; @@ -287,10 +287,10 @@ static void blktest_stress(FAR void **state) } /**************************************************************************** - * Name: blktest_multiple_write + * Name: drivertest_block_cache_write ****************************************************************************/ -static void blktest_cachesize_write(FAR void **state) +static void drivertest_block_cache_write(FAR void **state) { FAR struct pre_build_s *pre; FAR void *input; @@ -387,10 +387,10 @@ static void blktest_cachesize_write(FAR void **state) } /**************************************************************************** - * Name: blktest_single_write + * Name: drivertest_block_single_write ****************************************************************************/ -static void blktest_single_write(FAR void **state) +static void drivertest_block_single_write(FAR void **state) { FAR struct pre_build_s *pre; FAR void *input; @@ -490,12 +490,12 @@ int main(int argc, FAR char *argv[]) parse_commandline(argc, argv, pre); const struct CMUnitTest tests[] = { - cmocka_unit_test_prestate_setup_teardown(blktest_stress, setup_bch, - teardown_bch, pre), - cmocka_unit_test_prestate_setup_teardown(blktest_single_write, + cmocka_unit_test_prestate_setup_teardown(drivertest_block_stress, + setup_bch, teardown_bch, pre), + cmocka_unit_test_prestate_setup_teardown(drivertest_block_single_write, setup_driver, teardown_driver, pre), - cmocka_unit_test_prestate_setup_teardown(blktest_cachesize_write, + cmocka_unit_test_prestate_setup_teardown(drivertest_block_cache_write, setup_driver, teardown_driver, pre), }; diff --git a/testing/drivers/drivertest/drivertest_framebuffer.c b/testing/drivers/drivertest/drivertest_framebuffer.c index 04ee135f3d1..ac8f6f266d9 100644 --- a/testing/drivers/drivertest/drivertest_framebuffer.c +++ b/testing/drivers/drivertest/drivertest_framebuffer.c @@ -406,10 +406,10 @@ static void draw_rect(FAR struct fb_state_s *fb_state, int x, int y, } /**************************************************************************** - * Name: test_case_fb_0 + * Name: drivertest_framebuffer_black ****************************************************************************/ -static void test_case_fb_0(FAR void **state) +static void drivertest_framebuffer_black(FAR void **state) { FAR struct fb_state_s * fb_state; fb_state = (struct fb_state_s *)*state; @@ -421,10 +421,10 @@ static void test_case_fb_0(FAR void **state) } /**************************************************************************** - * Name: test_case_fb_1 + * Name: drivertest_framebuffer_white ****************************************************************************/ -static void test_case_fb_1(FAR void **state) +static void drivertest_framebuffer_white(FAR void **state) { FAR struct fb_state_s * fb_state; fb_state = (struct fb_state_s *)*state; @@ -436,10 +436,10 @@ static void test_case_fb_1(FAR void **state) } /**************************************************************************** - * Name: test_case_fb_2 + * Name: drivertest_framebuffer_cross ****************************************************************************/ -static void test_case_fb_2(FAR void **state) +static void drivertest_framebuffer_cross(FAR void **state) { FAR struct fb_state_s * fb_state; fb_state = (struct fb_state_s *)*state; @@ -470,10 +470,10 @@ static void test_case_fb_2(FAR void **state) } /**************************************************************************** - * Name: test_case_fb_3 + * Name: drivertest_framebuffer_vertical ****************************************************************************/ -static void test_case_fb_3(FAR void **state) +static void drivertest_framebuffer_vertical(FAR void **state) { FAR struct fb_state_s * fb_state; fb_state = (struct fb_state_s *)*state; @@ -541,14 +541,18 @@ int main(int argc, FAR char *argv[]) const struct CMUnitTest tests[] = { - cmocka_unit_test_prestate_setup_teardown(test_case_fb_0, fb_setup, - fb_teardown, &fb_state), - cmocka_unit_test_prestate_setup_teardown(test_case_fb_1, fb_setup, - fb_teardown, &fb_state), - cmocka_unit_test_prestate_setup_teardown(test_case_fb_2, fb_setup, - fb_teardown, &fb_state), - cmocka_unit_test_prestate_setup_teardown(test_case_fb_3, fb_setup, - fb_teardown, &fb_state), + cmocka_unit_test_prestate_setup_teardown(drivertest_framebuffer_black, + fb_setup, fb_teardown, + &fb_state), + cmocka_unit_test_prestate_setup_teardown(drivertest_framebuffer_white, + fb_setup, fb_teardown, + &fb_state), + cmocka_unit_test_prestate_setup_teardown(drivertest_framebuffer_cross, + fb_setup, fb_teardown, + &fb_state), + cmocka_unit_test_prestate_setup_teardown(drivertest_framebuffer_vertical, + fb_setup, fb_teardown, + &fb_state), }; return cmocka_run_group_tests(tests, NULL, NULL); diff --git a/testing/drivers/drivertest/drivertest_i2c_spi.c b/testing/drivers/drivertest/drivertest_i2c_spi.c index b9a37afcfd8..b13a8a6541a 100644 --- a/testing/drivers/drivertest/drivertest_i2c_spi.c +++ b/testing/drivers/drivertest/drivertest_i2c_spi.c @@ -100,10 +100,10 @@ static int teardown(FAR void **state) } /**************************************************************************** - * Name: read_from_device + * Name: drivertest_i2c_spi ****************************************************************************/ -static void read_from_device(FAR void **state) +static void drivertest_i2c_spi(FAR void **state) { FAR struct test_state_s *test_state; struct accel_gyro_st_s data; @@ -163,7 +163,7 @@ int main(int argc, FAR char *argv[]) const struct CMUnitTest tests[] = { - cmocka_unit_test_prestate_setup_teardown(read_from_device, setup, + cmocka_unit_test_prestate_setup_teardown(drivertest_i2c_spi, setup, teardown, &test_state), }; diff --git a/testing/drivers/drivertest/drivertest_lcd.c b/testing/drivers/drivertest/drivertest_lcd.c index 32cbaa30a05..647d8cbe2f3 100644 --- a/testing/drivers/drivertest/drivertest_lcd.c +++ b/testing/drivers/drivertest/drivertest_lcd.c @@ -296,10 +296,10 @@ static void draw_rect(FAR struct lcd_info_s *lcd_info, int x, int y, } /**************************************************************************** - * Name: test_case_lcd_0 + * Name: drivertest_lcd_black ****************************************************************************/ -static void test_case_lcd_0(FAR void **state) +static void drivertest_lcd_black(FAR void **state) { FAR struct lcd_state_s * lcd_state; lcd_state = (struct lcd_state_s *)*state; @@ -311,10 +311,10 @@ static void test_case_lcd_0(FAR void **state) } /**************************************************************************** - * Name: test_case_lcd_1 + * Name: drivertest_lcd_white ****************************************************************************/ -static void test_case_lcd_1(FAR void **state) +static void drivertest_lcd_white(FAR void **state) { FAR struct lcd_state_s * lcd_state; lcd_state = (struct lcd_state_s *)*state; @@ -326,10 +326,10 @@ static void test_case_lcd_1(FAR void **state) } /**************************************************************************** - * Name: test_case_lcd_2 + * Name: drivertest_lcd_cross ****************************************************************************/ -static void test_case_lcd_2(FAR void **state) +static void drivertest_lcd_cross(FAR void **state) { FAR struct lcd_state_s * lcd_state = (struct lcd_state_s *)*state; int i = 0; @@ -360,10 +360,10 @@ static void test_case_lcd_2(FAR void **state) } /**************************************************************************** - * Name: test_case_lcd_3 + * Name: drivertest_lcd_vertical ****************************************************************************/ -static void test_case_lcd_3(FAR void **state) +static void drivertest_lcd_vertical(FAR void **state) { FAR struct lcd_state_s * lcd_state = (struct lcd_state_s *)*state; int i = 0; @@ -427,14 +427,18 @@ int main(int argc, FAR char *argv[]) const struct CMUnitTest tests[] = { - cmocka_unit_test_prestate_setup_teardown(test_case_lcd_0, lcd_setup, - lcd_teardown, &lcd_state), - cmocka_unit_test_prestate_setup_teardown(test_case_lcd_1, lcd_setup, - lcd_teardown, &lcd_state), - cmocka_unit_test_prestate_setup_teardown(test_case_lcd_2, lcd_setup, - lcd_teardown, &lcd_state), - cmocka_unit_test_prestate_setup_teardown(test_case_lcd_3, lcd_setup, - lcd_teardown, &lcd_state), + cmocka_unit_test_prestate_setup_teardown(drivertest_lcd_black, + lcd_setup, lcd_teardown, + &lcd_state), + cmocka_unit_test_prestate_setup_teardown(drivertest_lcd_white, + lcd_setup, lcd_teardown, + &lcd_state), + cmocka_unit_test_prestate_setup_teardown(drivertest_lcd_cross, + lcd_setup, lcd_teardown, + &lcd_state), + cmocka_unit_test_prestate_setup_teardown(drivertest_lcd_vertical, + lcd_setup, lcd_teardown, + &lcd_state), }; return cmocka_run_group_tests(tests, NULL, NULL); diff --git a/testing/drivers/drivertest/drivertest_mps2.c b/testing/drivers/drivertest/drivertest_mps2.c index 9d33b4143b3..1ce62f86214 100644 --- a/testing/drivers/drivertest/drivertest_mps2.c +++ b/testing/drivers/drivertest/drivertest_mps2.c @@ -419,7 +419,7 @@ static void *test_irq_prio_thread_entry(void *arg) return NULL; } -static void test_irqprio(void **argv) +static void drivertest_mps2(void **argv) { pid_t tid[CONFIG_TEST_IRQPRIO_TTHREAD + 1]; pthread_attr_t attr; @@ -489,7 +489,7 @@ int main(int argc, char *argv[]) { const struct CMUnitTest tests[] = { cmocka_unit_test_prestate_setup_teardown( - test_irqprio, setup, teardown, NULL), + drivertest_mps2, setup, teardown, NULL), }; return cmocka_run_group_tests(tests, NULL, NULL); diff --git a/testing/drivers/drivertest/drivertest_mps2_zerointerrupt.c b/testing/drivers/drivertest/drivertest_mps2_zerointerrupt.c index 6a15ee91dc8..e7171d8944d 100644 --- a/testing/drivers/drivertest/drivertest_mps2_zerointerrupt.c +++ b/testing/drivers/drivertest/drivertest_mps2_zerointerrupt.c @@ -206,7 +206,7 @@ static void *test_irq_awaker_thread_entry(void *arg) return 0; } -static void test_irqprio(void **argv) +static void drivertest_mps2_zerointerrupt(void **argv) { pid_t tid; irqstate_t flags; @@ -265,7 +265,7 @@ int main(int argc, char *argv[]) { const struct CMUnitTest tests[] = { cmocka_unit_test_prestate_setup_teardown( - test_irqprio, setup, teardown, NULL), + drivertest_mps2_zerointerrupt, setup, teardown, NULL), }; return cmocka_run_group_tests(tests, NULL, NULL); diff --git a/testing/drivers/drivertest/drivertest_oneshot.c b/testing/drivers/drivertest/drivertest_oneshot.c index f950c0ada1b..a8b18cc6d89 100644 --- a/testing/drivers/drivertest/drivertest_oneshot.c +++ b/testing/drivers/drivertest/drivertest_oneshot.c @@ -135,10 +135,10 @@ static void parse_commandline(FAR struct oneshot_state_s *oneshot_state, } /**************************************************************************** - * Name: test_case_oneshot + * Name: drivertest_oneshot ****************************************************************************/ -static void test_case_oneshot(FAR void **state) +static void drivertest_oneshot(FAR void **state) { int ret; int fd; @@ -222,7 +222,7 @@ int main(int argc, FAR char *argv[]) const struct CMUnitTest tests[] = { - cmocka_unit_test_prestate(test_case_oneshot, &oneshot_state) + cmocka_unit_test_prestate(drivertest_oneshot, &oneshot_state) }; parse_commandline(&oneshot_state, argc, argv); diff --git a/testing/drivers/drivertest/drivertest_pm.c b/testing/drivers/drivertest/drivertest_pm.c index a616b4227c3..7027f186017 100644 --- a/testing/drivers/drivertest/drivertest_pm.c +++ b/testing/drivers/drivertest/drivertest_pm.c @@ -150,7 +150,7 @@ static void test_pm_callback_notify(FAR struct pm_callback_s *cb, return; } -static void test_pm(FAR void **argv) +static void drivertest_pm(FAR void **argv) { int persist_stay_cnt[PM_COUNT]; int init_delay; @@ -409,7 +409,7 @@ int main(int argc, FAR char *argv[]) { const struct CMUnitTest tests[] = { - cmocka_unit_test_prestate_setup_teardown(test_pm, setup, + cmocka_unit_test_prestate_setup_teardown(drivertest_pm, setup, teardown, NULL), }; diff --git a/testing/drivers/drivertest/drivertest_pm_runtime.c b/testing/drivers/drivertest/drivertest_pm_runtime.c index 8cef500d38f..d4131062d15 100644 --- a/testing/drivers/drivertest/drivertest_pm_runtime.c +++ b/testing/drivers/drivertest/drivertest_pm_runtime.c @@ -97,7 +97,7 @@ static int test_pm_runtime_resume(FAR struct pm_runtime_s *dev) return 0; } -static void test_pm_runtime(FAR void **state) +static void drivertest_pm_runtime(FAR void **state) { int ret = 0; int cnt = 10; @@ -167,7 +167,7 @@ int main(int argc, FAR char *argv[]) { const struct CMUnitTest tests[] = { - cmocka_unit_test_prestate_setup_teardown(test_pm_runtime, setup, + cmocka_unit_test_prestate_setup_teardown(drivertest_pm_runtime, setup, teardown, NULL), }; diff --git a/testing/drivers/drivertest/drivertest_pm_smp.c b/testing/drivers/drivertest/drivertest_pm_smp.c index 5de71e546a3..db3d70257e5 100644 --- a/testing/drivers/drivertest/drivertest_pm_smp.c +++ b/testing/drivers/drivertest/drivertest_pm_smp.c @@ -432,7 +432,7 @@ static void *test_pm_smp_thread_entry(void *arg) return (void *)(uintptr_t)ret; } -static void test_pm_smp(FAR void **argv) +static void drivertest_pm_smp(FAR void **argv) { for (int i = 0; i < CONFIG_SMP_NCPUS; i++) { @@ -486,7 +486,7 @@ int main(int argc, FAR char *argv[]) { const struct CMUnitTest tests[] = { - cmocka_unit_test_prestate_setup_teardown(test_pm_smp, setup, + cmocka_unit_test_prestate_setup_teardown(drivertest_pm_smp, setup, teardown, NULL), }; diff --git a/testing/drivers/drivertest/drivertest_posix_timer.c b/testing/drivers/drivertest/drivertest_posix_timer.c index e87dd7a3374..00b7fb20317 100644 --- a/testing/drivers/drivertest/drivertest_posix_timer.c +++ b/testing/drivers/drivertest/drivertest_posix_timer.c @@ -168,10 +168,10 @@ static void posix_timer_callback(union sigval arg) } /**************************************************************************** - * Name: test_case_posix_timer + * Name: drivertest_posix_timer ****************************************************************************/ -static void test_case_posix_timer(FAR void **state) +static void drivertest_posix_timer(FAR void **state) { int ret; timer_t timerid; @@ -230,7 +230,8 @@ int main(int argc, FAR char *argv[]) const struct CMUnitTest tests[] = { - cmocka_unit_test_prestate(test_case_posix_timer, &posix_timer_state) + cmocka_unit_test_prestate_setup_teardown(drivertest_posix_timer, NULL, + NULL, &posix_timer_state) }; parse_commandline(&posix_timer_state, argc, argv); diff --git a/testing/drivers/drivertest/drivertest_pwm.c b/testing/drivers/drivertest/drivertest_pwm.c index 5869db08f88..a587fead10f 100644 --- a/testing/drivers/drivertest/drivertest_pwm.c +++ b/testing/drivers/drivertest/drivertest_pwm.c @@ -219,7 +219,7 @@ static void parse_commandline(FAR struct pwm_state_s *pwm_state, int argc, * Name: test_case_pwm ****************************************************************************/ -static void test_case_pwm(FAR void **state) +static void drivertest_pwm(FAR void **state) { int fd; int ret; @@ -314,7 +314,7 @@ int main(int argc, FAR char *argv[]) const struct CMUnitTest tests[] = { - cmocka_unit_test_prestate(test_case_pwm, &pwm_state) + cmocka_unit_test_prestate(drivertest_pwm, &pwm_state) }; return cmocka_run_group_tests(tests, NULL, NULL); diff --git a/testing/drivers/drivertest/drivertest_regulator.c b/testing/drivers/drivertest/drivertest_regulator.c index 19de21928ea..fe51e756497 100644 --- a/testing/drivers/drivertest/drivertest_regulator.c +++ b/testing/drivers/drivertest/drivertest_regulator.c @@ -198,7 +198,7 @@ static int test_regulator_resume(FAR struct regulator_dev_s *rdev) return 0; } -static void test_regulator_register(FAR void **state) +static void drivertest_reg_register(FAR void **state) { FAR struct regulator_dev_s *test = NULL; @@ -213,7 +213,7 @@ static void test_regulator_register(FAR void **state) regulator_unregister(g_fake_regulator.rdev); } -static void test_regulator_always_on(FAR void **state) +static void drivertest_reg_always_on(FAR void **state) { FAR struct regulator_s *test = NULL; int ret = 0; @@ -254,7 +254,7 @@ static void test_regulator_always_on(FAR void **state) return; } -static void test_regulator_supply_1(FAR void **state) +static void drivertest_reg_supply_always_on_boot_off(FAR void **state) { FAR struct regulator_s *test = NULL; int cnt = 10; @@ -313,7 +313,7 @@ static void test_regulator_supply_1(FAR void **state) return; } -static void test_regulator_supply_2(FAR void **state) +static void drivertest_reg_supply_boot_on_always_on(FAR void **state) { FAR struct regulator_s *test = NULL; int cnt = 10; @@ -372,7 +372,7 @@ static void test_regulator_supply_2(FAR void **state) return; } -static void test_regulator_supply_3(FAR void **state) +static void drivertest_reg_supply_boot_on_always_off(FAR void **state) { FAR struct regulator_s *test = NULL; int cnt = 10; @@ -435,7 +435,7 @@ static void test_regulator_supply_3(FAR void **state) return; } -static void test_regulator_supply_4(FAR void **state) +static void drivertest_reg_supply_boot_off_always_off(FAR void **state) { FAR struct regulator_s *test = NULL; int cnt = 10; @@ -495,7 +495,7 @@ static void test_regulator_supply_4(FAR void **state) return; } -static void test_regulator_mode(FAR void **state) +static void drivertest_reg_mode(FAR void **state) { FAR struct regulator_s *test = NULL; int cnt = 10; @@ -535,7 +535,7 @@ static void test_regulator_mode(FAR void **state) } #ifdef CONFIG_PM -static void test_regulator_pm_register(FAR void **state) +static void drivertest_reg_pm_register(FAR void **state) { g_fake_regulator_desc.auto_lp = 0; g_fake_regulator.lpmode = REGULATOR_MODE_INVALID; @@ -556,7 +556,7 @@ static void test_regulator_pm_register(FAR void **state) return; } -static void test_regulator_pm_callback(FAR void **state) +static void drivertest_reg_pm_callback(FAR void **state) { g_fake_regulator_desc.supply_name = NULL; g_fake_regulator_desc.auto_lp = 1; @@ -611,16 +611,20 @@ int main(int argc, FAR char *argv[]) { const struct CMUnitTest tests[] = { - cmocka_unit_test_prestate(test_regulator_register, NULL), - cmocka_unit_test_prestate(test_regulator_always_on, NULL), - cmocka_unit_test_prestate(test_regulator_supply_1, NULL), - cmocka_unit_test_prestate(test_regulator_supply_2, NULL), - cmocka_unit_test_prestate(test_regulator_supply_3, NULL), - cmocka_unit_test_prestate(test_regulator_supply_4, NULL), - cmocka_unit_test_prestate(test_regulator_mode, NULL), + cmocka_unit_test_prestate(drivertest_reg_register, NULL), + cmocka_unit_test_prestate(drivertest_reg_always_on, NULL), + cmocka_unit_test_prestate(drivertest_reg_supply_always_on_boot_off, + NULL), + cmocka_unit_test_prestate(drivertest_reg_supply_boot_on_always_on, + NULL), + cmocka_unit_test_prestate(drivertest_reg_supply_boot_on_always_off, + NULL), + cmocka_unit_test_prestate(drivertest_reg_supply_boot_off_always_off, + NULL), + cmocka_unit_test_prestate(drivertest_reg_mode, NULL), #ifdef CONFIG_PM - cmocka_unit_test_prestate(test_regulator_pm_register, NULL), - cmocka_unit_test_prestate(test_regulator_pm_callback, NULL), + cmocka_unit_test_prestate(drivertest_reg_pm_register, NULL), + cmocka_unit_test_prestate(drivertest_reg_pm_callback, NULL), #endif }; diff --git a/testing/drivers/drivertest/drivertest_relay.c b/testing/drivers/drivertest/drivertest_relay.c index 53871d94758..adca1bb597f 100644 --- a/testing/drivers/drivertest/drivertest_relay.c +++ b/testing/drivers/drivertest/drivertest_relay.c @@ -125,10 +125,10 @@ static int setup(FAR void **state) } /**************************************************************************** - * Name: relaytest01 + * Name: drivertest_relay ****************************************************************************/ -static void relaytest01(FAR void **state) +static void drivertest_relay(FAR void **state) { FAR struct relay_args_s *relay_args; int fd; @@ -243,7 +243,7 @@ int main(int argc, FAR char *argv[]) parse_commandline(argc, argv, &relay_args); const struct CMUnitTest tests[] = { - cmocka_unit_test_prestate_setup_teardown(relaytest01, setup, + cmocka_unit_test_prestate_setup_teardown(drivertest_relay, setup, teardown, &relay_args), }; diff --git a/testing/drivers/drivertest/drivertest_rtc.c b/testing/drivers/drivertest/drivertest_rtc.c index e4cd03301f2..e25e93c5505 100644 --- a/testing/drivers/drivertest/drivertest_rtc.c +++ b/testing/drivers/drivertest/drivertest_rtc.c @@ -150,10 +150,10 @@ static void parse_commandline(FAR struct rtc_state_s *rtc_state, int argc, } /**************************************************************************** - * Name: test_case_rtc_01 + * Name: drivertest_rtc_api ****************************************************************************/ -static void test_case_rtc_01(FAR void **state) +static void drivertest_rtc_api(FAR void **state) { int fd; int ret; @@ -245,10 +245,10 @@ static void add_timeout(struct rtc_time * rtc_tm, const int delay) } /**************************************************************************** - * Name: test_case_rtc_02 + * Name: drivertest_rtc_alarm ****************************************************************************/ -static void test_case_rtc_02(FAR void **state) +static void drivertest_rtc_alarm(FAR void **state) { int fd; int ret; @@ -372,10 +372,10 @@ static void rtc_periodic_callback(union sigval arg) } /**************************************************************************** - * Name: test_case_rtc_03 + * Name: drivertest_rtc_periodic ****************************************************************************/ -static void test_case_rtc_03(FAR void **state) +static void drivertest_rtc_periodic(FAR void **state) { int alarmid = 0; int ret; @@ -434,12 +434,12 @@ int main(int argc, FAR char *argv[]) const struct CMUnitTest tests[] = { - cmocka_unit_test_prestate(test_case_rtc_01, &rtc_state), + cmocka_unit_test_prestate(drivertest_rtc_api, &rtc_state), #ifdef CONFIG_RTC_ALARM - cmocka_unit_test_prestate(test_case_rtc_02, &rtc_state), + cmocka_unit_test_prestate(drivertest_rtc_alarm, &rtc_state), #endif #ifdef CONFIG_RTC_PERIODIC - cmocka_unit_test_prestate(test_case_rtc_03, &rtc_state), + cmocka_unit_test_prestate(drivertest_rtc_periodic, &rtc_state), #endif }; diff --git a/testing/drivers/drivertest/drivertest_simple.c b/testing/drivers/drivertest/drivertest_simple.c index eea6c86d16f..213cb1256c4 100644 --- a/testing/drivers/drivertest/drivertest_simple.c +++ b/testing/drivers/drivertest/drivertest_simple.c @@ -34,13 +34,13 @@ * Private Functions ****************************************************************************/ -static void test_case_01(FAR void **state) +static void drivertest_simple_assert(FAR void **state) { UNUSED(state); assert_int_equal(0, 0); } -static void test_case_02(FAR void **state) +static void drivertest_simple_assert_string(FAR void **state) { UNUSED(state); assert_string_not_equal("hello", "world"); @@ -58,8 +58,8 @@ int main(int argc, FAR char *argv[]) { const struct CMUnitTest tests[] = { - cmocka_unit_test(test_case_01), - cmocka_unit_test(test_case_02), + cmocka_unit_test(drivertest_simple_assert), + cmocka_unit_test(drivertest_simple_assert_string), }; return cmocka_run_group_tests(tests, NULL, NULL); diff --git a/testing/drivers/drivertest/drivertest_timer.c b/testing/drivers/drivertest/drivertest_timer.c index 55f05425754..73c1e6e721f 100644 --- a/testing/drivers/drivertest/drivertest_timer.c +++ b/testing/drivers/drivertest/drivertest_timer.c @@ -201,10 +201,10 @@ static void parse_commandline(FAR struct timer_state_s *timer_state, } /**************************************************************************** - * Name: test_case_timer + * Name: drivertest_timer ****************************************************************************/ -static void test_case_timer(FAR void **state) +static void drivertest_timer(FAR void **state) { int i; int fd; @@ -318,7 +318,7 @@ int main(int argc, FAR char *argv[]) const struct CMUnitTest tests[] = { - cmocka_unit_test_prestate(test_case_timer, &timer_state) + cmocka_unit_test_prestate(drivertest_timer, &timer_state) }; return cmocka_run_group_tests(tests, NULL, NULL); diff --git a/testing/drivers/drivertest/drivertest_touchpanel.c b/testing/drivers/drivertest/drivertest_touchpanel.c index b354760c6ac..3892c3d0fea 100644 --- a/testing/drivers/drivertest/drivertest_touchpanel.c +++ b/testing/drivers/drivertest/drivertest_touchpanel.c @@ -717,10 +717,10 @@ static void parse_commandline(uint32_t *screen_shape, } /**************************************************************************** - * Name: test_case_touchpanel + * Name: drivertest_touchpanel ****************************************************************************/ -static void test_case_touchpanel(FAR void **state) +static void drivertest_touchpanel(FAR void **state) { lv_nuttx_dsc_t info; lv_nuttx_result_t result; @@ -780,7 +780,7 @@ int main(int argc, FAR char *argv[]) const struct CMUnitTest tests[] = { - cmocka_unit_test_prestate(test_case_touchpanel, &screen_shape) + cmocka_unit_test_prestate(drivertest_touchpanel, &screen_shape) }; parse_commandline(&screen_shape, argc, argv); diff --git a/testing/drivers/drivertest/drivertest_watchdog.c b/testing/drivers/drivertest/drivertest_watchdog.c index a9240479ef9..1a4f54c495f 100644 --- a/testing/drivers/drivertest/drivertest_watchdog.c +++ b/testing/drivers/drivertest/drivertest_watchdog.c @@ -288,14 +288,14 @@ static int capture_callback(int irq, FAR void *context, FAR void *arg) } /**************************************************************************** - * Name: test_case_wdog_01 + * Name: drivertest_watchdog_feeding * * Description: * This function is used to test whether the watchdog can take effect after * timeout without relying on automatic feeding ****************************************************************************/ -static void test_case_wdog_01(FAR void **state) +static void drivertest_watchdog_feeding(FAR void **state) { int dev_fd; int ret; @@ -347,14 +347,14 @@ static void test_case_wdog_01(FAR void **state) } /**************************************************************************** - * Name: test_case_wdog_02 + * Name: drivertest_watchdog_interrupts * * Description: * This function is used to test whether the watchdog takes effect when * the interrupt is turned off. ****************************************************************************/ -static void test_case_wdog_02(FAR void **state) +static void drivertest_watchdog_interrupts(FAR void **state) { FAR struct wdg_state_s *wdg_state; struct boardioc_reset_cause_s reset_cause; @@ -390,14 +390,14 @@ static void wdg_wdentry(wdparm_t arg) } /**************************************************************************** - * Name: test_case_wdog_03 + * Name: drivertest_watchdog_loop * * Description: * This function is used to test whether the infinite loop will start * watchdog after opening the interrupt. ****************************************************************************/ -static void test_case_wdog_03(FAR void **state) +static void drivertest_watchdog_loop(FAR void **state) { int ret; static struct wdog_s wdog; @@ -428,13 +428,13 @@ static void test_case_wdog_03(FAR void **state) } /**************************************************************************** - * Name: test_case_wdog_04 + * Name: drivertest_watchdog_api * * Description: * This function is used to test the watchdog driver interface. ****************************************************************************/ -static void test_case_wdog_04(FAR void **state) +static void drivertest_watchdog_api(FAR void **state) { int dev_fd; int ret; @@ -541,10 +541,10 @@ int main(int argc, FAR char *argv[]) const struct CMUnitTest tests[] = { - cmocka_unit_test_prestate(test_case_wdog_01, &wdg_state), - cmocka_unit_test_prestate(test_case_wdog_02, &wdg_state), - cmocka_unit_test_prestate(test_case_wdog_03, &wdg_state), - cmocka_unit_test_prestate(test_case_wdog_04, &wdg_state) + cmocka_unit_test_prestate(drivertest_watchdog_feeding, &wdg_state), + cmocka_unit_test_prestate(drivertest_watchdog_interrupts, &wdg_state), + cmocka_unit_test_prestate(drivertest_watchdog_loop, &wdg_state), + cmocka_unit_test_prestate(drivertest_watchdog_api, &wdg_state) }; return cmocka_run_group_tests(tests, NULL, NULL); From 1193a82fcab5c8322f21fd09d8a54f653bb0902e Mon Sep 17 00:00:00 2001 From: simbit18 Date: Fri, 28 Mar 2025 12:40:58 +0100 Subject: [PATCH 235/391] system/uorb/listener.c: fix typo fix typo "Mointor" -> "Monitor" Signed-off-by: simbit18 --- system/uorb/listener.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/uorb/listener.c b/system/uorb/listener.c index 4897c63ec51..ebee5300545 100644 --- a/system/uorb/listener.c +++ b/system/uorb/listener.c @@ -944,7 +944,7 @@ int main(int argc, FAR char *argv[]) } else { - uorbinfo_raw("\nMointor objects num:%d", ret); + uorbinfo_raw("\nMonitor objects num:%d", ret); SLIST_FOREACH(tmp, &objlist, node) { uorbinfo_raw("object_name:%s, object_instance:%d", From 4bca48431a1e2ccf3d2099f5758d0b4c54f33930 Mon Sep 17 00:00:00 2001 From: raiden00pl Date: Fri, 28 Mar 2025 13:56:41 +0100 Subject: [PATCH 236/391] examples/adc: fix printf warning examples/adc: fix printf warning Signed-off-by: raiden00pl --- examples/adc/adc_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/adc/adc_main.c b/examples/adc/adc_main.c index 89cee2f23f9..68f4f19559e 100644 --- a/examples/adc/adc_main.c +++ b/examples/adc/adc_main.c @@ -310,7 +310,7 @@ int main(int argc, FAR char *argv[]) if (nsamples * sizeof(struct adc_msg_s) != nbytes) { printf("adc_main: read size=%ld is not a multiple of " - "sample size=%d, Ignoring\n", + "sample size=%zu, Ignoring\n", (long)nbytes, sizeof(struct adc_msg_s)); } else From 3764ab041aea97f261e4d18b7635a860cdf4963e Mon Sep 17 00:00:00 2001 From: raiden00pl Date: Fri, 28 Mar 2025 13:45:16 +0100 Subject: [PATCH 237/391] cmake: remove empty strings from FetchContent remove empty strings from FetchContent to eliminate cmake build warnings like this: CMake Warning (dev) at /usr/share/cmake/Modules/FetchContent.cmake:1564 (cmake_parse_arguments): The BUILD_COMMAND keyword was followed by an empty string or no value at all. Policy CMP0174 is not set, so cmake_parse_arguments() will unset the ARG_BUILD_COMMAND variable rather than setting it to an empty string. Signed-off-by: raiden00pl --- boot/mcuboot/CMakeLists.txt | 8 -------- crypto/tinydtls/CMakeLists.txt | 8 -------- graphics/lvgl/CMakeLists.txt | 14 ++------------ netutils/cjson/CMakeLists.txt | 8 -------- netutils/wakaama/CMakeLists.txt | 8 -------- system/adb/CMakeLists.txt | 14 ++------------ system/argtable3/CMakeLists.txt | 8 -------- testing/mm/stressapptest/CMakeLists.txt | 8 -------- testing/unity/CMakeLists.txt | 12 +----------- wireless/bluetooth/nimble/CMakeLists.txt | 8 -------- 10 files changed, 5 insertions(+), 91 deletions(-) diff --git a/boot/mcuboot/CMakeLists.txt b/boot/mcuboot/CMakeLists.txt index 28fe0d13b7a..2ea3e713722 100644 --- a/boot/mcuboot/CMakeLists.txt +++ b/boot/mcuboot/CMakeLists.txt @@ -33,14 +33,6 @@ if(CONFIG_BOOT_MCUBOOT) ${CMAKE_CURRENT_LIST_DIR}/mcuboot BINARY_DIR ${CMAKE_BINARY_DIR}/apps/boot/mcuboot/mcuboot - CONFIGURE_COMMAND - "" - BUILD_COMMAND - "" - INSTALL_COMMAND - "" - TEST_COMMAND - "" DOWNLOAD_NO_PROGRESS true TIMEOUT 30) diff --git a/crypto/tinydtls/CMakeLists.txt b/crypto/tinydtls/CMakeLists.txt index c0fd7000737..525422b4d4b 100644 --- a/crypto/tinydtls/CMakeLists.txt +++ b/crypto/tinydtls/CMakeLists.txt @@ -32,14 +32,6 @@ if(CONFIG_CRYPTO_TINYDTLS) ${CMAKE_CURRENT_LIST_DIR}/tinydtls BINARY_DIR ${CMAKE_BINARY_DIR}/apps/crypto/tinydtls/tinydtls - CONFIGURE_COMMAND - "" - BUILD_COMMAND - "" - INSTALL_COMMAND - "" - TEST_COMMAND - "" DOWNLOAD_NO_PROGRESS true TIMEOUT 30) diff --git a/graphics/lvgl/CMakeLists.txt b/graphics/lvgl/CMakeLists.txt index a1d1c5123d6..352b5da59fb 100644 --- a/graphics/lvgl/CMakeLists.txt +++ b/graphics/lvgl/CMakeLists.txt @@ -31,19 +31,9 @@ if(CONFIG_GRAPHICS_LVGL) FetchContent_Declare( lvgl_fetch DOWNLOAD_DIR ${CMAKE_CURRENT_LIST_DIR} - URL "https://github.com/lvgl/lvgl/archive/refs/tags/v9.2.1.zip" - SOURCE_DIR - ${CMAKE_CURRENT_LIST_DIR}/lvgl - BINARY_DIR + URL "https://github.com/lvgl/lvgl/archive/refs/tags/v9.2.1.zip" SOURCE_DIR + ${CMAKE_CURRENT_LIST_DIR}/lvgl BINARY_DIR ${CMAKE_BINARY_DIR}/apps/graphics/lvgl/lvgl - CONFIGURE_COMMAND - "" - BUILD_COMMAND - "" - INSTALL_COMMAND - "" - TEST_COMMAND - "" DOWNLOAD_NO_PROGRESS true TIMEOUT 120) diff --git a/netutils/cjson/CMakeLists.txt b/netutils/cjson/CMakeLists.txt index 9749f42f12f..83a6475cde7 100644 --- a/netutils/cjson/CMakeLists.txt +++ b/netutils/cjson/CMakeLists.txt @@ -40,14 +40,6 @@ if(CONFIG_NETUTILS_CJSON) ${CMAKE_CURRENT_LIST_DIR}/cJSON BINARY_DIR ${CMAKE_BINARY_DIR}/apps/netutils/cjson/cJSON - CONFIGURE_COMMAND - "" - BUILD_COMMAND - "" - INSTALL_COMMAND - "" - TEST_COMMAND - "" DOWNLOAD_NO_PROGRESS true TIMEOUT 30) diff --git a/netutils/wakaama/CMakeLists.txt b/netutils/wakaama/CMakeLists.txt index 97a6823c28e..df3c32c2cdc 100644 --- a/netutils/wakaama/CMakeLists.txt +++ b/netutils/wakaama/CMakeLists.txt @@ -32,14 +32,6 @@ if(CONFIG_NETUTILS_WAKAAMA) ${CMAKE_CURRENT_LIST_DIR}/wakaama BINARY_DIR ${CMAKE_BINARY_DIR}/apps/netutils/wakaama/wakaama - CONFIGURE_COMMAND - "" - BUILD_COMMAND - "" - INSTALL_COMMAND - "" - TEST_COMMAND - "" DOWNLOAD_NO_PROGRESS true TIMEOUT 30) diff --git a/system/adb/CMakeLists.txt b/system/adb/CMakeLists.txt index 7d1f9234180..e13f6f83ed5 100644 --- a/system/adb/CMakeLists.txt +++ b/system/adb/CMakeLists.txt @@ -34,19 +34,9 @@ if(CONFIG_SYSTEM_ADBD) FetchContent_Declare( microADB - URL "${ADBD_URL}/${ADBD_VERSION}.zip" - SOURCE_DIR - ${CMAKE_CURRENT_LIST_DIR}/microADB - BINARY_DIR + URL "${ADBD_URL}/${ADBD_VERSION}.zip" SOURCE_DIR + ${CMAKE_CURRENT_LIST_DIR}/microADB BINARY_DIR ${CMAKE_BINARY_DIR}/apps/system/microADB/microADB - CONFIGURE_COMMAND - "" - BUILD_COMMAND - "" - INSTALL_COMMAND - "" - TEST_COMMAND - "" DOWNLOAD_NO_PROGRESS true TIMEOUT 30) diff --git a/system/argtable3/CMakeLists.txt b/system/argtable3/CMakeLists.txt index fee506f42a0..40d322f60b2 100644 --- a/system/argtable3/CMakeLists.txt +++ b/system/argtable3/CMakeLists.txt @@ -43,14 +43,6 @@ if(CONFIG_SYSTEM_ARGTABLE3) ${CMAKE_CURRENT_LIST_DIR}/argtable3 BINARY_DIR ${CMAKE_BINARY_DIR}/apps/system/argtable3/argtable3 - CONFIGURE_COMMAND - "" - BUILD_COMMAND - "" - INSTALL_COMMAND - "" - TEST_COMMAND - "" DOWNLOAD_NO_PROGRESS true TIMEOUT 30) diff --git a/testing/mm/stressapptest/CMakeLists.txt b/testing/mm/stressapptest/CMakeLists.txt index 11fb3788fc6..397760397e0 100644 --- a/testing/mm/stressapptest/CMakeLists.txt +++ b/testing/mm/stressapptest/CMakeLists.txt @@ -37,14 +37,6 @@ if(CONFIG_TESTING_STRESSAPPTEST) ${CMAKE_CURRENT_LIST_DIR}/stressapptest BINARY_DIR ${CMAKE_BINARY_DIR}/stressapptest - CONFIGURE_COMMAND - "" - BUILD_COMMAND - "" - INSTALL_COMMAND - "" - TEST_COMMAND - "" DOWNLOAD_NO_PROGRESS true TIMEOUT 30) diff --git a/testing/unity/CMakeLists.txt b/testing/unity/CMakeLists.txt index 9aef4189996..a52dd57457d 100644 --- a/testing/unity/CMakeLists.txt +++ b/testing/unity/CMakeLists.txt @@ -29,18 +29,8 @@ if(CONFIG_TESTING_UNITY) DOWNLOAD_NAME "v${CONFIG_TESTING_UNITY_VERSION}.tar.gz" DOWNLOAD_DIR ${CMAKE_CURRENT_LIST_DIR} URL "${CONFIG_TESTING_UNITY_URL}/v${CONFIG_TESTING_UNITY_VERSION}.tar.gz" - SOURCE_DIR - ${CMAKE_CURRENT_LIST_DIR}/Unity - BINARY_DIR + SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/Unity BINARY_DIR ${CMAKE_BINARY_DIR}/apps/testing/unity/unity - CONFIGURE_COMMAND - "" - BUILD_COMMAND - "" - INSTALL_COMMAND - "" - TEST_COMMAND - "" DOWNLOAD_NO_PROGRESS true TIMEOUT 30) diff --git a/wireless/bluetooth/nimble/CMakeLists.txt b/wireless/bluetooth/nimble/CMakeLists.txt index 177439447e2..7733a8698fc 100644 --- a/wireless/bluetooth/nimble/CMakeLists.txt +++ b/wireless/bluetooth/nimble/CMakeLists.txt @@ -33,14 +33,6 @@ if(CONFIG_NIMBLE) ${CMAKE_CURRENT_LIST_DIR}/mynewt-nimble BINARY_DIR ${CMAKE_BINARY_DIR}/apps/wireless/bluetooth/nimble/mynewt-nimble - CONFIGURE_COMMAND - "" - BUILD_COMMAND - "" - INSTALL_COMMAND - "" - TEST_COMMAND - "" DOWNLOAD_NO_PROGRESS true TIMEOUT 30) From a4af41f893fa73210f615a7c3ba3899c98940ae9 Mon Sep 17 00:00:00 2001 From: raiden00pl Date: Fri, 28 Mar 2025 12:43:23 +0100 Subject: [PATCH 238/391] examples/nimble_blecent: fix various coding standard issues fix various coding standard issues for examples/nimble_blecent also fix compilation for make Signed-off-by: raiden00pl --- examples/nimble_blecent/CMakeLists.txt | 4 +- examples/nimble_blecent/Kconfig | 6 +- examples/nimble_blecent/Make.defs | 4 +- examples/nimble_blecent/Makefile | 2 + examples/nimble_blecent/blecent.h | 121 +++--- examples/nimble_blecent/misc.c | 13 +- examples/nimble_blecent/nimble_blecent_main.c | 410 +++++++++--------- examples/nimble_blecent/peer.c | 332 +++++++------- 8 files changed, 462 insertions(+), 430 deletions(-) diff --git a/examples/nimble_blecent/CMakeLists.txt b/examples/nimble_blecent/CMakeLists.txt index 6b10b76d66b..973b6e9edf8 100644 --- a/examples/nimble_blecent/CMakeLists.txt +++ b/examples/nimble_blecent/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/nimble_blecent/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this @@ -21,7 +23,7 @@ if(CONFIG_EXAMPLES_NIMBLE_BLECENT) nuttx_add_application( NAME - nimble + ${CONFIG_EXAMPLES_NIMBLE_BLECENT_PROGNAME} SRCS ${CMAKE_CURRENT_LIST_DIR}/nimble_blecent_main.c ${CMAKE_CURRENT_LIST_DIR}/misc.c diff --git a/examples/nimble_blecent/Kconfig b/examples/nimble_blecent/Kconfig index edaa65aa50e..20fe3b82e50 100644 --- a/examples/nimble_blecent/Kconfig +++ b/examples/nimble_blecent/Kconfig @@ -4,16 +4,16 @@ # config EXAMPLES_NIMBLE_BLECENT - tristate "NimBLE peripheral" + tristate "NimBLE central" default n ---help--- - Enable the nimble peripheral + Enable the nimble central example if EXAMPLES_NIMBLE_BLECENT config EXAMPLES_NIMBLE_BLECENT_PROGNAME string "Program name" - default "nimble" + default "blecent" ---help--- This is the name of the program that will be used when the NSH ELF program is installed. diff --git a/examples/nimble_blecent/Make.defs b/examples/nimble_blecent/Make.defs index fb8b4456538..c6f0b98e67f 100644 --- a/examples/nimble_blecent/Make.defs +++ b/examples/nimble_blecent/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/nimble_blecent/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The @@ -19,5 +21,5 @@ ############################################################################ ifneq ($(CONFIG_EXAMPLES_NIMBLE_BLECENT),) -CONFIGURED_APPS += $(APPDIR)/examples/nimble +CONFIGURED_APPS += $(APPDIR)/examples/nimble_blecent endif diff --git a/examples/nimble_blecent/Makefile b/examples/nimble_blecent/Makefile index 36f93724e52..5870a0285ce 100644 --- a/examples/nimble_blecent/Makefile +++ b/examples/nimble_blecent/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/nimble_blecent/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/nimble_blecent/blecent.h b/examples/nimble_blecent/blecent.h index 8ae394ecd29..20e9239a7ee 100644 --- a/examples/nimble_blecent/blecent.h +++ b/examples/nimble_blecent/blecent.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nimble_blecent/blecent.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The @@ -18,8 +20,8 @@ * ****************************************************************************/ -#ifndef H_BLECENT_ -#define H_BLECENT_ +#ifndef __APPS_EXAMPLES_NIMBLE_BLECENT_BLECENT_H +#define __APPS_EXAMPLES_NIMBLE_BLECENT_BLECENT_H /**************************************************************************** * Included Files @@ -27,16 +29,9 @@ #include -#ifdef __cplusplus -extern "C" -{ -#endif - -struct ble_hs_adv_fields; -struct ble_gap_conn_desc; -struct ble_hs_cfg; -union ble_store_value; -union ble_store_key; +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ #define BLECENT_SVC_ALERT_UUID 0x1811 #define BLECENT_CHR_SUP_NEW_ALERT_CAT_UUID 0x2A47 @@ -45,39 +40,34 @@ union ble_store_key; #define BLECENT_CHR_UNR_ALERT_STAT_UUID 0x2A45 #define BLECENT_CHR_ALERT_NOT_CTRL_PT 0x2A44 -/* Misc. */ - -void print_bytes(const uint8_t *bytes, int len); -void print_mbuf(const struct os_mbuf *om); -char *addr_str(const void *addr); -void print_uuid(const ble_uuid_t *uuid); -void print_conn_desc(const struct ble_gap_conn_desc *desc); -void print_adv_fields(const struct ble_hs_adv_fields *fields); +/**************************************************************************** + * Public Type Definition + ****************************************************************************/ /* Peer. */ struct peer_dsc { - SLIST_ENTRY(peer_dsc) next; - struct ble_gatt_dsc dsc; + SLIST_ENTRY(peer_dsc) next; + struct ble_gatt_dsc dsc; }; SLIST_HEAD(peer_dsc_list, peer_dsc); struct peer_chr { - SLIST_ENTRY(peer_chr) next; - struct ble_gatt_chr chr; + SLIST_ENTRY(peer_chr) next; + struct ble_gatt_chr chr; - struct peer_dsc_list dscs; + struct peer_dsc_list dscs; }; SLIST_HEAD(peer_chr_list, peer_chr); struct peer_svc { - SLIST_ENTRY(peer_svc) next; - struct ble_gatt_svc svc; + SLIST_ENTRY(peer_svc) next; + struct ble_gatt_svc svc; - struct peer_chr_list chrs; + struct peer_chr_list chrs; }; SLIST_HEAD(peer_svc_list, peer_svc); @@ -86,35 +76,68 @@ typedef void peer_disc_fn(const struct peer *peer, int status, void *arg); struct peer { - SLIST_ENTRY(peer) next; + SLIST_ENTRY(peer) next; - uint16_t conn_handle; + uint16_t conn_handle; - /* List of discovered GATT services. */ + /* List of discovered GATT services. */ - struct peer_svc_list svcs; + struct peer_svc_list svcs; - /* Keeps track of where we are in the service discovery process. */ + /* Keeps track of where we are in the service discovery process. */ - uint16_t disc_prev_chr_val; - struct peer_svc *cur_svc; + uint16_t disc_prev_chr_val; + struct peer_svc *cur_svc; - /* Callback that gets executed when service discovery completes. */ + /* Callback that gets executed when service discovery completes. */ - peer_disc_fn *disc_cb; - void *disc_cb_arg; + peer_disc_fn *disc_cb; + void *disc_cb_arg; }; -int peer_disc_all(uint16_t conn_handle, peer_disc_fn *disc_cb, - void *disc_cb_arg); -const struct peer_dsc * -peer_dsc_find_uuid(const struct peer *peer, const ble_uuid_t *svc_uuid, - const ble_uuid_t *chr_uuid, const ble_uuid_t *dsc_uuid); -const struct peer_chr * -peer_chr_find_uuid(const struct peer *peer, const ble_uuid_t *svc_uuid, - const ble_uuid_t *chr_uuid); -const struct peer_svc * -peer_svc_find_uuid(const struct peer *peer, const ble_uuid_t *uuid); +/**************************************************************************** + * Public Type Definition + ****************************************************************************/ + +/* Forward references */ + +struct ble_hs_adv_fields; +struct ble_gap_conn_desc; +struct ble_hs_cfg; +union ble_store_value; +union ble_store_key; + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +#ifdef __cplusplus +extern "C" +{ +#endif + +/* Misc. */ + +void print_mbuf(FAR const struct os_mbuf *om); +FAR char *addr_str(FAR const void *addr); +void print_uuid(FAR const ble_uuid_t *uuid); +void print_conn_desc(FAR const struct ble_gap_conn_desc *desc); +void print_adv_fields(FAR const struct ble_hs_adv_fields *fields); + +int peer_disc_all(uint16_t conn_handle, FAR peer_disc_fn *disc_cb, + FAR void *disc_cb_arg); +FAR const struct peer_dsc * +peer_dsc_find_uuid(FAR const struct peer *peer, + FAR const ble_uuid_t *svc_uuid, + FAR const ble_uuid_t *chr_uuid, + FAR const ble_uuid_t *dsc_uuid); +FAR const struct peer_chr * +peer_chr_find_uuid(FAR const struct peer *peer, + FAR const ble_uuid_t *svc_uuid, + FAR const ble_uuid_t *chr_uuid); +FAR const struct peer_svc * +peer_svc_find_uuid(FAR const struct peer *peer, + FAR const ble_uuid_t *uuid); int peer_delete(uint16_t conn_handle); int peer_add(uint16_t conn_handle); int peer_init(int max_peers, int max_svcs, int max_chrs, int max_dscs); @@ -123,4 +146,4 @@ int peer_init(int max_peers, int max_svcs, int max_chrs, int max_dscs); } #endif -#endif +#endif /* __APPS_EXAMPLES_NIMBLE_BLECENT_BLECENT_H */ diff --git a/examples/nimble_blecent/misc.c b/examples/nimble_blecent/misc.c index 8ac07677f44..87c7f5d3757 100644 --- a/examples/nimble_blecent/misc.c +++ b/examples/nimble_blecent/misc.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nimble_blecent/misc.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The @@ -25,15 +27,16 @@ #include #include #include + #include "host/ble_hs.h" #include "host/ble_uuid.h" #include "blecent.h" /**************************************************************************** - * Public Functions + * Private Functions ****************************************************************************/ -void print_bytes(FAR const uint8_t *bytes, int len) +static void print_bytes(FAR const uint8_t *bytes, int len) { int i; @@ -43,6 +46,10 @@ void print_bytes(FAR const uint8_t *bytes, int len) } } +/**************************************************************************** + * Public Functions + ****************************************************************************/ + void print_mbuf(FAR const struct os_mbuf *om) { int colon; @@ -64,7 +71,7 @@ void print_mbuf(FAR const struct os_mbuf *om) } } -char * addr_str(FAR const void *addr) +FAR char *addr_str(FAR const void *addr) { static char buf[6 * 2 + 5 + 1]; const uint8_t *u8p; diff --git a/examples/nimble_blecent/nimble_blecent_main.c b/examples/nimble_blecent/nimble_blecent_main.c index 6e2bd0cb61f..a20dd282db9 100644 --- a/examples/nimble_blecent/nimble_blecent_main.c +++ b/examples/nimble_blecent/nimble_blecent_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nimble_blecent/nimble_blecent_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The @@ -69,7 +71,7 @@ void ble_hci_sock_set_device(int dev); static int blecent_gap_event(FAR struct ble_gap_event *event, FAR void *arg); /**************************************************************************** - * Private Data + * Private Functions ****************************************************************************/ /**************************************************************************** @@ -85,10 +87,11 @@ blecent_on_read(uint16_t conn_handle, printf("Read complete; status=%d conn_handle=%d", error->status, conn_handle); if (error->status == 0) - { - printf(" attr_handle=%d value=", attr->handle); - print_mbuf(attr->om); - } + { + printf(" attr_handle=%d value=", attr->handle); + print_mbuf(attr->om); + } + printf("\n"); return 0; @@ -110,8 +113,7 @@ blecent_on_write(uint16_t conn_handle, return 0; } -/** - * Application callback. Called when the attempt to subscribe to +/* Application callback. Called when the attempt to subscribe to * notifications for the ANS Unread Alert Status characteristic * has completed. */ @@ -133,8 +135,7 @@ blecent_on_subscribe(uint16_t conn_handle, * Name: blecent_read_write_subscribe ****************************************************************************/ -static void -blecent_read_write_subscribe(FAR const struct peer *peer) +static void blecent_read_write_subscribe(FAR const struct peer *peer) { const struct peer_chr *chr; const struct peer_dsc *dsc; @@ -143,76 +144,74 @@ blecent_read_write_subscribe(FAR const struct peer *peer) /* Read the supported-new-alert-category characteristic. */ - chr = peer_chr_find_uuid(peer, - BLE_UUID16_DECLARE(BLECENT_SVC_ALERT_UUID), - BLE_UUID16_DECLARE(BLECENT_CHR_SUP_NEW_ALERT_CAT_UUID)); + chr = peer_chr_find_uuid( + peer, BLE_UUID16_DECLARE(BLECENT_SVC_ALERT_UUID), + BLE_UUID16_DECLARE(BLECENT_CHR_SUP_NEW_ALERT_CAT_UUID)); if (chr == NULL) - { - printf("Error: Peer doesn't support the Supported New " - "Alert Category characteristic\n"); - goto err; - } + { + printf("Error: Peer doesn't support the Supported New " + "Alert Category characteristic\n"); + goto err; + } rc = ble_gattc_read(peer->conn_handle, chr->chr.val_handle, blecent_on_read, NULL); if (rc != 0) - { - printf("Error: Failed to read characteristic; rc=%d\n", - rc); - goto err; - } + { + printf("Error: Failed to read characteristic; rc=%d\n", rc); + goto err; + } /* Write two bytes (99, 100) to the alert-notification-control-point * characteristic. */ - chr = peer_chr_find_uuid(peer, - BLE_UUID16_DECLARE(BLECENT_SVC_ALERT_UUID), - BLE_UUID16_DECLARE(BLECENT_CHR_ALERT_NOT_CTRL_PT)); + chr = peer_chr_find_uuid( + peer, BLE_UUID16_DECLARE(BLECENT_SVC_ALERT_UUID), + BLE_UUID16_DECLARE(BLECENT_CHR_ALERT_NOT_CTRL_PT)); if (chr == NULL) - { - printf("Error: Peer doesn't support the Alert " - "Notification Control Point characteristic\n"); - goto err; - } + { + printf("Error: Peer doesn't support the Alert " + "Notification Control Point characteristic\n"); + goto err; + } value[0] = 99; value[1] = 100; - rc = ble_gattc_write_flat(peer->conn_handle, chr->chr.val_handle, - value, sizeof value, blecent_on_write, NULL); + rc = ble_gattc_write_flat(peer->conn_handle, chr->chr.val_handle, value, + sizeof value, blecent_on_write, NULL); if (rc != 0) - { - printf("Error: Failed to write characteristic; rc=%d\n", - rc); - } + { + printf("Error: Failed to write characteristic; rc=%d\n", rc); + } /* Subscribe to notifications for the Battery Level characteristic. * A central enables notifications by writing two bytes (1, 0) to the * characteristic's client-characteristic-configuration-descriptor (CCCD). */ - dsc = peer_dsc_find_uuid(peer, - BLE_UUID16_DECLARE(BLE_SVC_BAS_UUID16), - BLE_UUID16_DECLARE(BLE_SVC_BAS_CHR_UUID16_BATTERY_LEVEL), - BLE_UUID16_DECLARE(BLE_GATT_DSC_CLT_CFG_UUID16)); + dsc = peer_dsc_find_uuid( + peer, BLE_UUID16_DECLARE(BLE_SVC_BAS_UUID16), + BLE_UUID16_DECLARE(BLE_SVC_BAS_CHR_UUID16_BATTERY_LEVEL), + BLE_UUID16_DECLARE(BLE_GATT_DSC_CLT_CFG_UUID16)); if (dsc == NULL) - { - printf("Error: Peer lacks a CCCD for the \ + { + printf("Error: Peer lacks a CCCD for the \ Battery Level characteristic\n"); - goto err; - } + goto err; + } value[0] = 1; value[1] = 0; - rc = ble_gattc_write_flat(peer->conn_handle, dsc->dsc.handle, - value, sizeof value, blecent_on_subscribe, NULL); + rc = ble_gattc_write_flat(peer->conn_handle, dsc->dsc.handle, value, + sizeof value, blecent_on_subscribe, NULL); if (rc != 0) - { - printf("Error: Failed to subscribe to characteristic; " - "rc=%d\n", - rc); - goto err; - } + { + printf("Error: Failed to subscribe to characteristic; " + "rc=%d\n", + rc); + goto err; + } return; @@ -236,8 +235,8 @@ blecent_on_disc_complete(FAR const struct peer *peer, int status, /* Service discovery failed. Terminate the connection. */ printf("Error: Service discovery failed; status=%d " - "conn_handle=%d\n", - status, peer->conn_handle); + "conn_handle=%d\n", + status, peer->conn_handle); ble_gap_terminate(peer->conn_handle, BLE_ERR_REM_USER_CONN_TERM); return; } @@ -264,8 +263,8 @@ blecent_on_disc_complete(FAR const struct peer *peer, int status, static void blecent_scan(void) { - uint8_t own_addr_type; struct ble_gap_disc_params disc_params; + uint8_t own_addr_type; int rc; /* Figure out address to use while advertising (no privacy for now) */ @@ -283,8 +282,7 @@ static void blecent_scan(void) disc_params.filter_duplicates = 1; - /** - * Perform a passive scan. I.e., don't send follow-up scan requests to + /* Perform a passive scan. I.e., don't send follow-up scan requests to * each advertiser. */ @@ -292,26 +290,24 @@ static void blecent_scan(void) /* Use defaults for the rest of the parameters. */ - disc_params.itvl = 0; - disc_params.window = 0; + disc_params.itvl = 0; + disc_params.window = 0; disc_params.filter_policy = 0; - disc_params.limited = 0; + disc_params.limited = 0; rc = ble_gap_disc(own_addr_type, BLE_HS_FOREVER, &disc_params, blecent_gap_event, NULL); if (rc != 0) - { - printf("Error initiating GAP discovery procedure; rc=%d\n", - rc); - } + { + printf("Error initiating GAP discovery procedure; rc=%d\n", rc); + } } /**************************************************************************** * Name: blecent_should_connect ****************************************************************************/ -static int -blecent_should_connect(const struct ble_gap_disc_desc *disc) +static int blecent_should_connect(const struct ble_gap_disc_desc *disc) { struct ble_hs_adv_fields fields; int rc; @@ -319,8 +315,8 @@ blecent_should_connect(const struct ble_gap_disc_desc *disc) /* The device has to be advertising connectability. */ - if (disc->event_type != BLE_HCI_ADV_RPT_EVTYPE_ADV_IND && - disc->event_type != BLE_HCI_ADV_RPT_EVTYPE_DIR_IND) + if (disc->event_type != BLE_HCI_ADV_RPT_EVTYPE_ADV_IND + && disc->event_type != BLE_HCI_ADV_RPT_EVTYPE_DIR_IND) { return 0; } @@ -359,27 +355,27 @@ blecent_connect_if_interesting(FAR const struct ble_gap_disc_desc *disc) /* Don't do anything if we don't care about this advertiser. */ if (!blecent_should_connect(disc)) - { - return; - } + { + return; + } /* Scanning must be stopped before a connection can be initiated. */ rc = ble_gap_disc_cancel(); if (rc != 0) - { - printf("Failed to cancel scan; rc=%d\n", rc); - return; - } + { + printf("Failed to cancel scan; rc=%d\n", rc); + return; + } /* Figure out address to use for connect (no privacy for now) */ rc = ble_hs_id_infer_auto(0, &own_addr_type); if (rc != 0) - { - printf("error determining address type; rc=%d\n", rc); - return; - } + { + printf("error determining address type; rc=%d\n", rc); + return; + } /* Try to connect the the advertiser. Allow 30 seconds (30000 ms) for * timeout. @@ -388,182 +384,181 @@ blecent_connect_if_interesting(FAR const struct ble_gap_disc_desc *disc) rc = ble_gap_connect(own_addr_type, &disc->addr, 30000, NULL, blecent_gap_event, NULL); if (rc != 0) - { - printf("Error: Failed to connect to device; addr_type=%d " - "addr=%s\n; rc=%d", - disc->addr.type, addr_str(disc->addr.val), rc); - return; - } + { + printf("Error: Failed to connect to device; addr_type=%d " + "addr=%s\n; rc=%d", + disc->addr.type, addr_str(disc->addr.val), rc); + return; + } } /**************************************************************************** * Name: blecent_gap_event ****************************************************************************/ -static int -blecent_gap_event(FAR struct ble_gap_event *event, FAR void *arg) +static int blecent_gap_event(FAR struct ble_gap_event *event, FAR void *arg) { struct ble_gap_conn_desc desc; struct ble_hs_adv_fields fields; int rc; switch (event->type) - { - case BLE_GAP_EVENT_DISC: - rc = ble_hs_adv_parse_fields(&fields, event->disc.data, - event->disc.length_data); - if (rc != 0) { - return 0; - } + case BLE_GAP_EVENT_DISC: + rc = ble_hs_adv_parse_fields(&fields, event->disc.data, + event->disc.length_data); + if (rc != 0) + { + return 0; + } - /* An advertisment report was received during GAP discovery. */ + /* An advertisment report was received during GAP discovery. */ - print_adv_fields(&fields); + print_adv_fields(&fields); - /* Try to connect to the advertiser if it looks interesting. */ + /* Try to connect to the advertiser if it looks interesting. */ - blecent_connect_if_interesting(&event->disc); - return 0; + blecent_connect_if_interesting(&event->disc); + return 0; - case BLE_GAP_EVENT_CONNECT: + case BLE_GAP_EVENT_CONNECT: - /* A new connection was established or a connection attempt failed. */ + /* A new connection was established or a connection attempt failed. + */ - if (event->connect.status == 0) - { - /* Connection successfully established. */ + if (event->connect.status == 0) + { + /* Connection successfully established. */ - printf("Connection established "); + printf("Connection established "); - rc = ble_gap_conn_find(event->connect.conn_handle, &desc); - assert(rc == 0); - print_conn_desc(&desc); - printf("\n"); + rc = ble_gap_conn_find(event->connect.conn_handle, &desc); + assert(rc == 0); + print_conn_desc(&desc); + printf("\n"); - /* Remember peer. */ + /* Remember peer. */ - rc = peer_add(event->connect.conn_handle); - if (rc != 0) - { - printf("Failed to add peer; rc=%d\n", rc); - return 0; - } + rc = peer_add(event->connect.conn_handle); + if (rc != 0) + { + printf("Failed to add peer; rc=%d\n", rc); + return 0; + } - /* Perform service discovery. */ + /* Perform service discovery. */ - rc = peer_disc_all(event->connect.conn_handle, - blecent_on_disc_complete, NULL); - if (rc != 0) - { - printf("Failed to discover services; rc=%d\n", rc); - return 0; - } - } - else - { - /* Connection attempt failed; resume scanning. */ + rc = peer_disc_all(event->connect.conn_handle, + blecent_on_disc_complete, NULL); + if (rc != 0) + { + printf("Failed to discover services; rc=%d\n", rc); + return 0; + } + } + else + { + /* Connection attempt failed; resume scanning. */ - printf("Error: Connection failed; status=%d\n", - event->connect.status); - blecent_scan(); - } + printf("Error: Connection failed; status=%d\n", + event->connect.status); + blecent_scan(); + } - return 0; + return 0; - case BLE_GAP_EVENT_DISCONNECT: + case BLE_GAP_EVENT_DISCONNECT: - /* Connection terminated. */ + /* Connection terminated. */ - printf("disconnect; reason=%d ", event->disconnect.reason); - print_conn_desc(&event->disconnect.conn); - printf("\n"); + printf("disconnect; reason=%d ", event->disconnect.reason); + print_conn_desc(&event->disconnect.conn); + printf("\n"); - /* Forget about peer. */ + /* Forget about peer. */ - peer_delete(event->disconnect.conn.conn_handle); + peer_delete(event->disconnect.conn.conn_handle); - /* Resume scanning. */ + /* Resume scanning. */ - blecent_scan(); - return 0; + blecent_scan(); + return 0; - case BLE_GAP_EVENT_DISC_COMPLETE: - printf("discovery complete; reason=%d\n", - event->disc_complete.reason); - return 0; + case BLE_GAP_EVENT_DISC_COMPLETE: + printf("discovery complete; reason=%d\n", + event->disc_complete.reason); + return 0; - case BLE_GAP_EVENT_ENC_CHANGE: + case BLE_GAP_EVENT_ENC_CHANGE: - /* Encryption has been enabled or disabled for this connection. */ + /* Encryption has been enabled or disabled for this connection. */ - printf("encryption change event; status=%d ", - event->enc_change.status); - rc = ble_gap_conn_find(event->enc_change.conn_handle, &desc); - assert(rc == 0); - print_conn_desc(&desc); - return 0; + printf("encryption change event; status=%d ", + event->enc_change.status); + rc = ble_gap_conn_find(event->enc_change.conn_handle, &desc); + assert(rc == 0); + print_conn_desc(&desc); + return 0; - case BLE_GAP_EVENT_NOTIFY_RX: + case BLE_GAP_EVENT_NOTIFY_RX: - /* Peer sent us a notification or indication. */ + /* Peer sent us a notification or indication. */ - printf("received %s; conn_handle=%d attr_handle=%d " - "attr_len=%d\n", - event->notify_rx.indication ? "indication" : "notification", - event->notify_rx.conn_handle, - event->notify_rx.attr_handle, - OS_MBUF_PKTLEN(event->notify_rx.om)); + printf("received %s; conn_handle=%d attr_handle=%d " + "attr_len=%d\n", + event->notify_rx.indication ? "indication" : "notification", + event->notify_rx.conn_handle, event->notify_rx.attr_handle, + OS_MBUF_PKTLEN(event->notify_rx.om)); - uint8_t notif_data[100]; /* Size depending on the actual size of the notification data you have */ - uint16_t notif_len; - int offset = 0; - notif_len = OS_MBUF_PKTLEN(event->notify_rx.om); - os_mbuf_copydata(event->notify_rx.om, offset, notif_len, notif_data); + uint8_t notif_data[100]; /* Size depending on the actual size of the + notification data you have */ + uint16_t notif_len; + int offset = 0; + notif_len = OS_MBUF_PKTLEN(event->notify_rx.om); + os_mbuf_copydata(event->notify_rx.om, offset, notif_len, notif_data); - printf("notification data: "); - for (int i = 0; i < notif_len; i++) - { - printf("%02d ", notif_data[i]); - } - printf("\n"); + printf("notification data: "); + for (int i = 0; i < notif_len; i++) + { + printf("%02d ", notif_data[i]); + } - /* Attribute data is contained in event->notify_rx.attr_data. */ + printf("\n"); - return 0; + /* Attribute data is contained in event->notify_rx.attr_data. */ - case BLE_GAP_EVENT_MTU: - printf("mtu update event; conn_handle=%d cid=%d mtu=%d\n", - event->mtu.conn_handle, - event->mtu.channel_id, - event->mtu.value); - return 0; + return 0; + + case BLE_GAP_EVENT_MTU: + printf("mtu update event; conn_handle=%d cid=%d mtu=%d\n", + event->mtu.conn_handle, event->mtu.channel_id, + event->mtu.value); + return 0; - case BLE_GAP_EVENT_REPEAT_PAIRING: - /* We already have a bond with the peer, but it is attempting to - * establish a new secure link. This app sacrifices security for - * convenience: just throw away the old bond and accept the new link. - */ + case BLE_GAP_EVENT_REPEAT_PAIRING: + /* We already have a bond with the peer, but it is attempting to + * establish a new secure link. This app sacrifices security for + * convenience: just throw away the old bond and accept the new link. + */ - /* Delete the old bond. */ + /* Delete the old bond. */ - rc = ble_gap_conn_find(event->repeat_pairing.conn_handle, &desc); - assert(rc == 0); - ble_store_util_delete_peer(&desc.peer_id_addr); + rc = ble_gap_conn_find(event->repeat_pairing.conn_handle, &desc); + assert(rc == 0); + ble_store_util_delete_peer(&desc.peer_id_addr); - /* Return BLE_GAP_REPEAT_PAIRING_RETRY to indicate that the host should - * continue with the pairing operation. - */ + /* Return BLE_GAP_REPEAT_PAIRING_RETRY to indicate that the host + * should continue with the pairing operation. + */ - return BLE_GAP_REPEAT_PAIRING_RETRY; + return BLE_GAP_REPEAT_PAIRING_RETRY; - default: - return 0; - } + default: + return 0; + } } -static void -blecent_on_reset(int reason) +static void blecent_on_reset(int reason) { printf("Resetting state; reason=%d\n", reason); } @@ -572,8 +567,7 @@ blecent_on_reset(int reason) * Name: blecent_on_sync ****************************************************************************/ -static void -blecent_on_sync(void) +static void blecent_on_sync(void) { int rc; @@ -654,8 +648,8 @@ int main(int argc, FAR char **argv) /* Configure the host. */ - ble_hs_cfg.reset_cb = blecent_on_reset; - ble_hs_cfg.sync_cb = blecent_on_sync; + ble_hs_cfg.reset_cb = blecent_on_reset; + ble_hs_cfg.sync_cb = blecent_on_sync; ble_hs_cfg.store_status_cb = ble_store_util_status_rr; /* Initialize data structures to track connected peers. */ @@ -665,8 +659,8 @@ int main(int argc, FAR char **argv) /* Create task which handles HCI socket */ - ret = ble_npl_task_init(&s_task_hci, "hci_sock", ble_hci_sock_task, - NULL, TASK_DEFAULT_PRIORITY, BLE_NPL_TIME_FOREVER, + ret = ble_npl_task_init(&s_task_hci, "hci_sock", ble_hci_sock_task, NULL, + TASK_DEFAULT_PRIORITY, BLE_NPL_TIME_FOREVER, TASK_DEFAULT_STACK, TASK_DEFAULT_STACK_SIZE); if (ret != 0) { @@ -675,8 +669,8 @@ int main(int argc, FAR char **argv) /* Create task which handles default event queue for host stack. */ - ret = ble_npl_task_init(&s_task_host, "ble_host", ble_host_task, - NULL, TASK_DEFAULT_PRIORITY, BLE_NPL_TIME_FOREVER, + ret = ble_npl_task_init(&s_task_host, "ble_host", ble_host_task, NULL, + TASK_DEFAULT_PRIORITY, BLE_NPL_TIME_FOREVER, TASK_DEFAULT_STACK, TASK_DEFAULT_STACK_SIZE); if (ret != 0) { diff --git a/examples/nimble_blecent/peer.c b/examples/nimble_blecent/peer.c index 3ed07729040..16ebd787263 100644 --- a/examples/nimble_blecent/peer.c +++ b/examples/nimble_blecent/peer.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nimble_blecent/peer.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The @@ -27,47 +29,53 @@ #include "host/ble_hs.h" #include "blecent.h" -static void *peer_svc_mem; -static struct os_mempool peer_svc_pool; - -static void *peer_chr_mem; -static struct os_mempool peer_chr_pool; - -static void *peer_dsc_mem; -static struct os_mempool peer_dsc_pool; - -static void *peer_mem; -static struct os_mempool peer_pool; -static SLIST_HEAD(, peer) peers; +/**************************************************************************** + * Private Function Prototypes + ****************************************************************************/ -static struct peer_svc * +FAR static struct peer_svc * peer_svc_find_range(FAR struct peer *peer, uint16_t attr_handle); -static struct peer_svc * +FAR static struct peer_svc * peer_svc_find(FAR struct peer *peer, uint16_t svc_start_handle, struct peer_svc **out_prev); -int peer_svc_is_empty(const struct peer_svc *svc); - -uint16_t -chr_end_handle(FAR const struct peer_svc *svc, - FAR const struct peer_chr *chr); -int chr_is_empty(FAR const struct peer_svc *svc, - FAR const struct peer_chr *chr); -static struct peer_chr * +static int peer_svc_is_empty(const struct peer_svc *svc); + +static uint16_t chr_end_handle(FAR const struct peer_svc *svc, + FAR const struct peer_chr *chr); +static int chr_is_empty(FAR const struct peer_svc *svc, + FAR const struct peer_chr *chr); +FAR static struct peer_chr * peer_chr_find(FAR const struct peer_svc *svc, uint16_t chr_def_handle, FAR struct peer_chr **out_prev); -static void -peer_disc_chrs(FAR struct peer *peer); +static void peer_disc_chrs(FAR struct peer *peer); static int peer_dsc_disced(uint16_t conn_handle, FAR const struct ble_gatt_error *error, uint16_t chr_val_handle, FAR const struct ble_gatt_dsc *dsc, FAR void *arg); +/**************************************************************************** + * Private Data + ****************************************************************************/ + +FAR static void *peer_svc_mem; +static struct os_mempool peer_svc_pool; + +FAR static void *peer_chr_mem; +static struct os_mempool peer_chr_pool; + +FAR static void *peer_dsc_mem; +static struct os_mempool peer_dsc_pool; + +FAR static void *peer_mem; +static struct os_mempool peer_pool; +static SLIST_HEAD(, peer) peers; + /**************************************************************************** * Public Functions ****************************************************************************/ -static struct peer *peer_find(uint16_t conn_handle) +FAR static struct peer *peer_find(uint16_t conn_handle) { struct peer *peer; @@ -94,11 +102,11 @@ static void peer_disc_complete(FAR struct peer *peer, int rc) } } -static struct peer_dsc * +FAR static struct peer_dsc * peer_dsc_find_prev(FAR const struct peer_chr *chr, uint16_t dsc_handle) { - struct peer_dsc *prev; - struct peer_dsc *dsc; + FAR struct peer_dsc *prev; + FAR struct peer_dsc *dsc; prev = NULL; SLIST_FOREACH(dsc, &chr->dscs, next) @@ -114,12 +122,12 @@ peer_dsc_find_prev(FAR const struct peer_chr *chr, uint16_t dsc_handle) return prev; } -static struct peer_dsc * +FAR static struct peer_dsc * peer_dsc_find(FAR const struct peer_chr *chr, uint16_t dsc_handle, FAR struct peer_dsc **out_prev) { - struct peer_dsc *prev; - struct peer_dsc *dsc; + FAR struct peer_dsc *prev; + FAR struct peer_dsc *dsc; prev = peer_dsc_find_prev(chr, dsc_handle); if (prev == NULL) @@ -148,10 +156,10 @@ static int peer_dsc_add(FAR struct peer *peer, uint16_t chr_val_handle, FAR const struct ble_gatt_dsc *gatt_dsc) { - struct peer_dsc *prev; - struct peer_dsc *dsc; - struct peer_svc *svc; - struct peer_chr *chr; + FAR struct peer_dsc *prev; + FAR struct peer_dsc *dsc; + FAR struct peer_svc *svc; + FAR struct peer_chr *chr; svc = peer_svc_find_range(peer, chr_val_handle); if (svc == NULL) @@ -209,8 +217,8 @@ peer_dsc_add(FAR struct peer *peer, uint16_t chr_val_handle, static void peer_disc_dscs(FAR struct peer *peer) { - struct peer_chr *chr; - struct peer_svc *svc; + FAR struct peer_chr *chr; + FAR struct peer_svc *svc; int rc; /* Search through the list of discovered characteristics for the first @@ -251,38 +259,38 @@ peer_dsc_disced(uint16_t conn_handle, FAR const struct ble_gatt_error *error, uint16_t chr_val_handle, FAR const struct ble_gatt_dsc *dsc, FAR void *arg) { - struct peer *peer; + FAR struct peer *peer; int rc; peer = arg; assert(peer->conn_handle == conn_handle); switch (error->status) - { - case 0: - rc = peer_dsc_add(peer, chr_val_handle, dsc); - break; + { + case 0: + rc = peer_dsc_add(peer, chr_val_handle, dsc); + break; - case BLE_HS_EDONE: - /* All descriptors in this characteristic discovered; - * start discovering descriptors in the next characteristic. - */ + case BLE_HS_EDONE: + /* All descriptors in this characteristic discovered; + * start discovering descriptors in the next characteristic. + */ - if (peer->disc_prev_chr_val > 0) - { - peer_disc_dscs(peer); - } + if (peer->disc_prev_chr_val > 0) + { + peer_disc_dscs(peer); + } - rc = 0; - break; + rc = 0; + break; - default: + default: - /* Error; abort discovery. */ + /* Error; abort discovery. */ - rc = error->status; - break; - } + rc = error->status; + break; + } if (rc != 0) { @@ -294,11 +302,10 @@ peer_dsc_disced(uint16_t conn_handle, FAR const struct ble_gatt_error *error, return rc; } -uint16_t -chr_end_handle(FAR const struct peer_svc *svc, - FAR const struct peer_chr *chr) +static uint16_t chr_end_handle(FAR const struct peer_svc *svc, + FAR const struct peer_chr *chr) { - const struct peer_chr *next_chr; + FAR const struct peer_chr *next_chr; next_chr = SLIST_NEXT(chr, next); if (next_chr != NULL) @@ -311,17 +318,17 @@ chr_end_handle(FAR const struct peer_svc *svc, } } -int chr_is_empty(FAR const struct peer_svc *svc, - FAR const struct peer_chr *chr) +static int chr_is_empty(FAR const struct peer_svc *svc, + FAR const struct peer_chr *chr) { return chr_end_handle(svc, chr) <= chr->chr.val_handle; } -static struct peer_chr * +FAR static struct peer_chr * peer_chr_find_prev(const struct peer_svc *svc, uint16_t chr_val_handle) { - struct peer_chr *prev; - struct peer_chr *chr; + FAR struct peer_chr *prev; + FAR struct peer_chr *chr; prev = NULL; SLIST_FOREACH(chr, &svc->chrs, next) @@ -337,12 +344,12 @@ peer_chr_find_prev(const struct peer_svc *svc, uint16_t chr_val_handle) return prev; } -static struct peer_chr * +FAR static struct peer_chr * peer_chr_find(FAR const struct peer_svc *svc, uint16_t chr_val_handle, FAR struct peer_chr **out_prev) { - struct peer_chr *prev; - struct peer_chr *chr; + FAR struct peer_chr *prev; + FAR struct peer_chr *chr; prev = peer_chr_find_prev(svc, chr_val_handle); if (prev == NULL) @@ -369,7 +376,7 @@ peer_chr_find(FAR const struct peer_svc *svc, uint16_t chr_val_handle, static void peer_chr_delete(FAR struct peer_chr *chr) { - struct peer_dsc *dsc; + FAR struct peer_dsc *dsc; while ((dsc = SLIST_FIRST(&chr->dscs)) != NULL) { @@ -384,9 +391,9 @@ static int peer_chr_add(FAR struct peer *peer, uint16_t svc_start_handle, FAR const struct ble_gatt_chr *gatt_chr) { - struct peer_chr *prev; - struct peer_chr *chr; - struct peer_svc *svc; + FAR struct peer_chr *prev; + FAR struct peer_chr *chr; + FAR struct peer_svc *svc; svc = peer_svc_find(peer, svc_start_handle, NULL); if (svc == NULL) @@ -435,35 +442,35 @@ static int peer_chr_disced(uint16_t conn_handle, FAR const struct ble_gatt_error *error, FAR const struct ble_gatt_chr *chr, FAR void *arg) { - struct peer *peer; + FAR struct peer *peer; int rc; peer = arg; assert(peer->conn_handle == conn_handle); switch (error->status) - { - case 0: - rc = peer_chr_add(peer, peer->cur_svc->svc.start_handle, chr); - break; + { + case 0: + rc = peer_chr_add(peer, peer->cur_svc->svc.start_handle, chr); + break; - case BLE_HS_EDONE: - /* All characteristics in this service discovered; start discovering - * characteristics in the next service. - */ + case BLE_HS_EDONE: + /* All characteristics in this service discovered; start discovering + * characteristics in the next service. + */ - if (peer->disc_prev_chr_val > 0) - { - peer_disc_chrs(peer); - } + if (peer->disc_prev_chr_val > 0) + { + peer_disc_chrs(peer); + } - rc = 0; - break; + rc = 0; + break; - default: - rc = error->status; - break; - } + default: + rc = error->status; + break; + } if (rc != 0) { @@ -477,7 +484,7 @@ peer_chr_disced(uint16_t conn_handle, FAR const struct ble_gatt_error *error, static void peer_disc_chrs(FAR struct peer *peer) { - struct peer_svc *svc; + FAR struct peer_svc *svc; int rc; /* Search through the list of discovered service for the first @@ -491,9 +498,9 @@ static void peer_disc_chrs(FAR struct peer *peer) { peer->cur_svc = svc; rc = ble_gattc_disc_all_chrs(peer->conn_handle, - svc->svc.start_handle, - svc->svc.end_handle, - peer_chr_disced, peer); + svc->svc.start_handle, + svc->svc.end_handle, + peer_chr_disced, peer); if (rc != 0) { peer_disc_complete(peer, rc); @@ -508,16 +515,16 @@ static void peer_disc_chrs(FAR struct peer *peer) peer_disc_dscs(peer); } -int peer_svc_is_empty(FAR const struct peer_svc *svc) +static int peer_svc_is_empty(FAR const struct peer_svc *svc) { return svc->svc.end_handle <= svc->svc.start_handle; } -static struct peer_svc * +FAR static struct peer_svc * peer_svc_find_prev(FAR struct peer *peer, uint16_t svc_start_handle) { - struct peer_svc *prev; - struct peer_svc *svc; + FAR struct peer_svc *prev; + FAR struct peer_svc *svc; prev = NULL; SLIST_FOREACH(svc, &peer->svcs, next) @@ -533,12 +540,12 @@ peer_svc_find_prev(FAR struct peer *peer, uint16_t svc_start_handle) return prev; } -static struct peer_svc * +FAR static struct peer_svc * peer_svc_find(FAR struct peer *peer, uint16_t svc_start_handle, FAR struct peer_svc **out_prev) { - struct peer_svc *prev; - struct peer_svc *svc; + FAR struct peer_svc *prev; + FAR struct peer_svc *svc; prev = peer_svc_find_prev(peer, svc_start_handle); if (prev == NULL) @@ -563,10 +570,10 @@ peer_svc_find(FAR struct peer *peer, uint16_t svc_start_handle, return svc; } -static struct peer_svc * +FAR static struct peer_svc * peer_svc_find_range(FAR struct peer *peer, uint16_t attr_handle) { - struct peer_svc *svc; + FAR struct peer_svc *svc; SLIST_FOREACH(svc, &peer->svcs, next) { @@ -580,10 +587,10 @@ peer_svc_find_range(FAR struct peer *peer, uint16_t attr_handle) return NULL; } -const struct peer_svc * +FAR const struct peer_svc * peer_svc_find_uuid(FAR const struct peer *peer, FAR const ble_uuid_t *uuid) { - const struct peer_svc *svc; + FAR const struct peer_svc *svc; SLIST_FOREACH(svc, &peer->svcs, next) { @@ -596,13 +603,13 @@ peer_svc_find_uuid(FAR const struct peer *peer, FAR const ble_uuid_t *uuid) return NULL; } -const struct peer_chr * +FAR const struct peer_chr * peer_chr_find_uuid(FAR const struct peer *peer, FAR const ble_uuid_t *svc_uuid, FAR const ble_uuid_t *chr_uuid) { - const struct peer_svc *svc; - const struct peer_chr *chr; + FAR const struct peer_svc *svc; + FAR const struct peer_chr *chr; svc = peer_svc_find_uuid(peer, svc_uuid); if (svc == NULL) @@ -621,14 +628,14 @@ peer_chr_find_uuid(FAR const struct peer *peer, return NULL; } -const struct peer_dsc * +FAR const struct peer_dsc * peer_dsc_find_uuid(FAR const struct peer *peer, FAR const ble_uuid_t *svc_uuid, FAR const ble_uuid_t *chr_uuid, FAR const ble_uuid_t *dsc_uuid) { - const struct peer_chr *chr; - const struct peer_dsc *dsc; + FAR const struct peer_chr *chr; + FAR const struct peer_dsc *dsc; chr = peer_chr_find_uuid(peer, svc_uuid, chr_uuid); if (chr == NULL) @@ -650,8 +657,8 @@ peer_dsc_find_uuid(FAR const struct peer *peer, static int peer_svc_add(FAR struct peer *peer, FAR const struct ble_gatt_svc *gatt_svc) { - struct peer_svc *prev; - struct peer_svc *svc; + FAR struct peer_svc *prev; + FAR struct peer_svc *svc; svc = peer_svc_find(peer, gatt_svc->start_handle, &prev); if (svc != NULL) @@ -688,7 +695,7 @@ peer_svc_add(FAR struct peer *peer, FAR const struct ble_gatt_svc *gatt_svc) static void peer_svc_delete(FAR struct peer_svc *svc) { - struct peer_chr *chr; + FAR struct peer_chr *chr; while ((chr = SLIST_FIRST(&svc->chrs)) != NULL) { @@ -703,41 +710,41 @@ static int peer_svc_disced(uint16_t conn_handle, FAR const struct ble_gatt_error *error, FAR const struct ble_gatt_svc *service, FAR void *arg) { - struct peer *peer; + FAR struct peer *peer; int rc; peer = arg; assert(peer->conn_handle == conn_handle); switch (error->status) - { - case 0: - rc = peer_svc_add(peer, service); - break; + { + case 0: + rc = peer_svc_add(peer, service); + break; - case BLE_HS_EDONE: + case BLE_HS_EDONE: - /* All services discovered; start discovering characteristics. */ + /* All services discovered; start discovering characteristics. */ - if (peer->disc_prev_chr_val > 0) - { - peer_disc_chrs(peer); - } + if (peer->disc_prev_chr_val > 0) + { + peer_disc_chrs(peer); + } - rc = 0; - break; + rc = 0; + break; - default: - rc = error->status; - break; - } + default: + rc = error->status; + break; + } if (rc != 0) - { - /* Error; abort discovery. */ + { + /* Error; abort discovery. */ - peer_disc_complete(peer, rc); - } + peer_disc_complete(peer, rc); + } return rc; } @@ -745,8 +752,8 @@ peer_svc_disced(uint16_t conn_handle, FAR const struct ble_gatt_error *error, int peer_disc_all(uint16_t conn_handle, FAR peer_disc_fn *disc_cb, FAR void *disc_cb_arg) { - struct peer_svc *svc; - struct peer *peer; + FAR struct peer_svc *svc; + FAR struct peer *peer; int rc; peer = peer_find(conn_handle); @@ -764,8 +771,8 @@ int peer_disc_all(uint16_t conn_handle, FAR peer_disc_fn *disc_cb, } peer->disc_prev_chr_val = 1; - peer->disc_cb = disc_cb; - peer->disc_cb_arg = disc_cb_arg; + peer->disc_cb = disc_cb; + peer->disc_cb_arg = disc_cb_arg; rc = ble_gattc_disc_all_svcs(conn_handle, peer_svc_disced, peer); if (rc != 0) @@ -778,8 +785,8 @@ int peer_disc_all(uint16_t conn_handle, FAR peer_disc_fn *disc_cb, int peer_delete(uint16_t conn_handle) { - struct peer_svc *svc; - struct peer *peer; + FAR struct peer_svc *svc; + FAR struct peer *peer; int rc; peer = peer_find(conn_handle); @@ -807,7 +814,7 @@ int peer_delete(uint16_t conn_handle) int peer_add(uint16_t conn_handle) { - struct peer *peer; + FAR struct peer *peer; /* Make sure the connection handle is unique. */ @@ -833,8 +840,7 @@ int peer_add(uint16_t conn_handle) return 0; } -static void -peer_free_mem(void) +static void peer_free_mem(void) { free(peer_mem); peer_mem = NULL; @@ -849,6 +855,10 @@ peer_free_mem(void) peer_dsc_mem = NULL; } +/**************************************************************************** + * Public Functions + ****************************************************************************/ + int peer_init(int max_peers, int max_svcs, int max_chrs, int max_dscs) { int rc; @@ -857,16 +867,14 @@ int peer_init(int max_peers, int max_svcs, int max_chrs, int max_dscs) peer_free_mem(); - peer_mem = malloc( - OS_MEMPOOL_BYTES(max_peers, sizeof(struct peer))); + peer_mem = malloc(OS_MEMPOOL_BYTES(max_peers, sizeof(struct peer))); if (peer_mem == NULL) { rc = BLE_HS_ENOMEM; goto err; } - rc = os_mempool_init(&peer_pool, max_peers, - sizeof(struct peer), peer_mem, + rc = os_mempool_init(&peer_pool, max_peers, sizeof(struct peer), peer_mem, "peer_pool"); if (rc != 0) { @@ -874,51 +882,45 @@ int peer_init(int max_peers, int max_svcs, int max_chrs, int max_dscs) goto err; } - peer_svc_mem = malloc( - OS_MEMPOOL_BYTES(max_svcs, sizeof(struct peer_svc))); + peer_svc_mem = malloc(OS_MEMPOOL_BYTES(max_svcs, sizeof(struct peer_svc))); if (peer_svc_mem == NULL) { rc = BLE_HS_ENOMEM; goto err; } - rc = os_mempool_init(&peer_svc_pool, max_svcs, - sizeof(struct peer_svc), peer_svc_mem, - "peer_svc_pool"); + rc = os_mempool_init(&peer_svc_pool, max_svcs, sizeof(struct peer_svc), + peer_svc_mem, "peer_svc_pool"); if (rc != 0) { rc = BLE_HS_EOS; goto err; } - peer_chr_mem = malloc( - OS_MEMPOOL_BYTES(max_chrs, sizeof(struct peer_chr))); + peer_chr_mem = malloc(OS_MEMPOOL_BYTES(max_chrs, sizeof(struct peer_chr))); if (peer_chr_mem == NULL) { rc = BLE_HS_ENOMEM; goto err; } - rc = os_mempool_init(&peer_chr_pool, max_chrs, - sizeof(struct peer_chr), peer_chr_mem, - "peer_chr_pool"); + rc = os_mempool_init(&peer_chr_pool, max_chrs, sizeof(struct peer_chr), + peer_chr_mem, "peer_chr_pool"); if (rc != 0) { rc = BLE_HS_EOS; goto err; } - peer_dsc_mem = malloc( - OS_MEMPOOL_BYTES(max_dscs, sizeof(struct peer_dsc))); + peer_dsc_mem = malloc(OS_MEMPOOL_BYTES(max_dscs, sizeof(struct peer_dsc))); if (peer_dsc_mem == NULL) { rc = BLE_HS_ENOMEM; goto err; } - rc = os_mempool_init(&peer_dsc_pool, max_dscs, - sizeof(struct peer_dsc), peer_dsc_mem, - "peer_dsc_pool"); + rc = os_mempool_init(&peer_dsc_pool, max_dscs, sizeof(struct peer_dsc), + peer_dsc_mem, "peer_dsc_pool"); if (rc != 0) { rc = BLE_HS_EOS; From fa8daf40718a7c85a6d77c09658017bad713f195 Mon Sep 17 00:00:00 2001 From: raiden00pl Date: Fri, 28 Mar 2025 12:44:08 +0100 Subject: [PATCH 239/391] examples/nimble_bleprph: fix various coding standard issues fix various coding standard issues examples/nimble_bleprph also fix compilation for make Signed-off-by: raiden00pl --- examples/nimble_bleprph/CMakeLists.txt | 4 +- examples/nimble_bleprph/Kconfig | 4 +- examples/nimble_bleprph/Make.defs | 4 +- examples/nimble_bleprph/Makefile | 2 + examples/nimble_bleprph/bleprph.h | 35 ++- examples/nimble_bleprph/gatt_svr.c | 158 ++++++----- examples/nimble_bleprph/misc.c | 14 +- examples/nimble_bleprph/nimble_bleprph_main.c | 250 +++++++++--------- 8 files changed, 247 insertions(+), 224 deletions(-) diff --git a/examples/nimble_bleprph/CMakeLists.txt b/examples/nimble_bleprph/CMakeLists.txt index 1213cc279bc..a745fd4f741 100644 --- a/examples/nimble_bleprph/CMakeLists.txt +++ b/examples/nimble_bleprph/CMakeLists.txt @@ -1,6 +1,8 @@ # ############################################################################## # apps/examples/nimble_bleprph/CMakeLists.txt # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more contributor # license agreements. See the NOTICE file distributed with this work for # additional information regarding copyright ownership. The ASF licenses this @@ -21,7 +23,7 @@ if(CONFIG_EXAMPLES_NIMBLE_BLEPRPH) nuttx_add_application( NAME - nimble + ${CONFIG_EXAMPLES_NIMBLE_BLECENT_PROGNAME} SRCS ${CMAKE_CURRENT_LIST_DIR}/nimble_bleprph_main.c ${CMAKE_CURRENT_LIST_DIR}/misc.c diff --git a/examples/nimble_bleprph/Kconfig b/examples/nimble_bleprph/Kconfig index 7ee88ea6a47..ce7870febfc 100644 --- a/examples/nimble_bleprph/Kconfig +++ b/examples/nimble_bleprph/Kconfig @@ -7,13 +7,13 @@ config EXAMPLES_NIMBLE_BLEPRPH tristate "NimBLE peripheral" default n ---help--- - Enable the nimble peripheral + Enable the nimble peripheral example if EXAMPLES_NIMBLE_BLEPRPH config EXAMPLES_NIMBLE_BLEPRPH_PROGNAME string "Program name" - default "nimble" + default "bleprph" ---help--- This is the name of the program that will be used when the NSH ELF program is installed. diff --git a/examples/nimble_bleprph/Make.defs b/examples/nimble_bleprph/Make.defs index af5e367d96b..a2b5e29f8f4 100644 --- a/examples/nimble_bleprph/Make.defs +++ b/examples/nimble_bleprph/Make.defs @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/nimble_bleprph/Make.defs # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The @@ -19,5 +21,5 @@ ############################################################################ ifneq ($(CONFIG_EXAMPLES_NIMBLE_BLEPRPH),) -CONFIGURED_APPS += $(APPDIR)/examples/nimble +CONFIGURED_APPS += $(APPDIR)/examples/nimble_bleprph endif diff --git a/examples/nimble_bleprph/Makefile b/examples/nimble_bleprph/Makefile index 7e4e76dd756..f5c04b01443 100644 --- a/examples/nimble_bleprph/Makefile +++ b/examples/nimble_bleprph/Makefile @@ -1,6 +1,8 @@ ############################################################################ # apps/examples/nimble_bleprph/Makefile # +# SPDX-License-Identifier: Apache-2.0 +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. The diff --git a/examples/nimble_bleprph/bleprph.h b/examples/nimble_bleprph/bleprph.h index 43995c58942..cb752f3ad2d 100644 --- a/examples/nimble_bleprph/bleprph.h +++ b/examples/nimble_bleprph/bleprph.h @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nimble_bleprph/bleprph.h * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The @@ -27,14 +29,12 @@ #include #include + #include "nimble/ble.h" -#ifdef __cplusplus -extern "C" -{ -#endif -struct ble_hs_cfg; -struct ble_gatt_register_ctxt; +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ /* GATT server. */ @@ -45,13 +45,30 @@ struct ble_gatt_register_ctxt; #define GATT_SVR_CHR_UNR_ALERT_STAT_UUID 0x2A45 #define GATT_SVR_CHR_ALERT_NOT_CTRL_PT 0x2A44 -void gatt_svr_register_cb(struct ble_gatt_register_ctxt *ctxt, void *arg); +/**************************************************************************** + * Public Type Definition + ****************************************************************************/ + +/* Forward references */ + +struct ble_gatt_register_ctxt; + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +#ifdef __cplusplus +extern "C" +{ +#endif + +void gatt_svr_register_cb(FAR struct ble_gatt_register_ctxt *ctxt, + FAR void *arg); int gatt_svr_init(void); /* Misc. */ -void print_bytes(const uint8_t *bytes, int len); -void print_addr(const void *addr); +void print_addr(FAR const void *addr); #ifdef __cplusplus } diff --git a/examples/nimble_bleprph/gatt_svr.c b/examples/nimble_bleprph/gatt_svr.c index fb03d1943fc..38efeefd184 100644 --- a/examples/nimble_bleprph/gatt_svr.c +++ b/examples/nimble_bleprph/gatt_svr.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nimble_bleprph/gatt_svr.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The @@ -31,12 +33,24 @@ #include "services/bas/ble_svc_bas.h" #include "bleprph.h" -/** - * The vendor specific security test service consists of two characteristics: - * o random-number-generator: generates a random 32-bit number each time +/**************************************************************************** + * Private Function Prototypes + ****************************************************************************/ + +static int +gatt_svr_chr_access_sec_test(uint16_t conn_handle, uint16_t attr_handle, + FAR struct ble_gatt_access_ctxt *ctxt, + FAR void *arg); + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +/* The vendor specific security test service consists of two characteristics: + * - random-number-generator: generates a random 32-bit number each time * it is read. This characteristic can only be read over an encrypted * connection. - * o static-value: a single-byte characteristic that can always be read, + * - static-value: a single-byte characteristic that can always be read, * but can only be written over an encrypted connection. */ @@ -60,48 +74,43 @@ static const ble_uuid128_t gatt_svr_chr_sec_test_static_uuid = static uint8_t gatt_svr_sec_test_static_val; -static int -gatt_svr_chr_access_sec_test(uint16_t conn_handle, uint16_t attr_handle, - struct ble_gatt_access_ctxt *ctxt, - void *arg); - static const struct ble_gatt_svc_def gatt_svr_svcs[] = { { - /* Service: Security test. */ + /* Service: Security test. */ - .type = BLE_GATT_SVC_TYPE_PRIMARY, - .uuid = &gatt_svr_svc_sec_test_uuid.u, - .characteristics = (struct ble_gatt_chr_def[]) + .type = BLE_GATT_SVC_TYPE_PRIMARY, + .uuid = &gatt_svr_svc_sec_test_uuid.u, + .characteristics = (struct ble_gatt_chr_def[]) + { { - { - /* Characteristic: Random number generator. */ + /* Characteristic: Random number generator. */ - .uuid = &gatt_svr_chr_sec_test_rand_uuid.u, - .access_cb = gatt_svr_chr_access_sec_test, - .flags = BLE_GATT_CHR_F_READ, - }, - { - /* Characteristic: Static value. */ + .uuid = &gatt_svr_chr_sec_test_rand_uuid.u, + .access_cb = gatt_svr_chr_access_sec_test, + .flags = BLE_GATT_CHR_F_READ, + }, + { + /* Characteristic: Static value. */ - .uuid = &gatt_svr_chr_sec_test_static_uuid.u, - .access_cb = gatt_svr_chr_access_sec_test, - .flags = BLE_GATT_CHR_F_READ | - BLE_GATT_CHR_F_WRITE, - }, - { - 0, /* No more characteristics in this service. */ - } + .uuid = &gatt_svr_chr_sec_test_static_uuid.u, + .access_cb = gatt_svr_chr_access_sec_test, + .flags = BLE_GATT_CHR_F_READ | + BLE_GATT_CHR_F_WRITE, }, + { + 0, /* No more characteristics in this service. */ + } + }, }, { - 0, /* No more services. */ + 0, /* No more services. */ }, }; /**************************************************************************** - * Public Functions + * Private Functions ****************************************************************************/ static int @@ -131,7 +140,7 @@ gatt_svr_chr_access_sec_test(uint16_t conn_handle, uint16_t attr_handle, FAR struct ble_gatt_access_ctxt *ctxt, FAR void *arg) { - const ble_uuid_t *uuid; + FAR const ble_uuid_t *uuid; int rand_num; int rc; @@ -148,7 +157,7 @@ gatt_svr_chr_access_sec_test(uint16_t conn_handle, uint16_t attr_handle, /* Respond with a 32-bit random number. */ rand_num = rand(); - rc = os_mbuf_append(ctxt->om, &rand_num, sizeof rand_num); + rc = os_mbuf_append(ctxt->om, &rand_num, sizeof rand_num); return rc == 0 ? 0 : BLE_ATT_ERR_INSUFFICIENT_RES; } @@ -156,21 +165,21 @@ gatt_svr_chr_access_sec_test(uint16_t conn_handle, uint16_t attr_handle, { switch (ctxt->op) { - case BLE_GATT_ACCESS_OP_READ_CHR: - rc = os_mbuf_append(ctxt->om, &gatt_svr_sec_test_static_val, - sizeof gatt_svr_sec_test_static_val); - return rc == 0 ? 0 : BLE_ATT_ERR_INSUFFICIENT_RES; - - case BLE_GATT_ACCESS_OP_WRITE_CHR: - rc = gatt_svr_chr_write(ctxt->om, - sizeof gatt_svr_sec_test_static_val, - sizeof gatt_svr_sec_test_static_val, - &gatt_svr_sec_test_static_val, NULL); - return rc; - - default: - assert(0); - return BLE_ATT_ERR_UNLIKELY; + case BLE_GATT_ACCESS_OP_READ_CHR: + rc = os_mbuf_append(ctxt->om, &gatt_svr_sec_test_static_val, + sizeof gatt_svr_sec_test_static_val); + return rc == 0 ? 0 : BLE_ATT_ERR_INSUFFICIENT_RES; + + case BLE_GATT_ACCESS_OP_WRITE_CHR: + rc = gatt_svr_chr_write(ctxt->om, + sizeof gatt_svr_sec_test_static_val, + sizeof gatt_svr_sec_test_static_val, + &gatt_svr_sec_test_static_val, NULL); + return rc; + + default: + assert(0); + return BLE_ATT_ERR_UNLIKELY; } } @@ -182,37 +191,40 @@ gatt_svr_chr_access_sec_test(uint16_t conn_handle, uint16_t attr_handle, return BLE_ATT_ERR_UNLIKELY; } +/**************************************************************************** + * Public Functions + ****************************************************************************/ + void gatt_svr_register_cb(FAR struct ble_gatt_register_ctxt *ctxt, FAR void *arg) { char buf[BLE_UUID_STR_LEN]; switch (ctxt->op) - { - case BLE_GATT_REGISTER_OP_SVC: - printf("registered service %s with handle=%d\n", - ble_uuid_to_str(ctxt->svc.svc_def->uuid, buf), - ctxt->svc.handle); - break; - - case BLE_GATT_REGISTER_OP_CHR: - printf("registering characteristic %s with " - "def_handle=%d val_handle=%d\n", - ble_uuid_to_str(ctxt->chr.chr_def->uuid, buf), - ctxt->chr.def_handle, - ctxt->chr.val_handle); - break; - - case BLE_GATT_REGISTER_OP_DSC: - printf("registering descriptor %s with handle=%d\n", - ble_uuid_to_str(ctxt->dsc.dsc_def->uuid, buf), - ctxt->dsc.handle); - break; - - default: - assert(0); - break; - } + { + case BLE_GATT_REGISTER_OP_SVC: + printf("registered service %s with handle=%d\n", + ble_uuid_to_str(ctxt->svc.svc_def->uuid, buf), + ctxt->svc.handle); + break; + + case BLE_GATT_REGISTER_OP_CHR: + printf("registering characteristic %s with " + "def_handle=%d val_handle=%d\n", + ble_uuid_to_str(ctxt->chr.chr_def->uuid, buf), + ctxt->chr.def_handle, ctxt->chr.val_handle); + break; + + case BLE_GATT_REGISTER_OP_DSC: + printf("registering descriptor %s with handle=%d\n", + ble_uuid_to_str(ctxt->dsc.dsc_def->uuid, buf), + ctxt->dsc.handle); + break; + + default: + assert(0); + break; + } } int gatt_svr_init(void) diff --git a/examples/nimble_bleprph/misc.c b/examples/nimble_bleprph/misc.c index 2a0b40a9297..5007f24fa79 100644 --- a/examples/nimble_bleprph/misc.c +++ b/examples/nimble_bleprph/misc.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nimble_bleprph/misc.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The @@ -28,19 +30,9 @@ * Public Functions ****************************************************************************/ -void print_bytes(FAR const uint8_t *bytes, int len) -{ - int i; - - for (i = 0; i < len; i++) - { - printf("%s0x%02x", i != 0 ? ":" : "", bytes[i]); - } -} - void print_addr(FAR const void *addr) { - const uint8_t *u8p; + FAR const uint8_t *u8p; u8p = addr; printf("%02x:%02x:%02x:%02x:%02x:%02x", diff --git a/examples/nimble_bleprph/nimble_bleprph_main.c b/examples/nimble_bleprph/nimble_bleprph_main.c index ad432daa86f..9dea4d226e0 100644 --- a/examples/nimble_bleprph/nimble_bleprph_main.c +++ b/examples/nimble_bleprph/nimble_bleprph_main.c @@ -1,6 +1,8 @@ /**************************************************************************** * apps/examples/nimble_bleprph/nimble_bleprph_main.c * + * SPDX-License-Identifier: Apache-2.0 + * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. The @@ -68,15 +70,14 @@ static FAR void *ble_host_task(FAR void *param); static int bleprph_gap_event(FAR struct ble_gap_event *event, FAR void *arg); /**************************************************************************** - * Private Data + * Private Functions ****************************************************************************/ /**************************************************************************** * Name: bleprph_print_conn_desc ****************************************************************************/ -static void -bleprph_print_conn_desc(FAR struct ble_gap_conn_desc *desc) +static void bleprph_print_conn_desc(FAR struct ble_gap_conn_desc *desc) { printf("handle=%d our_ota_addr_type=%d our_ota_addr=", desc->conn_handle, desc->our_ota_addr.type); @@ -105,20 +106,20 @@ bleprph_print_conn_desc(FAR struct ble_gap_conn_desc *desc) static void bleprph_advertise(void) { - uint8_t own_addr_type; struct ble_gap_adv_params adv_params; struct ble_hs_adv_fields fields; - const char *name; + uint8_t own_addr_type; + FAR const char *name; int rc; /* Figure out address to use while advertising (no privacy for now) */ rc = ble_hs_id_infer_auto(0, &own_addr_type); if (rc != 0) - { - printf("error determining address type; rc=%d\n", rc); - return; - } + { + printf("error determining address type; rc=%d\n", rc); + return; + } /** * Set the advertisement data included in our advertisements: @@ -136,7 +137,7 @@ static void bleprph_advertise(void) */ fields.flags = BLE_HS_ADV_F_DISC_GEN | - BLE_HS_ADV_F_BREDR_UNSUP; + BLE_HS_ADV_F_BREDR_UNSUP; /* Indicate that the TX power level field should be included; have the * stack fill this value automatically. This is done by assiging the @@ -147,23 +148,24 @@ static void bleprph_advertise(void) fields.tx_pwr_lvl = BLE_HS_ADV_TX_PWR_LVL_AUTO; name = ble_svc_gap_device_name(); - fields.name = (uint8_t *)name; + fields.name = (FAR uint8_t *)name; fields.name_len = strlen(name); fields.name_is_complete = 1; fields.uuids16 = (ble_uuid16_t[]) - { + { BLE_UUID16_INIT(GATT_SVR_SVC_ALERT_UUID) - }; + }; + fields.num_uuids16 = 1; fields.uuids16_is_complete = 1; rc = ble_gap_adv_set_fields(&fields); if (rc != 0) - { - printf("error setting advertisement data; rc=%d\n", rc); - return; - } + { + printf("error setting advertisement data; rc=%d\n", rc); + return; + } /* Begin advertising. */ @@ -173,124 +175,120 @@ static void bleprph_advertise(void) rc = ble_gap_adv_start(own_addr_type, NULL, BLE_HS_FOREVER, &adv_params, bleprph_gap_event, NULL); if (rc != 0) - { - printf("error enabling advertisement; rc=%d\n", rc); - return; - } + { + printf("error enabling advertisement; rc=%d\n", rc); + return; + } } /**************************************************************************** * Name: bleprph_gap_event ****************************************************************************/ -static int -bleprph_gap_event(FAR struct ble_gap_event *event, FAR void *arg) +static int bleprph_gap_event(FAR struct ble_gap_event *event, FAR void *arg) { struct ble_gap_conn_desc desc; int rc; switch (event->type) - { - case BLE_GAP_EVENT_CONNECT: - - /* A new connection was established or a connection attempt failed. */ - - printf("connection %s; status=%d ", - event->connect.status == 0 ? "established" : "failed", - event->connect.status); - if (event->connect.status == 0) { - rc = ble_gap_conn_find(event->connect.conn_handle, &desc); - assert(rc == 0); - bleprph_print_conn_desc(&desc); + case BLE_GAP_EVENT_CONNECT: + + /* A new connection was established or a connection attempt failed. + */ + + printf("connection %s; status=%d ", + event->connect.status == 0 ? "established" : "failed", + event->connect.status); + if (event->connect.status == 0) + { + rc = ble_gap_conn_find(event->connect.conn_handle, &desc); + assert(rc == 0); + bleprph_print_conn_desc(&desc); + } + + printf("\n"); + + if (event->connect.status != 0) + { + /* Connection failed; resume advertising. */ + + bleprph_advertise(); + } + + return 0; + + case BLE_GAP_EVENT_DISCONNECT: + printf("disconnect; reason=%d ", event->disconnect.reason); + bleprph_print_conn_desc(&event->disconnect.conn); + printf("\n"); + + /* Connection terminated; resume advertising. */ + + bleprph_advertise(); + return 0; + + case BLE_GAP_EVENT_CONN_UPDATE: + + /* The central has updated the connection parameters. */ + + printf("connection updated; status=%d ", event->conn_update.status); + rc = ble_gap_conn_find(event->conn_update.conn_handle, &desc); + assert(rc == 0); + bleprph_print_conn_desc(&desc); + printf("\n"); + return 0; + + case BLE_GAP_EVENT_ADV_COMPLETE: + printf("advertise complete; reason=%d", event->adv_complete.reason); + bleprph_advertise(); + return 0; + + case BLE_GAP_EVENT_ENC_CHANGE: + + /* Encryption has been enabled or disabled for this connection. */ + + printf("encryption change event; status=%d ", + event->enc_change.status); + rc = ble_gap_conn_find(event->connect.conn_handle, &desc); + assert(rc == 0); + bleprph_print_conn_desc(&desc); + printf("\n"); + return 0; + + case BLE_GAP_EVENT_SUBSCRIBE: + printf("subscribe event; conn_handle=%d attr_handle=%d " + "reason=%d prevn=%d curn=%d previ=%d curi=%d\n", + event->subscribe.conn_handle, event->subscribe.attr_handle, + event->subscribe.reason, event->subscribe.prev_notify, + event->subscribe.cur_notify, event->subscribe.prev_indicate, + event->subscribe.cur_indicate); + return 0; + + case BLE_GAP_EVENT_MTU: + printf("mtu update event; conn_handle=%d cid=%d mtu=%d\n", + event->mtu.conn_handle, event->mtu.channel_id, + event->mtu.value); + return 0; + + case BLE_GAP_EVENT_REPEAT_PAIRING: + /* We already have a bond with the peer, but it is attempting to + * establish a new secure link. This app sacrifices security for + * convenience: just throw away the old bond and accept the new link. + */ + + /* Delete the old bond. */ + + rc = ble_gap_conn_find(event->repeat_pairing.conn_handle, &desc); + assert(rc == 0); + ble_store_util_delete_peer(&desc.peer_id_addr); + + /* Return BLE_GAP_REPEAT_PAIRING_RETRY to indicate that the host + * should continue with the pairing operation. + */ + + return BLE_GAP_REPEAT_PAIRING_RETRY; } - printf("\n"); - - if (event->connect.status != 0) - { - /* Connection failed; resume advertising. */ - - bleprph_advertise(); - } - return 0; - - case BLE_GAP_EVENT_DISCONNECT: - printf("disconnect; reason=%d ", event->disconnect.reason); - bleprph_print_conn_desc(&event->disconnect.conn); - printf("\n"); - - /* Connection terminated; resume advertising. */ - - bleprph_advertise(); - return 0; - - case BLE_GAP_EVENT_CONN_UPDATE: - - /* The central has updated the connection parameters. */ - - printf("connection updated; status=%d ", - event->conn_update.status); - rc = ble_gap_conn_find(event->conn_update.conn_handle, &desc); - assert(rc == 0); - bleprph_print_conn_desc(&desc); - printf("\n"); - return 0; - - case BLE_GAP_EVENT_ADV_COMPLETE: - printf("advertise complete; reason=%d", - event->adv_complete.reason); - bleprph_advertise(); - return 0; - - case BLE_GAP_EVENT_ENC_CHANGE: - - /* Encryption has been enabled or disabled for this connection. */ - - printf("encryption change event; status=%d ", - event->enc_change.status); - rc = ble_gap_conn_find(event->connect.conn_handle, &desc); - assert(rc == 0); - bleprph_print_conn_desc(&desc); - printf("\n"); - return 0; - - case BLE_GAP_EVENT_SUBSCRIBE: - printf("subscribe event; conn_handle=%d attr_handle=%d " - "reason=%d prevn=%d curn=%d previ=%d curi=%d\n", - event->subscribe.conn_handle, - event->subscribe.attr_handle, - event->subscribe.reason, - event->subscribe.prev_notify, - event->subscribe.cur_notify, - event->subscribe.prev_indicate, - event->subscribe.cur_indicate); - return 0; - - case BLE_GAP_EVENT_MTU: - printf("mtu update event; conn_handle=%d cid=%d mtu=%d\n", - event->mtu.conn_handle, - event->mtu.channel_id, - event->mtu.value); - return 0; - - case BLE_GAP_EVENT_REPEAT_PAIRING: - /* We already have a bond with the peer, but it is attempting to - * establish a new secure link. This app sacrifices security for - * convenience: just throw away the old bond and accept the new link. - */ - - /* Delete the old bond. */ - - rc = ble_gap_conn_find(event->repeat_pairing.conn_handle, &desc); - assert(rc == 0); - ble_store_util_delete_peer(&desc.peer_id_addr); - - /* Return BLE_GAP_REPEAT_PAIRING_RETRY to indicate that the host should - * continue with the pairing operation. - */ - - return BLE_GAP_REPEAT_PAIRING_RETRY; - } return 0; } @@ -299,8 +297,7 @@ bleprph_gap_event(FAR struct ble_gap_event *event, FAR void *arg) * Name: bleprph_on_reset ****************************************************************************/ -static void -bleprph_on_reset(int reason) +static void bleprph_on_reset(int reason) { printf("Resetting state; reason=%d\n", reason); } @@ -309,8 +306,7 @@ bleprph_on_reset(int reason) * Name: bleprph_on_sync ****************************************************************************/ -static void -bleprph_on_sync(void) +static void bleprph_on_sync(void) { int rc; @@ -366,8 +362,8 @@ int main(int argc, FAR char *argv[]) { struct ble_npl_task s_task_host; struct ble_npl_task s_task_hci; - int ret = 0; uint8_t batt_level = 0; + int ret = 0; /* allow to specify custom hci */ From 19352ab3c0d837ad847ea36412fdda470cd62d88 Mon Sep 17 00:00:00 2001 From: Filipe Cavalcanti Date: Thu, 27 Mar 2025 10:12:30 -0300 Subject: [PATCH 240/391] gps: modify printf to use format specifier macros Replace '%d' with 'PRId32' in some printf calls. Signed-off-by: Filipe Cavalcanti --- examples/gps/gps_main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/gps/gps_main.c b/examples/gps/gps_main.c index 596efb5bd9b..f6e9e01d826 100644 --- a/examples/gps/gps_main.c +++ b/examples/gps/gps_main.c @@ -99,11 +99,11 @@ int main(int argc, FAR char *argv[]) if (minmea_parse_rmc(&frame, line)) { - printf("Fixed-point Latitude...........: %d\n", + printf("Fixed-point Latitude...........: %" PRId32 "\n", minmea_rescale(&frame.latitude, 1000)); - printf("Fixed-point Longitude..........: %d\n", + printf("Fixed-point Longitude..........: %" PRId32 "\n", minmea_rescale(&frame.longitude, 1000)); - printf("Fixed-point Speed..............: %d\n", + printf("Fixed-point Speed..............: %" PRId32 "\n", minmea_rescale(&frame.speed, 1000)); printf("Floating point degree latitude.: %2.6f\n", minmea_tocoord(&frame.latitude)); @@ -127,7 +127,7 @@ int main(int argc, FAR char *argv[]) { printf("Fix quality....................: %d\n", frame.fix_quality); - printf("Altitude.......................: %d\n", + printf("Altitude.......................: %" PRId32 "\n", frame.altitude.value); printf("Tracked satellites.............: %d\n", frame.satellites_tracked); From b80e444aea9c7ef8cf5083b1a0a14a61f268638d Mon Sep 17 00:00:00 2001 From: Tiago Medicci Date: Fri, 28 Mar 2025 16:33:27 -0300 Subject: [PATCH 241/391] benchmarks/mtd: Select libc's floating point support The application requires libc's floating point support. Although it may be already enabled by other applications and/or hardware support, it should be explicitly selected by the app too. Signed-off-by: Tiago Medicci --- benchmarks/mtd/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/benchmarks/mtd/Kconfig b/benchmarks/mtd/Kconfig index f5ceadfe04d..717bd5b2006 100644 --- a/benchmarks/mtd/Kconfig +++ b/benchmarks/mtd/Kconfig @@ -7,6 +7,7 @@ config BENCHMARK_MTD tristate "MTD test and transfer rate benchmark" default n depends on BUILD_FLAT && MTD + select LIBC_FLOATINGPOINT ---help--- This testing/benchmark application performs an erase/write operation to evaluate write transfer rate and then reads the From cf1d5bb08b5b2a4f86621d52336c6ad7a3f482b7 Mon Sep 17 00:00:00 2001 From: Tiago Medicci Date: Fri, 28 Mar 2025 16:35:48 -0300 Subject: [PATCH 242/391] benchmarks/mtd: use `PRIxxx` macro to improve portability To improve portability, use `PRIxxx` macro instead of int/long int format specifiers. Signed-off-by: Tiago Medicci --- benchmarks/mtd/Kconfig | 3 +-- benchmarks/mtd/mtd.c | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/benchmarks/mtd/Kconfig b/benchmarks/mtd/Kconfig index 717bd5b2006..0628e7835d9 100644 --- a/benchmarks/mtd/Kconfig +++ b/benchmarks/mtd/Kconfig @@ -6,8 +6,7 @@ config BENCHMARK_MTD tristate "MTD test and transfer rate benchmark" default n - depends on BUILD_FLAT && MTD - select LIBC_FLOATINGPOINT + depends on BUILD_FLAT && MTD && LIBC_FLOATINGPOINT ---help--- This testing/benchmark application performs an erase/write operation to evaluate write transfer rate and then reads the diff --git a/benchmarks/mtd/mtd.c b/benchmarks/mtd/mtd.c index 4d117c60607..475fd1c669f 100644 --- a/benchmarks/mtd/mtd.c +++ b/benchmarks/mtd/mtd.c @@ -95,7 +95,7 @@ int main(int argc, FAR char *argv[]) ret = inode->u.i_bops->ioctl(inode, MTDIOC_GEOMETRY, (unsigned long) &geo); if (ret != OK) { - fprintf(stderr, "Device is not a MTD device\n"); + fprintf(stderr, "Device is not a MTD device"); goto errout_with_driver; } @@ -104,7 +104,7 @@ int main(int argc, FAR char *argv[]) printf("FLASH device parameters:\n"); printf(" Sector size: %10d\n", info.sectorsize); printf(" Sector count: %10d\n", info.numsectors); - printf(" Erase block: %10d\n", geo.erasesize); + printf(" Erase block: %10" PRIx32 "\n", geo.erasesize); printf(" Total size: %10d\n", info.sectorsize * info.numsectors); if (info.sectorsize != geo.erasesize) From 5d4b7205967012e7b495aa613ff70df37dc6e978 Mon Sep 17 00:00:00 2001 From: raiden00pl Date: Thu, 3 Apr 2025 09:48:53 +0200 Subject: [PATCH 243/391] foc/foc_feedforward.c: vdq_comp->q should use idq->d fix typo in calculations for vdq_comp->q. It should use idq->d not idq->q. Reported in https://github.com/apache/nuttx-apps/issues/3047 Signed-off-by: raiden00pl --- industry/foc/fixed16/foc_feedforward.c | 2 +- industry/foc/float/foc_feedforward.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/industry/foc/fixed16/foc_feedforward.c b/industry/foc/fixed16/foc_feedforward.c index 0a3e2fe740e..97c1b669948 100644 --- a/industry/foc/fixed16/foc_feedforward.c +++ b/industry/foc/fixed16/foc_feedforward.c @@ -63,7 +63,7 @@ int foc_feedforward_pmsm_b16(FAR struct motor_phy_params_b16_s *phy, vdq_comp->q = -b16mulb16(vel_now, (phy->flux_link + b16mulb16(phy->ind, - idq->q))); + idq->d))); vdq_comp->d = b16mulb16(b16mulb16(vel_now, phy->ind), idq->q); return OK; diff --git a/industry/foc/float/foc_feedforward.c b/industry/foc/float/foc_feedforward.c index 922696fdd5d..f9d3c33245e 100644 --- a/industry/foc/float/foc_feedforward.c +++ b/industry/foc/float/foc_feedforward.c @@ -61,7 +61,7 @@ int foc_feedforward_pmsm_f32(FAR struct motor_phy_params_f32_s *phy, * so vq compensation must be negative here. */ - vdq_comp->q = -vel_now * (phy->flux_link + phy->ind * idq->q); + vdq_comp->q = -vel_now * (phy->flux_link + phy->ind * idq->d); vdq_comp->d = vel_now * phy->ind * idq->q; return OK; From 61551aa8490236bf0dc2c96e36071b935c6d1252 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Wed, 2 Apr 2025 22:58:58 +0900 Subject: [PATCH 244/391] system/dd: Implement conv=notrunc https://pubs.opengroup.org/onlinepubs/9699919799/utilities/dd.html > notrunc > Do not truncate the output file. Preserve blocks in the output > file not explicitly written by this invocation of the dd utility. Signed-off-by: YAMAMOTO Takashi --- system/dd/dd_main.c | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/system/dd/dd_main.c b/system/dd/dd_main.c index ca9e3c7b6f6..fb8005b400c 100644 --- a/system/dd/dd_main.c +++ b/system/dd/dd_main.c @@ -79,6 +79,7 @@ struct dd_s uint32_t skip; /* The number of sectors skipped on input */ uint32_t seek; /* The number of sectors seeked on output */ bool eof; /* true: The end of the input or output file has been hit */ + bool notrunc; /* conv=notrunc */ uint16_t sectsize; /* Size of one sector */ uint16_t nbytes; /* Number of valid bytes in the buffer */ FAR uint8_t *buffer; /* Buffer of data to write to the output file */ @@ -186,7 +187,8 @@ static inline int dd_outfopen(FAR const char *name, FAR struct dd_s *dd) return OK; } - dd->outfd = open(name, O_WRONLY | O_CREAT | O_TRUNC, 0644); + dd->outfd = open(name, O_WRONLY | O_CREAT | (dd->notrunc ? 0 : O_TRUNC), + 0644); if (dd->outfd < 0) { fprintf(stderr, "%s: failed to open '%s': %s\n", @@ -259,6 +261,32 @@ int main(int argc, FAR char **argv) { dd.seek = atoi(&argv[i][5]); } + else if (strncmp(argv[i], "conv=", 5) == 0) + { + const char *cur = &argv[i][5]; + while (true) + { + const char *next = strchr(cur, ','); + size_t len = next != NULL ? next - cur : strlen(cur); + if (len == 7 && !memcmp(cur, "notrunc", 7)) + { + dd.notrunc = true; + } + else + { + fprintf(stderr, "%s: unknown conversion '%.*s'\n", g_dd, + (int)len, cur); + goto errout_with_paths; + } + + if (next == NULL) + { + break; + } + + cur = next + 1; + } + } else { print_usage(); From 21a6a13698d1418fbaafebea12d46cd7cc957351 Mon Sep 17 00:00:00 2001 From: anjiahao Date: Mon, 10 Feb 2025 17:55:31 +0800 Subject: [PATCH 245/391] kernel build:avoid multiple definition ld script Signed-off-by: anjiahao --- import/Make.defs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/import/Make.defs b/import/Make.defs index d6f99cf5051..8943963ed24 100644 --- a/import/Make.defs +++ b/import/Make.defs @@ -98,4 +98,9 @@ ifeq ($(CONFIG_BINFMT_ELF_RELOCATABLE),y) LDELFFLAGS += -r endif LDELFFLAGS += -e __start -Bstatic + +# Remove other ld scripts, just use import ld scripts +# +LDFILE := $(filter -T %.ld, $(LDELFFLAGS)) +LDELFFLAGS := $(filter-out $(LDFILE), $(LDELFFLAGS)) LDELFFLAGS += $(addprefix -T,$(call CONVERT_PATH,$(TOPDIR)/scripts/gnu-elf.ld)) From 70f28553c625b9ab43929bf302503975169ce023 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Thu, 10 Apr 2025 14:05:22 +0900 Subject: [PATCH 246/391] examples/gps: fix a few printf formats references: https://github.com/apache/nuttx/pull/16022 https://github.com/kosma/minmea/blob/4abb6f8da5f0fd6b7a7a1064b58e50cbe912043e/minmea.h#L241C15-L241C28 https://github.com/kosma/minmea/blob/4abb6f8da5f0fd6b7a7a1064b58e50cbe912043e/minmea.h#L43 Signed-off-by: YAMAMOTO Takashi --- examples/gps/gps_main.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/examples/gps/gps_main.c b/examples/gps/gps_main.c index f6e9e01d826..72673944d38 100644 --- a/examples/gps/gps_main.c +++ b/examples/gps/gps_main.c @@ -99,11 +99,14 @@ int main(int argc, FAR char *argv[]) if (minmea_parse_rmc(&frame, line)) { - printf("Fixed-point Latitude...........: %" PRId32 "\n", + printf("Fixed-point Latitude...........: %" PRIdLEAST32 + "\n", minmea_rescale(&frame.latitude, 1000)); - printf("Fixed-point Longitude..........: %" PRId32 "\n", + printf("Fixed-point Longitude..........: %" PRIdLEAST32 + "\n", minmea_rescale(&frame.longitude, 1000)); - printf("Fixed-point Speed..............: %" PRId32 "\n", + printf("Fixed-point Speed..............: %" PRIdLEAST32 + "\n", minmea_rescale(&frame.speed, 1000)); printf("Floating point degree latitude.: %2.6f\n", minmea_tocoord(&frame.latitude)); @@ -127,7 +130,8 @@ int main(int argc, FAR char *argv[]) { printf("Fix quality....................: %d\n", frame.fix_quality); - printf("Altitude.......................: %" PRId32 "\n", + printf("Altitude.......................: %" PRIdLEAST32 + "\n", frame.altitude.value); printf("Tracked satellites.............: %d\n", frame.satellites_tracked); From ac12971ac9b8d7d8f24c1fd3e24774150eeb92e1 Mon Sep 17 00:00:00 2001 From: raiden00pl Date: Thu, 10 Apr 2025 09:45:17 +0200 Subject: [PATCH 247/391] nxscope/nxscope_pser.c: use xmodem crc16 directly use crc16xmodem directly to avoid using confusing crc16() Signed-off-by: raiden00pl --- logging/nxscope/nxscope_pser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/logging/nxscope/nxscope_pser.c b/logging/nxscope/nxscope_pser.c index 95bbb60d883..89c2c74c245 100644 --- a/logging/nxscope/nxscope_pser.c +++ b/logging/nxscope/nxscope_pser.c @@ -184,7 +184,7 @@ static int nxscope_frame_get(FAR struct nxscope_proto_s *p, /* Verify crc16 for the whole frame */ - crc = crc16(&buff[i], hdr->len); + crc = crc16xmodem(&buff[i], hdr->len); if (crc != 0) { _err("ERROR: invalid crc16 %d\n", crc); @@ -238,7 +238,7 @@ static int nxscope_frame_final(FAR struct nxscope_proto_s *p, * final xor value = 0x0000 */ - crc = crc16(buff, *len); + crc = crc16xmodem(buff, *len); #ifdef CONFIG_ENDIAN_BIG buff[(*len)++] = (crc >> 0) & 0xff; From 69cb2e89e93c426fa2ddd345d34b440bec03b4a9 Mon Sep 17 00:00:00 2001 From: chao an Date: Mon, 7 Apr 2025 12:42:05 +0800 Subject: [PATCH 248/391] libs/libc/crc16: Separate implementation of crc16xmodem from crc16 keep default crc16 catalogue for CRC-16/XMODEM Mapping crc16 implement to crc16xmodem crc16 -> crc16xmodem crc16part -> crc16xmodempart - CRC-16/ACORN, CRC-16/LTE, CRC-16/V-41-MSB, XMODEM, ZMODEM poly: 0x1021 initial seed: 0x0000, xor output: 0x0000 : width=16 : poly=0x1021 : init=0x0000 : refin=false : refout=false : xorout=0x0000 : check=0x31c3 : residue=0x0000 : name="CRC-16/XMODEM" https://reveng.sourceforge.io/crc-catalogue/16.htm#crc.cat.crc-16-xmodem Signed-off-by: chao an --- system/ymodem/ymodem.c | 8 ++++---- system/zmodem/zm_proto.c | 12 ++++++------ system/zmodem/zm_send.c | 4 ++-- system/zmodem/zm_state.c | 4 ++-- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/system/ymodem/ymodem.c b/system/ymodem/ymodem.c index 48d1320dccb..79c131f378a 100644 --- a/system/ymodem/ymodem.c +++ b/system/ymodem/ymodem.c @@ -173,7 +173,7 @@ static int ymodem_recv_packet(FAR struct ymodem_ctx_s *ctx) recv_crc = (ctx->data[ctx->packet_size] << 8) + ctx->data[ctx->packet_size + 1]; - cal_crc = crc16(ctx->data, ctx->packet_size); + cal_crc = crc16xmodem(ctx->data, ctx->packet_size); if (cal_crc != recv_crc) { ymodem_debug("recv_packet: EBADMSG rcev:cal=0x%x 0x%x\n", @@ -373,7 +373,7 @@ static int ymodem_send_file(FAR struct ymodem_ctx_s *ctx) ctx->header[1] = 0x00; ctx->header[2] = 0xff; ctx->packet_size = YMODEM_PACKET_SIZE; - crc = crc16(ctx->data, ctx->packet_size); + crc = crc16xmodem(ctx->data, ctx->packet_size); ctx->data[ctx->packet_size] = crc >> 8; ctx->data[ctx->packet_size + 1] = crc; @@ -438,7 +438,7 @@ static int ymodem_send_file(FAR struct ymodem_ctx_s *ctx) return ret; } - crc = crc16(ctx->data, ctx->packet_size); + crc = crc16xmodem(ctx->data, ctx->packet_size); ctx->data[ctx->packet_size] = crc >> 8; ctx->data[ctx->packet_size + 1] = crc; send_packet_again: @@ -512,7 +512,7 @@ static int ymodem_send_file(FAR struct ymodem_ctx_s *ctx) ctx->packet_type = YMODEM_DATA_PACKET; ctx->packet_size = YMODEM_PACKET_SIZE; memset(ctx->data, 0, YMODEM_PACKET_SIZE); - crc = crc16(ctx->data, ctx->packet_size); + crc = crc16xmodem(ctx->data, ctx->packet_size); ctx->data[ctx->packet_size] = crc >> 8; ctx->data[ctx->packet_size + 1] = crc; send_last_again: diff --git a/system/zmodem/zm_proto.c b/system/zmodem/zm_proto.c index c5600de62ee..83e8887f250 100644 --- a/system/zmodem/zm_proto.c +++ b/system/zmodem/zm_proto.c @@ -191,7 +191,7 @@ int zm_senddata(FAR struct zm_state_s *pzm, FAR const uint8_t *buffer, { if (zbin == ZBIN) { - crc = (uint32_t)crc16part(buffer, 1, (uint16_t)crc); + crc = (uint32_t)crc16xmodempart(buffer, 1, (uint16_t)crc); } else /* zbin = ZBIN32 */ { @@ -209,7 +209,7 @@ int zm_senddata(FAR struct zm_state_s *pzm, FAR const uint8_t *buffer, if (zbin == ZBIN) { - crc = crc16part((FAR const uint8_t *)&term, 1, crc); + crc = crc16xmodempart((FAR const uint8_t *)&term, 1, crc); } else { @@ -283,12 +283,12 @@ int zm_sendhexhdr(FAR struct zm_state_s *pzm, int type, /* type */ - crc = crc16part((FAR const uint8_t *)&type, 1, 0); + crc = crc16xmodempart((FAR const uint8_t *)&type, 1, 0); ptr = zm_puthex8(ptr, type); /* f3/p0 f2/p1 f1/p2 f0/p3 */ - crc = crc16part(buffer, 4, crc); + crc = crc16xmodempart(buffer, 4, crc); for (i = 0; i < 4; i++) { ptr = zm_puthex8(ptr, *buffer++); @@ -359,12 +359,12 @@ int zm_sendbin16hdr(FAR struct zm_state_s *pzm, int type, /* type */ - crc = crc16part((FAR const uint8_t *)&type, 1, 0); + crc = crc16xmodempart((FAR const uint8_t *)&type, 1, 0); ptr = zm_putzdle(pzm, ptr, type); /* f3/p0 f2/p1 f1/p2 f0/p3 */ - crc = crc16part(buffer, 4, crc); + crc = crc16xmodempart(buffer, 4, crc); for (i = 0; i < 4; i++) { ptr = zm_putzdle(pzm, ptr, *buffer++); diff --git a/system/zmodem/zm_send.c b/system/zmodem/zm_send.c index 059a7d14a21..51ab25a0ea7 100644 --- a/system/zmodem/zm_send.c +++ b/system/zmodem/zm_send.c @@ -993,7 +993,7 @@ static int zms_sendpacket(FAR struct zm_state_s *pzm) #endif if (!bcrc32) { - crc = (uint32_t)crc16part(&ch, 1, (uint16_t)crc); + crc = (uint32_t)crc16xmodempart(&ch, 1, (uint16_t)crc); } else { @@ -1049,7 +1049,7 @@ static int zms_sendpacket(FAR struct zm_state_s *pzm) if (!bcrc32) { - crc = (uint32_t)crc16part(&type, 1, (uint16_t)crc); + crc = (uint32_t)crc16xmodempart(&type, 1, (uint16_t)crc); } else { diff --git a/system/zmodem/zm_state.c b/system/zmodem/zm_state.c index d3add1c6ee3..2a8bc7fa53b 100644 --- a/system/zmodem/zm_state.c +++ b/system/zmodem/zm_state.c @@ -201,7 +201,7 @@ static int zm_hdrevent(FAR struct zm_state_s *pzm) * The header type, 4 data bytes, plus 2 CRC bytes */ - crc = crc16part(pzm->hdrdata, 7, 0); + crc = crc16xmodempart(pzm->hdrdata, 7, 0); if (crc != 0) { zmdbg("ERROR: ZBIN/ZHEX CRC16 failure: %04x vs 0000\n", crc); @@ -258,7 +258,7 @@ static int zm_dataevent(FAR struct zm_state_s *pzm) { uint16_t crc; - crc = crc16part(pzm->pktbuf, pzm->pktlen, 0); + crc = crc16xmodempart(pzm->pktbuf, pzm->pktlen, 0); if (crc != 0) { zmdbg("ERROR: ZBIN/ZHEX CRC16 failure: %04x vs 0000\n", crc); From 27846ffec721135ff05f7da4d2df7f280b03997b Mon Sep 17 00:00:00 2001 From: chao an Date: Wed, 5 Feb 2025 16:28:21 +0800 Subject: [PATCH 249/391] libc/elf: rename modlib to libelf Renaming "modlib" to "libelf" is more in line with the implementation content, which makes it easier for individual developers to understand the capabilities of this module. CONFIG_LIBC_MODLIB -> CONFIG_LIBC_ELF Signed-off-by: chao an --- benchmarks/fio/Kconfig | 2 +- examples/module/chardev/chardev.c | 2 +- examples/sotest/main/sotest_main.c | 8 ++++---- examples/sotest/modprint/modprint.c | 2 +- examples/sotest/sotest/sotest.c | 6 +++--- tools/mksymtab.sh | 8 ++++---- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/benchmarks/fio/Kconfig b/benchmarks/fio/Kconfig index 298962a6c6c..f77a8a8a8a6 100644 --- a/benchmarks/fio/Kconfig +++ b/benchmarks/fio/Kconfig @@ -6,7 +6,7 @@ config BENCHMARK_FIO tristate "Flexible I/O Tester" default n - depends on LIBC_MODLIB && LIBC_DLFCN + depends on LIBC_ELF && LIBC_DLFCN ---help--- https://github.com/axboe/fio Fio spawns a number of threads or processes doing a particular type of I/O action as specified by the user. diff --git a/examples/module/chardev/chardev.c b/examples/module/chardev/chardev.c index 82eed698c95..f0faa3bfba1 100644 --- a/examples/module/chardev/chardev.c +++ b/examples/module/chardev/chardev.c @@ -35,7 +35,7 @@ #include #include -#include +#include #include /**************************************************************************** diff --git a/examples/sotest/main/sotest_main.c b/examples/sotest/main/sotest_main.c index ccc7a325519..98b11730c7a 100644 --- a/examples/sotest/main/sotest_main.c +++ b/examples/sotest/main/sotest_main.c @@ -107,7 +107,7 @@ int main(int argc, FAR char *argv[]) #ifdef CONFIG_EXAMPLES_SOTEST_BUILTINFS char devname[32]; #endif -#if CONFIG_MODLIB_MAXDEPEND > 0 +#if CONFIG_LIBC_ELF_MAXDEPEND > 0 FAR void *handle1; #endif FAR void *handle2; @@ -170,7 +170,7 @@ int main(int argc, FAR char *argv[]) } #endif /* CONFIG_EXAMPLES_SOTEST_BUILTINFS */ -#if CONFIG_MODLIB_MAXDEPEND > 0 +#if CONFIG_LIBC_ELF_MAXDEPEND > 0 /* Install the first test shared library. The first shared library only * verifies that symbols exported by one shared library can be used to * resolve undefined symbols in a second shared library. @@ -253,7 +253,7 @@ int main(int argc, FAR char *argv[]) testfunc(msg); -#if CONFIG_MODLIB_MAXDEPEND > 0 +#if CONFIG_LIBC_ELF_MAXDEPEND > 0 /* This should fail because the second shared library depends on * the first. */ @@ -276,7 +276,7 @@ int main(int argc, FAR char *argv[]) exit(EXIT_FAILURE); } -#if CONFIG_MODLIB_MAXDEPEND > 0 +#if CONFIG_LIBC_ELF_MAXDEPEND > 0 /* Now we should be able to close the first shared library. */ ret = dlclose(handle1); diff --git a/examples/sotest/modprint/modprint.c b/examples/sotest/modprint/modprint.c index 898899a24a4..744c53cdc59 100644 --- a/examples/sotest/modprint/modprint.c +++ b/examples/sotest/modprint/modprint.c @@ -32,7 +32,7 @@ #include #include -#include +#include /**************************************************************************** * Private Functions diff --git a/examples/sotest/sotest/sotest.c b/examples/sotest/sotest/sotest.c index df9ab3201ae..ff825cbac16 100644 --- a/examples/sotest/sotest/sotest.c +++ b/examples/sotest/sotest/sotest.c @@ -32,13 +32,13 @@ #include #include -#include +#include /**************************************************************************** * Public Function Prototypes ****************************************************************************/ -#if CONFIG_MODLIB_MAXDEPEND > 0 +#if CONFIG_LIBC_ELF_MAXDEPEND > 0 void modprint(FAR const char *fmt, ...) printf_like(1, 2); #endif @@ -62,7 +62,7 @@ visibility_default const char g_msg3[] = "Yes, don't be a stranger!"; * Name: modprint ****************************************************************************/ -#if CONFIG_MODLIB_MAXDEPEND < 1 +#if CONFIG_LIBC_ELF_MAXDEPEND < 1 static void modprint(FAR const char *fmt, ...) { va_list ap; diff --git a/tools/mksymtab.sh b/tools/mksymtab.sh index 744aa05fe7a..9c2a0cf9271 100755 --- a/tools/mksymtab.sh +++ b/tools/mksymtab.sh @@ -116,8 +116,8 @@ if [ -z "$prefix" ]; then echo "const struct symtab_s CONFIG_EXECFUNCS_SYMTAB_ARRAY[] = " echo "#elif defined(CONFIG_NSH_SYMTAB)" echo "const struct symtab_s CONFIG_NSH_SYMTAB_ARRAYNAME[] = " - echo "#elif defined(CONFIG_MODLIB_HAVE_SYMTAB)" - echo "const struct symtab_s CONFIG_MODLIB_SYMTAB_ARRAY[] = " + echo "#elif defined(CONFIG_LIBC_ELF_HAVE_SYMTAB)" + echo "const struct symtab_s CONFIG_LIBC_ELF_SYMTAB_ARRAY[] = " echo "#else" echo "const struct symtab_s dummy_symtab[] = " echo "#endif" @@ -138,8 +138,8 @@ if [ -z "$prefix" ]; then echo "const int CONFIG_EXECFUNCS_NSYMBOLS_VAR = sizeof(CONFIG_EXECFUNCS_SYMTAB_ARRAY) / sizeof(struct symtab_s);" echo "#elif defined(CONFIG_NSH_SYMTAB)" echo "const int CONFIG_NSH_SYMTAB_COUNTNAME = sizeof(CONFIG_NSH_SYMTAB_ARRAYNAME) / sizeof(struct symtab_s);" - echo "#elif defined(CONFIG_MODLIB_HAVE_SYMTAB)" - echo "const int CONFIG_MODLIB_NSYMBOLS_VAR = sizeof(CONFIG_MODLIB_SYMTAB_ARRAY) / sizeof(struct symtab_s);" + echo "#elif defined(CONFIG_LIBC_ELF_HAVE_SYMTAB)" + echo "const int CONFIG_LIBC_ELF_NSYMBOLS_VAR = sizeof(CONFIG_LIBC_ELF_SYMTAB_ARRAY) / sizeof(struct symtab_s);" echo "#else" echo "const int dummy_nsymtabs = sizeof(dummy_symtab) / sizeof(struct symtab_s);" echo "#endif" From 109457302566b580b417eed6bae08d8577288c52 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Sat, 12 Apr 2025 15:12:15 +0900 Subject: [PATCH 250/391] toywasm: bump to v67.0.0 see below for the included changes. the "fix GCC warnings for the target with long uint32_t" change is for https://github.com/apache/nuttx/pull/16022. ```shell 2e4474d1af3bf9bc5a4b571be7ee69694f4a8aef wapm.toml: bump the version 95fdefcd3ea85ce18d0fd9c41536e609f6b0d7b2 suppress ubsan complaints on function type mismatches 9e131d0b86f29f453b51390e7a57db2f12efa8af fix a type in a comment 6832384862dab5f44b5328dbfe2a09cdba35713b platform.h: add WRONG_FUNC_TYPE macro to suppress -fsanitize=function 50062832c0481f4dcc67458fcfd2e1184e423d8b fix GCC warnings for the target with long uint32_t 04861b1084cd4925d99bfc758d5ae00359360c5d explain a cryptic dyld error 569aaa9b0ab6309311f331cdf3376e8d4445b1c0 libwasi_littlefs: emulate preadv/pwritev b3f665319efe68215d9c9f51f489ba61b03c27fb ci: bump littlefs version fe5cd58608c0eab0e3383626988240da1971a6ba fix debug info with IPO on macOS 7ef1b8abc4e4d1558986336732f21cf54f6abc58 libwasi_littlefs: fix crashes with non-debug builds abb5efe1141721225945087d414d348f4afd4976 libwasi_littlefs: fix a few races 125d8973b485583d3ac4a8c4a60f97334135ee53 lfs_error_to_errno: translate unknown values to EIO f1eda35d45229d02c7e23c872d2e0faeb9b2c731 Fix compilation errors with the latest macOS 15.2 SDK 3a01d8c5a063c18c8ebc58c45a61c7dd12cd4b75 libwasi_littlefs/README.md: remove a stale section b7f015fd933fd330ed6e4e6f9af0dfc7b280e70d CI: update actions/upload-artifact download-artifact to v4 3a90622e105a2064878d4d63fc5e4566c6d1906b comment 6cdb84116abb930e903221231dd657ec08fec9e2 cmake: add custom-page-sizes tests a2958960f59b6b0ccf7733fc3db301236991ff0b add run-wasm3-spec-test-custom-page-sizes.sh f1029a818e638e0a5995a7fef43988592e709740 fetch-spec-test.sh: bump wasm-spec-test 7aa3d9050abcac11f7f8abef12ced6334acf0670 prepare-spec-test.sh: use my fork of custom-page-sizes for now c987677a10557a0f938e3c10cfd05e5d741cf51e fetch-spec-test.sh: bump wasm-spec-test c9372193a766c145a76a7ceaf79c820ce4576ce8 test/prepare-spec-test.sh: add custom-pages-sizes tests 9a74326a8d9503151ca3868ea6ed855293cb77b1 doc cc700465b4275cc27007950f00ecf5079f68a778 comment 1700c523acf9fa3ba20772731eb04096852902a2 add a comment ``` Signed-off-by: YAMAMOTO Takashi --- interpreters/toywasm/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interpreters/toywasm/Makefile b/interpreters/toywasm/Makefile index b36604b0408..e3bff7582d0 100644 --- a/interpreters/toywasm/Makefile +++ b/interpreters/toywasm/Makefile @@ -146,7 +146,7 @@ CFLAGS += ${INCDIR_PREFIX}$(APPDIR)/interpreters/toywasm/toywasm/libdyld CFLAGS += -Wno-unknown-warning-option -Wno-unused-but-set-variable -Wno-unused-variable -Wno-return-type -TOYWASM_VERSION = b0e100a4ebd666f02b2bb9222d402a9f399a740b +TOYWASM_VERSION = 2e4474d1af3bf9bc5a4b571be7ee69694f4a8aef TOYWASM_UNPACK = toywasm TOYWASM_TARBALL = $(TOYWASM_VERSION).zip TOYWASM_URL_BASE = https://github.com/yamt/toywasm/archive/ From 57365ac05d6488ca39a063b1d64d38d91e60a3e6 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Sat, 12 Apr 2025 15:15:11 +0900 Subject: [PATCH 251/391] toywasm: regen for v67.0.0 ```shell REF=2e4474d1af3bf9bc5a4b571be7ee69694f4a8aef ./regen.sh ``` Signed-off-by: YAMAMOTO Takashi --- interpreters/toywasm/include/toywasm_version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interpreters/toywasm/include/toywasm_version.h b/interpreters/toywasm/include/toywasm_version.h index b2f1cc77aec..b0a0ea3e8b4 100644 --- a/interpreters/toywasm/include/toywasm_version.h +++ b/interpreters/toywasm/include/toywasm_version.h @@ -23,6 +23,6 @@ #if !defined(_TOYWASM_VERSION_H) #define _TOYWASM_VERSION_H -#define TOYWASM_VERSION "v66.0.0" +#define TOYWASM_VERSION "v67.0.0" #endif /* !defined(_TOYWASM_VERSION_H) */ From ecbd1e964a988e0ea4c1585e26f7ec5a5d994888 Mon Sep 17 00:00:00 2001 From: Jukka Laitinen Date: Wed, 16 Apr 2025 10:30:57 +0300 Subject: [PATCH 252/391] examples/camera: Initialize g_nximage semaphore with SEM_INITIALIZER Use SEM_INITIALIZER macro instead of direct { 0 } Signed-off-by: Jukka Laitinen --- examples/camera/camera_bkgd.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/camera/camera_bkgd.c b/examples/camera/camera_bkgd.c index cdd6653ff0f..c53b11ab8b3 100644 --- a/examples/camera/camera_bkgd.c +++ b/examples/camera/camera_bkgd.c @@ -97,13 +97,13 @@ static const struct nx_callback_s g_nximagecb = static struct nximage_data_s g_nximage = { - NULL, /* hnx */ - NULL, /* hbkgd */ - false, /* connected */ - 0, /* xres */ - 0, /* yres */ - false, /* havpos */ - { 0 }, /* sem */ + NULL, /* hnx */ + NULL, /* hbkgd */ + false, /* connected */ + 0, /* xres */ + 0, /* yres */ + false, /* havpos */ + SEM_INITIALIZER(0), /* sem */ }; /**************************************************************************** From 8d89d73bb8e56859ff961381fd975597d90c1196 Mon Sep 17 00:00:00 2001 From: Carlos Sanchez Date: Wed, 16 Apr 2025 10:36:43 +0200 Subject: [PATCH 253/391] canutils: use bps units for bitrate in SocketCAN interfaces. This matches PR https://github.com/apache/nuttx/pull/16225 in Nuttx where units for SocketCAN bitrate ioctls were changed. --- canutils/lely-canopen/0005-add-NuttX-support.patch | 6 +++--- canutils/slcan/slcan.c | 4 +--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/canutils/lely-canopen/0005-add-NuttX-support.patch b/canutils/lely-canopen/0005-add-NuttX-support.patch index 11b6198f5db..c33b5c10454 100644 --- a/canutils/lely-canopen/0005-add-NuttX-support.patch +++ b/canutils/lely-canopen/0005-add-NuttX-support.patch @@ -120,7 +120,7 @@ index ca7e7d95..fed1ae16 100644 + return -1; + } + -+ *pbitrate = ifr.ifr_ifru.ifru_can_data.arbi_bitrate * 1000; ++ *pbitrate = ifr.ifr_ifru.ifru_can_data.arbi_bitrate; + + return 0; +} @@ -141,8 +141,8 @@ index ca7e7d95..fed1ae16 100644 + struct ifreq ifr; + if_indextoname(can->ifindex, ifr.ifr_name); + -+ ifr.ifr_ifru.ifru_can_data.arbi_bitrate = bitrate / 1000; -+ ifr.ifr_ifru.ifru_can_data.data_bitrate = bitrate / 1000; ++ ifr.ifr_ifru.ifru_can_data.arbi_bitrate = bitrate; ++ ifr.ifr_ifru.ifru_can_data.data_bitrate = bitrate; + ifr.ifr_ifru.ifru_can_data.arbi_samplep = 0; + ifr.ifr_ifru.ifru_can_data.data_samplep = 0; + diff --git a/canutils/slcan/slcan.c b/canutils/slcan/slcan.c index f6b6c4e3ccc..84d7a13990d 100644 --- a/canutils/slcan/slcan.c +++ b/canutils/slcan/slcan.c @@ -363,9 +363,7 @@ int main(int argc, char *argv[]) /* set the device name */ strlcpy(ifr.ifr_name, argv[1], IFNAMSIZ); - - ifr.ifr_ifru.ifru_can_data.arbi_bitrate = - canspeed / 1000; /* Convert bit/s to kbit/s */ + ifr.ifr_ifru.ifru_can_data.arbi_bitrate = canspeed; ifr.ifr_ifru.ifru_can_data.arbi_samplep = 80; if (ioctl(s, SIOCSCANBITRATE, &ifr) < 0) From 61194fe6c003dcc7425936d494970f98b25fe1f3 Mon Sep 17 00:00:00 2001 From: Laczen JMS Date: Thu, 17 Apr 2025 15:17:31 +0200 Subject: [PATCH 254/391] examples/elf: add possibility to create romfs image Add the possibility to create a romfs image for an "external" file system. The romfs.img can directly be written to a configurable mtdblock device. Signed-off-by: Laczen JMS --- examples/elf/Kconfig | 7 +++++-- examples/elf/elf_main.c | 8 ++++++-- examples/elf/tests/.gitignore | 1 + examples/elf/tests/Makefile | 34 ++++++++++++++++++++++++++++++++-- 4 files changed, 44 insertions(+), 6 deletions(-) diff --git a/examples/elf/Kconfig b/examples/elf/Kconfig index 3c1a69a3976..ee285b091f8 100644 --- a/examples/elf/Kconfig +++ b/examples/elf/Kconfig @@ -39,7 +39,7 @@ config EXAMPLES_ELF_EXTERN The file system is assumed to reside on some external media such as an SD card or a USB FLASH drive. In this case, that external file system must be created manually by copying the - files in apps/examples/elf/tests/romfs to the volume. + files in apps/examples/elf/tests/extfs to the volume. The external volume can optionally be mounted by the test if the CONFIG_EXAMPLES_FSMOUNT option is also selected. @@ -81,7 +81,10 @@ config EXAMPLES_ELF_FSTYPE depends on EXAMPLES_ELF_FSMOUNT ---help--- The type of the external file system as will be used in the mount() - command. Default: "vfat" + command. Default: "vfat". + If the type of the external file system is set to "romfs" a romfs.img + is created in apps/examples/elf/tests/ this can be copied to an + internal block device. config EXAMPLES_ELF_DEVPATH string "Block driver device path" diff --git a/examples/elf/elf_main.c b/examples/elf/elf_main.c index 160d1e233bc..befa256e356 100644 --- a/examples/elf/elf_main.c +++ b/examples/elf/elf_main.c @@ -215,7 +215,11 @@ int main(int argc, FAR char *argv[]) mm_initmonitor(); +#if defined(CONFIG_EXAMPLES_ELF_FSMOUNT) + sprintf(devname, CONFIG_EXAMPLES_ELF_DEVPATH); +#else sprintf(devname, ELF_DEVPATH_FMT, CONFIG_EXAMPLES_ELF_DEVMINOR); +#endif #if defined(CONFIG_EXAMPLES_ELF_ROMFS) @@ -298,8 +302,8 @@ int main(int argc, FAR char *argv[]) /* Mount the external file system */ - message("Mounting %s filesystem at target=%s\n", - CONFIG_EXAMPLES_ELF_FSTYPE, MOUNTPT); + message("Mounting %s filesystem at target=%s on %s\n", + CONFIG_EXAMPLES_ELF_FSTYPE, MOUNTPT, devname); ret = mount(devname, MOUNTPT, CONFIG_EXAMPLES_ELF_FSTYPE, MS_RDONLY, NULL); if (ret < 0) diff --git a/examples/elf/tests/.gitignore b/examples/elf/tests/.gitignore index abf82cfea94..416f7e66e78 100644 --- a/examples/elf/tests/.gitignore +++ b/examples/elf/tests/.gitignore @@ -4,4 +4,5 @@ /cromfs /cromfs.c /dirlist.c +/extfs /symtab.c diff --git a/examples/elf/tests/Makefile b/examples/elf/tests/Makefile index ca78d8d5d3b..f73d31fc9e7 100644 --- a/examples/elf/tests/Makefile +++ b/examples/elf/tests/Makefile @@ -51,7 +51,9 @@ ifeq ($(CONFIG_EXAMPLES_ELF_ROMFS),y) FSIMG_DIR = $(TESTS_DIR)/$(FSIMG_SUBDIR) ROMFS_IMG = $(TESTS_DIR)/romfs.img FSIMG_SRC = $(TESTS_DIR)/romfs.c -else +endif + +ifeq ($(CONFIG_EXAMPLES_ELF_CROMFS),y) NXTOOLDIR = $(TOPDIR)/tools GENCROMFSSRC = gencromfs.c GENCROMFSEXE = gencromfs$(HOSTEXEEXT) @@ -61,6 +63,19 @@ else FSIMG_SRC = $(TESTS_DIR)/cromfs.c endif +ifeq ($(CONFIG_EXAMPLES_ELF_EXTERN),y) + FSIMG_SUBDIR = extfs + FSIMG_DIR = $(TESTS_DIR)/$(FSIMG_SUBDIR) +endif + +# generate the romfs image in case the fs type is romfs +# the FSIMG_SRC is not actually generated. + +ifeq ($(CONFIG_EXAMPLES_ELF_FSTYPE), "romfs") + ROMFS_IMG = $(TESTS_DIR)/romfs.img + FSIMG_SRC = $(TESTS_DIR)/romfs.c +endif + define DIR_template $(1)_$(2): +$(Q) $(MAKE) -C $(1) $(2) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" FSIMG_DIR="$(FSIMG_DIR)" CROSSDEV=$(CROSSDEV) @@ -90,7 +105,9 @@ $(FSIMG_SRC): $(ROMFS_IMG) xxd -i romfs.img | sed -e "s/^unsigned char/const unsigned char aligned_data(4)/g" | \ sed -e "s/romfs_img/elf_romfs_img/g" >>$@) -else +endif + +ifeq ($(CONFIG_EXAMPLES_ELF_CROMFS),y) # Make sure that the NuttX gencromfs tool has been built $(NXTOOLDIR)/$(GENCROMFSEXE): $(NXTOOLDIR)/$(GENCROMFSSRC) @@ -104,6 +121,19 @@ $(FSIMG_SRC): install $(NXTOOLDIR)/$(GENCROMFSEXE) endif +ifeq ($(CONFIG_EXAMPLES_ELF_FSTYPE),"romfs") +# Create the romfs.img file from the populated romfs directory + +$(ROMFS_IMG): install + $(Q) genromfs -f $@.tmp -d $(FSIMG_DIR) -V "ELFTEST" + $(Q) $(call TESTANDREPLACEFILE, $@.tmp, $@) + +# Create the romfs.c file from the romfs.img file + +$(FSIMG_SRC): $(ROMFS_IMG) + +endif + # Create the dirlist.h header file from the file system image directory $(DIRLIST_SRC): install From 2a52c4c7f56c45b7a8c8897811bd89094e3194cb Mon Sep 17 00:00:00 2001 From: dongjiuzhu1 Date: Sun, 13 Apr 2025 22:06:52 +0800 Subject: [PATCH 255/391] system/dd: support conv=nocreat align nshlib/nsh_cmddd Signed-off-by: dongjiuzhu1 --- system/dd/dd_main.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/system/dd/dd_main.c b/system/dd/dd_main.c index fb8005b400c..744f3dbbaad 100644 --- a/system/dd/dd_main.c +++ b/system/dd/dd_main.c @@ -78,8 +78,8 @@ struct dd_s uint32_t nsectors; /* Number of sectors to transfer */ uint32_t skip; /* The number of sectors skipped on input */ uint32_t seek; /* The number of sectors seeked on output */ + int oflags; /* The open flags on output deivce */ bool eof; /* true: The end of the input or output file has been hit */ - bool notrunc; /* conv=notrunc */ uint16_t sectsize; /* Size of one sector */ uint16_t nbytes; /* Number of valid bytes in the buffer */ FAR uint8_t *buffer; /* Buffer of data to write to the output file */ @@ -187,8 +187,7 @@ static inline int dd_outfopen(FAR const char *name, FAR struct dd_s *dd) return OK; } - dd->outfd = open(name, O_WRONLY | O_CREAT | (dd->notrunc ? 0 : O_TRUNC), - 0644); + dd->outfd = open(name, dd->oflags, 0644); if (dd->outfd < 0) { fprintf(stderr, "%s: failed to open '%s': %s\n", @@ -207,7 +206,8 @@ static void print_usage(void) { fprintf(stderr, "usage:\n"); fprintf(stderr, " %s [if=] [of=] [bs=] " - "[count=] [skip=] [seek=]\n", g_dd); + "[count=] [skip=] [seek=] " + "[conv=]\n", g_dd); } /**************************************************************************** @@ -232,6 +232,7 @@ int main(int argc, FAR char **argv) memset(&dd, 0, sizeof(struct dd_s)); dd.sectsize = DEFAULT_SECTSIZE; /* Sector size if 'bs=' not provided */ dd.nsectors = 0xffffffff; /* MAX_UINT32 */ + dd.oflags = O_WRONLY | O_CREAT | O_TRUNC; /* Parse command line parameters */ @@ -270,7 +271,11 @@ int main(int argc, FAR char **argv) size_t len = next != NULL ? next - cur : strlen(cur); if (len == 7 && !memcmp(cur, "notrunc", 7)) { - dd.notrunc = true; + dd.oflags &= ~O_TRUNC; + } + else if (len == 7 && !memcmp(cur, "nocreat", 7)) + { + dd.oflags &= ~(O_CREAT | O_TRUNC); } else { From b608dd0e3f9ba23ebed6635699b68b8da5c5d124 Mon Sep 17 00:00:00 2001 From: dongjiuzhu1 Date: Sat, 12 Apr 2025 18:37:49 +0800 Subject: [PATCH 256/391] system/dd: align nshlib/cmd_dd nshlib/cmd_dd: Retry if read() was interrupted Without this patch nsh> ls /etc/group | dd | dd sh [13:100] sh [14:100] nsh: dd: read failed: 4 nsh> Signed-off-by: wangjianyu3 Signed-off-by: dongjiuzhu1 --- system/dd/dd_main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/system/dd/dd_main.c b/system/dd/dd_main.c index 744f3dbbaad..b92c44233a1 100644 --- a/system/dd/dd_main.c +++ b/system/dd/dd_main.c @@ -135,6 +135,11 @@ static int dd_read(FAR struct dd_s *dd) nbytes = read(dd->infd, buffer, dd->sectsize - dd->nbytes); if (nbytes < 0) { + if (errno == EINTR) + { + continue; + } + fprintf(stderr, "%s: failed to read: %s\n", g_dd, strerror(errno)); return ERROR; } @@ -147,7 +152,7 @@ static int dd_read(FAR struct dd_s *dd) break; } } - while (dd->nbytes < dd->sectsize && nbytes > 0); + while (dd->nbytes < dd->sectsize && nbytes != 0); return OK; } From 721d79fb73c526b606ebe338b4220cf51dc5c158 Mon Sep 17 00:00:00 2001 From: dongjiuzhu1 Date: Sat, 12 Apr 2025 18:57:15 +0800 Subject: [PATCH 257/391] system/dd: align nshlib/cmd_dd cmd_dd:support dd can do verify After writing the file, compare the contents of the two files again Signed-off-by: anjiahao Signed-off-by: dongjiuzhu1 --- system/dd/dd_main.c | 91 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 90 insertions(+), 1 deletion(-) diff --git a/system/dd/dd_main.c b/system/dd/dd_main.c index b92c44233a1..3d6cae02d0d 100644 --- a/system/dd/dd_main.c +++ b/system/dd/dd_main.c @@ -31,6 +31,7 @@ #include #include +#include #include #include #include @@ -203,6 +204,75 @@ static inline int dd_outfopen(FAR const char *name, FAR struct dd_s *dd) return OK; } +static int dd_verify(FAR struct dd_s *dd) +{ + FAR uint8_t *buffer; + unsigned sector = 0; + int ret = OK; + + ret = lseek(dd->infd, dd->skip ? dd->skip * dd->sectsize : 0, SEEK_SET); + if (ret < 0) + { + fprintf(stderr, "%s: failed to infd lseek: %s\n", + g_dd, strerror(errno)); + return ret; + } + + dd->eof = 0; + ret = lseek(dd->outfd, 0, SEEK_SET); + if (ret < 0) + { + fprintf(stderr, "%s: failed to outfd lseek: %s\n", + g_dd, strerror(errno)); + return ret; + } + + buffer = malloc(dd->sectsize); + if (buffer == NULL) + { + return ERROR; + } + + while (!dd->eof && sector < dd->nsectors) + { + ret = dd_read(dd); + if (ret < 0) + { + break; + } + + ret = read(dd->outfd, buffer, dd->nbytes); + if (ret != dd->nbytes) + { + fprintf(stderr, "%s: failed to outfd read: %d\n", + g_dd, ret < 0 ? errno : ret); + break; + } + + if (memcmp(dd->buffer, buffer, dd->nbytes) != 0) + { + char msg[32]; + snprintf(msg, sizeof(msg), "infile sector %d", sector); + lib_dumpbuffer(msg, dd->buffer, dd->nbytes); + snprintf(msg, sizeof(msg), "\noutfile sector %d", sector); + lib_dumpbuffer(msg, buffer, dd->nbytes); + ret = ERROR; + break; + } + + sector++; + } + + if (ret < 0) + { + fprintf(stderr, "%s: failed to dd verify: %d\n", + g_dd, ret); + } + + free(buffer); + return ret; +} + /**************************************************************************** * Name: print_usage ****************************************************************************/ @@ -211,7 +281,7 @@ static void print_usage(void) { fprintf(stderr, "usage:\n"); fprintf(stderr, " %s [if=] [of=] [bs=] " - "[count=] [skip=] [seek=] " + "[count=] [skip=] [seek=] [verify] " "[conv=]\n", g_dd); } @@ -267,6 +337,10 @@ int main(int argc, FAR char **argv) { dd.seek = atoi(&argv[i][5]); } + else if (strncmp(argv[i], "verify", 6) == 0) + { + dd.oflags |= O_RDONLY; + } else if (strncmp(argv[i], "conv=", 5) == 0) { const char *cur = &argv[i][5]; @@ -304,6 +378,16 @@ int main(int argc, FAR char **argv) } } + /* If verify enabled, infile and outfile are mandatory */ + + if ((dd.oflags & O_RDONLY) && (infile == NULL || outfile == NULL)) + { + fprintf(stderr, "%s: invalid parameters: %s\n", g_dd, + strerror(EINVAL)); + print_usage(); + goto errout_with_paths; + } + /* Allocate the I/O buffer */ dd.buffer = malloc(dd.sectsize); @@ -400,6 +484,11 @@ int main(int argc, FAR char **argv) (unsigned int)(((double)total / 1024) / ((double)elapsed / USEC_PER_SEC))); + if (ret == 0 && (dd.oflags & O_RDONLY) != 0) + { + ret = dd_verify(&dd); + } + errout_with_outf: close(dd.outfd); From be6a45cb145845377df8425829aca47afe5e7b6c Mon Sep 17 00:00:00 2001 From: dongjiuzhu1 Date: Sun, 13 Apr 2025 21:48:37 +0800 Subject: [PATCH 258/391] system/dd: check infile/outfile when closing Signed-off-by: dongjiuzhu1 --- system/dd/dd_main.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/system/dd/dd_main.c b/system/dd/dd_main.c index 3d6cae02d0d..5c0f9cd16ef 100644 --- a/system/dd/dd_main.c +++ b/system/dd/dd_main.c @@ -490,14 +490,30 @@ int main(int argc, FAR char **argv) } errout_with_outf: - close(dd.outfd); + if (outfile) + { + dd.outfd = close(dd.outfd); + if (dd.outfd < 0) + { + fprintf(stderr, "%s failed to close outfd:%s\n", + g_dd, strerror(errno)); + } + } errout_with_inf: - close(dd.infd); + if (infile) + { + dd.infd = close(dd.infd); + if (dd.infd < 0) + { + fprintf(stderr, "%s failed to close infd:%s\n", + g_dd, strerror(errno)); + } + } errout_with_alloc: free(dd.buffer); errout_with_paths: - return ret; + return ret < 0 ? ret : (dd.outfd < 0 ? dd.outfd : dd.infd); } From 6db2c14faab97d23ae1363ae89b70a69bd87ee7a Mon Sep 17 00:00:00 2001 From: dongjiuzhu1 Date: Sun, 13 Apr 2025 22:12:05 +0800 Subject: [PATCH 259/391] system/dd: align nsh dd command nshlib/dd: Increase the integer width for sector size in dd. On some systems, using sector sizes larger than 65536 is needed for profiling performance or testing. Stuart Ianna Signed-off-by: dongjiuzhu1 --- system/dd/dd_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/system/dd/dd_main.c b/system/dd/dd_main.c index 5c0f9cd16ef..3eba567ffe5 100644 --- a/system/dd/dd_main.c +++ b/system/dd/dd_main.c @@ -81,8 +81,8 @@ struct dd_s uint32_t seek; /* The number of sectors seeked on output */ int oflags; /* The open flags on output deivce */ bool eof; /* true: The end of the input or output file has been hit */ - uint16_t sectsize; /* Size of one sector */ - uint16_t nbytes; /* Number of valid bytes in the buffer */ + size_t sectsize; /* Size of one sector */ + size_t nbytes; /* Number of valid bytes in the buffer */ FAR uint8_t *buffer; /* Buffer of data to write to the output file */ }; @@ -97,7 +97,7 @@ struct dd_s static int dd_write(FAR struct dd_s *dd) { FAR uint8_t *buffer = dd->buffer; - uint16_t written; + size_t written; ssize_t nbytes; /* Is the out buffer full (or is this the last one)? */ From 5585c9d347ccc0d14b909eb8a8e0e74ad81bb04e Mon Sep 17 00:00:00 2001 From: dongjiuzhu1 Date: Sun, 13 Apr 2025 22:20:23 +0800 Subject: [PATCH 260/391] nshlib/dd: remove nsh dd cmd using system/dd to instead nsh dd cmd remove related to config, file. Signed-off-by: dongjiuzhu1 --- nshlib/CMakeLists.txt | 1 - nshlib/Kconfig | 9 - nshlib/Makefile | 2 +- nshlib/nsh.h | 3 - nshlib/nsh_command.c | 6 - nshlib/nsh_ddcmd.c | 505 ------------------------------------------ system/dd/Kconfig | 7 +- system/dd/dd_main.c | 72 +++--- 8 files changed, 41 insertions(+), 564 deletions(-) delete mode 100644 nshlib/nsh_ddcmd.c diff --git a/nshlib/CMakeLists.txt b/nshlib/CMakeLists.txt index d09df277d7d..ddfe1f87e04 100644 --- a/nshlib/CMakeLists.txt +++ b/nshlib/CMakeLists.txt @@ -34,7 +34,6 @@ if(CONFIG_NSH_LIBRARY) nsh_system.c nsh_command.c nsh_fscmds.c - nsh_ddcmd.c nsh_proccmds.c nsh_mmcmds.c nsh_timcmds.c diff --git a/nshlib/Kconfig b/nshlib/Kconfig index 86863ff99e9..fa7215ce2d2 100644 --- a/nshlib/Kconfig +++ b/nshlib/Kconfig @@ -345,10 +345,6 @@ config NSH_DISABLE_DATE bool "Disable date" default DEFAULT_SMALL || !RTC -config NSH_DISABLE_DD - bool "Disable dd" - default DEFAULT_SMALL - config NSH_DISABLE_DF bool "Disable df" default DEFAULT_SMALL @@ -787,11 +783,6 @@ config NSH_VARS variables variables ============== =========================== =========================== -config NSH_CMDOPT_DD_STATS - bool "dd: Support transfer statistics" - default n - depends on !NSH_DISABLE_DD - config NSH_CODECS_BUFSIZE int "File buffer size used by CODEC commands" default 128 diff --git a/nshlib/Makefile b/nshlib/Makefile index 917d8baeb28..bf6ec06f777 100644 --- a/nshlib/Makefile +++ b/nshlib/Makefile @@ -25,7 +25,7 @@ include $(APPDIR)/Make.defs # NSH Library CSRCS = nsh_init.c nsh_parse.c nsh_console.c nsh_script.c nsh_system.c -CSRCS += nsh_command.c nsh_fscmds.c nsh_ddcmd.c nsh_proccmds.c nsh_mmcmds.c +CSRCS += nsh_command.c nsh_fscmds.c nsh_proccmds.c nsh_mmcmds.c CSRCS += nsh_timcmds.c nsh_envcmds.c nsh_syscmds.c nsh_dbgcmds.c nsh_prompt.c CSRCS += nsh_session.c diff --git a/nshlib/nsh.h b/nshlib/nsh.h index cd0ea0e1a26..8d037f5176f 100644 --- a/nshlib/nsh.h +++ b/nshlib/nsh.h @@ -975,9 +975,6 @@ int cmd_irqinfo(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv); #ifndef CONFIG_NSH_DISABLE_CMP int cmd_cmp(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv); #endif -#ifndef CONFIG_NSH_DISABLE_DD - int cmd_dd(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv); -#endif #ifndef CONFIG_NSH_DISABLE_HEXDUMP int cmd_hexdump(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv); #endif diff --git a/nshlib/nsh_command.c b/nshlib/nsh_command.c index 3a91a1c2f5a..dc8fab48128 100644 --- a/nshlib/nsh_command.c +++ b/nshlib/nsh_command.c @@ -185,12 +185,6 @@ static const struct cmdmap_s g_cmdmap[] = 1, 4, "[-s \"MMM DD HH:MM:SS YYYY\"] [-u] [+format]"), #endif -#ifndef CONFIG_NSH_DISABLE_DD - CMD_MAP("dd", cmd_dd, 1, 7, - "if= of= [bs=] [count=] " - "[skip=] [seek=] [verify] [conv=]"), -#endif - #if defined(CONFIG_NET) && defined(CONFIG_NET_ROUTE) && !defined(CONFIG_NSH_DISABLE_DELROUTE) CMD_MAP("delroute", cmd_delroute, 2, 3, " []"), #endif diff --git a/nshlib/nsh_ddcmd.c b/nshlib/nsh_ddcmd.c deleted file mode 100644 index d24aac52bb8..00000000000 --- a/nshlib/nsh_ddcmd.c +++ /dev/null @@ -1,505 +0,0 @@ -/**************************************************************************** - * apps/nshlib/nsh_ddcmd.c - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "nsh.h" -#include "nsh_console.h" - -#ifndef CONFIG_NSH_DISABLE_DD - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/* If no sector size is specified with BS=, then the following default value - * is used. - */ - -#define DEFAULT_SECTSIZE 512 -#define g_dd "dd" - -/**************************************************************************** - * Private Types - ****************************************************************************/ - -struct dd_s -{ - FAR struct nsh_vtbl_s *vtbl; - - int infd; /* File descriptor of the input device */ - int outfd; /* File descriptor of the output device */ - uint32_t nsectors; /* Number of sectors to transfer */ - uint32_t skip; /* The number of sectors skipped on input */ - uint32_t seek; /* The number of bytes skipped on output */ - int oflags; /* The open flags on output deivce */ - bool eof; /* true: The end of the input or output file has been hit */ - size_t sectsize; /* Size of one sector */ - size_t nbytes; /* Number of valid bytes in the buffer */ - FAR uint8_t *buffer; /* Buffer of data to write to the output file */ -}; - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: dd_write - ****************************************************************************/ - -static int dd_write(FAR struct dd_s *dd) -{ - FAR uint8_t *buffer = dd->buffer; - size_t written; - ssize_t nbytes; - - /* Is the out buffer full (or is this the last one)? */ - - written = 0; - do - { - nbytes = write(dd->outfd, buffer, dd->nbytes - written); - if (nbytes < 0) - { - FAR struct nsh_vtbl_s *vtbl = dd->vtbl; - nsh_error(vtbl, g_fmtcmdfailed, g_dd, "write", NSH_ERRNO); - return ERROR; - } - - written += nbytes; - buffer += nbytes; - } - while (written < dd->nbytes); - - return OK; -} - -/**************************************************************************** - * Name: dd_read - ****************************************************************************/ - -static int dd_read(FAR struct dd_s *dd) -{ - FAR uint8_t *buffer = dd->buffer; - ssize_t nbytes; - - dd->nbytes = 0; - do - { - nbytes = read(dd->infd, buffer, dd->sectsize - dd->nbytes); - if (nbytes < 0) - { - if (errno == EINTR) - { - continue; - } - - FAR struct nsh_vtbl_s *vtbl = dd->vtbl; - nsh_error(vtbl, g_fmtcmdfailed, g_dd, "read", NSH_ERRNO); - return ERROR; - } - - dd->nbytes += nbytes; - buffer += nbytes; - } - while (dd->nbytes < dd->sectsize && nbytes != 0); - - dd->eof |= (dd->nbytes == 0); - return OK; -} - -/**************************************************************************** - * Name: dd_infopen - ****************************************************************************/ - -static inline int dd_infopen(FAR const char *name, FAR struct dd_s *dd) -{ - dd->infd = open(name, O_RDONLY); - if (dd->infd < 0) - { - FAR struct nsh_vtbl_s *vtbl = dd->vtbl; - nsh_error(vtbl, g_fmtcmdfailed, g_dd, "open", NSH_ERRNO); - return ERROR; - } - - return OK; -} - -/**************************************************************************** - * Name: dd_outfopen - ****************************************************************************/ - -static inline int dd_outfopen(FAR const char *name, FAR struct dd_s *dd) -{ - dd->outfd = open(name, dd->oflags, 0644); - if (dd->outfd < 0) - { - FAR struct nsh_vtbl_s *vtbl = dd->vtbl; - nsh_error(vtbl, g_fmtcmdfailed, g_dd, "open", NSH_ERRNO); - return ERROR; - } - - return OK; -} - -static int dd_verify(FAR const char *infile, FAR const char *outfile, - FAR struct dd_s *dd) -{ - FAR struct nsh_vtbl_s *vtbl = dd->vtbl; - FAR uint8_t *buffer; - unsigned sector = 0; - int ret = OK; - - UNUSED(infile); - UNUSED(outfile); - - ret = lseek(dd->infd, dd->skip ? dd->skip * dd->sectsize : 0, SEEK_SET); - if (ret < 0) - { - nsh_error(vtbl, g_fmtcmdfailed, g_dd, "lseek", NSH_ERRNO); - return ret; - } - - dd->eof = 0; - ret = lseek(dd->outfd, 0, SEEK_SET); - if (ret < 0) - { - nsh_error(vtbl, g_fmtcmdfailed, g_dd, "lseek", NSH_ERRNO); - return ret; - } - - buffer = malloc(dd->sectsize); - if (buffer == NULL) - { - return ERROR; - } - - while (!dd->eof && sector < dd->nsectors) - { - ret = dd_read(dd); - if (ret < 0) - { - break; - } - - ret = read(dd->outfd, buffer, dd->nbytes); - if (ret != dd->nbytes) - { - nsh_error(vtbl, g_fmtcmdfailed, g_dd, "read", NSH_ERRNO); - break; - } - - if (memcmp(dd->buffer, buffer, dd->nbytes) != 0) - { - char msg[32]; - snprintf(msg, sizeof(msg), "infile sector %d", sector); - nsh_dumpbuffer(vtbl, msg, dd->buffer, dd->nbytes); - snprintf(msg, sizeof(msg), "\noutfile sector %d", sector); - nsh_dumpbuffer(vtbl, msg, buffer, dd->nbytes); - nsh_output(vtbl, "\n"); - ret = ERROR; - break; - } - - sector++; - } - - if (ret < 0) - { - nsh_error(vtbl, g_fmtcmdfailed, g_dd, "dd_verify", ret); - } - - free(buffer); - return ret; -} - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: cmd_dd - * - * At present, redirect of input and output are supported. - * of= and if= arguments are required only when verify enabled. - * - ****************************************************************************/ - -int cmd_dd(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv) -{ - FAR struct console_stdio_s *pstate = (FAR struct console_stdio_s *)vtbl; - struct dd_s dd; - FAR char *infile = NULL; - FAR char *outfile = NULL; -#ifdef CONFIG_NSH_CMDOPT_DD_STATS - struct timespec ts0; - struct timespec ts1; - uint64_t elapsed; - uint64_t total; -#endif - uint32_t sector = 0; - int ret = ERROR; - int i; - - /* Initialize the dd structure */ - - memset(&dd, 0, sizeof(struct dd_s)); - dd.vtbl = vtbl; /* For nsh_output */ - dd.sectsize = DEFAULT_SECTSIZE; /* Sector size if 'bs=' not provided */ - dd.nsectors = 0xffffffff; /* MAX_UINT32 */ - dd.oflags = O_WRONLY | O_CREAT | O_TRUNC; - - /* If no IF= option is provided on the command line, then read - * from stdin. - */ - - dd.infd = INFD(pstate); /* stdin */ - - /* If no OF= option is provided on the command line, then write - * to stdout. - */ - - dd.outfd = OUTFD(pstate); /* stdout */ - - /* Parse command line parameters */ - - for (i = 1; i < argc; i++) - { - if (strncmp(argv[i], "if=", 3) == 0) - { - if (infile != NULL) - { - free(infile); - } - - infile = nsh_getfullpath(vtbl, &argv[i][3]); - } - else if (strncmp(argv[i], "of=", 3) == 0) - { - if (outfile != NULL) - { - free(outfile); - } - - outfile = nsh_getfullpath(vtbl, &argv[i][3]); - } - else if (strncmp(argv[i], "bs=", 3) == 0) - { - dd.sectsize = atoi(&argv[i][3]); - } - else if (strncmp(argv[i], "count=", 6) == 0) - { - dd.nsectors = atoi(&argv[i][6]); - } - else if (strncmp(argv[i], "skip=", 5) == 0) - { - dd.skip = atoi(&argv[i][5]); - } - else if (strncmp(argv[i], "seek=", 5) == 0) - { - dd.seek = atoi(&argv[i][5]); - } - else if (strncmp(argv[i], "verify", 6) == 0) - { - dd.oflags |= O_RDONLY; - } - else if (strncmp(argv[i], "conv=", 5) == 0) - { - if (strstr(argv[i], "nocreat") != NULL) - { - dd.oflags &= ~(O_CREAT | O_TRUNC); - } - else if (strstr(argv[i], "notrunc") != NULL) - { - dd.oflags &= ~O_TRUNC; - } - } - } - - /* If verify enabled, infile and outfile are mandatory */ - - if ((dd.oflags & O_RDONLY) && (infile == NULL || outfile == NULL)) - { - nsh_error(vtbl, g_fmtargrequired, g_dd); - goto errout_with_paths; - } - - /* Allocate the I/O buffer */ - - dd.buffer = malloc(dd.sectsize); - if (!dd.buffer) - { - nsh_error(vtbl, g_fmtcmdoutofmemory, g_dd); - goto errout_with_paths; - } - - /* Open the input file */ - - if (infile) - { - ret = dd_infopen(infile, &dd); - if (ret < 0) - { - goto errout_with_alloc; - } - } - - /* Open the output file */ - - if (outfile) - { - ret = dd_outfopen(outfile, &dd); - if (ret < 0) - { - goto errout_with_inf; - } - } - - /* Then perform the data transfer */ - -#ifdef CONFIG_NSH_CMDOPT_DD_STATS - clock_gettime(CLOCK_MONOTONIC, &ts0); -#endif - - if (dd.skip) - { - ret = lseek(dd.infd, dd.skip * dd.sectsize, SEEK_SET); - if (ret < 0) - { - nsh_error(vtbl, g_fmtcmdfailed, g_dd, "skip lseek", NSH_ERRNO); - ret = ERROR; - goto errout_with_outf; - } - } - - if (dd.seek) - { - ret = lseek(dd.outfd, dd.seek * dd.sectsize, SEEK_SET); - if (ret < 0) - { - nsh_error(vtbl, g_fmtcmdfailed, g_dd, "seek lseek", NSH_ERRNO); - ret = ERROR; - goto errout_with_outf; - } - } - - while (!dd.eof && sector < dd.nsectors) - { - /* Read one sector from from the input */ - - ret = dd_read(&dd); - if (ret < 0) - { - goto errout_with_outf; - } - - /* Has the incoming data stream ended? */ - - if (!dd.eof) - { - /* Write one sector to the output file */ - - ret = dd_write(&dd); - if (ret < 0) - { - goto errout_with_outf; - } - - /* Increment the sector number */ - - sector++; - } - } - - ret = OK; - -#ifdef CONFIG_NSH_CMDOPT_DD_STATS - clock_gettime(CLOCK_MONOTONIC, &ts1); - - elapsed = (((uint64_t)ts1.tv_sec * NSEC_PER_SEC) + ts1.tv_nsec); - elapsed -= (((uint64_t)ts0.tv_sec * NSEC_PER_SEC) + ts0.tv_nsec); - elapsed /= NSEC_PER_USEC; /* usec */ - - total = ((uint64_t)sector * (uint64_t)dd.sectsize); - - nsh_output(vtbl, "%" PRIu64 "bytes copied, %" PRIu64 " usec, ", - total, elapsed); - nsh_output(vtbl, "%u KB/s\n" , - (unsigned int)(((double)total / 1024) - / ((double)elapsed / USEC_PER_SEC))); -#endif - - if (ret == 0 && (dd.oflags & O_RDONLY) != 0) - { - ret = dd_verify(infile, outfile, &dd); - } - -errout_with_outf: - if (outfile) - { - close(dd.outfd); - } - -errout_with_inf: - if (infile) - { - close(dd.infd); - } - -errout_with_alloc: - free(dd.buffer); - -errout_with_paths: - if (infile) - { - nsh_freefullpath(infile); - } - - if (outfile) - { - nsh_freefullpath(outfile); - } - - return ret; -} - -#endif /* !CONFIG_NSH_DISABLE_DD */ diff --git a/system/dd/Kconfig b/system/dd/Kconfig index b5fb44cb8d3..3479ad32c21 100644 --- a/system/dd/Kconfig +++ b/system/dd/Kconfig @@ -5,8 +5,7 @@ config SYSTEM_DD tristate "system 'dd' command" - default n - select NSH_DISABLE_DD if NSH_LIBRARY + default !DEFAULT_SMALL ---help--- Enable support for the system 'dd' command. @@ -27,4 +26,8 @@ config SYSTEM_DD_STACKSIZE int "dd stack size" default DEFAULT_TASK_STACKSIZE +config SYSTEM_DD_STATS + bool "dd: Support transfer statistics" + default y + endif diff --git a/system/dd/dd_main.c b/system/dd/dd_main.c index 3eba567ffe5..4ab595b078b 100644 --- a/system/dd/dd_main.c +++ b/system/dd/dd_main.c @@ -108,8 +108,7 @@ static int dd_write(FAR struct dd_s *dd) nbytes = write(dd->outfd, buffer, dd->nbytes - written); if (nbytes < 0) { - fprintf(stderr, "%s: failed to write: %s\n", - g_dd, strerror(errno)); + printf("%s: failed to write: %s\n", g_dd, strerror(errno)); return ERROR; } @@ -141,7 +140,7 @@ static int dd_read(FAR struct dd_s *dd) continue; } - fprintf(stderr, "%s: failed to read: %s\n", g_dd, strerror(errno)); + printf("%s: failed to read: %s\n", g_dd, strerror(errno)); return ERROR; } @@ -173,8 +172,7 @@ static inline int dd_infopen(FAR const char *name, FAR struct dd_s *dd) dd->infd = open(name, O_RDONLY); if (dd->infd < 0) { - fprintf(stderr, "%s: failed to open '%s': %s\n", - g_dd, name, strerror(errno)); + printf("%s: failed to open '%s': %s\n", g_dd, name, strerror(errno)); return ERROR; } @@ -196,8 +194,7 @@ static inline int dd_outfopen(FAR const char *name, FAR struct dd_s *dd) dd->outfd = open(name, dd->oflags, 0644); if (dd->outfd < 0) { - fprintf(stderr, "%s: failed to open '%s': %s\n", - g_dd, name, strerror(errno)); + printf("%s: failed to open '%s': %s\n", g_dd, name, strerror(errno)); return ERROR; } @@ -213,8 +210,7 @@ static int dd_verify(FAR struct dd_s *dd) ret = lseek(dd->infd, dd->skip ? dd->skip * dd->sectsize : 0, SEEK_SET); if (ret < 0) { - fprintf(stderr, "%s: failed to infd lseek: %s\n", - g_dd, strerror(errno)); + printf("%s: failed to infd lseek: %s\n", g_dd, strerror(errno)); return ret; } @@ -222,8 +218,7 @@ static int dd_verify(FAR struct dd_s *dd) ret = lseek(dd->outfd, 0, SEEK_SET); if (ret < 0) { - fprintf(stderr, "%s: failed to outfd lseek: %s\n", - g_dd, strerror(errno)); + printf("%s: failed to outfd lseek: %s\n", g_dd, strerror(errno)); return ret; } @@ -244,8 +239,8 @@ static int dd_verify(FAR struct dd_s *dd) ret = read(dd->outfd, buffer, dd->nbytes); if (ret != dd->nbytes) { - fprintf(stderr, "%s: failed to outfd read: %d\n", - g_dd, ret < 0 ? errno : ret); + printf("%s: failed to outfd read: %d\n", + g_dd, ret < 0 ? errno : ret); break; } @@ -265,8 +260,7 @@ static int dd_verify(FAR struct dd_s *dd) if (ret < 0) { - fprintf(stderr, "%s: failed to dd verify: %d\n", - g_dd, ret); + printf("%s: failed to dd verify: %d\n", g_dd, ret); } free(buffer); @@ -279,10 +273,10 @@ static int dd_verify(FAR struct dd_s *dd) static void print_usage(void) { - fprintf(stderr, "usage:\n"); - fprintf(stderr, " %s [if=] [of=] [bs=] " - "[count=] [skip=] [seek=] [verify] " - "[conv=]\n", g_dd); + printf("usage:\n"); + printf(" %s [if=] [of=] [bs=] " + "[count=] [skip=] [seek=] [verify] " + "[conv=]\n", g_dd); } /**************************************************************************** @@ -294,10 +288,12 @@ int main(int argc, FAR char **argv) struct dd_s dd; FAR char *infile = NULL; FAR char *outfile = NULL; +#ifdef CONFIG_SYSTEM_DD_STATS struct timespec ts0; struct timespec ts1; uint64_t elapsed; uint64_t total = 0; +#endif uint32_t sector = 0; int ret = ERROR; int i; @@ -358,8 +354,8 @@ int main(int argc, FAR char **argv) } else { - fprintf(stderr, "%s: unknown conversion '%.*s'\n", g_dd, - (int)len, cur); + printf("%s: unknown conversion '%.*s'\n", g_dd, + (int)len, cur); goto errout_with_paths; } @@ -382,8 +378,7 @@ int main(int argc, FAR char **argv) if ((dd.oflags & O_RDONLY) && (infile == NULL || outfile == NULL)) { - fprintf(stderr, "%s: invalid parameters: %s\n", g_dd, - strerror(EINVAL)); + printf("%s: invalid parameters: %s\n", g_dd, strerror(EINVAL)); print_usage(); goto errout_with_paths; } @@ -393,7 +388,7 @@ int main(int argc, FAR char **argv) dd.buffer = malloc(dd.sectsize); if (!dd.buffer) { - fprintf(stderr, "%s: failed to malloc: %s\n", g_dd, strerror(errno)); + printf("%s: failed to malloc: %s\n", g_dd, strerror(errno)); goto errout_with_paths; } @@ -418,8 +413,7 @@ int main(int argc, FAR char **argv) ret = lseek(dd.infd, dd.skip * dd.sectsize, SEEK_SET); if (ret < 0) { - fprintf(stderr, "%s: failed to lseek: %s\n", - g_dd, strerror(errno)); + printf("%s: failed to lseek: %s\n", g_dd, strerror(errno)); ret = ERROR; goto errout_with_outf; } @@ -430,8 +424,8 @@ int main(int argc, FAR char **argv) ret = lseek(dd.outfd, dd.seek * dd.sectsize, SEEK_SET); if (ret < 0) { - fprintf(stderr, "%s: failed to lseek on output: %s\n", - g_dd, strerror(errno)); + printf("%s: failed to lseek on output: %s\n", + g_dd, strerror(errno)); ret = ERROR; goto errout_with_outf; } @@ -439,7 +433,9 @@ int main(int argc, FAR char **argv) /* Then perform the data transfer */ +#ifdef CONFIG_SYSTEM_DD_STATS clock_gettime(CLOCK_MONOTONIC, &ts0); +#endif while (!dd.eof && sector < dd.nsectors) { @@ -466,23 +462,27 @@ int main(int argc, FAR char **argv) /* Increment the sector number */ sector++; +#ifdef CONFIG_SYSTEM_DD_STATS total += dd.nbytes; +#endif } } ret = OK; +#ifdef CONFIG_SYSTEM_DD_STATS clock_gettime(CLOCK_MONOTONIC, &ts1); elapsed = (((uint64_t)ts1.tv_sec * NSEC_PER_SEC) + ts1.tv_nsec); elapsed -= (((uint64_t)ts0.tv_sec * NSEC_PER_SEC) + ts0.tv_nsec); elapsed /= NSEC_PER_USEC; /* usec */ - fprintf(stderr, "%" PRIu64 " bytes (%" PRIu32 " blocks) copied, %u usec, ", - total, sector, (unsigned int)elapsed); - fprintf(stderr, "%u KB/s\n" , - (unsigned int)(((double)total / 1024) - / ((double)elapsed / USEC_PER_SEC))); + printf("%" PRIu64 " bytes (%" PRIu32 " blocks) copied, %u usec, ", + total, sector, (unsigned int)elapsed); + printf("%u KB/s\n" , + (unsigned int)(((double)total / 1024) + / ((double)elapsed / USEC_PER_SEC))); +#endif if (ret == 0 && (dd.oflags & O_RDONLY) != 0) { @@ -495,8 +495,7 @@ int main(int argc, FAR char **argv) dd.outfd = close(dd.outfd); if (dd.outfd < 0) { - fprintf(stderr, "%s failed to close outfd:%s\n", - g_dd, strerror(errno)); + printf("%s failed to close outfd:%s\n", g_dd, strerror(errno)); } } @@ -506,8 +505,7 @@ int main(int argc, FAR char **argv) dd.infd = close(dd.infd); if (dd.infd < 0) { - fprintf(stderr, "%s failed to close infd:%s\n", - g_dd, strerror(errno)); + printf("%s failed to close infd:%s\n", g_dd, strerror(errno)); } } From 4fb47a6a6df7e128e539c2577962272c1ccee80f Mon Sep 17 00:00:00 2001 From: Carlos Sanchez Date: Tue, 15 Apr 2025 19:03:45 +0200 Subject: [PATCH 261/391] canutils/slcan: Work with CAN interfaces with names longer than 4 characters. Signed-off-by: Carlos Sanchez --- canutils/slcan/slcan.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/canutils/slcan/slcan.c b/canutils/slcan/slcan.c index 84d7a13990d..e2759a20c94 100644 --- a/canutils/slcan/slcan.c +++ b/canutils/slcan/slcan.c @@ -137,8 +137,7 @@ static int caninit(char *candev, int *s, struct sockaddr_can *addr, syslog(LOG_ERR, "Error opening CAN socket\n"); return -1; } - strncpy(ifr.ifr_name, candev, 4); - ifr.ifr_name[4] = '\0'; + strlcpy(ifr.ifr_name, candev, IFNAMSIZ); ifr.ifr_ifindex = if_nametoindex(ifr.ifr_name); if (!ifr.ifr_ifindex) { From f94bccf119e8d5765ecec5dacd27708f17b87104 Mon Sep 17 00:00:00 2001 From: Carlos Sanchez Date: Tue, 15 Apr 2025 19:09:48 +0200 Subject: [PATCH 262/391] canutils/slcan: explicitly manage the interface. A recent change (https://github.com/apache/nuttx/pull/16199) has made the bitrate setting no longer bring the interface up. Moreover, it is now no longer possible to change bitrate of a CAN interface if it is up. Therefore, slcan needs to bring the interface down to change it. Fortunately, it already had commands to open and close the interface which map nicely to this. Signed-off-by: Carlos Sanchez --- canutils/slcan/slcan.c | 38 ++++++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/canutils/slcan/slcan.c b/canutils/slcan/slcan.c index e2759a20c94..cd7234fa2b2 100644 --- a/canutils/slcan/slcan.c +++ b/canutils/slcan/slcan.c @@ -316,9 +316,22 @@ int main(int argc, char *argv[]) { /* open CAN interface */ - mode = 1; - debug_print("Open interface\n"); - ok_return(fd); + struct ifreq ifr; + + strlcpy(ifr.ifr_name, argv[1], IFNAMSIZ); + + ifr.ifr_flags = IFF_UP; + if (ioctl(s, SIOCSIFFLAGS, &ifr) < 0) + { + syslog(LOG_ERR, "Open interface failed\n"); + fail_return(fd); + } + else + { + mode = 1; + debug_print("Open interface\n"); + ok_return(fd); + } } else if (buf[0] == 'S') { @@ -392,9 +405,22 @@ int main(int argc, char *argv[]) { /* close interface */ - mode = 0; - debug_print("Close interface\n"); - ok_return(fd); + struct ifreq ifr; + + strlcpy(ifr.ifr_name, argv[1], IFNAMSIZ); + + ifr.ifr_flags = 0; + if (ioctl(s, SIOCSIFFLAGS, &ifr) < 0) + { + syslog(LOG_ERR, "Close interface failed\n"); + fail_return(fd); + } + else + { + mode = 0; + debug_print("Close interface\n"); + ok_return(fd); + } } else if (buf[0] == 'T') { From 84d4fe0bfd5fb94ee5ebef1224b781629a0a6916 Mon Sep 17 00:00:00 2001 From: dongjiuzhu1 Date: Tue, 17 Dec 2024 22:33:53 +0800 Subject: [PATCH 263/391] system/uorb: using UORB_LOOP_MAX_EVENTS to config loop function Disable loop events by default (not compile loop.c and epoll.c). Signed-off-by: dongjiuzhu1 --- system/uorb/Kconfig | 2 +- system/uorb/Makefile | 6 +++++- system/uorb/uORB/uORB.h | 4 ++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/system/uorb/Kconfig b/system/uorb/Kconfig index 8457c136239..3d1d9cb5ec3 100644 --- a/system/uorb/Kconfig +++ b/system/uorb/Kconfig @@ -28,7 +28,7 @@ config UORB_TESTS config UORB_LOOP_MAX_EVENTS int "uorb loop max events" - default 16 + default 0 if UORB_TESTS diff --git a/system/uorb/Makefile b/system/uorb/Makefile index 3b36622080f..800cd5cfb7d 100644 --- a/system/uorb/Makefile +++ b/system/uorb/Makefile @@ -22,9 +22,13 @@ include $(APPDIR)/Make.defs -CSRCS += $(wildcard uORB/*.c) +CSRCS += uORB/uORB.c CSRCS += $(wildcard sensor/*.c) +ifneq ($(CONFIG_UORB_LOOP_MAX_EVENTS),0) +CSRCS += uORB/loop.c uORB/epoll.c +endif + ifneq ($(CONFIG_UORB_LISTENER),) MAINSRC += listener.c PROGNAME += uorb_listener diff --git a/system/uorb/uORB/uORB.h b/system/uorb/uORB/uORB.h index 69cffd08ac6..b1aa15ef292 100644 --- a/system/uorb/uORB/uORB.h +++ b/system/uorb/uORB/uORB.h @@ -88,6 +88,7 @@ typedef CODE int (*orb_eventpri_cb_t)(FAR struct orb_handle_s *handle, typedef CODE int (*orb_eventerr_cb_t)(FAR struct orb_handle_s *handle, FAR void *arg); +#if CONFIG_UORB_LOOP_MAX_EVENTS enum orb_loop_type_e { ORB_EPOLL_TYPE = 0, @@ -111,6 +112,7 @@ struct orb_handle_s orb_eventpri_cb_t eventpri_cb; /* User EPOLLPRI callback funtion. */ orb_eventerr_cb_t eventerr_cb; /* User EPOLLERR callback funtion. */ }; +#endif /**************************************************************************** * Pre-processor Definitions @@ -896,6 +898,7 @@ int orb_fprintf(FAR FILE *stream, FAR const char *format, FAR const void *data); #endif +#if CONFIG_UORB_LOOP_MAX_EVENTS /**************************************************************************** * Name: orb_loop_init * @@ -1003,6 +1006,7 @@ int orb_handle_start(FAR struct orb_loop_s *loop, int orb_handle_stop(FAR struct orb_loop_s *loop, FAR struct orb_handle_s *handle); +#endif #ifdef __cplusplus } From d6708057583c47419f3fd2dce64adce883b3b523 Mon Sep 17 00:00:00 2001 From: dongjiuzhu1 Date: Wed, 11 Dec 2024 21:32:13 +0800 Subject: [PATCH 264/391] system/uorb: add eventfd to notify loop exit. Add support for exiting loop by writing eventfd. Signed-off-by: dongjiuzhu1 --- system/uorb/Kconfig | 1 + system/uorb/Makefile | 2 ++ system/uorb/uORB/loop.c | 51 +++++++++++++++++++++++++++++++++++++++++ system/uorb/uORB/uORB.h | 27 +++++++++++++++------- 4 files changed, 73 insertions(+), 8 deletions(-) diff --git a/system/uorb/Kconfig b/system/uorb/Kconfig index 3d1d9cb5ec3..bbe66ca16a8 100644 --- a/system/uorb/Kconfig +++ b/system/uorb/Kconfig @@ -28,6 +28,7 @@ config UORB_TESTS config UORB_LOOP_MAX_EVENTS int "uorb loop max events" + depends on EVENT_FD default 0 if UORB_TESTS diff --git a/system/uorb/Makefile b/system/uorb/Makefile index 800cd5cfb7d..2811f2f78e3 100644 --- a/system/uorb/Makefile +++ b/system/uorb/Makefile @@ -25,9 +25,11 @@ include $(APPDIR)/Make.defs CSRCS += uORB/uORB.c CSRCS += $(wildcard sensor/*.c) +ifneq ($(CONFIG_UORB_LOOP_MAX_EVENTS),) ifneq ($(CONFIG_UORB_LOOP_MAX_EVENTS),0) CSRCS += uORB/loop.c uORB/epoll.c endif +endif ifneq ($(CONFIG_UORB_LISTENER),) MAINSRC += listener.c diff --git a/system/uorb/uORB/loop.c b/system/uorb/uORB/loop.c index 772e37d40fb..9d9bf994c51 100644 --- a/system/uorb/uORB/loop.c +++ b/system/uorb/uORB/loop.c @@ -25,6 +25,11 @@ ****************************************************************************/ #include +#include +#include +#include +#include +#include #include "internal.h" @@ -35,6 +40,7 @@ int orb_loop_init(FAR struct orb_loop_s *loop, enum orb_loop_type_e type) { int ret = -EINVAL; + int fd; if (loop == NULL) { @@ -57,20 +63,65 @@ int orb_loop_init(FAR struct orb_loop_s *loop, enum orb_loop_type_e type) { uorberr("loop init failed! ret:%d", ret); loop->ops = NULL; + return ret; + } + + fd = eventfd(0, EFD_CLOEXEC | EFD_NONBLOCK); + if (fd < 0) + { + ret = -errno; + uorberr("loop init eventfd failed! ret:%d", ret); + goto err_event; } + ret = orb_handle_init(&loop->exit_handle, fd, POLLIN, loop, + NULL, NULL, NULL, NULL); + if (ret < 0) + { + uorberr("loop init eventfd handle init failed! ret:%d", ret); + goto err_init; + } + + ret = orb_handle_start(loop, &loop->exit_handle); + if (ret < 0) + { + uorberr("loop init eventfd handle start failed! ret:%d", ret); + goto err_init; + } + + return ret; + +err_init: + close(fd); +err_event: + orb_loop_deinit(loop); return ret; } int orb_loop_run(FAR struct orb_loop_s *loop) { + loop->self = gettid(); return loop->ops->run(loop); } int orb_loop_deinit(FAR struct orb_loop_s *loop) { + eventfd_t exit = 1; int ret; + loop->running = false; + write(loop->exit_handle.fd, &exit, sizeof(exit)); + + if (gettid() != loop->self) + { + ret = waitpid(loop->self, &ret, 0); + if (ret < 0) + { + uorberr("loop deinit waitpid failed! ret:%d", -errno); + } + } + + close(loop->exit_handle.fd); ret = loop->ops->uninit(loop); if (ret >= 0) { diff --git a/system/uorb/uORB/uORB.h b/system/uorb/uORB/uORB.h index b1aa15ef292..fb6e172eaec 100644 --- a/system/uorb/uORB/uORB.h +++ b/system/uorb/uORB/uORB.h @@ -39,6 +39,15 @@ #include #include #include +#include + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#ifndef CONFIG_UORB_LOOP_MAX_EVENTS +# define CONFIG_UORB_LOOP_MAX_EVENTS 0 +#endif /**************************************************************************** * Public Types @@ -94,14 +103,6 @@ enum orb_loop_type_e ORB_EPOLL_TYPE = 0, }; -struct orb_loop_ops_s; -struct orb_loop_s -{ - FAR const struct orb_loop_ops_s *ops; /* Loop handle ops. */ - bool running; /* uORB loop is running flag. */ - int fd; /* Loop fd. */ -}; - struct orb_handle_s { int events; /* Events of interest. */ @@ -112,6 +113,16 @@ struct orb_handle_s orb_eventpri_cb_t eventpri_cb; /* User EPOLLPRI callback funtion. */ orb_eventerr_cb_t eventerr_cb; /* User EPOLLERR callback funtion. */ }; + +struct orb_loop_ops_s; +struct orb_loop_s +{ + FAR const struct orb_loop_ops_s *ops; /* Loop handle ops. */ + bool running; /* uORB loop is running flag. */ + int fd; /* Loop fd. */ + struct orb_handle_s exit_handle; /* The exit handle */ + pid_t self; /* The pid of the loop */ +}; #endif /**************************************************************************** From 3b0181dbd036f4115af6a8e047609a1217999618 Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Thu, 24 Apr 2025 20:33:43 +0800 Subject: [PATCH 265/391] system/uORB: Fix orb_loop_s undeclared error /workspace/apps/system/uorb/uORB/internal.h:42:31: error: 'struct orb_loop_s' declared inside parameter list will not be visible outside of this definition or declaration Signed-off-by: wangjianyu3 --- system/uorb/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/system/uorb/CMakeLists.txt b/system/uorb/CMakeLists.txt index 18656add337..18a510feb71 100644 --- a/system/uorb/CMakeLists.txt +++ b/system/uorb/CMakeLists.txt @@ -29,7 +29,11 @@ if(CONFIG_UORB) nuttx_add_library(uorb STATIC) - file(GLOB_RECURSE CSRCS "sensor/*.c" "uORB/*.c") + file(GLOB_RECURSE CSRCS "sensor/*.c" "uORB/uORB.c") + + if(CONFIG_UORB_LOOP_MAX_EVENTS) + file(GLOB_RECURSE CSRCS "uORB/loop.c" "uORB/epoll.c") + endif() if(CONFIG_UORB_LISTENER) nuttx_add_application( From f14249d1d341fb1345e74b257bdea636a1777996 Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Wed, 16 Apr 2025 21:10:50 +0800 Subject: [PATCH 266/391] system/uORB: Add API for sending loop exit event Add orb_loop_exit_async() API to send exit event to uORB loop. Closing immediately after a write may cause missing a wakeup. When all file descriptors associated with the same eventfd object have been closed, the resources for object are freed by the kernel. --EVENTFD(2) Signed-off-by: wangjianyu3 --- system/uorb/uORB/epoll.c | 14 +++++--------- system/uorb/uORB/loop.c | 34 ++++++++++++++++++++-------------- system/uorb/uORB/uORB.h | 17 +++++++++++++++-- 3 files changed, 40 insertions(+), 25 deletions(-) diff --git a/system/uorb/uORB/epoll.c b/system/uorb/uORB/epoll.c index 28237acc8b9..147831d3f60 100644 --- a/system/uorb/uORB/epoll.c +++ b/system/uorb/uORB/epoll.c @@ -58,7 +58,6 @@ const struct orb_loop_ops_s g_orb_loop_epoll_ops = static int orb_loop_epoll_init(FAR struct orb_loop_s *loop) { - loop->running = false; loop->fd = epoll_create1(EPOLL_CLOEXEC); if (loop->fd < 0) { @@ -75,13 +74,7 @@ static int orb_loop_epoll_run(FAR struct orb_loop_s *loop) int nfds; int i; - if (loop->running) - { - return -EBUSY; - } - - loop->running = true; - while (loop->running) + while (1) { nfds = epoll_wait(loop->fd, et, CONFIG_UORB_LOOP_MAX_EVENTS, -1); if (nfds == -1 && errno != EINTR) @@ -96,6 +89,10 @@ static int orb_loop_epoll_run(FAR struct orb_loop_s *loop) { continue; } + else if (handle == &loop->exit_handle) + { + return OK; + } if (et[i].events & EPOLLIN) { @@ -151,7 +148,6 @@ static int orb_loop_epoll_uninit(FAR struct orb_loop_s *loop) { int ret; - loop->running = false; ret = close(loop->fd); if (ret < 0) { diff --git a/system/uorb/uORB/loop.c b/system/uorb/uORB/loop.c index 9d9bf994c51..01ea5f7534e 100644 --- a/system/uorb/uORB/loop.c +++ b/system/uorb/uORB/loop.c @@ -100,27 +100,14 @@ int orb_loop_init(FAR struct orb_loop_s *loop, enum orb_loop_type_e type) int orb_loop_run(FAR struct orb_loop_s *loop) { - loop->self = gettid(); return loop->ops->run(loop); } int orb_loop_deinit(FAR struct orb_loop_s *loop) { - eventfd_t exit = 1; int ret; - loop->running = false; - write(loop->exit_handle.fd, &exit, sizeof(exit)); - - if (gettid() != loop->self) - { - ret = waitpid(loop->self, &ret, 0); - if (ret < 0) - { - uorberr("loop deinit waitpid failed! ret:%d", -errno); - } - } - + orb_handle_stop(loop, &loop->exit_handle); close(loop->exit_handle.fd); ret = loop->ops->uninit(loop); if (ret >= 0) @@ -131,6 +118,25 @@ int orb_loop_deinit(FAR struct orb_loop_s *loop) return ret; } +int orb_loop_exit_async(FAR struct orb_loop_s *loop) +{ + eventfd_t exit = 1; + ssize_t n; + + if (!loop) + { + return -EINVAL; + } + + n = write(loop->exit_handle.fd, &exit, sizeof(exit)); + if (n < 0) + { + return -errno; + } + + return n == sizeof(exit) ? OK : ERROR; +} + int orb_handle_init(FAR struct orb_handle_s *handle, int fd, int events, FAR void *arg, orb_datain_cb_t datain_cb, orb_dataout_cb_t dataout_cb, orb_eventpri_cb_t pri_cb, diff --git a/system/uorb/uORB/uORB.h b/system/uorb/uORB/uORB.h index fb6e172eaec..5e0bc6c67b1 100644 --- a/system/uorb/uORB/uORB.h +++ b/system/uorb/uORB/uORB.h @@ -118,10 +118,8 @@ struct orb_loop_ops_s; struct orb_loop_s { FAR const struct orb_loop_ops_s *ops; /* Loop handle ops. */ - bool running; /* uORB loop is running flag. */ int fd; /* Loop fd. */ struct orb_handle_s exit_handle; /* The exit handle */ - pid_t self; /* The pid of the loop */ }; #endif @@ -959,6 +957,21 @@ int orb_loop_run(FAR struct orb_loop_s *loop); int orb_loop_deinit(FAR struct orb_loop_s *loop); +/**************************************************************************** + * Name: orb_loop_exit_async + * + * Description: + * Send exit event to the current loop(not wait). + * + * Input Parameters: + * loop orb loop contains multiple handles. + * + * Returned Value: + * Zero (OK) on success; a -1 (ERROR) or negated errno value on failure. + ****************************************************************************/ + +int orb_loop_exit_async(FAR struct orb_loop_s *loop); + /**************************************************************************** * Name: orb_handle_init * From a011cad584411c64083c3db033334d0eca156e12 Mon Sep 17 00:00:00 2001 From: Jukka Laitinen Date: Fri, 2 May 2025 08:03:29 +0300 Subject: [PATCH 267/391] testing/ostest/signest: Replace kill with pthread_kill to fix running in SMP "kill" sends the signal to all the the threads in the group. The intention of the test is to send signals only to the "waiter" thread. Running signal actions in parallel is not compatible behaviour with the signest test, which assumes that signals are being run one after another. For example running signals 38 and 40 in parallel on two threads/two cpus would cause the test incorrectly fail on "even signals nested". Signed-off-by: Jukka Laitinen --- testing/ostest/signest.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/testing/ostest/signest.c b/testing/ostest/signest.c index 7b0378849d4..1e82e8ea64c 100644 --- a/testing/ostest/signest.c +++ b/testing/ostest/signest.c @@ -328,13 +328,13 @@ void signest_test(void) { if (signest_catchable(j)) { - kill(waiterpid, j); + pthread_kill(waiterpid, j); odd_signals++; } if (signest_catchable(j + 1)) { - kill(waiterpid, j + 1); + pthread_kill(waiterpid, j + 1); even_signals++; } @@ -344,13 +344,13 @@ void signest_test(void) if (signest_catchable(j + 1)) { - kill(waiterpid, j + 1); + pthread_kill(waiterpid, j + 1); even_signals++; } if (signest_catchable(j)) { - kill(waiterpid, j); + pthread_kill(waiterpid, j); odd_signals++; } @@ -387,13 +387,13 @@ void signest_test(void) if (signest_catchable(j)) { - kill(waiterpid, j); + pthread_kill(waiterpid, j); odd_signals++; } if (signest_catchable(j + 1)) { - kill(waiterpid, j + 1); + pthread_kill(waiterpid, j + 1); even_signals++; } @@ -407,13 +407,13 @@ void signest_test(void) if (signest_catchable(j + 1)) { - kill(waiterpid, j + 1); + pthread_kill(waiterpid, j + 1); even_signals++; } if (signest_catchable(j)) { - kill(waiterpid, j); + pthread_kill(waiterpid, j); odd_signals++; } @@ -449,7 +449,7 @@ void signest_test(void) if (signest_catchable(j)) { - kill(waiterpid, j); + pthread_kill(waiterpid, j); odd_signals++; } @@ -457,7 +457,7 @@ void signest_test(void) if (signest_catchable(j + 1)) { - kill(waiterpid, j + 1); + pthread_kill(waiterpid, j + 1); even_signals++; } @@ -470,7 +470,7 @@ void signest_test(void) sched_lock(); if (signest_catchable(j + 1)) { - kill(waiterpid, j + 1); + pthread_kill(waiterpid, j + 1); even_signals++; } @@ -478,7 +478,7 @@ void signest_test(void) if (signest_catchable(j)) { - kill(waiterpid, j); + pthread_kill(waiterpid, j); odd_signals++; } From 30ef8ff845b219220aa635660d570a673907e9e8 Mon Sep 17 00:00:00 2001 From: George Poulios Date: Sat, 3 May 2025 19:38:58 +0300 Subject: [PATCH 268/391] examples/optee: Introduce an OP-TEE client example Add an example app that opens a session with the devices pseudo-TA and enumerates the available devices (prints their UUIDs only). The example showcases: - opening the OP-TEE client driver - printing its version - opening a session - allocating shared memory - registering shared memory - invoking a function to the TA referencing the shared memory - closing the session Enabled with CONFIG_EXAMPLES_OPTEE. Signed-off-by: George Poulios --- examples/optee/CMakeLists.txt | 33 +++ examples/optee/Kconfig | 29 +++ examples/optee/Make.defs | 25 +++ examples/optee/Makefile | 34 +++ examples/optee/optee_main.c | 410 ++++++++++++++++++++++++++++++++++ 5 files changed, 531 insertions(+) create mode 100644 examples/optee/CMakeLists.txt create mode 100644 examples/optee/Kconfig create mode 100644 examples/optee/Make.defs create mode 100644 examples/optee/Makefile create mode 100644 examples/optee/optee_main.c diff --git a/examples/optee/CMakeLists.txt b/examples/optee/CMakeLists.txt new file mode 100644 index 00000000000..e843d671726 --- /dev/null +++ b/examples/optee/CMakeLists.txt @@ -0,0 +1,33 @@ +# ############################################################################## +# apps/examples/optee/CMakeLists.txt +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_EXAMPLES_OPTEE) + nuttx_add_application( + NAME + ${CONFIG_EXAMPLES_OPTEE_PROGNAME} + SRCS + optee_main.c + STACKSIZE + ${CONFIG_EXAMPLES_OPTEE_STACKSIZE} + PRIORITY + ${CONFIG_EXAMPLES_OPTEE_PRIORITY}) +endif() diff --git a/examples/optee/Kconfig b/examples/optee/Kconfig new file mode 100644 index 00000000000..9e91beff6e5 --- /dev/null +++ b/examples/optee/Kconfig @@ -0,0 +1,29 @@ +# +# For a description of the syntax of this configuration file, +# see the file kconfig-language.txt in the NuttX tools repository. +# + +config EXAMPLES_OPTEE + tristate "OP-TEE client example" + default n + ---help--- + Enable the OP-TEE client example + +if EXAMPLES_OPTEE + +config EXAMPLES_OPTEE_PROGNAME + string "Program name" + default "optee" + ---help--- + This is the name of the program that will be used when the NSH ELF + program is installed. + +config EXAMPLES_OPTEE_PRIORITY + int "OP-TEE task priority" + default 100 + +config EXAMPLES_OPTEE_STACKSIZE + int "OP-TEE stack size" + default DEFAULT_TASK_STACKSIZE + +endif diff --git a/examples/optee/Make.defs b/examples/optee/Make.defs new file mode 100644 index 00000000000..8da4df36e05 --- /dev/null +++ b/examples/optee/Make.defs @@ -0,0 +1,25 @@ +############################################################################ +# apps/examples/optee/Make.defs +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +ifneq ($(CONFIG_EXAMPLES_OPTEE),) +CONFIGURED_APPS += $(APPDIR)/examples/optee +endif diff --git a/examples/optee/Makefile b/examples/optee/Makefile new file mode 100644 index 00000000000..f60644cd71e --- /dev/null +++ b/examples/optee/Makefile @@ -0,0 +1,34 @@ +############################################################################ +# apps/examples/optee/Makefile +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +include $(APPDIR)/Make.defs + +# OP-TEE client built-in application info + +PROGNAME = $(CONFIG_EXAMPLES_OPTEE_PROGNAME) +PRIORITY = $(CONFIG_EXAMPLES_OPTEE_PRIORITY) +STACKSIZE = $(CONFIG_EXAMPLES_OPTEE_STACKSIZE) +MODULE = $(CONFIG_EXAMPLES_OPTEE) + +MAINSRC = optee_main.c + +include $(APPDIR)/Application.mk diff --git a/examples/optee/optee_main.c b/examples/optee/optee_main.c new file mode 100644 index 00000000000..9fd474f5384 --- /dev/null +++ b/examples/optee/optee_main.c @@ -0,0 +1,410 @@ +/**************************************************************************** + * apps/examples/optee/optee_main.c + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/**************************************************************************** + * Pre-processor definitions + ****************************************************************************/ + +#define OPTEE_DEV "/dev/tee0" + +#define PTA_DEVICE_ENUM { 0x7011a688, 0xddde, 0x4053, \ + 0xa5, 0xa9, \ + { 0x7b, 0x3c, 0x4d, 0xdf, 0x13, 0xb8 } } + +#define PTA_CMD_GET_DEVICES 0x0 + +/**************************************************************************** + * Private Types + ****************************************************************************/ + +typedef struct tee_shm +{ + int fd; + size_t size; + void *ptr; + int32_t id; +} tee_shm_t; + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +static int tee_check_version_and_caps(int fd, uint32_t *caps) +{ + struct tee_ioctl_version_data ioc_ver; + int ret; + + ret = ioctl(fd, TEE_IOC_VERSION, (unsigned long)&ioc_ver); + if (ret < 0) + { + printf("Failed to query TEE driver version and caps: %d, %s\n", + ret, strerror(errno)); + return ret; + } + + if (ioc_ver.impl_id != TEE_IMPL_ID_OPTEE) + { + printf("Not an OP-TEE implementation\n"); + return -ENOTSUP; + } + + if (!(ioc_ver.impl_caps & TEE_OPTEE_CAP_TZ)) + { + printf("OP-TEE TrustZone not supported\n"); + return -ENOTSUP; + } + + if (((TEE_GEN_CAP_GP | TEE_GEN_CAP_MEMREF_NULL) & ioc_ver.gen_caps) != + (TEE_GEN_CAP_GP | TEE_GEN_CAP_MEMREF_NULL)) + { + printf("CAP_GP or MEMREF_NULL not supported\n"); + return -ENOTSUP; + } + + printf("impl id: %u, impl caps: %u, gen caps: %u\n", + ioc_ver.impl_id, ioc_ver.impl_caps, ioc_ver.gen_caps); + + if (caps) + { + *caps = ioc_ver.gen_caps; + } + + return ret; +} + +static int tee_open_session(int fd, const uuid_t *uuid, uint32_t *session) +{ + struct tee_ioctl_open_session_arg ioc_opn; + struct tee_ioctl_buf_data ioc_buf; + int ret; + + memset(&ioc_opn, 0, sizeof(struct tee_ioctl_open_session_arg)); + + uuid_enc_be(&ioc_opn.uuid, uuid); + + ioc_buf.buf_ptr = (uintptr_t)&ioc_opn; + ioc_buf.buf_len = sizeof(struct tee_ioctl_open_session_arg); + + ret = ioctl(fd, TEE_IOC_OPEN_SESSION, (unsigned long)&ioc_buf); + if (ret < 0) + { + return ret; + } + + if (session) + { + *session = ioc_opn.session; + } + + return ret; +} + +static int tee_invoke(int fd, uint32_t session, uint32_t func, + struct tee_ioctl_param *params, size_t num_params) +{ + struct tee_ioctl_invoke_arg *ioc_args; + struct tee_ioctl_buf_data ioc_buf; + size_t ioc_args_len; + int ret; + + ioc_args_len = sizeof(struct tee_ioctl_invoke_arg) + + TEE_IOCTL_PARAM_SIZE(num_params); + + ioc_args = (struct tee_ioctl_invoke_arg *)calloc(1, ioc_args_len); + if (!ioc_args) + { + return -ENOMEM; + } + + ioc_args->func = func; + ioc_args->session = session; + ioc_args->num_params = num_params; + memcpy(&ioc_args->params, params, TEE_IOCTL_PARAM_SIZE(num_params)); + + ioc_buf.buf_ptr = (uintptr_t)ioc_args; + ioc_buf.buf_len = ioc_args_len; + + ret = ioctl(fd, TEE_IOC_INVOKE, (unsigned long)&ioc_buf); + if (ret < 0) + { + goto err_with_args; + } + + memcpy(params, &ioc_args->params, TEE_IOCTL_PARAM_SIZE(num_params)); + +err_with_args: + free(ioc_args); + + return ret; +} + +static int tee_shm_register(int fd, tee_shm_t *shm) +{ + struct tee_ioctl_shm_register_data ioc_reg; + + memset(&ioc_reg, 0, sizeof(struct tee_ioctl_shm_register_data)); + + if (!shm) + { + return -EINVAL; + } + + shm->id = (int32_t)(uintptr_t)shm->ptr; + + ioc_reg.addr = (uintptr_t)shm->ptr; + ioc_reg.length = shm->size; + ioc_reg.flags = TEE_SHM_REGISTER | TEE_SHM_SEC_REGISTER; + ioc_reg.id = shm->id; + + return ioctl(fd, TEE_IOC_SHM_REGISTER, (unsigned long)&ioc_reg); +} + +#if 0 /* Not used */ +static int tee_shm_mmap(int fd, tee_shm_t *shm, bool reg) +{ + struct tee_ioctl_shm_alloc_data ioc_alloc; + int ret = 0; + + memset(&ioc_alloc, 0, sizeof(struct tee_ioctl_shm_alloc_data)); + + if (!shm) + { + return -EINVAL; + } + + ioc_alloc.size = shm->size; + + shm->fd = ioctl(fd, TEE_IOC_SHM_ALLOC, (unsigned long)&ioc_alloc); + if (shm->fd < 0) + { + return shm->fd; + } + + shm->ptr = mmap(NULL, shm->size, PROT_READ | PROT_WRITE, MAP_SHARED, + shm->fd, 0); + if (shm->ptr == MAP_FAILED) + { + close(shm->fd); + return -ENOMEM; + } + + if (reg) + { + ret = tee_shm_register(fd, shm); + if (ret < 0) + { + munmap(shm->ptr, shm->size); + close(shm->fd); + return ret; + } + } + + return ret; +} +#endif + +static int tee_shm_alloc(int fd, tee_shm_t *shm, bool reg) +{ + int ret = 0; + + if (!shm) + { + return -EINVAL; + } + + shm->ptr = malloc(shm->size); + if (!shm->ptr) + { + return -ENOMEM; + } + + shm->fd = -1; + + if (reg) + { + ret = tee_shm_register(fd, shm); + if (ret < 0) + { + free(shm->ptr); + } + } + + return ret; +} + +static void tee_shm_free(tee_shm_t *shm) +{ + if (!shm) + { + return; + } + + if (shm->fd > 0) + { + /* Allocated via tee_shm_mmap() */ + + munmap(shm->ptr, shm->size); + close(shm->fd); + } + else + { + /* Allocated via tee_shm_alloc() */ + + free(shm->ptr); + } + + shm->ptr = NULL; + shm->fd = -1; +} + +static int tee_close_session(int fd, uint32_t session) +{ + struct tee_ioctl_close_session_arg ioc_close; + int ret; + + ioc_close.session = session; + + ret = ioctl(fd, TEE_IOC_CLOSE_SESSION, (unsigned long)&ioc_close); + + return ret; +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * optee_main + ****************************************************************************/ + +int main(int argc, FAR char *argv[]) +{ + int fd; + uint32_t caps; + const uuid_t pta_dvc_uuid = PTA_DEVICE_ENUM; + uint32_t session; + struct tee_ioctl_param par0; + tee_shm_t shm; + unsigned int count; + const uuid_t *raw_ta_uuid; + uuid_t ta_uuid; + char *ta_uuid_s; + int ret; + + memset(&par0, 0, sizeof(struct tee_ioctl_param)); + memset(&shm, 0, sizeof(tee_shm_t)); + + fd = open(OPTEE_DEV, O_RDONLY | O_NONBLOCK); + if (fd < 0) + { + printf("Failed to open " OPTEE_DEV ": %s\n", strerror(errno)); + return -errno; + } + + ret = tee_check_version_and_caps(fd, &caps); + if (ret < 0) + { + goto err; + } + + ret = tee_open_session(fd, &pta_dvc_uuid, &session); + if (ret < 0) + { + printf("Failed to open session with devices.pta: %d, %s\n", + ret, strerror(errno)); + goto err; + } + + par0.attr = TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_OUTPUT; + + ret = tee_invoke(fd, session, PTA_CMD_GET_DEVICES, &par0, 1); + if (ret < 0) + { + printf("Failed to get size needed for device enumeration: %d, %s\n", + ret, strerror(errno)); + goto err_with_session; + } + + shm.size = par0.b; + + ret = tee_shm_alloc(fd, &shm, caps & TEE_GEN_CAP_REG_MEM); + if (ret < 0) + { + printf("Failed to allocate shared memory: %d, %s\n", + ret, strerror(errno)); + goto err_with_session; + } + + par0.attr = TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_OUTPUT; + par0.a = 0; + par0.b = shm.size; + par0.c = (uintptr_t)shm.ptr; + + ret = tee_invoke(fd, session, PTA_CMD_GET_DEVICES, &par0, 1); + if (ret < 0) + { + printf("Failed to enumerate devices: %d, %s\n", ret, strerror(errno)); + goto err_with_shm; + } + + printf("Available devices:\n"); + + count = par0.b / sizeof(uuid_t); + raw_ta_uuid = (uuid_t *)shm.ptr; + + while (count--) + { + uuid_dec_be(raw_ta_uuid, &ta_uuid); + uuid_to_string(&ta_uuid, &ta_uuid_s, NULL); + + printf(" %s\n", ta_uuid_s); + + free(ta_uuid_s); + raw_ta_uuid++; + } + +err_with_shm: + tee_shm_free(&shm); + +err_with_session: + tee_close_session(fd, session); + +err: + close(fd); + + return ret; +} From 77b2e8dfeeada4184dfd2f081ee26a65632f86c3 Mon Sep 17 00:00:00 2001 From: vrmay23 Date: Sun, 27 Apr 2025 18:52:14 +0200 Subject: [PATCH 269/391] examples/posix_stdio: New example dedicated to posix stdio library. This example will help newcomers to port software from Linux to NuttX in a POSIX compliant fashion using stdio library. It shows how to work with open(), close() and write() functions over /dev/console. Signed-off-by: Vinicius May --- examples/posix_stdio/CMakeLists.txt | 35 ++++++++++ examples/posix_stdio/Kconfig | 20 ++++++ examples/posix_stdio/Make.defs | 25 +++++++ examples/posix_stdio/Makefile | 32 +++++++++ examples/posix_stdio/posix_stdio.c | 100 ++++++++++++++++++++++++++++ 5 files changed, 212 insertions(+) create mode 100644 examples/posix_stdio/CMakeLists.txt create mode 100644 examples/posix_stdio/Kconfig create mode 100644 examples/posix_stdio/Make.defs create mode 100644 examples/posix_stdio/Makefile create mode 100644 examples/posix_stdio/posix_stdio.c diff --git a/examples/posix_stdio/CMakeLists.txt b/examples/posix_stdio/CMakeLists.txt new file mode 100644 index 00000000000..e10cb599287 --- /dev/null +++ b/examples/posix_stdio/CMakeLists.txt @@ -0,0 +1,35 @@ +# ############################################################################## +# apps/examples/posix_stdio/CMakeLists.txt +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_EXAMPLES_POSIX_STDIO) + nuttx_add_application( + NAME + ${CONFIG_EXAMPLES_POSIX_STDIO_PROGNAME} + PRIORITY + ${CONFIG_EXAMPLES_POSIX_STDIO_PRIORITY} + STACKSIZE + ${CONFIG_EXAMPLES_POSIX_STDIO_STACKSIZE} + MODULE + ${CONFIG_EXAMPLES_POSIX_STDIO} + SRCS + posix_stdio.c) +endif() diff --git a/examples/posix_stdio/Kconfig b/examples/posix_stdio/Kconfig new file mode 100644 index 00000000000..3c41e975f28 --- /dev/null +++ b/examples/posix_stdio/Kconfig @@ -0,0 +1,20 @@ +# +# For a description of the syntax of this configuration file, +# see the file kconfig-language.txt in the NuttX tools repository. +# + +config EXAMPLES_POSIX_STDIO + bool "Posix stdio example" + default n + ---help--- + Enable POSIX stdio example that shows how to use open(), write() and close() via /dev/console. + +config EXAMPLES_POSIX_STDIO_PROGNAME + string "Program name" + default "posix_stdio" + depends on EXAMPLES_POSIX_STDIO + +config EXAMPLES_POSIX_STDIO_PRIORITY + int "POSIX_STDIO test priority" + default 100 + depends on EXAMPLES_POSIX_STDIO diff --git a/examples/posix_stdio/Make.defs b/examples/posix_stdio/Make.defs new file mode 100644 index 00000000000..72d9594a41e --- /dev/null +++ b/examples/posix_stdio/Make.defs @@ -0,0 +1,25 @@ +############################################################################ +# apps/examples/posix_stdio/Make.defs +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +ifneq ($(CONFIG_EXAMPLES_POSIX_STDIO),) +CONFIGURED_APPS += $(APPDIR)/examples/posix_stdio +endif diff --git a/examples/posix_stdio/Makefile b/examples/posix_stdio/Makefile new file mode 100644 index 00000000000..53717613319 --- /dev/null +++ b/examples/posix_stdio/Makefile @@ -0,0 +1,32 @@ +############################################################################ +# apps/examples/posix_stdio/Makefile +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +include $(APPDIR)/Make.defs + +PROGNAME = $(CONFIG_EXAMPLES_POSIX_STDIO_PROGNAME) +PRIORITY = $(CONFIG_EXAMPLES_POSIX_STDIO_PRIORITY) +STACKSIZE = $(CONFIG_EXAMPLES_POSIX_STDIO_STACKSIZE) +MODULE = $(CONFIG_EXAMPLES_POSIX_STDIO) + +MAINSRC = posix_stdio.c + +include $(APPDIR)/Application.mk diff --git a/examples/posix_stdio/posix_stdio.c b/examples/posix_stdio/posix_stdio.c new file mode 100644 index 00000000000..722f088ca99 --- /dev/null +++ b/examples/posix_stdio/posix_stdio.c @@ -0,0 +1,100 @@ +/**************************************************************************** + * apps/examples/posix_stdio/posix_stdio.c + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * This is a single POSIX example that works for both Nuttx and Linux distros + * (with minimal changes). By this example its possible to learn how to use + * posix style and also works with onpen(), close() and write() functions. + * + * For linux, need to change the headers and the output device + * A) Headers: + * #include + * #include + * #include + * #include + * + * B) output: + * /dev/tty + * + * To compile it on Linux, you can simple use gcc: + * gcc posix_stdio.c -o posix_stdio + * + * To run, just send the following command: ./posix_stdio + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +#include +#include +#include +#include + +/**************************************************************************** + * Pre-processor Definitions + * *************************************************************************/ + +/* define how many times the message will be printed in the console */ + +#ifndef PRINT_N_TIMES +# define PRINT_N_TIMES 10 +#endif + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +static void print_message(int fd) +{ + const char *message = "Hello, NuttX users, welcome!!!\n"; + + write(fd, message, strlen(message)); +} + +/**************************************************************************** + * hello_nuttx_main + ****************************************************************************/ + +int main(int argc, char *argv[]) +{ + int counter; + int fd = open("/dev/console", O_WRONLY); + + if (fd < 0) + { + fprintf(stderr, "Failed to open console\n"); + return 1; + } + + for (counter = 0; counter < PRINT_N_TIMES; counter++) + { + print_message(fd); + } + + close(fd); + return 0; +} + From 376cc5a731d9b43a34dd619fece8c49015238fd1 Mon Sep 17 00:00:00 2001 From: Jukka Laitinen Date: Wed, 7 May 2025 10:29:11 +0300 Subject: [PATCH 270/391] testing/ostest: Add checking of signal delivery TID to signest test - Add another signal action, "interfere_action", and signal the interfere thread - In both signal action functions (waiter and interfere), check that they get executed in correct thread's context Signed-off-by: Jukka Laitinen --- testing/ostest/signest.c | 91 +++++++++++++++++++++++++++------------- 1 file changed, 62 insertions(+), 29 deletions(-) diff --git a/testing/ostest/signest.c b/testing/ostest/signest.c index 1e82e8ea64c..5e8e6596140 100644 --- a/testing/ostest/signest.c +++ b/testing/ostest/signest.c @@ -52,6 +52,8 @@ * Private Data ****************************************************************************/ +static pthread_t g_waiterpid; +static pthread_t g_interferepid; static sem_t g_waiter_sem; static sem_t g_interferer_sem; static sem_t g_sem_thread_started; @@ -90,10 +92,29 @@ static bool signest_catchable(int signo) return true; } +static void interfere_action(int signo) +{ + pthread_t pid = pthread_self(); + if (pid != g_interferepid) + { + printf("interfere_action: Delivered to wrong TID %d, expected %d\n", + pid, g_interferepid); + ASSERT(false); + } +} + static void waiter_action(int signo) { int nest_level; + pthread_t pid = pthread_self(); + if (pid != g_waiterpid) + { + printf("waiter_action: Delivered to wrong TID %d, expected %d\n", + pid, g_waiterpid); + ASSERT(false); + } + sched_lock(); nest_level = g_nest_level++; @@ -145,7 +166,7 @@ static FAR void *waiter_main(FAR void *arg) act.sa_flags = 0; sigemptyset(&act.sa_mask); - for (i = 1; i <= MAX_SIGNO; i += 2) + for (i = 1; i <= MAX_SIGNO - 1; i += 2) { if (signest_catchable(i)) { @@ -153,7 +174,7 @@ static FAR void *waiter_main(FAR void *arg) } } - for (i = 1; i <= MAX_SIGNO; i++) + for (i = 1; i <= MAX_SIGNO - 1; i++) { if (signest_catchable(i)) { @@ -167,6 +188,11 @@ static FAR void *waiter_main(FAR void *arg) } } + act.sa_handler = interfere_action; + act.sa_flags = 0; + sigemptyset(&act.sa_mask); + sigaction(MAX_SIGNO, &act, NULL); + /* Now just loop until the test completes */ printf("waiter_main: Waiting on semaphore\n"); @@ -242,8 +268,6 @@ void signest_test(void) { struct sched_param param; pthread_attr_t attr; - pid_t waiterpid; - pid_t interferepid; int total_signals; int total_handled; int total_nested; @@ -287,7 +311,7 @@ void signest_test(void) pthread_attr_init(&attr); pthread_attr_setschedparam(&attr, ¶m); pthread_attr_setstacksize(&attr, STACKSIZE); - ret = pthread_create(&waiterpid, &attr, waiter_main, NULL); + ret = pthread_create(&g_waiterpid, &attr, waiter_main, NULL); if (ret != 0) { printf("signest_test: ERROR failed to start waiter_main\n"); @@ -295,7 +319,7 @@ void signest_test(void) return; } - printf("signest_test: Started waiter_main pid=%d\n", waiterpid); + printf("signest_test: Started waiter_main pid=%d\n", g_waiterpid); /* Start interfering thread */ @@ -303,7 +327,7 @@ void signest_test(void) printf("signest_test: Starting interfering task at priority %d\n", param.sched_priority); pthread_attr_setschedparam(&attr, ¶m); - ret = pthread_create(&interferepid, &attr, interfere_main, NULL); + ret = pthread_create(&g_interferepid, &attr, interfere_main, NULL); if (ret != 0) { printf("signest_test: ERROR failed to start interfere_main\n"); @@ -311,7 +335,7 @@ void signest_test(void) goto errout_with_waiter; } - printf("signest_test: Started interfere_main pid=%d\n", interferepid); + printf("signest_test: Started interfere_main pid=%d\n", g_interferepid); /* Wait a bit */ @@ -324,37 +348,37 @@ void signest_test(void) for (i = 0; i < 10; i++) { - for (j = 1; j + 1 <= MAX_SIGNO; j += 2) + for (j = 1; j + 1 <= MAX_SIGNO - 1; j += 2) { if (signest_catchable(j)) { - pthread_kill(waiterpid, j); + pthread_kill(g_waiterpid, j); odd_signals++; } if (signest_catchable(j + 1)) { - pthread_kill(waiterpid, j + 1); + pthread_kill(g_waiterpid, j + 1); even_signals++; } - wait_finish(waiterpid, j); + wait_finish(g_waiterpid, j); /* Even then odd */ if (signest_catchable(j + 1)) { - pthread_kill(waiterpid, j + 1); + pthread_kill(g_waiterpid, j + 1); even_signals++; } if (signest_catchable(j)) { - pthread_kill(waiterpid, j); + pthread_kill(g_waiterpid, j); odd_signals++; } - wait_finish(waiterpid, j); + wait_finish(g_waiterpid, j); } } @@ -379,7 +403,7 @@ void signest_test(void) for (i = 0; i < 10; i++) { - for (j = 1; j + 1 <= MAX_SIGNO; j += 2) + for (j = 1; j + 1 <= MAX_SIGNO - 1; j += 2) { /* Odd then even */ @@ -387,19 +411,19 @@ void signest_test(void) if (signest_catchable(j)) { - pthread_kill(waiterpid, j); + pthread_kill(g_waiterpid, j); odd_signals++; } if (signest_catchable(j + 1)) { - pthread_kill(waiterpid, j + 1); + pthread_kill(g_waiterpid, j + 1); even_signals++; } sched_unlock(); - wait_finish(waiterpid, j); + wait_finish(g_waiterpid, j); /* Even then odd */ @@ -407,19 +431,19 @@ void signest_test(void) if (signest_catchable(j + 1)) { - pthread_kill(waiterpid, j + 1); + pthread_kill(g_waiterpid, j + 1); even_signals++; } if (signest_catchable(j)) { - pthread_kill(waiterpid, j); + pthread_kill(g_waiterpid, j); odd_signals++; } sched_unlock(); - wait_finish(waiterpid, j); + wait_finish(g_waiterpid, j); } } @@ -441,15 +465,17 @@ void signest_test(void) for (i = 0; i < 10; i++) { - for (j = 1; j + 1 <= MAX_SIGNO; j += 2) + for (j = 1; j + 1 <= MAX_SIGNO - 1; j += 2) { /* Odd then even */ sched_lock(); + pthread_kill(g_interferepid, MAX_SIGNO); + if (signest_catchable(j)) { - pthread_kill(waiterpid, j); + pthread_kill(g_waiterpid, j); odd_signals++; } @@ -457,20 +483,20 @@ void signest_test(void) if (signest_catchable(j + 1)) { - pthread_kill(waiterpid, j + 1); + pthread_kill(g_waiterpid, j + 1); even_signals++; } sched_unlock(); - wait_finish(waiterpid, j); + wait_finish(g_waiterpid, j); /* Even then odd */ sched_lock(); if (signest_catchable(j + 1)) { - pthread_kill(waiterpid, j + 1); + pthread_kill(g_waiterpid, j + 1); even_signals++; } @@ -478,13 +504,13 @@ void signest_test(void) if (signest_catchable(j)) { - pthread_kill(waiterpid, j); + pthread_kill(g_waiterpid, j); odd_signals++; } sched_unlock(); - wait_finish(waiterpid, j); + wait_finish(g_waiterpid, j); } } @@ -556,6 +582,13 @@ void signest_test(void) ASSERT(false); } + /* Unregister signal handlers */ + + for (i = 1; i <= MAX_SIGNO; i++) + { + signal(i, SIG_DFL); + } + sem_destroy(&g_waiter_sem); sem_destroy(&g_interferer_sem); sem_destroy(&g_sem_thread_started); From d63bb6d81dc88ab50ce0fb8e6ee20a6bd08faebf Mon Sep 17 00:00:00 2001 From: Tiago Medicci Date: Fri, 9 May 2025 17:15:50 -0300 Subject: [PATCH 271/391] interpreters/python: Do not link to standard libraries This commit prevents Python from linking to standard libraries. This is needed because Python's `configure` script tests for a set of available functions that are provided by NuttX (instead of the toolchain) and not having `-nostdlib` set may give wrong results. --- interpreters/python/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interpreters/python/Makefile b/interpreters/python/Makefile index af5c8b89f6a..295a4bb61dd 100644 --- a/interpreters/python/Makefile +++ b/interpreters/python/Makefile @@ -56,7 +56,7 @@ CFLAGS += -Wno-shadow -Wno-undef -Wno-format -Wno-builtin-macro-redefined CFLAGS += -Wno-type-limits -Wno-implicit-fallthrough -Wno-char-subscripts CFLAGS += -Wno-sign-compare -Wno-unused-const-variable -Wno-unused-function CFLAGS += -Wno-unused-variable -Wno-overflow -Wno-unused-but-set-variable -CFLAGS += -Wno-strict-prototypes +CFLAGS += -Wno-strict-prototypes -nostdlib DEPPATH += --dep-path $(CPYTHON_UNPACKNAME)$(DELIM)Programs VPATH += :$(CPYTHON_UNPACKNAME)$(DELIM)Programs From 0fbeae7f0d275ca314660bef9be032ea8101383c Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Fri, 9 May 2025 16:39:21 +0800 Subject: [PATCH 272/391] uORB/sensor: Add timestamp for GNSS data Add timestamp for GNSS measurements and clock, for matching. When recovering the combination of `GnssMeasurement` and `GnssClock` into [GnssData](https://android.googlesource.com/platform/hardware/libhardware/+/ refs/heads/android14-release/include/hardware/gps.h#1748), the reason for splitting is that the uORB buffer is not large enough to accommodate `GnssData`, since different topics cannot guarantee the same timing when publishing and subscribing data, we need an index to match. WARNING: A new member "timestamp" of type uint64_t has been added at the beginning of the struct "sensor_gnss_measurement" and "sensor_gnss_clock". Signed-off-by: wangjianyu3 --- system/uorb/sensor/gnss.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/system/uorb/sensor/gnss.c b/system/uorb/sensor/gnss.c index 6c483ada702..cf6b0003a15 100644 --- a/system/uorb/sensor/gnss.c +++ b/system/uorb/sensor/gnss.c @@ -57,6 +57,7 @@ static const char sensor_gnss_format[] = UORB_DEBUG_FORMAT_SENSOR_GNSS ",firmware_version:%" PRIu32 ""; static const char sensor_gnss_clock_format[] = + "timestamp:%" PRIu64 "," "flags:%" PRIx32 ",leap_second:%" PRId32 ",time_ns:%" PRId64 "," "time_uncertainty_ns:%hf,hw_clock_discontinuity_count:%" PRIu32 "," "full_bias_ns:%" PRId64 ",bias_ns:%hf,bias_uncertainty_ns:%hf," @@ -68,6 +69,7 @@ static const char sensor_gnss_geofence_event_format[] = "timestamp:%" PRId64 ",status:%" PRId32 ",transition:%" PRId32 ""; static const char sensor_gnss_measurement_format[] = + "timestamp:%" PRIu64 "," "flags:%" PRIx32 ",svid:%" PRId32 ",constellation:%" PRIu32 "," "time_offset_ns:%hf,received_sv_time_in_ns:%" PRId64 "," "received_sv_time_uncertainty_in_ns:%" PRId64 ",state:%" PRIu32 "," From 677089b9120967dac7ba77ddb5fd55d9bfde4bff Mon Sep 17 00:00:00 2001 From: George Poulios Date: Sun, 11 May 2025 00:02:52 +0300 Subject: [PATCH 273/391] examples/optee: Correct use of shm reg id and flags Previous version of optee example was using id during shm registration as input whereas it is an output variable. It was also specifying flags to dictate the behaviour whereas the latest implementation of the driver prohibits their use. This commit addresses those issues. Signed-off-by: George Poulios --- examples/optee/optee_main.c | 42 ++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/examples/optee/optee_main.c b/examples/optee/optee_main.c index 9fd474f5384..c089145d484 100644 --- a/examples/optee/optee_main.c +++ b/examples/optee/optee_main.c @@ -39,6 +39,16 @@ * Pre-processor definitions ****************************************************************************/ +#undef USE_ALLOC_IOC + +#ifdef USE_ALLOC_IOC +# define tee_shm_alloc tee_shm_mmap +# define tee_shm_free_buf(p, s) munmap(p, s) +#else +# define tee_shm_alloc tee_shm_malloc +# define tee_shm_free_buf(p, s) ((void)s, free(p)) +#endif + #define OPTEE_DEV "/dev/tee0" #define PTA_DEVICE_ENUM { 0x7011a688, 0xddde, 0x4053, \ @@ -183,17 +193,16 @@ static int tee_shm_register(int fd, tee_shm_t *shm) return -EINVAL; } - shm->id = (int32_t)(uintptr_t)shm->ptr; - ioc_reg.addr = (uintptr_t)shm->ptr; ioc_reg.length = shm->size; - ioc_reg.flags = TEE_SHM_REGISTER | TEE_SHM_SEC_REGISTER; - ioc_reg.id = shm->id; - return ioctl(fd, TEE_IOC_SHM_REGISTER, (unsigned long)&ioc_reg); + shm->fd = ioctl(fd, TEE_IOC_SHM_REGISTER, (unsigned long)&ioc_reg); + shm->id = ioc_reg.id; + + return shm->fd < 0 ? shm->fd : 0; } -#if 0 /* Not used */ +#ifdef USE_ALLOC_IOC static int tee_shm_mmap(int fd, tee_shm_t *shm, bool reg) { struct tee_ioctl_shm_alloc_data ioc_alloc; @@ -235,9 +244,9 @@ static int tee_shm_mmap(int fd, tee_shm_t *shm, bool reg) return ret; } -#endif -static int tee_shm_alloc(int fd, tee_shm_t *shm, bool reg) +#else /* !USE_ALLOC_IOC */ +static int tee_shm_malloc(int fd, tee_shm_t *shm, bool reg) { int ret = 0; @@ -265,6 +274,7 @@ static int tee_shm_alloc(int fd, tee_shm_t *shm, bool reg) return ret; } +#endif /* !USE_ALLOC_IOC */ static void tee_shm_free(tee_shm_t *shm) { @@ -273,18 +283,11 @@ static void tee_shm_free(tee_shm_t *shm) return; } - if (shm->fd > 0) - { - /* Allocated via tee_shm_mmap() */ + tee_shm_free_buf(shm->ptr, shm->size); - munmap(shm->ptr, shm->size); - close(shm->fd); - } - else + if (shm->fd >= 0) { - /* Allocated via tee_shm_alloc() */ - - free(shm->ptr); + close(shm->fd); } shm->ptr = NULL; @@ -350,6 +353,7 @@ int main(int argc, FAR char *argv[]) } par0.attr = TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_OUTPUT; + par0.c = TEE_MEMREF_NULL; ret = tee_invoke(fd, session, PTA_CMD_GET_DEVICES, &par0, 1); if (ret < 0) @@ -372,7 +376,7 @@ int main(int argc, FAR char *argv[]) par0.attr = TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_OUTPUT; par0.a = 0; par0.b = shm.size; - par0.c = (uintptr_t)shm.ptr; + par0.c = shm.id; ret = tee_invoke(fd, session, PTA_CMD_GET_DEVICES, &par0, 1); if (ret < 0) From 67db0af4eb4fb1efdae60c4b6667fcc438fbd6f5 Mon Sep 17 00:00:00 2001 From: George Poulios Date: Sun, 11 May 2025 02:01:02 +0300 Subject: [PATCH 274/391] tee/libteec: Add optee_client/libteec library Support for downloading, patching and linking against optee_client/libteec by NuttX apps. Defaults to version 4.6.0. Enabled with CONFIG_LIBTEEC. More info: - https://github.com/OP-TEE/optee_client - https://optee.readthedocs.io/en/latest/architecture/globalplatform_api.html#tee-client-api - https://globalplatform.org/specs-library/?filter-committee=tee (GPD_SPE_007) Signed-off-by: George Poulios --- tee/.gitignore | 1 + tee/CMakeLists.txt | 25 ++++++++++++ tee/Make.defs | 21 ++++++++++ tee/Makefile | 23 +++++++++++ tee/libteec/.gitignore | 3 ++ tee/libteec/0001-libteec-NuttX.patch | 47 ++++++++++++++++++++++ tee/libteec/CMakeLists.txt | 59 ++++++++++++++++++++++++++++ tee/libteec/Kconfig | 45 +++++++++++++++++++++ tee/libteec/Make.defs | 46 ++++++++++++++++++++++ tee/libteec/Makefile | 52 ++++++++++++++++++++++++ 10 files changed, 322 insertions(+) create mode 100644 tee/.gitignore create mode 100644 tee/CMakeLists.txt create mode 100644 tee/Make.defs create mode 100644 tee/Makefile create mode 100644 tee/libteec/.gitignore create mode 100644 tee/libteec/0001-libteec-NuttX.patch create mode 100644 tee/libteec/CMakeLists.txt create mode 100644 tee/libteec/Kconfig create mode 100644 tee/libteec/Make.defs create mode 100644 tee/libteec/Makefile diff --git a/tee/.gitignore b/tee/.gitignore new file mode 100644 index 00000000000..9e1d2593ee8 --- /dev/null +++ b/tee/.gitignore @@ -0,0 +1 @@ +/Kconfig diff --git a/tee/CMakeLists.txt b/tee/CMakeLists.txt new file mode 100644 index 00000000000..bfd5cacc51e --- /dev/null +++ b/tee/CMakeLists.txt @@ -0,0 +1,25 @@ +# ############################################################################## +# apps/tee/CMakeLists.txt +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +nuttx_add_subdirectory() + +nuttx_generate_kconfig(MENUDESC "TEE Libraries Support") diff --git a/tee/Make.defs b/tee/Make.defs new file mode 100644 index 00000000000..11499d5ed6c --- /dev/null +++ b/tee/Make.defs @@ -0,0 +1,21 @@ +############################################################################ +# apps/tee/Make.defs +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +include $(wildcard $(APPDIR)/tee/*/Make.defs) diff --git a/tee/Makefile b/tee/Makefile new file mode 100644 index 00000000000..1e41bb1e310 --- /dev/null +++ b/tee/Makefile @@ -0,0 +1,23 @@ +############################################################################ +# apps/tee/Makefile +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +MENUDESC = "TEE Libraries Support" + +include $(APPDIR)/Directory.mk diff --git a/tee/libteec/.gitignore b/tee/libteec/.gitignore new file mode 100644 index 00000000000..ea8e52b3a03 --- /dev/null +++ b/tee/libteec/.gitignore @@ -0,0 +1,3 @@ +/optee_client +/*.zip +/*.tar.gz diff --git a/tee/libteec/0001-libteec-NuttX.patch b/tee/libteec/0001-libteec-NuttX.patch new file mode 100644 index 00000000000..026a2e150ba --- /dev/null +++ b/tee/libteec/0001-libteec-NuttX.patch @@ -0,0 +1,47 @@ +From 70a12eb84a1276cad15bc2ac867ffad513d5c732 Mon Sep 17 00:00:00 2001 +From: George Poulios +Date: Sun, 11 May 2025 00:44:22 +0300 +Subject: [PATCH] libteec: NuttX patches + +Fix use of gettid() syscall in teec_trace.c and +replace include of linux/tee.h with nuttx/tee.h. + +Signed-off-by: George Poulios +--- + libteec/src/tee_client_api.c | 6 +++++- + libteec/src/teec_trace.c | 2 +- + 2 files changed, 6 insertions(+), 2 deletions(-) + +diff --git a/libteec/src/tee_client_api.c b/libteec/src/tee_client_api.c +index 512fdac..b54e0b6 100644 +--- a/libteec/src/tee_client_api.c ++++ b/libteec/src/tee_client_api.c +@@ -44,7 +44,11 @@ + #ifndef __aligned + #define __aligned(x) __attribute__((__aligned__(x))) + #endif +-#include ++#ifdef __NuttX__ ++# include ++#else ++# include ++#endif + + #define MIN(x, y) (((x) < (y)) ? (x) : (y)) + +diff --git a/libteec/src/teec_trace.c b/libteec/src/teec_trace.c +index 7194c8c..025cc4b 100644 +--- a/libteec/src/teec_trace.c ++++ b/libteec/src/teec_trace.c +@@ -75,7 +75,7 @@ void _dprintf(const char *function, int line, int level, const char *prefix, + va_list ap; + + if (function) { +- int thread_id = syscall(SYS_gettid); ++ int thread_id = (int)gettid(); + + n = snprintf(msg, sizeof(msg), "%s [%d] %s:%s:%d: ", + trace_level_strings[level], thread_id, prefix, +-- +2.34.1 + diff --git a/tee/libteec/CMakeLists.txt b/tee/libteec/CMakeLists.txt new file mode 100644 index 00000000000..d748d5ad3cb --- /dev/null +++ b/tee/libteec/CMakeLists.txt @@ -0,0 +1,59 @@ +# ############################################################################## +# apps/tee/libteec/CMakeLists.txt +# +# SPDX-License-Identifier: Apache-2.0 +# +# Copyright (C) 2023 Xiaomi Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_LIBTEEC) + + set(OPTEE_CLIENT_DIR ${CMAKE_CURRENT_LIST_DIR}/optee_client) + + if(NOT EXISTS ${OPTEE_CLIENT_DIR}) + FetchContent_Declare( + optee_client_fetch + URL https://github.com/OP-TEE/optee_client/archive/refs/tags/${CONFIG_LIBTEEC_VERSION}.tar.gz + SOURCE_DIR + ${OPTEE_CLIENT_DIR} + BINARY_DIR + ${CMAKE_BINARY_DIR}/tee/libteec/optee_client + PATCH_COMMAND patch -p1 -d ${OPTEE_CLIENT_DIR} < + ${CMAKE_CURRENT_LIST_DIR}/0001-libteec-NuttX.patch + DOWNLOAD_NO_PROGRESS true + TIMEOUT 30) + + FetchContent_GetProperties(optee_client_fetch) + + if(NOT optee_client_fetch_POPULATED) + FetchContent_Populate(optee_client_fetch) + endif() + endif() + + set_property( + TARGET nuttx + APPEND + PROPERTY NUTTX_INCLUDE_DIRECTORIES ${OPTEE_CLIENT_DIR}/libteec/include) + + nuttx_add_library(libteec STATIC) + + target_sources(libteec PRIVATE optee_client/libteec/src/tee_client_api.c + optee_client/libteec/src/teec_trace.c) + target_include_directories(libteec + PRIVATE ${OPTEE_CLIENT_DIR}/libteec/include) + target_compile_definitions(libteec PRIVATE BINARY_PREFIX=\"TEEC\") + +endif() diff --git a/tee/libteec/Kconfig b/tee/libteec/Kconfig new file mode 100644 index 00000000000..2c5f4c0d647 --- /dev/null +++ b/tee/libteec/Kconfig @@ -0,0 +1,45 @@ +############################################################################ +# apps/tee/libteec/Kconfig +# +# SPDX-License-Identifier: Apache-2.0 +# +# Copyright (C) 2023 Xiaomi Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +############################################################################ + +config LIBTEEC + bool "TEE client library (libteec)" + default n + ---help--- + Enable libteec from https://github.com/OP-TEE/optee_client. This + is OP-TEE project's implementation of GlobalPlatform's TEE client + API specification v1.0 (GPD_SPE_007): + https://globalplatform.org/specs-library/?filter-committee=tee + The TEE Client API describes and defines how a client running in + a rich operating environment (REE, in this case NuttX) should + communicate with the Trusted Execution Environment (TEE) and its + Trusted Applications (TAs). The library provides a + well-established and easy-to-use interface abstracting away much + of the details of the underlying subsystems. For more information + please refer to: + https://optee.readthedocs.io/en/latest/architecture/globalplatform_api.html#tee-client-api + +if LIBTEEC + +config LIBTEEC_VERSION + string "optee_client version (4.6.0)" + default "4.6.0" + +endif # LIBTEEC diff --git a/tee/libteec/Make.defs b/tee/libteec/Make.defs new file mode 100644 index 00000000000..5ac2332e615 --- /dev/null +++ b/tee/libteec/Make.defs @@ -0,0 +1,46 @@ +############################################################################ +# apps/tee/libteec/Make.defs +# +# SPDX-License-Identifier: Apache-2.0 +# +# Copyright (C) 2023 Xiaomi Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +############################################################################ + +ifneq ($(CONFIG_LIBTEEC),) +CONFIGURED_APPS += $(APPDIR)/tee/libteec + +FLAGS += ${INCDIR_PREFIX}$(APPDIR)/tee/libteec/optee_client/libteec/include +FLAGS += ${DEFINE_PREFIX}BINARY_PREFIX="\"TEEC\"" + +ifneq ($(CONFIG_DEBUG_INFO),) + FLAGS += ${DEFINE_PREFIX}DEBUGLEVEL=3 +else ifneq ($(CONFIG_DEBUG_WARN),) + FLAGS += ${DEFINE_PREFIX}DEBUGLEVEL=2 +else ifneq ($(CONFIG_DEBUG_ERROR),) + FLAGS += ${DEFINE_PREFIX}DEBUGLEVEL=1 +else +# the default DEBUGLEVEL are 1(with error level) + FLAGS += ${DEFINE_PREFIX}DEBUGLEVEL=1 +endif + +AFLAGS += $(FLAGS) +CFLAGS += $(FLAGS) +CXXFLAGS += $(FLAGS) + +DEPPATH += --dep-path libteec +VPATH += :libteec + +endif diff --git a/tee/libteec/Makefile b/tee/libteec/Makefile new file mode 100644 index 00000000000..1fe12a0df7d --- /dev/null +++ b/tee/libteec/Makefile @@ -0,0 +1,52 @@ +############################################################################ +# apps/tee/libteec/Makefile +# +# SPDX-License-Identifier: Apache-2.0 +# +# Copyright (C) 2023 Xiaomi Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +############################################################################ + +include $(APPDIR)/Make.defs + +LIBTEEC_VERSION = $(patsubst "%",%,$(strip $(CONFIG_LIBTEEC_VERSION))) +LIBTEEC_URL ?= "https://github.com/OP-TEE/optee_client/archive/refs/tags" +LIBTEEC_ZIP = $(LIBTEEC_VERSION).zip +LIBTEEC_UNPACKNAME = optee_client +UNPACK ?= unzip -q -o + +CSRCS += optee_client/libteec/src/tee_client_api.c +CSRCS += optee_client/libteec/src/teec_trace.c + +$(LIBTEEC_ZIP): + @echo "Downloading: $(LIBTEEC_URL)/$(LIBTEEC_ZIP)" + $(Q) $(call DOWNLOAD,$(LIBTEEC_URL),$(LIBTEEC_ZIP)) + +$(LIBTEEC_UNPACKNAME): $(LIBTEEC_ZIP) + @echo "Unpacking: $(LIBTEEC_ZIP) -> $(LIBTEEC_UNPACKNAME)" + $(Q) $(UNPACK) $(LIBTEEC_ZIP) + $(Q) mv $(LIBTEEC_UNPACKNAME)-$(LIBTEEC_VERSION) $(LIBTEEC_UNPACKNAME) + $(Q) echo "Patching $(LIBTEEC_UNPACKNAME)" + $(Q) patch -p1 -d $(LIBTEEC_UNPACKNAME) < 0001-libteec-NuttX.patch + $(Q) touch $(LIBTEEC_UNPACKNAME) + +ifeq ($(wildcard $(LIBTEEC_UNPACKNAME)/.git),) +context:: $(LIBTEEC_UNPACKNAME) + +distclean:: + $(Q) rm -rf $(LIBTEEC_UNPACKNAME) +endif + +include $(APPDIR)/Application.mk From 7b383d05625de11f4d8173252e37920aa905d423 Mon Sep 17 00:00:00 2001 From: George Poulios Date: Sun, 11 May 2025 02:06:01 +0300 Subject: [PATCH 275/391] examples/optee_gp: Add a OP-TEE GP API client example Add an example app that opens a session with the devices pseudo-TA and enumerates the available devices (prints their UUIDs only) using the GlobalPlatform API and libteec. The example showcases: - initializing the context - opening a session - invoking a command using NULL references - invoking a command using temp shared memory - invoking a command using registered shared memory - closing the session - finalizing the context Enabled with CONFIG_EXAMPLES_OPTEE_GP. Signed-off-by: George Poulios --- examples/optee_gp/CMakeLists.txt | 33 ++++++ examples/optee_gp/Kconfig | 30 +++++ examples/optee_gp/Make.defs | 25 ++++ examples/optee_gp/Makefile | 34 ++++++ examples/optee_gp/optee_gp_main.c | 190 ++++++++++++++++++++++++++++++ 5 files changed, 312 insertions(+) create mode 100644 examples/optee_gp/CMakeLists.txt create mode 100644 examples/optee_gp/Kconfig create mode 100644 examples/optee_gp/Make.defs create mode 100644 examples/optee_gp/Makefile create mode 100644 examples/optee_gp/optee_gp_main.c diff --git a/examples/optee_gp/CMakeLists.txt b/examples/optee_gp/CMakeLists.txt new file mode 100644 index 00000000000..3e4d16f8724 --- /dev/null +++ b/examples/optee_gp/CMakeLists.txt @@ -0,0 +1,33 @@ +# ############################################################################## +# apps/examples/optee_gp/CMakeLists.txt +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_EXAMPLES_OPTEE_GP) + nuttx_add_application( + NAME + ${CONFIG_EXAMPLES_OPTEE_GP_PROGNAME} + SRCS + optee_gp_main.c + STACKSIZE + ${CONFIG_EXAMPLES_OPTEE_GP_STACKSIZE} + PRIORITY + ${CONFIG_EXAMPLES_OPTEE_GP_PRIORITY}) +endif() diff --git a/examples/optee_gp/Kconfig b/examples/optee_gp/Kconfig new file mode 100644 index 00000000000..6a2acc28e0f --- /dev/null +++ b/examples/optee_gp/Kconfig @@ -0,0 +1,30 @@ +# +# For a description of the syntax of this configuration file, +# see the file kconfig-language.txt in the NuttX tools repository. +# + +config EXAMPLES_OPTEE_GP + tristate "OP-TEE GP API client example" + depends on LIBTEEC + default n + ---help--- + Enable the OP-TEE GP API client example which uses libteec + +if EXAMPLES_OPTEE + +config EXAMPLES_OPTEE_GP_PROGNAME + string "Program name" + default "optee_gp" + ---help--- + This is the name of the program that will be used when the NSH ELF + program is installed. + +config EXAMPLES_OPTEE_GP_PRIORITY + int "OP-TEE GP task priority" + default 100 + +config EXAMPLES_OPTEE_GP_STACKSIZE + int "OP-TEE GP stack size" + default DEFAULT_TASK_STACKSIZE + +endif diff --git a/examples/optee_gp/Make.defs b/examples/optee_gp/Make.defs new file mode 100644 index 00000000000..e732a4c5bdf --- /dev/null +++ b/examples/optee_gp/Make.defs @@ -0,0 +1,25 @@ +############################################################################ +# apps/examples/optee_gp/Make.defs +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +ifneq ($(CONFIG_EXAMPLES_OPTEE_GP),) +CONFIGURED_APPS += $(APPDIR)/examples/optee_gp +endif diff --git a/examples/optee_gp/Makefile b/examples/optee_gp/Makefile new file mode 100644 index 00000000000..02fb022cc92 --- /dev/null +++ b/examples/optee_gp/Makefile @@ -0,0 +1,34 @@ +############################################################################ +# apps/examples/optee_gp/Makefile +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +include $(APPDIR)/Make.defs + +# OP-TEE GP API client built-in application info + +PROGNAME = $(CONFIG_EXAMPLES_OPTEE_GP_PROGNAME) +PRIORITY = $(CONFIG_EXAMPLES_OPTEE_GP_PRIORITY) +STACKSIZE = $(CONFIG_EXAMPLES_OPTEE_GP_STACKSIZE) +MODULE = $(CONFIG_EXAMPLES_OPTEE_GP) + +MAINSRC = optee_gp_main.c + +include $(APPDIR)/Application.mk diff --git a/examples/optee_gp/optee_gp_main.c b/examples/optee_gp/optee_gp_main.c new file mode 100644 index 00000000000..b88aba69404 --- /dev/null +++ b/examples/optee_gp/optee_gp_main.c @@ -0,0 +1,190 @@ +/**************************************************************************** + * apps/examples/optee_gp/optee_gp_main.c + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +#include +#include +#include + +/**************************************************************************** + * Pre-processor definitions + ****************************************************************************/ + +/* This UUID is taken from the OP-TEE OS built-in pseudo TA: + * https://github.com/OP-TEE/optee_os/blob/4.6.0/ + * lib/libutee/include/pta_device.h + */ +#define PTA_DEVICE_ENUM_UUID \ + { \ + 0x7011a688, 0xddde, 0x4053, \ + { \ + 0xa5, 0xa9, 0x7b, 0x3c, 0x4d, 0xdf, 0x13, 0xb8 \ + } \ + } + +#define PTA_CMD_GET_DEVICES 0x0 + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * optee_gp_main + ****************************************************************************/ + +int main(int argc, FAR char *argv[]) +{ + TEEC_Result res; + TEEC_Context ctx; + TEEC_Session sess; + TEEC_Operation op; + TEEC_UUID uuid = PTA_DEVICE_ENUM_UUID; + void *buf; + TEEC_SharedMemory io_shm; + uint32_t err_origin; + unsigned int count; + const uuid_t *raw_ta_uuid; + uuid_t ta_uuid; + char *ta_uuid_s; + + res = TEEC_InitializeContext(NULL, &ctx); + if (res != TEEC_SUCCESS) + { + EMSG("TEEC_InitializeContext failed with code 0x%08x\n", res); + goto exit; + } + + memset(&op, 0, sizeof(op)); + + /* Open a session with the devices pseudo TA */ + + res = TEEC_OpenSession(&ctx, &sess, &uuid, TEEC_LOGIN_PUBLIC, NULL, + &op, &err_origin); + if (res != TEEC_SUCCESS) + { + EMSG("TEEC_Opensession failed with code 0x%08x origin 0x%08x", res, + err_origin); + goto exit_with_ctx; + } + + /* Invoke command with NULL buffer to get required size */ + + op.paramTypes = TEEC_PARAM_TYPES(TEEC_MEMREF_TEMP_OUTPUT, TEEC_NONE, + TEEC_NONE, TEEC_NONE); + op.params[0].tmpref.buffer = NULL; + op.params[0].tmpref.size = 0; + + res = TEEC_InvokeCommand(&sess, PTA_CMD_GET_DEVICES, &op, &err_origin); + if (err_origin != TEEC_ORIGIN_TRUSTED_APP || + res != TEEC_ERROR_SHORT_BUFFER) + { + EMSG("TEEC_InvokeCommand failed: code 0x%08x origin 0x%08x", + res, err_origin); + goto exit_with_session; + } + + /* Invoke command using temporary memory */ + + op.paramTypes = TEEC_PARAM_TYPES(TEEC_MEMREF_TEMP_OUTPUT, TEEC_NONE, + TEEC_NONE, TEEC_NONE); + + op.params[0].tmpref.buffer = buf = malloc(op.params[0].tmpref.size); + if (!op.params[0].tmpref.buffer) + { + EMSG("Failed to allocate %zu bytes of memory to share with TEE", + op.params[0].tmpref.size); + goto exit_with_session; + } + + res = TEEC_InvokeCommand(&sess, PTA_CMD_GET_DEVICES, &op, &err_origin); + if (res != TEEC_SUCCESS) + { + EMSG("TEEC_InvokeCommand failed: code 0x%08x origin 0x%08x", + res, err_origin); + goto exit_with_buf; + } + + /* Invoke command using pre-allocated, pre-registered memory */ + + io_shm.size = op.params[0].tmpref.size; + io_shm.flags = TEEC_MEM_OUTPUT; + res = TEEC_AllocateSharedMemory(&ctx, &io_shm); + if (res != TEEC_SUCCESS) + { + EMSG("TEEC_AllocateSharedMemory failed: code 0x%08x", res); + goto exit_with_buf; + } + + op.paramTypes = TEEC_PARAM_TYPES(TEEC_MEMREF_WHOLE, TEEC_NONE, TEEC_NONE, + TEEC_NONE); + op.params[0].memref.parent = &io_shm; + + res = TEEC_InvokeCommand(&sess, PTA_CMD_GET_DEVICES, &op, &err_origin); + if (res != TEEC_SUCCESS) + { + EMSG("TEEC_InvokeCommand failed: code 0x%08x origin 0x%08x", + res, err_origin); + goto exit_with_shm; + } + + /* Sanity check that both outputs are the same */ + + if (memcmp(buf, io_shm.buffer, io_shm.size)) + { + EMSG("Different results with temp vs registered memory"); + goto exit_with_shm; + } + + /* Print results to stdout */ + + IMSG("Available devices:"); + + count = io_shm.size / sizeof(uuid_t); + raw_ta_uuid = (uuid_t *)io_shm.buffer; + + while (count--) + { + uuid_dec_be(raw_ta_uuid, &ta_uuid); + uuid_to_string(&ta_uuid, &ta_uuid_s, NULL); + + IMSG(" %s", ta_uuid_s); + + free(ta_uuid_s); + raw_ta_uuid++; + } + +exit_with_shm: + TEEC_ReleaseSharedMemory(&io_shm); +exit_with_buf: + free(buf); +exit_with_session: + TEEC_CloseSession(&sess); +exit_with_ctx: + TEEC_FinalizeContext(&ctx); +exit: + return res; +} From fb6b3ddfd9b79a5632618b34cc87de5256e36ec2 Mon Sep 17 00:00:00 2001 From: dongjiuzhu1 Date: Fri, 14 Mar 2025 11:09:02 +0800 Subject: [PATCH 276/391] nsh/script: remove double close for output fd the output fd had been closed in nsh_closeifnotclosed, so remove double close. Signed-off-by: dongjiuzhu1 --- nshlib/nsh_script.c | 1 - 1 file changed, 1 deletion(-) diff --git a/nshlib/nsh_script.c b/nshlib/nsh_script.c index a049de62413..a0db4d6d002 100644 --- a/nshlib/nsh_script.c +++ b/nshlib/nsh_script.c @@ -74,7 +74,6 @@ static int nsh_script_redirect(FAR struct nsh_vtbl_s *vtbl, if (fd > 0) { nsh_undirect(vtbl, save); - close(fd); } } From 71df58e937831f17bdd047954ffc7d1696b7b9a6 Mon Sep 17 00:00:00 2001 From: raiden00pl Date: Fri, 9 Aug 2024 10:52:42 +0200 Subject: [PATCH 277/391] logging/nxscope: allow use in C++ code allow nxscope to use in C++ code Signed-off-by: raiden00pl --- include/logging/nxscope/nxscope.h | 13 +++++++++++++ include/logging/nxscope/nxscope_chan.h | 13 +++++++++++++ include/logging/nxscope/nxscope_intf.h | 13 +++++++++++++ include/logging/nxscope/nxscope_proto.h | 13 +++++++++++++ 4 files changed, 52 insertions(+) diff --git a/include/logging/nxscope/nxscope.h b/include/logging/nxscope/nxscope.h index bbbd145d27f..79d8c59fcfb 100644 --- a/include/logging/nxscope/nxscope.h +++ b/include/logging/nxscope/nxscope.h @@ -53,6 +53,14 @@ * Public Types ****************************************************************************/ +#ifdef __cplusplus +#define EXTERN extern "C" +extern "C" +{ +#else +#define EXTERN extern +#endif + /* Nxscope header ID */ enum nxscope_hdr_id_e @@ -488,4 +496,9 @@ int nxscope_recv(FAR struct nxscope_s *s); int nxscope_stream_start(FAR struct nxscope_s *s, bool start); +#undef EXTERN +#ifdef __cplusplus +} +#endif + #endif /* __APPS_INCLUDE_LOGGING_NXSCOPE_NXSCOPE_H */ diff --git a/include/logging/nxscope/nxscope_chan.h b/include/logging/nxscope/nxscope_chan.h index 5dfbf557210..abd66224cf1 100644 --- a/include/logging/nxscope/nxscope_chan.h +++ b/include/logging/nxscope/nxscope_chan.h @@ -37,6 +37,14 @@ * Public Types ****************************************************************************/ +#ifdef __cplusplus +#define EXTERN extern "C" +extern "C" +{ +#else +#define EXTERN extern +#endif + /* Nxscope sample type */ enum nxscope_sample_dtype_e @@ -400,4 +408,9 @@ int nxscope_put_ub32(FAR struct nxscope_s *s, uint8_t ch, ub32_t val); int nxscope_put_b32(FAR struct nxscope_s *s, uint8_t ch, b32_t val); int nxscope_put_char(FAR struct nxscope_s *s, uint8_t ch, char val); +#undef EXTERN +#ifdef __cplusplus +} +#endif + #endif /* __APPS_INCLUDE_LOGGING_NXSCOPE_NXSCOPE_CHAN_H */ diff --git a/include/logging/nxscope/nxscope_intf.h b/include/logging/nxscope/nxscope_intf.h index b493c9d0d82..b422e0d773c 100644 --- a/include/logging/nxscope/nxscope_intf.h +++ b/include/logging/nxscope/nxscope_intf.h @@ -37,6 +37,14 @@ * Public Types ****************************************************************************/ +#ifdef __cplusplus +#define EXTERN extern "C" +extern "C" +{ +#else +#define EXTERN extern +#endif + /* Forward declaration */ struct nxscope_intf_s; @@ -125,4 +133,9 @@ int nxscope_ser_init(FAR struct nxscope_intf_s *intf, void nxscope_ser_deinit(FAR struct nxscope_intf_s *intf); #endif +#undef EXTERN +#ifdef __cplusplus +} +#endif + #endif /* __APPS_INCLUDE_LOGGING_NXSCOPE_NXSCOPE_INTF_H */ diff --git a/include/logging/nxscope/nxscope_proto.h b/include/logging/nxscope/nxscope_proto.h index d666bed9ca9..109aa91c03b 100644 --- a/include/logging/nxscope/nxscope_proto.h +++ b/include/logging/nxscope/nxscope_proto.h @@ -33,6 +33,14 @@ * Public Types ****************************************************************************/ +#ifdef __cplusplus +#define EXTERN extern "C" +extern "C" +{ +#else +#define EXTERN extern +#endif + /* Nxscope frame handler */ struct nxscope_frame_s @@ -104,4 +112,9 @@ int nxscope_proto_ser_init(FAR struct nxscope_proto_s *proto, FAR void *cfg); void nxscope_proto_ser_deinit(FAR struct nxscope_proto_s *proto); #endif +#undef EXTERN +#ifdef __cplusplus +} +#endif + #endif /* __APPS_INCLUDE_LOGGING_NXSCOPE_NXSCOPE_PROTO_H */ From 877e4919cb466ee3c7f714f8ebd98978ce570445 Mon Sep 17 00:00:00 2001 From: raiden00pl Date: Sat, 5 Oct 2024 13:54:57 +0200 Subject: [PATCH 278/391] wireless/bluetooth/nimble/Kconfig: add missing header wireless/bluetooth/nimble/Kconfig: add missing header Signed-off-by: raiden00pl --- wireless/bluetooth/nimble/Kconfig | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wireless/bluetooth/nimble/Kconfig b/wireless/bluetooth/nimble/Kconfig index d739721f0ad..88b0f12c0be 100644 --- a/wireless/bluetooth/nimble/Kconfig +++ b/wireless/bluetooth/nimble/Kconfig @@ -1,3 +1,8 @@ +# +# For a description of the syntax of this configuration file, +# see misc/tools/kconfig-language.txt. +# + config NIMBLE bool "Apache NimBLE (BLE host-layer)" default n From a8740c260223cc65ee13a37009fa4b10514ed8ed Mon Sep 17 00:00:00 2001 From: raiden00pl Date: Mon, 12 Aug 2024 13:43:02 +0200 Subject: [PATCH 279/391] logging/nxscope: fix various warnings reported by CodeChekcer fix various warnings reported by CodeChekcer for nxscope Signed-off-by: raiden00pl --- include/logging/nxscope/nxscope_chan.h | 2 -- logging/nxscope/nxscope.c | 2 +- logging/nxscope/nxscope_chan.c | 4 ++-- logging/nxscope/nxscope_pser.c | 10 ++++++++++ 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/include/logging/nxscope/nxscope_chan.h b/include/logging/nxscope/nxscope_chan.h index abd66224cf1..8c7fb9087cc 100644 --- a/include/logging/nxscope/nxscope_chan.h +++ b/include/logging/nxscope/nxscope_chan.h @@ -31,8 +31,6 @@ #include -#include - /**************************************************************************** * Public Types ****************************************************************************/ diff --git a/logging/nxscope/nxscope.c b/logging/nxscope/nxscope.c index 123ff047e3b..f919bf62c4f 100644 --- a/logging/nxscope/nxscope.c +++ b/logging/nxscope/nxscope.c @@ -1120,7 +1120,7 @@ int nxscope_recv(FAR struct nxscope_s *s) /* Handle frame */ - ret = nxscope_recv_handle(s, frame.id, frame.dlen, frame.data); + ret = nxscope_recv_handle(s, frame.id, (uint16_t)frame.dlen, frame.data); if (ret < 0) { _err("ERROR: nxscope_recv_handle failed %d\n", ret); diff --git a/logging/nxscope/nxscope_chan.c b/logging/nxscope/nxscope_chan.c index 3af048c60d4..10c30ad25e5 100644 --- a/logging/nxscope/nxscope_chan.c +++ b/logging/nxscope/nxscope_chan.c @@ -683,8 +683,8 @@ int nxscope_chan_div(FAR struct nxscope_s *s, uint8_t ch, uint8_t div) int nxscope_chan_all_en(FAR struct nxscope_s *s, bool en) { - int ret = OK; - int i = 0; + int ret = OK; + uint8_t i = 0; DEBUGASSERT(s); diff --git a/logging/nxscope/nxscope_pser.c b/logging/nxscope/nxscope_pser.c index 89c2c74c245..1f548bb79ba 100644 --- a/logging/nxscope/nxscope_pser.c +++ b/logging/nxscope/nxscope_pser.c @@ -166,6 +166,16 @@ static int nxscope_frame_get(FAR struct nxscope_proto_s *p, } } + /* Check for no header */ + + if (hdr == NULL) + { + ret = -EINVAL; + goto errout; + } + + /* Check for no SOF in header */ + if (hdr->sof != NXSCOPE_HDR_SOF) { ret = -EINVAL; From 49f6a219f970c0ee3c85a71111d646bdbfb08e30 Mon Sep 17 00:00:00 2001 From: George Poulios Date: Tue, 20 May 2025 14:30:24 +0300 Subject: [PATCH 280/391] examples/optee_gp: Fix Kconfig if/else condition Previous Kconfig had a mistake guarding optee_gp Kconfig values based on EXAMPLES_OPTEE instead of EXAMPLES_OPTEE_GP. Fix that Signed-off-by: George Poulios --- examples/optee_gp/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/optee_gp/Kconfig b/examples/optee_gp/Kconfig index 6a2acc28e0f..46b1ae947e1 100644 --- a/examples/optee_gp/Kconfig +++ b/examples/optee_gp/Kconfig @@ -10,7 +10,7 @@ config EXAMPLES_OPTEE_GP ---help--- Enable the OP-TEE GP API client example which uses libteec -if EXAMPLES_OPTEE +if EXAMPLES_OPTEE_GP config EXAMPLES_OPTEE_GP_PROGNAME string "Program name" From afade4f5c921942cd6dd0e3b18601fe18991ffa5 Mon Sep 17 00:00:00 2001 From: ouyangxiangzhen Date: Thu, 21 Nov 2024 16:19:40 +0800 Subject: [PATCH 281/391] testing/ostest: add periodic wdog testing. This commit added periodic wdog testing. Signed-off-by: ouyangxiangzhen --- testing/ostest/wdog.c | 90 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 84 insertions(+), 6 deletions(-) diff --git a/testing/ostest/wdog.c b/testing/ostest/wdog.c index 8c1c35a826a..d0e7f3f56c0 100644 --- a/testing/ostest/wdog.c +++ b/testing/ostest/wdog.c @@ -221,7 +221,7 @@ static void wdtest_recursive(FAR struct wdog_s *wdog, clock_t wdset_tick; irqstate_t flags; - wdtest_printf("wdtest_recursive %lldus\n", (long long)delay_ns); + wdtest_printf("wdtest_recursive %lldns\n", (long long)delay_ns); cnt = param->callback_cnt; @@ -249,17 +249,59 @@ static void wdtest_recursive(FAR struct wdog_s *wdog, (long long)(param->triggered_tick - wdset_tick)); } +static void wdtest_periodic(FAR wdtest_param_t *param, + sclock_t period_ns) +{ + clock_t wdset_tick; + clock_t period_tick = (clock_t)NSEC2TICK((clock_t)period_ns); + uint64_t callback_cnt = param->callback_cnt; + + struct wdog_period_s period_wdog = + { + 0 + }; + + wdtest_printf("wdtest_periodic %lldns ~ %llutick\n", + (long long)period_ns, (unsigned long long)period_tick); + + wdset_tick = clock_systime_ticks(); + + wd_start_period(&period_wdog, period_tick, period_tick, + wdtest_callback, (wdparm_t)param); + + while (param->callback_cnt - callback_cnt <= WDOGTEST_RAND_ITER) + { + wdtest_delay(period_ns); + } + + wd_cancel_period(&period_wdog); + + callback_cnt = param->callback_cnt - callback_cnt; + wdset_tick = param->triggered_tick - wdset_tick; + + wdtest_printf("wdtest_periodic cancel..."); + wdtest_printf("wdtest_periodic triggered %llu times, " + "elapsed ticks %lld, error ticks %lld\n", + (unsigned long long)callback_cnt, (long long)wdset_tick, + (long long)(wdset_tick - callback_cnt * period_tick)); +} + static void wdog_test_run(FAR wdtest_param_t *param) { - uint64_t cnt; - sclock_t rest; - sclock_t delay; - struct wdog_s test_wdog = + uint64_t cnt; + sclock_t rest; + sclock_t delay; + struct wdog_s test_wdog = { 0 }; - /* Wrong arguments, all 7 combinations */ + struct wdog_period_s test_wdog_period = + { + 0 + }; + + /* Wrong arguments of the wd_start */ wdtest_assert(wd_start(NULL, 0, NULL, (wdparm_t)NULL) != OK); wdtest_assert(wd_start(NULL, 0, wdtest_callback, (wdparm_t)NULL) != OK); @@ -270,6 +312,34 @@ static void wdog_test_run(FAR wdtest_param_t *param) wdtest_assert(wd_start(&test_wdog, -1, wdtest_callback, (wdparm_t)NULL) != OK); + wdtest_assert(wd_start_period(NULL, 0, 0, + NULL, (wdparm_t)NULL) != OK); + + wdtest_assert(wd_start_period(NULL, 0, 0, + wdtest_callback, (wdparm_t)NULL) != OK); + + wdtest_assert(wd_start_period(NULL, 0, 12345, + NULL, (wdparm_t)NULL) != OK); + + wdtest_assert(wd_start_period(NULL, 0, 12345, + wdtest_callback, (wdparm_t)NULL) != OK); + + wdtest_assert(wd_start_period(&test_wdog_period, 0, 0, + NULL, (wdparm_t)NULL) != OK); + + wdtest_assert(wd_start_period(&test_wdog_period, 0, 12345, + NULL, (wdparm_t)NULL) != OK); + + wdtest_assert(wd_start_period(&test_wdog_period, 0, 0, + wdtest_callback, (wdparm_t)NULL) != OK); + + /* Wrong arguments of the wd_cancel */ + + wdtest_assert(wd_cancel(NULL) != OK); + wdtest_assert(wd_cancel(&test_wdog) != OK); + wdtest_assert(wd_cancel_period(NULL) != OK); + wdtest_assert(wd_cancel_period(&test_wdog_period) != OK); + /* Delay = 0 */ wdtest_once(&test_wdog, param, 0); @@ -331,9 +401,17 @@ static void wdog_test_run(FAR wdtest_param_t *param) wdtest_recursive(&test_wdog, param, 1000000, 100); wdtest_recursive(&test_wdog, param, 10000000, 10); + /* Periodic wdog period with 1000us */ + + wdtest_periodic(param, 100000); + /* Random delay ~12us */ wdtest_rand(&test_wdog, param, 12345); + + /* Finally, cancel the wdog. */ + + wd_cancel(&test_wdog); } /* Multi threaded */ From a5709532577ff0b3276a78bc8d278e8bf8a1b037 Mon Sep 17 00:00:00 2001 From: ouyangxiangzhen Date: Fri, 16 May 2025 16:13:21 +0800 Subject: [PATCH 282/391] ostest/wdog: update wdog_test. This commit updated the wdog_test to adapt to the semantic changes of the wd_start. Signed-off-by: ouyangxiangzhen --- testing/ostest/wdog.c | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/testing/ostest/wdog.c b/testing/ostest/wdog.c index d0e7f3f56c0..ef9d2e09aa8 100644 --- a/testing/ostest/wdog.c +++ b/testing/ostest/wdog.c @@ -44,7 +44,7 @@ #define wdtest_assert(x) _ASSERT(x, __FILE__, __LINE__) -#define wdtest_printf(...) syslog(LOG_WARNING, __VA_ARGS__) +#define wdtest_printf(...) printf(__VA_ARGS__) #define wdtest_delay(delay_ns) usleep(delay_ns / 1000 + 1) @@ -54,10 +54,10 @@ typedef struct wdtest_param_s { - FAR struct wdog_s *wdog; - sclock_t interval; - uint64_t callback_cnt; - clock_t triggered_tick; + FAR struct wdog_s *wdog; + sclock_t interval; + uint64_t callback_cnt; + clock_t triggered_tick; } wdtest_param_t; /**************************************************************************** @@ -242,7 +242,7 @@ static void wdtest_recursive(FAR struct wdog_s *wdog, wdtest_delay(times * delay_ns); - wdtest_assert(wd_cancel(param->wdog) == 0); + wd_cancel(param->wdog); wdtest_printf("recursive wdog triggered %llu times, elapsed tick %lld\n", (unsigned long long)(param->callback_cnt - cnt), @@ -290,7 +290,7 @@ static void wdog_test_run(FAR wdtest_param_t *param) { uint64_t cnt; sclock_t rest; - sclock_t delay; + clock_t delay; struct wdog_s test_wdog = { 0 @@ -363,7 +363,7 @@ static void wdog_test_run(FAR wdtest_param_t *param) /* Maximum */ - delay = ((clock_t)1 << (sizeof(sclock_t) * CHAR_BIT - 1)) - 1; + delay = CLOCK_MAX >> 2; wdtest_assert(wd_start(&test_wdog, delay, wdtest_callback, (wdparm_t)param) == OK); @@ -382,20 +382,13 @@ static void wdog_test_run(FAR wdtest_param_t *param) rest = wd_gettime(&test_wdog); - wdtest_assert(rest < delay && rest > (delay >> 1)); + wdtest_assert(rest < delay); wdtest_assert(wd_cancel(&test_wdog) == 0); wdtest_printf("wd_start with maximum delay, cancel OK, rest %lld\n", (long long)rest); - /* Delay wraparound (delay < 0) */ - - delay = (sclock_t)((clock_t)delay + 1); - wdtest_assert(wd_start(&test_wdog, delay, - wdtest_callback, (wdparm_t)param) != OK); - wdtest_assert(wd_gettime(&test_wdog) == 0); - /* Recursive wdog delay from 1000us to 10000us */ wdtest_recursive(&test_wdog, param, 1000000, 100); From 18b72e89a423c247e420fb1a5e7fc2bac17a4e37 Mon Sep 17 00:00:00 2001 From: Richard Tucker Date: Mon, 26 May 2025 14:59:08 +1000 Subject: [PATCH 283/391] apps/testing: fix typo --- testing/drivers/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/drivers/Makefile b/testing/drivers/Makefile index a0da405f43b..8c6b1a1adc7 100644 --- a/testing/drivers/Makefile +++ b/testing/drivers/Makefile @@ -20,6 +20,6 @@ # ############################################################################ -MENUDESC = "dirvers" +MENUDESC = "drivers" include $(APPDIR)/Directory.mk From 291373732f72e31e126240756957b8e636742d08 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 May 2025 22:49:52 +0000 Subject: [PATCH 284/391] build(deps): bump codelytv/pr-size-labeler from 1.10.2 to 1.10.3 Bumps [codelytv/pr-size-labeler](https://github.com/codelytv/pr-size-labeler) from 1.10.2 to 1.10.3. - [Release notes](https://github.com/codelytv/pr-size-labeler/releases) - [Commits](https://github.com/codelytv/pr-size-labeler/compare/v1.10.2...v1.10.3) --- updated-dependencies: - dependency-name: codelytv/pr-size-labeler dependency-version: 1.10.3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/labeler.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index bd75d11d3ed..30e1fdf40ac 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -34,7 +34,7 @@ jobs: sync-labels: true - name: Assign labels based on the PR's size - uses: codelytv/pr-size-labeler@v1.10.2 + uses: codelytv/pr-size-labeler@v1.10.3 with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} ignore_file_deletions: true From 94d02aaaf2c1767b8fbe89b7555fcfb91236a786 Mon Sep 17 00:00:00 2001 From: raiden00pl Date: Tue, 27 May 2025 18:30:06 +0200 Subject: [PATCH 285/391] examples: unify Private Types banners unify Private Types banners according to NuttX coding standard Signed-off-by: raiden00pl --- examples/foc/foc_fixed16_thr.c | 2 +- examples/foc/foc_float_thr.c | 2 +- examples/foc/foc_intf.c | 2 +- examples/foc/foc_motor_b16.c | 2 +- examples/foc/foc_motor_f32.c | 2 +- examples/ipforward/ipforward.c | 2 +- examples/lvgldemo/lvgldemo.c | 2 +- examples/nxscope/nxscope_main.c | 2 +- examples/powerled/powerled_main.c | 2 +- examples/smps/smps_main.c | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/examples/foc/foc_fixed16_thr.c b/examples/foc/foc_fixed16_thr.c index 412b2b26e87..2ba2998e60e 100644 --- a/examples/foc/foc_fixed16_thr.c +++ b/examples/foc/foc_fixed16_thr.c @@ -63,7 +63,7 @@ #endif /**************************************************************************** - * Private Type Definition + * Private Types ****************************************************************************/ /**************************************************************************** diff --git a/examples/foc/foc_float_thr.c b/examples/foc/foc_float_thr.c index 52fb0833b92..af967f255a3 100644 --- a/examples/foc/foc_float_thr.c +++ b/examples/foc/foc_float_thr.c @@ -63,7 +63,7 @@ #endif /**************************************************************************** - * Private Type Definition + * Private Types ****************************************************************************/ /**************************************************************************** diff --git a/examples/foc/foc_intf.c b/examples/foc/foc_intf.c index 1b0d4a8b1b0..be8e1ba5d14 100644 --- a/examples/foc/foc_intf.c +++ b/examples/foc/foc_intf.c @@ -73,7 +73,7 @@ #endif /**************************************************************************** - * Private Type Definition + * Private Types ****************************************************************************/ #ifdef CONFIG_EXAMPLES_FOC_HAVE_BUTTON diff --git a/examples/foc/foc_motor_b16.c b/examples/foc/foc_motor_b16.c index f7a8ed2a523..a9530e18cb8 100644 --- a/examples/foc/foc_motor_b16.c +++ b/examples/foc/foc_motor_b16.c @@ -48,7 +48,7 @@ #define FOC_FLOAT_IDENT_IND_MAX ftob16(2.0f) /**************************************************************************** - * Private Type Definition + * Private Types ****************************************************************************/ /**************************************************************************** diff --git a/examples/foc/foc_motor_f32.c b/examples/foc/foc_motor_f32.c index 8499a34ccf0..1aee970f9fd 100644 --- a/examples/foc/foc_motor_f32.c +++ b/examples/foc/foc_motor_f32.c @@ -48,7 +48,7 @@ #define FOC_FLOAT_IDENT_IND_MAX (2.0f) /**************************************************************************** - * Private Type Definition + * Private Types ****************************************************************************/ /**************************************************************************** diff --git a/examples/ipforward/ipforward.c b/examples/ipforward/ipforward.c index 205df55482d..57b146e7ebe 100644 --- a/examples/ipforward/ipforward.c +++ b/examples/ipforward/ipforward.c @@ -75,7 +75,7 @@ #endif /**************************************************************************** - * Name: Private Types + * Private Types ****************************************************************************/ struct ipfwd_tun_s diff --git a/examples/lvgldemo/lvgldemo.c b/examples/lvgldemo/lvgldemo.c index 05741cb88e0..55d6620edce 100644 --- a/examples/lvgldemo/lvgldemo.c +++ b/examples/lvgldemo/lvgldemo.c @@ -56,7 +56,7 @@ #endif /**************************************************************************** - * Private Type Declarations + * Private Types ****************************************************************************/ /**************************************************************************** diff --git a/examples/nxscope/nxscope_main.c b/examples/nxscope/nxscope_main.c index b4bf72665cc..b2311a74aae 100644 --- a/examples/nxscope/nxscope_main.c +++ b/examples/nxscope/nxscope_main.c @@ -55,7 +55,7 @@ #define SIN_DT (0.01f) /**************************************************************************** - * Private Type Definition + * Private Types ****************************************************************************/ struct nxscope_thr_env_s diff --git a/examples/powerled/powerled_main.c b/examples/powerled/powerled_main.c index d2eda170785..c0b3cd29d38 100644 --- a/examples/powerled/powerled_main.c +++ b/examples/powerled/powerled_main.c @@ -58,7 +58,7 @@ #define DEMO_FLASH_BRIGHTNESS_SET 100.0 /**************************************************************************** - * Private Type Definition + * Private Types ****************************************************************************/ /* Example modes */ diff --git a/examples/smps/smps_main.c b/examples/smps/smps_main.c index 5c12651ef52..ba6a7b079ae 100644 --- a/examples/smps/smps_main.c +++ b/examples/smps/smps_main.c @@ -79,7 +79,7 @@ #endif /**************************************************************************** - * Private Type Definition + * Private Types ****************************************************************************/ /* Application arguments */ From d62db5eb38be695611feea9390373fb3dfd675ff Mon Sep 17 00:00:00 2001 From: raiden00pl Date: Tue, 27 May 2025 18:30:52 +0200 Subject: [PATCH 286/391] logging: unify Private Types banners unify Private Types banners according to NuttX coding standard Signed-off-by: raiden00pl --- logging/nxscope/nxscope_idummy.c | 2 +- logging/nxscope/nxscope_iser.c | 2 +- logging/nxscope/nxscope_pser.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/logging/nxscope/nxscope_idummy.c b/logging/nxscope/nxscope_idummy.c index 83206e9e70e..8615748af8e 100644 --- a/logging/nxscope/nxscope_idummy.c +++ b/logging/nxscope/nxscope_idummy.c @@ -35,7 +35,7 @@ #include /**************************************************************************** - * Private Type Definition + * Private Types ****************************************************************************/ struct nxscope_intf_dummy_s diff --git a/logging/nxscope/nxscope_iser.c b/logging/nxscope/nxscope_iser.c index c36d6e3504e..b1722042b56 100644 --- a/logging/nxscope/nxscope_iser.c +++ b/logging/nxscope/nxscope_iser.c @@ -36,7 +36,7 @@ #include /**************************************************************************** - * Private Type Definition + * Private Types ****************************************************************************/ struct nxscope_intf_ser_s diff --git a/logging/nxscope/nxscope_pser.c b/logging/nxscope/nxscope_pser.c index 1f548bb79ba..2d0917d51ad 100644 --- a/logging/nxscope/nxscope_pser.c +++ b/logging/nxscope/nxscope_pser.c @@ -47,7 +47,7 @@ #define NXSCOPE_CRC_LEN (sizeof(uint16_t)) /**************************************************************************** - * Private Type Definition + * Private Types ****************************************************************************/ /* Nxscope serial protocol frame: From 1d3abc2651c3b96a47846e4cdbea1ba416b4ccaf Mon Sep 17 00:00:00 2001 From: raiden00pl Date: Tue, 27 May 2025 18:31:11 +0200 Subject: [PATCH 287/391] modbus: unify Private Types banners unify Private Types banners according to NuttX coding standard Signed-off-by: raiden00pl --- modbus/ascii/mbascii.c | 2 +- modbus/rtu/mbrtu.c | 2 +- modbus/rtu/mbrtu_m.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modbus/ascii/mbascii.c b/modbus/ascii/mbascii.c index 2394ecca5f4..3540628ad53 100644 --- a/modbus/ascii/mbascii.c +++ b/modbus/ascii/mbascii.c @@ -61,7 +61,7 @@ #define MB_SER_PDU_PDU_OFF 1 /* Offset of Modbus-PDU in Ser-PDU. */ /**************************************************************************** - * Private Type Definitions + * Private Typess ****************************************************************************/ typedef enum diff --git a/modbus/rtu/mbrtu.c b/modbus/rtu/mbrtu.c index cc6b1088e71..0f8262d4fc9 100644 --- a/modbus/rtu/mbrtu.c +++ b/modbus/rtu/mbrtu.c @@ -57,7 +57,7 @@ #define MB_SER_PDU_PDU_OFF 1 /* Offset of Modbus-PDU in Ser-PDU. */ /**************************************************************************** - * Private Type Definitions + * Private Typess ****************************************************************************/ typedef enum diff --git a/modbus/rtu/mbrtu_m.c b/modbus/rtu/mbrtu_m.c index 85827472998..ed8e62488b5 100644 --- a/modbus/rtu/mbrtu_m.c +++ b/modbus/rtu/mbrtu_m.c @@ -64,7 +64,7 @@ #define MB_SER_PDU_PDU_OFF 1 /* Offset of Modbus-PDU in Ser-PDU. */ /**************************************************************************** - * Private Type Definitions + * Private Typess ****************************************************************************/ typedef enum From 32bcd87d8f95b31ab7d65564f4aef61c6dd35aab Mon Sep 17 00:00:00 2001 From: raiden00pl Date: Tue, 27 May 2025 18:31:31 +0200 Subject: [PATCH 288/391] system: unify Private Types banners unify Private Types banners according to NuttX coding standard Signed-off-by: raiden00pl --- system/monkey/monkey_main.c | 2 +- system/monkey/monkey_utils.c | 2 +- system/nxcamera/nxcamera_main.c | 2 +- system/nxlooper/nxlooper_main.c | 2 +- system/nxplayer/nxplayer.c | 2 +- system/nxplayer/nxplayer_main.c | 2 +- system/nxplayer/nxplayer_mp3.c | 2 +- system/nxplayer/nxplayer_sbc.c | 2 +- system/nxrecorder/nxrecorder.c | 2 +- system/nxrecorder/nxrecorder_amr.c | 2 +- system/nxrecorder/nxrecorder_main.c | 2 +- system/ofloader/ofloader.c | 2 +- system/ofloader/segger.c | 2 +- system/readline/readline_fd.c | 2 +- system/resmonitor/showinfo.c | 2 +- system/sensorscope/sensorscope_main.c | 2 +- system/ymodem/sb_main.c | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/system/monkey/monkey_main.c b/system/monkey/monkey_main.c index f3d665c4f25..8ed5b6d0743 100644 --- a/system/monkey/monkey_main.c +++ b/system/monkey/monkey_main.c @@ -123,7 +123,7 @@ } while (0) /**************************************************************************** - * Private Type Declarations + * Private Types ****************************************************************************/ struct monkey_param_s diff --git a/system/monkey/monkey_utils.c b/system/monkey/monkey_utils.c index c785b504301..640bd28ef7f 100644 --- a/system/monkey/monkey_utils.c +++ b/system/monkey/monkey_utils.c @@ -35,7 +35,7 @@ #include "monkey_utils.h" /**************************************************************************** - * Private Type Declarations + * Private Types ****************************************************************************/ struct monkey_port_dev_type_name_s diff --git a/system/nxcamera/nxcamera_main.c b/system/nxcamera/nxcamera_main.c index 754f12e1d2f..01387202417 100644 --- a/system/nxcamera/nxcamera_main.c +++ b/system/nxcamera/nxcamera_main.c @@ -52,7 +52,7 @@ #endif /**************************************************************************** - * Private Type Declarations + * Private Types ****************************************************************************/ typedef CODE int (*nxcamera_func)(FAR struct nxcamera_s *cam, FAR char *arg); diff --git a/system/nxlooper/nxlooper_main.c b/system/nxlooper/nxlooper_main.c index 710fb8a77a8..e90ed578488 100644 --- a/system/nxlooper/nxlooper_main.c +++ b/system/nxlooper/nxlooper_main.c @@ -51,7 +51,7 @@ #endif /**************************************************************************** - * Private Type Declarations + * Private Types ****************************************************************************/ typedef int (*nxlooper_func)(FAR struct nxlooper_s *plooper, char *pargs); diff --git a/system/nxplayer/nxplayer.c b/system/nxplayer/nxplayer.c index 314bdea4049..0de66f68ad6 100644 --- a/system/nxplayer/nxplayer.c +++ b/system/nxplayer/nxplayer.c @@ -71,7 +71,7 @@ #endif /**************************************************************************** - * Private Type Declarations + * Private Types ****************************************************************************/ #ifdef CONFIG_NXPLAYER_FMT_FROM_EXT diff --git a/system/nxplayer/nxplayer_main.c b/system/nxplayer/nxplayer_main.c index daeed9477b2..5200c08f92b 100644 --- a/system/nxplayer/nxplayer_main.c +++ b/system/nxplayer/nxplayer_main.c @@ -51,7 +51,7 @@ #endif /**************************************************************************** - * Private Type Declarations + * Private Types ****************************************************************************/ struct mp_cmd_s diff --git a/system/nxplayer/nxplayer_mp3.c b/system/nxplayer/nxplayer_mp3.c index 7bf324f4727..56dc183ae2f 100644 --- a/system/nxplayer/nxplayer_mp3.c +++ b/system/nxplayer/nxplayer_mp3.c @@ -45,7 +45,7 @@ #define ID3V2_BIT_MASK 0x7F /**************************************************************************** - * Private Type Declarations + * Private Types ****************************************************************************/ const static uint16_t g_mpa_freq_tab[3] = diff --git a/system/nxplayer/nxplayer_sbc.c b/system/nxplayer/nxplayer_sbc.c index 50b7b82a27f..17ebc173a03 100644 --- a/system/nxplayer/nxplayer_sbc.c +++ b/system/nxplayer/nxplayer_sbc.c @@ -45,7 +45,7 @@ #define SBC_FRAME_HEADER_SIZE 32 /**************************************************************************** - * Private Type Declarations + * Private Types ****************************************************************************/ /**************************************************************************** diff --git a/system/nxrecorder/nxrecorder.c b/system/nxrecorder/nxrecorder.c index 98c62486c5a..6a75f6a5745 100644 --- a/system/nxrecorder/nxrecorder.c +++ b/system/nxrecorder/nxrecorder.c @@ -63,7 +63,7 @@ #endif /**************************************************************************** - * Private Type Declarations + * Private Types ****************************************************************************/ #ifdef CONFIG_NXRECORDER_FMT_FROM_EXT diff --git a/system/nxrecorder/nxrecorder_amr.c b/system/nxrecorder/nxrecorder_amr.c index 2f03d06aff6..f936629514c 100644 --- a/system/nxrecorder/nxrecorder_amr.c +++ b/system/nxrecorder/nxrecorder_amr.c @@ -34,7 +34,7 @@ #include "system/nxrecorder.h" /**************************************************************************** - * Private Type Declarations + * Private Types ****************************************************************************/ static const uint8_t AMR_NB[6] = "#!AMR\n"; diff --git a/system/nxrecorder/nxrecorder_main.c b/system/nxrecorder/nxrecorder_main.c index 5b649d5321f..8ba3ad4b494 100644 --- a/system/nxrecorder/nxrecorder_main.c +++ b/system/nxrecorder/nxrecorder_main.c @@ -51,7 +51,7 @@ #endif /**************************************************************************** - * Private Type Declarations + * Private Types ****************************************************************************/ struct mp_cmd_s diff --git a/system/ofloader/ofloader.c b/system/ofloader/ofloader.c index f68e4a96459..8200262febf 100644 --- a/system/ofloader/ofloader.c +++ b/system/ofloader/ofloader.c @@ -35,7 +35,7 @@ #include "ofloader.h" /**************************************************************************** - * Private Type Definitions + * Private Typess ****************************************************************************/ struct devinfo_s diff --git a/system/ofloader/segger.c b/system/ofloader/segger.c index 9308454ae13..705fa2df2c5 100644 --- a/system/ofloader/segger.c +++ b/system/ofloader/segger.c @@ -41,7 +41,7 @@ #define ALGO_VERSION 0x101 /* Algo version, must not be modified. */ /**************************************************************************** - * Private Type Definitions + * Private Typess ****************************************************************************/ struct SECTOR_INFO diff --git a/system/readline/readline_fd.c b/system/readline/readline_fd.c index d3822becfc1..2a37d2335ac 100644 --- a/system/readline/readline_fd.c +++ b/system/readline/readline_fd.c @@ -36,7 +36,7 @@ #include "readline.h" /**************************************************************************** - * Private Type Declarations + * Private Types ****************************************************************************/ struct readline_s diff --git a/system/resmonitor/showinfo.c b/system/resmonitor/showinfo.c index 27f016dee45..18713bc5fba 100644 --- a/system/resmonitor/showinfo.c +++ b/system/resmonitor/showinfo.c @@ -49,7 +49,7 @@ #define FILELEN 100 /**************************************************************************** - * Private Type Declarations + * Private Types ****************************************************************************/ struct t_info diff --git a/system/sensorscope/sensorscope_main.c b/system/sensorscope/sensorscope_main.c index fa194b39e65..2248afaecb3 100644 --- a/system/sensorscope/sensorscope_main.c +++ b/system/sensorscope/sensorscope_main.c @@ -50,7 +50,7 @@ #define SENSOR_CHNAME_MAX 16 /**************************************************************************** - * Private Type Definition + * Private Types ****************************************************************************/ struct nxsensor_info_s diff --git a/system/ymodem/sb_main.c b/system/ymodem/sb_main.c index 4453752e596..7a5c447e444 100644 --- a/system/ymodem/sb_main.c +++ b/system/ymodem/sb_main.c @@ -36,7 +36,7 @@ #include "ymodem.h" /**************************************************************************** - * Private Type Definitions + * Private Typess ****************************************************************************/ struct ymodem_priv_s From 44eeb1c7c8acf04ddeaff2cd07f7215570f1b891 Mon Sep 17 00:00:00 2001 From: raiden00pl Date: Tue, 27 May 2025 18:31:46 +0200 Subject: [PATCH 289/391] testing: unify Private Types banners unify Private Types banners according to NuttX coding standard Signed-off-by: raiden00pl --- testing/drivers/drivertest/drivertest_i2c_spi.c | 2 +- testing/drivers/drivertest/drivertest_uart.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/testing/drivers/drivertest/drivertest_i2c_spi.c b/testing/drivers/drivertest/drivertest_i2c_spi.c index b13a8a6541a..8703043256e 100644 --- a/testing/drivers/drivertest/drivertest_i2c_spi.c +++ b/testing/drivers/drivertest/drivertest_i2c_spi.c @@ -47,7 +47,7 @@ #define READ_TIMES 100 /**************************************************************************** - * Private Type Declarations + * Private Types ****************************************************************************/ struct test_state_s diff --git a/testing/drivers/drivertest/drivertest_uart.c b/testing/drivers/drivertest/drivertest_uart.c index f888205292e..fb19a980e42 100644 --- a/testing/drivers/drivertest/drivertest_uart.c +++ b/testing/drivers/drivertest/drivertest_uart.c @@ -58,7 +58,7 @@ #endif /**************************************************************************** - * Private Type Declarations + * Private Types ****************************************************************************/ struct test_confs_s From 8ff533beb37eeef1f288c467acd7c50b542464eb Mon Sep 17 00:00:00 2001 From: vrmay23 Date: Sun, 25 May 2025 17:41:10 +0200 Subject: [PATCH 290/391] examples/posix_stdio: Fix Kconfig to define default stack size Fix the Kconfig file for the posix_stdio example by adding the STACKSIZE symbol and setting it to DEFAULT_TASK_STACKSIZE. This change ensures that the example builds properly and respects system-wide stack size configuration. Signed-off-by: Vinicius May --- examples/posix_stdio/Kconfig | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/examples/posix_stdio/Kconfig b/examples/posix_stdio/Kconfig index 3c41e975f28..8980223a11f 100644 --- a/examples/posix_stdio/Kconfig +++ b/examples/posix_stdio/Kconfig @@ -7,7 +7,8 @@ config EXAMPLES_POSIX_STDIO bool "Posix stdio example" default n ---help--- - Enable POSIX stdio example that shows how to use open(), write() and close() via /dev/console. + Enable POSIX stdio example that shows how to use open(), write() and + close() via /dev/console. config EXAMPLES_POSIX_STDIO_PROGNAME string "Program name" @@ -15,6 +16,11 @@ config EXAMPLES_POSIX_STDIO_PROGNAME depends on EXAMPLES_POSIX_STDIO config EXAMPLES_POSIX_STDIO_PRIORITY - int "POSIX_STDIO test priority" + int "POSIX_STDIO priority" default 100 depends on EXAMPLES_POSIX_STDIO + +config EXAMPLES_POSIX_STDIO_STACKSIZE + int "POSIX_STDIO stack size" + default DEFAULT_TASK_STACKSIZE + depends on EXAMPLES_POSIX_STDIO From 30b1c024a1d1c59f4b7108643bead85616b4334a Mon Sep 17 00:00:00 2001 From: Tim Hardisty <56726697+TimJTi@users.noreply.github.com> Date: Wed, 14 May 2025 15:27:30 +0100 Subject: [PATCH 291/391] apps/netutils: add mdns library support This commit allows an external mDNS library to be included in NuttX. It originates from here: It is declared as being in the Public Domain as per Signed-off-by: Tim Hardisty --- include/netutils/mdnsd.h | 58 +++++++++ netutils/mdns/Kconfig | 81 +++++++++++++ netutils/mdns/Make.defs | 25 ++++ netutils/mdns/Makefile | 106 +++++++++++++++++ netutils/mdns/mdnsd.c | 182 +++++++++++++++++++++++++++++ netutils/mdns/verbose_option.patch | 16 +++ 6 files changed, 468 insertions(+) create mode 100644 include/netutils/mdnsd.h create mode 100644 netutils/mdns/Kconfig create mode 100644 netutils/mdns/Make.defs create mode 100644 netutils/mdns/Makefile create mode 100644 netutils/mdns/mdnsd.c create mode 100644 netutils/mdns/verbose_option.patch diff --git a/include/netutils/mdnsd.h b/include/netutils/mdnsd.h new file mode 100644 index 00000000000..1900fb9dbaa --- /dev/null +++ b/include/netutils/mdnsd.h @@ -0,0 +1,58 @@ +/**************************************************************************** + * apps/netutils/mdnsd.h + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +#ifndef __APPS_INCLUDE_NETUTILS_MDNSD_H +#define __APPS_INCLUDE_NETUTILS_MDNSD_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Public Types + ****************************************************************************/ + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +#ifdef __cplusplus +#define EXTERN extern "C" +extern "C" +{ +#else +#define EXTERN extern +#endif + +int mdnsd_start(FAR char *service_name, FAR char *service_port); +int mdnsd_stop(void); + +#undef EXTERN +#ifdef __cplusplus +} +#endif + +#endif /* __APPS_INCLUDE_NETUTILS_MDNSD_H */ diff --git a/netutils/mdns/Kconfig b/netutils/mdns/Kconfig new file mode 100644 index 00000000000..bd2003bdbed --- /dev/null +++ b/netutils/mdns/Kconfig @@ -0,0 +1,81 @@ +config LIB_MDNS + bool "MDNS library" + default n + ---help--- + Enable the mDNS library. This allows calls to the library to be made. + + This external library is "unlicensed" using the methodology from + http://unlicense.org + + You should be sure that this license is acceptable for your usage. + + By default, the "built-in" demo is added as an application that can + be run from nsh . + + This is also needed for the optional daemon that allows the demo + app's mDNS functionality to be started and stopped from user + applications. There is an associated example app + (CONFIG_EXAMPLES_MDNSD) to allow the daemon to be tried from nsh. + + Ultimately, this should be used simply as a library, and neither the + demo app nor the daemon utilised. If just built as a library,the + relevant header file is copied to the usual netutils + include location and can be utilised be including it: + + #include + +if LIB_MDNS + +config NETUTILS_MDNS + tristate "Enable mdns built-in demo app" + default n + ---help--- + Enable the author's original built-in MDNS demo app. This allows the + functionality of the library to be demonstrated. Information on using + it is available from the original git repo for this external library: + + https://github.com/mjansson/mdns + +if NETUTILS_MDNS + +config NETUTILS_MDNS_PROGNAME + string "mDNS program name" + default "mdns" + ---help--- + This is the name of the program that will be used when the NSH ELF + program is installed. + +config NETUTILS_MDNS_PRIORITY + int "mDNS task priority" + default 100 + +config NETUTILS_MDNS_STACKSIZE + int "mDNS stack size" + default DEFAULT_TASK_STACKSIZE + ---help--- + The default (4KiB) is adequate for simple networks but this will + most likely need to be increased if there are many network devices + attached that could send queries. + +config NETUTILS_MDNS_VERBOSE + bool "Enable verbose printf output from built-in mdns demo" + default y +endif + +config NETUTILS_MDNS_DAEMON + tristate "Wrap mdns demo app as a daemon, which can be started/stopped" + default n + depends on NETUTILS_MDNS + ---help--- + This option wraps the mdns demo app as a daemon, so requires + CONFIG_NETUTILS_MDNS to be selected. + + There is also an example app (CONFIG_EXAMPLES_MDNSD) to allow the + mdns daemon to be started/stopped via the NuttX shell. + +config NETUTILS_MDNS_DAEMON_STOP_SIGNAL + int "Signal used to stop the MDNSD daemon" + default 22 + depends on NETUTILS_MDNS_DAEMON + +endif #NETUTILS_MDNS diff --git a/netutils/mdns/Make.defs b/netutils/mdns/Make.defs new file mode 100644 index 00000000000..9bc358982eb --- /dev/null +++ b/netutils/mdns/Make.defs @@ -0,0 +1,25 @@ +############################################################################ +# apps/netutils/mdns/Make.defs +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +ifneq ($(CONFIG_LIB_MDNS),) +CONFIGURED_APPS += $(APPDIR)/netutils/mdns +endif diff --git a/netutils/mdns/Makefile b/netutils/mdns/Makefile new file mode 100644 index 00000000000..2a69531a9c2 --- /dev/null +++ b/netutils/mdns/Makefile @@ -0,0 +1,106 @@ +############################################################################ +# netutils/mdns/Makefile +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +include $(APPDIR)/Make.defs + +# mDNS application + +############################################################################ +# Flags +############################################################################ + +MDNS_URL ?= "https://github.com/mjansson/mdns/archive" + +MDNS_VERSION = main +MDNS_ZIP = $(MDNS_VERSION).zip + +MDNS_UNPACKNAME = mdns +UNPACK ?= unzip -q -o + +VPATH += $(MDNS_UNPACKNAME) +VPATH += $(MDNS_UNPACKNAME)$(DELIM)posix +DEPPATH += --dep-path $(MDNS_UNPACKNAME) +DEPPATH += --dep-path $(MDNS_UNPACKNAME)$(DELIM)posix + +CFLAGS += -Wno-strict-prototypes -Wno-undef -Wno-format + +APPS_INCDIR = $(APPDIR)$(DELIM)include$(DELIM)netutils + +############################################################################ +# Targets +############################################################################ + +$(MDNS_ZIP): + @echo "Downloading: $(MDNS_URL)/$(MDNS_ZIP)" + $(Q) curl -O -L $(MDNS_URL)/$(MDNS_ZIP) + +$(MDNS_UNPACKNAME): $(MDNS_ZIP) + @echo "Unpacking: $(MDNS_ZIP) -> $(MDNS_UNPACKNAME)" + $(Q) $(UNPACK) $(MDNS_ZIP) + $(Q) mv mdns-$(MDNS_VERSION) $(MDNS_UNPACKNAME) + $(Q) cp $(MDNS_UNPACKNAME)$(DELIM)mdns.h $(APPS_INCDIR) + $(Q) patch -p0 < verbose_option.patch # Update to enable non-verbose mode + $(Q) touch $(MDNS_UNPACKNAME) + +clean:: + $(call DELFILE, $(OBJS)) + +# Download and unpack tarball if no git repo found + +ifeq ($(wildcard $(MDNS_UNPACKNAME)/.git),) +context:: $(MDNS_UNPACKNAME) + +distclean:: + $(call DELFILE, $(OBJS)) + $(call DELDIR, $(MDNS_UNPACKNAME)) + $(call DELFILE, $(APPS_INCDIR)$(DELIM)mdns.h) + $(call DELFILE, $(MDNS_ZIP)) +endif + +############################################################################ +# Applications Configuration +############################################################################ + +include $(APPDIR)/Make.defs + +ifneq ($(CONFIG_NETUTILS_MDNS),) +PROGNAME = $(CONFIG_NETUTILS_MDNS_PROGNAME) +PRIORITY = $(CONFIG_NETUTILS_MDNS_PRIORITY) +STACKSIZE = $(CONFIG_NETUTILS_MDNS_STACKSIZE) +MODULE = $(CONFIG_NETUTILS_MDNS) + +MAINSRC = mdns/mdns.c +else +CSRCS += mdns/mdns.c +endif + +ifneq ($(CONFIG_NETUTILS_MDNS_DAEMON),) +CSRCS += mdnsd.c +endif + +# This is an external library so we accept NuttX style violations + +CFLAGS += -Wno-undef -Wno-strict-prototypes -Wno-unused-variable \ + -Wno-pointer-sign -Wno-unused-but-set-variable -Wno-shadow \ + -Wno-format + +include $(APPDIR)/Application.mk \ No newline at end of file diff --git a/netutils/mdns/mdnsd.c b/netutils/mdns/mdnsd.c new file mode 100644 index 00000000000..1f648950b2e --- /dev/null +++ b/netutils/mdns/mdnsd.c @@ -0,0 +1,182 @@ +/**************************************************************************** + * apps/netutils/mdns/mdnsd.c + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include +#include +#include +#include +#include /* For nerr, info */ + +#include "netutils/netlib.h" +#include "netutils/mdnsd.h" + +#include + +/**************************************************************************** + * Preprocessor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Types + ****************************************************************************/ + +/* This enumeration describes the state of the MDNSD daemon */ + +enum mdnsd_daemon_e +{ + MDNSD_NOT_RUNNING = 0, + MDNSD_STARTING, + MDNSD_RUNNING, + MDNSD_STOP_REQUESTED, +}; + +struct mdnsd_config_s +{ + pid_t pid; /* Task ID of the spawned MDNSD daemon */ + enum mdnsd_daemon_e state; /* State of the daemon */ + sem_t lock; /* Used to protect the whole structure */ +}; + +/**************************************************************************** + * Private Function Prototypes + ****************************************************************************/ + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +struct mdnsd_config_s g_mdnsd_config = +{ + -1, + MDNSD_NOT_RUNNING, + SEM_INITIALIZER(1), +}; + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +int mdnsd_stop(void) +{ + int ret; + + sem_wait(&g_mdnsd_config.lock); + if (g_mdnsd_config.state == MDNSD_RUNNING) + { + g_mdnsd_config.state = MDNSD_STOP_REQUESTED; + do + { + ret = (kill(g_mdnsd_config.pid, + CONFIG_NETUTILS_MDNS_DAEMON_STOP_SIGNAL)); + if (ret < 0) + { + nerr("ERROR: kill pid %d failed: %d\n", + g_mdnsd_config.pid, errno); + break; + } + } + while (g_mdnsd_config.state == MDNSD_STOP_REQUESTED); + } + + g_mdnsd_config.state = MDNSD_NOT_RUNNING; + sem_post(&g_mdnsd_config.lock); + return OK; +} + +int mdnsd_start(FAR char *service_name, FAR char *service_port) +{ + int ret; + char hostname_buffer[HOST_NAME_MAX]; + const char *hostname = "nuttx"; + FAR char *argv[7]; + + /* Are we in a non-running state? */ + + sem_wait(&g_mdnsd_config.lock); + if (g_mdnsd_config.state == MDNSD_NOT_RUNNING) + { + g_mdnsd_config.state = MDNSD_STARTING; + + /* Configure our mDNS service */ + + /* The mdns library function will check the hostname too, but this + * ensures the default is our, not the library author's, choice. + */ + + if (gethostname(hostname_buffer, HOST_NAME_MAX) == 0) + { + if (strlen(hostname_buffer) != 0) + { + hostname = hostname_buffer; + } + } + + argv[0] = "--service"; + argv[1] = service_name; + argv[2] = "--hostname"; + argv[3] = (char *)hostname; + argv[4] = "--port"; + argv[5] = service_port; + argv[6] = NULL; + + /* Spawn mdns app */ + + ret = posix_spawn(&g_mdnsd_config.pid, /* Returned Task ID */ + "mdns", /* Task Path */ + NULL, /* File actions */ + NULL, /* Attributes */ + argv, /* Arguments */ + NULL); /* No */ + + if (ret < 0) + { + int errval = errno; + syslog(LOG_ERR, "Failed to spawn mdns daemon\n"); + g_mdnsd_config.state = MDNSD_NOT_RUNNING; + return -errval; + } + + ninfo("Started\n"); + + g_mdnsd_config.state = MDNSD_RUNNING; + } + + sem_post(&g_mdnsd_config.lock); + return OK; +} + diff --git a/netutils/mdns/verbose_option.patch b/netutils/mdns/verbose_option.patch new file mode 100644 index 00000000000..63e09fffd68 --- /dev/null +++ b/netutils/mdns/verbose_option.patch @@ -0,0 +1,16 @@ +--- mdns/mdns.c ++++ mdns/mdns/mdns.c +@@ -22,7 +22,9 @@ + // Alias some things to simulate recieving data to fuzz library + #if defined(MDNS_FUZZING) + #define recvfrom(sock, buffer, capacity, flags, src_addr, addrlen) ((mdns_ssize_t)capacity) +-#define printf ++#endif ++#if defined(MDNS_FUZZING) || !defined(CONFIG_NETUTILS_MDNS_VERBOSE) ++#define printf(...) + #endif + + #include "mdns.h" +-- +2.34.1 + From f0eb00ffd99d6a520348c2ae552fff77e851957d Mon Sep 17 00:00:00 2001 From: Tim Hardisty <56726697+TimJTi@users.noreply.github.com> Date: Wed, 21 May 2025 15:43:07 +0100 Subject: [PATCH 292/391] examples: add mdnsd example application to accompany netutils/mdns library This commit adds a new example app to allow the newly added netutils/mdns library and associated daemon to be exeercised. Signed-off-by: Tim Hardisty --- examples/mdnsd/Kconfig | 32 +++++++++++ examples/mdnsd/Make.defs | 25 ++++++++ examples/mdnsd/Makefile | 38 +++++++++++++ examples/mdnsd/mdnsd_daemon.c | 104 ++++++++++++++++++++++++++++++++++ examples/mdnsd/mdnsd_daemon.h | 57 +++++++++++++++++++ examples/mdnsd/mdnsd_start.c | 43 ++++++++++++++ examples/mdnsd/mdnsd_stop.c | 43 ++++++++++++++ 7 files changed, 342 insertions(+) create mode 100644 examples/mdnsd/Kconfig create mode 100644 examples/mdnsd/Make.defs create mode 100644 examples/mdnsd/Makefile create mode 100644 examples/mdnsd/mdnsd_daemon.c create mode 100644 examples/mdnsd/mdnsd_daemon.h create mode 100644 examples/mdnsd/mdnsd_start.c create mode 100644 examples/mdnsd/mdnsd_stop.c diff --git a/examples/mdnsd/Kconfig b/examples/mdnsd/Kconfig new file mode 100644 index 00000000000..5b142d5d1f6 --- /dev/null +++ b/examples/mdnsd/Kconfig @@ -0,0 +1,32 @@ +# +# For a description of the syntax of this configuration file, +# see the file kconfig-language.txt in the NuttX tools repository. +# + +config EXAMPLES_MDNSD + tristate "MDNS daemon example" + default n + depends on NETUTILS_MDNS_DAEMON + ---help--- + Enable the MDNS daemon example + +if EXAMPLES_MDNSD + +config EXAMPLES_MDNS_SERVICE + string "Name of the mdns service" + default "_nuttx._tcp.local" + ---help--- + This is the name of the service to be advertised by this example. + The format is _service.protocol.domain where + - "service" identifies the type of service being advertised such as + _http, or _printer + - "protocol" as used by the service (e.g. _udp or _tcp) + - "domain" which for mDNS is most likely _local + +config EXAMPLES_MDNS_SERVICE_PORT + string "The port that the advertised service uses" + default "32000" + ---help--- + The port the advertised service uses. The default is randomly chosen. + +endif diff --git a/examples/mdnsd/Make.defs b/examples/mdnsd/Make.defs new file mode 100644 index 00000000000..96008aa5c76 --- /dev/null +++ b/examples/mdnsd/Make.defs @@ -0,0 +1,25 @@ +############################################################################ +# apps/examples/mdnsd/Make.defs +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +ifneq ($(CONFIG_EXAMPLES_MDNSD),) +CONFIGURED_APPS += $(APPDIR)/examples/mdnsd +endif diff --git a/examples/mdnsd/Makefile b/examples/mdnsd/Makefile new file mode 100644 index 00000000000..316e6d8172f --- /dev/null +++ b/examples/mdnsd/Makefile @@ -0,0 +1,38 @@ +############################################################################ +# apps/examples/mdnsd/Makefile +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +include $(APPDIR)/Make.defs + +# MDNS Daemon Example + +CSRCS = mdnsd_daemon.c + +MAINSRC = mdnsd_start.c mdnsd_stop.c + +# MDNSD built-in application info + +PROGNAME = mdnsd_start mdnsd_stop +PRIORITY = SCHED_PRIORITY_DEFAULT +STACKSIZE = $(CONFIG_DEFAULT_TASK_STACKSIZE) +MODULE = $(CONFIG_EXAMPLES_MDNSD) + +include $(APPDIR)/Application.mk diff --git a/examples/mdnsd/mdnsd_daemon.c b/examples/mdnsd/mdnsd_daemon.c new file mode 100644 index 00000000000..bfa7759e813 --- /dev/null +++ b/examples/mdnsd/mdnsd_daemon.c @@ -0,0 +1,104 @@ +/**************************************************************************** + * apps/examples/mdnsd/mdnsd_daemon.c + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include "netutils/netlib.h" +#include "netutils/mdnsd.h" +#include "mdnsd_daemon.h" + +/**************************************************************************** + * Preprocessor Definitions + ****************************************************************************/ + +/* Configuration Checks *****************************************************/ + +/* BEWARE: + * There are other configuration settings needed in netutils/mdnsd/mdnsdc.c, + * but there are default values for those so we cannot check them here. + */ + +#ifndef CONFIG_NET +# error "You must define CONFIG_NET" +#endif + +#ifndef CONFIG_NET_UDP +# error "You must define CONFIG_NET_UDP" +#endif + +#ifndef CONFIG_NET_BROADCAST +# error "You must define CONFIG_NET_BROADCAST" +#endif + +/**************************************************************************** + * Private Types + ****************************************************************************/ + +/**************************************************************************** + * Private Function Prototypes + ****************************************************************************/ + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * mdnsd_showusage + ****************************************************************************/ + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: mdnsd_daemon + ****************************************************************************/ + +int mdnsd_daemon(int argc, FAR char *argv[], bool start) +{ + /* No arguments are needed for the example app */ + + if (start) + { + return mdnsd_start(CONFIG_EXAMPLES_MDNS_SERVICE, + CONFIG_EXAMPLES_MDNS_SERVICE_PORT); + } + else + { + return mdnsd_stop(); + } +} diff --git a/examples/mdnsd/mdnsd_daemon.h b/examples/mdnsd/mdnsd_daemon.h new file mode 100644 index 00000000000..4fda59587e6 --- /dev/null +++ b/examples/mdnsd/mdnsd_daemon.h @@ -0,0 +1,57 @@ +/**************************************************************************** + * apps/examples/mdnsd/mdnsd_daemon.h + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +#ifndef __APPS_EXAMPLES_MDNSD_H +#define __APPS_EXAMPLES_MDNSD_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Public Types + ****************************************************************************/ + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +#ifdef __cplusplus +#define EXTERN extern "C" +extern "C" +{ +#else +#define EXTERN extern +#endif + +int mdnsd_daemon(int argc, FAR char *argv[], bool start); + +#undef EXTERN +#ifdef __cplusplus +} +#endif + +#endif /* __APPS_EXAMPLES_MDNSD_H */ diff --git a/examples/mdnsd/mdnsd_start.c b/examples/mdnsd/mdnsd_start.c new file mode 100644 index 00000000000..865bde967c1 --- /dev/null +++ b/examples/mdnsd/mdnsd_start.c @@ -0,0 +1,43 @@ +/**************************************************************************** + * apps/examples/mdnsd/mdnsd_start.c + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include + +#include "mdnsd_daemon.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: mdnsd_start_main + ****************************************************************************/ + +int main(int argc, FAR char *argv[]) +{ + return mdnsd_daemon(argc, argv, true); +} diff --git a/examples/mdnsd/mdnsd_stop.c b/examples/mdnsd/mdnsd_stop.c new file mode 100644 index 00000000000..45da47dd294 --- /dev/null +++ b/examples/mdnsd/mdnsd_stop.c @@ -0,0 +1,43 @@ +/**************************************************************************** + * apps/examples/mdnsd/mdnsd_stop.c + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include + +#include "mdnsd_daemon.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: mdnsd_stop_main + ****************************************************************************/ + +int main(int argc, char **argv) +{ + return mdnsd_daemon(argc, argv, false); +} From a03ed469477d6642310bd00c232bf1e89fce6858 Mon Sep 17 00:00:00 2001 From: ouyangxiangzhen Date: Thu, 29 May 2025 14:15:55 +0800 Subject: [PATCH 293/391] ostest/wdog: Remove periodical wdog test cases. The peridiodical wdog test cases should be removed after removing of the periodical wdog APIs. Signed-off-by: ouyangxiangzhen --- testing/ostest/wdog.c | 69 ------------------------------------------- 1 file changed, 69 deletions(-) diff --git a/testing/ostest/wdog.c b/testing/ostest/wdog.c index ef9d2e09aa8..3243723b241 100644 --- a/testing/ostest/wdog.c +++ b/testing/ostest/wdog.c @@ -249,43 +249,6 @@ static void wdtest_recursive(FAR struct wdog_s *wdog, (long long)(param->triggered_tick - wdset_tick)); } -static void wdtest_periodic(FAR wdtest_param_t *param, - sclock_t period_ns) -{ - clock_t wdset_tick; - clock_t period_tick = (clock_t)NSEC2TICK((clock_t)period_ns); - uint64_t callback_cnt = param->callback_cnt; - - struct wdog_period_s period_wdog = - { - 0 - }; - - wdtest_printf("wdtest_periodic %lldns ~ %llutick\n", - (long long)period_ns, (unsigned long long)period_tick); - - wdset_tick = clock_systime_ticks(); - - wd_start_period(&period_wdog, period_tick, period_tick, - wdtest_callback, (wdparm_t)param); - - while (param->callback_cnt - callback_cnt <= WDOGTEST_RAND_ITER) - { - wdtest_delay(period_ns); - } - - wd_cancel_period(&period_wdog); - - callback_cnt = param->callback_cnt - callback_cnt; - wdset_tick = param->triggered_tick - wdset_tick; - - wdtest_printf("wdtest_periodic cancel..."); - wdtest_printf("wdtest_periodic triggered %llu times, " - "elapsed ticks %lld, error ticks %lld\n", - (unsigned long long)callback_cnt, (long long)wdset_tick, - (long long)(wdset_tick - callback_cnt * period_tick)); -} - static void wdog_test_run(FAR wdtest_param_t *param) { uint64_t cnt; @@ -296,11 +259,6 @@ static void wdog_test_run(FAR wdtest_param_t *param) 0 }; - struct wdog_period_s test_wdog_period = - { - 0 - }; - /* Wrong arguments of the wd_start */ wdtest_assert(wd_start(NULL, 0, NULL, (wdparm_t)NULL) != OK); @@ -312,33 +270,10 @@ static void wdog_test_run(FAR wdtest_param_t *param) wdtest_assert(wd_start(&test_wdog, -1, wdtest_callback, (wdparm_t)NULL) != OK); - wdtest_assert(wd_start_period(NULL, 0, 0, - NULL, (wdparm_t)NULL) != OK); - - wdtest_assert(wd_start_period(NULL, 0, 0, - wdtest_callback, (wdparm_t)NULL) != OK); - - wdtest_assert(wd_start_period(NULL, 0, 12345, - NULL, (wdparm_t)NULL) != OK); - - wdtest_assert(wd_start_period(NULL, 0, 12345, - wdtest_callback, (wdparm_t)NULL) != OK); - - wdtest_assert(wd_start_period(&test_wdog_period, 0, 0, - NULL, (wdparm_t)NULL) != OK); - - wdtest_assert(wd_start_period(&test_wdog_period, 0, 12345, - NULL, (wdparm_t)NULL) != OK); - - wdtest_assert(wd_start_period(&test_wdog_period, 0, 0, - wdtest_callback, (wdparm_t)NULL) != OK); - /* Wrong arguments of the wd_cancel */ wdtest_assert(wd_cancel(NULL) != OK); wdtest_assert(wd_cancel(&test_wdog) != OK); - wdtest_assert(wd_cancel_period(NULL) != OK); - wdtest_assert(wd_cancel_period(&test_wdog_period) != OK); /* Delay = 0 */ @@ -394,10 +329,6 @@ static void wdog_test_run(FAR wdtest_param_t *param) wdtest_recursive(&test_wdog, param, 1000000, 100); wdtest_recursive(&test_wdog, param, 10000000, 10); - /* Periodic wdog period with 1000us */ - - wdtest_periodic(param, 100000); - /* Random delay ~12us */ wdtest_rand(&test_wdog, param, 12345); From 4b8b96f060ae35632b488fccb79a6f338f5023ea Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Wed, 4 Jun 2025 19:39:02 +0800 Subject: [PATCH 294/391] system/uORB: fix orb_subscribe_multi undefined Fix `orb_subscribe_multi` undefined error. /workspace/prebuilts/gcc/linux/arm64/bin/../lib/gcc/aarch64-none-elf/13.2.1/../../../../aarch64-none-elf/bin/ld: apps/system/uorb/libapps_uorb_listener.a(listener.c.o): in function `listener_monitor': /workspace/apps/system/uorb/listener.c:803:(.text.listener_monitor.constprop.0+0xe4): undefined reference to `orb_subscribe_multi' /workspace/apps/system/uorb/listener.c:803:(.text.listener_monitor.constprop.0+0xe4): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `orb_subscribe_multi' Signed-off-by: wangjianyu3 --- system/uorb/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/uorb/CMakeLists.txt b/system/uorb/CMakeLists.txt index 18a510feb71..030339a5141 100644 --- a/system/uorb/CMakeLists.txt +++ b/system/uorb/CMakeLists.txt @@ -32,7 +32,7 @@ if(CONFIG_UORB) file(GLOB_RECURSE CSRCS "sensor/*.c" "uORB/uORB.c") if(CONFIG_UORB_LOOP_MAX_EVENTS) - file(GLOB_RECURSE CSRCS "uORB/loop.c" "uORB/epoll.c") + list(APPEND CSRCS "uORB/loop.c" "uORB/epoll.c") endif() if(CONFIG_UORB_LISTENER) From bcd1b46946dc8d2ff86f8edbd59f880fd6556a94 Mon Sep 17 00:00:00 2001 From: Tim Hardisty <56726697+TimJTi@users.noreply.github.com> Date: Thu, 24 Apr 2025 11:15:26 +0100 Subject: [PATCH 295/391] apps/boot/nxboot: Enhancements to add progress messages and copy-to-RAM feature This adds Kconfig-enabled progress messages that are output to stdout. It also adds Kconfig-enabled option to copy the validated and bootable image to RAM Signed-off by: Tim Hardisty --- boot/nxboot/Kconfig | 55 ++++++++- boot/nxboot/include/nxboot.h | 66 +++++++++- boot/nxboot/loader/boot.c | 111 ++++++++++++++++- boot/nxboot/loader/flash.c | 9 +- boot/nxboot/nxboot_main.c | 233 ++++++++++++++++++++++++++++++++++- 5 files changed, 454 insertions(+), 20 deletions(-) diff --git a/boot/nxboot/Kconfig b/boot/nxboot/Kconfig index f8e817b5ac5..6f51370eab0 100644 --- a/boot/nxboot/Kconfig +++ b/boot/nxboot/Kconfig @@ -64,6 +64,36 @@ config NXBOOT_BOOTLOADER if NXBOOT_BOOTLOADER +config NXBOOT_COPY_TO_RAM + bool "Copy bootable image to RAM before calling board boot-image function" + default n + ---help--- + The is a board and/or arch specific option that may be used when running + directly from flash, especially if external flash, even in XIP mode, is too + slow. + Running from RAM usually results in faster execution but the board must, of + course, have sufficient RAM available for the application image, stack + and heap. + +config NXBOOT_RAMSTART + hex "Start address in RAM that the application is to be loaded" + default 0x0 + depends on NXBOOT_COPY_TO_RAM + ---help--- + This will be board specific. A check of the board's linker script + may be informative. For example the SAMA5D2-XULT eval board's uboot + linker script - boards/arm/sama5/sama5d2-xult/scripts/uboot.ld - has: + + sdram (W!RX) : ORIGIN = 0x20008000, LENGTH = 256M - 32K + + This shows the load address to be 0x20008000 and would be the address + to use here if the same linker script is to be be used for NXboot. + + Typically the address is the base address of the RAM to be used, plus the + size of the NXboot image itself. The example above has reserved + 32KiB (0x8000) for this from the 256MiB available on the board at + address 0x20000000. + config NXBOOT_SWRESET_ONLY bool "Perform update/revert only on SW reset" default n @@ -86,12 +116,35 @@ config NXBOOT_PREVENT_DOWNGRADE NXboot uses Semantic Version 2.0.0 (without build metadata). By default the update is performed for every version that doesn't match the currently running one. If NXBOOT_PREVENT_DOWNGRADE selected, update is - performed only for newer versions (according to Semantic Version + performed only for newer versions (according to Semantic Version preference rules). WARNING: NXboot currently implements preferences only for MAJOR.MINOR.PATCH and ignores prerelease. +config NXBOOT_PRINTF_PROGRESS + bool "Enable progress messages to be sent to STDOUT" + default y + ---help--- + This will display progress during typically lengthy operations: + - Calculating checksums + - copying images between slots + + Note: the NXboot binary will be approximately 2KiB larger with this enabled. + +choice + prompt "Choose preferred progress indication type" + depends on NXBOOT_PRINTF_PROGRESS + default NXBOOT_PRINTF_PROGRESS_PERCENT + +config NXBOOT_PRINTF_PROGRESS_DOTS + bool "Display progress using sequential dots" + +config NXBOOT_PRINTF_PROGRESS_PERCENT + bool "Display progress using percentage remaining" + +endchoice + endif # NXBOOT_BOOTLOADER endif # BOOT_NXBOOT diff --git a/boot/nxboot/include/nxboot.h b/boot/nxboot/include/nxboot.h index 5370c2ee6f8..6c4a89b3257 100644 --- a/boot/nxboot/include/nxboot.h +++ b/boot/nxboot/include/nxboot.h @@ -35,6 +35,8 @@ * Pre-processor Definitions ****************************************************************************/ +#define ERROR -1 + #define NXBOOT_PRIMARY_SLOT_NUM (0) #define NXBOOT_SECONDARY_SLOT_NUM (1) #define NXBOOT_TERTIARY_SLOT_NUM (2) @@ -117,6 +119,7 @@ struct nxboot_img_header struct nxboot_img_version img_version; /* Image version */ }; + static_assert(CONFIG_NXBOOT_HEADER_SIZE > sizeof(struct nxboot_img_header), "CONFIG_NXBOOT_HEADER_SIZE has to be larger than" "sizeof(struct nxboot_img_header)"); @@ -131,10 +134,42 @@ struct nxboot_state enum nxboot_update_type next_boot; /* nxboot_update_type with next operation */ }; +enum progress_type_e +{ + nxboot_info = 0, /* Prefixes arg. string with "INFO:" */ + nxboot_error, /* Prefixes arg. string with "ERR:" */ + nxboot_progress_start, /* Prints arg. string with no newline to allow ..... sequence to follow */ + nxboot_progress_dot, /* Prints of a "." to the ..... progress sequence */ + nxboot_progress_percent, /* Displays progress as % remaining */ + nxboot_progress_end, /* Flags end of a "..." progrees sequence and prints newline */ +}; + +enum progress_msg_e +{ + startup_msg = 0, + power_reset, + soft_reset, + found_bootable_image, + no_bootable_image, + boardioc_image_boot_fail, + ramcopy_started, + recovery_revert, + recovery_create, + update_from_update, + validate_primary, + validate_recovery, + validate_update, + recovery_created, + recovery_invalid, + update_failed, +}; + /**************************************************************************** * Public Function Prototypes ****************************************************************************/ +void nxboot_progress(enum progress_type_e type, ...); + /**************************************************************************** * Name: nxboot_get_state * @@ -148,7 +183,7 @@ struct nxboot_state * state: The pointer to nxboot_state structure. The state is stored here. * * Returned Value: - * 0 on success, -1 and sets errno on failure. + * OK (0) on success, ERROR (-1) and sets errno on failure. * ****************************************************************************/ @@ -164,7 +199,7 @@ int nxboot_get_state(struct nxboot_state *state); * if afterwards. * * Returned Value: - * Valid file descriptor on success, -1 and sets errno on failure. + * Valid file descriptor on success, ERROR (-1) and sets errno on failure. * ****************************************************************************/ @@ -180,7 +215,7 @@ int nxboot_open_update_partition(void); * state of the bootloader. * * Returned Value: - * 1 means confirmed, 0 not confirmed, -1 and sets errno on failure. + * 1 if confirmed, OK (0) on success, ERROR (-1) and sets errno on failure. * ****************************************************************************/ @@ -194,14 +229,14 @@ int nxboot_get_confirm(void); * its copy in update partition as a recovery. * * Returned Value: - * 0 on success, -1 and sets errno on failure. + * OK (0) on success, ERROR (-1) and sets errno on failure. * ****************************************************************************/ int nxboot_confirm(void); /**************************************************************************** - * Name: nxboot_perform_swap + * Name: nxboot_perform_update * * Description: * Checks for the possible firmware update and performs it by copying @@ -216,10 +251,29 @@ int nxboot_confirm(void); * check_only: Only repairs corrupted update, but do not start another one * * Returned Value: - * 0 on success, -1 and sets errno on failure. + * OK (0) on success, ERROR (-1) and sets errno on failure. * ****************************************************************************/ int nxboot_perform_update(bool check_only); +/**************************************************************************** + * Name: nxboot_ramcopy + * + * Description: + * Copies the (already) validate bootable image to RAM memory + * + * NOTE - no checking that the RAM location is correct, nor that the + * image size is appropriate for that RAM address! + * + * Input parameters: + * none + * + * Returned Value: + * OK (0) on success, ERROR (-1) on fail + * + ****************************************************************************/ + +int nxboot_ramcopy(void); + #endif /* __BOOT_NXBOOT_INCLUDE_NXBOOT_H */ diff --git a/boot/nxboot/loader/boot.c b/boot/nxboot/loader/boot.c index 9a43f4cb67e..9364ba16f94 100644 --- a/boot/nxboot/loader/boot.c +++ b/boot/nxboot/loader/boot.c @@ -79,6 +79,9 @@ static uint32_t calculate_crc(int fd, struct nxboot_img_header *header) off_t off; uint32_t crc; struct flash_partition_info info; +#ifdef CONFIG_NXBOOT_PRINTF_PROGRESS_PERCENT + int total_size; +#endif if (flash_partition_info(fd, &info) < 0) { @@ -94,6 +97,9 @@ static uint32_t calculate_crc(int fd, struct nxboot_img_header *header) crc = 0xffffffff; off = offsetof(struct nxboot_img_header, crc) + sizeof crc; remain = header->size + header->header_size - off; +#ifdef CONFIG_NXBOOT_PRINTF_PROGRESS_PERCENT + total_size = remain; +#endif while (remain > 0) { readsiz = remain > info.blocksize ? info.blocksize : remain; @@ -106,6 +112,15 @@ static uint32_t calculate_crc(int fd, struct nxboot_img_header *header) off += readsiz; remain -= readsiz; crc = crc32part((uint8_t *)buf, readsiz, crc); + if ((remain % 25) == 0) + { +#ifdef CONFIG_NXBOOT_PRINTF_PROGRESS_PERCENT + nxboot_progress(nxboot_progress_percent, + ((total_size - remain) * 100) / total_size); +#else + nxboot_progress(nxboot_progress_dot); +#endif + } } free(buf); @@ -124,6 +139,9 @@ static int copy_partition(int from, int where, struct nxboot_state *state, int blocksize; off_t off; char *buf; +#ifdef CONFIG_NXBOOT_PRINTF_PROGRESS_PERCENT + int total_size; +#endif get_image_header(from, &header); @@ -143,6 +161,9 @@ static int copy_partition(int from, int where, struct nxboot_state *state, return ERROR; } +#ifdef CONFIG_NXBOOT_PRINTF_PROGRESS_PERCENT + total_size = remain * 100; +#endif blocksize = MAX(info_from.blocksize, info_where.blocksize); buf = malloc(blocksize); @@ -202,6 +223,15 @@ static int copy_partition(int from, int where, struct nxboot_state *state, off += readsiz; remain -= readsiz; + if ((remain % 25) == 0) + { +#ifdef CONFIG_NXBOOT_PRINTF_PROGRESS_PERCENT + nxboot_progress(nxboot_progress_percent, + ((total_size - remain) * 100) / total_size); +#else + nxboot_progress(nxboot_progress_dot); +#endif + } } free(buf); @@ -218,6 +248,7 @@ static bool validate_image(int fd) return false; } + syslog(LOG_INFO, "Validating image.\n"); return calculate_crc(fd, &header) == header.crc; } @@ -268,18 +299,24 @@ static enum nxboot_update_type struct nxboot_img_header *update_header, struct nxboot_img_header *recovery_header) { + nxboot_progress(nxboot_progress_start, validate_primary); bool primary_valid = validate_image(primary); + nxboot_progress(nxboot_progress_end); + nxboot_progress(nxboot_progress_start, validate_update); if (update_header->magic == NXBOOT_HEADER_MAGIC && validate_image(update)) { if (primary_header->crc != update_header->crc || !compare_versions(&primary_header->img_version, &update_header->img_version) || !primary_valid) { + nxboot_progress(nxboot_progress_end); return NXBOOT_UPDATE_TYPE_UPDATE; } } + nxboot_progress(nxboot_progress_end); + if (IS_INTERNAL_MAGIC(recovery_header->magic) && state->recovery_valid && ((IS_INTERNAL_MAGIC(primary_header->magic) && !state->primary_confirmed) || !primary_valid)) @@ -292,6 +329,7 @@ static enum nxboot_update_type static int perform_update(struct nxboot_state *state, bool check_only) { + int successful; int update; int recovery; int primary; @@ -331,18 +369,25 @@ static int perform_update(struct nxboot_state *state, bool check_only) recovery = secondary; } + nxboot_progress(nxboot_progress_start, validate_primary); if (state->next_boot == NXBOOT_UPDATE_TYPE_REVERT && (!check_only || !validate_image(primary))) { + nxboot_progress(nxboot_progress_end); if (state->recovery_valid) { syslog(LOG_INFO, "Reverting image to recovery.\n"); + nxboot_progress(nxboot_progress_start, recovery_revert); copy_partition(recovery, primary, state, false); + nxboot_progress(nxboot_progress_end); } } else { + nxboot_progress(nxboot_progress_end); + nxboot_progress(nxboot_progress_start, validate_primary); primary_valid = validate_image(primary); + nxboot_progress(nxboot_progress_end); if (primary_valid && check_only) { /* Skip if primary image is valid (does not mather whether @@ -368,21 +413,33 @@ static int perform_update(struct nxboot_state *state, bool check_only) */ syslog(LOG_INFO, "Creating recovery image.\n"); + nxboot_progress(nxboot_progress_start, recovery_create); copy_partition(primary, recovery, state, false); - if (!validate_image(recovery)) + nxboot_progress(nxboot_progress_end); + nxboot_progress(nxboot_progress_start, validate_recovery); + successful = validate_image(recovery); + nxboot_progress(nxboot_progress_end); + if (!successful) { - syslog(LOG_INFO, "New recovery is not valid, stop update.\n"); + syslog(LOG_INFO, + "New recovery is not valid,stop update.\n"); + nxboot_progress(nxboot_info, recovery_invalid); goto perform_update_done; } syslog(LOG_INFO, "Recovery image created.\n"); + nxboot_progress(nxboot_info, recovery_created); } - if (validate_image(update)) + nxboot_progress(nxboot_progress_start, validate_update); + successful = validate_image(update); + nxboot_progress(nxboot_progress_end); + if (successful) { /* Perform update only if update slot contains valid image. */ syslog(LOG_INFO, "Updating from update image.\n"); + nxboot_progress(nxboot_progress_start, update_from_update); if (copy_partition(update, primary, state, true) >= 0) { /* Erase the first sector of update partition. This marks the @@ -393,6 +450,8 @@ static int perform_update(struct nxboot_state *state, bool check_only) flash_partition_erase_first_sector(update); } + + nxboot_progress(nxboot_progress_end); } } @@ -403,6 +462,46 @@ static int perform_update(struct nxboot_state *state, bool check_only) return OK; } +#ifdef CONFIG_NXBOOT_COPY_TO_RAM +int nxboot_ramcopy(void) +{ + int ret = OK; + int primary; + struct nxboot_img_header header; + ssize_t bytes; + static uint8_t *buf; + + primary = flash_partition_open(CONFIG_NXBOOT_PRIMARY_SLOT_PATH); + if (primary < 0) + { + return ERROR; + } + + get_image_header(primary, &header); + buf = malloc(header.size); + if (!buf) + { + ret = ERROR; + goto exit_with_error; + } + + bytes = pread(primary, buf, header.size, header.header_size); + if (bytes != header.size) + { + ret = ERROR; + goto exit_with_error; + } + + memcpy((uint32_t *)CONFIG_NXBOOT_RAMSTART, buf, header.size); + +exit_with_error: + flash_partition_close(primary); + free(buf); + + return ret; +} +#endif + /**************************************************************************** * Public Functions ****************************************************************************/ @@ -528,7 +627,9 @@ int nxboot_get_state(struct nxboot_state *state) state->update = NXBOOT_TERTIARY_SLOT_NUM; } + nxboot_progress(nxboot_progress_start, validate_recovery); state->recovery_valid = validate_image(recovery); + nxboot_progress(nxboot_progress_end); state->recovery_present = primary_header.crc == recovery_header->crc; /* The image is confirmed if it has either NXBOOT_HEADER_MAGIC or a @@ -611,7 +712,7 @@ int nxboot_get_confirm(void) int recovery; int recovery_pointer; char *path; - int ret = 0; + int ret = OK; struct nxboot_img_header primary_header; struct nxboot_img_header recovery_header; @@ -799,6 +900,7 @@ int nxboot_perform_update(bool check_only) */ syslog(LOG_ERR, "Update process failed: %s\n", strerror(errno)); + nxboot_progress(nxboot_error, update_failed); } } @@ -823,3 +925,4 @@ int nxboot_perform_update(bool check_only) return ret; } + diff --git a/boot/nxboot/loader/flash.c b/boot/nxboot/loader/flash.c index e7a53b83c16..fdbab4bb99d 100644 --- a/boot/nxboot/loader/flash.c +++ b/boot/nxboot/loader/flash.c @@ -202,8 +202,8 @@ int flash_partition_read(int fd, void *buf, size_t count, off_t off) nbytes = read(fd, buf, count); if (nbytes != count) { - syslog(LOG_ERR, "Read from offset %ld failed %s\n", - off, strerror(errno)); + syslog(LOG_ERR, "Read from offset %ld failed %s\n", off, + strerror(errno)); return ERROR; } @@ -265,7 +265,7 @@ int flash_partition_erase_first_sector(int fd) if (ret < 0) { syslog(LOG_ERR, "Could not erase the partition: %s\n", - strerror(errno)); + strerror(errno)); return ERROR; } @@ -295,7 +295,8 @@ int flash_partition_info(int fd, struct flash_partition_info *info) ret = ioctl(fd, MTDIOC_GEOMETRY, (unsigned long)((uintptr_t)&geometry)); if (ret < 0) { - syslog(LOG_ERR, "ioctl MTDIOC_GEOMETRY failed: %s\n", strerror(errno)); + syslog(LOG_ERR, "ioctl MTDIOC_GEOMETRY failed: %s\n", + strerror(errno)); return ERROR; } diff --git a/boot/nxboot/nxboot_main.c b/boot/nxboot/nxboot_main.c index 09e556b2b1b..0d0084ad0c6 100644 --- a/boot/nxboot/nxboot_main.c +++ b/boot/nxboot/nxboot_main.c @@ -28,28 +28,235 @@ #include #include - +#include +#include #include #include +/**************************************************************************** + * Private Types + ****************************************************************************/ + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +static bool g_progress_started = false; +#ifdef CONFIG_NXBOOT_PRINTF_PROGRESS_PERCENT +static bool g_progress_percent_started = false; +#endif + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +#ifdef CONFIG_NXBOOT_PRINTF_PROGRESS + +# ifdef CONFIG_NXBOOT_PRINTF_PROGRESS_PERCENT +static const char backtab[] = +{ + ASCII_BS, ASCII_BS, ASCII_BS, ASCII_BS, '\0', +}; +# endif + +static const char *progress_msgs[] = +{ + [startup_msg] = "*** nxboot ***", + [power_reset] = "Power Reset detected, check images only", + [soft_reset] = "Soft reset detected, check for update", + [found_bootable_image] = "Found bootable image, boot from primary", + [no_bootable_image] = "No bootable image found", + [boardioc_image_boot_fail] = "Board failed to boot bootable image", + [ramcopy_started] = "Copying bootable image to RAM", + [recovery_revert] = "Reverting image to recovery", + [recovery_create] = "Creating recovery image", + [update_from_update] = "Updating from update image", + [validate_primary] = "Validating primary image", + [validate_recovery] = "Validating recovery image", + [validate_update] = "Validating update image", + [recovery_created] = "Recovery image created", + [recovery_invalid] = "Recovery image invalid, update stopped", + [update_failed] = "Update failed", +}; +#endif /* CONFIG_NXBOOT_PRINTF_PROGRESS */ + +/**************************************************************************** + * Private Function Prototypes + ****************************************************************************/ + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + /**************************************************************************** * Public Functions ****************************************************************************/ +/**************************************************************************** + * Name: nxboot_progress + * + * Description: + * If enabled, this function prints progress messages to stdout. + * Messages are handled via integer enums, allowing this function to be + * easily replaced if required with no changes needed to the underlying + * code + * + * Input Parameters: + * type - the progress message type to be printed, as per progress_type_e: + * - nxboot_info: Prefixes arg. string with "INFO:" + * - nxboot_error: Prefixes arg. string with "ERR:" + * - nxboot_progress_start: Prints arg. string with no newline + * to allow a ..... sequence + * or % remaining to follow + * - nxboot_progress_dot: Prints a "." to the ..... sequence + * - nxboot_progress_percent: Displays progress as % remaining + * - nxboot_progress_end, Flags end of a progrees sequence + * + * ... - variadic argument: + * - the enum (int) reference to the message string or + * - the % remaining in the case of type: nxboot_progress_percent + * + * Returned Value: + * None + * + ****************************************************************************/ + +void nxboot_progress(enum progress_type_e type, ...) +{ +#ifdef CONFIG_NXBOOT_PRINTF_PROGRESS + va_list arg; + + va_start(arg, type); + + switch (type) + { + case nxboot_info: + { + int idx = va_arg(arg, int); + assert(progress_msgs[idx]); + if (strlen(progress_msgs[idx]) == 0) + { + syslog(LOG_ERR, "No progress message for idx: %d\n", idx); + break; + } + + dprintf(STDOUT_FILENO, "%s\n", progress_msgs[idx]); + } + break; + case nxboot_error: + { + int idx = va_arg(arg, int); + assert(progress_msgs[idx]); + if (strlen(progress_msgs[idx]) == 0) + { + syslog(LOG_ERR, "No progress message for idx: %d\n", idx); + break; + } + + dprintf(STDOUT_FILENO, "ERROR: %s\n", progress_msgs[idx]); + } + break; + case nxboot_progress_start: + { + int idx = va_arg(arg, int); + assert(progress_msgs[idx]); + if (strlen(progress_msgs[idx]) == 0) + { + syslog(LOG_ERR, "No progress message for idx: %d\n", idx); + break; + } + + dprintf(STDOUT_FILENO, "%s", progress_msgs[idx]); + g_progress_started = true; + } + break; + case nxboot_progress_dot: + { + assert(g_progress_started); + if (!g_progress_started) + { + syslog(LOG_ERR, "Progress dot requested " + "but no previous progress start\n"); + } + else + { + dprintf(STDOUT_FILENO, "."); + } + } + break; +#ifdef CONFIG_NXBOOT_PRINTF_PROGRESS_PERCENT + case nxboot_progress_percent: + { + assert(g_progress_started); + if (!g_progress_started) + { + syslog(LOG_ERR, "Progress percent requested " + "but no previous progress start\n"); + } + else + { + int percent = va_arg(arg, int); + if (!g_progress_percent_started) + { + g_progress_percent_started = true; + dprintf(STDOUT_FILENO, ": "); + } + else + { + dprintf(STDOUT_FILENO, "%s", backtab); + } + + dprintf(STDOUT_FILENO, "%3d%%", MIN(percent, 100)); + } + } + break; +#endif + case nxboot_progress_end: + { + assert(g_progress_started); + if (!g_progress_started) + { + syslog(LOG_ERR, "Progress dot stop requested " + "but no previous progress start\n"); + } + else + { + dprintf(STDOUT_FILENO, "\n"); + } + + g_progress_started = false; +#ifdef CONFIG_NXBOOT_PRINTF_PROGRESS_PERCENT + g_progress_percent_started = false; +#endif + } + break; + default: + { + assert(false); + syslog(LOG_ERR, "Invalid progress message type: %d\n", type); + dprintf(STDOUT_FILENO, "progress: unknown type!\n"); + } + break; + } + + va_end(arg); +#endif /* CONFIG_NXBOOT_PRINTF_PROGRESS */ +} + /**************************************************************************** * Name: nxboot_main * * Description: - * NuttX bootlaoder entry point. + * NuttX bootloader entry point. * ****************************************************************************/ int main(int argc, FAR char *argv[]) { + int ret; struct boardioc_boot_info_s info; bool check_only; #ifdef CONFIG_NXBOOT_SWRESET_ONLY - int ret; FAR struct boardioc_reset_cause_s cause; #endif @@ -66,6 +273,7 @@ int main(int argc, FAR char *argv[]) #endif syslog(LOG_INFO, "*** nxboot ***\n"); + nxboot_progress(nxboot_info, startup_msg); #ifdef CONFIG_NXBOOT_SWRESET_ONLY check_only = true; @@ -77,10 +285,12 @@ int main(int argc, FAR char *argv[]) cause.cause == BOARDIOC_RESETCAUSE_PIN) { check_only = false; + nxboot_progress(nxboot_info, soft_reset); } else { syslog(LOG_INFO, "Power reset detected, performing check only.\n"); + nxboot_progress(nxboot_info, power_reset); } } #else @@ -90,15 +300,28 @@ int main(int argc, FAR char *argv[]) if (nxboot_perform_update(check_only) < 0) { syslog(LOG_ERR, "Could not find bootable image.\n"); - return 0; + nxboot_progress(nxboot_error, no_bootable_image); + return OK; } syslog(LOG_INFO, "Found bootable image, boot from primary.\n"); + nxboot_progress(nxboot_info, found_bootable_image); + +#ifdef CONFIG_NXBOOT_COPY_TO_RAM + syslog(LOG_INFO, "Copying image to RAM.\n"); + nxboot_ramcopy(); +#endif /* Call board specific image boot */ info.path = CONFIG_NXBOOT_PRIMARY_SLOT_PATH; info.header_size = CONFIG_NXBOOT_HEADER_SIZE; - return boardctl(BOARDIOC_BOOT_IMAGE, (uintptr_t)&info); + ret = boardctl(BOARDIOC_BOOT_IMAGE, (uintptr_t)&info); + + /* Only get here if the board boot fails */ + + nxboot_progress(nxboot_error, boardioc_image_boot_fail); + + return ret; } From 4f5c28343888215e01fa564333807cbafac914a8 Mon Sep 17 00:00:00 2001 From: dongjiuzhu1 Date: Tue, 10 Jun 2025 10:10:25 +0800 Subject: [PATCH 296/391] testing/fs: update api name fs_getfilep/fs_putfilep to file_get/file_put Signed-off-by: dongjiuzhu1 --- .../{fs_getfilep_test.c => fs_file_get_test.c} | 14 +++++++------- testing/testsuites/kernel/fs/cmocka_fs_test.c | 2 +- testing/testsuites/kernel/fs/include/fstest.h | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) rename testing/testsuites/kernel/fs/cases/{fs_getfilep_test.c => fs_file_get_test.c} (91%) diff --git a/testing/testsuites/kernel/fs/cases/fs_getfilep_test.c b/testing/testsuites/kernel/fs/cases/fs_file_get_test.c similarity index 91% rename from testing/testsuites/kernel/fs/cases/fs_getfilep_test.c rename to testing/testsuites/kernel/fs/cases/fs_file_get_test.c index 06aff68653b..dd61c1f9099 100644 --- a/testing/testsuites/kernel/fs/cases/fs_getfilep_test.c +++ b/testing/testsuites/kernel/fs/cases/fs_file_get_test.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/testing/testsuites/kernel/fs/cases/fs_getfilep_test.c + * apps/testing/testsuites/kernel/fs/cases/fs_file_get_test.c * * SPDX-License-Identifier: Apache-2.0 * @@ -45,10 +45,10 @@ ****************************************************************************/ /**************************************************************************** - * Name: test_nuttx_fs_getfilep01 + * Name: test_nuttx_fs_file_get01 ****************************************************************************/ -void test_nuttx_fs_getfilep01(FAR void **state) +void test_nuttx_fs_file_get01(FAR void **state) { FAR struct file *filep; int ret; @@ -72,7 +72,7 @@ void test_nuttx_fs_getfilep01(FAR void **state) /* get struct file */ - ret = fs_getfilep(fileno(fp), &filep); + ret = file_get(fileno(fp), &filep); assert_int_equal(ret, 0); /* malloc memory */ @@ -100,11 +100,11 @@ void test_nuttx_fs_getfilep01(FAR void **state) /* put filep */ - fs_putfilep(filep); + file_put(filep); /* get struct file again */ - ret = fs_getfilep(fileno(fp), &filep); + ret = file_get(fileno(fp), &filep); assert_int_equal(ret, 0); assert_int_equal(filep->f_pos, BUF_SIZE); @@ -113,7 +113,7 @@ void test_nuttx_fs_getfilep01(FAR void **state) /* put filep */ - fs_putfilep(filep); + file_put(filep); assert_int_equal(fclose(fp), 0); } diff --git a/testing/testsuites/kernel/fs/cmocka_fs_test.c b/testing/testsuites/kernel/fs/cmocka_fs_test.c index c5917c3676b..2b4101246c6 100644 --- a/testing/testsuites/kernel/fs/cmocka_fs_test.c +++ b/testing/testsuites/kernel/fs/cmocka_fs_test.c @@ -84,7 +84,7 @@ int main(int argc, char *argv[]) cmocka_unit_test_setup_teardown(test_nuttx_fs_fsync02, test_nuttx_fs_test_group_setup, test_nuttx_fs_test_group_teardown), - cmocka_unit_test_setup_teardown(test_nuttx_fs_getfilep01, + cmocka_unit_test_setup_teardown(test_nuttx_fs_file_get01, test_nuttx_fs_test_group_setup, test_nuttx_fs_test_group_teardown), cmocka_unit_test_setup_teardown(test_nuttx_fs_mkdir01, diff --git a/testing/testsuites/kernel/fs/include/fstest.h b/testing/testsuites/kernel/fs/include/fstest.h index 4892f0ad553..0a590bf88bf 100644 --- a/testing/testsuites/kernel/fs/include/fstest.h +++ b/testing/testsuites/kernel/fs/include/fstest.h @@ -111,10 +111,10 @@ void test_nuttx_fs_fstatfs01(FAR void **state); void test_nuttx_fs_fsync01(FAR void **state); void test_nuttx_fs_fsync02(FAR void **state); -/* cases/fs_getfilep_test.c +/* cases/fs_file_get_test.c * ************************************************/ -void test_nuttx_fs_getfilep01(FAR void **state); +void test_nuttx_fs_file_get01(FAR void **state); /* cases/fs_mkdir_test.c * ************************************************/ From 9a73fb7f4b25410ea44365dc3e0fbe5ab8661411 Mon Sep 17 00:00:00 2001 From: Michal Lenc Date: Fri, 13 Jun 2025 08:30:18 +0200 Subject: [PATCH 297/391] benchmarks/osperf/osperf.c: fix spelling mistakes Signed-off-by: Michal Lenc --- benchmarks/osperf/osperf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/benchmarks/osperf/osperf.c b/benchmarks/osperf/osperf.c index c5b680613d7..536d5505412 100644 --- a/benchmarks/osperf/osperf.c +++ b/benchmarks/osperf/osperf.c @@ -188,10 +188,10 @@ static size_t pthread_create_performance(void) } /**************************************************************************** - * Contxt create performance + * Context create performance ****************************************************************************/ -static FAR void *context_swtich_task(FAR void *arg) +static FAR void *context_switch_task(FAR void *arg) { FAR struct performance_time_s *time = arg; sched_yield(); @@ -204,7 +204,7 @@ static size_t context_switch_performance(void) struct performance_time_s time; int tid; - tid = performance_thread_create(context_swtich_task, &time, + tid = performance_thread_create(context_switch_task, &time, CONFIG_INIT_PRIORITY); sched_yield(); performance_start(&time); From 7ca3656c3ef352f1b7c38950b54d7867f1672be9 Mon Sep 17 00:00:00 2001 From: Michal Lenc Date: Fri, 13 Jun 2025 08:35:06 +0200 Subject: [PATCH 298/391] benchmarks/osperf/osperf.c: add pipe read-write performance test This adds a simple pip read-write performance test. Signed-off-by: Michal Lenc --- benchmarks/osperf/osperf.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/benchmarks/osperf/osperf.c b/benchmarks/osperf/osperf.c index 536d5505412..0e71a4e0548 100644 --- a/benchmarks/osperf/osperf.c +++ b/benchmarks/osperf/osperf.c @@ -71,6 +71,7 @@ static size_t pthread_switch_performance(void); static size_t context_switch_performance(void); static size_t hpwork_performance(void); static size_t poll_performance(void); +static size_t pipe_performance(void); static size_t semwait_performance(void); static size_t sempost_performance(void); @@ -85,6 +86,7 @@ static const struct performance_entry_s g_entry_list[] = {"context-switch", context_switch_performance}, {"hpwork", hpwork_performance}, {"poll-write", poll_performance}, + {"pipe-rw", pipe_performance}, {"semwait", semwait_performance}, {"sempost", sempost_performance}, }; @@ -290,6 +292,30 @@ static size_t poll_performance(void) return performance_gettime(&result); } +/**************************************************************************** + * pipe performance + ****************************************************************************/ + +static size_t pipe_performance(void) +{ + struct performance_time_s result; + int pipefd[2]; + int ret; + char r; + + ret = pipe(pipefd); + DEBUGASSERT(ret == 0); + + performance_start(&result); + write(pipefd[0], "a", 1); + read(pipefd[1], &r, 1); + performance_end(&result); + + close(pipefd[0]); + close(pipefd[1]); + return performance_gettime(&result); +} + /**************************************************************************** * semwait_performance ****************************************************************************/ From 4c605ac43f92c0cee74c277a1ce19c641cb90bda Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Wed, 11 Jun 2025 21:54:55 +0800 Subject: [PATCH 299/391] system/fastboot: dump all memory regions Add examples for oem memdump dumping all memory regions. Host side $ fastboot oem memdump fastboot oem memdump 0x20000 0x28000 fastboot get_staged 0x20000.bin fastboot oem memdump 0x40000000 0xf590000 fastboot get_staged 0x40000000.bin fastboot oem memdump 0x4ff30000 0xd0000 fastboot get_staged 0x4ff30000.bin FAILED (remote: 'Invalid argument') fastboot: error: Command failed Device side nsh> fastbootd -h Usage: fastbootd [wait_ms] memdump: fastboot oem memdump 0x20000 0x28000 fastboot get_staged 0x20000.bin fastboot oem memdump 0x40000000 0xf590000 fastboot get_staged 0x40000000.bin fastboot oem memdump 0x4ff30000 0xd0000 fastboot get_staged 0x4ff30000.bin Signed-off-by: wangjianyu3 --- system/fastboot/fastboot.c | 44 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/system/fastboot/fastboot.c b/system/fastboot/fastboot.c index 4fa882eee55..df250290d02 100644 --- a/system/fastboot/fastboot.c +++ b/system/fastboot/fastboot.c @@ -25,6 +25,7 @@ ****************************************************************************/ #include +#include #include #include @@ -156,6 +157,8 @@ struct fastboot_cmd_s FAR const char *arg); }; +typedef void (*memdump_print_t)(FAR void *, FAR char *); + /**************************************************************************** * Private Function Prototypes ****************************************************************************/ @@ -211,6 +214,13 @@ static const struct fastboot_cmd_s g_oem_cmd[] = #endif }; +#ifdef CONFIG_BOARD_MEMORY_RANGE +static const struct memory_region_s g_memory_region[] = +{ + CONFIG_BOARD_MEMORY_RANGE +}; +#endif + /**************************************************************************** * Private Functions ****************************************************************************/ @@ -650,6 +660,37 @@ static int fastboot_memdump_upload(FAR struct fastboot_ctx_s *context) context->upload_param.size); } +static void fastboot_memdump_region(memdump_print_t memprint, FAR void *priv) +{ +#ifdef CONFIG_BOARD_MEMORY_RANGE + char response[FASTBOOT_MSG_LEN - 4]; + size_t index; + + for (index = 0; index < nitems(g_memory_region); index++) + { + snprintf(response, sizeof(response), + "fastboot oem memdump 0x%" PRIxPTR " 0x%" PRIxPTR "\n", + g_memory_region[index].start, + g_memory_region[index].end - g_memory_region[index].start); + memprint(priv, response); + snprintf(response, sizeof(response), + "fastboot get_staged 0x%" PRIxPTR ".bin\n", + g_memory_region[index].start); + memprint(priv, response); + } +#endif +} + +static void fastboot_memdump_syslog(FAR void *priv, FAR char *response) +{ + fb_err(" %s", response); +} + +static void fastboot_memdump_response(FAR void *priv, FAR char *response) +{ + fastboot_ack((FAR struct fastboot_ctx_s *)priv, "TEXT", response); +} + /* Usage(host): * fastboot oem memdump * @@ -666,6 +707,7 @@ static void fastboot_memdump(FAR struct fastboot_ctx_s *context, &context->upload_param.u.mem.addr, &context->upload_param.size) != 2) { + fastboot_memdump_region(fastboot_memdump_response, context); fastboot_fail(context, "Invalid argument"); return; } @@ -1044,6 +1086,8 @@ int main(int argc, FAR char **argv) if (strcmp(argv[1], "-h") == 0) { fb_err("Usage: fastbootd [wait_ms]\n"); + fb_err("\nmemdump: \n"); + fastboot_memdump_region(fastboot_memdump_syslog, NULL); return 0; } From 7375f6574e7c0c2a143c349194a9e2c36985d79d Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Sun, 15 Jun 2025 01:00:22 +0800 Subject: [PATCH 300/391] system/fastboot: move usbdev init after help Move initialization of usbdev to after help(). This patch fix that even users just run `fastbootd -h`, the usbdev will also be (re)initialized, and if the daemon is running the status will be broken. Signed-off-by: wangjianyu3 --- system/fastboot/fastboot.c | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/system/fastboot/fastboot.c b/system/fastboot/fastboot.c index df250290d02..734561798db 100644 --- a/system/fastboot/fastboot.c +++ b/system/fastboot/fastboot.c @@ -1035,16 +1035,8 @@ static int fastboot_open_usb(int index, int flags) return -errno; } -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -int main(int argc, FAR char **argv) +static int fastboot_usbdev_initialize(void) { - struct fastboot_ctx_s context; - FAR void *buffer = NULL; - int ret = OK; - #ifdef CONFIG_SYSTEM_FASTBOOTD_USB_BOARDCTL struct boardioc_usbdev_ctrl_s ctrl; # ifdef CONFIG_USBDEV_COMPOSITE @@ -1053,6 +1045,7 @@ int main(int argc, FAR char **argv) uint8_t dev = BOARDIOC_USBDEV_FASTBOOT; # endif FAR void *handle; + int ret; ctrl.usbdev = dev; ctrl.action = BOARDIOC_USBDEV_INITIALIZE; @@ -1063,7 +1056,7 @@ int main(int argc, FAR char **argv) ret = boardctl(BOARDIOC_USBDEV_CONTROL, (uintptr_t)&ctrl); if (ret < 0) { - fb_err("boardctl(BOARDIOC_USBDEV_CONTROL) failed: %d\n", ret); + fb_err("boardctl(BOARDIOC_USBDEV_INITIALIZE) failed: %d\n", ret); return ret; } @@ -1076,11 +1069,24 @@ int main(int argc, FAR char **argv) ret = boardctl(BOARDIOC_USBDEV_CONTROL, (uintptr_t)&ctrl); if (ret < 0) { - fb_err("boardctl(BOARDIOC_USBDEV_CONTROL) failed: %d\n", ret); + fb_err("boardctl(BOARDIOC_USBDEV_CONNECT) failed: %d\n", ret); return ret; } #endif /* SYSTEM_FASTBOOTD_USB_BOARDCTL */ + return 0; +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +int main(int argc, FAR char **argv) +{ + struct fastboot_ctx_s context; + FAR void *buffer = NULL; + int ret = OK; + if (argc > 1) { if (strcmp(argv[1], "-h") == 0) @@ -1098,6 +1104,12 @@ int main(int argc, FAR char **argv) context.wait_ms = 0; } + ret = fastboot_usbdev_initialize(); + if (ret < 0) + { + return ret; + } + buffer = malloc(CONFIG_SYSTEM_FASTBOOTD_DOWNLOAD_MAX); if (buffer == NULL) { From 5e50e2c1f95b35582346c374fb3ce10f5ba0b260 Mon Sep 17 00:00:00 2001 From: Matteo Golin Date: Sat, 7 Jun 2025 15:01:58 -0400 Subject: [PATCH 301/391] system/syslogd: Initial implementation Initial implementation of syslogd including version information, simple usage help and UDP transmission. The current implementation transmits RFC 5424 formatted syslog entries over UDP for consumption by a syslog collector. Only some options from the manpage are implemented since NuttX doesn't currently have the ability for some of the more complex features (-l, etc.). Signed-off-by: Matteo Golin --- .gitignore | 1 + system/syslogd/CMakeLists.txt | 36 ++++ system/syslogd/Kconfig | 53 +++++ system/syslogd/Make.defs | 25 +++ system/syslogd/Makefile | 36 ++++ system/syslogd/syslogd_main.c | 376 ++++++++++++++++++++++++++++++++++ 6 files changed, 527 insertions(+) create mode 100644 system/syslogd/CMakeLists.txt create mode 100644 system/syslogd/Kconfig create mode 100644 system/syslogd/Make.defs create mode 100644 system/syslogd/Makefile create mode 100644 system/syslogd/syslogd_main.c diff --git a/.gitignore b/.gitignore index 5bf6033a628..d0382885b92 100644 --- a/.gitignore +++ b/.gitignore @@ -48,3 +48,4 @@ build compile_commands.json .aider* .clang-format +.cache diff --git a/system/syslogd/CMakeLists.txt b/system/syslogd/CMakeLists.txt new file mode 100644 index 00000000000..61d74f67bc1 --- /dev/null +++ b/system/syslogd/CMakeLists.txt @@ -0,0 +1,36 @@ +# ############################################################################## +# apps/system/syslogd/CMakeLists.txt +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_SYSTEM_SYSLOGD) + nuttx_add_application( + MODULE + ${CONFIG_SYSTEM_SYSLOGD} + NAME + ${CONFIG_SYSTEM_SYSLOGD_PROGNAME} + STACKSIZE + ${CONFIG_SYSTEM_SYSLOGD_STACKSIZE} + PRIORITY + ${CONFIG_SYSTEM_SYSLOGD_PRIORITY} + SRCS + syslogd_main.c) + +endif() diff --git a/system/syslogd/Kconfig b/system/syslogd/Kconfig new file mode 100644 index 00000000000..b346dc1459a --- /dev/null +++ b/system/syslogd/Kconfig @@ -0,0 +1,53 @@ +# +# For a description of the syntax of this configuration file, +# see the file kconfig-language.txt in the NuttX tools repository. +# + +config SYSTEM_SYSLOGD + bool "syslogd utility" + default n + depends on NET_UDP && SYSLOG_RFC5424 + ---help--- + Enable support for the 'syslogd' utility. This utility will read syslog + messages from the syslog device and transmit them over UDP in RFC 5424 + compatible format. Ensure the syslog device being used is capable of being + read from. + +if SYSTEM_SYSLOGD + +config SYSTEM_SYSLOGD_PROGNAME + string "syslogd progname" + default "syslogd" + ---help--- + This is the name of the program that will be used when the syslogd + program is installed. + +config SYSTEM_SYSLOGD_PRIORITY + int "syslogd task priority" + default 100 + +config SYSTEM_SYSLOGD_STACKSIZE + int "syslogd stack size" + default DEFAULT_TASK_STACKSIZE + +config SYSTEM_SYSLOGD_ENTRYSIZE + int "Max entry size" + default 480 + ---help--- + The maximum size (in bytes) of the UDP message buffer for sending syslog + entries. Set this value to the expected maximum length of a syslog entry. RFC + 5424 specifies a minimum maximum of 480. + +config SYSTEM_SYSLOGD_PORT + int "syslogd port" + default 514 + ---help--- + The default port for syslogd to send UDP traffic to. + +config SYSTEM_SYSLOGD_ADDR + string "Log server address" + default "127.0.0.1" + ---help--- + The network address for syslogd to send UDP traffic to. + +endif diff --git a/system/syslogd/Make.defs b/system/syslogd/Make.defs new file mode 100644 index 00000000000..ad90cf9da22 --- /dev/null +++ b/system/syslogd/Make.defs @@ -0,0 +1,25 @@ +############################################################################ +# apps/system/syslogd/Make.defs +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for asyslogditional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +ifneq ($(CONFIG_SYSTEM_SYSLOGD),) +CONFIGURED_APPS += $(APPDIR)/system/syslogd +endif diff --git a/system/syslogd/Makefile b/system/syslogd/Makefile new file mode 100644 index 00000000000..dd60b83531e --- /dev/null +++ b/system/syslogd/Makefile @@ -0,0 +1,36 @@ +############################################################################ +# apps/system/syslogd/Makefile +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +include $(APPDIR)/Make.defs + +# Standalone syslogd command + +PROGNAME = $(CONFIG_SYSTEM_SYSLOGD_PROGNAME) +PRIORITY = $(CONFIG_SYSTEM_SYSLOGD_PRIORITY) +STACKSIZE = $(CONFIG_SYSTEM_SYSLOGD_STACKSIZE) +MODULE = $(CONFIG_SYSTEM_SYSLOGD) + +# Files + +MAINSRC = syslogd_main.c + +include $(APPDIR)/Application.mk diff --git a/system/syslogd/syslogd_main.c b/system/syslogd/syslogd_main.c new file mode 100644 index 00000000000..27c13118685 --- /dev/null +++ b/system/syslogd/syslogd_main.c @@ -0,0 +1,376 @@ +/**************************************************************************** + * apps/system/syslogd/syslogd_main.c + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for asyslogditional information regarding copyright ownership. + * The ASF licenses this file to you under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef CONFIG_LIBC_EXECFUNCS +#include +#endif + +#include +#include + +#include +#include +#include + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* syslogd program version */ + +#define SYSLOGD_VERSION "0.0.0" + +/* Minimum buffer size check */ + +#if CONFIG_SYSTEM_SYSLOGD_ENTRYSIZE < 480 +#error "SYSTEM_SYSLOGD_ENTRYSIZE must be more than 480 to satisfy RFC 5424" +#endif + +/* Maximum number of arguments that can be passed to syslogd */ + +#define MAX_ARGS 8 + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: print_usage + ****************************************************************************/ + +static void print_usage(void) +{ + fprintf(stderr, "usage:\n"); + fprintf(stderr, " %s [-vdn]\n", CONFIG_SYSTEM_SYSLOGD_PROGNAME); +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +int main(int argc, FAR char **argv) +{ + int fd; + int sock; + int c; + ssize_t bread; + ssize_t bsent; + ssize_t endpos; + char *end; + size_t bufpos = 0; + struct sockaddr_in server; + char buffer[CONFIG_SYSTEM_SYSLOGD_ENTRYSIZE]; + bool debugmode = false; + bool skiplog = false; +#ifdef CONFIG_LIBC_EXECFUNCS + pid_t pid; + bool background = true; + char *new_argv[MAX_ARGS + 1]; +#endif + + /* Parse command line options */ + + while ((c = getopt(argc, argv, ":vdn")) != -1) + { + switch (c) + { + case 'v': + + /* Print version and exit */ + + printf("%s " SYSLOGD_VERSION " (NuttX)\n", argv[0]); + return EXIT_SUCCESS; + + case 'd': + + /* Enable debug mode and stay in foreground */ + + debugmode = true; + printf("Enabling debug mode.\n"); +#ifdef CONFIG_LIBC_EXECFUNCS + background = false; +#endif + break; + + case 'n': + + /* Stay in foreground */ + +#ifdef CONFIG_LIBC_EXECFUNCS + background = false; +#endif + break; + + case '?': + print_usage(); + exit(EXIT_FAILURE); + break; + } + } + + /* Run this program in the background as a spawned task if the background + * option was selected. + */ + +#ifdef CONFIG_LIBC_EXECFUNCS + if (background) + { + /* Set up the arguments, which is identical to the original except with + * an added `-n` flag to ensure that the new process does not 'respawn' + */ + + if (argc > MAX_ARGS) + { + fprintf(stderr, + "Cannot spawn syslogd daemon: arg count %d exceeds %d", + argc, MAX_ARGS); + return EXIT_FAILURE; + } + + new_argv[0] = argv[0]; /* Same program name */ + new_argv[1] = "-n"; /* Prevent daemon from spawning another child */ + memcpy(&new_argv[2], &argv[1], sizeof(char *) * (argc - 1)); + + /* Spawn the child for backgrounding now */ + + if (posix_spawn(&pid, argv[0], NULL, NULL, new_argv, NULL) != 0) + { + fprintf(stderr, "Failed to fork() to background process: %d\n", + errno); + return EXIT_FAILURE; + } + else + { + /* We succeeded in spawning, exit now. */ + + return EXIT_SUCCESS; + } + } +#endif /* CONFIG_LIBC_EXECFUNCS */ + + /* Set up client connection information */ + + server.sin_family = AF_INET; + server.sin_port = htons(CONFIG_SYSTEM_SYSLOGD_PORT); + server.sin_addr.s_addr = inet_addr(CONFIG_SYSTEM_SYSLOGD_ADDR); + + if (server.sin_addr.s_addr == INADDR_NONE) + { + fprintf(stderr, "Invalid address '%s'\n", CONFIG_SYSTEM_SYSLOGD_ADDR); + return EXIT_FAILURE; + } + + /* Create a UDP socket */ + + if (debugmode) + { + printf("Creating UDP socket %s:%u\n", CONFIG_SYSTEM_SYSLOGD_ADDR, + CONFIG_SYSTEM_SYSLOGD_PORT); + } + + sock = socket(AF_INET, SOCK_DGRAM, 0); + if (sock < 0) + { + fprintf(stderr, "Couldn't create UDP socket: %d\n", errno); + return EXIT_FAILURE; + } + + /* Open syslog stream */ + + if (debugmode) + { + printf("Opening syslog device '%s' to read entries.\n", + CONFIG_SYSLOG_DEVPATH); + } + + fd = open(CONFIG_SYSLOG_DEVPATH, O_RDWR); + if (fd < 0) + { + fprintf(stderr, "Could not open syslog stream: %d", errno); + close(sock); + return EXIT_FAILURE; + } + + /* Transmit syslog messages forever */ + + if (debugmode) + { + printf("Beginning to continuously transmit syslog entries.\n"); + } + + for (; ; ) + { + /* Read as much data as possible into the remaining space in our buffer + */ + + bread = read(fd, &buffer[bufpos], sizeof(buffer) - bufpos); + if (bread < 0) + { + fprintf(stderr, "Failed to read from syslog: %d", errno); + close(fd); + close(sock); + return EXIT_FAILURE; + } + + if (bread == 0 && bufpos == 0) + { + /* Stream is over, terminate the program. */ + + if (debugmode) + { + printf("Syslog stream depleted, exiting...\n"); + } + + break; /* Successful exit */ + } + + /* Get the position of the '\n' character of the syslog entry, + * signifying its end. + */ + + end = memchr(buffer, '\n', bufpos + bread); + if (end == NULL) + { + endpos = -1; + } + else + { + endpos = end - buffer; + } + + if (endpos < 0) + { + /* If we couldn't find a newline character in the buffer, it means + * that the syslog entry doesn't end in our local buffer. We either + * need to: + * + * 1) If `bread` is 0, acknowledge that there is no more data to be + * read and our buffer will never contain a newline character. We + * can exit successfully in this case. + * + * 2) Read more and try again if there's still room in our buffer + * + * 3) Acknowledge that the syslog entry is too long for our buffer + * size, and skip it since we can't construct a UDP packet if + * that's the case. + */ + + if (bread == 0) + { + break; /* Successful exit */ + } + else if (bufpos + bread < sizeof(buffer)) + { + /* Try to get more bytes in our buffer in case we read while + * more bytes were coming. + */ + + bufpos += bread; + continue; + } + + /* If we are here, there's no room left in our buffer. We need to + * skip this entry. + */ + + fprintf(stderr, "Couldn't find end of log in local buffer, " + "skipping entry until the next newline...\n"); + skiplog = true; + bufpos = 0; /* Wipe all buffer contents */ + continue; + } + + /* Print out entry if we are in debug mode and not skipping this line. + * `endpos` + 1 to print newline too. + */ + + if (debugmode && !skiplog) + { + bsent = write(0, buffer, endpos + 1); + if (bsent < 0) + { + fprintf(stderr, "Couldn't print syslog entry: %d\n", errno); + } + } + + /* Send entry over UDP (without newline) if we're not skipping this + * line + */ + + if (!skiplog) + { + bsent = sendto(sock, buffer, endpos, 0, + (const struct sockaddr *)&server, sizeof(server)); + if (bsent < 0) + { + fprintf(stderr, "Couldn't send syslog over UDP: %d\n", errno); + } + } + + /* Take whatever bytes were leftover from our bulk read, and move them + * to the front of the buffer. Mark the new starting point for the next + * read so we don't overwrite them. + * + * endpos + 1 to overwrite vestigial newline character. + */ + + bufpos = (bufpos + bread) - (endpos + 1); + + if (bufpos > 0) + { + /* Copy from right after the newline character up until the end of + * unread bytes + */ + + memcpy(buffer, &buffer[endpos + 1], bufpos); + } + + /* If we got here while skipping a log, it means the endpos for the log + * being skipped was found. Now we're done skipping the log. + */ + + if (skiplog) + { + skiplog = false; + } + } + + close(fd); + close(sock); + + return EXIT_SUCCESS; +} From 38bd6accea3e09a430172e78d076b49daf9fa258 Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Sun, 15 Jun 2025 13:21:18 +0800 Subject: [PATCH 302/391] system/fastboot: add const for memdump_print_t Add qualifier "const" to the declaration of `memdump_print_t`, the value of the 2nd argument will not be changed. Signed-off-by: wangjianyu3 --- system/fastboot/fastboot.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/system/fastboot/fastboot.c b/system/fastboot/fastboot.c index 734561798db..18b2b0e6852 100644 --- a/system/fastboot/fastboot.c +++ b/system/fastboot/fastboot.c @@ -157,7 +157,7 @@ struct fastboot_cmd_s FAR const char *arg); }; -typedef void (*memdump_print_t)(FAR void *, FAR char *); +typedef void (*memdump_print_t)(FAR void *, FAR const char *); /**************************************************************************** * Private Function Prototypes @@ -681,12 +681,13 @@ static void fastboot_memdump_region(memdump_print_t memprint, FAR void *priv) #endif } -static void fastboot_memdump_syslog(FAR void *priv, FAR char *response) +static void fastboot_memdump_syslog(FAR void *priv, FAR const char *response) { fb_err(" %s", response); } -static void fastboot_memdump_response(FAR void *priv, FAR char *response) +static void fastboot_memdump_response(FAR void *priv, + FAR const char *response) { fastboot_ack((FAR struct fastboot_ctx_s *)priv, "TEXT", response); } From 7b42dfc53ecbd9f1bc6ab93ed4eeeed2c88f772d Mon Sep 17 00:00:00 2001 From: Michal Lenc Date: Mon, 16 Jun 2025 10:09:14 +0200 Subject: [PATCH 303/391] boot/nxboot: fix compile errors caused by nxboot_progress Function nxboot_progress is located in nxboot_main.c, but this file is not compiled when NXboot is used as a library to an existing application and not as a bootloader. Therefore, the declaration of nxboot_progress function should be dependent on NXBOOT_PROGRESS config option. Signed-off-by: Michal Lenc --- boot/nxboot/Kconfig | 5 +++++ boot/nxboot/include/nxboot.h | 4 ++++ boot/nxboot/nxboot_main.c | 4 ++++ 3 files changed, 13 insertions(+) diff --git a/boot/nxboot/Kconfig b/boot/nxboot/Kconfig index 6f51370eab0..2f48ed18a28 100644 --- a/boot/nxboot/Kconfig +++ b/boot/nxboot/Kconfig @@ -122,9 +122,14 @@ config NXBOOT_PREVENT_DOWNGRADE WARNING: NXboot currently implements preferences only for MAJOR.MINOR.PATCH and ignores prerelease. +config NXBOOT_PROGRESS + bool + default n + config NXBOOT_PRINTF_PROGRESS bool "Enable progress messages to be sent to STDOUT" default y + select NXBOOT_PROGRESS ---help--- This will display progress during typically lengthy operations: - Calculating checksums diff --git a/boot/nxboot/include/nxboot.h b/boot/nxboot/include/nxboot.h index 6c4a89b3257..6821cc7030b 100644 --- a/boot/nxboot/include/nxboot.h +++ b/boot/nxboot/include/nxboot.h @@ -168,7 +168,11 @@ enum progress_msg_e * Public Function Prototypes ****************************************************************************/ +#ifdef CONFIG_NXBOOT_PROGRESS void nxboot_progress(enum progress_type_e type, ...); +#else +#define nxboot_progress(type, ...) do {} while (0) +#endif /**************************************************************************** * Name: nxboot_get_state diff --git a/boot/nxboot/nxboot_main.c b/boot/nxboot/nxboot_main.c index 0d0084ad0c6..ddc2f228422 100644 --- a/boot/nxboot/nxboot_main.c +++ b/boot/nxboot/nxboot_main.c @@ -41,10 +41,12 @@ * Public Data ****************************************************************************/ +#ifdef CONFIG_NXBOOT_PROGRESS static bool g_progress_started = false; #ifdef CONFIG_NXBOOT_PRINTF_PROGRESS_PERCENT static bool g_progress_percent_started = false; #endif +#endif /**************************************************************************** * Private Data @@ -121,6 +123,7 @@ static const char *progress_msgs[] = * ****************************************************************************/ +#ifdef CONFIG_NXBOOT_PROGRESS void nxboot_progress(enum progress_type_e type, ...) { #ifdef CONFIG_NXBOOT_PRINTF_PROGRESS @@ -242,6 +245,7 @@ void nxboot_progress(enum progress_type_e type, ...) va_end(arg); #endif /* CONFIG_NXBOOT_PRINTF_PROGRESS */ } +#endif /**************************************************************************** * Name: nxboot_main From faea03f1fdedc87c6b783ce89f231a3b2e3e910f Mon Sep 17 00:00:00 2001 From: raiden00pl Date: Sun, 1 Sep 2024 11:38:23 +0200 Subject: [PATCH 304/391] add system/adcscope - streaming tool for ADC add adcscope app allowing to stream data from ADC device with logging/nxscope. Useful for testing ADC drivers. Signed-off-by: raiden00pl --- system/adcscope/CMakeLists.txt | 31 ++ system/adcscope/Kconfig | 109 ++++++++ system/adcscope/Make.defs | 23 ++ system/adcscope/Makefile | 34 +++ system/adcscope/adcscope_main.c | 482 ++++++++++++++++++++++++++++++++ 5 files changed, 679 insertions(+) create mode 100644 system/adcscope/CMakeLists.txt create mode 100644 system/adcscope/Kconfig create mode 100644 system/adcscope/Make.defs create mode 100644 system/adcscope/Makefile create mode 100644 system/adcscope/adcscope_main.c diff --git a/system/adcscope/CMakeLists.txt b/system/adcscope/CMakeLists.txt new file mode 100644 index 00000000000..38c85d7d9d3 --- /dev/null +++ b/system/adcscope/CMakeLists.txt @@ -0,0 +1,31 @@ +# ############################################################################## +# apps/system/adcscope/CMakeLists.txt +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_SYSTEM_ADCSCOPE) + nuttx_add_application( + NAME + ${CONFIG_SYSTEM_ADCSCOPE_PROGNAME} + SRCS + adcscope_main.c + STACKSIZE + ${CONFIG_SYSTEM_ADCSCOPE_STACKSIZE} + PRIORITY + ${CONFIG_SYSTEM_ADCSCOPE_PRIORITY}) +endif() diff --git a/system/adcscope/Kconfig b/system/adcscope/Kconfig new file mode 100644 index 00000000000..803fe83a995 --- /dev/null +++ b/system/adcscope/Kconfig @@ -0,0 +1,109 @@ +# +# For a description of the syntax of this configuration file, +# see the file kconfig-language.txt in the NuttX tools repository. +# + +menuconfig SYSTEM_ADCSCOPE + bool "NxScope ADC stream app" + default n + depends on ADC && LOGGING_NXSCOPE + +if SYSTEM_ADCSCOPE + +config SYSTEM_ADCSCOPE_PROGNAME + string "Program name" + default "adcscope" + +config SYSTEM_ADCSCOPE_PRIORITY + int "adcscope task priority" + default 100 + +config SYSTEM_ADCSCOPE_STACKSIZE + int "adcscope stack size" + default DEFAULT_TASK_STACKSIZE + +config SYSTEM_ADCSCOPE_SERIAL_PATH + string "adcscope serial device path" + default "/dev/ttyUSB0" + +config SYSTEM_ADCSCOPE_SERIAL_BAUD + int "adcscope serial baud" + default 115200 + ---help--- + Ignored if set to 0 (for example for RTT interface) + +config SYSTEM_ADCSCOPE_CDCACM + bool "adcscope CDCACM device support" + depends on CDCACM + default n + +config SYSTEM_ADCSCOPE_FORCE_ENABLE + bool "adcscope force enable" + default n + +config SYSTEM_ADCSCOPE_STREAMBUF_LEN + int "adcscope stream buffer length" + default 512 + +config SYSTEM_ADCSCOPE_RXBUF_LEN + int "adcscope RX buffer length" + default 32 + +config SYSTEM_ADCSCOPE_RX_PADDING + int "adcscope RX padding" + default 0 + ---help--- + This value is returned by NxScope protocol to the client and can + be used to optimize RX transfers when the target supports DMA transfers. + In this case this value should be equal to the DMA RX buffer length. + +config SYSTEM_ADCSCOPE_MAIN_INTERVAL + int "adcscope main interval (microseconds)" + default 100000 + ---help--- + This value is responsible for the frequency at which stream + frames will be sent and incoming frames will be received. + +config SYSTEM_ADCSCOPE_FETCH_INTERVAL + int "adcscope fetch interval (microseconds)" + default 1000 + ---help--- + This value is responsible for the frequency at which the ADC + samples are read. If set to 0, then samples are read at maximum rate. + +config SYSTEM_ADCSCOPE_ADC_PATH + string "adcscope ADC device path" + default "/dev/adc0" + +config SYSTEM_ADCSCOPE_ADCBUF_LEN + int "adcscope buffer length" + default ADC_FIFOSIZE + ---help--- + The number of samples in the buffer used to read from the ADC device. + This is the maximum number of samples that can be read from the ADC + device during one read() operation. + +config SYSTEM_ADCSCOPE_SWTRIG + bool "adcscope uses software trigger" + default n + ---help--- + When this option is set, all read() operations on the ADC device will + be preceded by an ioctl(ANIOC_TRIGGER) call. + +choice + prompt "adcscope data type" + default SYSTEM_ADCSCOPE_INT16 + +config SYSTEM_ADCSCOPE_INT16 + bool "pack ADC data as int16_t" + ---help--- + NxScope send ADC samples as int16_t data. + +config SYSTEM_ADCSCOPE_INT32 + bool "pack ADC data as int32_t" + ---help--- + NxScope send ADC samples as int32_t data. + +endchoice # "adcscope data type" + +endif # SYSTEM_ADCSCOPE diff --git a/system/adcscope/Make.defs b/system/adcscope/Make.defs new file mode 100644 index 00000000000..1e16190e443 --- /dev/null +++ b/system/adcscope/Make.defs @@ -0,0 +1,23 @@ +############################################################################ +# apps/systen/adcscope/Make.defs +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +ifneq ($(CONFIG_SYSTEM_ADCSCOPE),) +CONFIGURED_APPS += $(APPDIR)/system/adcscope +endif diff --git a/system/adcscope/Makefile b/system/adcscope/Makefile new file mode 100644 index 00000000000..663a95ef86a --- /dev/null +++ b/system/adcscope/Makefile @@ -0,0 +1,34 @@ +############################################################################ +# apps/system/adcscope/Makefile +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +include $(APPDIR)/Make.defs + +# adcscope built-in application info + +PROGNAME = $(CONFIG_SYSTEM_ADCSCOPE_PROGNAME) +PRIORITY = $(CONFIG_SYSTEM_ADCSCOPE_PRIORITY) +STACKSIZE = $(CONFIG_SYSTEM_ADCSCOPE_STACKSIZE) +MODULE = $(CONFIG_SYSTEM_ADCSCOPE) + +MAINSRC = adcscope_main.c + +CSRCS = + +include $(APPDIR)/Application.mk diff --git a/system/adcscope/adcscope_main.c b/system/adcscope/adcscope_main.c new file mode 100644 index 00000000000..3413c6b52b9 --- /dev/null +++ b/system/adcscope/adcscope_main.c @@ -0,0 +1,482 @@ +/**************************************************************************** + * apps/system/adcscope/adcscope_main.c + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include "logging/nxscope/nxscope.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* Channel name length */ + +#define CHNAME_MAX 8 + +/* ADC data type */ + +#ifdef CONFIG_SYSTEM_ADCSCOPE_INT16 +# define ADATA_PUT nxscope_put_int16 +# define ADATA_DTYPE NXSCOPE_TYPE_INT16 +#elif defined(CONFIG_SYSTEM_ADCSCOPE_INT32) +# define ADATA_PUT nxscope_put_int32 +# define ADATA_DTYPE NXSCOPE_TYPE_INT32 +#else +# error ADC data type not selected +#endif + +/**************************************************************************** + * Private Type Definition + ****************************************************************************/ + +struct adcscope_thr_env_s +{ + /* NxScope data */ + + struct nxscope_s nxs; + struct nxscope_cfg_s nxs_cfg; + struct nxscope_intf_s intf; + struct nxscope_proto_s proto; + struct nxscope_callbacks_s cbs; + struct nxscope_ser_cfg_s nxs_ser_cfg; + + /* ADC data */ + + int fd; + size_t channels; + size_t data_size; + FAR struct adc_msg_s *data; + FAR char *chname; +}; + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: adcscope_env_init + ****************************************************************************/ + +static int adcscope_env_init(FAR struct adcscope_thr_env_s *envp) +{ + int ret = OK; + + /* Open ADC device */ + + envp->fd = open(CONFIG_SYSTEM_ADCSCOPE_ADC_PATH, O_RDWR); + if (envp->fd <= 0) + { + printf("ERROR: failed to open %s\n", CONFIG_SYSTEM_ADCSCOPE_ADC_PATH); + ret = -errno; + goto errout; + } + + /* Get number of channels */ + + envp->channels = ioctl(envp->fd, ANIOC_GET_NCHANNELS, 0); + if (envp->channels <= 0) + { + printf("ANIOC_GET_NCHANNELS ioctl failed: %d\n", envp->channels); + ret = -errno; + goto errout; + } + + /* Allocate data buffer */ + + envp->data_size = sizeof(struct adc_msg_s) * envp->channels * + CONFIG_SYSTEM_ADCSCOPE_ADCBUF_LEN; + envp->data = zalloc(envp->data_size); + if (!envp->data) + { + printf("ERROR: zalloc failed %d\n", -errno); + ret = -errno; + goto errout; + } + + /* Allocate channels name buffer */ + + envp->chname = zalloc(envp->channels * CHNAME_MAX); + if (!envp->chname) + { + printf("ERROR: zalloc failed %d\n", -errno); + ret = -errno; + goto errout; + } + +errout: + return ret; +} + +/**************************************************************************** + * Name: adcscope_env_clean + ****************************************************************************/ + +static void adcscope_env_clean(FAR struct adcscope_thr_env_s *envp) +{ + /* Free buffers */ + + free(envp->data); + free(envp->chname); +} + +/**************************************************************************** + * Name: nxscope_cb_start + ****************************************************************************/ + +static int nxscope_cb_start(FAR void *priv, bool start) +{ + UNUSED(priv); + + printf("--> nxscope_cb_start: start=%d\n", start); + + return OK; +} + +/**************************************************************************** + * Name: adcscope_nxscope_init + ****************************************************************************/ + +static int adcscope_nxscope_init(FAR struct adcscope_thr_env_s *envp) +{ + int ret; + + /* Default serial protocol */ + + ret = nxscope_proto_ser_init(&envp->proto, NULL); + if (ret < 0) + { + printf("ERROR: nxscope_proto_ser_init failed %d\n", ret); + goto errout_noproto; + } + + /* Configuration */ + + envp->nxs_ser_cfg.path = CONFIG_SYSTEM_ADCSCOPE_SERIAL_PATH; + envp->nxs_ser_cfg.nonblock = true; + envp->nxs_ser_cfg.baud = CONFIG_SYSTEM_ADCSCOPE_SERIAL_BAUD; + + /* Initialize serial interface */ + + ret = nxscope_ser_init(&envp->intf, &envp->nxs_ser_cfg); + if (ret < 0) + { + printf("ERROR: nxscope_ser_init failed %d\n", ret); + goto errout_nointf; + } + + /* Connect callbacks */ + + envp->cbs.start_priv = NULL; + envp->cbs.start = nxscope_cb_start; + + /* Initialize nxscope */ + + envp->nxs_cfg.intf_cmd = &envp->intf; + envp->nxs_cfg.intf_stream = &envp->intf; + envp->nxs_cfg.proto_cmd = &envp->proto; + envp->nxs_cfg.proto_stream = &envp->proto; + envp->nxs_cfg.callbacks = &envp->cbs; + envp->nxs_cfg.channels = envp->channels; + envp->nxs_cfg.streambuf_len = CONFIG_SYSTEM_ADCSCOPE_STREAMBUF_LEN; + envp->nxs_cfg.rxbuf_len = CONFIG_SYSTEM_ADCSCOPE_RXBUF_LEN; + envp->nxs_cfg.rx_padding = CONFIG_SYSTEM_ADCSCOPE_RX_PADDING; + + ret = nxscope_init(&envp->nxs, &envp->nxs_cfg); + if (ret < 0) + { + printf("ERROR: nxscope_init failed %d\n", ret); + goto errout_nonxscope; + } + + return OK; + +errout_nonxscope: + nxscope_proto_ser_deinit(&envp->proto); +errout_nointf: + nxscope_ser_deinit(&envp->intf); +errout_noproto: + return ret; +} + +/**************************************************************************** + * Name: adcscope_nxscope_clean + ****************************************************************************/ + +static void adcscope_nxscope_clean(FAR struct adcscope_thr_env_s *envp) +{ + /* Deinit nxscope */ + + nxscope_deinit(&envp->nxs); + + /* Deinit protocol */ + + nxscope_proto_ser_deinit(&envp->proto); + + /* Deinit interface */ + + nxscope_ser_deinit(&envp->intf); +} + +/**************************************************************************** + * Name: adcscope_samples_thr + ****************************************************************************/ + +static FAR void *adcscope_samples_thr(FAR void *arg) +{ + FAR struct adcscope_thr_env_s *envp = arg; + int ret; + size_t ptr; + size_t i; + + DEBUGASSERT(envp); + + printf("adcscope_samples_thr\n"); + + while (1) + { +#ifdef CONFIG_SYSTEM_ADCSCOPE_SWTRIG + /* Issue the software trigger to start ADC conversion */ + + ret = ioctl(envp->fd, ANIOC_TRIGGER, 0); + if (ret < 0) + { + printf("ERROR: ANIOC_TRIGGER ioctl failed: %d\n", -errno); + return NULL; + } +#endif + + /* Read data from ADC */ + + ret = read(envp->fd, envp->data, envp->data_size); + if (ret < 0) + { + printf("ERROR: read failed %d\n", -errno); + } + else + { + /* Feed data to nxscope */ + + for (ptr = 0; ptr < ret / sizeof(struct adc_msg_s); ) + { + for (i = 0; i < envp->channels; i++) + { + ADATA_PUT(&envp->nxs, i, envp->data[ptr].am_data); + ptr += 1; + } + } + } + +#if CONFIG_SYSTEM_ADCSCOPE_FETCH_INTERVAL > 0 + usleep(CONFIG_SYSTEM_ADCSCOPE_FETCH_INTERVAL); +#endif + } + + return NULL; +} + +#ifdef CONFIG_SYSTEM_ADCSCOPE_CDCACM +/**************************************************************************** + * Name: adcscope_cdcacm_init + ****************************************************************************/ + +static int adcscope_cdcacm_init(void) +{ + struct boardioc_usbdev_ctrl_s ctrl; + FAR void *handle; + int ret; + + ctrl.usbdev = BOARDIOC_USBDEV_CDCACM; + ctrl.action = BOARDIOC_USBDEV_CONNECT; + ctrl.instance = 0; + ctrl.handle = &handle; + + ret = boardctl(BOARDIOC_USBDEV_CONTROL, (uintptr_t)&ctrl); + if (ret < 0) + { + printf("ERROR: BOARDIOC_USBDEV_CONTROL failed %d\n", ret); + goto errout; + } + +errout: + return ret; +} +#endif + +/**************************************************************************** + * Name: adcscope_channels + ****************************************************************************/ + +static int adcscope_channels(FAR struct adcscope_thr_env_s *envp) +{ + union nxscope_chinfo_type_u u; + FAR char *chname; + size_t i; + + for (i = 0; i < envp->channels; i++) + { + /* Get channel name */ + + chname = &envp->chname[i * CHNAME_MAX]; + snprintf(chname, CHNAME_MAX, "chan%d", i); + + /* Register nxscope channel */ + + u.s.dtype = ADATA_DTYPE; + u.s._res = 0; + u.s.cri = 0; + + nxscope_chan_init(&envp->nxs, i, chname, u.u8, 1, 0); + } + + return OK; +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: adcscope_main + ****************************************************************************/ + +int main(int argc, FAR char *argv[]) +{ + struct adcscope_thr_env_s env; + pthread_t thread; + int ret; + +#ifndef CONFIG_NSH_ARCHINIT + /* Perform architecture-specific initialization (if configured) */ + + boardctl(BOARDIOC_INIT, 0); + +# ifdef CONFIG_BOARDCTL_FINALINIT + /* Perform architecture-specific final-initialization (if configured) */ + + boardctl(BOARDIOC_FINALINIT, 0); +# endif +#endif + +#ifdef CONFIG_SYSTEM_ADCSCOPE_CDCACM + /* Initialize the USB CDCACM device */ + + ret = adcscope_cdcacm_init(); + if (ret < 0) + { + printf("ERROR: adcscope_cdcacm_init failed %d\n", ret); + goto errout_noenv; + } +#endif + + /* Initialize environment */ + + ret = adcscope_env_init(&env); + if (ret < 0) + { + printf("ERROR: failed to open %s\n", CONFIG_SYSTEM_ADCSCOPE_ADC_PATH); + goto errout_nonxscope; + } + + /* Initialize NxScope */ + + ret = adcscope_nxscope_init(&env); + if (ret < 0) + { + printf("ERROR: failed to init nxscope\n"); + goto errout_nonxscope; + } + + /* Create channels */ + + ret = adcscope_channels(&env); + if (ret != OK) + { + printf("ERROR: adcscope_channels failed %d\n", ret); + goto errout; + } + + /* Create samples thread */ + + ret = pthread_create(&thread, NULL, adcscope_samples_thr, &env); + if (ret != OK) + { + printf("ERROR: pthread_create failed %d\n", ret); + goto errout; + } + +#ifdef CONFIG_SYSTEM_ADCSCOPE_FORCE_ENABLE + /* Enable channels and enable stream */ + + nxscope_chan_all_en(&nxs, true); + nxscope_stream_start(&nxs, true); +#endif + + /* Main loop */ + + while (1) + { + /* Flush stream data */ + + ret = nxscope_stream(&env.nxs); + if (ret < 0) + { + printf("ERROR: nxscope_stream failed %d\n", ret); + } + + /* Handle recv data */ + + ret = nxscope_recv(&env.nxs); + if (ret < 0) + { + printf("ERROR: nxscope_recv failed %d\n", ret); + } + + usleep(CONFIG_SYSTEM_ADCSCOPE_MAIN_INTERVAL); + } + +errout: + adcscope_nxscope_clean(&env); +errout_nonxscope: + adcscope_env_clean(&env); +#ifdef CONFIG_SYSTEM_ADCSCOPE_CDCACM +errout_noenv: +#endif + return 0; +} From 88fea63ff474b65b3e3a0ba98831e5c60989b650 Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Tue, 17 Jun 2025 16:08:14 +0800 Subject: [PATCH 305/391] system/fastboot: replace GETUINT32 with be32toh Replace macro `FASTBOOT_GETUINT32` with function `be32toh()`. Signed-off-by: wangjianyu3 --- system/fastboot/fastboot.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/system/fastboot/fastboot.c b/system/fastboot/fastboot.c index 18b2b0e6852..773ea232844 100644 --- a/system/fastboot/fastboot.c +++ b/system/fastboot/fastboot.c @@ -29,6 +29,7 @@ #include #include +#include #include #include #include @@ -72,11 +73,6 @@ #define FASTBOOT_SPARSE_HEADER sizeof(struct fastboot_sparse_header_s) #define FASTBOOT_CHUNK_HEADER sizeof(struct fastboot_chunk_header_s) -#define FASTBOOT_GETUINT32(p) (((uint32_t)(p)[3] << 24) | \ - ((uint32_t)(p)[2] << 16) | \ - ((uint32_t)(p)[1] << 8) | \ - (uint32_t)(p)[0]) - #define fb_info(...) syslog(LOG_INFO, ##__VA_ARGS__); #define fb_err(...) syslog(LOG_ERR, ##__VA_ARGS__); @@ -437,7 +433,7 @@ fastboot_flash_program(FAR struct fastboot_ctx_s *context, int fd) break; case FASTBOOT_CHUNK_FILL: { - uint32_t fill_data = FASTBOOT_GETUINT32(chunk_ptr); + uint32_t fill_data = be32toh(*(FAR uint32_t *)chunk_ptr); uint32_t chunk_size = chunk->chunk_sz * sparse->blk_sz; ret = ffastboot_flash_fill(fd, context->download_offset, fill_data, sparse->blk_sz, From 75033b7d269e75f1bdc1e2c64f6a01ce88d639be Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Thu, 12 Jun 2025 19:14:28 +0800 Subject: [PATCH 306/391] system/fastboot: add func for context and usbdev fastboot_context_initialize : initialize fastboot context fastboot_context_deinit : deinitialize fastboot context fastboot_usbdev_initialize : initialize usbdev and open USB endpoint fastboot_usbdev_deinit : close USB endpoint Signed-off-by: wangjianyu3 --- system/fastboot/fastboot.c | 108 ++++++++++++++++++++----------------- 1 file changed, 60 insertions(+), 48 deletions(-) diff --git a/system/fastboot/fastboot.c b/system/fastboot/fastboot.c index 773ea232844..bf97fdb61db 100644 --- a/system/fastboot/fastboot.c +++ b/system/fastboot/fastboot.c @@ -1032,7 +1032,7 @@ static int fastboot_open_usb(int index, int flags) return -errno; } -static int fastboot_usbdev_initialize(void) +static int fastboot_usbdev_initialize(FAR struct fastboot_ctx_s *ctx) { #ifdef CONFIG_SYSTEM_FASTBOOTD_USB_BOARDCTL struct boardioc_usbdev_ctrl_s ctrl; @@ -1071,9 +1071,58 @@ static int fastboot_usbdev_initialize(void) } #endif /* SYSTEM_FASTBOOTD_USB_BOARDCTL */ + ctx->usbdev_in = + fastboot_open_usb(FASTBOOT_EP_BULKOUT_IDX, O_RDONLY | O_CLOEXEC); + if (ctx->usbdev_in < 0) + { + return ctx->usbdev_in; + } + + ctx->usbdev_out = + fastboot_open_usb(FASTBOOT_EP_BULKIN_IDX, O_WRONLY | O_CLOEXEC); + if (ctx->usbdev_out < 0) + { + close(ctx->usbdev_in); + ctx->usbdev_in = -1; + return ctx->usbdev_out; + } + + return 0; +} + +static void fastboot_usbdev_deinit(FAR struct fastboot_ctx_s *ctx) +{ + close(ctx->usbdev_out); + ctx->usbdev_out = -1; + close(ctx->usbdev_in); + ctx->usbdev_in = -1; +} + +static int fastboot_context_initialize(FAR struct fastboot_ctx_s *ctx) +{ + ctx->download_max = CONFIG_SYSTEM_FASTBOOTD_DOWNLOAD_MAX; + ctx->download_offset = 0; + ctx->download_size = 0; + ctx->flash_fd = -1; + ctx->total_imgsize = 0; + ctx->varlist = NULL; + ctx->wait_ms = 0; + + ctx->download_buffer = malloc(CONFIG_SYSTEM_FASTBOOTD_DOWNLOAD_MAX); + if (ctx->download_buffer == NULL) + { + fb_err("ERROR: Could not allocate the memory.\n"); + return -errno; + } + return 0; } +static void fastboot_context_deinit(FAR struct fastboot_ctx_s *ctx) +{ + free(ctx->download_buffer); +} + /**************************************************************************** * Public Functions ****************************************************************************/ @@ -1081,8 +1130,13 @@ static int fastboot_usbdev_initialize(void) int main(int argc, FAR char **argv) { struct fastboot_ctx_s context; - FAR void *buffer = NULL; - int ret = OK; + int ret; + + ret = fastboot_context_initialize(&context); + if (ret < 0) + { + return ret; + } if (argc > 1) { @@ -1096,60 +1150,18 @@ int main(int argc, FAR char **argv) context.wait_ms = atoi(argv[1]); } - else - { - context.wait_ms = 0; - } - ret = fastboot_usbdev_initialize(); + ret = fastboot_usbdev_initialize(&context); if (ret < 0) { return ret; } - buffer = malloc(CONFIG_SYSTEM_FASTBOOTD_DOWNLOAD_MAX); - if (buffer == NULL) - { - fb_err("ERROR: Could not allocate the memory.\n"); - return -ENOMEM; - } - - context.usbdev_in = - fastboot_open_usb(FASTBOOT_EP_BULKOUT_IDX, O_RDONLY | O_CLOEXEC); - if (context.usbdev_in < 0) - { - ret = -errno; - goto err_with_mem; - } - - context.usbdev_out = - fastboot_open_usb(FASTBOOT_EP_BULKIN_IDX, O_WRONLY | O_CLOEXEC); - if (context.usbdev_out < 0) - { - ret = -errno; - goto err_with_in; - } - - context.varlist = NULL; - context.flash_fd = -1; - context.download_buffer = buffer; - context.download_size = 0; - context.download_offset = 0; - context.download_max = CONFIG_SYSTEM_FASTBOOTD_DOWNLOAD_MAX; - context.total_imgsize = 0; - fastboot_create_publish(&context); fastboot_command_loop(&context); fastboot_free_publish(&context); + fastboot_usbdev_deinit(&context); + fastboot_context_deinit(&context); - close(context.usbdev_out); - context.usbdev_out = -1; - -err_with_in: - close(context.usbdev_in); - context.usbdev_in = -1; - -err_with_mem: - free(buffer); return ret; } From 7790894bb67ee2591ea6dfc88710e3b2e69580af Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Fri, 13 Jun 2025 20:26:02 +0800 Subject: [PATCH 307/391] system/fastboot: add support for fastboot tcp Add TCP network transport support for fastboot, users can add "-s tcp:HOST[:PORT]" option to specify a network device. Examples fastboot -s tcp:192.168.100.2 getvar version fastboot -s tcp:192.168.100.2 flash virtblk0 fastboot.c fastboot -s tcp:192.168.100.2 oem shell "uname -a" Signed-off-by: wangjianyu3 --- system/fastboot/Kconfig | 3 +- system/fastboot/fastboot.c | 347 ++++++++++++++++++++++++++++++++----- 2 files changed, 310 insertions(+), 40 deletions(-) diff --git a/system/fastboot/Kconfig b/system/fastboot/Kconfig index eb5edcfd91f..4b7cad26767 100644 --- a/system/fastboot/Kconfig +++ b/system/fastboot/Kconfig @@ -6,7 +6,7 @@ menuconfig SYSTEM_FASTBOOTD bool "fastbootd" default n - depends on USBFASTBOOT + depends on USBFASTBOOT || NET_TCP ---help--- support usb fastboot function. @@ -29,6 +29,7 @@ config SYSTEM_FASTBOOTD_USB_BOARDCTL default n depends on BOARDCTL depends on BOARDCTL_USBDEVCTRL + depends on USBFASTBOOT ---help--- Connect usbdev before running fastboot daemon. diff --git a/system/fastboot/fastboot.c b/system/fastboot/fastboot.c index bf97fdb61db..063476e4574 100644 --- a/system/fastboot/fastboot.c +++ b/system/fastboot/fastboot.c @@ -41,9 +41,11 @@ #include #include +#include #include #include #include +#include #include #include #include @@ -73,6 +75,19 @@ #define FASTBOOT_SPARSE_HEADER sizeof(struct fastboot_sparse_header_s) #define FASTBOOT_CHUNK_HEADER sizeof(struct fastboot_chunk_header_s) +/* Fastboot TCP Protocol v1 + * + * handshake: chars "FB" followed by a 2-digit base-10 ASCII version number + * data_size: 8-byte big-endian binary value before fastboot packet + * + * https://android.googlesource.com/platform/system/core/+/refs/heads/main\ + * /fastboot/README.md#tcp-protocol-v1 + */ + +#define FASTBOOT_TCP_HANDSHAKE "FB01" +#define FASTBOOT_TCP_HANDSHAKE_LEN 4 +#define FASTBOOT_TCP_PORT 5554 + #define fb_info(...) syslog(LOG_INFO, ##__VA_ARGS__); #define fb_err(...) syslog(LOG_ERR, ##__VA_ARGS__); @@ -80,6 +95,8 @@ * Private types ****************************************************************************/ +struct fastboot_ctx_s; + struct fastboot_var_s { FAR struct fastboot_var_s *next; @@ -122,19 +139,40 @@ struct fastboot_file_s off_t offset; }; +struct fastboot_transport_ops_s +{ + CODE int (*init)(FAR struct fastboot_ctx_s *); + CODE void (*deinit)(FAR struct fastboot_ctx_s *); + CODE ssize_t (*read)(FAR struct fastboot_ctx_s *, FAR void *, size_t); + CODE int (*write)(FAR struct fastboot_ctx_s *, FAR const void *, size_t); +}; + struct fastboot_ctx_s { - int usbdev_in; - int usbdev_out; + /* Transport file descriptors + * + * | idx | USB | TCP | poll | + * |-----|----------|---------------|------| + * | 0 |usbdev in |TCP socket | Y | + * | 1 |usbdev out|accepted socket| N | + */ + + int tran_fd[2]; int flash_fd; size_t download_max; size_t download_size; size_t download_offset; size_t total_imgsize; - int wait_ms; + + /* Store wait_ms argument before poll of fastboot_command_loop, and + * TCP transport remaining data size later. + */ + + uint64_t left; FAR void *download_buffer; FAR struct fastboot_var_s *varlist; CODE int (*upload_func)(FAR struct fastboot_ctx_s *context); + FAR const struct fastboot_transport_ops_s *ops; struct { size_t size; @@ -185,6 +223,27 @@ static void fastboot_shell(FAR struct fastboot_ctx_s *context, FAR const char *arg); #endif +/* USB transport */ + +#ifdef CONFIG_USBFASTBOOT +static int fastboot_usbdev_initialize(FAR struct fastboot_ctx_s *ctx); +static void fastboot_usbdev_deinit(FAR struct fastboot_ctx_s *ctx); +static ssize_t fastboot_usbdev_read(FAR struct fastboot_ctx_s *ctx, + FAR void *buf, size_t len); +static int fastboot_usbdev_write(FAR struct fastboot_ctx_s *ctx, + FAR const void *buf, size_t len); +#elif defined(CONFIG_NET_TCP) + +/* TCP transport */ + +static int fastboot_tcp_initialize(FAR struct fastboot_ctx_s *ctx); +static void fastboot_tcp_deinit(FAR struct fastboot_ctx_s *ctx); +static ssize_t fastboot_tcp_read(FAR struct fastboot_ctx_s *ctx, + FAR void *buf, size_t len); +static int fastboot_tcp_write(FAR struct fastboot_ctx_s *ctx, + FAR const void *buf, size_t len); +#endif + /**************************************************************************** * Private Data ****************************************************************************/ @@ -217,6 +276,24 @@ static const struct memory_region_s g_memory_region[] = }; #endif +#ifdef CONFIG_USBFASTBOOT +static const struct fastboot_transport_ops_s g_tran_ops_usb = +{ + .init = fastboot_usbdev_initialize, + .deinit = fastboot_usbdev_deinit, + .read = fastboot_usbdev_read, + .write = fastboot_usbdev_write, +}; +#elif defined(CONFIG_NET_TCP) +static const struct fastboot_transport_ops_s g_tran_ops_tcp = +{ + .init = fastboot_tcp_initialize, + .deinit = fastboot_tcp_deinit, + .read = fastboot_tcp_read, + .write = fastboot_tcp_write, +}; +#endif + /**************************************************************************** * Private Functions ****************************************************************************/ @@ -239,9 +316,9 @@ static ssize_t fastboot_read(int fd, FAR void *buf, size_t len) return r < 0 ? -errno : r; } -static int fastboot_write(int fd, FAR void *buf, size_t len) +static int fastboot_write(int fd, FAR const void *buf, size_t len) { - FAR char *data = buf; + FAR const char *data = buf; while (len > 0) { @@ -270,7 +347,7 @@ static void fastboot_ack(FAR struct fastboot_ctx_s *context, } snprintf(response, FASTBOOT_MSG_LEN, "%s%s", code, reason); - fastboot_write(context->usbdev_out, response, strlen(response)); + context->ops->write(context, response, strlen(response)); } static void fastboot_fail(FAR struct fastboot_ctx_s *context, @@ -572,7 +649,7 @@ static void fastboot_download(FAR struct fastboot_ctx_s *context, } snprintf(response, FASTBOOT_MSG_LEN, "DATA%08lx", len); - ret = fastboot_write(context->usbdev_out, response, strlen(response)); + ret = context->ops->write(context, response, strlen(response)); if (ret < 0) { fb_err("Reponse error [%d]\n", -ret); @@ -584,8 +661,7 @@ static void fastboot_download(FAR struct fastboot_ctx_s *context, while (len > 0) { - ssize_t r = fastboot_read(context->usbdev_in, - download, len); + ssize_t r = context->ops->read(context, download, len); if (r < 0) { context->download_size = 0; @@ -651,9 +727,8 @@ static void fastboot_reboot_bootloader(FAR struct fastboot_ctx_s *context, static int fastboot_memdump_upload(FAR struct fastboot_ctx_s *context) { - return fastboot_write(context->usbdev_out, - context->upload_param.u.mem.addr, - context->upload_param.size); + return context->ops->write(context, context->upload_param.u.mem.addr, + context->upload_param.size); } static void fastboot_memdump_region(memdump_print_t memprint, FAR void *priv) @@ -748,9 +823,8 @@ static int fastboot_filedump_upload(FAR struct fastboot_ctx_s *context) break; } else if (nread < 0 || - fastboot_write(context->usbdev_out, - context->download_buffer, - nread) < 0) + context->ops->write(context, context->download_buffer, + nread) < 0) { fb_err("Upload failed (%zu bytes left)\n", size); close(fd); @@ -869,7 +943,7 @@ static void fastboot_upload(FAR struct fastboot_ctx_s *context, snprintf(response, FASTBOOT_MSG_LEN, "DATA%08zx", context->upload_param.size); - ret = fastboot_write(context->usbdev_out, response, strlen(response)); + ret = context->ops->write(context, response, strlen(response)); if (ret < 0) { fb_err("Reponse error [%d]\n", -ret); @@ -919,31 +993,34 @@ static void fastboot_oem(FAR struct fastboot_ctx_s *context, static void fastboot_command_loop(FAR struct fastboot_ctx_s *context) { - if (context->wait_ms > 0) + if (context->left > 0) { struct pollfd fds[1]; - fds[0].fd = context->usbdev_in; + fds[0].fd = context->tran_fd[0]; fds[0].events = POLLIN; - if (poll(fds, 1, context->wait_ms) <= 0) + if (poll(fds, 1, context->left) <= 0) { return; } } + /* Reinitialize for storing TCP transport remaining data size. */ + + context->left = 0; + while (1) { char buffer[FASTBOOT_MSG_LEN + 1]; size_t ncmds = nitems(g_fast_cmd); size_t index; - ssize_t r = fastboot_read(context->usbdev_in, - buffer, FASTBOOT_MSG_LEN); + ssize_t r = context->ops->read(context, buffer, FASTBOOT_MSG_LEN); if (r < 0) { - fb_err("USB read error\n"); - break; + fb_err("fastboot transport read() %zd\n", r); + continue; } buffer[r] = '\0'; @@ -1007,6 +1084,7 @@ static void fastboot_free_publish(FAR struct fastboot_ctx_s *context) } } +#ifdef CONFIG_USBFASTBOOT static int fastboot_open_usb(int index, int flags) { int try = FASTBOOT_EP_RETRY_TIMES; @@ -1071,20 +1149,20 @@ static int fastboot_usbdev_initialize(FAR struct fastboot_ctx_s *ctx) } #endif /* SYSTEM_FASTBOOTD_USB_BOARDCTL */ - ctx->usbdev_in = + ctx->tran_fd[0] = fastboot_open_usb(FASTBOOT_EP_BULKOUT_IDX, O_RDONLY | O_CLOEXEC); - if (ctx->usbdev_in < 0) + if (ctx->tran_fd[0] < 0) { - return ctx->usbdev_in; + return ctx->tran_fd[0]; } - ctx->usbdev_out = + ctx->tran_fd[1] = fastboot_open_usb(FASTBOOT_EP_BULKIN_IDX, O_WRONLY | O_CLOEXEC); - if (ctx->usbdev_out < 0) + if (ctx->tran_fd[1] < 0) { - close(ctx->usbdev_in); - ctx->usbdev_in = -1; - return ctx->usbdev_out; + close(ctx->tran_fd[0]); + ctx->tran_fd[0] = -1; + return ctx->tran_fd[1]; } return 0; @@ -1092,12 +1170,193 @@ static int fastboot_usbdev_initialize(FAR struct fastboot_ctx_s *ctx) static void fastboot_usbdev_deinit(FAR struct fastboot_ctx_s *ctx) { - close(ctx->usbdev_out); - ctx->usbdev_out = -1; - close(ctx->usbdev_in); - ctx->usbdev_in = -1; + int i; + + for (i = 0; i < nitems(ctx->tran_fd); i++) + { + close(ctx->tran_fd[i]); + ctx->tran_fd[i] = -1; + } +} + +static ssize_t fastboot_usbdev_read(FAR struct fastboot_ctx_s *ctx, + FAR void *buf, size_t len) +{ + return fastboot_read(ctx->tran_fd[0], buf, len); +} + +static int fastboot_usbdev_write(FAR struct fastboot_ctx_s *ctx, + FAR const void *buf, size_t len) +{ + return fastboot_write(ctx->tran_fd[1], buf, len); +} + +#elif defined(CONFIG_NET_TCP) +static int fastboot_tcp_initialize(FAR struct fastboot_ctx_s *ctx) +{ + struct sockaddr_in addr; + + ctx->tran_fd[0] = socket(AF_INET, SOCK_STREAM, 0); + if (ctx->tran_fd[0] < 0) + { + fb_err("create socket failed %d", errno); + return -errno; + } + + memset(&addr, 0, sizeof(addr)); + addr.sin_family = AF_INET; + addr.sin_addr.s_addr = htonl(INADDR_ANY); + addr.sin_port = htons(FASTBOOT_TCP_PORT); + if (bind(ctx->tran_fd[0], (struct sockaddr *) &addr, sizeof(addr)) < 0) + { + fb_err("bind() failed %d", errno); + goto error; + } + + if (listen(ctx->tran_fd[0], 1) < 0) + { + fb_err("listen() failed %d", errno); + goto error; + } + + return 0; +error: + close(ctx->tran_fd[0]); + ctx->tran_fd[0] = -1; + return -errno; +} + +static void fastboot_tcp_disconn(FAR struct fastboot_ctx_s *ctx) +{ + close(ctx->tran_fd[1]); + ctx->tran_fd[1] = -1; } +static void fastboot_tcp_deinit(FAR struct fastboot_ctx_s *ctx) +{ + fastboot_tcp_disconn(ctx); + close(ctx->tran_fd[0]); + ctx->tran_fd[0] = -1; +} + +static ssize_t fastboot_read_all(int fd, FAR void *buf, size_t len) +{ + size_t total = 0; + ssize_t nread; + + while (total < len) + { + nread = fastboot_read(fd, buf, len); + if (nread <= 0) + { + if (total == 0) + { + return nread; + } + + break; + } + + total += nread; + } + + return total; +} + +static ssize_t fastboot_tcp_read(FAR struct fastboot_ctx_s *ctx, + FAR void *buf, size_t len) +{ + char handshake[FASTBOOT_TCP_HANDSHAKE_LEN]; + uint64_t data_size; + ssize_t nread; + + if (ctx->tran_fd[1] == -1) + { + while (1) + { + /* Accept a connection, not care the address of the peer socket */ + + ctx->tran_fd[1] = accept(ctx->tran_fd[0], NULL, 0); + if (ctx->tran_fd[1] < 0) + { + continue; + } + + /* Handshake */ + + memset(handshake, 0, sizeof(handshake)); + if (fastboot_read_all(ctx->tran_fd[1], handshake, + sizeof(handshake)) != sizeof(handshake) || + strncmp(handshake, FASTBOOT_TCP_HANDSHAKE, + sizeof(handshake)) != 0 || + fastboot_write(ctx->tran_fd[1], handshake, + sizeof(handshake)) < 0) + { + fb_err("%s err handshake %d 0x%" PRIx32, __func__, errno, + *(FAR uint32_t *)handshake); + fastboot_tcp_disconn(ctx); + continue; + } + + break; + } + } + + if (ctx->left == 0) + { + nread = + fastboot_read_all(ctx->tran_fd[1], &data_size, sizeof(data_size)); + if (nread != sizeof(data_size)) + { + /* As normal, end of file if client has closed the connection */ + + if (nread != 0) + { + fb_err("%s err read data_size %zd %d", __func__, nread, errno); + } + + fastboot_tcp_disconn(ctx); + return nread; + } + + ctx->left = be64toh(data_size); + } + + if (len > ctx->left) + { + len = ctx->left; + } + + nread = fastboot_read(ctx->tran_fd[1], buf, len); + if (nread <= 0) + { + fastboot_tcp_disconn(ctx); + ctx->left = 0; + } + else + { + ctx->left -= nread; + } + + return nread; +} + +static int fastboot_tcp_write(FAR struct fastboot_ctx_s *ctx, + FAR const void *buf, size_t len) +{ + uint64_t data_size = htobe64(len); + int ret; + + ret = fastboot_write(ctx->tran_fd[1], &data_size, sizeof(data_size)); + if (ret < 0) + { + return ret; + } + + return fastboot_write(ctx->tran_fd[1], buf, len); +} +#endif + static int fastboot_context_initialize(FAR struct fastboot_ctx_s *ctx) { ctx->download_max = CONFIG_SYSTEM_FASTBOOTD_DOWNLOAD_MAX; @@ -1106,7 +1365,14 @@ static int fastboot_context_initialize(FAR struct fastboot_ctx_s *ctx) ctx->flash_fd = -1; ctx->total_imgsize = 0; ctx->varlist = NULL; - ctx->wait_ms = 0; + ctx->left = 0; +#ifdef CONFIG_USBFASTBOOT + ctx->ops = &g_tran_ops_usb; +#elif defined(CONFIG_NET_TCP) + ctx->ops = &g_tran_ops_tcp; +#endif + ctx->tran_fd[0] = -1; + ctx->tran_fd[1] = -1; ctx->download_buffer = malloc(CONFIG_SYSTEM_FASTBOOTD_DOWNLOAD_MAX); if (ctx->download_buffer == NULL) @@ -1148,10 +1414,13 @@ int main(int argc, FAR char **argv) return 0; } - context.wait_ms = atoi(argv[1]); + if (sscanf(argv[1], "%" SCNu64 , &context.left) != 1) + { + return -EINVAL; + } } - ret = fastboot_usbdev_initialize(&context); + ret = context.ops->init(&context); if (ret < 0) { return ret; @@ -1160,7 +1429,7 @@ int main(int argc, FAR char **argv) fastboot_create_publish(&context); fastboot_command_loop(&context); fastboot_free_publish(&context); - fastboot_usbdev_deinit(&context); + context.ops->deinit(&context); fastboot_context_deinit(&context); return ret; From e23ba4891d73f4c601e4df8eb03196473fe0218b Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Fri, 20 Jun 2025 11:18:59 +0800 Subject: [PATCH 308/391] system/fastboot: rename argument context to ctx Rename argument "context" to "ctx" for all functions. Signed-off-by: wangjianyu3 --- system/fastboot/fastboot.c | 307 ++++++++++++++++++------------------- 1 file changed, 147 insertions(+), 160 deletions(-) diff --git a/system/fastboot/fastboot.c b/system/fastboot/fastboot.c index 063476e4574..67a01dd0d7a 100644 --- a/system/fastboot/fastboot.c +++ b/system/fastboot/fastboot.c @@ -171,7 +171,7 @@ struct fastboot_ctx_s uint64_t left; FAR void *download_buffer; FAR struct fastboot_var_s *varlist; - CODE int (*upload_func)(FAR struct fastboot_ctx_s *context); + CODE int (*upload_func)(FAR struct fastboot_ctx_s *); FAR const struct fastboot_transport_ops_s *ops; struct { @@ -187,8 +187,7 @@ struct fastboot_ctx_s struct fastboot_cmd_s { FAR const char *prefix; - CODE void (*handle)(FAR struct fastboot_ctx_s *context, - FAR const char *arg); + CODE void (*handle)(FAR struct fastboot_ctx_s *, FAR const char *); }; typedef void (*memdump_print_t)(FAR void *, FAR const char *); @@ -197,29 +196,29 @@ typedef void (*memdump_print_t)(FAR void *, FAR const char *); * Private Function Prototypes ****************************************************************************/ -static void fastboot_getvar(FAR struct fastboot_ctx_s *context, +static void fastboot_getvar(FAR struct fastboot_ctx_s *ctx, FAR const char *arg); -static void fastboot_download(FAR struct fastboot_ctx_s *context, +static void fastboot_download(FAR struct fastboot_ctx_s *ctx, FAR const char *arg); -static void fastboot_erase(FAR struct fastboot_ctx_s *context, +static void fastboot_erase(FAR struct fastboot_ctx_s *ctx, FAR const char *arg); -static void fastboot_flash(FAR struct fastboot_ctx_s *context, +static void fastboot_flash(FAR struct fastboot_ctx_s *ctx, FAR const char *arg); -static void fastboot_reboot(FAR struct fastboot_ctx_s *context, +static void fastboot_reboot(FAR struct fastboot_ctx_s *ctx, FAR const char *arg); -static void fastboot_reboot_bootloader(FAR struct fastboot_ctx_s *context, +static void fastboot_reboot_bootloader(FAR struct fastboot_ctx_s *ctx, FAR const char *arg); -static void fastboot_oem(FAR struct fastboot_ctx_s *context, +static void fastboot_oem(FAR struct fastboot_ctx_s *ctx, FAR const char *arg); -static void fastboot_upload(FAR struct fastboot_ctx_s *context, +static void fastboot_upload(FAR struct fastboot_ctx_s *ctx, FAR const char *arg); -static void fastboot_memdump(FAR struct fastboot_ctx_s *context, +static void fastboot_memdump(FAR struct fastboot_ctx_s *ctx, FAR const char *arg); -static void fastboot_filedump(FAR struct fastboot_ctx_s *context, +static void fastboot_filedump(FAR struct fastboot_ctx_s *ctx, FAR const char *arg); #ifdef CONFIG_SYSTEM_FASTBOOTD_SHELL -static void fastboot_shell(FAR struct fastboot_ctx_s *context, +static void fastboot_shell(FAR struct fastboot_ctx_s *ctx, FAR const char *arg); #endif @@ -335,9 +334,8 @@ static int fastboot_write(int fd, FAR const void *buf, size_t len) return OK; } -static void fastboot_ack(FAR struct fastboot_ctx_s *context, - FAR const char *code, - FAR const char *reason) +static void fastboot_ack(FAR struct fastboot_ctx_s *ctx, + FAR const char *code, FAR const char *reason) { char response[FASTBOOT_MSG_LEN]; @@ -347,10 +345,10 @@ static void fastboot_ack(FAR struct fastboot_ctx_s *context, } snprintf(response, FASTBOOT_MSG_LEN, "%s%s", code, reason); - context->ops->write(context, response, strlen(response)); + ctx->ops->write(ctx, response, strlen(response)); } -static void fastboot_fail(FAR struct fastboot_ctx_s *context, +static void fastboot_fail(FAR struct fastboot_ctx_s *ctx, FAR const char *fmt, ...) { char reason[FASTBOOT_MSG_LEN]; @@ -358,14 +356,14 @@ static void fastboot_fail(FAR struct fastboot_ctx_s *context, va_start(ap, fmt); vsnprintf(reason, sizeof(reason), fmt, ap); - fastboot_ack(context, "FAIL", reason); + fastboot_ack(ctx, "FAIL", reason); va_end(ap); } -static void fastboot_okay(FAR struct fastboot_ctx_s *context, +static void fastboot_okay(FAR struct fastboot_ctx_s *ctx, FAR const char *info) { - fastboot_ack(context, "OKAY", info); + fastboot_ack(ctx, "OKAY", info); } static int fastboot_flash_open(FAR const char *name) @@ -458,11 +456,10 @@ static int fastboot_flash_erase(int fd) return ret < 0 ? -errno : ret; } -static int -fastboot_flash_program(FAR struct fastboot_ctx_s *context, int fd) +static int fastboot_flash_program(FAR struct fastboot_ctx_s *ctx, int fd) { - FAR char *chunk_ptr = context->download_buffer; - FAR char *end_ptr = chunk_ptr + context->download_size; + FAR char *chunk_ptr = ctx->download_buffer; + FAR char *end_ptr = chunk_ptr + ctx->download_size; FAR struct fastboot_sparse_header_s *sparse; uint32_t chunk_num; int ret = OK; @@ -472,14 +469,14 @@ fastboot_flash_program(FAR struct fastboot_ctx_s *context, int fd) sparse = (FAR struct fastboot_sparse_header_s *)chunk_ptr; if (sparse->magic != FASTBOOT_SPARSE_MAGIC) { - ret = fastboot_flash_write(fd, 0, context->download_buffer, - context->download_size); + ret = fastboot_flash_write(fd, 0, ctx->download_buffer, + ctx->download_size); goto end; } - if (context->total_imgsize == 0) + if (ctx->total_imgsize == 0) { - context->total_imgsize = sparse->blk_sz * sparse->total_blks; + ctx->total_imgsize = sparse->blk_sz * sparse->total_blks; } chunk_num = sparse->total_chunks; @@ -497,14 +494,14 @@ fastboot_flash_program(FAR struct fastboot_ctx_s *context, int fd) case FASTBOOT_CHUNK_RAW: { uint32_t chunk_size = chunk->chunk_sz * sparse->blk_sz; - ret = fastboot_flash_write(fd, context->download_offset, + ret = fastboot_flash_write(fd, ctx->download_offset, chunk_ptr, chunk_size); if (ret < 0) { goto end; } - context->download_offset += chunk_size; + ctx->download_offset += chunk_size; chunk_ptr += chunk_size; } break; @@ -512,15 +509,14 @@ fastboot_flash_program(FAR struct fastboot_ctx_s *context, int fd) { uint32_t fill_data = be32toh(*(FAR uint32_t *)chunk_ptr); uint32_t chunk_size = chunk->chunk_sz * sparse->blk_sz; - ret = ffastboot_flash_fill(fd, context->download_offset, - fill_data, sparse->blk_sz, - chunk->chunk_sz); + ret = ffastboot_flash_fill(fd, ctx->download_offset, fill_data, + sparse->blk_sz, chunk->chunk_sz); if (ret < 0) { goto end; } - context->download_offset += chunk_size; + ctx->download_offset += chunk_size; chunk_ptr += 4; } break; @@ -533,18 +529,18 @@ fastboot_flash_program(FAR struct fastboot_ctx_s *context, int fd) } } - if (context->download_offset < context->total_imgsize) + if (ctx->download_offset < ctx->total_imgsize) { return 1; } end: - context->total_imgsize = 0; - context->download_offset = 0; + ctx->total_imgsize = 0; + ctx->download_offset = 0; return ret; } -static void fastboot_flash(FAR struct fastboot_ctx_s *context, +static void fastboot_flash(FAR struct fastboot_ctx_s *ctx, FAR const char *arg) { char blkdev[PATH_MAX]; @@ -552,34 +548,34 @@ static void fastboot_flash(FAR struct fastboot_ctx_s *context, snprintf(blkdev, PATH_MAX, FASTBOOT_BLKDEV, arg); - if (context->flash_fd < 0) + if (ctx->flash_fd < 0) { - context->flash_fd = fastboot_flash_open(blkdev); - if (context->flash_fd < 0) + ctx->flash_fd = fastboot_flash_open(blkdev); + if (ctx->flash_fd < 0) { - fastboot_fail(context, "Flash open failure"); + fastboot_fail(ctx, "Flash open failure"); return; } } - ret = fastboot_flash_program(context, context->flash_fd); + ret = fastboot_flash_program(ctx, ctx->flash_fd); if (ret < 0) { - fastboot_fail(context, "Image flash failure"); + fastboot_fail(ctx, "Image flash failure"); } else { - fastboot_okay(context, ""); + fastboot_okay(ctx, ""); } if (ret <= 0) { - fastboot_flash_close(context->flash_fd); - context->flash_fd = -1; + fastboot_flash_close(ctx->flash_fd); + ctx->flash_fd = -1; } } -static void fastboot_erase(FAR struct fastboot_ctx_s *context, +static void fastboot_erase(FAR struct fastboot_ctx_s *ctx, FAR const char *arg) { char blkdev[PATH_MAX]; @@ -592,7 +588,7 @@ static void fastboot_erase(FAR struct fastboot_ctx_s *context, fd = fastboot_flash_open(blkdev); if (fd < 0) { - fastboot_fail(context, "Flash open failure"); + fastboot_fail(ctx, "Flash open failure"); return; } @@ -604,13 +600,13 @@ static void fastboot_erase(FAR struct fastboot_ctx_s *context, ret = fstat(fd, &sb); if (ret >= 0) { - memset(context->download_buffer, 0xff, context->download_max); + memset(ctx->download_buffer, 0xff, ctx->download_max); while (sb.st_size > 0) { - size_t len = MIN(sb.st_size, context->download_max); + size_t len = MIN(sb.st_size, ctx->download_max); - ret = fastboot_write(fd, context->download_buffer, len); + ret = fastboot_write(fd, ctx->download_buffer, len); if (ret < 0) { break; @@ -623,17 +619,17 @@ static void fastboot_erase(FAR struct fastboot_ctx_s *context, if (ret < 0) { - fastboot_fail(context, "Flash erase failure"); + fastboot_fail(ctx, "Flash erase failure"); } else { - fastboot_okay(context, ""); + fastboot_okay(ctx, ""); } fastboot_flash_close(fd); } -static void fastboot_download(FAR struct fastboot_ctx_s *context, +static void fastboot_download(FAR struct fastboot_ctx_s *ctx, FAR const char *arg) { FAR char *download; @@ -642,29 +638,29 @@ static void fastboot_download(FAR struct fastboot_ctx_s *context, int ret; len = strtoul(arg, NULL, 16); - if (len > context->download_max) + if (len > ctx->download_max) { - fastboot_fail(context, "Data too large"); + fastboot_fail(ctx, "Data too large"); return; } snprintf(response, FASTBOOT_MSG_LEN, "DATA%08lx", len); - ret = context->ops->write(context, response, strlen(response)); + ret = ctx->ops->write(ctx, response, strlen(response)); if (ret < 0) { fb_err("Reponse error [%d]\n", -ret); return; } - download = context->download_buffer; - context->download_size = len; + download = ctx->download_buffer; + ctx->download_size = len; while (len > 0) { - ssize_t r = context->ops->read(context, download, len); + ssize_t r = ctx->ops->read(ctx, download, len); if (r < 0) { - context->download_size = 0; + ctx->download_size = 0; fb_err("fastboot_download usb read error\n"); return; } @@ -673,62 +669,62 @@ static void fastboot_download(FAR struct fastboot_ctx_s *context, download += r; } - fastboot_okay(context, ""); + fastboot_okay(ctx, ""); } -static void fastboot_getvar(FAR struct fastboot_ctx_s *context, +static void fastboot_getvar(FAR struct fastboot_ctx_s *ctx, FAR const char *arg) { FAR struct fastboot_var_s *var; char buffer[FASTBOOT_MSG_LEN]; - for (var = context->varlist; var != NULL; var = var->next) + for (var = ctx->varlist; var != NULL; var = var->next) { if (!strcmp(var->name, arg)) { if (var->string == NULL) { itoa(var->data, buffer, 10); - fastboot_okay(context, buffer); + fastboot_okay(ctx, buffer); } else { - fastboot_okay(context, var->string); + fastboot_okay(ctx, var->string); } return; } } - fastboot_okay(context, ""); + fastboot_okay(ctx, ""); } -static void fastboot_reboot(FAR struct fastboot_ctx_s *context, +static void fastboot_reboot(FAR struct fastboot_ctx_s *ctx, FAR const char *arg) { #ifdef CONFIG_BOARDCTL_RESET - fastboot_okay(context, ""); + fastboot_okay(ctx, ""); boardctl(BOARDIOC_RESET, BOARDIOC_SOFTRESETCAUSE_USER_REBOOT); #else - fastboot_fail(context, "Operation not supported"); + fastboot_fail(ctx, "Operation not supported"); #endif } -static void fastboot_reboot_bootloader(FAR struct fastboot_ctx_s *context, +static void fastboot_reboot_bootloader(FAR struct fastboot_ctx_s *ctx, FAR const char *arg) { #ifdef CONFIG_BOARDCTL_RESET - fastboot_okay(context, ""); + fastboot_okay(ctx, ""); boardctl(BOARDIOC_RESET, BOARDIOC_SOFTRESETCAUSE_ENTER_BOOTLOADER); #else - fastboot_fail(context, "Operation not supported"); + fastboot_fail(ctx, "Operation not supported"); #endif } -static int fastboot_memdump_upload(FAR struct fastboot_ctx_s *context) +static int fastboot_memdump_upload(FAR struct fastboot_ctx_s *ctx) { - return context->ops->write(context, context->upload_param.u.mem.addr, - context->upload_param.size); + return ctx->ops->write(ctx, ctx->upload_param.u.mem.addr, + ctx->upload_param.size); } static void fastboot_memdump_region(memdump_print_t memprint, FAR void *priv) @@ -771,60 +767,56 @@ static void fastboot_memdump_response(FAR void *priv, * fastboot get_staged mem_44000000_440b6c00.bin */ -static void fastboot_memdump(FAR struct fastboot_ctx_s *context, +static void fastboot_memdump(FAR struct fastboot_ctx_s *ctx, FAR const char *arg) { if (!arg || - sscanf(arg, "%p %zx", - &context->upload_param.u.mem.addr, - &context->upload_param.size) != 2) + sscanf(arg, "%p %zx", &ctx->upload_param.u.mem.addr, + &ctx->upload_param.size) != 2) { - fastboot_memdump_region(fastboot_memdump_response, context); - fastboot_fail(context, "Invalid argument"); + fastboot_memdump_region(fastboot_memdump_response, ctx); + fastboot_fail(ctx, "Invalid argument"); return; } - fb_info("Memdump Addr: %p, Size: 0x%zx\n", - context->upload_param.u.mem.addr, - context->upload_param.size); - context->upload_func = fastboot_memdump_upload; - fastboot_okay(context, ""); + fb_info("Memdump Addr: %p, Size: 0x%zx\n", ctx->upload_param.u.mem.addr, + ctx->upload_param.size); + ctx->upload_func = fastboot_memdump_upload; + fastboot_okay(ctx, ""); } -static int fastboot_filedump_upload(FAR struct fastboot_ctx_s *context) +static int fastboot_filedump_upload(FAR struct fastboot_ctx_s *ctx) { - size_t size = context->upload_param.size; + size_t size = ctx->upload_param.size; int fd; - fd = open(context->upload_param.u.file.path, O_RDONLY | O_CLOEXEC); + fd = open(ctx->upload_param.u.file.path, O_RDONLY | O_CLOEXEC); if (fd < 0) { fb_err("No such file or directory %d\n", errno); return -errno; } - if (context->upload_param.u.file.offset && - lseek(fd, context->upload_param.u.file.offset, - context->upload_param.u.file.offset > 0 ? SEEK_SET : - SEEK_END) < 0) + if (ctx->upload_param.u.file.offset && + lseek(fd, ctx->upload_param.u.file.offset, + ctx->upload_param.u.file.offset > 0 ? SEEK_SET : SEEK_END) < 0) { fb_err("Invalid argument, offset: %" PRIdOFF "\n", - context->upload_param.u.file.offset); + ctx->upload_param.u.file.offset); close(fd); return -errno; } while (size > 0) { - ssize_t nread = fastboot_read(fd, context->download_buffer, - MIN(size, context->download_max)); + ssize_t nread = fastboot_read(fd, ctx->download_buffer, + MIN(size, ctx->download_max)); if (nread == 0) { break; } else if (nread < 0 || - context->ops->write(context, context->download_buffer, - nread) < 0) + ctx->ops->write(ctx, ctx->download_buffer, nread) < 0) { fb_err("Upload failed (%zu bytes left)\n", size); close(fd); @@ -855,7 +847,7 @@ static int fastboot_filedump_upload(FAR struct fastboot_ctx_s *context) * fastboot get_staged bl_l1044480_l1042432.txt */ -static void fastboot_filedump(FAR struct fastboot_ctx_s *context, +static void fastboot_filedump(FAR struct fastboot_ctx_s *ctx, FAR const char *arg) { struct stat sb; @@ -863,42 +855,39 @@ static void fastboot_filedump(FAR struct fastboot_ctx_s *context, if (!arg) { - fastboot_fail(context, "Invalid argument"); + fastboot_fail(ctx, "Invalid argument"); return; } - ret = sscanf(arg, "%s %" PRIdOFF " %zu", - context->upload_param.u.file.path, - &context->upload_param.u.file.offset, - &context->upload_param.size); + ret = sscanf(arg, "%s %" PRIdOFF " %zu", ctx->upload_param.u.file.path, + &ctx->upload_param.u.file.offset, &ctx->upload_param.size); if (ret != 1 && ret != 3) { - fastboot_fail(context, "Failed to parse arguments"); + fastboot_fail(ctx, "Failed to parse arguments"); return; } else if (ret == 1) { - ret = stat(context->upload_param.u.file.path, &sb); + ret = stat(ctx->upload_param.u.file.path, &sb); if (ret < 0) { - fastboot_fail(context, "No such file or directory"); + fastboot_fail(ctx, "No such file or directory"); return; } - context->upload_param.size = sb.st_size; - context->upload_param.u.file.offset = 0; + ctx->upload_param.size = sb.st_size; + ctx->upload_param.u.file.offset = 0; } fb_info("Filedump Path: %s, Offset: %" PRIdOFF ", Size: %zu\n", - context->upload_param.u.file.path, - context->upload_param.u.file.offset, - context->upload_param.size); - context->upload_func = fastboot_filedump_upload; - fastboot_okay(context, ""); + ctx->upload_param.u.file.path, ctx->upload_param.u.file.offset, + ctx->upload_param.size); + ctx->upload_func = fastboot_filedump_upload; + fastboot_okay(ctx, ""); } #ifdef CONFIG_SYSTEM_FASTBOOTD_SHELL -static void fastboot_shell(FAR struct fastboot_ctx_s *context, +static void fastboot_shell(FAR struct fastboot_ctx_s *ctx, FAR const char *arg) { char response[FASTBOOT_MSG_LEN - 4]; @@ -908,66 +897,64 @@ static void fastboot_shell(FAR struct fastboot_ctx_s *context, fp = popen(arg, "r"); if (fp == NULL) { - fastboot_fail(context, "popen() fails %d", errno); + fastboot_fail(ctx, "popen() fails %d", errno); return; } while (fgets(response, sizeof(response), fp)) { - fastboot_ack(context, "TEXT", response); + fastboot_ack(ctx, "TEXT", response); } ret = pclose(fp); if (WIFEXITED(ret) && WEXITSTATUS(ret) == 0) { - fastboot_okay(context, ""); + fastboot_okay(ctx, ""); return; } - fastboot_fail(context, "error detected 0x%x %d", ret, errno); + fastboot_fail(ctx, "error detected 0x%x %d", ret, errno); } #endif -static void fastboot_upload(FAR struct fastboot_ctx_s *context, +static void fastboot_upload(FAR struct fastboot_ctx_s *ctx, FAR const char *arg) { char response[FASTBOOT_MSG_LEN]; int ret; - if (!context->upload_param.size || !context->upload_func) + if (!ctx->upload_param.size || !ctx->upload_func) { - fastboot_fail(context, "No data staged by the last command"); + fastboot_fail(ctx, "No data staged by the last command"); return; } - snprintf(response, FASTBOOT_MSG_LEN, "DATA%08zx", - context->upload_param.size); + snprintf(response, FASTBOOT_MSG_LEN, "DATA%08zx", ctx->upload_param.size); - ret = context->ops->write(context, response, strlen(response)); + ret = ctx->ops->write(ctx, response, strlen(response)); if (ret < 0) { fb_err("Reponse error [%d]\n", -ret); goto done; } - ret = context->upload_func(context); + ret = ctx->upload_func(ctx); if (ret < 0) { fb_err("Upload failed, [%d]\n", -ret); - fastboot_fail(context, "Upload failed"); + fastboot_fail(ctx, "Upload failed"); } else { - fastboot_okay(context, ""); + fastboot_okay(ctx, ""); } done: - context->upload_param.size = 0; - context->upload_func = NULL; + ctx->upload_param.size = 0; + ctx->upload_func = NULL; } -static void fastboot_oem(FAR struct fastboot_ctx_s *context, - FAR const char *arg) +static void fastboot_oem(FAR struct fastboot_ctx_s *ctx, FAR const char *arg) { size_t ncmds = nitems(g_oem_cmd); size_t index; @@ -980,27 +967,27 @@ static void fastboot_oem(FAR struct fastboot_ctx_s *context, if (memcmp(arg, g_oem_cmd[index].prefix, len) == 0) { arg += len; - g_oem_cmd[index].handle(context, *arg == ' ' ? ++arg : NULL); + g_oem_cmd[index].handle(ctx, *arg == ' ' ? ++arg : NULL); break; } } if (index == ncmds) { - fastboot_fail(context, "Unknown command"); + fastboot_fail(ctx, "Unknown command"); } } -static void fastboot_command_loop(FAR struct fastboot_ctx_s *context) +static void fastboot_command_loop(FAR struct fastboot_ctx_s *ctx) { - if (context->left > 0) + if (ctx->left > 0) { struct pollfd fds[1]; - fds[0].fd = context->tran_fd[0]; + fds[0].fd = ctx->tran_fd[0]; fds[0].events = POLLIN; - if (poll(fds, 1, context->left) <= 0) + if (poll(fds, 1, ctx->left) <= 0) { return; } @@ -1008,7 +995,7 @@ static void fastboot_command_loop(FAR struct fastboot_ctx_s *context) /* Reinitialize for storing TCP transport remaining data size. */ - context->left = 0; + ctx->left = 0; while (1) { @@ -1016,7 +1003,7 @@ static void fastboot_command_loop(FAR struct fastboot_ctx_s *context) size_t ncmds = nitems(g_fast_cmd); size_t index; - ssize_t r = context->ops->read(context, buffer, FASTBOOT_MSG_LEN); + ssize_t r = ctx->ops->read(ctx, buffer, FASTBOOT_MSG_LEN); if (r < 0) { fb_err("fastboot transport read() %zd\n", r); @@ -1029,19 +1016,19 @@ static void fastboot_command_loop(FAR struct fastboot_ctx_s *context) size_t len = strlen(g_fast_cmd[index].prefix); if (memcmp(buffer, g_fast_cmd[index].prefix, len) == 0) { - g_fast_cmd[index].handle(context, buffer + len); + g_fast_cmd[index].handle(ctx, buffer + len); break; } } if (index == ncmds) { - fastboot_fail(context, "Unknown command"); + fastboot_fail(ctx, "Unknown command"); } } } -static void fastboot_publish(FAR struct fastboot_ctx_s *context, +static void fastboot_publish(FAR struct fastboot_ctx_s *ctx, FAR const char *name, FAR const char *string, int data) @@ -1058,29 +1045,29 @@ static void fastboot_publish(FAR struct fastboot_ctx_s *context, var->name = name; var->string = string; var->data = data; - var->next = context->varlist; - context->varlist = var; + var->next = ctx->varlist; + ctx->varlist = var; } -static void fastboot_create_publish(FAR struct fastboot_ctx_s *context) +static void fastboot_create_publish(FAR struct fastboot_ctx_s *ctx) { - fastboot_publish(context, "product", "NuttX", 0); - fastboot_publish(context, "kernel", "NuttX", 0); - fastboot_publish(context, "version", CONFIG_VERSION_STRING, 0); - fastboot_publish(context, "slot-count", "1", 0); - fastboot_publish(context, "max-download-size", NULL, + fastboot_publish(ctx, "product", "NuttX", 0); + fastboot_publish(ctx, "kernel", "NuttX", 0); + fastboot_publish(ctx, "version", CONFIG_VERSION_STRING, 0); + fastboot_publish(ctx, "slot-count", "1", 0); + fastboot_publish(ctx, "max-download-size", NULL, CONFIG_SYSTEM_FASTBOOTD_DOWNLOAD_MAX); } -static void fastboot_free_publish(FAR struct fastboot_ctx_s *context) +static void fastboot_free_publish(FAR struct fastboot_ctx_s *ctx) { FAR struct fastboot_var_s *next; - while (context->varlist) + while (ctx->varlist) { - next = context->varlist->next; - free(context->varlist); - context->varlist = next; + next = ctx->varlist->next; + free(ctx->varlist); + ctx->varlist = next; } } From abf9fbee30a1f524b659d8386e962c71e527bbf3 Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Thu, 19 Jun 2025 21:15:24 +0800 Subject: [PATCH 309/391] system/fastboot: switch to epoll Switch from poll() to epoll(). Signed-off-by: wangjianyu3 --- system/fastboot/fastboot.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/system/fastboot/fastboot.c b/system/fastboot/fastboot.c index 67a01dd0d7a..c5afbb9a930 100644 --- a/system/fastboot/fastboot.c +++ b/system/fastboot/fastboot.c @@ -43,13 +43,13 @@ #include #include +#include #include #include #include #include #include #include -#include #include /**************************************************************************** @@ -980,14 +980,27 @@ static void fastboot_oem(FAR struct fastboot_ctx_s *ctx, FAR const char *arg) static void fastboot_command_loop(FAR struct fastboot_ctx_s *ctx) { + struct epoll_event ev[1]; + int epfd; + if (ctx->left > 0) { - struct pollfd fds[1]; + epfd = epoll_create(1); + if (epfd < 0) + { + fb_err("open epoll failed %d", errno); + return; + } - fds[0].fd = ctx->tran_fd[0]; - fds[0].events = POLLIN; + ev[0].events = EPOLLIN; + ev[0].data.ptr = ctx; + if (epoll_ctl(epfd, EPOLL_CTL_ADD, ctx->tran_fd[0], &ev[0]) < 0) + { + fb_err("err add poll %d", ctx->tran_fd[0]); + return; + } - if (poll(fds, 1, ctx->left) <= 0) + if (epoll_wait(epfd, ev, nitems(ev), ctx->left) <= 0) { return; } From 11cf4211abe7890b544287358b79a8c385b7ed46 Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Thu, 19 Jun 2025 21:48:39 +0800 Subject: [PATCH 310/391] system/fastboot: enable usb and tcp the same time Add support for enabling USB and TCP transport at the same time. Signed-off-by: wangjianyu3 --- system/fastboot/fastboot.c | 243 ++++++++++++++++++++++--------------- 1 file changed, 143 insertions(+), 100 deletions(-) diff --git a/system/fastboot/fastboot.c b/system/fastboot/fastboot.c index c5afbb9a930..569d5c961cf 100644 --- a/system/fastboot/fastboot.c +++ b/system/fastboot/fastboot.c @@ -231,10 +231,11 @@ static ssize_t fastboot_usbdev_read(FAR struct fastboot_ctx_s *ctx, FAR void *buf, size_t len); static int fastboot_usbdev_write(FAR struct fastboot_ctx_s *ctx, FAR const void *buf, size_t len); -#elif defined(CONFIG_NET_TCP) +#endif /* TCP transport */ +#ifdef CONFIG_NET_TCP static int fastboot_tcp_initialize(FAR struct fastboot_ctx_s *ctx); static void fastboot_tcp_deinit(FAR struct fastboot_ctx_s *ctx); static ssize_t fastboot_tcp_read(FAR struct fastboot_ctx_s *ctx, @@ -275,23 +276,25 @@ static const struct memory_region_s g_memory_region[] = }; #endif -#ifdef CONFIG_USBFASTBOOT -static const struct fastboot_transport_ops_s g_tran_ops_usb = +static const struct fastboot_transport_ops_s g_tran_ops[] = { - .init = fastboot_usbdev_initialize, - .deinit = fastboot_usbdev_deinit, - .read = fastboot_usbdev_read, - .write = fastboot_usbdev_write, -}; -#elif defined(CONFIG_NET_TCP) -static const struct fastboot_transport_ops_s g_tran_ops_tcp = -{ - .init = fastboot_tcp_initialize, - .deinit = fastboot_tcp_deinit, - .read = fastboot_tcp_read, - .write = fastboot_tcp_write, -}; +#ifdef CONFIG_USBFASTBOOT + { + .init = fastboot_usbdev_initialize, + .deinit = fastboot_usbdev_deinit, + .read = fastboot_usbdev_read, + .write = fastboot_usbdev_write, + }, +#endif +#ifdef CONFIG_NET_TCP + { + .init = fastboot_tcp_initialize, + .deinit = fastboot_tcp_deinit, + .read = fastboot_tcp_read, + .write = fastboot_tcp_write, + }, #endif +}; /**************************************************************************** * Private Functions @@ -660,6 +663,11 @@ static void fastboot_download(FAR struct fastboot_ctx_s *ctx, ssize_t r = ctx->ops->read(ctx, download, len); if (r < 0) { + if (errno == EAGAIN) + { + continue; + } + ctx->download_size = 0; fb_err("fastboot_download usb read error\n"); return; @@ -978,28 +986,34 @@ static void fastboot_oem(FAR struct fastboot_ctx_s *ctx, FAR const char *arg) } } -static void fastboot_command_loop(FAR struct fastboot_ctx_s *ctx) +static void fastboot_command_loop(FAR struct fastboot_ctx_s *ctx, + size_t nctx) { - struct epoll_event ev[1]; + FAR struct fastboot_ctx_s *c; + struct epoll_event ev[nctx]; int epfd; + int n; - if (ctx->left > 0) + epfd = epoll_create(1); + if (epfd < 0) { - epfd = epoll_create(1); - if (epfd < 0) - { - fb_err("open epoll failed %d", errno); - return; - } + fb_err("open epoll failed %d", errno); + return; + } - ev[0].events = EPOLLIN; - ev[0].data.ptr = ctx; - if (epoll_ctl(epfd, EPOLL_CTL_ADD, ctx->tran_fd[0], &ev[0]) < 0) + for (c = ctx, n = nctx; n-- > 0; c++) + { + ev[n].events = EPOLLIN; + ev[n].data.ptr = c; + if (epoll_ctl(epfd, EPOLL_CTL_ADD, c->tran_fd[0], &ev[n]) < 0) { - fb_err("err add poll %d", ctx->tran_fd[0]); + fb_err("err add poll %d", c->tran_fd[0]); return; } + } + if (ctx->left > 0) + { if (epoll_wait(epfd, ev, nitems(ev), ctx->left) <= 0) { return; @@ -1008,7 +1022,10 @@ static void fastboot_command_loop(FAR struct fastboot_ctx_s *ctx) /* Reinitialize for storing TCP transport remaining data size. */ - ctx->left = 0; + for (c = ctx, n = nctx; n-- > 0; c++) + { + c->left = 0; + } while (1) { @@ -1016,27 +1033,32 @@ static void fastboot_command_loop(FAR struct fastboot_ctx_s *ctx) size_t ncmds = nitems(g_fast_cmd); size_t index; - ssize_t r = ctx->ops->read(ctx, buffer, FASTBOOT_MSG_LEN); - if (r < 0) + n = epoll_wait(epfd, ev, nitems(ev), -1); + for (n--; n >= 0; ) { - fb_err("fastboot transport read() %zd\n", r); - continue; - } + c = (FAR struct fastboot_ctx_s *)ev[n].data.ptr; + ssize_t r = c->ops->read(c, buffer, FASTBOOT_MSG_LEN); + if (r <= 0) + { + n--; + continue; + } - buffer[r] = '\0'; - for (index = 0; index < ncmds; index++) - { - size_t len = strlen(g_fast_cmd[index].prefix); - if (memcmp(buffer, g_fast_cmd[index].prefix, len) == 0) + buffer[r] = '\0'; + for (index = 0; index < ncmds; index++) { - g_fast_cmd[index].handle(ctx, buffer + len); - break; + size_t len = strlen(g_fast_cmd[index].prefix); + if (memcmp(buffer, g_fast_cmd[index].prefix, len) == 0) + { + g_fast_cmd[index].handle(c, buffer + len); + break; + } } - } - if (index == ncmds) - { - fastboot_fail(ctx, "Unknown command"); + if (index == ncmds) + { + fastboot_fail(c, "Unknown command"); + } } } } @@ -1062,25 +1084,33 @@ static void fastboot_publish(FAR struct fastboot_ctx_s *ctx, ctx->varlist = var; } -static void fastboot_create_publish(FAR struct fastboot_ctx_s *ctx) +static void fastboot_create_publish(FAR struct fastboot_ctx_s *ctx, + size_t nctx) { - fastboot_publish(ctx, "product", "NuttX", 0); - fastboot_publish(ctx, "kernel", "NuttX", 0); - fastboot_publish(ctx, "version", CONFIG_VERSION_STRING, 0); - fastboot_publish(ctx, "slot-count", "1", 0); - fastboot_publish(ctx, "max-download-size", NULL, - CONFIG_SYSTEM_FASTBOOTD_DOWNLOAD_MAX); + for (; nctx-- > 0; ctx++) + { + fastboot_publish(ctx, "product", "NuttX", 0); + fastboot_publish(ctx, "kernel", "NuttX", 0); + fastboot_publish(ctx, "version", CONFIG_VERSION_STRING, 0); + fastboot_publish(ctx, "slot-count", "1", 0); + fastboot_publish(ctx, "max-download-size", NULL, + CONFIG_SYSTEM_FASTBOOTD_DOWNLOAD_MAX); + } } -static void fastboot_free_publish(FAR struct fastboot_ctx_s *ctx) +static void fastboot_free_publish(FAR struct fastboot_ctx_s *ctx, + size_t nctx) { FAR struct fastboot_var_s *next; - while (ctx->varlist) + for (; nctx-- > 0; ctx++) { - next = ctx->varlist->next; - free(ctx->varlist); - ctx->varlist = next; + while (ctx->varlist) + { + next = ctx->varlist->next; + free(ctx->varlist); + ctx->varlist = next; + } } } @@ -1149,15 +1179,15 @@ static int fastboot_usbdev_initialize(FAR struct fastboot_ctx_s *ctx) } #endif /* SYSTEM_FASTBOOTD_USB_BOARDCTL */ - ctx->tran_fd[0] = - fastboot_open_usb(FASTBOOT_EP_BULKOUT_IDX, O_RDONLY | O_CLOEXEC); + ctx->tran_fd[0] = fastboot_open_usb(FASTBOOT_EP_BULKOUT_IDX, + O_RDONLY | O_CLOEXEC | O_NONBLOCK); if (ctx->tran_fd[0] < 0) { return ctx->tran_fd[0]; } - ctx->tran_fd[1] = - fastboot_open_usb(FASTBOOT_EP_BULKIN_IDX, O_WRONLY | O_CLOEXEC); + ctx->tran_fd[1] = fastboot_open_usb(FASTBOOT_EP_BULKIN_IDX, + O_WRONLY | O_CLOEXEC | O_NONBLOCK); if (ctx->tran_fd[1] < 0) { close(ctx->tran_fd[0]); @@ -1190,13 +1220,15 @@ static int fastboot_usbdev_write(FAR struct fastboot_ctx_s *ctx, { return fastboot_write(ctx->tran_fd[1], buf, len); } +#endif -#elif defined(CONFIG_NET_TCP) +#ifdef CONFIG_NET_TCP static int fastboot_tcp_initialize(FAR struct fastboot_ctx_s *ctx) { struct sockaddr_in addr; - ctx->tran_fd[0] = socket(AF_INET, SOCK_STREAM, 0); + ctx->tran_fd[0] = socket(AF_INET, SOCK_STREAM, + SOCK_CLOEXEC | SOCK_NONBLOCK); if (ctx->tran_fd[0] < 0) { fb_err("create socket failed %d", errno); @@ -1357,36 +1389,54 @@ static int fastboot_tcp_write(FAR struct fastboot_ctx_s *ctx, } #endif -static int fastboot_context_initialize(FAR struct fastboot_ctx_s *ctx) +static int fastboot_context_initialize(FAR struct fastboot_ctx_s *ctx, + size_t nctx) { - ctx->download_max = CONFIG_SYSTEM_FASTBOOTD_DOWNLOAD_MAX; - ctx->download_offset = 0; - ctx->download_size = 0; - ctx->flash_fd = -1; - ctx->total_imgsize = 0; - ctx->varlist = NULL; - ctx->left = 0; -#ifdef CONFIG_USBFASTBOOT - ctx->ops = &g_tran_ops_usb; -#elif defined(CONFIG_NET_TCP) - ctx->ops = &g_tran_ops_tcp; -#endif - ctx->tran_fd[0] = -1; - ctx->tran_fd[1] = -1; + int ret; - ctx->download_buffer = malloc(CONFIG_SYSTEM_FASTBOOTD_DOWNLOAD_MAX); - if (ctx->download_buffer == NULL) - { - fb_err("ERROR: Could not allocate the memory.\n"); - return -errno; + for (; nctx-- > 0; ctx++) + { + ctx->download_max = CONFIG_SYSTEM_FASTBOOTD_DOWNLOAD_MAX; + ctx->download_offset = 0; + ctx->download_size = 0; + ctx->flash_fd = -1; + ctx->total_imgsize = 0; + ctx->varlist = NULL; + ctx->left = ctx[0].left; + ctx->ops = &g_tran_ops[nctx]; + ctx->tran_fd[0] = -1; + ctx->tran_fd[1] = -1; + + ctx->download_buffer = malloc(CONFIG_SYSTEM_FASTBOOTD_DOWNLOAD_MAX); + if (ctx->download_buffer == NULL) + { + fb_err("ERROR: Could not allocate the memory.\n"); + continue; + } + + ret = ctx->ops->init(ctx); + if (ret < 0) + { + free(ctx->download_buffer); + ctx->download_buffer = NULL; + ctx->ops->deinit(ctx); + } } return 0; } -static void fastboot_context_deinit(FAR struct fastboot_ctx_s *ctx) +static void fastboot_context_deinit(FAR struct fastboot_ctx_s *ctx, + size_t nctx) { - free(ctx->download_buffer); + for (; nctx-- > 0; ctx++) + { + if (ctx->download_buffer) + { + ctx->ops->deinit(ctx); + free(ctx->download_buffer); + } + } } /**************************************************************************** @@ -1395,15 +1445,9 @@ static void fastboot_context_deinit(FAR struct fastboot_ctx_s *ctx) int main(int argc, FAR char **argv) { - struct fastboot_ctx_s context; + struct fastboot_ctx_s context[nitems(g_tran_ops)]; int ret; - ret = fastboot_context_initialize(&context); - if (ret < 0) - { - return ret; - } - if (argc > 1) { if (strcmp(argv[1], "-h") == 0) @@ -1414,23 +1458,22 @@ int main(int argc, FAR char **argv) return 0; } - if (sscanf(argv[1], "%" SCNu64 , &context.left) != 1) + if (sscanf(argv[1], "%" SCNu64 , &context[0].left) != 1) { return -EINVAL; } } - ret = context.ops->init(&context); + ret = fastboot_context_initialize(context, nitems(context)); if (ret < 0) { return ret; } - fastboot_create_publish(&context); - fastboot_command_loop(&context); - fastboot_free_publish(&context); - context.ops->deinit(&context); - fastboot_context_deinit(&context); + fastboot_create_publish(context, nitems(context)); + fastboot_command_loop(context, nitems(context)); + fastboot_free_publish(context, nitems(context)); + fastboot_context_deinit(context, nitems(context)); return ret; } From 6afed1011802a7dd4c9403d72b89db6f73229bf1 Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Fri, 20 Jun 2025 19:05:56 +0800 Subject: [PATCH 311/391] system/fastboot: add depends for TCP poll Add TCP backlog dependence for poll(), network related configurations referenced to may has not enable it, without which the TCP handshake will fail. Signed-off-by: wangjianyu3 --- system/fastboot/Kconfig | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/system/fastboot/Kconfig b/system/fastboot/Kconfig index 4b7cad26767..f5b14cd0292 100644 --- a/system/fastboot/Kconfig +++ b/system/fastboot/Kconfig @@ -6,9 +6,11 @@ menuconfig SYSTEM_FASTBOOTD bool "fastbootd" default n - depends on USBFASTBOOT || NET_TCP + depends on USBFASTBOOT || (NET_TCP && NET_TCPBACKLOG) ---help--- - support usb fastboot function. + Enable Fastboot daemon. + The USB transport depends on USBFASTBOOT. + The TCP network transport depends on NET_TCP and NET_TCPBACKLOG. if SYSTEM_FASTBOOTD From 1e053ee9360df1aa0ebfa76434d2c9eaee1a1499 Mon Sep 17 00:00:00 2001 From: simbit18 Date: Mon, 23 Jun 2025 12:18:25 +0200 Subject: [PATCH 312/391] check.yml: fix cvt2utf not found sync with nuttx repository This PR add missing cvt2utf installation on our CI see apache/nuttx#16561 Signed-off-by: simbit18 --- .github/workflows/check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 0345e0f9b89..a83c388c279 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -46,7 +46,7 @@ jobs: echo "::add-matcher::nuttx/.github/nxstyle.json" python3 -m venv .venv source .venv/bin/activate - pip install cmake-format black isort flake8 + pip install cmake-format black isort flake8 cvt2utf cd apps commits="${{ github.event.pull_request.base.sha }}..HEAD" git log --oneline $commits From fa0e073baf5370e8cb0e56554f09e66ac5ade2b8 Mon Sep 17 00:00:00 2001 From: Tomasz 'CeDeROM' CEDRO Date: Tue, 6 May 2025 15:05:31 +0200 Subject: [PATCH 313/391] github: Setup protection for master branch. * We do not have "Settings" tab in the Apache's owned repository, thus we need to update .asf.yaml file with repository settings. * No direct push to master branch is possible. * Require status checks to pass before merge. * Setup reviews parameters. * Require signatures. * Require conversation resolution. * Require linear history. Signed-off-by: Tomasz 'CeDeROM' CEDRO --- .asf.yaml | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/.asf.yaml b/.asf.yaml index 31267a11da0..7039286b020 100644 --- a/.asf.yaml +++ b/.asf.yaml @@ -1,10 +1,9 @@ +# Reference: https://github.com/apache/infrastructure-asfyaml. github: description: "Apache NuttX Apps is a collection of tools, shells, network utilities, libraries, interpreters and can be used with the NuttX RTOS" homepage: https://nuttx.apache.org/ features: - # Enable issues management issues: true - # Enable project for project management boards projects: true labels: - nuttx @@ -14,9 +13,21 @@ github: - mcu - microcontroller enabled_merge_buttons: - # disable squash button: - squash: false - # disable merge button: - merge: false - # enable rebase button: - rebase: true + squash: false + merge: false + rebase: true + protected_branches: + master: + required_status_checks: + strict: true + contexts: + - Check + - Lint + - Build + required_pull_request_reviews: + dismiss_stale_reviews: true + require_last_push_approval: true + required_approving_review_count: 2 + required_linear_history: true + required_signatures: true + required_conversation_resolution: true From 2dcad906bce8b4f810f8a035837b069e95145440 Mon Sep 17 00:00:00 2001 From: Tomasz 'CeDeROM' CEDRO Date: Wed, 7 May 2025 13:22:46 +0200 Subject: [PATCH 314/391] github: master branch protection tune. * Strict master branch protection requires all PR to be in sync with latest master even if changes are not related and there are no conflicts. * Because we have lots of daily merges this blocks most of the PRs as they are forced to be rebased on top of current master. * This also causes unnecessary automatic CI rebuild of each rebase. * Therefore we are setting strict status checks setting to false. * required_signatures in github means not only `git commit -s` but also cryptographic signature which is not required by us, setting false. * Disable "contexts" checks enforcement, that cause CI problems, mark TODO. References: https://github.com/apache/infrastructure-asfyaml?tab=readme-ov-file https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits Signed-off-by: Tomasz 'CeDeROM' CEDRO --- .asf.yaml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.asf.yaml b/.asf.yaml index 7039286b020..4e7b260a719 100644 --- a/.asf.yaml +++ b/.asf.yaml @@ -19,15 +19,16 @@ github: protected_branches: master: required_status_checks: - strict: true - contexts: - - Check - - Lint - - Build + strict: false +# Contexts cause hanging CI etc disable for now. +# contexts: +# - Check +# - Lint +# - Build required_pull_request_reviews: dismiss_stale_reviews: true require_last_push_approval: true required_approving_review_count: 2 required_linear_history: true - required_signatures: true + required_signatures: false required_conversation_resolution: true From 6bc5e71a136e91df8e4114154f28651c08025d85 Mon Sep 17 00:00:00 2001 From: Eren Terzioglu Date: Mon, 20 Jan 2025 14:39:29 +0100 Subject: [PATCH 315/391] .github/ISSUE_TEMPLATE: Add host_info command section into bug report template --- .github/ISSUE_TEMPLATE/001_bug_report.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/001_bug_report.yml b/.github/ISSUE_TEMPLATE/001_bug_report.yml index 97ee87d779d..ac18add90d6 100644 --- a/.github/ISSUE_TEMPLATE/001_bug_report.yml +++ b/.github/ISSUE_TEMPLATE/001_bug_report.yml @@ -140,6 +140,13 @@ body: validations: required: true + - type: textarea + attributes: + label: "Host information" + description: "What is the output of `make host_info` command while your buggy configuration selected and if possible device connected to your system?" + validations: + required: false + - type: markdown attributes: value: | From b1fcf5041056eda27cc4a4a6fd0e6613502cd973 Mon Sep 17 00:00:00 2001 From: Lars Kruse Date: Fri, 2 May 2025 12:40:33 +0200 Subject: [PATCH 316/391] ci: enable spelling checks (via codespell) --- .github/workflows/check.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index a83c388c279..6f007e52fb9 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -46,9 +46,9 @@ jobs: echo "::add-matcher::nuttx/.github/nxstyle.json" python3 -m venv .venv source .venv/bin/activate - pip install cmake-format black isort flake8 cvt2utf + pip install codespell cmake-format black isort flake8 cvt2utf cd apps commits="${{ github.event.pull_request.base.sha }}..HEAD" git log --oneline $commits - echo "../nuttx/tools/checkpatch.sh -m -g $commits" - ../nuttx/tools/checkpatch.sh -m -g $commits + echo "../nuttx/tools/checkpatch.sh -c -u -m -g $commits" + ../nuttx/tools/checkpatch.sh -c -u -m -g $commits From 0ff820e6147ed6390b5905e3365fada09615c63b Mon Sep 17 00:00:00 2001 From: Tomasz 'CeDeROM' CEDRO Date: Mon, 16 Sep 2024 15:46:40 +0200 Subject: [PATCH 317/391] Update github pull request template. * Update CONTRIBUTING.md guide with hints and examples. * Minor GitHub Pull Request Template update hinting expected information. Signed-off-by: Tomasz 'CeDeROM' CEDRO --- .github/PULL_REQUEST_TEMPLATE.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index f0c73122655..0c929e85918 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,6 +1,21 @@ +*Note: Please adhere to [Contributing Guidelines](../CONTRIBUTING.md).* + ## Summary +*Update this section with information on why change is necessary, + what it exactly does and how, if new feature shows up, provide + references (dependencies, similar problems and solutions), etc.* + ## Impact +*Update this section, where applicable, on how change affects users, + build process, hardware, documentation, security, compatibility, etc.* + ## Testing +*Update this section with details on how did you verify the change, + what Host was used for build (OS, CPU, compiler, ..), what Target was + used for verification (arch, board:config, ..), etc. Providing build + and runtime logs from before and after change is highly appreciated.* + + From 559dcf5a9049901d3b62154d9dda09452d215b4b Mon Sep 17 00:00:00 2001 From: Tomasz 'CeDeROM' CEDRO Date: Fri, 11 Oct 2024 20:55:49 +0200 Subject: [PATCH 318/391] Contributing and PR template fix. * Fix CONTRIBUTING.md github link reference. * Full URL is provided to avoid relative/fork reference issues. * Minor update on full contributing documentation. Signed-off-by: Tomasz 'CeDeROM' CEDRO --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 0c929e85918..d95cfcec565 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,4 +1,4 @@ -*Note: Please adhere to [Contributing Guidelines](../CONTRIBUTING.md).* +*Note: Please adhere to [Contributing Guidelines](https://github.com/apache/nuttx/blob/master/CONTRIBUTING.md).* ## Summary From 23d5abeb760ff613ad87c874022bd9ee59268e09 Mon Sep 17 00:00:00 2001 From: xuxingliang Date: Fri, 16 Aug 2024 09:58:13 +0800 Subject: [PATCH 319/391] tools: make isort and black formatters to work together Config multi line output to mode 3, so isort and black can agree with each other: ``` 3 - Vertical Hanging Indent from third_party import ( lib1, lib2, lib3, lib4, ) ``` Signed-off-by: xuxingliang --- .github/linters/setup.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/linters/setup.cfg b/.github/linters/setup.cfg index b0224c1475b..1f065ea7504 100644 --- a/.github/linters/setup.cfg +++ b/.github/linters/setup.cfg @@ -2,6 +2,7 @@ ignore = W503,W605,E203 max-complexity = 27 max-line-length = 125 +multi_line_output=3 show-source = True statistics = True From 433765bbc86ca7507b37324470b4f31198ddc8ac Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Sat, 16 Nov 2024 23:08:31 +0800 Subject: [PATCH 320/391] .github/linters: Ignore E704 warning since black and flake8 disagree on code style: https://github.com/pyvista/pyvista/issues/5591 Signed-off-by: Xiang Xiao --- .github/linters/setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/linters/setup.cfg b/.github/linters/setup.cfg index 1f065ea7504..a8b142d93a0 100644 --- a/.github/linters/setup.cfg +++ b/.github/linters/setup.cfg @@ -1,5 +1,5 @@ [flake8] -ignore = W503,W605,E203 +ignore = W503,W605,E203,E704 max-complexity = 27 max-line-length = 125 multi_line_output=3 From b6f554c3e2c3f1e0ba625a48bac5030aeb93e132 Mon Sep 17 00:00:00 2001 From: Brennan Ashton Date: Wed, 16 Dec 2020 20:29:00 -0800 Subject: [PATCH 321/391] Add project GitHub Security Policy page Signed-off-by: Brennan Ashton --- .github/SECURITY.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/SECURITY.md diff --git a/.github/SECURITY.md b/.github/SECURITY.md new file mode 100644 index 00000000000..3f34d85f752 --- /dev/null +++ b/.github/SECURITY.md @@ -0,0 +1,17 @@ +# Security Policy + +## Supported Versions + +| Version | Supported | +| ------- | ------------------ | +| 10.0.x | :heavy_check_mark: | +| 9.1.x | :heavy_check_mark: | +| < 9.1 | :x: | + +## Reporting a Vulnerability + +If you think you have found a possible vulnerability please reach out to the _private_ project mailing list +private@nuttx.apache.org or the Apache Security list security@apache.org. + +Please **DO NOT** create a GitHub issue or email the project dev list as they are public. +This project follows the Apache Vulnerability Handling Policy docuemnted [here](https://www.apache.org/security/committers.html#vulnerability-handling) From f1b78948db0da2e699fd3f472fb96f0307ff9e6a Mon Sep 17 00:00:00 2001 From: Abdelatif Guettouche Date: Thu, 17 Dec 2020 09:52:44 +0000 Subject: [PATCH 322/391] .github/SECURITY.md: Fix a typo. Signed-off-by: Abdelatif Guettouche --- .github/SECURITY.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/SECURITY.md b/.github/SECURITY.md index 3f34d85f752..af523f6ba1c 100644 --- a/.github/SECURITY.md +++ b/.github/SECURITY.md @@ -14,4 +14,4 @@ If you think you have found a possible vulnerability please reach out to the _pr private@nuttx.apache.org or the Apache Security list security@apache.org. Please **DO NOT** create a GitHub issue or email the project dev list as they are public. -This project follows the Apache Vulnerability Handling Policy docuemnted [here](https://www.apache.org/security/committers.html#vulnerability-handling) +This project follows the Apache Vulnerability Handling Policy documented [here](https://www.apache.org/security/committers.html#vulnerability-handling). From f97274611f3660814764d04db379e24b6b0af67d Mon Sep 17 00:00:00 2001 From: Brennan Ashton Date: Sun, 20 Nov 2022 22:56:46 -0800 Subject: [PATCH 323/391] docs: Include released 10.x and 11.x versions under security policy. Fixes #7514 --- .github/SECURITY.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/SECURITY.md b/.github/SECURITY.md index af523f6ba1c..89213a4c02c 100644 --- a/.github/SECURITY.md +++ b/.github/SECURITY.md @@ -4,6 +4,10 @@ | Version | Supported | | ------- | ------------------ | +| 11.0.x | :heavy_check_mark: | +| 10.3.x | :heavy_check_mark: | +| 10.2.x | :heavy_check_mark: | +| 10.1.x | :heavy_check_mark: | | 10.0.x | :heavy_check_mark: | | 9.1.x | :heavy_check_mark: | | < 9.1 | :x: | From ee33688acadec76dd85b7d9ed3cba2d49e237a85 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Mon, 23 Jun 2025 20:43:46 +0800 Subject: [PATCH 324/391] Fix /.github/ISSUE_TEMPLATE/001_bug_report.yml:122: Intertial ==> Inertial Signed-off-by: Xiang Xiao --- .github/ISSUE_TEMPLATE/001_bug_report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/001_bug_report.yml b/.github/ISSUE_TEMPLATE/001_bug_report.yml index ac18add90d6..1206aa1ea26 100644 --- a/.github/ISSUE_TEMPLATE/001_bug_report.yml +++ b/.github/ISSUE_TEMPLATE/001_bug_report.yml @@ -119,7 +119,7 @@ body: - "[Area: Games]" - "[Area: Graphics]" - "[Area: Industry]" - - "[Area: Intertial]" + - "[Area: Inertial]" - "[Area: Interpreters]" - "[Area: Logging]" - "[Area: LTE]" From 4b5af957ac68edd016f642e00e67cc60ba843e4b Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Tue, 24 Jun 2025 18:35:02 +0800 Subject: [PATCH 325/391] system/fastboot: remove interest and close epoll Remove fds from the interest list and close epoll if need. Signed-off-by: wangjianyu3 --- system/fastboot/fastboot.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/system/fastboot/fastboot.c b/system/fastboot/fastboot.c index 569d5c961cf..190040e5531 100644 --- a/system/fastboot/fastboot.c +++ b/system/fastboot/fastboot.c @@ -1008,7 +1008,7 @@ static void fastboot_command_loop(FAR struct fastboot_ctx_s *ctx, if (epoll_ctl(epfd, EPOLL_CTL_ADD, c->tran_fd[0], &ev[n]) < 0) { fb_err("err add poll %d", c->tran_fd[0]); - return; + goto epoll_close; } } @@ -1016,7 +1016,7 @@ static void fastboot_command_loop(FAR struct fastboot_ctx_s *ctx, { if (epoll_wait(epfd, ev, nitems(ev), ctx->left) <= 0) { - return; + goto epoll_close; } } @@ -1061,6 +1061,14 @@ static void fastboot_command_loop(FAR struct fastboot_ctx_s *ctx, } } } + +epoll_close: + while (--c >= ctx) + { + epoll_ctl(epfd, EPOLL_CTL_DEL, c->tran_fd[0], NULL); + } + + close(epfd); } static void fastboot_publish(FAR struct fastboot_ctx_s *ctx, From 9df322d9389fbe60e27a441d63df852364d523d0 Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Tue, 24 Jun 2025 18:50:18 +0800 Subject: [PATCH 326/391] system/fastboot: add disconn for usb transport Disconnect usbdev when deinit USB transport. Signed-off-by: wangjianyu3 --- system/fastboot/fastboot.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/system/fastboot/fastboot.c b/system/fastboot/fastboot.c index 190040e5531..c34bc23797f 100644 --- a/system/fastboot/fastboot.c +++ b/system/fastboot/fastboot.c @@ -169,6 +169,7 @@ struct fastboot_ctx_s */ uint64_t left; + FAR void *handle; FAR void *download_buffer; FAR struct fastboot_var_s *varlist; CODE int (*upload_func)(FAR struct fastboot_ctx_s *); @@ -1157,7 +1158,6 @@ static int fastboot_usbdev_initialize(FAR struct fastboot_ctx_s *ctx) # else uint8_t dev = BOARDIOC_USBDEV_FASTBOOT; # endif - FAR void *handle; int ret; ctrl.usbdev = dev; @@ -1177,7 +1177,7 @@ static int fastboot_usbdev_initialize(FAR struct fastboot_ctx_s *ctx) ctrl.action = BOARDIOC_USBDEV_CONNECT; ctrl.instance = 0; ctrl.config = 0; - ctrl.handle = &handle; + ctrl.handle = &ctx->handle; ret = boardctl(BOARDIOC_USBDEV_CONTROL, (uintptr_t)&ctrl); if (ret < 0) @@ -1208,6 +1208,9 @@ static int fastboot_usbdev_initialize(FAR struct fastboot_ctx_s *ctx) static void fastboot_usbdev_deinit(FAR struct fastboot_ctx_s *ctx) { +#ifdef CONFIG_SYSTEM_FASTBOOTD_USB_BOARDCTL + struct boardioc_usbdev_ctrl_s ctrl; +#endif int i; for (i = 0; i < nitems(ctx->tran_fd); i++) @@ -1215,6 +1218,27 @@ static void fastboot_usbdev_deinit(FAR struct fastboot_ctx_s *ctx) close(ctx->tran_fd[i]); ctx->tran_fd[i] = -1; } + +#ifdef CONFIG_SYSTEM_FASTBOOTD_USB_BOARDCTL + if (ctx->handle) + { +# ifdef CONFIG_USBDEV_COMPOSITE + ctrl.usbdev = BOARDIOC_USBDEV_COMPOSITE; +# else + ctrl.usbdev = BOARDIOC_USBDEV_FASTBOOT; +# endif + ctrl.action = BOARDIOC_USBDEV_DISCONNECT; + ctrl.instance = 0; + ctrl.config = 0; + ctrl.handle = &ctx->handle; + + i = boardctl(BOARDIOC_USBDEV_CONTROL, (uintptr_t)&ctrl); + if (i < 0) + { + fb_err("boardctl(BOARDIOC_USBDEV_DISCONNECT) failed: %d\n", i); + } + } +#endif /* SYSTEM_FASTBOOTD_USB_BOARDCTL */ } static ssize_t fastboot_usbdev_read(FAR struct fastboot_ctx_s *ctx, From c4ff19a7e447dec2cdb188415650c5b0e2df9d9c Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Wed, 25 Jun 2025 00:53:07 +0800 Subject: [PATCH 327/391] system/fastboot: fix typos of response error log Fix typos of sparse header comments and download/upload response error log. Signed-off-by: wangjianyu3 --- system/fastboot/fastboot.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/system/fastboot/fastboot.c b/system/fastboot/fastboot.c index c34bc23797f..b20be6b7d63 100644 --- a/system/fastboot/fastboot.c +++ b/system/fastboot/fastboot.c @@ -109,7 +109,7 @@ struct fastboot_sparse_header_s { uint32_t magic; /* 0xed26ff3a */ uint16_t major_version; /* (0x1) - reject images with higher major versions */ - uint16_t minor_version; /* (0x0) - allow images with higer minor versions */ + uint16_t minor_version; /* (0x0) - allow images with higher minor versions */ uint16_t file_hdr_sz; /* 28 bytes for first revision of the file format */ uint16_t chunk_hdr_sz; /* 12 bytes for first revision of the file format */ uint32_t blk_sz; /* block size in bytes, must be a multiple of 4 (4096) */ @@ -652,7 +652,7 @@ static void fastboot_download(FAR struct fastboot_ctx_s *ctx, ret = ctx->ops->write(ctx, response, strlen(response)); if (ret < 0) { - fb_err("Reponse error [%d]\n", -ret); + fb_err("Response error [%d]\n", -ret); return; } @@ -943,7 +943,7 @@ static void fastboot_upload(FAR struct fastboot_ctx_s *ctx, ret = ctx->ops->write(ctx, response, strlen(response)); if (ret < 0) { - fb_err("Reponse error [%d]\n", -ret); + fb_err("Response error [%d]\n", -ret); goto done; } From bb508520f1e29a532ac0df413d2714b410e96bf3 Mon Sep 17 00:00:00 2001 From: Jean THOMAS Date: Wed, 25 Jun 2025 14:44:57 +0200 Subject: [PATCH 328/391] system/settings: fix assertion triggered by uninitialized variables Fix non-NULL pointer assertion in `get_setting()` caused by uninitialized pointer variables. Signed-off-by: Jean THOMAS --- system/settings/settings.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/system/settings/settings.c b/system/settings/settings.c index d6a6673af91..b4fcef34f2b 100644 --- a/system/settings/settings.c +++ b/system/settings/settings.c @@ -1312,7 +1312,7 @@ int settings_create(FAR char *key, enum settings_type_e type, ...) int settings_type(FAR char *key, FAR enum settings_type_e *stype) { int ret; - FAR setting_t *setting; + FAR setting_t *setting = NULL; if (!g_settings.initialized) { @@ -1360,7 +1360,7 @@ int settings_type(FAR char *key, FAR enum settings_type_e *stype) int settings_get(FAR char *key, enum settings_type_e type, ...) { int ret; - FAR setting_t *setting; + FAR setting_t *setting = NULL; if (!g_settings.initialized) { @@ -1458,7 +1458,7 @@ int settings_get(FAR char *key, enum settings_type_e type, ...) int settings_set(FAR char *key, enum settings_type_e type, ...) { int ret; - FAR setting_t *setting; + FAR setting_t *setting = NULL; uint32_t h; if (!g_settings.initialized) From 25d43c65db9c73b4b5f6f29268f92b6795fafb40 Mon Sep 17 00:00:00 2001 From: wangmingrong1 Date: Fri, 28 Feb 2025 12:55:36 +0800 Subject: [PATCH 329/391] apps/gcov: Alloc to strip 0 Signed-off-by: wangmingrong1 --- system/gcov/gcov.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/gcov/gcov.c b/system/gcov/gcov.c index 64acb3c0e6d..3b66cfcaf8d 100644 --- a/system/gcov/gcov.c +++ b/system/gcov/gcov.c @@ -71,7 +71,7 @@ static void show_usage(FAR const char *progname) static void gcov_dump(FAR const char * path, FAR const char *strip) { - if (path == NULL || access(path, F_OK) != 0 || atoi(strip) <= 0) + if (path == NULL || access(path, F_OK) != 0 || atoi(strip) < 0) { fprintf(stderr, "ERROR: Invalid parameter\n"); return; @@ -157,7 +157,7 @@ static void gcov_stdout_dump(void) int main(int argc, FAR char *argv[]) { - FAR const char *strip = "99"; + FAR const char *strip = CONFIG_COVERAGE_DEFAULT_PREFIX_STRIP; FAR const char *path = NULL; int option; From dfbaedd5c2f230b78955fbf5c1416233b45e0717 Mon Sep 17 00:00:00 2001 From: wangmingrong1 Date: Wed, 12 Mar 2025 11:55:09 +0800 Subject: [PATCH 330/391] gcov: Refactoring the implementation framework of gcov All implementations of gcov are sunk to the kernel implementation 1. Support three dump modes: serial port output, single file output, standard output Signed-off-by: wangmingrong1 --- system/gcov/gcov.c | 123 ++++++--------------------------------------- 1 file changed, 14 insertions(+), 109 deletions(-) diff --git a/system/gcov/gcov.c b/system/gcov/gcov.c index 3b66cfcaf8d..c71c84761b3 100644 --- a/system/gcov/gcov.c +++ b/system/gcov/gcov.c @@ -24,6 +24,7 @@ * Included Files ****************************************************************************/ +#include #include #include #include @@ -34,17 +35,6 @@ #include #include -/**************************************************************************** - * Private Types - ****************************************************************************/ - -struct gcov_arg -{ - FAR const char *name; - struct lib_stdoutstream_s stdoutstream; - struct lib_hexdumpstream_s hexstream; -}; - /**************************************************************************** * Private Functions ****************************************************************************/ @@ -65,92 +55,6 @@ static void show_usage(FAR const char *progname) exit(EXIT_FAILURE); } -/**************************************************************************** - * Name: gcov_dump - ****************************************************************************/ - -static void gcov_dump(FAR const char * path, FAR const char *strip) -{ - if (path == NULL || access(path, F_OK) != 0 || atoi(strip) < 0) - { - fprintf(stderr, "ERROR: Invalid parameter\n"); - return; - } - - setenv("GCOV_PREFIX_STRIP", strip, 1); - setenv("GCOV_PREFIX", path, 1); - __gcov_dump(); -} - -/**************************************************************************** - * Name: stdout_dump - ****************************************************************************/ - -#ifndef CONFIG_COVERAGE_TOOLCHAIN -static void stdout_dump(FAR const void *buffer, size_t size, - FAR void *arg) -{ - FAR struct gcov_arg *args = (FAR struct gcov_arg *)arg; - uint16_t checksum = 0; - int i; - - if (size == 0) - { - return; - } - - for (i = 0; i < size; i++) - { - checksum += ((FAR const uint8_t *)buffer)[i]; - } - - lib_sprintf(&args->stdoutstream.common, - "gcov start filename:%s size: %zuByte\n", - args->name, size); - lib_stream_puts(&args->hexstream, buffer, size); - lib_stream_flush(&args->hexstream); - lib_sprintf(&args->stdoutstream.common, - "gcov end filename:%s checksum: %#0x\n", - args->name, checksum); - lib_stream_flush(&args->stdoutstream); -} - -/**************************************************************************** - * Name: stdout_filename - ****************************************************************************/ - -static void stdout_filename(const char *name, FAR void *arg) -{ - FAR struct gcov_arg *args = (FAR struct gcov_arg *)arg; - args->name = name; - __gcov_filename_to_gcfn(name, NULL, NULL); -} - -/**************************************************************************** - * Name: gcov_stdout_dump - * - * Description: - * Dump the gcov information of all translation units to stdout. - * - ****************************************************************************/ - -static void gcov_stdout_dump(void) -{ - FAR struct gcov_info *info = __gcov_info_start; - FAR struct gcov_info *end = __gcov_info_end; - struct gcov_arg arg; - - lib_stdoutstream(&arg.stdoutstream, stdout); - lib_hexdumpstream(&arg.hexstream, &arg.stdoutstream.common); - - while (info != end) - { - __gcov_info_to_gcda(info, stdout_filename, stdout_dump, NULL, &arg); - info = info->next; - } -} -#endif - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -159,14 +63,10 @@ int main(int argc, FAR char *argv[]) { FAR const char *strip = CONFIG_COVERAGE_DEFAULT_PREFIX_STRIP; FAR const char *path = NULL; + bool onefile = false; int option; - if (argc < 2) - { - show_usage(argv[0]); - } - - while ((option = getopt(argc, argv, "d::t:rh")) != ERROR) + while ((option = getopt(argc, argv, "d::t:orh")) != ERROR) { switch (option) { @@ -191,17 +91,22 @@ int main(int argc, FAR char *argv[]) } } -#ifndef CONFIG_COVERAGE_TOOLCHAIN - if (path == NULL) + if (access(path, F_OK) == 0) + { + onefile = true; + } + + if (onefile) { - gcov_stdout_dump(); + setenv("GCOV_DUMP_ONEFILE", "1", 1); } else -#endif { - gcov_dump(path, strip); + setenv("GCOV_DUMP_ONEFILE", "0", 1); } - printf("Gcov dump complete\n"); + setenv("GCOV_PREFIX_STRIP", strip, 1); + setenv("GCOV_PREFIX", path, 1); + __gcov_dump(); return 0; } From 92c490579db2e6cbeb9f9362e3d6df1f9cd5cabb Mon Sep 17 00:00:00 2001 From: wangmingrong1 Date: Mon, 31 Mar 2025 15:59:28 +0800 Subject: [PATCH 331/391] gcov: Output mode judgment is implemented in the kernel layer Signed-off-by: wangmingrong1 --- system/gcov/gcov.c | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/system/gcov/gcov.c b/system/gcov/gcov.c index c71c84761b3..b317cbb28e2 100644 --- a/system/gcov/gcov.c +++ b/system/gcov/gcov.c @@ -63,7 +63,6 @@ int main(int argc, FAR char *argv[]) { FAR const char *strip = CONFIG_COVERAGE_DEFAULT_PREFIX_STRIP; FAR const char *path = NULL; - bool onefile = false; int option; while ((option = getopt(argc, argv, "d::t:orh")) != ERROR) @@ -91,20 +90,6 @@ int main(int argc, FAR char *argv[]) } } - if (access(path, F_OK) == 0) - { - onefile = true; - } - - if (onefile) - { - setenv("GCOV_DUMP_ONEFILE", "1", 1); - } - else - { - setenv("GCOV_DUMP_ONEFILE", "0", 1); - } - setenv("GCOV_PREFIX_STRIP", strip, 1); setenv("GCOV_PREFIX", path, 1); __gcov_dump(); From 4be82876e4d533a332a52a9ad797da306129e238 Mon Sep 17 00:00:00 2001 From: Jean THOMAS Date: Wed, 25 Jun 2025 15:35:23 +0200 Subject: [PATCH 332/391] system/settings: general code cleaning * Remove duplicate checks, use switch/case whenever possible * Remove assertions just before if () condition checking the exact same thing * Replace if (condition) assert(0) with assert(condition) Signed-off-by: Jean THOMAS --- system/settings/settings.c | 197 +++++++++++++++---------------------- 1 file changed, 78 insertions(+), 119 deletions(-) diff --git a/system/settings/settings.c b/system/settings/settings.c index b4fcef34f2b..2a6bccb93f7 100644 --- a/system/settings/settings.c +++ b/system/settings/settings.c @@ -249,7 +249,6 @@ static int set_string(FAR setting_t *setting, FAR char *str) return -EACCES; } - ASSERT(strlen(str) < CONFIG_SYSTEM_SETTINGS_VALUE_SIZE); if (strlen(str) >= CONFIG_SYSTEM_SETTINGS_VALUE_SIZE) { return -EINVAL; @@ -284,28 +283,29 @@ static int set_string(FAR setting_t *setting, FAR char *str) static int get_int(FAR setting_t *setting, FAR int *i) { assert(setting); - if ((setting->type != SETTING_INT) && - (setting->type != SETTING_BOOL) && - (setting->type != SETTING_FLOAT)) - { - return -EACCES; - } - if (setting->type == SETTING_INT) - { - *i = setting->val.i; - } - else if (setting->type == SETTING_BOOL) + switch (setting->type) { - *i = !!setting->val.i; - } - else if (setting->type == SETTING_FLOAT) - { - *i = (int)setting->val.f; - } - else - { - return -EINVAL; + case SETTING_INT: + { + *i = setting->val.i; + } + break; + case SETTING_BOOL: + { + *i = !!setting->val.i; + } + break; + case SETTING_FLOAT: + { + *i = (int)setting->val.f; + } + break; + default: + { + return -EACCES; + } + break; } return OK; @@ -359,19 +359,20 @@ static int set_int(FAR setting_t *setting, int i) static int get_bool(FAR setting_t *setting, FAR int *i) { assert(setting); - if ((setting->type != SETTING_BOOL) && - (setting->type != SETTING_INT)) - { - return -EACCES; - } - if ((setting->type == SETTING_INT) || (setting->type == SETTING_BOOL)) + switch (setting->type) { - *i = !!setting->val.i; - } - else - { - return -EINVAL; + case SETTING_INT: + case SETTING_BOOL: + { + *i = !!setting->val.i; + } + break; + default: + { + return -EACCES; + } + break; } return OK; @@ -423,23 +424,24 @@ static int set_bool(FAR setting_t *setting, int i) static int get_float(FAR setting_t *setting, FAR double *f) { assert(setting); - if ((setting->type != SETTING_FLOAT) && - (setting->type != SETTING_INT)) - { - return -EACCES; - } - if (setting->type == SETTING_FLOAT) - { - *f = setting->val.f; - } - else if (setting->type == SETTING_INT) - { - *f = (double)setting->val.i; - } - else + switch (setting->type) { - return -EINVAL; + case SETTING_FLOAT: + { + *f = setting->val.f; + } + break; + case SETTING_INT: + { + *f = (double)setting->val.i; + } + break; + default: + { + return -EACCES; + } + break; } return OK; @@ -494,24 +496,24 @@ static int get_ip(FAR setting_t *setting, FAR struct in_addr *ip) { int ret; assert(setting); - if ((setting->type != SETTING_IP_ADDR) && - (setting->type != SETTING_STRING)) - { - return -EACCES; - } - if (setting->type == SETTING_IP_ADDR) + switch (setting->type) { - memcpy(ip, &setting->val.ip, sizeof(struct in_addr)); - ret = OK; - } - else if (setting->type == SETTING_STRING) - { - ret = inet_pton(AF_INET, setting->val.s, ip); - } - else - { - ret = -EINVAL; + case SETTING_IP_ADDR: + { + memcpy(ip, &setting->val.ip, sizeof(struct in_addr)); + ret = OK; + } + break; + case SETTING_STRING: + { + ret = inet_pton(AF_INET, setting->val.s, ip); + } + break; + default: + { + return -EACCES; + } } return ret; @@ -673,10 +675,7 @@ static void dump_cache(union sigval ptr) int i; ret = pthread_mutex_lock(&g_settings.mtx); - if (ret < 0) - { - assert(0); - } + assert(ret >= 0); for (i = 0; i < CONFIG_SYSTEM_SETTINGS_MAX_STORAGES; i++) { @@ -809,10 +808,7 @@ int settings_setstorage(FAR char *file, enum storage_type_e type) int idx = 0; uint32_t h; - if (!g_settings.initialized) - { - assert(0); - } + assert(g_settings.initialized); ret = pthread_mutex_lock(&g_settings.mtx); if (ret < 0) @@ -908,10 +904,7 @@ int settings_sync(bool wait_dump) int ret = OK; uint32_t h; - if (!g_settings.initialized) - { - assert(0); - } + assert(g_settings.initialized); ret = pthread_mutex_lock(&g_settings.mtx); if (ret < 0) @@ -971,10 +964,7 @@ int settings_notify(void) int ret; int idx = 0; - if (!g_settings.initialized) - { - assert(0); - } + assert(g_settings.initialized); ret = pthread_mutex_lock(&g_settings.mtx); if (ret < 0) @@ -1026,10 +1016,7 @@ int settings_notify(void) int settings_hash(FAR uint32_t *h) { - if (!g_settings.initialized) - { - assert(0); - } + assert(g_settings.initialized); *h = g_settings.hash; @@ -1062,10 +1049,7 @@ int settings_clear(void) { int ret; - if (!g_settings.initialized) - { - assert(0); - } + assert(g_settings.initialized); ret = pthread_mutex_lock(&g_settings.mtx); if (ret < 0) @@ -1114,26 +1098,18 @@ int settings_create(FAR char *key, enum settings_type_e type, ...) FAR setting_t *setting = NULL; int j; - if (!g_settings.initialized) - { - assert(0); - } - - assert(type != SETTING_EMPTY); + assert(g_settings.initialized); - assert(strlen(key)); - if (strlen(key) == 0) + if (type == SETTING_EMPTY) { return -EINVAL; } - assert(strlen(key) < CONFIG_SYSTEM_SETTINGS_KEY_SIZE); - if (strlen(key) >= CONFIG_SYSTEM_SETTINGS_KEY_SIZE) + if (strlen(key) == 0 || strlen(key) >= CONFIG_SYSTEM_SETTINGS_KEY_SIZE) { return -EINVAL; } - assert(isalpha(key[0]) && (sanity_check(key) == OK)); if (!isalpha(key[0]) || (sanity_check(key) < 0)) { return -EINVAL; @@ -1168,7 +1144,6 @@ int settings_create(FAR char *key, enum settings_type_e type, ...) } } - assert(setting); if (setting == NULL) { goto errout; @@ -1314,11 +1289,7 @@ int settings_type(FAR char *key, FAR enum settings_type_e *stype) int ret; FAR setting_t *setting = NULL; - if (!g_settings.initialized) - { - assert(0); - } - + assert(g_settings.initialized); assert(stype != NULL); assert(key != NULL); @@ -1362,11 +1333,7 @@ int settings_get(FAR char *key, enum settings_type_e type, ...) int ret; FAR setting_t *setting = NULL; - if (!g_settings.initialized) - { - assert(0); - } - + assert(g_settings.initialized); assert(type != SETTING_EMPTY); assert(key[0] != '\0'); @@ -1461,11 +1428,7 @@ int settings_set(FAR char *key, enum settings_type_e type, ...) FAR setting_t *setting = NULL; uint32_t h; - if (!g_settings.initialized) - { - assert(0); - } - + assert(g_settings.initialized); assert(type != SETTING_EMPTY); assert(key[0] != '\0'); @@ -1568,11 +1531,7 @@ int settings_iterate(int idx, FAR setting_t *setting) { int ret; - if (!g_settings.initialized) - { - assert(0); - } - + assert(g_settings.initialized); assert(setting); if ((idx < 0) || (idx >= CONFIG_SYSTEM_SETTINGS_MAP_SIZE)) From c7b395e7da2148cb2b46fc4dd1071d2125bd6cfd Mon Sep 17 00:00:00 2001 From: Jean THOMAS Date: Thu, 26 Jun 2025 11:15:57 +0200 Subject: [PATCH 333/391] system/settings: Add spaces after each switch 'case' --- system/settings/settings.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/system/settings/settings.c b/system/settings/settings.c index 2a6bccb93f7..105c093dd8e 100644 --- a/system/settings/settings.c +++ b/system/settings/settings.c @@ -291,16 +291,19 @@ static int get_int(FAR setting_t *setting, FAR int *i) *i = setting->val.i; } break; + case SETTING_BOOL: { *i = !!setting->val.i; } break; + case SETTING_FLOAT: { *i = (int)setting->val.f; } break; + default: { return -EACCES; @@ -368,6 +371,7 @@ static int get_bool(FAR setting_t *setting, FAR int *i) *i = !!setting->val.i; } break; + default: { return -EACCES; @@ -432,11 +436,13 @@ static int get_float(FAR setting_t *setting, FAR double *f) *f = setting->val.f; } break; + case SETTING_INT: { *f = (double)setting->val.i; } break; + default: { return -EACCES; @@ -505,11 +511,13 @@ static int get_ip(FAR setting_t *setting, FAR struct in_addr *ip) ret = OK; } break; + case SETTING_STRING: { ret = inet_pton(AF_INET, setting->val.s, ip); } break; + default: { return -EACCES; From 63c86438fbd2164d278dc44610c29c09bbd25486 Mon Sep 17 00:00:00 2001 From: Alan Carvalho de Assis Date: Thu, 26 Jun 2025 16:53:32 -0300 Subject: [PATCH 334/391] apps/can: Replace fprintf with dprint This modification will remove the dependency on CONFIG_FILE_STREAM, useful for small devices. Signed-off-by: Alan C. Assis --- examples/can/can_main.c | 39 ++++++++++++++++----------------------- 1 file changed, 16 insertions(+), 23 deletions(-) diff --git a/examples/can/can_main.c b/examples/can/can_main.c index 94402fdfeaf..b62f565fe05 100644 --- a/examples/can/can_main.c +++ b/examples/can/can_main.c @@ -105,7 +105,7 @@ static void show_usage(FAR const char *progname) { - fprintf(stderr, "USAGE: %s" + dprintf(STDERR_FILENO, "USAGE: %s" " [-n : The number of messages to send. Default: 32\n"); #ifdef CONFIG_EXAMPLES_CAN_WRITE #ifdef CONFIG_CAN_EXTID - fprintf(stderr, "-s: Use standard IDs. Default: Extended ID\n"); + dprintf(STDERR_FILENO, "-s: Use standard IDs. Default: Extended ID\n"); #endif #ifdef CONFIG_CAN_FD - fprintf(stderr, "-e: Use extended data length without bit rate switch. " - "Default: bit rate switch enabled\n"); + dprintf(STDERR_FILENO, "-e: Use extended data length without bit rate " + "switch. Default: bit rate switch enabled\n"); #endif - fprintf(stderr, "-a : The start message id. Default 1\n"); - fprintf(stderr, "-b : The start message id. Default %d\n", + dprintf(STDERR_FILENO, "-a : The start message id. Default 1\n"); + dprintf(STDERR_FILENO, "-b : The start message id. Default %d\n", MAX_ID); #endif - fprintf(stderr, "-h: Show this message and exit\n"); + dprintf(STDERR_FILENO, "-h: Show this message and exit\n"); } /**************************************************************************** @@ -213,7 +213,7 @@ int main(int argc, FAR char *argv[]) minid = strtol(optarg, NULL, 10); if (minid < 1 || minid > maxid) { - fprintf(stderr, " out of range\n"); + dprintf(STDERR_FILENO, " out of range\n"); badarg = true; } break; @@ -222,7 +222,7 @@ int main(int argc, FAR char *argv[]) maxid = strtol(optarg, NULL, 10); if (maxid < minid || maxid > MAX_ID) { - fprintf(stderr, "ERROR: out of range\n"); + dprintf(STDERR_FILENO, "ERROR: out of range\n"); badarg = true; } break; @@ -236,19 +236,19 @@ int main(int argc, FAR char *argv[]) nmsgs = strtol(optarg, NULL, 10); if (nmsgs < 1) { - fprintf(stderr, "ERROR: out of range\n"); + dprintf(STDERR_FILENO, "ERROR: out of range\n"); badarg = true; } break; case ':': - fprintf(stderr, "ERROR: Bad option argument\n"); + dprintf(STDERR_FILENO, "ERROR: Bad option argument\n"); badarg = true; break; case '?': default: - fprintf(stderr, "ERROR: Unrecognized option\n"); + dprintf(STDERR_FILENO, "ERROR: Unrecognized option\n"); badarg = true; break; } @@ -279,7 +279,7 @@ int main(int argc, FAR char *argv[]) if (optind != argc) { - fprintf(stderr, "ERROR: Garbage on command line\n"); + dprintf(STDERR_FILENO, "ERROR: Garbage on command line\n"); show_usage(argv[0]); return EXIT_FAILURE; } @@ -334,12 +334,6 @@ int main(int argc, FAR char *argv[]) for (msgno = 0; !nmsgs || msgno < nmsgs; msgno++) { - /* Flush any output before the loop entered or from the previous pass - * through the loop. - */ - - fflush(stdout); - #ifdef CONFIG_EXAMPLES_CAN_WRITE /* Construct the next TX message */ @@ -525,6 +519,5 @@ int main(int argc, FAR char *argv[]) close(fd); printf("Terminating!\n"); - fflush(stdout); return errval; } From 971a7374d6add8f8efadf601175222ab6ac71177 Mon Sep 17 00:00:00 2001 From: Tang Meng Date: Fri, 27 Jun 2025 17:46:47 +0800 Subject: [PATCH 335/391] examples/i2schar: fix spelling mistakes --- examples/i2schar/i2schar.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/i2schar/i2schar.h b/examples/i2schar/i2schar.h index b80b5e4832a..fb73a6c40e1 100644 --- a/examples/i2schar/i2schar.h +++ b/examples/i2schar/i2schar.h @@ -73,7 +73,7 @@ #endif #ifndef CONFIG_EXAMPLES_I2SCHAR_BUFSIZE -# efine CONFIG_EXAMPLES_I2SCHAR_BUFSIZE 256 +# define CONFIG_EXAMPLES_I2SCHAR_BUFSIZE 256 #endif /**************************************************************************** From ecd7b84871484c24db60a88bca5031f0bc520288 Mon Sep 17 00:00:00 2001 From: Eren Terzioglu Date: Mon, 30 Jun 2025 16:03:00 +0200 Subject: [PATCH 336/391] games/snake: Enchacements for snake game Add high score feature into snake game Signed-off-by: Eren Terzioglu --- games/snake/snake_main.c | 137 +++++++++++++++++++++++++++++++++++---- 1 file changed, 125 insertions(+), 12 deletions(-) diff --git a/games/snake/snake_main.c b/games/snake/snake_main.c index 8b65d80bdeb..464ef6d9fd9 100644 --- a/games/snake/snake_main.c +++ b/games/snake/snake_main.c @@ -67,12 +67,13 @@ #define SNAKE_HEAD 2 #define FOOD 3 #define BLINK 4 +#define HIGH_SCORE 5 /**************************************************************************** * Private Types ****************************************************************************/ -/* Game item struct to repesent in board */ +/* Game item struct to represent in board */ struct game_item { @@ -80,7 +81,7 @@ struct game_item int pos_y; }; -/* Snake item struct to repesent in board */ +/* Snake item struct to represent in board */ struct snake_item { @@ -112,15 +113,49 @@ uint32_t board[BOARDX_SIZE][BOARDY_SIZE] = 0 }; +/* Reached highest score */ + +uint32_t high_score = 0; + /* Colors used in the game plus Black */ -static const uint32_t pallete[] = +static const uint32_t palette[] = { RGB24_BLACK, RGB24_BLUE, RGB24_CYAN, RGB24_RED, RGB24_WHITE, + RGB24_GREENYELLOW, +}; + +/* Second block of score value to print (.e.g 1x) */ + +const uint64_t second_score_block[] = +{ + 0x0007050505070000, + 0x0004040404040000, + 0x0007010704070000, + 0x0007040704070000, + 0x0004040705050000, + 0x0007040701070000, + 0x0007050701070000 +}; + +/* First block of score value to print (.e.g x1) */ + +const uint64_t first_score_block[] = +{ + 0x0070505050700000, + 0x0040404040400000, + 0x0070107040700000, + 0x0070407040700000, + 0x0040407050500000, + 0x0070407010700000, + 0x0070507010700000, + 0x0040404040700000, + 0x0070507050700000, + 0x0070407050700000 }; /**************************************************************************** @@ -189,7 +224,7 @@ static void draw_board(int fd) { for (y = 0; y < BOARDY_SIZE; y++) { - rgb_val = pallete[board[x][y]]; + rgb_val = palette[board[x][y]]; tmp = dim_color(rgb_val, 0.15); *bp++ = ws2812_gamma_correct(tmp); } @@ -351,20 +386,81 @@ static void move_snake(int dir) } /**************************************************************************** - * Name: clear_board + * Name: fill_board_with_score * * Description: - * Clears the board + * Fills board with score value to print * * Parameters: - * None + * val - Value that includes with tiles should light up + * + * Returned Value: + * None. + * + ****************************************************************************/ + +static void fill_board_with_score(uint64_t val) +{ + int i = 0; + int j = 0; + for (i = 0; i < BOARDX_SIZE; i++) + { + for (j = 0; j < BOARDX_SIZE; j++) + { + if (val % 2 == 0) + { + board[i][j] = BLANK_PLACE; + } + else + { + board[i][j] = FOOD; + } + + val = val >> 1; + } + } +} + +/**************************************************************************** + * Name: print_score + * + * Description: + * Prints score to the screen + * + * Parameters: + * score - Score that reached in game + * fd - File descriptor for screen + * + * Returned Value: + * None. + * + ****************************************************************************/ + +static void print_score(int score, int fd) +{ + int second_idx = (int) score / 10; + int first_idx = score % 10; + uint64_t val = second_score_block[second_idx] | + first_score_block[first_idx]; + fill_board_with_score(val); + draw_board(fd); +} + +/**************************************************************************** + * Name: fill_board + * + * Description: + * Fill board with given value + * + * Parameters: + * val - Value to fill the board * * Returned Value: * None. * ****************************************************************************/ -static void clear_board(void) +static void fill_board(int val) { int i; int j; @@ -373,7 +469,7 @@ static void clear_board(void) { for (j = 0; j < BOARDY_SIZE; j++) { - board[i][j] = 0; + board[i][j] = val; } } } @@ -399,7 +495,7 @@ static void init_game(void) snake.tail[0].pos_y = BOARDY_SIZE / 2; food.pos_x = rand() % BOARDX_SIZE; food.pos_y = rand() % BOARDY_SIZE; - clear_board(); + fill_board(BLANK_PLACE); board[BOARDX_SIZE / 2][BOARDY_SIZE / 2] = SNAKE_HEAD; } @@ -607,10 +703,27 @@ int main(int argc, FAR char *argv[]) usleep(85000); } - printf("Game Over! Score: %d", (snake.tail_len * 10)); + printf("Game Over! Score: %d\n", snake.tail_len); + if (high_score < snake.tail_len) + { + printf("Congrats! New High Score\n"); + high_score = snake.tail_len; + for (i = 0; i < 3; i++) + { + fill_board(HIGH_SCORE); + draw_board(board_fd); + usleep(200000); + + fill_board(BLANK_PLACE); + draw_board(board_fd); + usleep(200000); + } + } + + print_score(snake.tail_len, board_fd); printf("Please press left key to exit or other keys to restart\n"); - usleep(1000000); + usleep(2000000); input_st.dir = DIR_NONE; ret = ERROR; From c3e628c45a8e4b4984c11d8e222bc4bc4d035d5e Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Wed, 2 Jul 2025 11:40:03 +0800 Subject: [PATCH 337/391] nshlib/md5: Support reading from standard input Sometimes users may want to calculate the MD5 of part of a file(e.g. check partition contents for debug after flashing, size of which may be greater than image). This can be done with the "dd" command and pipes, the "md5" command just needs to support reading from standard input. For example: `dd if=/dev/virtblk0 bs=512 count=1 | md5`. Signed-off-by: wangjianyu3 --- nshlib/nsh_codeccmd.c | 20 ++++++++++++++++++++ nshlib/nsh_command.c | 3 ++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/nshlib/nsh_codeccmd.c b/nshlib/nsh_codeccmd.c index 796bcffd9df..91b3953ffbd 100644 --- a/nshlib/nsh_codeccmd.c +++ b/nshlib/nsh_codeccmd.c @@ -509,6 +509,26 @@ int cmd_md5(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv) return ret; } } + else if (argc == 1) + { + MD5_CTX ctx; + + md5_init(&ctx); + + while (1) + { + ret = nsh_read(vtbl, digest, sizeof(digest)); + if (ret <= 0) + { + ret = ret < 0 ? -errno : 0; + break; + } + + md5_update(&ctx, digest, ret); + } + + md5_final(digest, &ctx); + } else { md5_sum((FAR unsigned char *)argv[1], strlen(argv[1]), digest); diff --git a/nshlib/nsh_command.c b/nshlib/nsh_command.c index dc8fab48128..7bbaf69be88 100644 --- a/nshlib/nsh_command.c +++ b/nshlib/nsh_command.c @@ -353,7 +353,8 @@ static const struct cmdmap_s g_cmdmap[] = #if defined(CONFIG_NETUTILS_CODECS) && defined(CONFIG_CODECS_HASH_MD5) # ifndef CONFIG_NSH_DISABLE_MD5 - CMD_MAP("md5", cmd_md5, 2, 3, "[-f] "), + CMD_MAP("md5", cmd_md5, 1, 3, + "[string] or [-f ] or read stdin"), # endif #endif From 8c9e126f91a99d5f14e0ffc07c864be9013aaa45 Mon Sep 17 00:00:00 2001 From: Tim Hardisty <56726697+TimJTi@users.noreply.github.com> Date: Tue, 1 Jul 2025 15:03:16 +0100 Subject: [PATCH 338/391] netutils/thttpd-fix-broken-CGI-and-fixup-Kconfig --- netutils/thttpd/Kconfig | 16 +++++++++++++--- netutils/thttpd/libhttpd.c | 4 ++-- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/netutils/thttpd/Kconfig b/netutils/thttpd/Kconfig index ad5920670be..8d6dec693fd 100644 --- a/netutils/thttpd/Kconfig +++ b/netutils/thttpd/Kconfig @@ -16,7 +16,10 @@ config THTTPD_NFILE_DESCRIPTORS int "the maximum number of file descriptors for thttpd webserver" default 16 ---help--- - The maximum number of file descriptors for thttpd webserver + The maximum number of file descriptors for thttpd webserver. This is + used during CGI application execution to close all file descriptors + after stdin, stdout and stderr up to and including this value (with + the exception of file descriptor for the open network socket). config THTTPD_PORT int "THTTPD port number" @@ -106,6 +109,13 @@ config THTTPD_CGI_TIMELIMIT How many seconds to allow CGI programs to run before killing them. Default: 0 (no time limit) +config THTTPD_CGIDUMP + bool "Output Interposed CGI strings to stderr" + default n + ---help--- + Enabling this will copy sent to and received from CGI tasks + to the stderr device. + config THTTPD_CHARSET string "Default character set" default "iso-8859-1" @@ -137,7 +147,7 @@ config THTTPD_MAXREALLOC ---help--- Maximum string reallocation size. Default: 4096 -config THTTPD_CGIINBUFFERSIZ +config THTTPD_CGIINBUFFERSIZE int "CGI interpose input buffer size" default 512 ---help--- @@ -236,7 +246,7 @@ choice the name of a subdirectory off of the user's actual home dir, something like "public_html". - 3) Niether. You can also leave both options undefined, and thttpd + 3) Neither. You can also leave both options undefined, and thttpd will not do anything special about tildes. Enabling both options is an error. diff --git a/netutils/thttpd/libhttpd.c b/netutils/thttpd/libhttpd.c index 9bb8d20d7ef..06212b4d0ee 100644 --- a/netutils/thttpd/libhttpd.c +++ b/netutils/thttpd/libhttpd.c @@ -2354,8 +2354,8 @@ int httpd_get_conn(httpd_server *hs, int listen_fd, httpd_conn *hc) ninfo("accept() new connection on listen_fd %d\n", listen_fd); sz = sizeof(sa); - hc->conn_fd = accept4(listen_fd, (struct sockaddr *)&sa, &sz, - SOCK_CLOEXEC); + hc->conn_fd = accept4(listen_fd, (struct sockaddr *)&sa, &sz, 0); + if (hc->conn_fd < 0) { if (errno == EWOULDBLOCK) From e6a335ded005a75829bd50baa328f89c247c5764 Mon Sep 17 00:00:00 2001 From: Tim Hardisty <56726697+TimJTi@users.noreply.github.com> Date: Tue, 1 Jul 2025 15:26:52 +0100 Subject: [PATCH 339/391] Fix Compiler warnings --- netutils/thttpd/libhttpd.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/netutils/thttpd/libhttpd.c b/netutils/thttpd/libhttpd.c index 06212b4d0ee..2d6a558e617 100644 --- a/netutils/thttpd/libhttpd.c +++ b/netutils/thttpd/libhttpd.c @@ -1589,9 +1589,7 @@ static void ls_child(int argc, char **argv) FAR httpd_conn *hc = (FAR httpd_conn *)strtoul(argv[1], NULL, 16); DIR *dirp; struct dirent *de; - int namlen; static int maxnames = 0; - int oldmax; int nnames; static char *names; static char **nameptrs; @@ -1615,6 +1613,18 @@ static void ls_child(int argc, char **argv) char *timestr; int i; + /* Compiler was warning that dirp was not initialised and it wasn't. + * But whether this is correct or not I am not sure. + */ + + dirp = opendir(hc->expnfilename); + if (dirp == NULL) + { + nerr("ERROR: opendir %s: %d\n", hc->expnfilename, errno); + httpd_send_err(hc, 404, err404title, "", err404form, hc->encodedurl); + return; + } + httpd_unlisten(hc->hs); send_mime(hc, 200, ok200title, "", "", "text/html; charset=%s", (off_t) - 1, hc->sb.st_mtime); @@ -1639,11 +1649,11 @@ static void ls_child(int argc, char **argv) fputs(html_html, fp); fputs(html_hdtitle, fp); - fprintf(fp, "Index of %s", hc->encodedurl, hc->encodedurl); + fprintf(fp, "Index of %s", hc->encodedurl); fputs(html_titlehd, fp); fputs(html_body, fp); fputs(html_hdr2, fp); - fprintf(fp, "Index of %s", hc->encodedurl, hc->encodedurl); + fprintf(fp, "Index of %s", hc->encodedurl); fputs(html_endhdr2, fp); fputs(html_crlf, fp); fputs("
\r\nmode  links  bytes  last-changed  name\r\n
", fp); @@ -1663,7 +1673,6 @@ static void ls_child(int argc, char **argv) } else { - oldmax = maxnames; maxnames *= 2; names = RENEW(names, char, oldmax * PATH_MAX, maxnames * PATH_MAX); @@ -1833,7 +1842,7 @@ static void ls_child(int argc, char **argv) /* And print. */ fprintf(fp, - "%s %3ld %10lld %s %s%s%s%s\n", + "%s %3d %10d %s %s%s%s%s\n", modestr, 0, (int16_t)sb.st_size, timestr, encrname, S_ISDIR(sb.st_mode) ? "/" : "", nameptrs[i], linkprefix, link, fileclass); @@ -1890,7 +1899,8 @@ static int ls(httpd_conn *hc) argv[0] = arg; child = task_create("CGI child", CONFIG_THTTPD_CGI_PRIORITY, - CONFIG_THTTPD_CGI_STACKSIZE, ls_child, argv); + CONFIG_THTTPD_CGI_STACKSIZE, (main_t)ls_child, + argv); if (child < 0) { nerr("ERROR: task_create: %d\n", errno); From 0037868ff0471c6836d2d0d3d1f1ef38fb1066c0 Mon Sep 17 00:00:00 2001 From: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com> Date: Wed, 9 Jul 2025 09:31:16 +0900 Subject: [PATCH 340/391] examples/nximage: Rename program name to nximage The original name is nxhello, which duplicates in examples/nxhello. Signed-off-by: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com> --- examples/nximage/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/nximage/Kconfig b/examples/nximage/Kconfig index 2bd34af41a4..1014da1566e 100644 --- a/examples/nximage/Kconfig +++ b/examples/nximage/Kconfig @@ -15,7 +15,7 @@ if EXAMPLES_NXIMAGE config EXAMPLES_NXIMAGE_PROGNAME string "NX Image Program name" - default "nxhello" + default "nximage" ---help--- This is the name of the program that will be used when the NSH ELF program is installed. From 0c680bcb8e011fcab1d6473da0f175348e75ceb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niccol=C3=B2=20Maggioni?= Date: Tue, 8 Jul 2025 00:40:50 +0200 Subject: [PATCH 341/391] system/coredump: Fix missing loglevel to logmask conversion. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The current setlogmask call used in the coredump app specifies a raw log level instead of a bitmask, and this causes wrong evaluations later on when that value is checked against a mask. Therefore the LOG_UPTO macro is added for conversion. Signed-off-by: Niccolò Maggioni --- system/coredump/coredump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/coredump/coredump.c b/system/coredump/coredump.c index 22a1f15d2ba..6a742f479a7 100644 --- a/system/coredump/coredump.c +++ b/system/coredump/coredump.c @@ -418,7 +418,7 @@ static int coredump_now(int pid, FAR char *filename) #endif printf("Start coredump:\n"); - logmask = setlogmask(LOG_ALERT); + logmask = setlogmask(LOG_UPTO(LOG_ALERT)); /* Initialize hex output stream */ From 8b121eb1382c0c66030d7b602c8523532e6ff492 Mon Sep 17 00:00:00 2001 From: Eren Terzioglu Date: Sat, 5 Jul 2025 17:48:01 +0200 Subject: [PATCH 342/391] games/match4: Add new match4 game Add match4 game support Signed-off-by: Eren Terzioglu --- games/match4/Kconfig | 84 +++ games/match4/Make.defs | 25 + games/match4/Makefile | 36 + games/match4/match4_input_console.h | 239 +++++++ games/match4/match4_input_gpio.h | 194 +++++ games/match4/match4_inputs.h | 60 ++ games/match4/match4_main.c | 1024 +++++++++++++++++++++++++++ 7 files changed, 1662 insertions(+) create mode 100644 games/match4/Kconfig create mode 100644 games/match4/Make.defs create mode 100644 games/match4/Makefile create mode 100644 games/match4/match4_input_console.h create mode 100644 games/match4/match4_input_gpio.h create mode 100644 games/match4/match4_inputs.h create mode 100644 games/match4/match4_main.c diff --git a/games/match4/Kconfig b/games/match4/Kconfig new file mode 100644 index 00000000000..cd916fd459e --- /dev/null +++ b/games/match4/Kconfig @@ -0,0 +1,84 @@ +# +# For a description of the syntax of this configuration file, +# see the file kconfig-language.txt in the NuttX tools repository. +# + +config GAMES_MATCH4 + bool "Match 4 Game" + default n + ---help--- + Enable Match 4 game. + +if GAMES_MATCH4 + +config GAMES_MATCH4_PROGNAME + string "Program name" + default "match" + ---help--- + This is the name of the program that will be used when the NSH ELF + program is installed. + +config GAMES_MATCH4_PRIORITY + int "Match 4 Game task priority" + default 100 + +config GAMES_MATCH4_STACKSIZE + int "Match 4 Game stack size" + default DEFAULT_TASK_STACKSIZE + +config MATCH4_GAME_DEBUG + bool "Print board status to the serial console for debugging" + default n + +config GAMES_MATCH4_LED_MATRIX_PATH + string "LED matrix path" + default "/dev/leds0" + ---help--- + Path of the led matrix + +config GAMES_MATCH4_LED_MATRIX_ROWS + int "LED Matrix row count" + default 8 + +config GAMES_MATCH4_LED_MATRIX_COLS + int "LED Matrix column count" + default 8 + +# +# Input Device Selection +# + +choice + prompt "Input Device (Serial Console, GPIO, etc)" + default GAMES_MATCH4_USE_CONSOLEKEY + +config GAMES_MATCH4_USE_CONSOLEKEY + bool "Serial Console as Input" + +config GAMES_MATCH4_USE_GPIO + bool "GPIO pins as Input" +endchoice + +if GAMES_MATCH4_USE_GPIO + +config GAMES_MATCH4_DOWN_KEY_PATH + string "Down key path" + default "/dev/gpio1" + ---help--- + Path of the down key to read + +config GAMES_MATCH4_LEFT_KEY_PATH + string "Left key path" + default "/dev/gpio2" + ---help--- + Path of the left key to read + +config GAMES_MATCH4_RIGHT_KEY_PATH + string "Right key path" + default "/dev/gpio3" + ---help--- + Path of the right key to read + +endif #GAMES_MATCH4_USE_GPIO + +endif diff --git a/games/match4/Make.defs b/games/match4/Make.defs new file mode 100644 index 00000000000..27b4f135233 --- /dev/null +++ b/games/match4/Make.defs @@ -0,0 +1,25 @@ +############################################################################ +# apps/games/match4/Make.defs +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +ifneq ($(CONFIG_GAMES_MATCH4),) +CONFIGURED_APPS += $(APPDIR)/games/match4 +endif diff --git a/games/match4/Makefile b/games/match4/Makefile new file mode 100644 index 00000000000..53bc6518636 --- /dev/null +++ b/games/match4/Makefile @@ -0,0 +1,36 @@ +############################################################################ +# apps/games/match4/Makefile +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +include $(APPDIR)/Make.defs + +# Match4 game info + +PROGNAME = $(CONFIG_GAMES_MATCH4_PROGNAME) +PRIORITY = $(CONFIG_GAMES_MATCH4_PRIORITY) +STACKSIZE = $(CONFIG_GAMES_MATCH4_STACKSIZE) +MODULE = $(CONFIG_GAMES_MATCH4) + +# Match4 game application + +MAINSRC = match4_main.c + +include $(APPDIR)/Application.mk diff --git a/games/match4/match4_input_console.h b/games/match4/match4_input_console.h new file mode 100644 index 00000000000..3e7f0522e13 --- /dev/null +++ b/games/match4/match4_input_console.h @@ -0,0 +1,239 @@ +/**************************************************************************** + * apps/games/match4/match4_input_console.h + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +#include + +#include "match4_inputs.h" + +/**************************************************************************** + * Preprocessor Definitions + ****************************************************************************/ + +/* Termios functions to have getch on Linux/NuttX */ + +static struct termios g_old; +static struct termios g_new; + +/**************************************************************************** + * Name: init_termios + * + * Description: + * Initialize g_new terminal I/O settings. + * + * Parameters: + * echo - Enable echo flag + * + * Returned Value: + * None. + * + ****************************************************************************/ + +void init_termios(int echo) +{ + tcgetattr(0, &g_old); /* grab old terminal i/o settings */ + g_new = g_old; /* use old settings as starting */ + g_new.c_lflag &= ~ICANON; /* disable buffered I/O */ + g_new.c_lflag &= ~ECHO; /* disable ECHO bit */ + g_new.c_lflag |= echo ? ECHO : 0; /* set echo mode if requested */ + tcsetattr(0, TCSANOW, &g_new); /* apply terminal I/O settings */ +} + +/**************************************************************************** + * Name: deinit_termios + * + * Description: + * Restore back g_old terminal I/O settings. + * + * Parameters: + * None + * + * Returned Value: + * None. + * + ****************************************************************************/ + +void deinit_termios(void) +{ + tcsetattr(0, TCSANOW, &g_old); /* restore old terminal i/o settings */ +} + +/**************************************************************************** + * Name: reset_termios + * + * Description: + * Restore g_old terminal i/o settings. + * + * Parameters: + * None + * + * Returned Value: + * None. + * + ****************************************************************************/ + +void reset_termios(void) +{ + tcsetattr(0, TCSANOW, &g_old); +} + +/**************************************************************************** + * Name: getch_ + * + * Description: + * Read 1 character. + * + * Parameters: + * echo - Enable echo mode flag + * + * Returned Value: + * Read character. + * + ****************************************************************************/ + +char getch_(int echo) +{ + char ch; + + init_termios(echo); + ch = getchar(); + reset_termios(); + + return ch; +} + +/**************************************************************************** + * Name: getch + * + * Description: + * Read 1 character without echo. + * + * Parameters: + * None + * + * Returned Value: + * Read character. + * + ****************************************************************************/ + +char getch(void) +{ + return getch_(0); +} + +/**************************************************************************** + * Name: dev_input_init + * + * Description: + * Initialize input method. + * + * Parameters: + * dev - Input state data + * + * Returned Value: + * Zero (OK) + * + ****************************************************************************/ + +int dev_input_init(FAR struct input_state_s *dev) +{ + init_termios(0); + + return OK; +} + +/**************************************************************************** + * Name: dev_input_deinit + * + * Description: + * Deinitialize input method. + * + * Parameters: + * None + * + * Returned Value: + * Zero (OK) + * + ****************************************************************************/ + +int dev_input_deinit(void) +{ + deinit_termios(); + + return OK; +} + +/**************************************************************************** + * Name: dev_read_input + * + * Description: + * Read inputs and returns result in input state data. + * + * Parameters: + * dev - Input state data + * + * Returned Value: + * Zero (OK) + * + ****************************************************************************/ + +int dev_read_input(FAR struct input_state_s *dev) +{ + char ch; + + /* Arrows keys return three bytes: 27 91 [65-68] */ + + if ((ch = getch()) == ASCII_ESC) + { + if ((ch = getch()) == ASCII_LBRACKET) + { + ch = getch(); + if (ch == ASCII_B) + { + dev->dir = DIR_DOWN; + } + else if (ch == ASCII_C) + { + dev->dir = DIR_RIGHT; + } + else if (ch == ASCII_D) + { + dev->dir = DIR_LEFT; + } + } + else + { + dev->dir = DIR_NONE; + } + } + else + { + dev->dir = DIR_NONE; + } + + return OK; +} diff --git a/games/match4/match4_input_gpio.h b/games/match4/match4_input_gpio.h new file mode 100644 index 00000000000..a25ab393033 --- /dev/null +++ b/games/match4/match4_input_gpio.h @@ -0,0 +1,194 @@ +/**************************************************************************** + * apps/games/match4/match4_input_gpio.h + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "match4_inputs.h" + +/**************************************************************************** + * Preprocessor Definitions + ****************************************************************************/ + +struct gpio_struct_fd_s +{ + int fd_down; /* File descriptor value to read down arrow key */ + int fd_left; /* File descriptor value to read left arrow key */ + int fd_right; /* File descriptor value to read right arrow key */ +}; + +struct gpio_struct_fd_s fd_list; + +/**************************************************************************** + * Name: dev_input_init + * + * Description: + * Initialize input method. + * + * Parameters: + * dev - Input state data + * + * Returned Value: + * Zero (OK) is returned on success. A negated errno value is returned on + * failure. + * + ****************************************************************************/ + +int dev_input_init(FAR struct input_state_s *dev) +{ + /* Open the down key gpio device */ + + fd_list.fd_down = open(CONFIG_GAMES_MATCH4_DOWN_KEY_PATH, O_RDONLY); + if (fd_list.fd_down < 0) + { + fprintf(stderr, "ERROR: Failed to open %s: %d\n", + CONFIG_GAMES_MATCH4_DOWN_KEY_PATH, errno); + return -ENODEV; + } + + /* Open the left key gpio device */ + + fd_list.fd_left = open(CONFIG_GAMES_MATCH4_LEFT_KEY_PATH, O_RDONLY); + if (fd_list.fd_down < 0) + { + fprintf(stderr, "ERROR: Failed to open %s: %d\n", + CONFIG_GAMES_MATCH4_LEFT_KEY_PATH, errno); + return -ENODEV; + } + + /* Open the right key gpio device */ + + fd_list.fd_right = open(CONFIG_GAMES_MATCH4_RIGHT_KEY_PATH, O_RDONLY); + if (fd_list.fd_down < 0) + { + fprintf(stderr, "ERROR: Failed to open %s: %d\n", + CONFIG_GAMES_MATCH4_RIGHT_KEY_PATH, errno); + return -ENODEV; + } + + dev->fd_gpio = (int)&fd_list; + + return OK; +} + +/**************************************************************************** + * Name: dev_input_deinit + * + * Description: + * Deinitialize input method. + * + * Parameters: + * None + * + * Returned Value: + * Zero (OK) + * + ****************************************************************************/ + +int dev_input_deinit(void) +{ + return OK; +} + +/**************************************************************************** + * Name: dev_read_input + * + * Description: + * Read inputs and returns result in input state data. + * + * Parameters: + * dev - Input state data + * + * Returned Value: + * Zero (OK) + * + ****************************************************************************/ + +int dev_read_input(FAR struct input_state_s *dev) +{ + struct gpio_struct_fd_s *fd = (struct gpio_struct_fd_s *)dev->fd_gpio; + int invalue = 0; + int ret; + + ret = ioctl(fd->fd_down, GPIOC_READ, (unsigned long)((uintptr_t)&invalue)); + if (ret < 0) + { + int errcode = errno; + fprintf(stderr, "ERROR: Failed to read value from %s: %d\n", + CONFIG_GAMES_MATCH4_DOWN_KEY_PATH, errcode); + } + else + { + if (invalue != 0) + { + dev->dir = DIR_DOWN; + } + } + + ret = ioctl(fd->fd_left, GPIOC_READ, (unsigned long)((uintptr_t)&invalue)); + if (ret < 0) + { + int errcode = errno; + fprintf(stderr, "ERROR: Failed to read value from %s: %d\n", + CONFIG_GAMES_MATCH4_LEFT_KEY_PATH, errcode); + } + else + { + if (invalue != 0) + { + dev->dir = DIR_LEFT; + } + } + + ret = ioctl(fd->fd_right, GPIOC_READ, + (unsigned long)((uintptr_t)&invalue)); + if (ret < 0) + { + int errcode = errno; + fprintf(stderr, "ERROR: Failed to read value from %s: %d\n", + CONFIG_GAMES_MATCH4_RIGHT_KEY_PATH, errcode); + } + else + { + if (invalue != 0) + { + dev->dir = DIR_RIGHT; + } + } + + return OK; +} diff --git a/games/match4/match4_inputs.h b/games/match4/match4_inputs.h new file mode 100644 index 00000000000..e48c1847f48 --- /dev/null +++ b/games/match4/match4_inputs.h @@ -0,0 +1,60 @@ +/**************************************************************************** + * apps/games/match4/match4_inputs.h + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +/**************************************************************************** + * Preprocessor Definitions + ****************************************************************************/ + +#ifndef DIR_NONE +# define DIR_NONE 0 +#endif + +#ifndef DIR_LEFT +# define DIR_LEFT 1 +#endif + +#ifndef DIR_RIGHT +# define DIR_RIGHT 2 +#endif + +#ifndef DIR_DOWN +# define DIR_DOWN 4 +#endif + +struct input_state_s +{ +#ifdef CONFIG_GAMES_MATCH4_USE_CONSOLEKEY + int fd_con; +#endif +#ifdef CONFIG_GAMES_MATCH4_USE_GPIO + int fd_gpio; +#endif + + int dir; /* Direction to move the blocks */ +}; + diff --git a/games/match4/match4_main.c b/games/match4/match4_main.c new file mode 100644 index 00000000000..d60e1dbc621 --- /dev/null +++ b/games/match4/match4_main.c @@ -0,0 +1,1024 @@ +/**************************************************************************** + * apps/games/match4/match4_main.c + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#ifdef CONFIG_GAMES_MATCH4_USE_CONSOLEKEY +#include "match4_input_console.h" +#endif + +#ifdef CONFIG_GAMES_MATCH4_USE_GPIO +#include "match4_input_gpio.h" +#endif + +/**************************************************************************** + * Preprocessor Definitions + ****************************************************************************/ + +#ifdef CONFIG_MATCH4_GAME_DEBUG +# define DEBUG_MATCH4_GAME 1 +#endif + +#define BOARDX_SIZE CONFIG_GAMES_MATCH4_LED_MATRIX_ROWS +#define BOARDY_SIZE CONFIG_GAMES_MATCH4_LED_MATRIX_COLS + +#define N_LEDS BOARDX_SIZE * BOARDY_SIZE + +#define P1_COLOUR RGB24_YELLOW +#define P1_SELECT_COLOUR RGB24_GOLD +#define P2_COLOUR RGB24_BLUE +#define P2_SELECT_COLOUR RGB24_CYAN +#define BLUE_COLOR RGB24_BLUE +#define RED_COLOR RGB24_RED +#define WHITE_COLOR RGB24_WHITE + +/* ID numbers of game items */ + +#define BLANK_PLACE 0 +#define P1_PREVIEW 1 +#define P1_SELECT 2 +#define P2_PREVIEW 3 +#define P2_SELECT 4 +#define BLUE_INDEX 5 +#define RED_INDEX 6 +#define WHITE_INDEX 7 +#define PALETTE_MAX 8 + +/**************************************************************************** + * Private Types + ****************************************************************************/ + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +static const char g_board_path[] = + CONFIG_GAMES_MATCH4_LED_MATRIX_PATH; + +/* Game board to show */ + +uint32_t board[BOARDX_SIZE][BOARDY_SIZE] = +{ + 0 +}; + +/* Player colours */ + +uint32_t players[2] = +{ + P1_SELECT, + P2_SELECT, +}; + +/* Player move preview colour */ + +uint32_t players_select[2] = +{ + P1_PREVIEW, + P2_PREVIEW, +}; + +/* Colors used in the game */ + +static const uint32_t palette[] = +{ + RGB24_BLACK, + P1_COLOUR, + P1_SELECT_COLOUR, + P2_COLOUR, + P2_SELECT_COLOUR, + BLUE_COLOR, + RED_COLOR, + WHITE_COLOR, +}; + +/* Game entrance screen that shows one player mode */ + +uint32_t one_player_scr[BOARDX_SIZE][BOARDY_SIZE] = +{ + { + BLUE_INDEX, WHITE_INDEX, WHITE_INDEX, WHITE_INDEX, + BLUE_INDEX, WHITE_INDEX, WHITE_INDEX, WHITE_INDEX + }, + { + WHITE_INDEX, BLUE_INDEX, WHITE_INDEX, BLUE_INDEX, + WHITE_INDEX, WHITE_INDEX, WHITE_INDEX, WHITE_INDEX + }, + { + WHITE_INDEX, WHITE_INDEX, BLUE_INDEX, WHITE_INDEX, + WHITE_INDEX, WHITE_INDEX, WHITE_INDEX, WHITE_INDEX + }, + { + WHITE_INDEX, WHITE_INDEX, RED_INDEX, WHITE_INDEX, + RED_INDEX, RED_INDEX, RED_INDEX, WHITE_INDEX + }, + { + WHITE_INDEX, RED_INDEX, RED_INDEX, WHITE_INDEX, + WHITE_INDEX, WHITE_INDEX, RED_INDEX, WHITE_INDEX + }, + { + WHITE_INDEX, WHITE_INDEX, RED_INDEX, WHITE_INDEX, + RED_INDEX, RED_INDEX, RED_INDEX, WHITE_INDEX + }, + { + WHITE_INDEX, WHITE_INDEX, RED_INDEX, WHITE_INDEX, + RED_INDEX, WHITE_INDEX, WHITE_INDEX, WHITE_INDEX + }, + { + WHITE_INDEX, WHITE_INDEX, RED_INDEX, WHITE_INDEX, + RED_INDEX, RED_INDEX, RED_INDEX, WHITE_INDEX + } +}; + +/* Game entrance screen that shows two players mode */ + +uint32_t two_player_scr[BOARDX_SIZE][BOARDY_SIZE] = +{ + { + WHITE_INDEX, WHITE_INDEX, WHITE_INDEX, BLUE_INDEX, + WHITE_INDEX, WHITE_INDEX, WHITE_INDEX, BLUE_INDEX + }, + { + WHITE_INDEX, WHITE_INDEX, WHITE_INDEX, WHITE_INDEX, + BLUE_INDEX, WHITE_INDEX, BLUE_INDEX, WHITE_INDEX + }, + { + WHITE_INDEX, WHITE_INDEX, WHITE_INDEX, WHITE_INDEX, + WHITE_INDEX, BLUE_INDEX, WHITE_INDEX, WHITE_INDEX + }, + { + WHITE_INDEX, WHITE_INDEX, RED_INDEX, WHITE_INDEX, + RED_INDEX, RED_INDEX, RED_INDEX, WHITE_INDEX + }, + { + WHITE_INDEX, RED_INDEX, RED_INDEX, WHITE_INDEX, + WHITE_INDEX, WHITE_INDEX, RED_INDEX, WHITE_INDEX + }, + { + WHITE_INDEX, WHITE_INDEX, RED_INDEX, WHITE_INDEX, + RED_INDEX, RED_INDEX, RED_INDEX, WHITE_INDEX + }, + { + WHITE_INDEX, WHITE_INDEX, RED_INDEX, WHITE_INDEX, + RED_INDEX, WHITE_INDEX, WHITE_INDEX, WHITE_INDEX + }, + { + WHITE_INDEX, WHITE_INDEX, RED_INDEX, WHITE_INDEX, + RED_INDEX, RED_INDEX, RED_INDEX, WHITE_INDEX + } +}; + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +#ifdef DEBUG_MATCH4_GAME +/**************************************************************************** + * Name: print_board + * + * Description: + * Draw the board for debugging. + * + * Parameters: + * None + * + * Returned Value: + * None. + * + ****************************************************************************/ + +static void print_board(void) +{ + const char board_icons[] = + { + ' ', 'x', 'X', 'o', 'O', '-', '#', ' ', ' ' + }; + + int row; + int col; + int tmp; + + /* Clear screen */ + + printf("\e[1;1H\e[2J"); + + /* Print board */ + + for (int i = 0; i < BOARDY_SIZE; i++) + { + printf(" %d", i); + } + + printf("\n"); + + for (row = 0; row < BOARDY_SIZE; row++) + { + for (col = 0; col < BOARDX_SIZE; col++) + { + printf("|%c", board_icons[board[row][col]]); + } + + printf("|\n"); + } + + for (tmp = 0; tmp < BOARDX_SIZE * 2 + 1; tmp++) + { + printf("-"); + } + + printf("\n"); +} +#endif /* DEBUG_MATCH4_GAME */ + +/**************************************************************************** + * Name: dim_color + * + * Description: + * Dim led color to handle brightness. + * + * Parameters: + * val - RGB24 value of the led + * dim - Percentage of brightness + * + * Returned Value: + * Dimmed RGB24 value. + * + ****************************************************************************/ + +static uint32_t dim_color(uint32_t val, float dim) +{ + uint16_t r = RGB24RED(val); + uint16_t g = RGB24GREEN(val); + uint16_t b = RGB24BLUE(val); + + float sat = dim; + + r *= sat; + g *= sat; + b *= sat; + + return RGBTO24(r, g, b); +} + +/**************************************************************************** + * Name: draw_board + * + * Description: + * Draw the user board. + * + * Parameters: + * fd - File descriptor for screen + * + * Returned Value: + * None. + * + ****************************************************************************/ + +static void draw_board(int fd) +{ + uint32_t buffer[N_LEDS] = + { + 0 + }; + + int result; + uint32_t *bp = buffer; + int x; + int y; + int rgb_val; + int tmp; + +#ifdef DEBUG_MATCH4_GAME + print_board(); +#endif + + for (x = 0; x < BOARDX_SIZE; x++) + { + for (y = 0; y < BOARDY_SIZE; y++) + { + rgb_val = palette[board[x][y]]; + tmp = dim_color(rgb_val, 0.15); + *bp++ = ws2812_gamma_correct(tmp); + } + } + + lseek(fd, 0, SEEK_SET); + + usleep(200); + result = write(fd, buffer, 4 * N_LEDS); + if (result != 4 * N_LEDS) + { + fprintf(stderr, + "ws2812_main: write failed: %d %d\n", + result, + errno); + } +} + +/**************************************************************************** + * Name: fill_board + * + * Description: + * Fill board with given value + * + * Parameters: + * val - Value to fill the board + * + * Returned Value: + * None. + * + ****************************************************************************/ + +static void fill_board(int val) +{ + int i; + int j; + + for (i = 0; i < BOARDX_SIZE; i++) + { + for (j = 0; j < BOARDY_SIZE; j++) + { + board[i][j] = val; + } + } +} + +/**************************************************************************** + * Name: put_mark + * + * Description: + * Drop a piece on the selected column + * + * Parameters: + * col - Column number + * piece - Piece to drop + * + * Returned Value: + * OK on success, ERROR if not. + * + ****************************************************************************/ + +int put_mark(int col, uint32_t piece) +{ + int i = 0; + if (col < 0 || col >= BOARDY_SIZE) + { + return OK; + } + + for (i = BOARDX_SIZE - 1; i >= 0; i--) + { + if (board[i][col] == BLANK_PLACE) + { + board[i][col] = piece; + return OK; + } + } + + return ERROR; +} + +/**************************************************************************** + * Name: check_winner + * + * Description: + * Check for 4 in a row in any direction + * + * Parameters: + * piece - Mark number depends on turn + * blink - Flag to blink + * + * Returned Value: + * OK on success, ERROR if not. + * + ****************************************************************************/ + +int check_winner(uint32_t piece, bool blink, int fd) +{ + int i = 0; + int j = 0; + int k = 0; + + /* Horizontal 4 piece check */ + + for (i = 0; i < BOARDX_SIZE; i++) + { + for (j = 0; j <= BOARDY_SIZE - 4; j++) + { + if (board[i][j] == piece && + board[i][j + 1] == piece && + board[i][j + 2] == piece && + board[i][j + 3] == piece) + { + if (blink) + { + for (k = 0; k < 3; k++) + { + board[i][j] = WHITE_INDEX; + board[i][j + 1] = WHITE_INDEX; + board[i][j + 2] = WHITE_INDEX; + board[i][j + 3] = WHITE_INDEX; + draw_board(fd); + usleep(300000); + + board[i][j] = piece; + board[i][j + 1] = piece; + board[i][j + 2] = piece; + board[i][j + 3] = piece; + draw_board(fd); + usleep(300000); + } + } + + return OK; + } + } + } + + /* Vertical 4 piece check */ + + for (i = 0; i <= BOARDX_SIZE - 4; i++) + { + for (j = 0; j < BOARDY_SIZE; j++) + { + if (board[i][j] == piece && + board[i + 1][j] == piece && + board[i + 2][j] == piece && + board[i + 3][j] == piece) + { + if (blink) + { + for (k = 0; k < 3; k++) + { + board[i][j] = WHITE_INDEX; + board[i + 1][j] = WHITE_INDEX; + board[i + 2][j] = WHITE_INDEX; + board[i + 3][j] = WHITE_INDEX; + draw_board(fd); + usleep(300000); + + board[i][j] = piece; + board[i + 1][j] = piece; + board[i + 2][j] = piece; + board[i + 3][j] = piece; + draw_board(fd); + usleep(300000); + } + } + + return OK; + } + } + } + + /* Diagonal down-right 4 piece check */ + + for (i = 0; i <= BOARDX_SIZE - 4; i++) + { + for (j = 0; j <= BOARDY_SIZE - 4; j++) + { + if (board[i][j] == piece && + board[i + 1][j + 1] == piece && + board[i + 2][j + 2] == piece && + board[i + 3][j + 3] == piece) + { + if (blink) + { + for (k = 0; k < 3; k++) + { + board[i][j] = WHITE_INDEX; + board[i + 1][j + 1] = WHITE_INDEX; + board[i + 2][j + 2] = WHITE_INDEX; + board[i + 3][j + 3] = WHITE_INDEX; + draw_board(fd); + usleep(300000); + + board[i][j] = piece; + board[i + 1][j + 1] = piece; + board[i + 2][j + 2] = piece; + board[i + 3][j + 3] = piece; + draw_board(fd); + usleep(300000); + } + } + + return OK; + } + } + } + + /* Diagonal up-right 4 piece check */ + + for (i = 3; i < BOARDX_SIZE; i++) + { + for (j = 0; j <= BOARDY_SIZE - 4; j++) + { + if (board[i][j] == piece && + board[i - 1][j + 1] == piece && + board[i - 2][j + 2] == piece && + board[i - 3][j + 3] == piece) + { + if (blink) + { + for (k = 0; k < 3; k++) + { + board[i][j] = WHITE_INDEX; + board[i - 1][j + 1] = WHITE_INDEX; + board[i - 2][j + 2] = WHITE_INDEX; + board[i - 3][j + 3] = WHITE_INDEX; + draw_board(fd); + usleep(300000); + + board[i][j] = piece; + board[i - 1][j + 1] = piece; + board[i - 2][j + 2] = piece; + board[i - 3][j + 3] = piece; + draw_board(fd); + usleep(300000); + } + } + + return OK; + } + } + } + + return ERROR; +} + +/**************************************************************************** + * Name: is_board_empty + * + * Description: + * Check if the board is full to decide there is a draw + * + * Parameters: + * None. + * + * Returned Value: + * OK if there is a BLANK_PLACE space, ERROR if not. + * + ****************************************************************************/ + +static int is_board_empty(void) +{ + for (int j = 0; j < BOARDY_SIZE; j++) + { + if (board[0][j] == BLANK_PLACE) + { + return OK; + } + } + + return ERROR; +} + +/**************************************************************************** + * Name: ai_move + * + * Description: + * Finds first empty column to fill + * + * Parameters: + * piece - AI (CPU) piece value + * opponent_piece - Opponent piece value + * + * Returned Value: + * Column number if there is valid move, ERROR if not. + * + ****************************************************************************/ + +int ai_move(uint32_t piece, uint32_t opponent_piece) +{ + int row = 0; + int col = 0; + int valid_boardy_size[BOARDY_SIZE]; + int count = 0; + + /* Trying to find winner move */ + + for (col = 0; col < BOARDY_SIZE; col++) + { + for (row = BOARDX_SIZE - 1; row >= 0; row--) + { + if (board[row][col] == BLANK_PLACE) + { + board[row][col] = piece; + if (check_winner(piece, false, 0) == OK) + { + board[row][col] = 0; + return col; + } + + board[row][col] = 0; + break; + } + } + } + + /* Trying to block opponent let to win */ + + for (col = 0; col < BOARDY_SIZE; col++) + { + for (row = BOARDX_SIZE - 1; row >= 0; row--) + { + if (board[row][col] == BLANK_PLACE) + { + board[row][col] = opponent_piece; + if (check_winner(opponent_piece, false, 0) == OK) + { + board[row][col] = 0; + return col; + } + + board[row][col] = 0; + break; + } + } + } + + /* Choose random column */ + + for (col = 0; col < BOARDY_SIZE; col++) + { + if (board[0][col] == BLANK_PLACE) + { + valid_boardy_size[count++] = col; + } + } + + if (count > 0) + { + return valid_boardy_size[rand() % count]; + } + + /* Return ERROR if no valid move */ + + return ERROR; +} + +/**************************************************************************** + * Name: find_empty_col + * + * Description: + * Finds first empty column to fill + * + * Parameters: + * col - Column number to start + * dir - Direction from that column + * + * Returned Value: + * First empty column to fill. + * + ****************************************************************************/ + +static int find_empty_col(int col, int dir) +{ + int i = 0; + while (i < BOARDY_SIZE) + { + if ((col == 7) && (dir == 1)) + { + col = 0; + } + else if ((col == BLANK_PLACE) && (dir == -1)) + { + col = 7; + } + else + { + col = col + dir; + } + + if (board[0][col] == BLANK_PLACE) + { + break; + } + + i++; + } + + return col; +} + +/**************************************************************************** + * Name: init_game + * + * Description: + * Initializes game to start properly + * + * Parameters: + * None + * + * Returned Value: + * None. + * + ****************************************************************************/ + +static void init_game(void) +{ + fill_board(BLANK_PLACE); +} + +/**************************************************************************** + * Name: get_col_input + * + * Description: + * Gets column number to put mark into board. + * + * Parameters: + * input_st - Input struct pointer to get input + * turn - Turn number + * col - Column number pointer to return + * fd - File descriptor to print + * + * Returned Value: + * None. + * + ****************************************************************************/ + +static void get_col_input(struct input_state_s *input_st, + int turn, int *col, int fd) +{ + int ret = ERROR; + uint8_t column = find_empty_col(-1, 1); + bool refresh_board = true; + + printf("Player %d, choose column (0-%d): \n", turn + 1, BOARDX_SIZE - 1); + while (input_st->dir != DIR_DOWN) + { + if (refresh_board) + { + refresh_board = false; + put_mark(column, players_select[turn]); + draw_board(fd); + int j = 0; + while (board[j][column] != players_select[turn]) + { + j++; + } + + board[j][column] = 0; + } + + while (ret == ERROR || input_st->dir == DIR_NONE) + { + ret = dev_read_input(input_st); + } + + if (input_st->dir == DIR_RIGHT) + { + column = find_empty_col(column, 1); + refresh_board = true; + input_st->dir = DIR_NONE; + printf("right button pressed: %d\n", column); + usleep(7000); + } + else if (input_st->dir == DIR_LEFT) + { + column = find_empty_col(column, -1); + refresh_board = true; + input_st->dir = DIR_NONE; + printf("left button pressed: %d\n", column); + usleep(7000); + } + + usleep(15000); + } + + usleep(15000); + input_st->dir = DIR_NONE; + *col = column; +} + +/**************************************************************************** + * Name: draw_led_matrix + * + * Description: + * Fills board premade picture + * + * Parameters: + * img - Image to show + * fd - File descriptor to print + * + * Returned Value: + * None. + * + ****************************************************************************/ + +static void draw_led_matrix(uint32_t img[][BOARDY_SIZE], int fd) +{ + int i = 0; + int j = 0; + for (i = 0; i < BOARDX_SIZE; i++) + { + for (j = 0; j < BOARDX_SIZE; j++) + { + board[i][j] = img[i][j]; + } + } + + draw_board(fd); +} + +/**************************************************************************** + * Name: game_entrance + * + * Description: + * Screen that handles entrance screen to select game mode (1-2 player) + * + * Parameters: + * input_st - Input struct pointer to get input + * fd - File descriptor to print + * + * Returned Value: + * True if one player mode, false if two player mode. + * + ****************************************************************************/ + +static bool game_entrance(struct input_state_s *input_st, int fd) +{ + int ret = ERROR; + bool game_mode_one = true; + + draw_led_matrix(one_player_scr, fd); + while (input_st->dir != DIR_DOWN) + { + while (ret == ERROR || input_st->dir == DIR_NONE) + { + ret = dev_read_input(input_st); + } + + if (input_st->dir == DIR_LEFT || input_st->dir == DIR_RIGHT) + { + game_mode_one = !game_mode_one; + if (game_mode_one) + { + draw_led_matrix(one_player_scr, fd); + } + else + { + draw_led_matrix(two_player_scr, fd); + } + + input_st->dir = DIR_NONE; + } + + usleep(15000); + } + + usleep(15000); + input_st->dir = DIR_NONE; + return game_mode_one; +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * match4_main + ****************************************************************************/ + +int main(int argc, FAR char *argv[]) +{ + int col = 0; + int turn = 0; + bool one_player_mode = true; + int ret = ERROR; + int board_fd = -1; + bool game_over = false; + struct input_state_s input_st; + char player_symbol[2] = + { + 'X', 'O' + }; + + srand(time(NULL)); + + /* Open the output device driver */ + + board_fd = open(g_board_path, O_RDWR); + if (board_fd < 0) + { + int errcode = errno; + fprintf(stderr, "ERROR: Failed to open %s: %d\n", + g_board_path, errcode); + return EXIT_FAILURE; + } + + dev_input_init(&input_st); + +restart: + ret = 0; + turn = 0; + col = 0; + one_player_mode = true; + input_st.dir = DIR_NONE; + game_over = false; + + one_player_mode = game_entrance(&input_st, board_fd); + init_game(); + while (!game_over) + { + draw_board(board_fd); + if ((one_player_mode && turn == 0) || !one_player_mode) + { + get_col_input(&input_st, turn, &col, board_fd); + } + else + { + col = ai_move(players[turn], players[(turn + 1) % 2]); + printf("AI chooses column %d\n", col); + } + + ret = put_mark(col, players[turn]); + if (ret != 0) + { + printf("Column full or invalid. Try again.\n"); + continue; + } + + if (check_winner(players[turn], true, board_fd) == OK) + { + if ((one_player_mode && turn == 0) || !one_player_mode) + { + printf("\nPlayer %d (%c) wins!\n", + turn + 1, player_symbol[turn]); + } + else + { + printf("\nAI (%c) wins!\n", player_symbol[turn]); + } + + fill_board(players[turn]); + draw_board(board_fd); + usleep(85000); + break; + } + + if (is_board_empty() != OK) + { + printf("It's a draw!\n"); + break; + } + + turn = (turn + 1) % 2; + usleep(85000); + } + + printf("Please press left key to exit or other keys to restart\n"); + usleep(2000000); + + input_st.dir = DIR_NONE; + ret = ERROR; + while (ret == ERROR && input_st.dir == DIR_NONE) + { + ret = dev_read_input(&input_st); + } + + if (input_st.dir != DIR_LEFT) + { + goto restart; + } + + input_st.dir = DIR_NONE; + dev_input_deinit(); + return 0; +} From 29c88356e9854ff2b2ed3f419105ee3762186168 Mon Sep 17 00:00:00 2001 From: simbit18 Date: Sat, 12 Jul 2025 15:44:21 +0200 Subject: [PATCH 343/391] [CI] build.yml: fix ERROR: Dangerous symbolic link path was ignored add Command Line Switch -snld -snld -> allow extracting of denagerous symbolic links. https://sourceforge.net/p/sevenzip/discussion/45798/thread/187ce54fb0/ Signed-off-by: simbit18 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5061c11c6c5..5070a1d6cac 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -368,7 +368,7 @@ jobs: - name: Extract sources run: | 7z x sources.tar.gz -y - 7z x sources.tar -y + 7z x sources.tar -y -snld - name: Run Builds run: | From 227d3ec35bb30bacbab5140b7e2ceef33c0944bc Mon Sep 17 00:00:00 2001 From: Petro Karashchenko Date: Mon, 14 Jul 2025 08:45:24 +0200 Subject: [PATCH 344/391] netutils/nanopb: fix unpack step for MACOS Currently NANOPB_UNPACK step in Makefile uses nanopb binary name with hardcoded suffix '-linux-x86' that is not suitable for MACOS x86. This commit replaces the hardcoded nanopb binary name with name that is derived from NANOPB_NAME variable that reflects the nanopb binary that is selected based on host OS selected in the build system Signed-off-by: Petro Karashchenko --- netutils/nanopb/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netutils/nanopb/Makefile b/netutils/nanopb/Makefile index c3624e7ad27..3c7dd6d2294 100644 --- a/netutils/nanopb/Makefile +++ b/netutils/nanopb/Makefile @@ -41,7 +41,7 @@ $(NANOPB_TARBALL): $(NANOPB_UNPACK): $(NANOPB_TARBALL) $(Q) tar zxf $(NANOPB_TARBALL) - $(Q) mv nanopb-$(NANOPB_VERSION)-linux-x86 $(NANOPB_UNPACK) + $(Q) mv $(NANOPB_NAME) $(NANOPB_UNPACK) $(Q) mv $(NANOPB_TARBALL) $(NANOPB_UNPACK) ifeq ($(wildcard $(NANOPB_UNPACK)),) From dfeeef41ed9bfed8951d1d42d9b84b833a4d129d Mon Sep 17 00:00:00 2001 From: nuttxs Date: Mon, 14 Jul 2025 13:50:02 +0800 Subject: [PATCH 345/391] netutils/dhcpc/dhcpc.c:Implement a dedicated interface to send DHCPRELEASE, According to RFC 2131 section 3.1, DHCPRELEASE is used by a client to relinquish a network address and cancel any remaining lease time Signed-off-by: nuttxs --- include/netutils/dhcpc.h | 1 + netutils/dhcpc/Kconfig | 38 ++++++++++++++ netutils/dhcpc/dhcpc.c | 111 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 150 insertions(+) diff --git a/include/netutils/dhcpc.h b/include/netutils/dhcpc.h index 541c0196163..4a5c451bd2c 100644 --- a/include/netutils/dhcpc.h +++ b/include/netutils/dhcpc.h @@ -78,6 +78,7 @@ FAR void *dhcpc_open(FAR const char *interface, FAR const void *mac_addr, int mac_len); int dhcpc_request(FAR void *handle, FAR struct dhcpc_state *presult); int dhcpc_request_async(FAR void *handle, dhcpc_callback_t callback); +int dhcpc_release(FAR void *handle, FAR struct dhcpc_state *presult); void dhcpc_cancel(FAR void *handle); void dhcpc_close(FAR void *handle); diff --git a/netutils/dhcpc/Kconfig b/netutils/dhcpc/Kconfig index 1016479a598..009ecaa9b9b 100644 --- a/netutils/dhcpc/Kconfig +++ b/netutils/dhcpc/Kconfig @@ -43,4 +43,42 @@ config NETUTILS_DHCPC_BOOTP_FLAGS being fully configured, e.g. with forward enabled. Then we need to enable the broadcast flag under these situations. +config NETUTILS_DHCPC_RELEASE_RETRIES + int "DHCP Release send retries" + default 3 + ---help--- + Number of times to retry sending DHCPRELEASE message if sendto() fails. + Default is 3 attempts. + +config NETUTILS_DHCPC_RELEASE_TRANSMISSION_DELAY_MS + int "DHCP Release transmission delay (milliseconds)" + default 10 + ---help--- + Delay in milliseconds used for: + 1. Between DHCPRELEASE retry attempts when sendto() fails + 2. To ensure packet transmission before socket closure (if IP clearing enabled) + Since UDP is connectionless, this delay gives the network stack + time to actually send the packet. Set to 0 to disable delays + (not recommended). Default is 10ms. + +config NETUTILS_DHCPC_RELEASE_ENSURE_TRANSMISSION + bool "Ensure DHCP Release message transmission" + default y + ---help--- + Add a delay after successfully sending DHCPRELEASE message to ensure + the packet is actually transmitted before the function returns. + Since DHCP RELEASE has no ACK response from server, this delay helps + ensure the release message reaches the server before closing the socket. + Uses the same delay value as CONFIG_NETUTILS_DHCPC_RELEASE_TRANSMISSION_DELAY_MS. + +config NETUTILS_DHCPC_RELEASE_CLEAR_IP + bool "Clear IP address after DHCP release" + default n + ---help--- + Clear all network configuration from the interface after sending + DHCPRELEASE message. This includes IP address, subnet mask, default + gateway. RFC 2131 doesn't mandate immediate clearing, so this is + disabled by default to maintain connectivity. + Enable this for scenarios where complete network reset is required. + endif diff --git a/netutils/dhcpc/dhcpc.c b/netutils/dhcpc/dhcpc.c index 38de90b2ea4..724894bb9c9 100644 --- a/netutils/dhcpc/dhcpc.c +++ b/netutils/dhcpc/dhcpc.c @@ -303,6 +303,16 @@ static int dhcpc_sendmsg(FAR struct dhcpc_state_s *pdhcpc, serverid = presult->serverid.s_addr; break; + /* Send RELEASE message to the server to relinquish the lease */ + + case DHCPRELEASE: + + memcpy(pdhcpc->packet.ciaddr, &presult->ipaddr.s_addr, 4); + pend = dhcpc_addserverid(&presult->serverid, pend); + pend = dhcpc_addclientid(pdhcpc->macaddr, pdhcpc->maclen, pend); + serverid = presult->serverid.s_addr; + break; + default: errno = EINVAL; return ERROR; @@ -950,3 +960,104 @@ int dhcpc_request_async(FAR void *handle, dhcpc_callback_t callback) return OK; } + +/**************************************************************************** + * Name: dhcpc_release + ****************************************************************************/ + +int dhcpc_release(FAR void *handle, FAR struct dhcpc_state *presult) +{ + FAR struct dhcpc_state_s *pdhcpc = (FAR struct dhcpc_state_s *)handle; + int ret; + int retries = 0; +#ifdef CONFIG_NETUTILS_DHCPC_RELEASE_CLEAR_IP + struct in_addr zero_addr; +#endif + + if (!handle || !presult) + { + errno = EINVAL; + return ERROR; + } + + /* Check that we have valid IP address and server ID to release */ + + if (presult->ipaddr.s_addr == 0 || presult->serverid.s_addr == 0) + { + errno = EINVAL; + return ERROR; + } + + /* Increment transaction ID for the release message */ + + pdhcpc->xid[3]++; + + /* Send DHCPRELEASE message to the server with retry mechanism. + * According to RFC 2131, no response is expected from the server. + */ + + for (; ; ) + { + ret = dhcpc_sendmsg(pdhcpc, presult, DHCPRELEASE); + if (ret > 0) + { + ninfo("DHCPRELEASE message sent successfully (%d bytes)\n", ret); + break; + } + else + { + retries++; + nerr("Failed send DHCPRELEASE (attempt %d/%d), ret=%d, errno=%d\n", + retries, CONFIG_NETUTILS_DHCPC_RELEASE_RETRIES, ret, errno); + + if (retries >= CONFIG_NETUTILS_DHCPC_RELEASE_RETRIES) + { + nerr("ERROR: Failed to send DHCPRELEASE after %d attempts\n", + CONFIG_NETUTILS_DHCPC_RELEASE_RETRIES); + return ERROR; + } + + usleep(1000 * CONFIG_NETUTILS_DHCPC_RELEASE_TRANSMISSION_DELAY_MS); + } + } + +#ifdef CONFIG_NETUTILS_DHCPC_RELEASE_ENSURE_TRANSMISSION + /* Ensure the DHCPRELEASE packet has time to be transmitted. + * Since DHCP RELEASE has no ACK response and UDP is connectionless, + * we use a delay to give the network stack time to actually send + * the packet before the function returns. + */ + + usleep(1000 * CONFIG_NETUTILS_DHCPC_RELEASE_TRANSMISSION_DELAY_MS); +#endif + +#ifdef CONFIG_NETUTILS_DHCPC_RELEASE_CLEAR_IP + /* Clear all network configuration that was obtained via DHCP */ + + zero_addr.s_addr = INADDR_ANY; + + ret = netlib_set_ipv4addr(pdhcpc->interface, &zero_addr); + if (ret < 0) + { + nwarn("Warning: Failed clear IP address from interface (errno=%d)\n", + errno); + } + + ret = netlib_set_ipv4netmask(pdhcpc->interface, &zero_addr); + if (ret < 0) + { + nwarn("Warning: Failed clear netmask from interface (errno=%d)\n", + errno); + } + + ret = netlib_set_dripv4addr(pdhcpc->interface, &zero_addr); + if (ret < 0) + { + nwarn("Warning: Failed clear gateway from interface (errno=%d)\n", + errno); + } +#endif + + ninfo("DHCP released successfully\n"); + return OK; +} From a7e4a2a30e37e755f0a317a0d44913c3108f47a2 Mon Sep 17 00:00:00 2001 From: Alan Carvalho de Assis Date: Sat, 12 Jul 2025 16:20:41 -0300 Subject: [PATCH 346/391] examples/keyboard: Fix compilation warning Replace %d with %PRIu32 to avoid warning convered in error on CI. Signed-off-by: Alan C. Assis --- examples/keyboard/kbd_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/keyboard/kbd_main.c b/examples/keyboard/kbd_main.c index 58a6e9f3efe..ff832c86248 100644 --- a/examples/keyboard/kbd_main.c +++ b/examples/keyboard/kbd_main.c @@ -141,8 +141,8 @@ int main(int argc, FAR char *argv[]) else { printf("Sample :\n"); - printf(" code : %d\n", sample.code); - printf(" type : %d\n", sample.type); + printf(" code : %" PRIu32 "\n", sample.code); + printf(" type : %" PRIu32 "\n", sample.type); } if (nsamples && --nsamples <= 0) From d27d6e635fca59c4a89c94e830b2e06d62bd6b77 Mon Sep 17 00:00:00 2001 From: Filipe Cavalcanti Date: Mon, 14 Jul 2025 21:46:08 -0300 Subject: [PATCH 347/391] examples/mcuboot: add example to update from binary in local storage This example makes it possible to use a binary from local storage for MCUBoot update. It copies the binary file to the secondary slot instead of downloading from a remote URL. Can be used to update from a SD Card, for example. Signed-off-by: Filipe Cavalcanti --- .../mcuboot/update_agent_local/CMakeLists.txt | 33 ++ examples/mcuboot/update_agent_local/Kconfig | 41 +++ examples/mcuboot/update_agent_local/Make.defs | 25 ++ examples/mcuboot/update_agent_local/Makefile | 32 ++ .../mcuboot_local_agent_main.c | 298 ++++++++++++++++++ 5 files changed, 429 insertions(+) create mode 100644 examples/mcuboot/update_agent_local/CMakeLists.txt create mode 100644 examples/mcuboot/update_agent_local/Kconfig create mode 100644 examples/mcuboot/update_agent_local/Make.defs create mode 100644 examples/mcuboot/update_agent_local/Makefile create mode 100644 examples/mcuboot/update_agent_local/mcuboot_local_agent_main.c diff --git a/examples/mcuboot/update_agent_local/CMakeLists.txt b/examples/mcuboot/update_agent_local/CMakeLists.txt new file mode 100644 index 00000000000..4b73b64fcbf --- /dev/null +++ b/examples/mcuboot/update_agent_local/CMakeLists.txt @@ -0,0 +1,33 @@ +# ############################################################################## +# apps/examples/mcuboot/update_agent_local/CMakeLists.txt +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_EXAMPLES_MCUBOOT_LOCAL_AGENT) + nuttx_add_application( + NAME + ${CONFIG_EXAMPLES_MCUBOOT_LOCAL_AGENT_PROGNAME} + SRCS + mcuboot_local_agent_main.c + STACKSIZE + ${CONFIG_EXAMPLES_MCUBOOT_LOCAL_AGENT_STACKSIZE} + PRIORITY + ${CONFIG_EXAMPLES_MCUBOOT_LOCAL_AGENT_PRIORITY}) +endif() diff --git a/examples/mcuboot/update_agent_local/Kconfig b/examples/mcuboot/update_agent_local/Kconfig new file mode 100644 index 00000000000..4079c83fbd8 --- /dev/null +++ b/examples/mcuboot/update_agent_local/Kconfig @@ -0,0 +1,41 @@ +# +# For a description of the syntax of this configuration file, +# see the file kconfig-language.txt in the NuttX tools repository. +# + +config EXAMPLES_MCUBOOT_LOCAL_AGENT + tristate "MCUBoot Local Update Agent" + default n + depends on BOOT_MCUBOOT + select BOARDCTL + select BOARDCTL_RESET + ---help--- + Enable the MCUBoot Local Update Agent example. + This application reads a firmware binary from local storage + and copies it to the MCUBoot secondary flash slot for update. + +if EXAMPLES_MCUBOOT_LOCAL_AGENT + +config EXAMPLES_MCUBOOT_LOCAL_AGENT_PROGNAME + string "Program name" + default "mcuboot_local_agent" + ---help--- + This is the name of the program that will be used when the NSH ELF + program is installed. + +config EXAMPLES_MCUBOOT_LOCAL_AGENT_PRIORITY + int "MCUBoot Local Agent task priority" + default 100 + +config EXAMPLES_MCUBOOT_LOCAL_AGENT_STACKSIZE + int "MCUBoot Local Agent stack size" + default DEFAULT_TASK_STACKSIZE + +config EXAMPLES_MCUBOOT_LOCAL_AGENT_DEFAULT_PATH + string "Default firmware file path" + default "/mnt/sdcard/firmware.bin" + ---help--- + Default path to the firmware binary file on local storage. + This can be overridden by passing a path as a command line argument. + +endif # EXAMPLES_MCUBOOT_LOCAL_AGENT diff --git a/examples/mcuboot/update_agent_local/Make.defs b/examples/mcuboot/update_agent_local/Make.defs new file mode 100644 index 00000000000..e7f7ff602df --- /dev/null +++ b/examples/mcuboot/update_agent_local/Make.defs @@ -0,0 +1,25 @@ +############################################################################ +# apps/examples/mcuboot/update_agent_local/Make.defs +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +ifneq ($(CONFIG_EXAMPLES_MCUBOOT_LOCAL_AGENT),) +CONFIGURED_APPS += $(APPDIR)/examples/mcuboot/update_agent_local +endif diff --git a/examples/mcuboot/update_agent_local/Makefile b/examples/mcuboot/update_agent_local/Makefile new file mode 100644 index 00000000000..a730a662b50 --- /dev/null +++ b/examples/mcuboot/update_agent_local/Makefile @@ -0,0 +1,32 @@ +############################################################################ +# apps/examples/mcuboot/update_agent_local/Makefile +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +include $(APPDIR)/Make.defs + +MAINSRC = mcuboot_local_agent_main.c + +PROGNAME = $(CONFIG_EXAMPLES_MCUBOOT_LOCAL_AGENT_PROGNAME) +PRIORITY = $(CONFIG_EXAMPLES_MCUBOOT_LOCAL_AGENT_PRIORITY) +STACKSIZE = $(CONFIG_EXAMPLES_MCUBOOT_LOCAL_AGENT_STACKSIZE) +MODULE = $(CONFIG_EXAMPLES_MCUBOOT_LOCAL_AGENT) + +include $(APPDIR)/Application.mk diff --git a/examples/mcuboot/update_agent_local/mcuboot_local_agent_main.c b/examples/mcuboot/update_agent_local/mcuboot_local_agent_main.c new file mode 100644 index 00000000000..dd0c183faee --- /dev/null +++ b/examples/mcuboot/update_agent_local/mcuboot_local_agent_main.c @@ -0,0 +1,298 @@ +/**************************************************************************** + * apps/examples/mcuboot/update_agent_local/mcuboot_local_agent_main.c + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "flash_map_backend/flash_map_backend.h" +#include "sysflash/sysflash.h" + +/**************************************************************************** + * Preprocessor Definitions + ****************************************************************************/ + +#define BUFFER_SIZE 4096 +#define DEFAULT_FW_PATH "/mnt/sdcard/firmware.bin" + +/**************************************************************************** + * Private Types + ****************************************************************************/ + +struct update_context_s +{ + FAR const struct flash_area *fa; + uint32_t fa_offset; + ssize_t image_size; + int fd; +}; + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +static uint8_t g_buffer[BUFFER_SIZE]; + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: get_file_size + * + * Description: + * Retrieves the size of an open file descriptor. + * + * Input Parameters: + * fd - File descriptor of the open file. + * + * Returned Value: + * On success, returns the file size in bytes. + * On failure, returns -1. + * + ****************************************************************************/ + +static ssize_t get_file_size(int fd) +{ + struct stat st; + + if (fstat(fd, &st) < 0) + { + return -1; + } + + return st.st_size; +} + +/**************************************************************************** + * Name: copy_firmware_from_local + * + * Description: + * Copies a firmware binary from local storage to the secondary flash slot. + * + * Input Parameters: + * filepath - Path to the firmware binary file. + * + * Returned Value: + * On success, returns OK. + * On failure, returns an error code. + * + ****************************************************************************/ + +static int copy_firmware_from_local(FAR const char *filepath) +{ + int ret = OK; + struct update_context_s ctx; + ssize_t bytes_read; + uint32_t total_copied = 0; + uint32_t progress; + + /* Initialize context */ + + memset(&ctx, 0, sizeof(ctx)); + ctx.fa = NULL; + ctx.fa_offset = 0; + ctx.image_size = -1; + ctx.fd = -1; + + /* Open firmware file from local storage */ + + ctx.fd = open(filepath, O_RDONLY); + if (ctx.fd < 0) + { + fprintf(stderr, "Failed to open firmware file: %s\n", filepath); + ret = -errno; + goto exit; + } + + /* Get file size */ + + ctx.image_size = get_file_size(ctx.fd); + if (ctx.image_size < 0) + { + fprintf(stderr, "Failed to get file size\n"); + ret = -errno; + goto exit_close_file; + } + + printf("Firmware file size: %zd bytes\n", ctx.image_size); + + /* Open secondary flash area for MCUBoot */ + + ret = flash_area_open(FLASH_AREA_IMAGE_SECONDARY(0), &ctx.fa); + if (ret != OK) + { + fprintf(stderr, "Failed to open secondary flash area: %d\n", ret); + goto exit_close_file; + } + + /* Check if file fits in secondary slot */ + + if (ctx.image_size > ctx.fa->fa_size) + { + fprintf(stderr, "Firmware file too large for secondary slot\n"); + fprintf(stderr, "File size: %zd, Slot size: %lu\n", + ctx.image_size, ctx.fa->fa_size); + ret = -EFBIG; + goto exit_close_flash; + } + + /* Erase secondary slot */ + + printf("Erasing secondary flash slot...\n"); + ret = flash_area_erase(ctx.fa, 0, ctx.fa->fa_size); + if (ret != OK) + { + fprintf(stderr, "Failed to erase secondary flash area: %d\n", ret); + goto exit_close_flash; + } + + /* Copy firmware from local storage to flash */ + + printf("Copying firmware to secondary slot...\n"); + + while (total_copied < ctx.image_size) + { + /* Read from local file */ + + bytes_read = read(ctx.fd, g_buffer, BUFFER_SIZE); + if (bytes_read < 0) + { + fprintf(stderr, "Failed to read from firmware file: %d\n", errno); + ret = -errno; + goto exit_close_flash; + } + + if (bytes_read == 0) + { + break; /* EOF reached */ + } + + /* Adjust bytes to write if near end of file */ + + if (total_copied + bytes_read > ctx.image_size) + { + bytes_read = ctx.image_size - total_copied; + } + + /* Write to flash */ + + ret = flash_area_write(ctx.fa, ctx.fa_offset, g_buffer, bytes_read); + if (ret != OK) + { + fprintf(stderr, "Failed to write to flash: %d\n", ret); + goto exit_close_flash; + } + + ctx.fa_offset += bytes_read; + total_copied += bytes_read; + + /* Show progress */ + + progress = (total_copied * 100) / ctx.image_size; + printf("Progress: %lu/%zd bytes [%lu%%]\n", + total_copied, ctx.image_size, progress); + } + + printf("Firmware copy completed successfully!\n"); + +exit_close_flash: + flash_area_close(ctx.fa); + +exit_close_file: + if (ctx.fd >= 0) + { + close(ctx.fd); + } + +exit: + return ret; +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * mcuboot_local_agent_main + ****************************************************************************/ + +int main(int argc, FAR char *argv[]) +{ + int ret; + FAR const char *filepath; + + printf("MCUBoot Local Update Agent\n"); + + if (argc > 1) + { + filepath = argv[1]; + } + else + { + filepath = DEFAULT_FW_PATH; + } + + printf("Firmware file: %s\n", filepath); + + /* Copy firmware from local storage to secondary flash slot */ + + ret = copy_firmware_from_local(filepath); + if (ret != OK) + { + fprintf(stderr, "Firmware update failed: %d\n", ret); + return ERROR; + } + + printf("Firmware successfully copied to secondary slot!\n"); + + /* Mark image as pending for next boot */ + + boot_set_pending_multi(0, 0); + + printf("Update scheduled for next boot. Restarting...\n"); + + fflush(stdout); + fflush(stderr); + + usleep(1000000); /* Wait 1 second */ + + /* Restart system to apply update */ + + boardctl(BOARDIOC_RESET, 0); + + return OK; +} From 9ea3fc69950ee11ab7c266e4477f4e63d979b4dc Mon Sep 17 00:00:00 2001 From: Eren Terzioglu Date: Mon, 7 Jul 2025 16:06:50 +0200 Subject: [PATCH 348/391] games/snake: Fix terminal issue after returning back from snake game Fix terminal issue after returning back from game Signed-off-by: Eren Terzioglu --- games/snake/snake_input_console.h | 21 +++++++++++++++++++++ games/snake/snake_input_gpio.h | 19 +++++++++++++++++++ games/snake/snake_main.c | 1 + 3 files changed, 41 insertions(+) diff --git a/games/snake/snake_input_console.h b/games/snake/snake_input_console.h index 468989d2a3c..9f6f2bbea53 100644 --- a/games/snake/snake_input_console.h +++ b/games/snake/snake_input_console.h @@ -147,6 +147,27 @@ int dev_input_init(FAR struct input_state_s *dev) return OK; } +/**************************************************************************** + * Name: dev_input_deinit + * + * Description: + * Deinitialize input method. + * + * Parameters: + * None + * + * Returned Value: + * Zero (OK) + * + ****************************************************************************/ + +int dev_input_deinit(void) +{ + reset_termios(); + + return OK; +} + /**************************************************************************** * Name: dev_read_input * diff --git a/games/snake/snake_input_gpio.h b/games/snake/snake_input_gpio.h index cb2e7329cda..2a487d331c8 100644 --- a/games/snake/snake_input_gpio.h +++ b/games/snake/snake_input_gpio.h @@ -116,6 +116,25 @@ int dev_input_init(FAR struct input_state_s *dev) return OK; } +/**************************************************************************** + * Name: dev_input_deinit + * + * Description: + * Deinitialize input method. + * + * Parameters: + * None + * + * Returned Value: + * Zero (OK) + * + ****************************************************************************/ + +int dev_input_deinit(void) +{ + return OK; +} + /**************************************************************************** * Name: dev_read_input * diff --git a/games/snake/snake_main.c b/games/snake/snake_main.c index 464ef6d9fd9..a49357c7cf2 100644 --- a/games/snake/snake_main.c +++ b/games/snake/snake_main.c @@ -737,5 +737,6 @@ int main(int argc, FAR char *argv[]) goto restart; } + dev_input_deinit(); return 0; } From f3e1985b1e3d421d65eac66ac1d54f077c5dac97 Mon Sep 17 00:00:00 2001 From: Eren Terzioglu Date: Fri, 11 Jul 2025 14:45:02 +0200 Subject: [PATCH 349/391] games/snake: Change consolekey magic numbers with ASCII macros Change consolekey magic numbers with ascii values to make it more understandable Signed-off-by: Eren Terzioglu --- games/snake/snake_input_console.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/games/snake/snake_input_console.h b/games/snake/snake_input_console.h index 9f6f2bbea53..03254f5d5cc 100644 --- a/games/snake/snake_input_console.h +++ b/games/snake/snake_input_console.h @@ -25,6 +25,7 @@ ****************************************************************************/ #include +#include #include #include "snake_inputs.h" @@ -188,24 +189,24 @@ int dev_read_input(FAR struct input_state_s *dev) /* Arrows keys return three bytes: 27 91 [65-68] */ - if ((ch = getch()) == 27) + if ((ch = getch()) == ASCII_ESC) { - if ((ch = getch()) == 91) + if ((ch = getch()) == ASCII_LBRACKET) { ch = getch(); - if (ch == 65) + if (ch == ASCII_A) { dev->dir = DIR_UP; } - else if (ch == 66) + else if (ch == ASCII_B) { dev->dir = DIR_DOWN; } - else if (ch == 67) + else if (ch == ASCII_C) { dev->dir = DIR_RIGHT; } - else if (ch == 68) + else if (ch == ASCII_D) { dev->dir = DIR_LEFT; } From 6bca3c2ca2fcce78315ee5909510339fbe0e7cfd Mon Sep 17 00:00:00 2001 From: "Kevin Witteveen (MartiniMarter)" Date: Fri, 11 Jul 2025 19:33:42 +0200 Subject: [PATCH 350/391] Add JPEG compressor support to Makefile Before this PR only the decompressor files were added to the Makefile. Now all the required compressor files are added. Decompression and compression tested on STM32H7 with 1:8 JPEG scaling. Signed-off-by: Kevin Witteveen (MartiniMarter) --- graphics/libjpeg/Makefile | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/graphics/libjpeg/Makefile b/graphics/libjpeg/Makefile index 4512c34a5e0..5e94447b01c 100644 --- a/graphics/libjpeg/Makefile +++ b/graphics/libjpeg/Makefile @@ -24,6 +24,8 @@ include $(APPDIR)/Make.defs SRC = libjpeg +# Decompressor + CSRCS += $(SRC)/jaricom.c CSRCS += $(SRC)/jcomapi.c CSRCS += $(SRC)/jdapimin.c @@ -52,6 +54,29 @@ CSRCS += $(SRC)/jutils.c CSRCS += $(SRC)/jmemmgr.c CSRCS += $(SRC)/jmemname.c +# Compressor + +CSRCS += $(SRC)/jcapimin.c +CSRCS += $(SRC)/jcapistd.c +CSRCS += $(SRC)/jcarith.c +CSRCS += $(SRC)/jccoefct.c +CSRCS += $(SRC)/jccolor.c +CSRCS += $(SRC)/jcdctmgr.c +CSRCS += $(SRC)/jchuff.c +CSRCS += $(SRC)/jcinit.c +CSRCS += $(SRC)/jcmainct.c +CSRCS += $(SRC)/jcmarker.c +CSRCS += $(SRC)/jcmaster.c +CSRCS += $(SRC)/jcparam.c +CSRCS += $(SRC)/jcprepct.c +CSRCS += $(SRC)/jcsample.c +CSRCS += $(SRC)/jctrans.c + +CSRCS += $(SRC)/jdatadst.c +CSRCS += $(SRC)/jfdctint.c +CSRCS += $(SRC)/jfdctfst.c +CSRCS += $(SRC)/jfdctflt.c + CFLAGS += -DTEMP_DIRECTORY=\"$(CONFIG_EXTERNALS_LIBJPEG_TEMP_DIR)\" CFLAGS += -Wno-shadow -Wno-strict-prototypes -Wno-unknown-pragmas From f34ae4587a27c18bcb1cafbb03be8e4b84581f2a Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Fri, 18 Jul 2025 15:05:23 +0800 Subject: [PATCH 351/391] system/gdbstub: Add depends of LIB_GDBSTUB in function `gdbstub_main': undefined reference to `gdb_state_init' undefined reference to `gdb_process' undefined reference to `gdb_state_uninit' Signed-off-by: wangjianyu3 --- system/gdbstub/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/system/gdbstub/Kconfig b/system/gdbstub/Kconfig index 31c833b3b13..94d92f6ccb5 100644 --- a/system/gdbstub/Kconfig +++ b/system/gdbstub/Kconfig @@ -5,6 +5,7 @@ config SYSTEM_GDBSTUB tristate "GDBSTUB" + depends on LIB_GDBSTUB ---help--- Enable support for gdbstub. From 3f823f9f2506740d83113c8c53da19093c48175a Mon Sep 17 00:00:00 2001 From: wangmingrong1 Date: Fri, 18 Jul 2025 11:37:42 +0800 Subject: [PATCH 352/391] kasantest: -fno-builtin is enabled by default The strlen function called by kasantest will be optimized by the compiler, and the strlen function implemented in NX will not be called. Adding -fno-builtin can solve the problem. Signed-off-by: wangmingrong1 --- testing/mm/kasantest/CMakeLists.txt | 1 + testing/mm/kasantest/Makefile | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/testing/mm/kasantest/CMakeLists.txt b/testing/mm/kasantest/CMakeLists.txt index ee58fa8ac4d..d578196c6fa 100644 --- a/testing/mm/kasantest/CMakeLists.txt +++ b/testing/mm/kasantest/CMakeLists.txt @@ -22,6 +22,7 @@ if(CONFIG_TESTING_KASAN) set(CFLAGS + -fno-builtin -Wno-error -Wno-use-after-free -Wno-array-bounds diff --git a/testing/mm/kasantest/Makefile b/testing/mm/kasantest/Makefile index 82edc831504..b12d007477a 100644 --- a/testing/mm/kasantest/Makefile +++ b/testing/mm/kasantest/Makefile @@ -32,6 +32,6 @@ STACKSIZE = $(CONFIG_TESTING_KASAN_STACKSIZE) CFLAGS += -Wno-error -Wno-use-after-free -Wno-stringop-overflow CFLAGS += -Wno-array-bounds -Wno-free-nonheap-object CFLAGS += -Wno-unused-value -Wno-unused-variable -CFLAGS += "-O0" +CFLAGS += -fno-builtin "-O0" include $(APPDIR)/Application.mk From c83e17c083737eb8b1cdc2c7d4679504f43c6137 Mon Sep 17 00:00:00 2001 From: Tiago Medicci Date: Mon, 21 Jul 2025 12:07:56 -0300 Subject: [PATCH 353/391] interpreters/python: Fix symbol collision with list_length function NuttX implements a function with the same name which may end up being included whenever `CONFIG_MM_KERNEL_HEAP` is set. To avoid it, insert a prefix to it on Python's implementation. Please note that the other patches had their metadata updated too. --- interpreters/python/Makefile | 1 + ...around-newlib-resource.h-limitations.patch | 6 +-- ...32_t-unsigned-int-type-mismatch-issu.patch | 6 +-- ...s.py-for-generating-an-archive-of-py.patch | 6 +-- ...04-recognize-nuttx-as-a-supported-OS.patch | 6 +-- ...ilds-Without-HAVE_DYNAMIC_LOADING-Se.patch | 6 +-- ...to-avoid-conflict-with-nuttx-unused_.patch | 6 +-- .../patch/0007-undef-atexit_register.patch | 6 +-- .../patch/0008-declare-struct-timeval.patch | 6 +-- ...s-select-header-to-define-FD_SETSIZE.patch | 6 +-- ...d_ino-member-of-the-structure-dirent.patch | 6 +-- ...on-warning-if-UNUSED-is-already-defi.patch | 6 +-- ...ntime-structure-into-PSRAM-bss-regio.patch | 6 +-- ...functions-used-by-NuttX-to-lowercase.patch | 6 +-- ...-list_length-to-avoid-symbol-collisi.patch | 44 +++++++++++++++++++ 15 files changed, 84 insertions(+), 39 deletions(-) create mode 100644 interpreters/python/patch/0014-insert-prefix-to-list_length-to-avoid-symbol-collisi.patch diff --git a/interpreters/python/Makefile b/interpreters/python/Makefile index 295a4bb61dd..bf20c9ae41d 100644 --- a/interpreters/python/Makefile +++ b/interpreters/python/Makefile @@ -83,6 +83,7 @@ $(CPYTHON_UNPACKNAME): $(CPYTHON_ZIP) $(Q) patch -p1 -d $(CPYTHON_UNPACKNAME) < patch$(DELIM)0011-avoid-redefinition-warning-if-UNUSED-is-already-defi.patch $(Q) patch -p1 -d $(CPYTHON_UNPACKNAME) < patch$(DELIM)0012-hack-place-_PyRuntime-structure-into-PSRAM-bss-regio.patch $(Q) patch -p1 -d $(CPYTHON_UNPACKNAME) < patch$(DELIM)0013-transform-functions-used-by-NuttX-to-lowercase.patch + $(Q) patch -p1 -d $(CPYTHON_UNPACKNAME) < patch$(DELIM)0014-insert-prefix-to-list_length-to-avoid-symbol-collisi.patch $(HOSTPYTHON): mkdir -p $(HOSTBUILD) diff --git a/interpreters/python/patch/0001-workaround-newlib-resource.h-limitations.patch b/interpreters/python/patch/0001-workaround-newlib-resource.h-limitations.patch index d2ef33c3cdd..3c7866c2838 100644 --- a/interpreters/python/patch/0001-workaround-newlib-resource.h-limitations.patch +++ b/interpreters/python/patch/0001-workaround-newlib-resource.h-limitations.patch @@ -1,7 +1,7 @@ -From 3917fd37644948096c6bebf53e701b59fa527cf5 Mon Sep 17 00:00:00 2001 +From b96f875c54e2d888413a701eb9727d704b995ce0 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Tue, 22 Oct 2024 23:58:17 +0200 -Subject: [PATCH 01/11] workaround newlib resource.h limitations +Subject: [PATCH 01/14] workaround newlib resource.h limitations configure script checks if resource.h is available but doesn't check if it defines all the necessary functions. @@ -27,5 +27,5 @@ index b62362f2777..327d883f94e 100644 /* Disable creation of core dump */ -- -2.46.1 +2.50.0 diff --git a/interpreters/python/patch/0002-fix-various-uint32_t-unsigned-int-type-mismatch-issu.patch b/interpreters/python/patch/0002-fix-various-uint32_t-unsigned-int-type-mismatch-issu.patch index 4dcef4e78c0..8257580dec8 100644 --- a/interpreters/python/patch/0002-fix-various-uint32_t-unsigned-int-type-mismatch-issu.patch +++ b/interpreters/python/patch/0002-fix-various-uint32_t-unsigned-int-type-mismatch-issu.patch @@ -1,7 +1,7 @@ -From 562138b0486ad050b5ce601d434910973ff6f094 Mon Sep 17 00:00:00 2001 +From 2c684af739d366dce8392ee2bb9af8248283e323 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Wed, 23 Oct 2024 16:48:49 +0200 -Subject: [PATCH 02/11] fix various uint32_t/'unsigned int' type mismatch +Subject: [PATCH 02/14] fix various uint32_t/'unsigned int' type mismatch issues In a few places existing code assumes that uint32_t == unsigned int. @@ -149,5 +149,5 @@ index c911c302003..9c640e0ab65 100644 assert(_PyASCIIObject_CAST(name)->hash != -1); OBJECT_STAT_INC_COND(type_cache_collisions, entry->name != Py_None && entry->name != name); -- -2.46.1 +2.50.0 diff --git a/interpreters/python/patch/0003-reuse-wasm_assets.py-for-generating-an-archive-of-py.patch b/interpreters/python/patch/0003-reuse-wasm_assets.py-for-generating-an-archive-of-py.patch index 83b46c6d5be..6e5820410e8 100644 --- a/interpreters/python/patch/0003-reuse-wasm_assets.py-for-generating-an-archive-of-py.patch +++ b/interpreters/python/patch/0003-reuse-wasm_assets.py-for-generating-an-archive-of-py.patch @@ -1,7 +1,7 @@ -From dcc6b2b6aa396f96e7c9efe3e793d96c7004ef4f Mon Sep 17 00:00:00 2001 +From 41728277acd7eba4e500d0b4ddd02198b92cf6ac Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Wed, 23 Oct 2024 16:54:39 +0200 -Subject: [PATCH 03/11] reuse wasm_assets.py for generating an archive of +Subject: [PATCH 03/14] reuse wasm_assets.py for generating an archive of python lib dir wasm_assets.py is a useful script to prepare the smallest possible @@ -39,5 +39,5 @@ index ffa5e303412..381d4819c39 100755 args.wasm_stdlib = args.wasm_root / WASM_STDLIB args.wasm_dynload = args.wasm_root / WASM_DYNLOAD -- -2.46.1 +2.50.0 diff --git a/interpreters/python/patch/0004-recognize-nuttx-as-a-supported-OS.patch b/interpreters/python/patch/0004-recognize-nuttx-as-a-supported-OS.patch index d187e248ca5..aae248a19b7 100644 --- a/interpreters/python/patch/0004-recognize-nuttx-as-a-supported-OS.patch +++ b/interpreters/python/patch/0004-recognize-nuttx-as-a-supported-OS.patch @@ -1,7 +1,7 @@ -From ff067ccb26c91de352de362a25d87bcbabe924dc Mon Sep 17 00:00:00 2001 +From 9965644a9cee6c85a726d21ff2ed6f1e42445941 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Wed, 23 Oct 2024 16:55:53 +0200 -Subject: [PATCH 04/11] recognize *-*-nuttx as a supported OS +Subject: [PATCH 04/14] recognize *-*-nuttx as a supported OS cpython's configure script bails out when cross-compiling for an unknown OS, so we have to add "nuttx" to the list, even though it @@ -57,5 +57,5 @@ index 24e28a1e2de..80d6738fab5 100644 # for now, limit cross builds to known configurations MACHDEP="unknown" -- -2.46.1 +2.50.0 diff --git a/interpreters/python/patch/0005-gh-122907-Fix-Builds-Without-HAVE_DYNAMIC_LOADING-Se.patch b/interpreters/python/patch/0005-gh-122907-Fix-Builds-Without-HAVE_DYNAMIC_LOADING-Se.patch index 52bbd6b68c8..3d7616b196f 100644 --- a/interpreters/python/patch/0005-gh-122907-Fix-Builds-Without-HAVE_DYNAMIC_LOADING-Se.patch +++ b/interpreters/python/patch/0005-gh-122907-Fix-Builds-Without-HAVE_DYNAMIC_LOADING-Se.patch @@ -1,7 +1,7 @@ -From 7e646549488f2d3de4cf1e04ad975625342a9218 Mon Sep 17 00:00:00 2001 +From d5c061676d7ee6f1fb963bdf79791e37b5b05a36 Mon Sep 17 00:00:00 2001 From: Eric Snow Date: Tue, 13 Aug 2024 14:44:57 -0600 -Subject: [PATCH 05/11] gh-122907: Fix Builds Without HAVE_DYNAMIC_LOADING Set +Subject: [PATCH 05/14] gh-122907: Fix Builds Without HAVE_DYNAMIC_LOADING Set (gh-122952) As of 529a160 (gh-118204), building with HAVE_DYNAMIC_LOADING stopped working. This is a minimal fix just to get builds working again. There are actually a number of long-standing deficiencies with HAVE_DYNAMIC_LOADING builds that need to be resolved separately. @@ -186,5 +186,5 @@ index 7de35b499da..66b2a262e11 100644 raise -- -2.46.1 +2.50.0 diff --git a/interpreters/python/patch/0006-change-var-name-to-avoid-conflict-with-nuttx-unused_.patch b/interpreters/python/patch/0006-change-var-name-to-avoid-conflict-with-nuttx-unused_.patch index a7787b4ff26..74665cebb9b 100644 --- a/interpreters/python/patch/0006-change-var-name-to-avoid-conflict-with-nuttx-unused_.patch +++ b/interpreters/python/patch/0006-change-var-name-to-avoid-conflict-with-nuttx-unused_.patch @@ -1,7 +1,7 @@ -From 82a3c7c021324e4245289c565b2d379b83ed4be3 Mon Sep 17 00:00:00 2001 +From 221e92fa16864f8a590091b643fc40050bab163c Mon Sep 17 00:00:00 2001 From: Tiago Medicci Date: Wed, 13 Nov 2024 14:20:36 -0300 -Subject: [PATCH 06/11] change var name to avoid conflict with nuttx +Subject: [PATCH 06/14] change var name to avoid conflict with nuttx unused_data macro Signed-off-by: Tiago Medicci @@ -165,5 +165,5 @@ index 034a9420b16..595d4ad32e9 100644 {"needs_input", Py_T_BOOL, offsetof(ZlibDecompressor, needs_input), Py_READONLY, ZlibDecompressor_needs_input_doc}, -- -2.46.1 +2.50.0 diff --git a/interpreters/python/patch/0007-undef-atexit_register.patch b/interpreters/python/patch/0007-undef-atexit_register.patch index 7003f155fb8..57bef770ff7 100644 --- a/interpreters/python/patch/0007-undef-atexit_register.patch +++ b/interpreters/python/patch/0007-undef-atexit_register.patch @@ -1,7 +1,7 @@ -From 7eab2315d75d5e78e67e0b049ebb2fc71914b7ea Mon Sep 17 00:00:00 2001 +From 6ebe2333a7862532aa50e7286db9ea8b9df895c4 Mon Sep 17 00:00:00 2001 From: Tiago Medicci Date: Wed, 13 Nov 2024 14:22:04 -0300 -Subject: [PATCH 07/11] undef atexit_register +Subject: [PATCH 07/14] undef atexit_register Even if not built, nuttx/include/nuttx/atexit.h defines it and this causes conflicts. @@ -27,5 +27,5 @@ index 297a8d74ba3..1fea72fbc99 100644 atexit_register(PyObject *module, PyObject *args, PyObject *kwargs) { -- -2.46.1 +2.50.0 diff --git a/interpreters/python/patch/0008-declare-struct-timeval.patch b/interpreters/python/patch/0008-declare-struct-timeval.patch index 646c87c28a1..07c70119b12 100644 --- a/interpreters/python/patch/0008-declare-struct-timeval.patch +++ b/interpreters/python/patch/0008-declare-struct-timeval.patch @@ -1,7 +1,7 @@ -From fc042cfa496f37f2a859495ad281583f79af0044 Mon Sep 17 00:00:00 2001 +From ce41aed2d663d6a7278b83bcdc2dc0adb65b9f5c Mon Sep 17 00:00:00 2001 From: Tiago Medicci Date: Wed, 13 Nov 2024 14:23:34 -0300 -Subject: [PATCH 08/11] declare struct timeval +Subject: [PATCH 08/14] declare struct timeval Otherwise, build will fail due to redefinition of _PyTime_FromTimeval @@ -25,5 +25,5 @@ index 205ac5d3781..c30e07f4b4a 100644 #define _SIZEOF_PYTIME_T 8 -- -2.46.1 +2.50.0 diff --git a/interpreters/python/patch/0009-include-nuttx-sys-select-header-to-define-FD_SETSIZE.patch b/interpreters/python/patch/0009-include-nuttx-sys-select-header-to-define-FD_SETSIZE.patch index 312797960f3..3f7726aebf7 100644 --- a/interpreters/python/patch/0009-include-nuttx-sys-select-header-to-define-FD_SETSIZE.patch +++ b/interpreters/python/patch/0009-include-nuttx-sys-select-header-to-define-FD_SETSIZE.patch @@ -1,7 +1,7 @@ -From 3d140751ebec3aedd8ed3cdf2a7eff5009693112 Mon Sep 17 00:00:00 2001 +From 682b331c77974ef5f051b39f30f3a5af4f7789d1 Mon Sep 17 00:00:00 2001 From: Tiago Medicci Date: Thu, 14 Nov 2024 13:44:49 -0300 -Subject: [PATCH 09/11] include nuttx sys/select header to define FD_SETSIZE +Subject: [PATCH 09/14] include nuttx sys/select header to define FD_SETSIZE Signed-off-by: Tiago Medicci --- @@ -24,5 +24,5 @@ index 5bd9b7732a4..e9fab839122 100644 # ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN -- -2.46.1 +2.50.0 diff --git a/interpreters/python/patch/0010-check-for-the-d_ino-member-of-the-structure-dirent.patch b/interpreters/python/patch/0010-check-for-the-d_ino-member-of-the-structure-dirent.patch index 13cffe3fa0c..897a12e77c4 100644 --- a/interpreters/python/patch/0010-check-for-the-d_ino-member-of-the-structure-dirent.patch +++ b/interpreters/python/patch/0010-check-for-the-d_ino-member-of-the-structure-dirent.patch @@ -1,7 +1,7 @@ -From 4191bf1e4505776efa0780ebc4fc5195a6ce79d3 Mon Sep 17 00:00:00 2001 +From 479f4647bf0c5a841af6a916c21fdef1fa1b5cdf Mon Sep 17 00:00:00 2001 From: Tiago Medicci Date: Tue, 3 Dec 2024 17:18:50 -0300 -Subject: [PATCH 10/11] check for the d_ino member of the structure dirent +Subject: [PATCH 10/14] check for the d_ino member of the structure dirent Signed-off-by: Tiago Medicci --- @@ -191,5 +191,5 @@ index 4d8b1d4f254..4a2ba83a872 100644 */ #undef HAVE_DIRENT_H -- -2.46.1 +2.50.0 diff --git a/interpreters/python/patch/0011-avoid-redefinition-warning-if-UNUSED-is-already-defi.patch b/interpreters/python/patch/0011-avoid-redefinition-warning-if-UNUSED-is-already-defi.patch index 15b5cf0c0f1..bade882e269 100644 --- a/interpreters/python/patch/0011-avoid-redefinition-warning-if-UNUSED-is-already-defi.patch +++ b/interpreters/python/patch/0011-avoid-redefinition-warning-if-UNUSED-is-already-defi.patch @@ -1,7 +1,7 @@ -From b82ab44e498a9e9bcdcbbfa1d6161023d8ea8c5b Mon Sep 17 00:00:00 2001 +From deadd332eda6355c6598dc9df5f12b34b870d857 Mon Sep 17 00:00:00 2001 From: Tiago Medicci Date: Tue, 10 Dec 2024 12:03:47 -0300 -Subject: [PATCH 11/11] avoid redefinition warning if UNUSED is already defined +Subject: [PATCH 11/14] avoid redefinition warning if UNUSED is already defined --- Parser/pegen.h | 2 ++ @@ -22,5 +22,5 @@ index 32c64e7774b..42574456f23 100644 #define EXTRA _start_lineno, _start_col_offset, _end_lineno, _end_col_offset, p->arena PyObject *_PyPegen_new_type_comment(Parser *, const char *); -- -2.46.1 +2.50.0 diff --git a/interpreters/python/patch/0012-hack-place-_PyRuntime-structure-into-PSRAM-bss-regio.patch b/interpreters/python/patch/0012-hack-place-_PyRuntime-structure-into-PSRAM-bss-regio.patch index 2cda0d5887e..2f49266795f 100644 --- a/interpreters/python/patch/0012-hack-place-_PyRuntime-structure-into-PSRAM-bss-regio.patch +++ b/interpreters/python/patch/0012-hack-place-_PyRuntime-structure-into-PSRAM-bss-regio.patch @@ -1,7 +1,7 @@ -From 79b6142580bad5235588faf38c0a22c7280a2d1b Mon Sep 17 00:00:00 2001 +From 70538c2ec3e59df6ce1e767e53908a9cad361f05 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Wed, 23 Oct 2024 16:52:52 +0200 -Subject: [PATCH 12/13] hack: place _PyRuntime structure into PSRAM bss region, +Subject: [PATCH 12/14] hack: place _PyRuntime structure into PSRAM bss region, initialize later _PyRuntime occupies around 100kB of RAM in .data region, making it @@ -50,5 +50,5 @@ index 1701a1cd217..93aa808bc03 100644 _PyRuntime_Initialize(void) { -- -2.48.1 +2.50.0 diff --git a/interpreters/python/patch/0013-transform-functions-used-by-NuttX-to-lowercase.patch b/interpreters/python/patch/0013-transform-functions-used-by-NuttX-to-lowercase.patch index c1e83aad640..ed03e2c18c0 100644 --- a/interpreters/python/patch/0013-transform-functions-used-by-NuttX-to-lowercase.patch +++ b/interpreters/python/patch/0013-transform-functions-used-by-NuttX-to-lowercase.patch @@ -1,7 +1,7 @@ -From 914c80b7969d73840bc1b573b478d9148999b7d0 Mon Sep 17 00:00:00 2001 +From 954d39ba94e772940486575e35d586ba1cf738e3 Mon Sep 17 00:00:00 2001 From: Tiago Medicci Date: Fri, 31 Jan 2025 14:06:21 -0300 -Subject: [PATCH 13/13] transform functions used by NuttX to lowercase +Subject: [PATCH 13/14] transform functions used by NuttX to lowercase --- Include/pylifecycle.h | 10 ++++++++++ @@ -29,5 +29,5 @@ index de1bcb1d2cb..044780ee188 100644 Py_DEPRECATED(3.11) PyAPI_FUNC(void) Py_SetProgramName(const wchar_t *); Py_DEPRECATED(3.13) PyAPI_FUNC(wchar_t *) Py_GetProgramName(void); -- -2.47.1 +2.50.0 diff --git a/interpreters/python/patch/0014-insert-prefix-to-list_length-to-avoid-symbol-collisi.patch b/interpreters/python/patch/0014-insert-prefix-to-list_length-to-avoid-symbol-collisi.patch new file mode 100644 index 00000000000..4d24a7cbaae --- /dev/null +++ b/interpreters/python/patch/0014-insert-prefix-to-list_length-to-avoid-symbol-collisi.patch @@ -0,0 +1,44 @@ +From e908a9a52806768b7546f6a5808eeba1a7862238 Mon Sep 17 00:00:00 2001 +From: Tiago Medicci +Date: Mon, 21 Jul 2025 12:04:04 -0300 +Subject: [PATCH 14/14] insert prefix to list_length to avoid symbol collision + on NuttX + +--- + Objects/listobject.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/Objects/listobject.c b/Objects/listobject.c +index dc9df3c3614..3e5bb33068b 100644 +--- a/Objects/listobject.c ++++ b/Objects/listobject.c +@@ -627,7 +627,7 @@ list_repr(PyObject *self) + } + + static Py_ssize_t +-list_length(PyObject *a) ++py_list_length(PyObject *a) + { + return PyList_GET_SIZE(a); + } +@@ -3502,7 +3502,7 @@ static PyMethodDef list_methods[] = { + }; + + static PySequenceMethods list_as_sequence = { +- list_length, /* sq_length */ ++ py_list_length, /* sq_length */ + list_concat, /* sq_concat */ + list_repeat, /* sq_repeat */ + list_item, /* sq_item */ +@@ -3768,7 +3768,7 @@ list_ass_subscript(PyObject* _self, PyObject* item, PyObject* value) + } + + static PyMappingMethods list_as_mapping = { +- list_length, ++ py_list_length, + list_subscript, + list_ass_subscript + }; +-- +2.50.0 + From 8b4a015f078ed0df2c144d5125dd70d4ccd25f48 Mon Sep 17 00:00:00 2001 From: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com> Date: Tue, 22 Jul 2025 10:07:11 +0900 Subject: [PATCH 354/391] netutils/esp8266: Fix compile error Fix compile error. Signed-off-by: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com> --- include/netutils/esp8266.h | 8 ++++---- netutils/esp8266/esp8266.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/netutils/esp8266.h b/include/netutils/esp8266.h index 2c8fccd8062..dce247f312a 100644 --- a/include/netutils/esp8266.h +++ b/include/netutils/esp8266.h @@ -37,8 +37,8 @@ * Pre-processor Definitions ****************************************************************************/ -#define lespSSID_SIZE 32 /* Number of character max of SSID (null char not included) */ -#define lespBSSID_SIZE 6 +#define LESP_SSID_SIZE 32 /* Number of character max of SSID (null char not included) */ +#define LESP_BSSID_SIZE 6 #define lespIP(x1,x2,x3,x4) ((x1) << 24 | (x2) << 16 | (x3) << 8 | (x4) << 0) @@ -66,8 +66,8 @@ typedef enum typedef struct { lesp_security_t security; - char ssid[lespSSID_SIZE + 1]; /* +1 for null char */ - uint8_t bssid[lespBSSID_SIZE]; + char ssid[LESP_SSID_SIZE + 1]; /* +1 for null char */ + uint8_t bssid[LESP_BSSID_SIZE]; int rssi; int channel; } lesp_ap_t; diff --git a/netutils/esp8266/esp8266.c b/netutils/esp8266/esp8266.c index ac64b4b2f67..f015da85fb2 100644 --- a/netutils/esp8266/esp8266.c +++ b/netutils/esp8266/esp8266.c @@ -315,7 +315,7 @@ static lesp_socket_t *get_sock(int sockfd) if (((unsigned int)sockfd) >= SOCKET_NBR) { errno = EINVAL; - ninfo("Esp8266 invalid sockfd\n", sockfd); + ninfo("Esp8266 invalid sockfd %d\n", sockfd); return NULL; } @@ -2283,7 +2283,7 @@ int lesp_connect(int sockfd, FAR const struct sockaddr *addr, socklen_t addrlen) { int ret = 0; - const char *proto_str; + const char *proto_str = ""; lesp_socket_t *sock; struct sockaddr_in *in; unsigned short port; From 5429191ab09e410a8b36aa9faba9a75565051e9e Mon Sep 17 00:00:00 2001 From: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com> Date: Tue, 22 Jul 2025 10:07:11 +0900 Subject: [PATCH 355/391] netutils/esp8266: Fix nxstyle Fix nxstyle. Signed-off-by: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com> --- include/netutils/esp8266.h | 18 +++++++++--------- netutils/esp8266/esp8266.c | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/netutils/esp8266.h b/include/netutils/esp8266.h index dce247f312a..2c4a612b923 100644 --- a/include/netutils/esp8266.h +++ b/include/netutils/esp8266.h @@ -48,19 +48,19 @@ typedef enum { - lesp_eMODE_AP = 0, - lesp_eMODE_STATION = 1, - lesp_eMODE_BOTH = 2 + LESP_MODE_AP = 0, + LESP_MODE_STATION = 1, + LESP_MODE_BOTH = 2 } lesp_mode_t; typedef enum { - lesp_eSECURITY_NONE = 0, - lesp_eSECURITY_WEP, - lesp_eSECURITY_WPA_PSK, - lesp_eSECURITY_WPA2_PSK, - lesp_eSECURITY_WPA_WPA2_PSK, - lesp_eSECURITY_NBR + LESP_SECURITY_NONE = 0, + LESP_SECURITY_WEP, + LESP_SECURITY_WPA_PSK, + LESP_SECURITY_WPA2_PSK, + LESP_SECURITY_WPA_WPA2_PSK, + LESP_SECURITY_NBR } lesp_security_t; typedef struct diff --git a/netutils/esp8266/esp8266.c b/netutils/esp8266/esp8266.c index f015da85fb2..c0ba031b1ee 100644 --- a/netutils/esp8266/esp8266.c +++ b/netutils/esp8266/esp8266.c @@ -2179,7 +2179,7 @@ int lesp_socket(int domain, int type, int protocol) * close socket creates with lesp_socket. * * Input Parameters: - * sockfd : socket indentifer. + * sockfd Socket descriptor returned by socket() * * Returned Value: * A 0 on success; -1 on error. From e61ee7981de6b0c7cdcebabeabce63cf304eb9ed Mon Sep 17 00:00:00 2001 From: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com> Date: Tue, 22 Jul 2025 10:07:11 +0900 Subject: [PATCH 356/391] netutils/esp8266: Fix bug to get gateway address Fix bug to get gateway address. Signed-off-by: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com> --- netutils/esp8266/esp8266.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netutils/esp8266/esp8266.c b/netutils/esp8266/esp8266.c index c0ba031b1ee..686c43eb89e 100644 --- a/netutils/esp8266/esp8266.c +++ b/netutils/esp8266/esp8266.c @@ -1771,7 +1771,7 @@ int lesp_get_net(lesp_mode_t mode, in_addr_t *ip, { ninfo("Read:%s\n", g_lesp_state.bufans); - ret = lesp_parse_cipxxx_ans_line(g_lesp_state.bufans, mask); + ret = lesp_parse_cipxxx_ans_line(g_lesp_state.bufans, gw); if (ret < 0) { nerr("ERROR: Line badly formed.\n"); From 549836600c045af1e3ab6101433f275b3a3891a2 Mon Sep 17 00:00:00 2001 From: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com> Date: Tue, 22 Jul 2025 10:07:11 +0900 Subject: [PATCH 357/391] netutils/esp8266: Add to get channel from access points Fix bug that channel retrieved by lesp_list_access_points is undefined. Signed-off-by: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com> --- netutils/esp8266/esp8266.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/netutils/esp8266/esp8266.c b/netutils/esp8266/esp8266.c index 686c43eb89e..e2368df9543 100644 --- a/netutils/esp8266/esp8266.c +++ b/netutils/esp8266/esp8266.c @@ -1123,6 +1123,7 @@ static int lesp_parse_cwjap_ans_line(char *ptr, lesp_ap_t *ap) * "FreeWifi" => ssid * -90 => rssi * "00:07:cb:07:b6:00" => mac + * 1 => channel * * Note: Content of ptr is modified and string in ap point into ptr string. * @@ -1220,6 +1221,14 @@ static int lesp_parse_cwlap_ans_line(char *ptr, lesp_ap_t *ap) } } break; + + case 5: + { + int i = atoi(ptr); + + ap->channel = i; + } + break; } ptr = ptr_next + 1; From 5e704891d9339aff6a39c3bd9f1f27858e6acf72 Mon Sep 17 00:00:00 2001 From: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com> Date: Tue, 22 Jul 2025 10:07:11 +0900 Subject: [PATCH 358/391] netutils/esp8266: Add a function for finalization. Add a function for finalization so that it can be used repeatedly. Signed-off-by: SPRESENSE <41312067+SPRESENSE@users.noreply.github.com> --- include/netutils/esp8266.h | 1 + netutils/esp8266/esp8266.c | 64 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) diff --git a/include/netutils/esp8266.h b/include/netutils/esp8266.h index 2c4a612b923..d36bd73c88c 100644 --- a/include/netutils/esp8266.h +++ b/include/netutils/esp8266.h @@ -77,6 +77,7 @@ typedef struct ****************************************************************************/ int lesp_initialize(void); +int lesp_finalize(void); int lesp_soft_reset(void); const char *lesp_security_to_str(lesp_security_t security); diff --git a/netutils/esp8266/esp8266.c b/netutils/esp8266/esp8266.c index e2368df9543..51de514b746 100644 --- a/netutils/esp8266/esp8266.c +++ b/netutils/esp8266/esp8266.c @@ -1531,6 +1531,70 @@ int lesp_initialize(void) return 0; } +/**************************************************************************** + * Name: lesp_finalize + * + * Description: + * finalize Esp8266 class. + * - destroy worker thread + * - close port + * + * Input Parameters: + * None + * + * Returned Value: + * 0 on success, -1 in case of error. + * + ****************************************************************************/ + +int lesp_finalize(void) +{ + int i; + + ninfo("Finalizing Esp8266...\n"); + + pthread_mutex_lock(&g_lesp_state.mutex); + + if (!g_lesp_state.is_initialized) + { + pthread_mutex_unlock(&g_lesp_state.mutex); + ninfo("Esp8266 already finalized\n"); + return 0; + } + + pthread_mutex_lock(&g_lesp_state.worker.mutex); + + for (i = 0; i < SOCKET_NBR; i++) + { + if ((g_lesp_state.sockets[i].flags & FLAGS_SOCK_USED) != 0) + { + nerr("ERROR: Exist opened socket\n"); + pthread_mutex_unlock(&g_lesp_state.worker.mutex); + pthread_mutex_unlock(&g_lesp_state.mutex); + return -1; + } + } + + /* Destroy worker thread */ + + g_lesp_state.worker.running = false; + pthread_kill(g_lesp_state.worker.thread, SIGTERM); + pthread_join(g_lesp_state.worker.thread, NULL); + + if (g_lesp_state.fd > 0) + { + close(g_lesp_state.fd); + g_lesp_state.fd = -1; + } + + g_lesp_state.is_initialized = false; + + pthread_mutex_unlock(&g_lesp_state.worker.mutex); + pthread_mutex_unlock(&g_lesp_state.mutex); + + return 0; +} + /**************************************************************************** * Name: lesp_soft_reset * From 72668d723447e79a73e850da1956b6edc141fd17 Mon Sep 17 00:00:00 2001 From: Theodore Karatapanis Date: Fri, 18 Jul 2025 17:32:19 +0300 Subject: [PATCH 359/391] tee/optee_supplicant: Added optee supplicant Support for extracting (from libteec), patching and compiling optee_client/tee-supplicant by NuttX apps. Defaults to version 4.6.0 (same as the current libteec). Enabled with: CONFIG_OPTEE_SUPPLICANT=y CONFIG_LIBTEEC=y And the following for the nuttx kernel: CONFIG_ALLOW_BSD_COMPONENTS=y CONFIG_FS_ANONMAP=y CONFIG_DEV_OPTEE_SMC=y CONFIG_DEV_OPTEE_SUPPLICANT=y The version of the supplicant needs to match the libteec version since the patch to be applied might fail otherwise. If the versions differ the build will be aborted. More info: - https://github.com/OP-TEE/optee_client - https://optee.readthedocs.io/en/latest/architecture/secure_storage.html Signed-off-by: Theodore Karatapanis --- .../0001-tee-supplicant-port-to-nuttx.patch | 316 ++++++++++++++++++ tee/optee_supplicant/CMakeLists.txt | 117 +++++++ tee/optee_supplicant/Kconfig | 54 +++ tee/optee_supplicant/Make.defs | 25 ++ tee/optee_supplicant/Makefile | 79 +++++ 5 files changed, 591 insertions(+) create mode 100644 tee/optee_supplicant/0001-tee-supplicant-port-to-nuttx.patch create mode 100644 tee/optee_supplicant/CMakeLists.txt create mode 100644 tee/optee_supplicant/Kconfig create mode 100644 tee/optee_supplicant/Make.defs create mode 100644 tee/optee_supplicant/Makefile diff --git a/tee/optee_supplicant/0001-tee-supplicant-port-to-nuttx.patch b/tee/optee_supplicant/0001-tee-supplicant-port-to-nuttx.patch new file mode 100644 index 00000000000..f1c971852a2 --- /dev/null +++ b/tee/optee_supplicant/0001-tee-supplicant-port-to-nuttx.patch @@ -0,0 +1,316 @@ +From b31fe60eb64610f36c501ad7462f92dfe149fc19 Mon Sep 17 00:00:00 2001 +From: Theodore Karatapanis +Date: Fri, 18 Jul 2025 17:10:36 +0300 +Subject: [PATCH] tee-supplicant: port to nuttx + +Replace include of linux/tee.h with nuttx/tee.h +Remove Daemon references +Remove threads (if the supplicant is killed and it has spawned 2 threads +it might crash the system). +--- + tee-supplicant/src/rpmb.c | 6 +- + tee-supplicant/src/tee_supp_fs.c | 2 +- + tee-supplicant/src/tee_supplicant.c | 163 +--------------------------- + 3 files changed, 6 insertions(+), 165 deletions(-) + +diff --git a/tee-supplicant/src/rpmb.c b/tee-supplicant/src/rpmb.c +index d5ea0ea..964a758 100644 +--- a/tee-supplicant/src/rpmb.c ++++ b/tee-supplicant/src/rpmb.c +@@ -27,8 +27,8 @@ + + #include + #include +-#include +-#include ++#include ++#include + #include + #include + #include +@@ -776,7 +776,7 @@ static bool remap_rpmb_dev_id(uint16_t dev_id, uint16_t *ndev_id) + #endif /* RPMB_EMU */ + + static inline void set_mmc_io_cmd(struct mmc_ioc_cmd *cmd, unsigned int blocks, +- __u32 opcode, int write_flag) ++ uint32_t opcode, int write_flag) + { + cmd->blksz = 512; + cmd->blocks = blocks; +diff --git a/tee-supplicant/src/tee_supp_fs.c b/tee-supplicant/src/tee_supp_fs.c +index cc4120f..460e872 100644 +--- a/tee-supplicant/src/tee_supp_fs.c ++++ b/tee-supplicant/src/tee_supp_fs.c +@@ -45,7 +45,7 @@ + #ifndef __aligned + #define __aligned(x) __attribute__((__aligned__(x))) + #endif +-#include ++#include + + #ifndef PATH_MAX + #define PATH_MAX 255 +diff --git a/tee-supplicant/src/tee_supplicant.c b/tee-supplicant/src/tee_supplicant.c +index b6add55..a2765b7 100644 +--- a/tee-supplicant/src/tee_supplicant.c ++++ b/tee-supplicant/src/tee_supplicant.c +@@ -61,7 +61,7 @@ + #ifndef __aligned + #define __aligned(x) __attribute__((__aligned__(x))) + #endif +-#include ++#include + + #define RPC_NUM_PARAMS 5 + +@@ -111,34 +111,6 @@ struct tee_supplicant_params supplicant_params = { + .fs_parent_path = TEE_FS_PARENT_PATH, + }; + +-static void *thread_main(void *a); +- +-static size_t num_waiters_inc(struct thread_arg *arg) +-{ +- size_t ret = 0; +- +- tee_supp_mutex_lock(&arg->mutex); +- arg->num_waiters++; +- assert(arg->num_waiters); +- ret = arg->num_waiters; +- tee_supp_mutex_unlock(&arg->mutex); +- +- return ret; +-} +- +-static size_t num_waiters_dec(struct thread_arg *arg) +-{ +- size_t ret = 0; +- +- tee_supp_mutex_lock(&arg->mutex); +- assert(arg->num_waiters); +- arg->num_waiters--; +- ret = arg->num_waiters; +- tee_supp_mutex_unlock(&arg->mutex); +- +- return ret; +-} +- + static void *paged_aligned_alloc(size_t sz) + { + void *p = NULL; +@@ -492,8 +464,6 @@ static int usage(int status) + { + fprintf(stderr, "Usage: tee-supplicant [options] []\n"); + fprintf(stderr, "\t-h, --help: this help\n"); +- fprintf(stderr, "\t-d, --daemonize: run as a daemon (fork and return " +- "after child has opened the TEE device or on error)\n"); + fprintf(stderr, "\t-f, --fs-parent-path: secure fs parent path [%s]\n", + supplicant_params.fs_parent_path); + fprintf(stderr, "\t-l, --ta-path: TA load path\n"); +@@ -546,7 +516,7 @@ static bool write_response(int fd, union tee_rpc_invoke *request) + data.buf_ptr = (uintptr_t)&request->send; + data.buf_len = sizeof(struct tee_iocl_supp_send_arg) + + sizeof(struct tee_ioctl_param) * +- (__u64)request->send.num_params; ++ (uint64_t)request->send.num_params; + if (ioctl(fd, TEE_IOC_SUPPL_SEND, &data)) { + EMSG("TEE_IOC_SUPPL_SEND: %s", strerror(errno)); + return false; +@@ -584,35 +554,6 @@ static bool find_params(union tee_rpc_invoke *request, uint32_t *func, + return true; + } + +-static bool spawn_thread(struct thread_arg *arg) +-{ +- int e = 0; +- pthread_t tid; +- +- memset(&tid, 0, sizeof(tid)); +- +- DMSG("Spawning a new thread"); +- +- /* +- * Increase number of waiters now to avoid starting another thread +- * before this thread has been scheduled. +- */ +- num_waiters_inc(arg); +- +- e = pthread_create(&tid, NULL, thread_main, arg); +- if (e) { +- EMSG("pthread_create: %s", strerror(e)); +- num_waiters_dec(arg); +- return false; +- } +- +- e = pthread_detach(tid); +- if (e) +- EMSG("pthread_detach: %s", strerror(e)); +- +- return true; +-} +- + static bool process_one_request(struct thread_arg *arg) + { + size_t num_params = 0; +@@ -631,17 +572,12 @@ static bool process_one_request(struct thread_arg *arg) + params = (struct tee_ioctl_param *)(&request.send + 1); + params->attr = TEE_IOCTL_PARAM_ATTR_META; + +- num_waiters_inc(arg); +- + if (!read_request(arg->fd, &request)) + return false; + + if (!find_params(&request, &func, &num_params, ¶ms, &num_meta)) + return false; + +- if (num_meta && !num_waiters_dec(arg) && !spawn_thread(arg)) +- return false; +- + switch (func) { + case OPTEE_MSG_RPC_CMD_LOAD_TA: + ret = load_ta(num_params, params); +@@ -681,24 +617,6 @@ static bool process_one_request(struct thread_arg *arg) + return write_response(arg->fd, &request); + } + +-static void *thread_main(void *a) +-{ +- struct thread_arg *arg = a; +- +- /* +- * Now that this thread has been scheduled, compensate for the +- * initial increase in spawn_thread() before. +- */ +- num_waiters_dec(arg); +- +- while (!arg->abort) { +- if (!process_one_request(arg)) +- arg->abort = true; +- } +- +- return NULL; +-} +- + static void set_ta_path(void) + { + char *ta_path_str = NULL; +@@ -764,62 +682,10 @@ err_path: + exit(EXIT_FAILURE); + } + +-/* +- * Similar to the standard libc function daemon(0, 0) but the parent process +- * issues a blocking read on pipefd[0] before exiting. +- * Returns 0 on success, <0 on error. +- */ +-static int make_daemon(int pipefd[2]) +-{ +- int fd = 0; +- char c = 0; +- int n = 0; +- +- switch (fork()) { +- case -1: +- return -1; +- case 0: +- /* In child */ +- close(pipefd[0]); +- break; +- default: +- /* In parent */ +- close(pipefd[1]); +- n = read(pipefd[0], &c, 1); +- close(pipefd[0]); +- if (!n) { +- /* +- * Nothing has been read: child has closed without +- * writing (either exited on error or crashed) +- */ +- return -1; +- } +- /* Child is done with the opening of the TEE device */ +- _exit(EXIT_SUCCESS); +- } +- +- if (setsid() < 0) +- return -2; +- +- if (chdir("/") < 0) +- return -3; +- +- fd = open("/dev/null", O_RDWR); +- if (fd < 0) +- return -4; +- dup2(fd, 0); +- dup2(fd, 1); +- dup2(fd, 2); +- close(fd); +- +- return 0; +-} + + int main(int argc, char *argv[]) + { + struct thread_arg arg = { .fd = -1 }; +- int pipefd[2] = { 0, }; +- bool daemonize = false; + char *dev = NULL; + int e = 0; + int long_index = 0; +@@ -835,7 +701,6 @@ int main(int argc, char *argv[]) + static struct option long_options[] = { + /* long name | has argument | flag | short value */ + { "help", no_argument, 0, 'h' }, +- { "daemonize", no_argument, 0, 'd' }, + { "fs-parent-path", required_argument, 0, 'f' }, + { "ta-path", required_argument, 0, 'l' }, + { "ta-dir", required_argument, 0, 't' }, +@@ -850,9 +715,6 @@ int main(int argc, char *argv[]) + case 'h' : + return usage(EXIT_SUCCESS); + break; +- case 'd': +- daemonize = true; +- break; + case 'f': + supplicant_params.fs_parent_path = optarg; + break; +@@ -898,18 +760,6 @@ int main(int argc, char *argv[]) + exit(EXIT_FAILURE); + } + +- if (daemonize) { +- if (pipe(pipefd) < 0) { +- EMSG("pipe(): %s", strerror(errno)); +- exit(EXIT_FAILURE); +- } +- e = make_daemon(pipefd); +- if (e < 0) { +- EMSG("make_daemon(): %d", e); +- exit(EXIT_FAILURE); +- } +- } +- + if (dev) { + arg.fd = open_dev(dev, &arg.gen_caps); + if (arg.fd < 0) { +@@ -929,15 +779,6 @@ int main(int argc, char *argv[]) + if(e < 0) + fprintf(stderr, "sd_notify_ready() failed: %s\n", strerror(-e)); + +- if (daemonize) { +- /* Release parent */ +- if (write(pipefd[1], "", 1) != 1) { +- EMSG("write(): %s", strerror(errno)); +- exit(EXIT_FAILURE); +- } +- close(pipefd[1]); +- } +- + while (!arg.abort) { + if (!process_one_request(&arg)) + arg.abort = true; +-- +2.49.0.rc2.11.g4b68faf6b9.dirty + diff --git a/tee/optee_supplicant/CMakeLists.txt b/tee/optee_supplicant/CMakeLists.txt new file mode 100644 index 00000000000..388952de570 --- /dev/null +++ b/tee/optee_supplicant/CMakeLists.txt @@ -0,0 +1,117 @@ +# ############################################################################## +# apps/tee/optee_supplicant/CMakeLists.txt +# +# SPDX-License-Identifier: Apache-2.0 +# +# Copyright (C) 2023 Xiaomi Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_OPTEE_SUPPLICANT) + + # Versions must match + set(LIBTEEC_VERSION ${CONFIG_LIBTEEC_VERSION}) + set(OPTEE_SUPPLICANT_VERSION ${CONFIG_OPTEE_SUPPLICANT_VERSION}) + if(NOT "${OPTEE_SUPPLICANT_VERSION}" STREQUAL "${LIBTEEC_VERSION}") + message( + FATAL_ERROR + "OPTEE supplicant version (${OPTEE_SUPPLICANT_VERSION}) does not match libteec version (${LIBTEEC_VERSION}).\n" + "Please set CONFIG_OPTEE_SUPPLICANT_VERSION to ${LIBTEEC_VERSION} in your config." + ) + endif() + + # Determine paths + set(OPTEE_CLIENT_DIR ${CMAKE_CURRENT_LIST_DIR}/optee_client) + set(OPTEE_CLIENT_ZIP + ${CMAKE_CURRENT_LIST_DIR}/../libteec/${LIBTEEC_VERSION}.zip) + set(PATCH_FILE + ${CMAKE_CURRENT_LIST_DIR}/0001-tee-supplicant-port-to-nuttx.patch) + + # Unpack only if not already present + if(NOT EXISTS "${OPTEE_CLIENT_DIR}") + message( + STATUS + "Unpacking OP-TEE client from ${OPTEE_CLIENT_ZIP} to ${OPTEE_CLIENT_DIR}" + ) + # Ensure output dir exists + file(MAKE_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/_optee_unpack) + # Extract zip + file(ARCHIVE_EXTRACT INPUT ${OPTEE_CLIENT_ZIP} OUTPUT_DIR + ${CMAKE_CURRENT_LIST_DIR}/_optee_unpack) + # Rename unpacked folder to optee_client + file(RENAME + ${CMAKE_CURRENT_LIST_DIR}/_optee_unpack/optee_client-${LIBTEEC_VERSION} + ${OPTEE_CLIENT_DIR}) + file(REMOVE_RECURSE ${CMAKE_CURRENT_LIST_DIR}/_optee_unpack) + # Apply patch + execute_process( + COMMAND patch -p1 -d ${OPTEE_CLIENT_DIR} -i ${PATCH_FILE} + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} + RESULT_VARIABLE patch_result) + if(NOT patch_result EQUAL 0) + message( + FATAL_ERROR + "Failed to apply patch ${PATCH_FILE} to optee_client sources.") + endif() + endif() + + # Source files for supplicant + set(SUPPLICANT_SRCS + ${OPTEE_CLIENT_DIR}/tee-supplicant/src/tee_supplicant.c + ${OPTEE_CLIENT_DIR}/tee-supplicant/src/handle.c + ${OPTEE_CLIENT_DIR}/tee-supplicant/src/hmac_sha2.c + ${OPTEE_CLIENT_DIR}/tee-supplicant/src/sha2.c + ${OPTEE_CLIENT_DIR}/tee-supplicant/src/sd_notify.c + ${OPTEE_CLIENT_DIR}/tee-supplicant/src/teec_ta_load.c + ${OPTEE_CLIENT_DIR}/tee-supplicant/src/tee_supp_fs.c + ${OPTEE_CLIENT_DIR}/tee-supplicant/src/rpmb.c) + + if(CONFIG_OPTEE_GP_SOCKETS) + list(APPEND SUPPLICANT_SRCS + ${OPTEE_CLIENT_DIR}/tee-supplicant/src/tee_socket.c) + add_compile_definitions(CFG_GP_SOCKETS=1) + endif() + + # Compiler flags + set(SUPPLICANT_CFLAGS + ${INCDIR_PREFIX}${OPTEE_CLIENT_DIR}/tee-supplicant/src + ${DEFINE_PREFIX}TEEC_LOAD_PATH=\"/bin\" + ${DEFINE_PREFIX}TEE_FS_PARENT_PATH=\"/data/tee\" + ${DEFINE_PREFIX}DEBUGLEVEL_${CONFIG_OPTEE_SUPPLICANT_LOG_LEVEL}) + add_compile_options($<$:${SUPPLICANT_CFLAGS}>) + + # Expose public headers for other apps + set_property( + TARGET nuttx + APPEND + PROPERTY NUTTX_INCLUDE_DIRECTORIES ${OPTEE_CLIENT_DIR}/libteec/include) + + # Add the application + nuttx_add_application( + NAME + ${CONFIG_OPTEE_SUPPLICANT_PROGNAME} + SRCS + ${SUPPLICANT_SRCS} + INCLUDES + ${OPTEE_CLIENT_DIR}/libteec/include + ${OPTEE_CLIENT_DIR}/tee-supplicant/src + STACKSIZE + ${CONFIG_OPTEE_SUPPLICANT_STACKSIZE} + PRIORITY + ${CONFIG_OPTEE_SUPPLICANT_PRIORITY} + REQUIRES + libteec) + +endif() diff --git a/tee/optee_supplicant/Kconfig b/tee/optee_supplicant/Kconfig new file mode 100644 index 00000000000..662bf96a7d3 --- /dev/null +++ b/tee/optee_supplicant/Kconfig @@ -0,0 +1,54 @@ +############################################################################ +# apps/tee/optee_supplicant/Kconfig +# +# SPDX-License-Identifier: Apache-2.0 +# +# Copyright (C) 2023 Xiaomi Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +############################################################################ + +config OPTEE_SUPPLICANT + bool "OP-TEE supplicant" + depends on LIBTEEC + default n + ---help--- + Enable OP-TEE supplicant from https://github.com/OP-TEE/optee_client. + +if OPTEE_SUPPLICANT + +config OPTEE_SUPPLICANT_PROGNAME + string "Program name" + default "optee_supplicant" + ---help--- + This is the name of the program that will be used when the NSH ELF + program is installed. + +config OPTEE_SUPPLICANT_PRIORITY + int "OP-TEE supplicant task priority" + default 100 + +config OPTEE_SUPPLICANT_STACKSIZE + int "OP-TEE supplicant stack size" + default DEFAULT_TASK_STACKSIZE + +config OPTEE_SUPPLICANT_VERSION + string "optee_client version (4.6.0)" + default "4.6.0" + +config OPTEE_SUPPLICANT_LOG_LEVEL + int "Log level for the supplicant (0‑4)" + range 0 4 + default 0 +endif # OPTEE_SUPPLICANT diff --git a/tee/optee_supplicant/Make.defs b/tee/optee_supplicant/Make.defs new file mode 100644 index 00000000000..bc07c1a67af --- /dev/null +++ b/tee/optee_supplicant/Make.defs @@ -0,0 +1,25 @@ +############################################################################ +# apps/tee/optee_supplicant/Make.defs +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +ifneq ($(CONFIG_OPTEE_SUPPLICANT),) +CONFIGURED_APPS += $(APPDIR)/tee/optee_supplicant +endif diff --git a/tee/optee_supplicant/Makefile b/tee/optee_supplicant/Makefile new file mode 100644 index 00000000000..4ecfe8a9264 --- /dev/null +++ b/tee/optee_supplicant/Makefile @@ -0,0 +1,79 @@ +############################################################################ +# apps/tee/optee_supplicant/Makefile +# +# SPDX-License-Identifier: Apache-2.0 +# +# Copyright (C) 2023 Xiaomi Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +############################################################################ + +include $(APPDIR)/Make.defs + +PROGNAME = ${CONFIG_OPTEE_SUPPLICANT_PROGNAME} +PRIORITY = $(CONFIG_OPTEE_SUPPLICANT_PRIORITY) +STACKSIZE = $(CONFIG_OPTEE_SUPPLICANT_STACKSIZE) +MODULE = $(CONFIG_OPTEE_SUPPLICANT) +MAINSRC = optee_client/tee-supplicant/src/tee_supplicant.c + +LIBTEEC_VERSION = $(patsubst "%",%,$(strip $(CONFIG_LIBTEEC_VERSION))) +OPTEE_SUPPLICANT_VERSION = $(patsubst "%",%,$(strip $(CONFIG_OPTEE_SUPPLICANT_VERSION))) +PATCH_FILE = 0001-tee-supplicant-port-to-nuttx.patch +OPTEE_SUPPLICANT_ZIP = ../libteec/$(LIBTEEC_VERSION).zip +OPTEE_SUPPLICANT_UNPACKNAME = optee_client +UNPACK ?= unzip -q -o + +ifeq ($(strip $(OPTEE_SUPPLICANT_VERSION)),$(strip $(LIBTEEC_VERSION))) + # Versions match, continue. +else + $(error \ + The supplicant patch version ($(OPTEE_SUPPLICANT_VERSION)) does not match LIBTEEC_VERSION ($(LIBTEEC_VERSION)). \ + Build aborted. Change LIBTEEC_VERSION version to match OPTEE_SUPPLICANT_VERSION. \ + ) +endif + +CSRCS += optee_client/tee-supplicant/src/handle.c +CSRCS += optee_client/tee-supplicant/src/hmac_sha2.c +CSRCS += optee_client/tee-supplicant/src/sha2.c +CSRCS += optee_client/tee-supplicant/src/sd_notify.c +CSRCS += optee_client/tee-supplicant/src/teec_ta_load.c +CSRCS += optee_client/tee-supplicant/src/tee_supp_fs.c +CSRCS += optee_client/tee-supplicant/src/rpmb.c + +ifeq ($(CONFIG_GP_SOCKETS),1) +CSRCS += optee_client/tee-supplicant/src/tee_socket.c +CFLAGS += ${DEFINE_PREFIX}CFG_GP_SOCKETS=1 +endif + +CFLAGS += ${INCDIR_PREFIX}optee_client/tee-supplicant/src +CFLAGS += ${DEFINE_PREFIX}TEEC_LOAD_PATH=\"/bin\" +CFLAGS += ${DEFINE_PREFIX}TEE_FS_PARENT_PATH=\"/data/tee\" +CFLAGS += ${DEFINE_PREFIX}DEBUGLEVEL_$(CONFIG_OPTEE_SUPPLICANT_LOG_LEVEL) + +$(OPTEE_SUPPLICANT_UNPACKNAME): $(OPTEE_SUPPLICANT_ZIP) + @echo "Unpacking: $(OPTEE_SUPPLICANT_ZIP) -> $(OPTEE_SUPPLICANT_UNPACKNAME)" + $(Q) $(UNPACK) $(OPTEE_SUPPLICANT_ZIP) + $(Q) mv $(OPTEE_SUPPLICANT_UNPACKNAME)-$(OPTEE_SUPPLICANT_VERSION) $(OPTEE_SUPPLICANT_UNPACKNAME) + $(Q) echo "Patching $(OPTEE_SUPPLICANT_UNPACKNAME)" + $(Q) patch -p1 -d $(OPTEE_SUPPLICANT_UNPACKNAME) < $(PATCH_FILE) + $(Q) touch $(OPTEE_SUPPLICANT_UNPACKNAME) + +ifeq ($(wildcard $(OPTEE_SUPPLICANT_UNPACKNAME)/.git),) +context:: $(OPTEE_SUPPLICANT_UNPACKNAME) + +distclean:: + $(Q) rm -rf $(OPTEE_SUPPLICANT_UNPACKNAME) +endif + +include $(APPDIR)/Application.mk From 2de49b8b229ed83dde029e48a4da1e5128db9ecf Mon Sep 17 00:00:00 2001 From: RTL <24235755+Telemechanics@users.noreply.github.com> Date: Tue, 20 May 2025 08:52:09 +0200 Subject: [PATCH 360/391] examples/xedge_demo: Add Xedge IoT Toolkit with BAS integration Add support for Xedge, an embedded software toolkit for IoT applications using Lua scripting with HTTP(S), WebSockets, MQTT, and device I/O. * netutils/xedge: Dependency manager that downloads BAS library and BAS-Resources, generates XedgeZip.c during build * examples/xedge_demo: Complete example showing Xedge integration with HTTP server, Lua runtime, and SNTP time synchronization Signed-off-by: Jorge Guzman --- examples/xedge_demo/Kconfig | 41 ++++++ examples/xedge_demo/Make.defs | 25 ++++ examples/xedge_demo/Makefile | 33 +++++ examples/xedge_demo/xedge_main.c | 240 +++++++++++++++++++++++++++++++ netutils/xedge/.gitignore | 3 + netutils/xedge/Kconfig | 23 +++ netutils/xedge/Make.defs | 35 +++++ netutils/xedge/Makefile | 95 ++++++++++++ 8 files changed, 495 insertions(+) create mode 100644 examples/xedge_demo/Kconfig create mode 100644 examples/xedge_demo/Make.defs create mode 100644 examples/xedge_demo/Makefile create mode 100644 examples/xedge_demo/xedge_main.c create mode 100644 netutils/xedge/.gitignore create mode 100644 netutils/xedge/Kconfig create mode 100644 netutils/xedge/Make.defs create mode 100644 netutils/xedge/Makefile diff --git a/examples/xedge_demo/Kconfig b/examples/xedge_demo/Kconfig new file mode 100644 index 00000000000..9bc02d0fadf --- /dev/null +++ b/examples/xedge_demo/Kconfig @@ -0,0 +1,41 @@ +# +# For a description of the syntax of this configuration file, +# see the file kconfig-language.txt in the NuttX tools repository. +# + +config EXAMPLES_XEDGE_DEMO + tristate "Xedge IoT Toolkit Demo" + depends on NETUTILS_XEDGE && ALLOW_GPL_COMPONENTS + default n + ---help--- + Simple demonstration of the Xedge IoT Toolkit library. + + This example shows how to integrate and use the Xedge library + in your NuttX application. Xedge provides a high-level development + environment for creating IoT and industrial device applications + using Lua scripting with access to HTTP(S), WebSockets, MQTT, + file system, and device I/O. + + Note: This example requires the NETUTILS_XEDGE library to be enabled. + +if EXAMPLES_XEDGE_DEMO + +config EXAMPLES_XEDGE_DEMO_PROGNAME + string "Program name" + default "xedge_demo" + ---help--- + This is the name of the ELF executable for the Xedge demo application in NSH. + +config EXAMPLES_XEDGE_DEMO_PRIORITY + int "Xedge demo task priority" + default 100 + ---help--- + Set the task priority for the Xedge demo application. + +config EXAMPLES_XEDGE_DEMO_STACKSIZE + int "Xedge demo stack size" + default 20000 + ---help--- + Set the stack size for the Xedge demo application. + +endif diff --git a/examples/xedge_demo/Make.defs b/examples/xedge_demo/Make.defs new file mode 100644 index 00000000000..1f9464a5ba3 --- /dev/null +++ b/examples/xedge_demo/Make.defs @@ -0,0 +1,25 @@ +############################################################################ +# apps/examples/xedge_demo/Make.defs +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +ifneq ($(CONFIG_EXAMPLES_XEDGE_DEMO),) +CONFIGURED_APPS += $(APPDIR)/examples/xedge_demo +endif \ No newline at end of file diff --git a/examples/xedge_demo/Makefile b/examples/xedge_demo/Makefile new file mode 100644 index 00000000000..720c880004b --- /dev/null +++ b/examples/xedge_demo/Makefile @@ -0,0 +1,33 @@ +# ############################################################################## +# apps/examples/xedge_demo/CMakeLists.txt +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + + +include $(APPDIR)/Make.defs + +PROGNAME = $(CONFIG_EXAMPLES_XEDGE_DEMO_PROGNAME) +PRIORITY = $(CONFIG_EXAMPLES_XEDGE_DEMO_PRIORITY) +STACKSIZE = $(CONFIG_EXAMPLES_XEDGE_DEMO_STACKSIZE) +MODULE = $(CONFIG_EXAMPLES_XEDGE_DEMO) + +MAINSRC = xedge_main.c + +include $(APPDIR)/Application.mk \ No newline at end of file diff --git a/examples/xedge_demo/xedge_main.c b/examples/xedge_demo/xedge_main.c new file mode 100644 index 00000000000..b0c2c56c65e --- /dev/null +++ b/examples/xedge_demo/xedge_main.c @@ -0,0 +1,240 @@ +/*************************************************************************** + * apps/examples/xedge_demo/xedge_main.c + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ***************************************************************************/ + +/* Xedge NuttX Startup Code (may need adjustments) + * + * Additional License Note: Xedge, based on the Barracuda + * App Server, uses the license options explained here: + * https://github.com/RealTimeLogic/BAS#license + * This repo does not include Xedge and the Barracuda App Server + * library and must be downloaded separately. The dependencies + * are automatically downloaded in apps/netutils/xedge/. + */ + +/*************************************************************************** + * Included Files + ***************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "../../netutils/xedge/BAS/examples/xedge/src/xedge.h" + +/*************************************************************************** + * Pre-processor Definitions + ***************************************************************************/ + +/* The code uses identifiers from the third-party Barracuda App Server + * library, which follows a camelCase naming style: + * https://realtimelogic.com/ba/doc/en/C/introduction.html#oo_c + * These identifiers are used directly and will trigger "Mixed Case" + * warnings in tools like nxstyle, which are safe to ignore in this case. + */ + +/*************************************************************************** + * Private Data + ***************************************************************************/ + +static int running = FALSE; /* Running mode: 2 running, 1 exiting, 0 stopped */ + +/* BAS is configured to use dlmalloc for NuttX. This is the pool. + * 2M : recommended minimum + */ + +static char poolbuf[2 * 1024 * 1024]; + +extern LThreadMgr ltMgr; /* The LThreadMgr configured in xedge.c */ + +/*************************************************************************** + * External Function Prototypes + ***************************************************************************/ + +/* barracuda(): BAS/examples/xedge/src/xedge.c */ + +extern void barracuda(void); +extern void init_dlmalloc(char *heapstart, char *heapend); /* dlmalloc.c */ +extern int (*platformInitDiskIo)(DiskIo *io); /* xedge.c */ + +/*************************************************************************** + * Private Functions + ***************************************************************************/ + +/* The following two functions are copied from the example: + * https://github.com/RealTimeLogic/BAS/blob/main/examples/xedge/src/led.c + * Details: + * https://realtimelogic.com/ba/examples/xedge/readme.html#time + */ + +/* This callback is called by one of the threads managed by LThreadMgr + * when a job is taken off the queue and executed. The callback + * attempts to find the global Lua function '_XedgeEvent', and if the + * function is found, it will be executed as follows: _XedgeEvent("sntp") + */ + +static void execevent(ThreadJob *job, int msgh, LThreadMgr *mgr) +{ + lua_State *L = job->Lt; + lua_pushglobaltable(L); + lua_getfield(L, -1, "_XedgeEvent"); + + if (lua_isfunction(L, -1)) + { + lua_pushstring(L, "sntp"); + lua_pcall(L, 1, 0, msgh); + } +} + +/* Thread started by xedgeOpenAUX() */ + +static void *checktimethread(void *arg) +{ + ThreadMutex *dm = HttpServer_getMutex(ltMgr.server); + const char *d = __DATE__; + char buf[50]; + + (void)arg; + + if (!(basnprintf(buf, sizeof(buf), "Mon, %c%c %c%c%c %s %s", + d[4], d[5], d[0], d[1], d[2], d + 7, __TIME__) < 0)) + { + BaTime t = baParseDate(buf); + if (t) + { + t -= 24 * 60 * 60; + while (baGetUnixTime() < t) + { + Thread_sleep(500); + } + + ThreadJob *job = ThreadJob_lcreate(sizeof(ThreadJob), execevent); + ThreadMutex_set(dm); + LThreadMgr_run(<Mgr, job); + ThreadMutex_release(dm); + } + } + + return NULL; +} + +static void panic(BaFatalErrorCodes ecode1, + unsigned int ecode2, + const char *file, + int line) +{ + syslog(LOG_ERR, "Fatal error in Barracuda %d %d %s %d\n", + ecode1, ecode2, file, line); + exit(1); +} + +/* Redirect server's HttpTrace to syslog. + * https://realtimelogic.com/ba/doc/en/C/reference/html/structHttpTrace.html + */ + +static void flushtrace(char *buf, int buflen) +{ + buf[buflen] = 0; + syslog(LOG_INFO, "%s", buf); +} + +static void sighandler(int signo) +{ + if (running) + { + printf("\nGot SIGTERM; exiting...\n"); + setDispExit(); + + /* NuttX feature: Must wait for socket select() to return */ + + Thread_sleep(2000); + } +} + +/*************************************************************************** + * Public Functions + ***************************************************************************/ + +/* xedge.c calls this to initialize the IO. + * Change "/mnt/lfs" to your preference. + */ + +int xedgeInitDiskIo(DiskIo *io) +{ + if (DiskIo_setRootDir(io, "/mnt/lfs")) + { + syslog(LOG_ERR, "Error: cannot set root to /mnt/lfs\n"); + return -1; + } + + return 0; +} + +/* xedge.c calls this; include your Lua bindings here. + * Tutorial: https://tutorial.realtimelogic.com/Lua-Bindings.lsp + */ + +int xedgeOpenAUX(XedgeOpenAUX *aux) +{ + pthread_t thread; + pthread_attr_t attr; + struct sched_param param; + + (void)aux; + + pthread_attr_init(&attr); + pthread_attr_setstacksize(&attr, 4096); + param.sched_priority = SCHED_PRIORITY_DEFAULT; + pthread_attr_setschedparam(&attr, ¶m); + pthread_create(&thread, &attr, checktimethread, NULL); + + return 0; +} + +int main(int argc, FAR char *argv[]) +{ + if (running) + { + printf("Already running!\n"); + return 1; + } + + signal(SIGINT, sighandler); + signal(SIGTERM, sighandler); + + ntpc_start(); + init_dlmalloc(poolbuf, poolbuf + sizeof(poolbuf)); + HttpTrace_setFLushCallback(flushtrace); + HttpServer_setErrHnd(panic); + + running = TRUE; + barracuda(); + running = FALSE; + + printf("Exiting Xedge\n"); + return 0; +} diff --git a/netutils/xedge/.gitignore b/netutils/xedge/.gitignore new file mode 100644 index 00000000000..adfe77e1622 --- /dev/null +++ b/netutils/xedge/.gitignore @@ -0,0 +1,3 @@ +/BAS +/BAS-Resources +/*.o diff --git a/netutils/xedge/Kconfig b/netutils/xedge/Kconfig new file mode 100644 index 00000000000..42bc72e1c79 --- /dev/null +++ b/netutils/xedge/Kconfig @@ -0,0 +1,23 @@ +# +# For a description of the syntax of this configuration file, +# see the file kconfig-language.txt in the NuttX tools repository. +# + +config NETUTILS_XEDGE + tristate "Xedge IoT Toolkit Dependencies" + depends on ALLOW_GPL_COMPONENTS + default n + ---help--- + Download and prepare Xedge IoT Toolkit dependencies (BAS and BAS-Resources). + + Xedge is an embedded software toolkit designed to enable high-level developers + (e.g., web and Lua programmers) to create sophisticated, secure IoT and industrial + device applications. It abstracts low-level embedded development through a lightweight + runtime built on top of the Barracuda App Server and Lua. + + This option will download the required Barracuda App Server and BAS-Resources + repositories during the build process, making them available for applications + that want to use Xedge. + + After enabling this, you can use the examples/xedge_demo as a reference + for integrating Xedge into your own applications. \ No newline at end of file diff --git a/netutils/xedge/Make.defs b/netutils/xedge/Make.defs new file mode 100644 index 00000000000..1674dad01e8 --- /dev/null +++ b/netutils/xedge/Make.defs @@ -0,0 +1,35 @@ +############################################################################ +# apps/netutils/xedge/Make.defs +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +ifneq ($(CONFIG_NETUTILS_XEDGE),) + +CONFIGURED_APPS += $(APPDIR)/netutils/xedge + +CFLAGS += ${INCDIR_PREFIX}$(APPDIR)/netutils/xedge/BAS/inc +CFLAGS += ${INCDIR_PREFIX}$(APPDIR)/netutils/xedge/BAS/inc/arch/Posix +CFLAGS += ${INCDIR_PREFIX}$(APPDIR)/netutils/xedge/BAS/inc/arch/NET/Posix + +CFLAGS += -DNO_INIT_DISK_IO +CFLAGS += -DUSE_DBGMON=1 +CFLAGS += -DUSE_IPV6 + +endif \ No newline at end of file diff --git a/netutils/xedge/Makefile b/netutils/xedge/Makefile new file mode 100644 index 00000000000..f45c8a3aa25 --- /dev/null +++ b/netutils/xedge/Makefile @@ -0,0 +1,95 @@ +############################################################################ +# apps/netutils/xedge/Makefile +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +include $(APPDIR)/Make.defs + +BAS_UNPACKNAME = BAS +BAS_HASH = 9f74a2f778b002ad8441471b8a7a5b13172dbe76 +BAS_RESOURCES_UNPACKNAME = BAS-Resources +BAS_RESOURCES_HASH = 227a4b998300fa4cfde871dc7dac92c09e1636c2 + +BAS_ZIP_URL = https://github.com/RealTimeLogic/BAS/archive/$(BAS_HASH).zip +BAS_RESOURCES_ZIP_URL = https://github.com/RealTimeLogic/BAS-Resources/archive/$(BAS_RESOURCES_HASH).zip + +XEDGEZIP = BAS/examples/xedge/XedgeZip.c + +BAS_SRC = $(BAS_UNPACKNAME)$(DELIM)src +BAS_ARCH_SRC = $(BAS_SRC)$(DELIM)arch$(DELIM)Posix +BAS_NET_SRC = $(BAS_SRC)$(DELIM)arch$(DELIM)NET$(DELIM)generic +BAS_DISKIO_SRC = $(BAS_SRC)$(DELIM)DiskIo$(DELIM)posix +BAS_XEDGE_SRC = $(BAS_UNPACKNAME)$(DELIM)examples$(DELIM)xedge$(DELIM)src + +VPATH += $(BAS_SRC) +VPATH += $(BAS_ARCH_SRC) +VPATH += $(BAS_NET_SRC) +VPATH += $(BAS_DISKIO_SRC) +VPATH += $(BAS_XEDGE_SRC) +VPATH += $(BAS_UNPACKNAME)/examples/xedge + +CSRCS = BAS.c dlmalloc.c ThreadLib.c SoDisp.c BaFile.c xedge.c XedgeZip.c + +# Download and prepare BAS and BAS-Resources +xedge-deps: + # ############################################################################ + # Config and Fetch xedge + # ############################################################################ + + @if [ ! -d $(BAS_UNPACKNAME) ]; then \ + echo "Downloading BAS from hash $(BAS_HASH)..."; \ + curl -f -L $(BAS_ZIP_URL) -o bas-temp.zip || \ + (echo "Error downloading BAS"; exit 1); \ + unzip -q bas-temp.zip; \ + mv BAS-$(BAS_HASH) $(BAS_UNPACKNAME); \ + rm -f bas-temp.zip; \ + fi + + @if [ ! -d $(BAS_RESOURCES_UNPACKNAME) ]; then \ + echo "Downloading BAS-Resources from hash $(BAS_RESOURCES_HASH)..."; \ + curl -f -L $(BAS_RESOURCES_ZIP_URL) -o resources-temp.zip || \ + (echo "Error downloading BAS-Resources"; exit 1); \ + unzip -q resources-temp.zip; \ + mv BAS-Resources-$(BAS_RESOURCES_HASH) $(BAS_RESOURCES_UNPACKNAME); \ + rm -f resources-temp.zip; \ + fi + + # ############################################################################ + # Library Configuration + # ############################################################################ + + @if [ ! -f "$(XEDGEZIP)" ]; then \ + echo "Creating XedgeZip.c"; \ + cd $(BAS_RESOURCES_UNPACKNAME)/build/ && \ + printf "n\nl\nn\n" | bash Xedge.sh > /dev/null && \ + cp XedgeZip.c ../../$(BAS_UNPACKNAME)/examples/xedge/ || exit 1; \ + fi + +$(CSRCS:.c=$(OBJEXT)): xedge-deps + +ifeq ($(wildcard $(BAS_UNPACKNAME)/.git),) +distclean:: xedge-deps + $(call DELDIR, $(BAS_UNPACKNAME)) + $(call DELDIR, $(BAS_RESOURCES_UNPACKNAME)) + +context:: xedge-deps +endif + +include $(APPDIR)/Application.mk \ No newline at end of file From beacf792faade4e320f43acfe7560ae9079615b1 Mon Sep 17 00:00:00 2001 From: Michal Lenc Date: Thu, 17 Jul 2025 17:12:27 +0200 Subject: [PATCH 361/391] boot/nxboot/loader/flash.c: open partition with O_DIRECT flag There is no need to use buffers in a bootloader. We expect a sequential access, therefore we just need to erase the erase page before writing to it for the first time, which is something FTL layer already takes care of. Signed-off-by: Michal Lenc --- boot/nxboot/loader/flash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boot/nxboot/loader/flash.c b/boot/nxboot/loader/flash.c index fdbab4bb99d..9142b25d9f0 100644 --- a/boot/nxboot/loader/flash.c +++ b/boot/nxboot/loader/flash.c @@ -64,7 +64,7 @@ int flash_partition_open(const char *path) { int fd; - fd = open(path, O_RDWR); + fd = open(path, O_RDWR | O_DIRECT); if (fd < 0) { syslog(LOG_ERR, "Could not open %s partition: %s\n", From 8fbba09895a9d47962c076e81431af94889b39d6 Mon Sep 17 00:00:00 2001 From: Michal Lenc Date: Thu, 17 Jul 2025 17:14:15 +0200 Subject: [PATCH 362/391] boot/nxboot/loader/boot.c: copy partition with blocksize large writes The previous logic MAX(info_from.blocksize, info_where.blocksize) was incorrect. The most effective access with by writing the entire size of the block, therefore just decide the size based on the target page size. Signed-off-by: Michal Lenc --- boot/nxboot/loader/boot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boot/nxboot/loader/boot.c b/boot/nxboot/loader/boot.c index 9364ba16f94..42f83a66e2e 100644 --- a/boot/nxboot/loader/boot.c +++ b/boot/nxboot/loader/boot.c @@ -164,7 +164,7 @@ static int copy_partition(int from, int where, struct nxboot_state *state, #ifdef CONFIG_NXBOOT_PRINTF_PROGRESS_PERCENT total_size = remain * 100; #endif - blocksize = MAX(info_from.blocksize, info_where.blocksize); + blocksize = info_where.blocksize; buf = malloc(blocksize); if (!buf) From 4ecdb92e61aa241a9f63cea5e12bf5bbe3fd8cfa Mon Sep 17 00:00:00 2001 From: jingfei Date: Sun, 13 Jul 2025 22:05:22 +0800 Subject: [PATCH 363/391] examples/mtdpart:Register MTD devices using the mtd_register method 1. Due to the automatic wrapping of MTD devices during the open() process, the legacy registration methods ftl_initialize() and bchdev_register() are no longer required for MTD device registration. The new method is now changed to register_mtddriver 2. Some code for space release and deregistration has been added, and certain error handling methods have been updated. --- examples/mtdpart/mtdpart_main.c | 213 +++++++++++++++----------------- 1 file changed, 97 insertions(+), 116 deletions(-) diff --git a/examples/mtdpart/mtdpart_main.c b/examples/mtdpart/mtdpart_main.c index 9b4496e9164..35ba65ce73f 100644 --- a/examples/mtdpart/mtdpart_main.c +++ b/examples/mtdpart/mtdpart_main.c @@ -89,18 +89,14 @@ # define CONFIG_EXAMPLES_MTDPART_NPARTITIONS 3 #endif +#if CONFIG_EXAMPLES_MTDPART_NPARTITIONS <= 0 +# error "CONFIG_EXAMPLES_MTDPART_NPARTITIONS must be greater than 0" +#endif + /**************************************************************************** * Private Types ****************************************************************************/ -struct mtdpart_filedesc_s -{ - FAR char *name; - bool deleted; - size_t len; - uint32_t crc; -}; - /**************************************************************************** * Private Data ****************************************************************************/ @@ -117,6 +113,7 @@ static uint8_t g_simflash[MTDPART_BUFSIZE]; #ifdef CONFIG_EXAMPLES_MTDPART_ARCHINIT extern FAR struct mtd_dev_s *mtdpart_archinitialize(void); +extern void mtdpart_archuninitialize(FAR struct mtd_dev_s *dev); #endif /**************************************************************************** @@ -133,8 +130,7 @@ int main(int argc, FAR char *argv[]) FAR struct mtd_dev_s *part[CONFIG_EXAMPLES_MTDPART_NPARTITIONS + 1]; FAR struct mtd_geometry_s geo; FAR uint32_t *buffer; - char blockname[32]; - char charname[32]; + char mtdname[32]; size_t partsize; ssize_t nbytes; off_t nblocks; @@ -148,6 +144,7 @@ int main(int argc, FAR char *argv[]) int j; int k; int ret; + int status; /* Create and initialize a RAM MTD FLASH driver instance */ @@ -159,8 +156,8 @@ int main(int argc, FAR char *argv[]) if (!master) { printf("ERROR: Failed to create RAM MTD instance\n"); - fflush(stdout); - exit(1); + status = 1; + exit(status); } /* Perform the IOCTL to erase the entire FLASH part */ @@ -179,22 +176,12 @@ int main(int argc, FAR char *argv[]) * interesting. */ - ret = ftl_initialize(0, master); - if (ret < 0) - { - printf("ERROR: ftl_initialize /dev/mtdblock0 failed: %d\n", ret); - fflush(stdout); - exit(2); - } - - /* Now create a character device on the block device */ - - ret = bchdev_register("/dev/mtdblock0", "/dev/mtd0", false); + ret = register_mtddriver("/dev/mtd0", master, 0775, NULL); if (ret < 0) { - printf("ERROR: bchdev_register /dev/mtd0 failed: %d\n", ret); - fflush(stdout); - exit(3); + printf("ERROR: register_mtddriver /dev/mtd0 failed: %d\n", ret); + status = 2; + goto err_master_mtd; } /* Get the geometry of the FLASH device */ @@ -203,8 +190,9 @@ int main(int argc, FAR char *argv[]) (unsigned long)((uintptr_t)&geo)); if (ret < 0) { - ferr("ERROR: mtd->ioctl failed: %d\n", ret); - exit(3); + printf("ERROR: mtd->ioctl failed: %d\n", ret); + status = 3; + goto err_master_mtd; } printf("Flash Geometry:\n"); @@ -244,33 +232,18 @@ int main(int argc, FAR char *argv[]) { printf("ERROR: mtd_partition failed. offset=%lu nblocks=%lu\n", (unsigned long)offset, (unsigned long)nblocks); - fflush(stdout); - exit(4); - } - - /* Initialize to provide an FTL block driver on the MTD FLASH - * interface - */ - - snprintf(blockname, sizeof(blockname), "/dev/mtdblock%d", i); - snprintf(charname, sizeof(charname), "/dev/mtd%d", i); - - ret = ftl_initialize(i, part[i]); - if (ret < 0) - { - printf("ERROR: ftl_initialize %s failed: %d\n", blockname, ret); - fflush(stdout); - exit(5); + status = 4; + goto err_part_mtd; } - /* Now create a character device on the block device */ + snprintf(mtdname, sizeof(mtdname), "/dev/mtd%d", i); - ret = bchdev_register(blockname, charname, false); + ret = register_mtddriver(mtdname, part[i], 0775, NULL); if (ret < 0) { - printf("ERROR: bchdev_register %s failed: %d\n", charname, ret); - fflush(stdout); - exit(6); + printf("ERROR: register_mtddriver %s failed: %d\n", mtdname, ret); + status = 5; + goto err_part_mtd; } } @@ -280,8 +253,8 @@ int main(int argc, FAR char *argv[]) if (!buffer) { printf("ERROR: failed to allocate a sector buffer\n"); - fflush(stdout); - exit(7); + status = 6; + goto err_part_mtd; } /* Open the master MTD FLASH character driver for writing */ @@ -290,8 +263,8 @@ int main(int argc, FAR char *argv[]) if (fd < 0) { printf("ERROR: open /dev/mtd0 failed: %d\n", errno); - fflush(stdout); - exit(8); + status = 7; + goto err_buf; } /* Now write the offset into every block */ @@ -317,8 +290,8 @@ int main(int argc, FAR char *argv[]) if (nbytes < 0) { printf("ERROR: write to /dev/mtd0 failed: %d\n", errno); - fflush(stdout); - exit(9); + status = 8; + goto err_fd; } } } @@ -338,13 +311,13 @@ int main(int argc, FAR char *argv[]) /* Open the master MTD partition character driver for writing */ - snprintf(charname, sizeof(charname), "/dev/mtd%d", i); - fd = open(charname, O_RDWR); + snprintf(mtdname, sizeof(mtdname), "/dev/mtd%d", i); + fd = open(mtdname, O_RDWR); if (fd < 0) { - printf("ERROR: open %s failed: %d\n", charname, errno); - fflush(stdout); - exit(10); + printf("ERROR: open %s failed: %d\n", mtdname, errno); + status = 9; + goto err_buf; } /* Now verify the offset in every block */ @@ -364,8 +337,8 @@ int main(int argc, FAR char *argv[]) { printf("ERROR: lseek to offset %ld failed: %d\n", (unsigned long)sectoff, errno); - fflush(stdout); - exit(11); + status = 10; + goto err_fd; } /* Read the next block into memory */ @@ -373,22 +346,9 @@ int main(int argc, FAR char *argv[]) nbytes = read(fd, buffer, geo.blocksize); if (nbytes < 0) { - printf("ERROR: read from %s failed: %d\n", charname, errno); - fflush(stdout); - exit(12); - } - else if (nbytes == 0) - { - printf("ERROR: Unexpected end-of file in %s\n", charname); - fflush(stdout); - exit(13); - } - else if (nbytes != geo.blocksize) - { - printf("ERROR: Unexpected read size from %s: %ld\n", - charname, (unsigned long)nbytes); - fflush(stdout); - exit(14); + printf("ERROR: read from %s failed: %d\n", mtdname, errno); + status = 11; + goto err_fd; } /* Since we forced the size of the partition to be an even number @@ -398,19 +358,19 @@ int main(int argc, FAR char *argv[]) else if (nbytes == 0) { - printf("ERROR: Unexpected end of file on %s\n", charname); - fflush(stdout); - exit(15); + printf("ERROR: Unexpected end of file on %s\n", mtdname); + status = 12; + goto err_fd; } /* This is not expected at all */ else if (nbytes != geo.blocksize) { - printf("ERROR: Short read from %s failed: %lu\n", - charname, (unsigned long)nbytes); - fflush(stdout); - exit(16); + printf("ERROR: Short read from %s failed: %lu\n", + mtdname, (unsigned long)nbytes); + status = 13; + goto err_fd; } /* Verify the offsets in the block */ @@ -421,8 +381,8 @@ int main(int argc, FAR char *argv[]) { printf("ERROR: Bad offset %lu, expected %lu\n", (long)buffer[k], (long)check); - fflush(stdout); - exit(17); + status = 14; + goto err_fd; } /* Invert the value to indicate that we have verified @@ -440,8 +400,8 @@ int main(int argc, FAR char *argv[]) { printf("ERROR: lseek to offset %ld failed: %d\n", (unsigned long)sectoff, errno); - fflush(stdout); - exit(18); + status = 15; + goto err_fd; } /* Now write the block back to FLASH with the modified value */ @@ -449,16 +409,16 @@ int main(int argc, FAR char *argv[]) nbytes = write(fd, buffer, geo.blocksize); if (nbytes < 0) { - printf("ERROR: write to %s failed: %d\n", charname, errno); - fflush(stdout); - exit(19); + printf("ERROR: write to %s failed: %d\n", mtdname, errno); + status = 16; + goto err_fd; } else if (nbytes != geo.blocksize) { printf("ERROR: Unexpected write size to %s: %ld\n", - charname, (unsigned long)nbytes); - fflush(stdout); - exit(20); + mtdname, (unsigned long)nbytes); + status = 17; + goto err_fd; } /* Get the offset to the next block */ @@ -472,15 +432,15 @@ int main(int argc, FAR char *argv[]) if (nbytes != 0) { printf("ERROR: Expected end-of-file from %s failed: %zd %d\n", - charname, nbytes, errno); - fflush(stdout); - exit(22); + mtdname, nbytes, errno); + status = 18; + goto err_fd; } close(fd); } - /* Now verify that all of the verifed blocks appear where we thing they + /* Now verify that all of the verified blocks appear where we thing they * should on the device. */ @@ -490,8 +450,8 @@ int main(int argc, FAR char *argv[]) if (fd < 0) { printf("ERROR: open /dev/mtd0 failed: %d\n", errno); - fflush(stdout); - exit(23); + status = 19; + goto err_buf; } offset = 0; @@ -504,22 +464,22 @@ int main(int argc, FAR char *argv[]) nbytes = read(fd, buffer, geo.blocksize); if (nbytes < 0) { - printf("ERROR: read from %s failed: %d\n", charname, errno); - fflush(stdout); - exit(24); + printf("ERROR: read from /dev/mtd0 failed: %d\n", errno); + status = 20; + goto err_fd; } else if (nbytes == 0) { - printf("ERROR: Unexpected end-of file in %s\n", charname); - fflush(stdout); - exit(25); + printf("ERROR: Unexpected end-of file in /dev/mtd0\n"); + status = 21; + goto err_fd; } else if (nbytes != geo.blocksize) { - printf("ERROR: Unexpected read size from %s: %ld\n", - charname, (unsigned long)nbytes); - fflush(stdout); - exit(26); + printf("ERROR: Unexpected read size from /dev/mtd0: %ld\n", + (unsigned long)nbytes); + status = 22; + goto err_fd; } /* Verify the values in the block */ @@ -530,19 +490,40 @@ int main(int argc, FAR char *argv[]) { printf("ERROR: Bad value %lu, expected %lu\n", (long)buffer[k], (long)(~check)); - fflush(stdout); - exit(27); + status = 23; + goto err_fd; } check += sizeof(uint32_t); } } - close(fd); + status = 0; /* And exit without bothering to clean up */ printf("PASS: Everything looks good\n"); + +err_fd: + close(fd); + +err_buf: + free(buffer); + +err_part_mtd: + for (i = 1; i <= CONFIG_EXAMPLES_MTDPART_NPARTITIONS; i++) + { + snprintf(mtdname, sizeof(mtdname), "/dev/mtd%d", i); + unregister_mtddriver(mtdname); + } + +err_master_mtd: + unregister_mtddriver("/dev/mtd0"); +#ifdef CONFIG_EXAMPLES_MTDPART_ARCHINIT + mtdpart_archuninitialize(master); +#else + rammtd_uninitialize(master); +#endif fflush(stdout); - return 0; + exit(status); } From 08fdbb03bb973d8b194f1ee420d662d27434170f Mon Sep 17 00:00:00 2001 From: makejian Date: Mon, 28 Jul 2025 15:25:20 +0800 Subject: [PATCH 364/391] mbedtls-alt: aligned alternative implementation return value with mbedtls mbedtls interfaces overwritten by nuttx crypto driver, change return value of mbedtls interfaces from return value of nuttx crypto driver into starndard return value of mbedtls Signed-off-by: makejian --- crypto/mbedtls/source/cmac_alt.c | 12 +++++++++++- crypto/mbedtls/source/poly1305_alt.c | 19 +++++++++++++++++-- crypto/mbedtls/source/sha1_alt.c | 19 +++++++++++++++++-- crypto/mbedtls/source/sha256_alt.c | 24 ++++++++++++++++++++++-- crypto/mbedtls/source/sha512_alt.c | 24 ++++++++++++++++++++++-- 5 files changed, 89 insertions(+), 9 deletions(-) diff --git a/crypto/mbedtls/source/cmac_alt.c b/crypto/mbedtls/source/cmac_alt.c index a72ef94b02b..c17d4ebdc89 100644 --- a/crypto/mbedtls/source/cmac_alt.c +++ b/crypto/mbedtls/source/cmac_alt.c @@ -107,7 +107,12 @@ int mbedtls_cipher_cmac_update(FAR mbedtls_cipher_context_t *ctx, ctx->cmac_ctx->dev.crypt.flags |= COP_FLAG_UPDATE; ctx->cmac_ctx->dev.crypt.src = (caddr_t)input; ctx->cmac_ctx->dev.crypt.len = ilen; - return cryptodev_crypt(&ctx->cmac_ctx->dev); + if (cryptodev_crypt(&ctx->cmac_ctx->dev) != 0) + { + return MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA; + } + + return 0; } int mbedtls_cipher_cmac_finish(FAR mbedtls_cipher_context_t *ctx, @@ -123,6 +128,11 @@ int mbedtls_cipher_cmac_finish(FAR mbedtls_cipher_context_t *ctx, ctx->cmac_ctx->dev.crypt.flags = 0; ctx->cmac_ctx->dev.crypt.mac = (caddr_t)output; ret = cryptodev_crypt(&ctx->cmac_ctx->dev); + if (ret != 0) + { + ret = MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA; + } + cryptodev_free_session(&ctx->cmac_ctx->dev); cryptodev_free(&ctx->cmac_ctx->dev); return ret; diff --git a/crypto/mbedtls/source/poly1305_alt.c b/crypto/mbedtls/source/poly1305_alt.c index 7c0e8110f66..0df9ddf3ea9 100644 --- a/crypto/mbedtls/source/poly1305_alt.c +++ b/crypto/mbedtls/source/poly1305_alt.c @@ -46,7 +46,12 @@ int mbedtls_poly1305_starts(FAR mbedtls_poly1305_context *ctx, ctx->session.mac = CRYPTO_POLY1305; ctx->session.mackey = (caddr_t)key; ctx->session.mackeylen = 32; - return cryptodev_get_session(ctx); + if (cryptodev_get_session(ctx) != 0) + { + return MBEDTLS_ERR_POLY1305_BAD_INPUT_DATA; + } + + return 0; } int mbedtls_poly1305_update(FAR mbedtls_poly1305_context *ctx, @@ -57,7 +62,12 @@ int mbedtls_poly1305_update(FAR mbedtls_poly1305_context *ctx, ctx->crypt.flags |= COP_FLAG_UPDATE; ctx->crypt.src = (caddr_t)input; ctx->crypt.len = ilen; - return cryptodev_crypt(ctx); + if (cryptodev_crypt(ctx) != 0) + { + return MBEDTLS_ERR_POLY1305_BAD_INPUT_DATA; + } + + return 0; } int mbedtls_poly1305_finish(FAR mbedtls_poly1305_context *ctx, @@ -69,6 +79,11 @@ int mbedtls_poly1305_finish(FAR mbedtls_poly1305_context *ctx, ctx->crypt.flags = 0; ctx->crypt.mac = (caddr_t)mac; ret = cryptodev_crypt(ctx); + if (ret != 0) + { + ret = MBEDTLS_ERR_POLY1305_BAD_INPUT_DATA; + } + cryptodev_free_session(ctx); return ret; } diff --git a/crypto/mbedtls/source/sha1_alt.c b/crypto/mbedtls/source/sha1_alt.c index 8c3e6b353db..04e7c511a84 100644 --- a/crypto/mbedtls/source/sha1_alt.c +++ b/crypto/mbedtls/source/sha1_alt.c @@ -48,7 +48,12 @@ void mbedtls_sha1_free(FAR mbedtls_sha1_context *ctx) int mbedtls_sha1_starts(FAR mbedtls_sha1_context *ctx) { ctx->session.mac = CRYPTO_SHA1; - return cryptodev_get_session(ctx); + if (cryptodev_get_session(ctx) != 0) + { + return MBEDTLS_ERR_SHA1_BAD_INPUT_DATA; + } + + return 0; } int mbedtls_sha1_update(FAR mbedtls_sha1_context *ctx, @@ -59,7 +64,12 @@ int mbedtls_sha1_update(FAR mbedtls_sha1_context *ctx, ctx->crypt.flags |= COP_FLAG_UPDATE; ctx->crypt.src = (caddr_t)input; ctx->crypt.len = ilen; - return cryptodev_crypt(ctx); + if (cryptodev_crypt(ctx) != 0) + { + return MBEDTLS_ERR_SHA1_BAD_INPUT_DATA; + } + + return 0; } int mbedtls_sha1_finish(FAR mbedtls_sha1_context *ctx, @@ -71,6 +81,11 @@ int mbedtls_sha1_finish(FAR mbedtls_sha1_context *ctx, ctx->crypt.flags = 0; ctx->crypt.mac = (caddr_t)output; ret = cryptodev_crypt(ctx); + if (ret != 0) + { + ret = MBEDTLS_ERR_SHA1_BAD_INPUT_DATA; + } + cryptodev_free_session(ctx); return ret; } diff --git a/crypto/mbedtls/source/sha256_alt.c b/crypto/mbedtls/source/sha256_alt.c index 7b716acb869..4de03a342ca 100644 --- a/crypto/mbedtls/source/sha256_alt.c +++ b/crypto/mbedtls/source/sha256_alt.c @@ -47,6 +47,11 @@ void mbedtls_sha256_free(FAR mbedtls_sha256_context *ctx) int mbedtls_sha256_starts(FAR mbedtls_sha256_context *ctx, int is224) { + if (is224 != 0 && is224 != 1) + { + return MBEDTLS_ERR_SHA256_BAD_INPUT_DATA; + } + if (is224) { ctx->session.mac = CRYPTO_SHA2_224; @@ -56,7 +61,12 @@ int mbedtls_sha256_starts(FAR mbedtls_sha256_context *ctx, int is224) ctx->session.mac = CRYPTO_SHA2_256; } - return cryptodev_get_session(ctx); + if (cryptodev_get_session(ctx) != 0) + { + return MBEDTLS_ERR_SHA256_BAD_INPUT_DATA; + } + + return 0; } int mbedtls_sha256_update(FAR mbedtls_sha256_context *ctx, @@ -67,7 +77,12 @@ int mbedtls_sha256_update(FAR mbedtls_sha256_context *ctx, ctx->crypt.flags |= COP_FLAG_UPDATE; ctx->crypt.src = (caddr_t)input; ctx->crypt.len = ilen; - return cryptodev_crypt(ctx); + if (cryptodev_crypt(ctx) != 0) + { + return MBEDTLS_ERR_SHA256_BAD_INPUT_DATA; + } + + return 0; } int mbedtls_sha256_finish(FAR mbedtls_sha256_context *ctx, @@ -79,6 +94,11 @@ int mbedtls_sha256_finish(FAR mbedtls_sha256_context *ctx, ctx->crypt.flags = 0; ctx->crypt.mac = (caddr_t)output; ret = cryptodev_crypt(ctx); + if (ret != 0) + { + ret = MBEDTLS_ERR_SHA256_BAD_INPUT_DATA; + } + cryptodev_free_session(ctx); return ret; } diff --git a/crypto/mbedtls/source/sha512_alt.c b/crypto/mbedtls/source/sha512_alt.c index 2793b8426c1..4fb3ed85095 100644 --- a/crypto/mbedtls/source/sha512_alt.c +++ b/crypto/mbedtls/source/sha512_alt.c @@ -47,6 +47,11 @@ void mbedtls_sha512_free(FAR mbedtls_sha512_context *ctx) int mbedtls_sha512_starts(FAR mbedtls_sha512_context *ctx, int is384) { + if (is384 != 0 && is384 != 1) + { + return MBEDTLS_ERR_SHA512_BAD_INPUT_DATA; + } + if (is384) { ctx->session.mac = CRYPTO_SHA2_384; @@ -56,7 +61,12 @@ int mbedtls_sha512_starts(FAR mbedtls_sha512_context *ctx, int is384) ctx->session.mac = CRYPTO_SHA2_512; } - return cryptodev_get_session(ctx); + if (cryptodev_get_session(ctx) != 0) + { + return MBEDTLS_ERR_SHA512_BAD_INPUT_DATA; + } + + return 0; } int mbedtls_sha512_update(FAR mbedtls_sha512_context *ctx, @@ -67,7 +77,12 @@ int mbedtls_sha512_update(FAR mbedtls_sha512_context *ctx, ctx->crypt.flags |= COP_FLAG_UPDATE; ctx->crypt.src = (caddr_t)input; ctx->crypt.len = ilen; - return cryptodev_crypt(ctx); + if (cryptodev_crypt(ctx) != 0) + { + return MBEDTLS_ERR_SHA512_BAD_INPUT_DATA; + } + + return 0; } int mbedtls_sha512_finish(FAR mbedtls_sha512_context *ctx, @@ -79,6 +94,11 @@ int mbedtls_sha512_finish(FAR mbedtls_sha512_context *ctx, ctx->crypt.flags = 0; ctx->crypt.mac = (caddr_t)output; ret = cryptodev_crypt(ctx); + if (ret != 0) + { + ret = MBEDTLS_ERR_SHA512_BAD_INPUT_DATA; + } + cryptodev_free_session(ctx); return ret; } From 7506c026fa9ba3ab77403bd2b6a9969fe6b6bc2a Mon Sep 17 00:00:00 2001 From: Tim Hardisty <56726697+TimJTi@users.noreply.github.com> Date: Mon, 28 Jul 2025 14:57:23 +0100 Subject: [PATCH 365/391] nxboot/loader: Fix boot progress calculation. This patch corrects a mathematical error in the progress reporting function which caused incorrect percentage progress calculations. Signed-off-by: Tim Hardisty --- boot/nxboot/loader/boot.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/boot/nxboot/loader/boot.c b/boot/nxboot/loader/boot.c index 42f83a66e2e..f7a24c7cd34 100644 --- a/boot/nxboot/loader/boot.c +++ b/boot/nxboot/loader/boot.c @@ -162,7 +162,7 @@ static int copy_partition(int from, int where, struct nxboot_state *state, } #ifdef CONFIG_NXBOOT_PRINTF_PROGRESS_PERCENT - total_size = remain * 100; + total_size = remain; #endif blocksize = info_where.blocksize; @@ -227,7 +227,7 @@ static int copy_partition(int from, int where, struct nxboot_state *state, { #ifdef CONFIG_NXBOOT_PRINTF_PROGRESS_PERCENT nxboot_progress(nxboot_progress_percent, - ((total_size - remain) * 100) / total_size); + 100 - ((100 * remain) / total_size)); #else nxboot_progress(nxboot_progress_dot); #endif From 3ee6fdaf99c9abcc21564f177249e4deaf899fc4 Mon Sep 17 00:00:00 2001 From: George Poulios Date: Sat, 2 Aug 2025 07:52:00 +0300 Subject: [PATCH 366/391] tee/libteec: Remove downloaded zip file on distclean Initially, leaving the .zip around seemed like a good idea to avoid re-downloading often. But it turns out deleting downloaded packages during distclean is standard practice and some CI scripts depend on the git local copy being clean, including ignored files. Change also CMakeLists.txt to download the zip instead of the tarball. Signed-off-by: George Poulios --- tee/libteec/CMakeLists.txt | 4 +++- tee/libteec/Makefile | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tee/libteec/CMakeLists.txt b/tee/libteec/CMakeLists.txt index d748d5ad3cb..f94bb4b488a 100644 --- a/tee/libteec/CMakeLists.txt +++ b/tee/libteec/CMakeLists.txt @@ -24,9 +24,11 @@ if(CONFIG_LIBTEEC) set(OPTEE_CLIENT_DIR ${CMAKE_CURRENT_LIST_DIR}/optee_client) if(NOT EXISTS ${OPTEE_CLIENT_DIR}) + set(OPTEE_CLIENT_URL https://github.com/OP-TEE/optee_client/archive/refs/tags) + set(OPTEE_CLIENT_VER ${CONFIG_LIBTEEC_VERSION}) FetchContent_Declare( optee_client_fetch - URL https://github.com/OP-TEE/optee_client/archive/refs/tags/${CONFIG_LIBTEEC_VERSION}.tar.gz + URL ${OPTEE_CLIENT_URL}/${OPTEE_CLIENT_VER}.zip SOURCE_DIR ${OPTEE_CLIENT_DIR} BINARY_DIR diff --git a/tee/libteec/Makefile b/tee/libteec/Makefile index 1fe12a0df7d..df08a696c8e 100644 --- a/tee/libteec/Makefile +++ b/tee/libteec/Makefile @@ -46,7 +46,8 @@ ifeq ($(wildcard $(LIBTEEC_UNPACKNAME)/.git),) context:: $(LIBTEEC_UNPACKNAME) distclean:: - $(Q) rm -rf $(LIBTEEC_UNPACKNAME) + $(call DELDIR, $(LIBTEEC_UNPACKNAME)) + $(call DELFILE, $(LIBTEEC_ZIP)) endif include $(APPDIR)/Application.mk From caefd0de9f311fcc9d57942e21a351b7fd5391cf Mon Sep 17 00:00:00 2001 From: George Poulios Date: Sat, 2 Aug 2025 09:39:13 +0300 Subject: [PATCH 367/391] tee/libteec, examples/optee_gp: Fix cmake build Top level: - 'tee' subdirectory added to top-level CMakeLists.txt tee/libteec: - BINARY_PREFIX defined PUBLIC to make it accessible to consumer apps - added missing DEBUGLEVEL definitions examples/optee_gp: - added missing dependency to libteec Signed-off-by: George Poulios --- CMakeLists.txt | 1 + examples/optee_gp/CMakeLists.txt | 4 +++- tee/libteec/CMakeLists.txt | 22 ++++++++++++++++------ tee/libteec/Make.defs | 2 +- 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8641d690b2b..84844e70033 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,6 +66,7 @@ add_subdirectory(nshlib) add_subdirectory(platform) add_subdirectory(sdr) add_subdirectory(system) +add_subdirectory(tee) add_subdirectory(testing) add_subdirectory(videoutils) add_subdirectory(wireless) diff --git a/examples/optee_gp/CMakeLists.txt b/examples/optee_gp/CMakeLists.txt index 3e4d16f8724..4840c7d7e4d 100644 --- a/examples/optee_gp/CMakeLists.txt +++ b/examples/optee_gp/CMakeLists.txt @@ -29,5 +29,7 @@ if(CONFIG_EXAMPLES_OPTEE_GP) STACKSIZE ${CONFIG_EXAMPLES_OPTEE_GP_STACKSIZE} PRIORITY - ${CONFIG_EXAMPLES_OPTEE_GP_PRIORITY}) + ${CONFIG_EXAMPLES_OPTEE_GP_PRIORITY} + DEPENDS + libteec) endif() diff --git a/tee/libteec/CMakeLists.txt b/tee/libteec/CMakeLists.txt index f94bb4b488a..9fa59587b1d 100644 --- a/tee/libteec/CMakeLists.txt +++ b/tee/libteec/CMakeLists.txt @@ -24,14 +24,13 @@ if(CONFIG_LIBTEEC) set(OPTEE_CLIENT_DIR ${CMAKE_CURRENT_LIST_DIR}/optee_client) if(NOT EXISTS ${OPTEE_CLIENT_DIR}) - set(OPTEE_CLIENT_URL https://github.com/OP-TEE/optee_client/archive/refs/tags) + set(OPTEE_CLIENT_URL + https://github.com/OP-TEE/optee_client/archive/refs/tags) set(OPTEE_CLIENT_VER ${CONFIG_LIBTEEC_VERSION}) FetchContent_Declare( optee_client_fetch - URL ${OPTEE_CLIENT_URL}/${OPTEE_CLIENT_VER}.zip - SOURCE_DIR - ${OPTEE_CLIENT_DIR} - BINARY_DIR + URL ${OPTEE_CLIENT_URL}/${OPTEE_CLIENT_VER}.zip SOURCE_DIR + ${OPTEE_CLIENT_DIR} BINARY_DIR ${CMAKE_BINARY_DIR}/tee/libteec/optee_client PATCH_COMMAND patch -p1 -d ${OPTEE_CLIENT_DIR} < ${CMAKE_CURRENT_LIST_DIR}/0001-libteec-NuttX.patch @@ -56,6 +55,17 @@ if(CONFIG_LIBTEEC) optee_client/libteec/src/teec_trace.c) target_include_directories(libteec PRIVATE ${OPTEE_CLIENT_DIR}/libteec/include) - target_compile_definitions(libteec PRIVATE BINARY_PREFIX=\"TEEC\") + target_compile_definitions(libteec PUBLIC BINARY_PREFIX=\"TEEC\") + + if(CONFIG_DEBUG_INFO) + target_compile_definitions(libteec PUBLIC DEBUGLEVEL=3) + elseif(CONFIG_DEBUG_WARN) + target_compile_definitions(libteec PUBLIC DEBUGLEVEL=2) + elseif(CONFIG_DEBUG_ERROR) + target_compile_definitions(libteec PUBLIC DEBUGLEVEL=1) + else() + # the default DEBUGLEVEL is 1 (with error level) + target_compile_definitions(libteec PUBLIC DEBUGLEVEL=1) + endif() endif() diff --git a/tee/libteec/Make.defs b/tee/libteec/Make.defs index 5ac2332e615..2947d677bbf 100644 --- a/tee/libteec/Make.defs +++ b/tee/libteec/Make.defs @@ -32,7 +32,7 @@ else ifneq ($(CONFIG_DEBUG_WARN),) else ifneq ($(CONFIG_DEBUG_ERROR),) FLAGS += ${DEFINE_PREFIX}DEBUGLEVEL=1 else -# the default DEBUGLEVEL are 1(with error level) +# the default DEBUGLEVEL is 1 (with error level) FLAGS += ${DEFINE_PREFIX}DEBUGLEVEL=1 endif From c19c2a71f3773b19d7ad91ceba6d8d748d12be5f Mon Sep 17 00:00:00 2001 From: Jorge Guzman Date: Wed, 30 Jul 2025 14:18:53 -0300 Subject: [PATCH 368/391] netutils/xedge: refactor Makefile to use git clone instead of zip downloads Previous zip-based approach was failing in CI environment. Changed to use git clone with specific commit hashes to resolve CI build issues. Signed-off-by: Jorge Guzman --- netutils/xedge/Makefile | 70 +++++++++++++++++------------------------ 1 file changed, 29 insertions(+), 41 deletions(-) diff --git a/netutils/xedge/Makefile b/netutils/xedge/Makefile index f45c8a3aa25..2963614641c 100644 --- a/netutils/xedge/Makefile +++ b/netutils/xedge/Makefile @@ -22,13 +22,15 @@ include $(APPDIR)/Make.defs +# BAS configuration BAS_UNPACKNAME = BAS BAS_HASH = 9f74a2f778b002ad8441471b8a7a5b13172dbe76 +BAS_REPO_URL = https://github.com/RealTimeLogic/BAS.git + +# BAS-Resources configuration BAS_RESOURCES_UNPACKNAME = BAS-Resources BAS_RESOURCES_HASH = 227a4b998300fa4cfde871dc7dac92c09e1636c2 - -BAS_ZIP_URL = https://github.com/RealTimeLogic/BAS/archive/$(BAS_HASH).zip -BAS_RESOURCES_ZIP_URL = https://github.com/RealTimeLogic/BAS-Resources/archive/$(BAS_RESOURCES_HASH).zip +BAS_RESOURCES_REPO_URL = https://github.com/RealTimeLogic/BAS-Resources.git XEDGEZIP = BAS/examples/xedge/XedgeZip.c @@ -47,49 +49,35 @@ VPATH += $(BAS_UNPACKNAME)/examples/xedge CSRCS = BAS.c dlmalloc.c ThreadLib.c SoDisp.c BaFile.c xedge.c XedgeZip.c -# Download and prepare BAS and BAS-Resources -xedge-deps: - # ############################################################################ - # Config and Fetch xedge - # ############################################################################ - - @if [ ! -d $(BAS_UNPACKNAME) ]; then \ - echo "Downloading BAS from hash $(BAS_HASH)..."; \ - curl -f -L $(BAS_ZIP_URL) -o bas-temp.zip || \ - (echo "Error downloading BAS"; exit 1); \ - unzip -q bas-temp.zip; \ - mv BAS-$(BAS_HASH) $(BAS_UNPACKNAME); \ - rm -f bas-temp.zip; \ - fi - - @if [ ! -d $(BAS_RESOURCES_UNPACKNAME) ]; then \ - echo "Downloading BAS-Resources from hash $(BAS_RESOURCES_HASH)..."; \ - curl -f -L $(BAS_RESOURCES_ZIP_URL) -o resources-temp.zip || \ - (echo "Error downloading BAS-Resources"; exit 1); \ - unzip -q resources-temp.zip; \ - mv BAS-Resources-$(BAS_RESOURCES_HASH) $(BAS_RESOURCES_UNPACKNAME); \ - rm -f resources-temp.zip; \ - fi - - # ############################################################################ - # Library Configuration - # ############################################################################ - - @if [ ! -f "$(XEDGEZIP)" ]; then \ - echo "Creating XedgeZip.c"; \ - cd $(BAS_RESOURCES_UNPACKNAME)/build/ && \ +# Clone and setup BAS repository +$(BAS_UNPACKNAME): + $(Q) echo "Cloning BAS repository..." + $(Q) git clone $(BAS_REPO_URL) $(BAS_UNPACKNAME) + $(Q) cd $(BAS_UNPACKNAME) && git checkout $(BAS_HASH) + +# Clone and setup BAS-Resources repository +$(BAS_RESOURCES_UNPACKNAME): + $(Q) echo "Cloning BAS-Resources repository..." + $(Q) git clone $(BAS_RESOURCES_REPO_URL) $(BAS_RESOURCES_UNPACKNAME) + $(Q) cd $(BAS_RESOURCES_UNPACKNAME) && git checkout $(BAS_RESOURCES_HASH) + +# Create XedgeZip.c +$(XEDGEZIP): $(BAS_UNPACKNAME) $(BAS_RESOURCES_UNPACKNAME) + $(Q) echo "Creating XedgeZip.c..." + $(Q) cd $(BAS_RESOURCES_UNPACKNAME)/build/ && \ printf "n\nl\nn\n" | bash Xedge.sh > /dev/null && \ - cp XedgeZip.c ../../$(BAS_UNPACKNAME)/examples/xedge/ || exit 1; \ - fi + cp XedgeZip.c ../../$(BAS_UNPACKNAME)/examples/xedge/ + +xedge-deps: $(XEDGEZIP) $(CSRCS:.c=$(OBJEXT)): xedge-deps ifeq ($(wildcard $(BAS_UNPACKNAME)/.git),) -distclean:: xedge-deps - $(call DELDIR, $(BAS_UNPACKNAME)) - $(call DELDIR, $(BAS_RESOURCES_UNPACKNAME)) - context:: xedge-deps endif -include $(APPDIR)/Application.mk \ No newline at end of file +include $(APPDIR)/Application.mk + +distclean:: + $(call DELDIR, $(BAS_UNPACKNAME)) + $(call DELDIR, $(BAS_RESOURCES_UNPACKNAME)) \ No newline at end of file From 7cc7cb8ffae512cd72b0b123776cb925e7b6b3b0 Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Thu, 24 Jul 2025 20:00:50 +0800 Subject: [PATCH 369/391] system/uORB: Add flags for gnss satellite format Some applications require satellite information for positioning using the flag USED_IN_FIX. More details: https://github.com/apache/nuttx/pull/16805 Signed-off-by: wangjianyu3 --- system/uorb/sensor/gnss.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/system/uorb/sensor/gnss.c b/system/uorb/sensor/gnss.c index cf6b0003a15..18720cfb6aa 100644 --- a/system/uorb/sensor/gnss.c +++ b/system/uorb/sensor/gnss.c @@ -51,7 +51,8 @@ ",svid" #idx ":%" PRIu32 \ ",elevation" #idx ":%" PRIu32 \ ",azimuth" #idx ":%" PRIu32 \ - ",snr" #idx ":%" PRIu32 "" + ",snr" #idx ":%" PRIu32 \ + ",flags" #idx ":%" PRIx32 "" static const char sensor_gnss_format[] = UORB_DEBUG_FORMAT_SENSOR_GNSS ",firmware_version:%" PRIu32 ""; From 8d2a7e32a58e61e685a8a25b9c35c02f0bb949a9 Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Sun, 3 Aug 2025 00:45:59 +0800 Subject: [PATCH 370/391] nshlib: Add ppid support for command ps Add parent process ID support for command ps, get from "/proc//group/status:Parent". For example nsh> sh nsh> ps PID PPID GROUP CPU PRI POLICY TYPE NPX STATE EVENT SIGMASK STACK COMMAND ... ... 3 0 3 --- 100 RR Task - Waiting Signal 0000000000000000 0008136 nsh_main ... ... 9 3 9 0 100 RR Task - Running 0000000000000000 0004064 sh nsh> sleep 100 & sh [10:100] nsh> ps PID PPID GROUP CPU PRI POLICY TYPE NPX STATE EVENT SIGMASK STACK COMMAND ... ... 3 0 3 --- 100 RR Task - Waiting Signal 0000000000000000 0008136 nsh_main ... ... 9 3 9 0 100 RR Task - Running 0000000000000000 0004064 sh 10 9 10 --- 100 RR Task - Waiting Signal 0000000000000000 0004040 sh -c sleep Signed-off-by: wangjianyu3 --- nshlib/nsh_proccmds.c | 67 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 63 insertions(+), 4 deletions(-) diff --git a/nshlib/nsh_proccmds.c b/nshlib/nsh_proccmds.c index 8811357f55b..389ee71dbd6 100644 --- a/nshlib/nsh_proccmds.c +++ b/nshlib/nsh_proccmds.c @@ -25,6 +25,7 @@ ****************************************************************************/ #include +#include #include #include @@ -100,6 +101,7 @@ struct nsh_taskstatus_s #endif FAR char *td_cmdline; /* Command line */ int td_pid; /* Task ID */ + int td_ppid; /* Parent task ID */ #ifdef NSH_HAVE_CPULOAD FAR const char *td_cpuload; /* CPU load */ #endif @@ -141,6 +143,7 @@ static const char g_scheduler[] = "Scheduler:"; #ifndef CONFIG_NSH_DISABLE_PSSIGMASK static const char g_sigmask[] = "SigMask:"; #endif +static const char g_ppid[] = "Parent:"; # ifdef PS_SHOW_HEAPSIZE static const char g_heapsize[] = "AllocSize:"; # endif /* PS_SHOW_HEAPSIZE */ @@ -257,6 +260,28 @@ static void nsh_parse_statusline(FAR char *line, } #endif } + +static void nsh_parse_gstatusline(FAR char *line, + FAR struct nsh_taskstatus_s *status) +{ + /* Parse the group status. + * + * Format: + * + * 111111111122222222223 + * 123456789012345678901234567890 + * Main task: nnnnn PID + * Parent: nnnnn Parent PID + * Flags: 0x** Group flags, See GROUP_FLAG_* + * Members: nnnn... Count of members + * Member IDs: nnnnn,nnnnn,... List of members{PID0, PID1, ...) + */ + + if (strncmp(line, g_ppid, strlen(g_ppid)) == 0) + { + status->td_ppid = atoi(&line[12]); + } +} #endif /**************************************************************************** @@ -355,6 +380,7 @@ static int ps_record(FAR struct nsh_vtbl_s *vtbl, FAR const char *dirpath, #endif status->td_cmdline = ""; status->td_pid = atoi(entryp->d_name); + status->td_ppid = INVALID_PROCESS_ID; #ifdef NSH_HAVE_CPULOAD status->td_cpuload = ""; #endif @@ -395,6 +421,39 @@ static int ps_record(FAR struct nsh_vtbl_s *vtbl, FAR const char *dirpath, while (nextline != NULL); } + ret = ps_readprocfs(vtbl, "group/status", dirpath, entryp, status); + if (ret >= 0) + { + /* Parse the group status. */ + + nextline = status->td_buf + status->td_bufpos; + do + { + /* Find the beginning of the next line and NUL-terminate the + * current line. + */ + + line = nextline; + for (nextline++; + *nextline != '\n' && *nextline != '\0'; + nextline++); + + if (*nextline == '\n') + { + *nextline++ = '\0'; + } + else + { + nextline = NULL; + } + + /* Parse the current line */ + + nsh_parse_gstatusline(line, status); + } + while (nextline != NULL); + } + #ifdef PS_SHOW_HEAPSIZE if (heap) { @@ -553,7 +612,7 @@ static void ps_title(FAR struct nsh_vtbl_s *vtbl, bool heap) #endif nsh_output(vtbl, - "%5s %5s " + "%5s %5s %5s " #ifdef CONFIG_SMP "%3s " #endif @@ -574,7 +633,7 @@ static void ps_title(FAR struct nsh_vtbl_s *vtbl, bool heap) "%6s " #endif "%s\n" - , "PID", "GROUP" + , "PID", "PPID", "GROUP" #ifdef CONFIG_SMP , "CPU" #endif @@ -620,7 +679,7 @@ static void ps_output(FAR struct nsh_vtbl_s *vtbl, bool heap, #endif nsh_output(vtbl, - "%5d %5s " + "%5d %5d %5s " #ifdef CONFIG_SMP "%3s " #endif @@ -641,7 +700,7 @@ static void ps_output(FAR struct nsh_vtbl_s *vtbl, bool heap, "%5s " #endif "%s\n" - , status->td_pid, status->td_groupid + , status->td_pid, status->td_ppid, status->td_groupid #ifdef CONFIG_SMP , status->td_cpu #endif From 8f3c3c57f9997c8b01834292fbc034dc7775dffd Mon Sep 17 00:00:00 2001 From: nuttxs Date: Tue, 5 Aug 2025 18:51:19 +0800 Subject: [PATCH 371/391] netutils/dhcpc/dhcpc: add implementation to get renewal (T1) time and rebinding (T2) time from DHCP packet. According to RFC 2131, T1 and T2 times play a critical role in lease management in DHCP clients. Signed-off-by: nuttxs --- include/netutils/dhcpc.h | 2 ++ netutils/dhcpc/dhcpc.c | 36 +++++++++++++++++++++++++++++++++++- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/include/netutils/dhcpc.h b/include/netutils/dhcpc.h index 4a5c451bd2c..3529e554fe9 100644 --- a/include/netutils/dhcpc.h +++ b/include/netutils/dhcpc.h @@ -58,6 +58,8 @@ struct dhcpc_state struct in_addr dnsaddr; struct in_addr default_router; uint32_t lease_time; /* Lease expires in this number of seconds */ + uint32_t renewal_time; /* Seconds to transition to RENEW state(T1) */ + uint32_t rebinding_time; /* Seconds to transition to REBIND state(T2) */ }; typedef void (*dhcpc_callback_t)(FAR struct dhcpc_state *presult); diff --git a/netutils/dhcpc/dhcpc.c b/netutils/dhcpc/dhcpc.c index 724894bb9c9..3b0c2e19168 100644 --- a/netutils/dhcpc/dhcpc.c +++ b/netutils/dhcpc/dhcpc.c @@ -96,6 +96,8 @@ #define DHCP_OPTION_MSG_TYPE 53 #define DHCP_OPTION_SERVER_ID 54 #define DHCP_OPTION_REQ_LIST 55 +#define DHCP_OPTION_T1_TIME 58 +#define DHCP_OPTION_T2_TIME 59 #define DHCP_OPTION_CLIENT_ID 61 #define DHCP_OPTION_END 255 @@ -340,6 +342,7 @@ static uint8_t dhcpc_parseoptions(FAR struct dhcpc_state *presult, { FAR uint8_t *end = optptr + len; uint8_t type = 0; + uint16_t tmp[2]; while (optptr < end) { @@ -421,7 +424,6 @@ static uint8_t dhcpc_parseoptions(FAR struct dhcpc_state *presult, if (optptr + 6 <= end) { - uint16_t tmp[2]; memcpy(tmp, optptr + 2, 4); presult->lease_time = ((uint32_t)ntohs(tmp[0])) << 16 | (uint32_t)ntohs(tmp[1]); @@ -432,6 +434,38 @@ static uint8_t dhcpc_parseoptions(FAR struct dhcpc_state *presult, } break; + case DHCP_OPTION_T1_TIME: + + /* Get renewal (T1) time (in seconds) in host order */ + + if (optptr + 6 <= end) + { + memcpy(tmp, optptr + 2, 4); + presult->renewal_time = ((uint32_t)ntohs(tmp[0])) << 16 | + (uint32_t)ntohs(tmp[1]); + } + else + { + nerr("Packet too short (renewal time missing)\n"); + } + break; + + case DHCP_OPTION_T2_TIME: + + /* Get rebinding (T2) time (in seconds) in host order */ + + if (optptr + 6 <= end) + { + memcpy(tmp, optptr + 2, 4); + presult->rebinding_time = ((uint32_t)ntohs(tmp[0])) << 16 | + (uint32_t)ntohs(tmp[1]); + } + else + { + nerr("Packet too short (rebinding time missing)\n"); + } + break; + case DHCP_OPTION_END: return type; } From d334c5eb67b685843826a99bbd9ed826980e5cc4 Mon Sep 17 00:00:00 2001 From: Matteo Golin Date: Wed, 6 Aug 2025 10:10:33 -0400 Subject: [PATCH 372/391] apps/unity: Add printf configuration Allows the user to select whether or not they want access to the Unity ``TEST_PRINTF`` commands. Signed-off-by: Matteo Golin --- include/testing/unity_config.h | 6 ++++++ testing/unity/Kconfig | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/include/testing/unity_config.h b/include/testing/unity_config.h index 993399e0174..adee96f8e52 100644 --- a/include/testing/unity_config.h +++ b/include/testing/unity_config.h @@ -47,4 +47,10 @@ # define UNITY_OUTPUT_COLOR 1 #endif +/* Enable Unity TEST_PRINTF */ + +#ifdef CONFIG_TESTING_UNITY_PRINT_FORMATTED +# define UNITY_INCLUDE_PRINT_FORMATTED 1 +#endif + #endif /* UNITY_CONFIG_H */ diff --git a/testing/unity/Kconfig b/testing/unity/Kconfig index 8e46422f00a..fa6d501cd8e 100644 --- a/testing/unity/Kconfig +++ b/testing/unity/Kconfig @@ -29,6 +29,12 @@ config TESTING_UNITY_OUTPUT_COLOR bool "Output color" default n ---help--- - Select this if your want to add some colors to your tests + Select this if you want to add some colors to your tests + +config TESTING_UNITY_PRINT_FORMATTED + bool "Unity printf" + default y + ---help--- + Select this if you you want to use the Unity TEST_PRINTF macro. endif # TESTING_UNITY From 9cb9cea4b23d70e7dcb18e2087858d016d536530 Mon Sep 17 00:00:00 2001 From: nuttxs Date: Mon, 11 Aug 2025 17:17:26 +0800 Subject: [PATCH 373/391] =?UTF-8?q?ntpclient/ntpclient.c:=20fix=20the=20NT?= =?UTF-8?q?P=20client=E2=80=99s=20timeval=20conversion=20bug=20from=20mill?= =?UTF-8?q?iseconds=20to=20microseconds?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: nuttxs --- netutils/ntpclient/ntpclient.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netutils/ntpclient/ntpclient.c b/netutils/ntpclient/ntpclient.c index 66aaacb4aaa..19962f4d508 100644 --- a/netutils/ntpclient/ntpclient.c +++ b/netutils/ntpclient/ntpclient.c @@ -892,7 +892,7 @@ static int ntpc_create_dgram_socket(int domain) /* Setup a send timeout on the socket */ tv.tv_sec = CONFIG_NETUTILS_NTPCLIENT_TIMEOUT_MS / 1000; - tv.tv_usec = CONFIG_NETUTILS_NTPCLIENT_TIMEOUT_MS % 1000; + tv.tv_usec = (CONFIG_NETUTILS_NTPCLIENT_TIMEOUT_MS % 1000) * 1000; ret = setsockopt(sd, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(struct timeval)); if (ret < 0) From cd1c835a351d513f59effd74e424116af6107f7e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Aug 2025 07:15:14 +0000 Subject: [PATCH 374/391] build(deps): bump actions/download-artifact from 4 to 5 Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4 to 5. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5070a1d6cac..b84de03adfb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -144,7 +144,7 @@ jobs: steps: - name: Download Source Artifact - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v5 with: name: source-bundle path: . @@ -212,7 +212,7 @@ jobs: boards: ${{ fromJSON(needs.macOS-Arch.outputs.selected_builds) }} steps: - name: Download Source Artifact - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v5 with: name: source-bundle path: . @@ -306,7 +306,7 @@ jobs: - run: git config --global core.autocrlf false - name: Download Source Artifact - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v5 with: name: source-bundle path: . @@ -360,7 +360,7 @@ jobs: - run: git config --global core.autocrlf false - name: Download Source Artifact - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v5 with: name: source-bundle path: . From 1820d7d2c7d5070637f71b0715ada3ffa9e6183f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Aug 2025 06:12:06 +0000 Subject: [PATCH 375/391] build(deps): bump actions/checkout from 4 to 5 Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/build.yml | 8 ++++---- .github/workflows/check.yml | 4 ++-- .github/workflows/labeler.yml | 2 +- .github/workflows/lint.yml | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b84de03adfb..138299d968e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -85,7 +85,7 @@ jobs: echo "apps_ref=$APPS_REF" >> $GITHUB_OUTPUT - name: Checkout nuttx repo - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: repository: apache/nuttx ref: ${{ steps.gittargets.outputs.os_ref }} @@ -95,7 +95,7 @@ jobs: run: git -C sources/nuttx fetch --tags - name: Checkout apps repo - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: repository: apache/nuttx-apps ref: ${{ steps.gittargets.outputs.apps_ref }} @@ -274,7 +274,7 @@ jobs: run: shell: msys2 {0} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: msys2/setup-msys2@v2 with: msystem: MSYS @@ -347,7 +347,7 @@ jobs: if: ${{ needs.msvc-Arch.outputs.skip_all_builds != '1' }} runs-on: windows-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 # Set up Python environment and install kconfiglib - name: Set up Python and install kconfiglib uses: actions/setup-python@v5 diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 6f007e52fb9..db3b285f7bf 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -28,14 +28,14 @@ jobs: steps: - name: Checkout nuttx repo - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: repository: apache/nuttx path: nuttx fetch-depth: 0 - name: Checkout apps repo - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: repository: apache/nuttx-apps path: apps diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 30e1fdf40ac..0b93976023d 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -25,7 +25,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Assign labels based on paths uses: actions/labeler@main diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 87c51660fad..33e042803d8 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -17,7 +17,7 @@ jobs: name: Lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: fetch-depth: 0 - run: mkdir super-linter.report From 7a2d5bbc64271ae43b86afde64e35a695962a236 Mon Sep 17 00:00:00 2001 From: Zhe Weng Date: Tue, 11 Mar 2025 20:08:58 +0800 Subject: [PATCH 376/391] apps/graphics: Add input generator library We can use it to unify our monkey / input tools, and for other input generation purposes easily. Signed-off-by: Zhe Weng --- graphics/input/CMakeLists.txt | 27 + graphics/input/Kconfig | 11 + graphics/input/Make.defs | 25 + graphics/input/Makefile | 29 + graphics/input/generator/input_gen_ctx.c | 304 +++++++++ graphics/input/generator/input_gen_dev.c | 228 +++++++ graphics/input/generator/input_gen_event.c | 578 ++++++++++++++++++ graphics/input/generator/input_gen_internal.h | 174 ++++++ include/graphics/input_gen.h | 304 +++++++++ 9 files changed, 1680 insertions(+) create mode 100644 graphics/input/CMakeLists.txt create mode 100644 graphics/input/Kconfig create mode 100644 graphics/input/Make.defs create mode 100644 graphics/input/Makefile create mode 100644 graphics/input/generator/input_gen_ctx.c create mode 100644 graphics/input/generator/input_gen_dev.c create mode 100644 graphics/input/generator/input_gen_event.c create mode 100644 graphics/input/generator/input_gen_internal.h create mode 100644 include/graphics/input_gen.h diff --git a/graphics/input/CMakeLists.txt b/graphics/input/CMakeLists.txt new file mode 100644 index 00000000000..17d86c80c28 --- /dev/null +++ b/graphics/input/CMakeLists.txt @@ -0,0 +1,27 @@ +# ############################################################################## +# apps/graphics/input/CMakeLists.txt +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_GRAPHICS_INPUT_GENERATOR) + nuttx_add_library(input_generator) + file(GLOB CSRCS generator/*.c) + target_sources(input_generator PRIVATE ${CSRCS}) +endif() diff --git a/graphics/input/Kconfig b/graphics/input/Kconfig new file mode 100644 index 00000000000..f4358da94cc --- /dev/null +++ b/graphics/input/Kconfig @@ -0,0 +1,11 @@ +# +# For a description of the syntax of this configuration file, +# see the file kconfig-language.txt in the NuttX tools repository. +# + +config GRAPHICS_INPUT_GENERATOR + bool "Input generator library" + default n + ---help--- + This is a simple input generator library that can be used to + generate input events for testing graphics applications. diff --git a/graphics/input/Make.defs b/graphics/input/Make.defs new file mode 100644 index 00000000000..8bf4cb9c1d8 --- /dev/null +++ b/graphics/input/Make.defs @@ -0,0 +1,25 @@ +############################################################################ +# apps/graphics/input/Make.defs +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +ifneq ($(CONFIG_GRAPHICS_INPUT_GENERATOR),) +CONFIGURED_APPS += $(APPDIR)/graphics/input +endif diff --git a/graphics/input/Makefile b/graphics/input/Makefile new file mode 100644 index 00000000000..2fc9e696feb --- /dev/null +++ b/graphics/input/Makefile @@ -0,0 +1,29 @@ +############################################################################ +# apps/graphics/input/Makefile +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +include $(APPDIR)/Make.defs + +ifneq ($(CONFIG_GRAPHICS_INPUT_GENERATOR),) +CSRCS = $(wildcard generator/*.c) +endif + +include $(APPDIR)/Application.mk diff --git a/graphics/input/generator/input_gen_ctx.c b/graphics/input/generator/input_gen_ctx.c new file mode 100644 index 00000000000..6449979fd1d --- /dev/null +++ b/graphics/input/generator/input_gen_ctx.c @@ -0,0 +1,304 @@ +/**************************************************************************** + * apps/graphics/input/generator/input_gen_ctx.c + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include +#include +#include +#include + +#include "input_gen_internal.h" + +/**************************************************************************** + * Private Types + ****************************************************************************/ + +struct input_gen_ctx_s +{ + struct input_gen_dev_s devs[INPUT_GEN_DEV_NUM]; +}; + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: input_gen_create + * + * Description: + * Create an input generator context. + * + * Input Parameters: + * ctx - A pointer to the input generator context, or NULL if the + * context failed to be created. + * devices - Device types to be opened. + * + * Returned Value: + * Success device count. On failure, a negated errno value is returned. + * + ****************************************************************************/ + +int input_gen_create(FAR input_gen_ctx_t *ctx, uint32_t devices) +{ + int success = 0; + int i; + + if (ctx == NULL || devices & ~INPUT_GEN_DEV_ALL) + { + gerr("ERROR: Invalid parameter: ctx=%p, devices=0x%08" PRIX32 "\n", + ctx, devices); + return -EINVAL; + } + + *ctx = (input_gen_ctx_t)zalloc(sizeof(struct input_gen_ctx_s)); + if (*ctx == NULL) + { + return -ENOMEM; + } + + /* Initialize the device context */ + + for (i = 0; i < INPUT_GEN_DEV_NUM; i++) + { + FAR struct input_gen_dev_s *dev = &(*ctx)->devs[i]; + input_gen_dev_t current = (1 << i); + + if (devices & current) + { + dev->fd = open(input_gen_dev2path(current), + O_WRONLY | O_NONBLOCK); + if (dev->fd < 0) + { + dev->device = INPUT_GEN_DEV_NONE; + gerr("ERROR: Open %s failed: %d\n", + input_gen_dev2path(current), errno); + continue; + } + + ginfo("Opened %s, fd = %d\n", + input_gen_dev2path(current), dev->fd); + dev->device = current; + success++; + } + else + { + dev->fd = -1; + dev->device = INPUT_GEN_DEV_NONE; + } + } + + ginfo("%d devices opened\n", success); + + if (success == 0) + { + free(*ctx); + *ctx = NULL; + return -ENODEV; + } + + return success; +} + +/**************************************************************************** + * Name: input_gen_destroy + * + * Description: + * Destroy an input generator context. + * + * Input Parameters: + * ctx - The input generator context to destroy. + * + * Returned Value: + * Zero (OK) is returned on success. On failure, a negated errno value is + * returned. + * + ****************************************************************************/ + +int input_gen_destroy(input_gen_ctx_t ctx) +{ + int i; + + if (ctx == NULL) + { + return -EINVAL; + } + + for (i = 0; i < INPUT_GEN_DEV_NUM; i++) + { + if (ctx->devs[i].fd >= 0) + { + ginfo("Closing %s, fd = %d\n", + input_gen_dev2path(ctx->devs[i].device), ctx->devs[i].fd); + close(ctx->devs[i].fd); + } + } + + free(ctx); + return OK; +} + +/**************************************************************************** + * Name: input_gen_search_dev + * + * Description: + * Get the input generator device by type. + * + * Input Parameters: + * ctx - The input generator context. + * device - The device type. + * + * Returned Value: + * A pointer to the input generator device structure, or NULL if not found. + * + ****************************************************************************/ + +FAR struct input_gen_dev_s *input_gen_search_dev(input_gen_ctx_t ctx, + input_gen_dev_t device) +{ + int i; + + if (ctx == NULL || device > INPUT_GEN_DEV_ALL) + { + return NULL; + } + + for (i = 0; i < INPUT_GEN_DEV_NUM; i++) + { + if (ctx->devs[i].device & device) + { + return &ctx->devs[i]; + } + } + + nwarn("WARNING: Device with type %d not found\n", device); + return NULL; +} + +/**************************************************************************** + * Name: input_gen_query_device + * + * Description: + * Query whether the device with the specified type is opened. + * + * Input Parameters: + * ctx - The input generator context. + * device - The device type. + * + * Returned Value: + * True if the device is opened, false otherwise. + * + ****************************************************************************/ + +bool input_gen_query_device(input_gen_ctx_t ctx, input_gen_dev_t device) +{ + return input_gen_search_dev(ctx, device) != NULL; +} + +/**************************************************************************** + * Name: input_gen_reset_devices + * + * Description: + * Reset the device state with the specified type. + * + * Input Parameters: + * ctx - The input generator context. + * devices - The device types to reset state. + * + * Returned Value: + * Zero (OK) is returned on success. On failure, a negated errno value is + * returned. + * + ****************************************************************************/ + +int input_gen_reset_devices(input_gen_ctx_t ctx, uint32_t devices) +{ + int ret; + + if (ctx == NULL) + { + return -EINVAL; + } + + /* Use actions with duration 0 to reset the device state */ + + if (devices & INPUT_GEN_DEV_UTOUCH) + { + ret = input_gen_swipe(ctx, 0, 0, 0, 0, 0); + if (ret < 0 && ret != -ENODEV) + { + return ret; + } + } + + if (devices & INPUT_GEN_DEV_UBUTTON) + { + ret = input_gen_button_longpress(ctx, 0, 0); + if (ret < 0 && ret != -ENODEV) + { + return ret; + } + } + + /* TODO: Reset keyboard when we support it. */ + + return OK; +} + +/**************************************************************************** + * Name: input_gen_write_raw + * + * Description: + * Write raw data to the device. + * + * Input Parameters: + * ctx - The input generator context. + * device - The device type. + * buf - The buffer to write. + * nbytes - The number of bytes to write. + * + * Returned Value: + * The number of bytes written, or a negated errno value on failure. + * + ****************************************************************************/ + +ssize_t input_gen_write_raw(input_gen_ctx_t ctx, input_gen_dev_t device, + FAR const void *buf, size_t nbytes) +{ + FAR struct input_gen_dev_s *dev = input_gen_search_dev(ctx, device); + ssize_t ret; + + if (dev == NULL) + { + gerr("ERROR: Device with type %d not found\n", device); + return -ENODEV; + } + + ret = write(dev->fd, buf, nbytes); + return ret < 0 ? -errno : ret; +} diff --git a/graphics/input/generator/input_gen_dev.c b/graphics/input/generator/input_gen_dev.c new file mode 100644 index 00000000000..117946d9c11 --- /dev/null +++ b/graphics/input/generator/input_gen_dev.c @@ -0,0 +1,228 @@ +/**************************************************************************** + * apps/graphics/input/generator/input_gen_dev.c + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include + +#include "input_gen_internal.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#define INPUT_GEN_DEV_PATH_UTOUCH "/dev/utouch" +#define INPUT_GEN_DEV_PATH_UBUTTON "/dev/ubutton" +#define INPUT_GEN_DEV_PATH_UMOUSE "/dev/umouse" +#define INPUT_GEN_DEV_PATH_UKEYBOARD "/dev/ukeyboard" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: input_gen_dev2path + * + * Description: + * Convert device type to device path. + * + * Input Parameters: + * device - Device type + * + * Returned Value: + * Device path string. + * + ****************************************************************************/ + +FAR const char *input_gen_dev2path(input_gen_dev_t device) +{ + switch (device) + { + case INPUT_GEN_DEV_UTOUCH: + return INPUT_GEN_DEV_PATH_UTOUCH; + case INPUT_GEN_DEV_UBUTTON: + return INPUT_GEN_DEV_PATH_UBUTTON; + case INPUT_GEN_DEV_UMOUSE: + return INPUT_GEN_DEV_PATH_UMOUSE; + case INPUT_GEN_DEV_UKEYBOARD: + return INPUT_GEN_DEV_PATH_UKEYBOARD; + default: + gerr("ERROR: Invalid device type: %d\n", device); + return ""; + } +} + +/**************************************************************************** + * Name: input_gen_utouch_write + * + * Description: + * Write touch sample to the device. + * + * Input Parameters: + * fd - File descriptor of the device + * sample - Pointer to the touch sample structure + * + * Returned Value: + * Zero (OK) is returned on success. On failure, a negated errno value is + * returned. + * + ****************************************************************************/ + +int input_gen_utouch_write(int fd, FAR const struct touch_sample_s *sample) +{ + size_t nbytes = SIZEOF_TOUCH_SAMPLE_S(sample->npoints); + ssize_t ret = write(fd, sample, nbytes); + + if (ret != nbytes) + { + gerr("ERROR: utouch_write failed: nbytes = %zu, ret = %zd, error = %d," + " data = %d points, first at x = %d, y = %d, pressure = %u\n", + nbytes, ret, errno, sample->npoints, sample->point[0].x, + sample->point[0].y, sample->point[0].pressure); + return ret < 0 ? -errno : -EIO; + } + + ginfo("utouch_write: %d points, first at x = %d, y = %d, pressure = %u\n", + sample->npoints, sample->point[0].x, sample->point[0].y, + sample->point[0].pressure); + return OK; +} + +/**************************************************************************** + * Name: input_gen_ubutton_write + * + * Description: + * Write button state to the device. + * + * Input Parameters: + * fd - File descriptor of the device + * mask - Button mask + * + * Returned Value: + * Zero (OK) is returned on success. On failure, a negated errno value is + * returned. + * + ****************************************************************************/ + +int input_gen_ubutton_write(int fd, btn_buttonset_t mask) +{ + ssize_t ret = write(fd, &mask, sizeof(mask)); + + if (ret != sizeof(mask)) + { + gerr("ERROR: ubutton_write failed: %zd, error = %d\n", ret, errno); + return ret < 0 ? -errno : -EIO; + } + + ginfo("ubutton_write: mask = 0x%08" PRIX32 "\n", mask); + return OK; +} + +/**************************************************************************** + * Name: input_gen_umouse_write + * + * Description: + * Write mouse wheel state to the device. + * + * Input Parameters: + * fd - File descriptor of the device + * wheel - Mouse wheel value + * + * Returned Value: + * Zero (OK) is returned on success. On failure, a negated errno value is + * returned. + * + ****************************************************************************/ + +#ifdef CONFIG_INPUT_MOUSE_WHEEL +int input_gen_umouse_write(int fd, int16_t wheel) +{ + struct mouse_report_s sample; + ssize_t ret; + + memset(&sample, 0, sizeof(sample)); + sample.wheel = wheel; + + ret = write(fd, &sample, sizeof(sample)); + if (ret != sizeof(sample)) + { + gerr("ERROR: umouse_write failed: %zd, error = %d\n", ret, errno); + return ret < 0 ? -errno : -EIO; + } + + ginfo("umouse_write: wheel = %d\n", wheel); + return OK; +} +#endif + +/**************************************************************************** + * Name: input_gen_grab / input_gen_ungrab + * + * Description: + * Grab or ungrab the input device. + * + * Input Parameters: + * dev - The input generator device. + * + * Returned Value: + * Zero (OK) is returned on success. On failure, a negated errno value is + * returned. + * + ****************************************************************************/ + +int input_gen_grab(FAR struct input_gen_dev_s *dev) +{ +/* Note: We use flock instead of GRAB ioctl because GRAB will block user + * programs like LVGL from receiving events from the device. + */ + +#if CONFIG_FS_LOCK_BUCKET_SIZE > 0 + if (flock(dev->fd, LOCK_EX | LOCK_NB) < 0) + { + gerr("ERROR: input_gen_grab failed: %d\n", errno); + return -errno; + } +#endif + + return OK; +} + +int input_gen_ungrab(FAR struct input_gen_dev_s *dev) +{ +#if CONFIG_FS_LOCK_BUCKET_SIZE > 0 + if (flock(dev->fd, LOCK_UN) < 0) + { + gerr("ERROR: input_gen_ungrab failed: %d\n", errno); + return -errno; + } +#endif + + return OK; +} diff --git a/graphics/input/generator/input_gen_event.c b/graphics/input/generator/input_gen_event.c new file mode 100644 index 00000000000..d2de2b77f72 --- /dev/null +++ b/graphics/input/generator/input_gen_event.c @@ -0,0 +1,578 @@ +/**************************************************************************** + * apps/graphics/input/generator/input_gen_event.c + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include + +#include "input_gen_internal.h" + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#define INPUT_GEN_DEFAULT_PRESSURE 42 + +#define INPUT_GEN_DEFAULT_PRESS_DURATION 50 /* ms */ +#define INPUT_GEN_DEFAULT_HOLD_DURATION 5 /* ms */ + +#define INPUT_GEN_DEFAULT_CLICK_DURATION 100 /* ms */ + +#define INPUT_GEN_MAX_FINGERS 2 + +/**************************************************************************** + * Private Types + ****************************************************************************/ + +/* Structure to hold parameters for single finger operations, we can support + * multiple fingers by using multiple instances of this structure. + */ + +struct input_gen_single_finger_s +{ + int16_t x1; + int16_t y1; + int16_t x2; + int16_t y2; + uint32_t press_duration; + uint32_t move_duration; + uint32_t hold_duration; +}; + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: input_gen_tick_get + * + * Description: + * Get the current tick count in milliseconds. + * + * Returned Value: + * The current tick count in milliseconds. + * + ****************************************************************************/ + +static uint32_t input_gen_tick_get(void) +{ + struct timespec ts; + uint32_t ms; + + clock_gettime(CLOCK_MONOTONIC, &ts); + ms = ts.tv_sec * 1000 + ts.tv_nsec / 1000000; + + return ms; +} + +/**************************************************************************** + * Name: input_gen_tick_elapsed + * + * Description: + * Calculate the elapsed time in milliseconds since the last tick. + * + * Input Parameters: + * act_time - The current tick count. + * prev_tick - The previous tick count. + * + * Returned Value: + * The elapsed time in milliseconds. + * + ****************************************************************************/ + +static uint32_t input_gen_tick_elapsed(uint32_t act_time, uint32_t prev_tick) +{ + /* If there is no overflow in sys_time simple subtract */ + + if (act_time >= prev_tick) + { + prev_tick = act_time - prev_tick; + } + else + { + prev_tick = UINT32_MAX - prev_tick + 1; + prev_tick += act_time; + } + + return prev_tick; +} + +/**************************************************************************** + * Name: input_gen_single_finger + * + * Description: + * Calculate the position of a single finger based on the elapsed time and + * the parameters. + * + * Input Parameters: + * point - The touch point structure to fill in. + * finger - The parameters for the single finger operation. + * elapsed - The elapsed time since the start of the operation. + * + * Returned Value: + * True if the operation is finished, false otherwise. + * + ****************************************************************************/ + +static bool +input_gen_single_finger(FAR struct touch_point_s *point, + FAR const struct input_gen_single_finger_s *finger, + uint32_t elapsed) +{ + if (elapsed < finger->press_duration) + { + /* Press */ + + input_gen_fill_point(point, finger->x1, finger->y1, TOUCH_DOWN); + return false; + } + + elapsed -= finger->press_duration; + if (elapsed < finger->move_duration) + { + int16_t x = ((int64_t)(finger->x2 - finger->x1) * elapsed) / + finger->move_duration + finger->x1; + int16_t y = ((int64_t)(finger->y2 - finger->y1) * elapsed) / + finger->move_duration + finger->y1; + input_gen_fill_point(point, x, y, TOUCH_MOVE); + + return false; + } + + elapsed -= finger->move_duration; + if (elapsed < finger->hold_duration) + { + /* Hold */ + + input_gen_fill_point(point, finger->x2, finger->y2, TOUCH_DOWN); + return false; + } + + /* Release */ + + input_gen_fill_point(point, finger->x2, finger->y2, TOUCH_UP); + return true; +} + +/**************************************************************************** + * Name: input_gen_write_motion + * + * Description: + * Write a motion event to the device. + * + * Input Parameters: + * fd - The file descriptor of the device. + * fingers - The parameters for the motion operation. + * nfingers - The number of fingers. + * elapsed - The elapsed time since the start of the operation. + * + * Returned Value: + * Zero (OK) is returned on success. On failure, a negated errno value is + * returned. + * + ****************************************************************************/ + +static int input_gen_write_motion(int fd, + FAR const struct input_gen_single_finger_s *fingers, + size_t nfingers, uint32_t elapsed) +{ + size_t finished = 0; + size_t i; + int ret; + union /* A union with enough space to make compiler / checker happy. */ + { + struct touch_sample_s sample; + struct + { + uint8_t placeholder[offsetof(struct touch_sample_s, point)]; + struct touch_point_s point[INPUT_GEN_MAX_FINGERS]; + } points; + } buffer; + + /* Check the number of fingers */ + + if (nfingers < 1 || nfingers > INPUT_GEN_MAX_FINGERS) + { + return -EINVAL; + } + + /* Fill the touch sample structure */ + + buffer.sample.npoints = nfingers; + + for (i = 0; i < nfingers; i++) + { + FAR struct touch_point_s *point = &buffer.points.point[i]; + + point->id = i; + if (input_gen_single_finger(point, &fingers[i], elapsed)) + { + finished++; + } + + ginfo("Finger %zu: x = %d, y = %d, flags = %02X\n", + i, point->x, point->y, point->flags); + } + + /* Write the sample to the device */ + + ret = input_gen_utouch_write(fd, &buffer.sample); + if (ret < 0) + { + return ret; + } + + return finished == nfingers ? OK : -EAGAIN; +} + +/**************************************************************************** + * Name: input_gen_motion + * + * Description: + * Perform a motion operation. + * + * Input Parameters: + * ctx - The input generator context. + * fingers - The parameters for the motion operation. + * nfingers - The number of fingers. + * + * Returned Value: + * Zero (OK) is returned on success. On failure, a negated errno value is + * returned. + * + ****************************************************************************/ + +static int input_gen_motion(input_gen_ctx_t ctx, + FAR const struct input_gen_single_finger_s *fingers, + size_t nfingers) +{ + FAR struct input_gen_dev_s *dev; + uint32_t start; + int ret; + + dev = input_gen_search_dev(ctx, INPUT_GEN_DEV_UTOUCH); + if (dev == NULL) + { + return -ENODEV; + } + + ret = input_gen_grab(dev); + if (ret < 0) + { + return ret; + } + + start = input_gen_tick_get(); + + do + { + uint32_t elapsed = input_gen_tick_elapsed(input_gen_tick_get(), start); + ret = input_gen_write_motion(dev->fd, fingers, nfingers, elapsed); + if (ret == -EAGAIN && usleep(1000) < 0) + { + nwarn("WARNING: Maybe interrupted by signal\n"); + input_gen_ungrab(dev); + return -errno; + } + } + while (ret == -EAGAIN); + + input_gen_ungrab(dev); + return ret; +} + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: input_gen_tap + * + * Description: + * Perform a tap operation. + * + * Input Parameters: + * ctx - The input generator context. + * x - The x coordinate. + * y - The y coordinate. + * + * Returned Value: + * Zero (OK) is returned on success. On failure, a negated errno value is + * returned. + * + ****************************************************************************/ + +int input_gen_tap(input_gen_ctx_t ctx, int16_t x, int16_t y) +{ + struct input_gen_single_finger_s finger = + { + .x1 = x, + .y1 = y, + .x2 = x, + .y2 = y, + .press_duration = INPUT_GEN_DEFAULT_PRESS_DURATION, + .move_duration = 0, + .hold_duration = 0, + }; + + return input_gen_motion(ctx, &finger, 1); +} + +/**************************************************************************** + * Name: input_gen_drag / input_gen_swipe + * + * Description: + * Perform a drag or swipe operation. + * + * Input Parameters: + * ctx - The input generator context. + * x1 - The start x coordinate. + * y1 - The start y coordinate. + * x2 - The end x coordinate. + * y2 - The end y coordinate. + * duration - The duration of the operation. + * + * Returned Value: + * Zero (OK) is returned on success. On failure, a negated errno value is + * returned. + * + ****************************************************************************/ + +int input_gen_drag(input_gen_ctx_t ctx, int16_t x1, int16_t y1, + int16_t x2, int16_t y2, uint32_t duration) +{ + struct input_gen_single_finger_s finger = + { + .x1 = x1, + .y1 = y1, + .x2 = x2, + .y2 = y2, + .press_duration = INPUT_GEN_DEFAULT_PRESS_DURATION, + .move_duration = duration, + .hold_duration = INPUT_GEN_DEFAULT_HOLD_DURATION, + }; + + return input_gen_motion(ctx, &finger, 1); +} + +int input_gen_swipe(input_gen_ctx_t ctx, int16_t x1, int16_t y1, + int16_t x2, int16_t y2, uint32_t duration) +{ + struct input_gen_single_finger_s finger = + { + .x1 = x1, + .y1 = y1, + .x2 = x2, + .y2 = y2, + .press_duration = 0, + .move_duration = duration, + .hold_duration = 0, + }; + + return input_gen_motion(ctx, &finger, 1); +} + +/**************************************************************************** + * Name: input_gen_pinch + * + * Description: + * Perform a pinch operation. + * + * Input Parameters: + * ctx - The input generator context. + * x1_start - The start x coordinate of the first finger. + * y1_start - The start y coordinate of the first finger. + * x2_start - The start x coordinate of the second finger. + * y2_start - The start y coordinate of the second finger. + * x1_end - The end x coordinate of the first finger. + * y1_end - The end y coordinate of the first finger. + * x2_end - The end x coordinate of the second finger. + * y2_end - The end y coordinate of the second finger. + * duration - The duration of the operation. + * + * Returned Value: + * Zero (OK) is returned on success. On failure, a negated errno value is + * returned. + * + ****************************************************************************/ + +int input_gen_pinch(input_gen_ctx_t ctx, int16_t x1_start, int16_t y1_start, + int16_t x2_start, int16_t y2_start, int16_t x1_end, + int16_t y1_end, int16_t x2_end, int16_t y2_end, + uint32_t duration) +{ + struct input_gen_single_finger_s fingers[2] = + { + { + .x1 = x1_start, + .y1 = y1_start, + .x2 = x1_end, + .y2 = y1_end, + .press_duration = INPUT_GEN_DEFAULT_PRESS_DURATION, + .move_duration = duration, + .hold_duration = INPUT_GEN_DEFAULT_HOLD_DURATION, + }, + { + .x1 = x2_start, + .y1 = y2_start, + .x2 = x2_end, + .y2 = y2_end, + .press_duration = INPUT_GEN_DEFAULT_PRESS_DURATION, + .move_duration = duration, + .hold_duration = INPUT_GEN_DEFAULT_HOLD_DURATION, + }, + }; + + return input_gen_motion(ctx, fingers, 2); +} + +/**************************************************************************** + * Name: input_gen_button_click / input_gen_button_longpress + * + * Description: + * Perform a button click or long press operation. + * + * Input Parameters: + * ctx - The input generator context. + * mask - The button mask. + * duration - The duration of the operation. + * + * Returned Value: + * Zero (OK) is returned on success. On failure, a negated errno value is + * returned. + * + ****************************************************************************/ + +int input_gen_button_click(input_gen_ctx_t ctx, btn_buttonset_t mask) +{ + return input_gen_button_longpress(ctx, mask, + INPUT_GEN_DEFAULT_CLICK_DURATION); +} + +int input_gen_button_longpress(input_gen_ctx_t ctx, btn_buttonset_t mask, + uint32_t duration) +{ + FAR struct input_gen_dev_s *dev; + int ret; + + dev = input_gen_search_dev(ctx, INPUT_GEN_DEV_UBUTTON); + if (dev == NULL) + { + return -ENODEV; + } + + ret = input_gen_grab(dev); + if (ret < 0) + { + return ret; + } + + ret = input_gen_ubutton_write(dev->fd, mask); + if (ret < 0) + { + goto out; + } + + usleep(duration * 1000); + + ret = input_gen_ubutton_write(dev->fd, 0); + if (ret < 0) + { + goto out; + } + +out: + input_gen_ungrab(dev); + return ret; +} + +/**************************************************************************** + * Name: input_gen_mouse_wheel + * + * Description: + * Perform a mouse wheel operation. + * + * Input Parameters: + * ctx - The input generator context. + * wheel - The wheel value. + * + * Returned Value: + * Zero (OK) is returned on success. On failure, a negated errno value is + * returned. + * + ****************************************************************************/ + +#ifdef CONFIG_INPUT_MOUSE_WHEEL +int input_gen_mouse_wheel(input_gen_ctx_t ctx, int16_t wheel) +{ + FAR struct input_gen_dev_s *dev; + + dev = input_gen_search_dev(ctx, INPUT_GEN_DEV_UMOUSE); + if (dev == NULL) + { + return -ENODEV; + } + + return input_gen_umouse_write(dev->fd, wheel); +} +#endif + +/**************************************************************************** + * Name: input_gen_fill_point + * + * Description: + * Fill the touch point structure. + * + * Input Parameters: + * point - The touch point structure. + * x - The x coordinate. + * y - The y coordinate. + * flags - The TOUCH_DOWN, TOUCH_MOVE, TOUCH_UP flag. + * + ****************************************************************************/ + +void input_gen_fill_point(FAR struct touch_point_s *point, + int16_t x, int16_t y, uint8_t flags) +{ + point->x = x; + point->y = y; + point->h = 1; + point->w = 1; + + if (flags & TOUCH_UP) + { + point->pressure = 0; + point->flags = flags | TOUCH_ID_VALID; + } + else + { + point->pressure = INPUT_GEN_DEFAULT_PRESSURE; + point->flags = flags | TOUCH_ID_VALID | TOUCH_POS_VALID | + TOUCH_PRESSURE_VALID; + } +} diff --git a/graphics/input/generator/input_gen_internal.h b/graphics/input/generator/input_gen_internal.h new file mode 100644 index 00000000000..8fadec8654c --- /dev/null +++ b/graphics/input/generator/input_gen_internal.h @@ -0,0 +1,174 @@ +/**************************************************************************** + * apps/graphics/input/generator/input_gen_internal.h + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +#ifndef __APPS_GRAPHICS_INPUT_GENERATOR_INPUT_GEN_INTERNAL_H +#define __APPS_GRAPHICS_INPUT_GENERATOR_INPUT_GEN_INTERNAL_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include + +/**************************************************************************** + * Public Types + ****************************************************************************/ + +struct input_gen_dev_s +{ + int fd; + input_gen_dev_t device; +}; + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +#undef EXTERN +#if defined(__cplusplus) +#define EXTERN extern "C" +extern "C" +{ +#else +#define EXTERN extern +#endif + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +/**************************************************************************** + * Name: input_gen_search_dev + * + * Description: + * Get the input generator device by type. + * + * Input Parameters: + * ctx - The input generator context. + * device - The device type. + * + * Returned Value: + * A pointer to the input generator device structure, or NULL if not found. + * + ****************************************************************************/ + +FAR struct input_gen_dev_s *input_gen_search_dev(input_gen_ctx_t ctx, + input_gen_dev_t device); + +/**************************************************************************** + * Name: input_gen_dev2path + * + * Description: + * Convert device type to device path. + * + * Input Parameters: + * device - Device type + * + * Returned Value: + * Device path string. + * + ****************************************************************************/ + +FAR const char *input_gen_dev2path(input_gen_dev_t device); + +/**************************************************************************** + * Name: input_gen_utouch_write + * + * Description: + * Write touch sample to the device. + * + * Input Parameters: + * fd - File descriptor of the device + * sample - Pointer to the touch sample structure + * + * Returned Value: + * Zero (OK) is returned on success. On failure, a negated errno value is + * returned. + * + ****************************************************************************/ + +int input_gen_utouch_write(int fd, FAR const struct touch_sample_s *sample); + +/**************************************************************************** + * Name: input_gen_ubutton_write + * + * Description: + * Write button state to the device. + * + * Input Parameters: + * fd - File descriptor of the device + * mask - Button mask + * + * Returned Value: + * Zero (OK) is returned on success. On failure, a negated errno value is + * returned. + * + ****************************************************************************/ + +int input_gen_ubutton_write(int fd, btn_buttonset_t mask); + +/**************************************************************************** + * Name: input_gen_umouse_write + * + * Description: + * Write mouse wheel state to the device. + * + * Input Parameters: + * fd - File descriptor of the device + * wheel - Mouse wheel value + * + * Returned Value: + * Zero (OK) is returned on success. On failure, a negated errno value is + * returned. + * + ****************************************************************************/ + +#ifdef CONFIG_INPUT_MOUSE_WHEEL +int input_gen_umouse_write(int fd, int16_t wheel); +#endif + +/**************************************************************************** + * Name: input_gen_grab / input_gen_ungrab + * + * Description: + * Grab or ungrab the input device. + * + * Input Parameters: + * dev - The input generator device. + * + * Returned Value: + * Zero (OK) is returned on success. On failure, a negated errno value is + * returned. + * + ****************************************************************************/ + +int input_gen_grab(FAR struct input_gen_dev_s *dev); +int input_gen_ungrab(FAR struct input_gen_dev_s *dev); + +#undef EXTERN +#if defined(__cplusplus) +} +#endif + +#endif /* __APPS_GRAPHICS_INPUT_GENERATOR_INPUT_GEN_INTERNAL_H */ diff --git a/include/graphics/input_gen.h b/include/graphics/input_gen.h new file mode 100644 index 00000000000..b69f4d69a1a --- /dev/null +++ b/include/graphics/input_gen.h @@ -0,0 +1,304 @@ +/**************************************************************************** + * apps/include/graphics/input_gen.h + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +#ifndef __APPS_INCLUDE_GRAPHICS_INPUT_GEN_H +#define __APPS_INCLUDE_GRAPHICS_INPUT_GEN_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include + +#include +#include + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +#define INPUT_GEN_DEV_NUM 4 + +/**************************************************************************** + * Public Types + ****************************************************************************/ + +/* Device types */ + +typedef enum +{ + INPUT_GEN_DEV_NONE = 0x00, + INPUT_GEN_DEV_UTOUCH = 0x01, /* Touchscreen */ + INPUT_GEN_DEV_UBUTTON = 0x02, /* Button */ + INPUT_GEN_DEV_UMOUSE = 0x04, /* Mouse */ + INPUT_GEN_DEV_UKEYBOARD = 0x08, /* Keyboard */ + INPUT_GEN_DEV_ALL = INPUT_GEN_DEV_UTOUCH | INPUT_GEN_DEV_UBUTTON | + INPUT_GEN_DEV_UMOUSE | INPUT_GEN_DEV_UKEYBOARD +} input_gen_dev_t; + +/* Input generator context */ + +typedef FAR struct input_gen_ctx_s *input_gen_ctx_t; + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +#ifdef __cplusplus +#define EXTERN extern "C" +extern "C" +{ +#else +#define EXTERN extern +#endif + +/**************************************************************************** + * Name: input_gen_create + * + * Description: + * Create an input generator context. + * + * Input Parameters: + * ctx - A pointer to the input generator context, or NULL if the + * context failed to be created. + * devices - Device types to be opened. + * + * Returned Value: + * Success device count. On failure, a negated errno value is returned. + * + ****************************************************************************/ + +int input_gen_create(FAR input_gen_ctx_t *ctx, uint32_t devices); + +/**************************************************************************** + * Name: input_gen_destroy + * + * Description: + * Destroy an input generator context. + * + * Input Parameters: + * ctx - The input generator context to destroy. + * + * Returned Value: + * Zero (OK) is returned on success. On failure, a negated errno value is + * returned. + * + ****************************************************************************/ + +int input_gen_destroy(input_gen_ctx_t ctx); + +/**************************************************************************** + * Name: input_gen_query_device + * + * Description: + * Query whether the device with the specified type is opened. + * + * Input Parameters: + * ctx - The input generator context. + * device - The device type. + * + * Returned Value: + * True if the device is opened, false otherwise. + * + ****************************************************************************/ + +bool input_gen_query_device(input_gen_ctx_t ctx, input_gen_dev_t device); + +/**************************************************************************** + * Name: input_gen_reset_devices + * + * Description: + * Reset the device state with the specified type. + * + * Input Parameters: + * ctx - The input generator context. + * devices - The device types to reset state. + * + * Returned Value: + * Zero (OK) is returned on success. On failure, a negated errno value is + * returned. + * + ****************************************************************************/ + +int input_gen_reset_devices(input_gen_ctx_t ctx, uint32_t devices); + +/**************************************************************************** + * Name: input_gen_tap + * + * Description: + * Perform a tap operation. + * + * Input Parameters: + * ctx - The input generator context. + * x - The x coordinate. + * y - The y coordinate. + * + * Returned Value: + * Zero (OK) is returned on success. On failure, a negated errno value is + * returned. + * + ****************************************************************************/ + +int input_gen_tap(input_gen_ctx_t ctx, int16_t x, int16_t y); + +/**************************************************************************** + * Name: input_gen_drag / input_gen_swipe + * + * Description: + * Perform a drag or swipe operation. + * + * Input Parameters: + * ctx - The input generator context. + * x1 - The start x coordinate. + * y1 - The start y coordinate. + * x2 - The end x coordinate. + * y2 - The end y coordinate. + * duration - The duration of the operation. + * + * Returned Value: + * Zero (OK) is returned on success. On failure, a negated errno value is + * returned. + * + ****************************************************************************/ + +int input_gen_drag(input_gen_ctx_t ctx, int16_t x1, int16_t y1, + int16_t x2, int16_t y2, uint32_t duration); +int input_gen_swipe(input_gen_ctx_t ctx, int16_t x1, int16_t y1, + int16_t x2, int16_t y2, uint32_t duration); + +/**************************************************************************** + * Name: input_gen_pinch + * + * Description: + * Perform a pinch operation. + * + * Input Parameters: + * ctx - The input generator context. + * x1_start - The start x coordinate of the first finger. + * y1_start - The start y coordinate of the first finger. + * x2_start - The start x coordinate of the second finger. + * y2_start - The start y coordinate of the second finger. + * x1_end - The end x coordinate of the first finger. + * y1_end - The end y coordinate of the first finger. + * x2_end - The end x coordinate of the second finger. + * y2_end - The end y coordinate of the second finger. + * duration - The duration of the operation. + * + * Returned Value: + * Zero (OK) is returned on success. On failure, a negated errno value is + * returned. + * + ****************************************************************************/ + +int input_gen_pinch(input_gen_ctx_t ctx, int16_t x1_start, int16_t y1_start, + int16_t x2_start, int16_t y2_start, int16_t x1_end, + int16_t y1_end, int16_t x2_end, int16_t y2_end, + uint32_t duration); + +/**************************************************************************** + * Name: input_gen_button_click / input_gen_button_longpress + * + * Description: + * Perform a button click or long press operation. + * + * Input Parameters: + * ctx - The input generator context. + * mask - The button mask. + * duration - The duration of the operation. + * + * Returned Value: + * Zero (OK) is returned on success. On failure, a negated errno value is + * returned. + * + ****************************************************************************/ + +int input_gen_button_click(input_gen_ctx_t ctx, btn_buttonset_t mask); +int input_gen_button_longpress(input_gen_ctx_t ctx, btn_buttonset_t mask, + uint32_t duration); + +/**************************************************************************** + * Name: input_gen_mouse_wheel + * + * Description: + * Perform a mouse wheel operation. + * + * Input Parameters: + * ctx - The input generator context. + * wheel - The wheel value. + * + * Returned Value: + * Zero (OK) is returned on success. On failure, a negated errno value is + * returned. + * + ****************************************************************************/ + +#ifdef CONFIG_INPUT_MOUSE_WHEEL +int input_gen_mouse_wheel(input_gen_ctx_t ctx, int16_t wheel); +#else +#define input_gen_mouse_wheel(ctx, wheel) (-ENODEV) +#endif + +/**************************************************************************** + * Name: input_gen_fill_point + * + * Description: + * Fill the touch point structure. + * + * Input Parameters: + * point - The touch point structure. + * x - The x coordinate. + * y - The y coordinate. + * flags - The TOUCH_DOWN, TOUCH_MOVE, TOUCH_UP flag. + * + ****************************************************************************/ + +void input_gen_fill_point(FAR struct touch_point_s *point, + int16_t x, int16_t y, uint8_t flags); + +/**************************************************************************** + * Name: input_gen_write_raw + * + * Description: + * Write raw data to the device. + * + * Input Parameters: + * ctx - The input generator context. + * device - The device type. + * buf - The buffer to write. + * nbytes - The number of bytes to write. + * + * Returned Value: + * The number of bytes written, or a negated errno value on failure. + * + ****************************************************************************/ + +ssize_t input_gen_write_raw(input_gen_ctx_t ctx, input_gen_dev_t device, + FAR const void *buf, size_t nbytes); + +#undef EXTERN +#ifdef __cplusplus +} +#endif + +#endif /* __APPS_INCLUDE_GRAPHICS_INPUT_GEN_H */ From 7bfd5e5790a7d5b7070382c82008e73add30fefc Mon Sep 17 00:00:00 2001 From: Zhe Weng Date: Wed, 19 Mar 2025 10:47:19 +0800 Subject: [PATCH 377/391] apps/system: Move input/monkey to apps/graphics/input Signed-off-by: Zhe Weng --- graphics/input/CMakeLists.txt | 33 +++++++++++++ graphics/input/Kconfig | 48 +++++++++++++++++++ graphics/input/Makefile | 26 +++++++++- .../input/generator}/input.c | 2 +- {system => graphics/input}/monkey/monkey.c | 2 +- {system => graphics/input}/monkey/monkey.h | 8 ++-- .../input}/monkey/monkey_assert.h | 8 ++-- .../input}/monkey/monkey_dev.c | 2 +- .../input}/monkey/monkey_dev.h | 8 ++-- .../input}/monkey/monkey_event.c | 2 +- .../input}/monkey/monkey_event.h | 8 ++-- .../input}/monkey/monkey_log.c | 2 +- .../input}/monkey/monkey_log.h | 8 ++-- .../input}/monkey/monkey_main.c | 4 +- .../input}/monkey/monkey_proc.c | 2 +- .../input}/monkey/monkey_recorder.c | 2 +- .../input}/monkey/monkey_recorder.h | 8 ++-- .../input}/monkey/monkey_type.h | 8 ++-- .../input}/monkey/monkey_utils.c | 2 +- .../input}/monkey/monkey_utils.h | 8 ++-- system/input/CMakeLists.txt | 35 -------------- system/input/Kconfig | 28 ----------- system/input/Make.defs | 25 ---------- system/input/Makefile | 32 ------------- system/monkey/CMakeLists.txt | 38 --------------- system/monkey/Kconfig | 27 ----------- system/monkey/Make.defs | 25 ---------- system/monkey/Makefile | 36 -------------- 28 files changed, 148 insertions(+), 289 deletions(-) rename {system/input => graphics/input/generator}/input.c (99%) rename {system => graphics/input}/monkey/monkey.c (99%) rename {system => graphics/input}/monkey/monkey.h (95%) rename {system => graphics/input}/monkey/monkey_assert.h (87%) rename {system => graphics/input}/monkey/monkey_dev.c (99%) rename {system => graphics/input}/monkey/monkey_dev.h (94%) rename {system => graphics/input}/monkey/monkey_event.c (99%) rename {system => graphics/input}/monkey/monkey_event.h (92%) rename {system => graphics/input}/monkey/monkey_log.c (98%) rename {system => graphics/input}/monkey/monkey_log.h (94%) rename {system => graphics/input}/monkey/monkey_main.c (99%) rename {system => graphics/input}/monkey/monkey_proc.c (99%) rename {system => graphics/input}/monkey/monkey_recorder.c (99%) rename {system => graphics/input}/monkey/monkey_recorder.h (94%) rename {system => graphics/input}/monkey/monkey_type.h (94%) rename {system => graphics/input}/monkey/monkey_utils.c (99%) rename {system => graphics/input}/monkey/monkey_utils.h (95%) delete mode 100644 system/input/CMakeLists.txt delete mode 100644 system/input/Kconfig delete mode 100644 system/input/Make.defs delete mode 100644 system/input/Makefile delete mode 100644 system/monkey/CMakeLists.txt delete mode 100644 system/monkey/Kconfig delete mode 100644 system/monkey/Make.defs delete mode 100644 system/monkey/Makefile diff --git a/graphics/input/CMakeLists.txt b/graphics/input/CMakeLists.txt index 17d86c80c28..57abc0fc68e 100644 --- a/graphics/input/CMakeLists.txt +++ b/graphics/input/CMakeLists.txt @@ -23,5 +23,38 @@ if(CONFIG_GRAPHICS_INPUT_GENERATOR) nuttx_add_library(input_generator) file(GLOB CSRCS generator/*.c) + list(REMOVE_ITEM CSRCS ${CMAKE_CURRENT_SOURCE_DIR}/generator/input.c) target_sources(input_generator PRIVATE ${CSRCS}) endif() + +if(CONFIG_GRAPHICS_INPUT_MONKEY) + file(GLOB MONKEY_SRCS monkey/*.c) + list(REMOVE_ITEM MONKEY_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/monkey/monkey_main.c) + set(SRCS monkey/monkey_main.c ${MONKEY_SRCS}) + + nuttx_add_application( + NAME + monkey + PRIORITY + ${CONFIG_GRAPHICS_INPUT_MONKEY_PRIORITY} + STACKSIZE + ${CONFIG_GRAPHICS_INPUT_MONKEY_STACKSIZE} + MODULE + ${CONFIG_GRAPHICS_INPUT_MONKEY} + SRCS + ${SRCS}) +endif() + +if(CONFIG_GRAPHICS_INPUT_TOOL) + nuttx_add_application( + MODULE + ${CONFIG_GRAPHICS_INPUT_TOOL} + NAME + input + STACKSIZE + ${CONFIG_GRAPHICS_INPUT_TOOL_STACKSIZE} + PRIORITY + ${CONFIG_GRAPHICS_INPUT_TOOL_PRIORITY} + SRCS + generator/input.c) +endif() diff --git a/graphics/input/Kconfig b/graphics/input/Kconfig index f4358da94cc..a2719fc90b2 100644 --- a/graphics/input/Kconfig +++ b/graphics/input/Kconfig @@ -9,3 +9,51 @@ config GRAPHICS_INPUT_GENERATOR ---help--- This is a simple input generator library that can be used to generate input events for testing graphics applications. + +menuconfig GRAPHICS_INPUT_MONKEY + tristate "Monkey test" + select UINPUT_TOUCH + select UINPUT_BUTTONS + select LIBC_PRINT_EXTENSION + default n + +if GRAPHICS_INPUT_MONKEY + +config GRAPHICS_INPUT_MONKEY_PRIORITY + int "Task priority" + default 110 + +config GRAPHICS_INPUT_MONKEY_STACKSIZE + int "Stack size" + default 4096 + +config GRAPHICS_INPUT_MONKEY_REC_DIR_PATH + string "Recorder directory path" + default "/data/monkey" + +endif + +menuconfig GRAPHICS_INPUT_TOOL + tristate "Enable input tool" + default n + select UINPUT_TOUCH + select UINPUT_BUTTONS + select UINPUT_KEYBOARD + ---help--- + Enable support for a command line input tool. + +if GRAPHICS_INPUT_TOOL + +config GRAPHICS_INPUT_TOOL_STACKSIZE + int "input stack size" + default DEFAULT_TASK_STACKSIZE + ---help--- + The size of stack allocated for the input task. + +config GRAPHICS_INPUT_TOOL_PRIORITY + int "input priority" + default 100 + ---help--- + The priority of the input task. + +endif # GRAPHICS_INPUT_TOOL diff --git a/graphics/input/Makefile b/graphics/input/Makefile index 2fc9e696feb..b88166a0969 100644 --- a/graphics/input/Makefile +++ b/graphics/input/Makefile @@ -23,7 +23,31 @@ include $(APPDIR)/Make.defs ifneq ($(CONFIG_GRAPHICS_INPUT_GENERATOR),) -CSRCS = $(wildcard generator/*.c) +CSRCS = $(filter-out generator/input.c, $(wildcard generator/*.c)) +endif + +# Monkey test + +ifneq ($(CONFIG_GRAPHICS_INPUT_MONKEY),) +PROGNAME += monkey +PRIORITY += $(CONFIG_GRAPHICS_INPUT_MONKEY_PRIORITY) +STACKSIZE += $(CONFIG_GRAPHICS_INPUT_MONKEY_STACKSIZE) +MODULE += $(CONFIG_GRAPHICS_INPUT_MONKEY) + +MAINSRC += monkey/monkey_main.c + +CSRCS += $(filter-out monkey/monkey_main.c, $(wildcard monkey/*.c)) +endif + +# Input tool + +ifneq ($(CONFIG_GRAPHICS_INPUT_TOOL),) +PROGNAME += input +PRIORITY += $(CONFIG_GRAPHICS_INPUT_TOOL_PRIORITY) +STACKSIZE += $(CONFIG_GRAPHICS_INPUT_TOOL_STACKSIZE) +MODULE += $(CONFIG_GRAPHICS_INPUT_TOOL) + +MAINSRC += generator/input.c endif include $(APPDIR)/Application.mk diff --git a/system/input/input.c b/graphics/input/generator/input.c similarity index 99% rename from system/input/input.c rename to graphics/input/generator/input.c index 94004af930e..bf7cab40f11 100644 --- a/system/input/input.c +++ b/graphics/input/generator/input.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/system/input/input.c + * apps/graphics/input/generator/input.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/system/monkey/monkey.c b/graphics/input/monkey/monkey.c similarity index 99% rename from system/monkey/monkey.c rename to graphics/input/monkey/monkey.c index 30a92aaa6fc..c79e9475160 100644 --- a/system/monkey/monkey.c +++ b/graphics/input/monkey/monkey.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/system/monkey/monkey.c + * apps/graphics/input/monkey/monkey.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/system/monkey/monkey.h b/graphics/input/monkey/monkey.h similarity index 95% rename from system/monkey/monkey.h rename to graphics/input/monkey/monkey.h index b86c0d122f4..ef3be8d90e2 100644 --- a/system/monkey/monkey.h +++ b/graphics/input/monkey/monkey.h @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/system/monkey/monkey.h + * apps/graphics/input/monkey/monkey.h * * SPDX-License-Identifier: Apache-2.0 * @@ -20,8 +20,8 @@ * ****************************************************************************/ -#ifndef __APPS_SYSTEM_MONKEY_MONKEY_H -#define __APPS_SYSTEM_MONKEY_MONKEY_H +#ifndef __APPS_GRAPHICS_INPUT_MONKEY_MONKEY_H +#define __APPS_GRAPHICS_INPUT_MONKEY_MONKEY_H /**************************************************************************** * Included Files @@ -97,4 +97,4 @@ bool monkey_set_recorder_path(FAR struct monkey_s *monkey, } #endif -#endif /* __APPS_SYSTEM_MONKEY_MONKEY_H */ +#endif /* __APPS_GRAPHICS_INPUT_MONKEY_MONKEY_H */ diff --git a/system/monkey/monkey_assert.h b/graphics/input/monkey/monkey_assert.h similarity index 87% rename from system/monkey/monkey_assert.h rename to graphics/input/monkey/monkey_assert.h index e11773b858e..8ff474c28c3 100644 --- a/system/monkey/monkey_assert.h +++ b/graphics/input/monkey/monkey_assert.h @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/system/monkey/monkey_assert.h + * apps/graphics/input/monkey/monkey_assert.h * * SPDX-License-Identifier: Apache-2.0 * @@ -20,8 +20,8 @@ * ****************************************************************************/ -#ifndef __APPS_SYSTEM_MONKEY_MONKEY_ASSERT_H -#define __APPS_SYSTEM_MONKEY_MONKEY_ASSERT_H +#ifndef __APPS_GRAPHICS_INPUT_MONKEY_MONKEY_ASSERT_H +#define __APPS_GRAPHICS_INPUT_MONKEY_MONKEY_ASSERT_H /**************************************************************************** * Included Files @@ -36,4 +36,4 @@ #define MONKEY_ASSERT(expr) DEBUGASSERT(expr) #define MONKEY_ASSERT_NULL(ptr) MONKEY_ASSERT(ptr != NULL) -#endif /* __APPS_SYSTEM_MONKEY_MONKEY_ASSERT_H */ +#endif /* __APPS_GRAPHICS_INPUT_MONKEY_MONKEY_ASSERT_H */ diff --git a/system/monkey/monkey_dev.c b/graphics/input/monkey/monkey_dev.c similarity index 99% rename from system/monkey/monkey_dev.c rename to graphics/input/monkey/monkey_dev.c index ce3d8e05be6..47c1a82f1ba 100644 --- a/system/monkey/monkey_dev.c +++ b/graphics/input/monkey/monkey_dev.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/system/monkey/monkey_dev.c + * apps/graphics/input/monkey/monkey_dev.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/system/monkey/monkey_dev.h b/graphics/input/monkey/monkey_dev.h similarity index 94% rename from system/monkey/monkey_dev.h rename to graphics/input/monkey/monkey_dev.h index dc5dfb7c29b..cdfcd4b6ceb 100644 --- a/system/monkey/monkey_dev.h +++ b/graphics/input/monkey/monkey_dev.h @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/system/monkey/monkey_dev.h + * apps/graphics/input/monkey/monkey_dev.h * * SPDX-License-Identifier: Apache-2.0 * @@ -20,8 +20,8 @@ * ****************************************************************************/ -#ifndef __APPS_SYSTEM_MONKEY_MONKEY_DEV_H -#define __APPS_SYSTEM_MONKEY_MONKEY_DEV_H +#ifndef __APPS_GRAPHICS_INPUT_MONKEY_MONKEY_DEV_H +#define __APPS_GRAPHICS_INPUT_MONKEY_MONKEY_DEV_H /**************************************************************************** * Included Files @@ -96,4 +96,4 @@ int monkey_dev_get_available(FAR struct monkey_dev_s *devs[], int dev_num); } #endif -#endif /* __APPS_SYSTEM_MONKEY_MONKEY_DEV_H */ +#endif /* __APPS_GRAPHICS_INPUT_MONKEY_MONKEY_DEV_H */ diff --git a/system/monkey/monkey_event.c b/graphics/input/monkey/monkey_event.c similarity index 99% rename from system/monkey/monkey_event.c rename to graphics/input/monkey/monkey_event.c index fc0149bf312..3f8239186ad 100644 --- a/system/monkey/monkey_event.c +++ b/graphics/input/monkey/monkey_event.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/system/monkey/monkey_event.c + * apps/graphics/input/monkey/monkey_event.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/system/monkey/monkey_event.h b/graphics/input/monkey/monkey_event.h similarity index 92% rename from system/monkey/monkey_event.h rename to graphics/input/monkey/monkey_event.h index 905b4fe6149..f1dc29724fc 100644 --- a/system/monkey/monkey_event.h +++ b/graphics/input/monkey/monkey_event.h @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/system/monkey/monkey_event.h + * apps/graphics/input/monkey/monkey_event.h * * SPDX-License-Identifier: Apache-2.0 * @@ -20,8 +20,8 @@ * ****************************************************************************/ -#ifndef __APPS_SYSTEM_MONKEY_EVENT_H -#define __APPS_SYSTEM_MONKEY_EVENT_H +#ifndef __APPS_GRAPHICS_INPUT_MONKEY_MONKEY_EVENT_H +#define __APPS_GRAPHICS_INPUT_MONKEY_MONKEY_EVENT_H /**************************************************************************** * Included Files @@ -76,4 +76,4 @@ bool monkey_event_exec(FAR struct monkey_s *monkey, } #endif -#endif /* __APPS_SYSTEM_MONKEY_EVENT_H */ +#endif /* __APPS_GRAPHICS_INPUT_MONKEY_MONKEY_EVENT_H */ diff --git a/system/monkey/monkey_log.c b/graphics/input/monkey/monkey_log.c similarity index 98% rename from system/monkey/monkey_log.c rename to graphics/input/monkey/monkey_log.c index 2eab51d2a5b..4735705782c 100644 --- a/system/monkey/monkey_log.c +++ b/graphics/input/monkey/monkey_log.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/system/monkey/monkey_log.c + * apps/graphics/input/monkey/monkey_log.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/system/monkey/monkey_log.h b/graphics/input/monkey/monkey_log.h similarity index 94% rename from system/monkey/monkey_log.h rename to graphics/input/monkey/monkey_log.h index e798d887cc4..30a8c18e0e6 100644 --- a/system/monkey/monkey_log.h +++ b/graphics/input/monkey/monkey_log.h @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/system/monkey/monkey_log.h + * apps/graphics/input/monkey/monkey_log.h * * SPDX-License-Identifier: Apache-2.0 * @@ -20,8 +20,8 @@ * ****************************************************************************/ -#ifndef __APPS_SYSTEM_MONKEY_MONKEY_LOG_H -#define __APPS_SYSTEM_MONKEY_MONKEY_LOG_H +#ifndef __APPS_GRAPHICS_INPUT_MONKEY_MONKEY_LOG_H +#define __APPS_GRAPHICS_INPUT_MONKEY_MONKEY_LOG_H /**************************************************************************** * Included Files @@ -105,4 +105,4 @@ enum monkey_log_level_type_e monkey_log_get_level(void); } #endif -#endif /* __APPS_SYSTEM_MONKEY_MONKEY_LOG_H */ +#endif /* __APPS_GRAPHICS_INPUT_MONKEY_MONKEY_LOG_H */ diff --git a/system/monkey/monkey_main.c b/graphics/input/monkey/monkey_main.c similarity index 99% rename from system/monkey/monkey_main.c rename to graphics/input/monkey/monkey_main.c index 8ed5b6d0743..72fdc6bd43a 100644 --- a/system/monkey/monkey_main.c +++ b/graphics/input/monkey/monkey_main.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/system/monkey/monkey_main.c + * apps/graphics/input/monkey/monkey_main.c * * SPDX-License-Identifier: Apache-2.0 * @@ -330,7 +330,7 @@ static FAR struct monkey_s *monkey_init( { monkey_set_mode(monkey, MONKEY_MODE_RECORD); if (!monkey_set_recorder_path(monkey, - CONFIG_SYSTEM_MONKEY_REC_DIR_PATH)) + CONFIG_GRAPHICS_INPUT_MONKEY_REC_DIR_PATH)) { goto failed; } diff --git a/system/monkey/monkey_proc.c b/graphics/input/monkey/monkey_proc.c similarity index 99% rename from system/monkey/monkey_proc.c rename to graphics/input/monkey/monkey_proc.c index d410e025e33..9bd0ccd015f 100644 --- a/system/monkey/monkey_proc.c +++ b/graphics/input/monkey/monkey_proc.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/system/monkey/monkey_proc.c + * apps/graphics/input/monkey/monkey_proc.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/system/monkey/monkey_recorder.c b/graphics/input/monkey/monkey_recorder.c similarity index 99% rename from system/monkey/monkey_recorder.c rename to graphics/input/monkey/monkey_recorder.c index 500ec95e668..13a41d8ff5f 100644 --- a/system/monkey/monkey_recorder.c +++ b/graphics/input/monkey/monkey_recorder.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/system/monkey/monkey_recorder.c + * apps/graphics/input/monkey/monkey_recorder.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/system/monkey/monkey_recorder.h b/graphics/input/monkey/monkey_recorder.h similarity index 94% rename from system/monkey/monkey_recorder.h rename to graphics/input/monkey/monkey_recorder.h index 2848538f28d..7dee8ae566a 100644 --- a/system/monkey/monkey_recorder.h +++ b/graphics/input/monkey/monkey_recorder.h @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/system/monkey/monkey_recorder.h + * apps/graphics/input/monkey/monkey_recorder.h * * SPDX-License-Identifier: Apache-2.0 * @@ -20,8 +20,8 @@ * ****************************************************************************/ -#ifndef __APPS_SYSTEM_MONKEY_MONKEY_RECORDER_H -#define __APPS_SYSTEM_MONKEY_MONKEY_RECORDER_H +#ifndef __APPS_GRAPHICS_INPUT_MONKEY_MONKEY_RECORDER_H +#define __APPS_GRAPHICS_INPUT_MONKEY_MONKEY_RECORDER_H /**************************************************************************** * Included Files @@ -109,4 +109,4 @@ enum monkey_recorder_res_e monkey_recorder_reset( } #endif -#endif /* __APPS_SYSTEM_MONKEY_MONKEY_RECORDER_H */ +#endif /* __APPS_GRAPHICS_INPUT_MONKEY_MONKEY_RECORDER_H */ diff --git a/system/monkey/monkey_type.h b/graphics/input/monkey/monkey_type.h similarity index 94% rename from system/monkey/monkey_type.h rename to graphics/input/monkey/monkey_type.h index e919f67d929..46dc644adc0 100644 --- a/system/monkey/monkey_type.h +++ b/graphics/input/monkey/monkey_type.h @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/system/monkey/monkey_type.h + * apps/graphics/input/monkey/monkey_type.h * * SPDX-License-Identifier: Apache-2.0 * @@ -20,8 +20,8 @@ * ****************************************************************************/ -#ifndef __APPS_SYSTEM_MONKEY_MONKEY_TYPE_H -#define __APPS_SYSTEM_MONKEY_MONKEY_TYPE_H +#ifndef __APPS_GRAPHICS_INPUT_MONKEY_MONKEY_TYPE_H +#define __APPS_GRAPHICS_INPUT_MONKEY_MONKEY_TYPE_H /**************************************************************************** * Included Files @@ -131,4 +131,4 @@ struct monkey_s } playback_ctx; }; -#endif /* __APPS_SYSTEM_MONKEY_MONKEY_TYPE_H */ +#endif /* __APPS_GRAPHICS_INPUT_MONKEY_MONKEY_TYPE_H */ diff --git a/system/monkey/monkey_utils.c b/graphics/input/monkey/monkey_utils.c similarity index 99% rename from system/monkey/monkey_utils.c rename to graphics/input/monkey/monkey_utils.c index 640bd28ef7f..829f81399bf 100644 --- a/system/monkey/monkey_utils.c +++ b/graphics/input/monkey/monkey_utils.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/system/monkey/monkey_utils.c + * apps/graphics/input/monkey/monkey_utils.c * * SPDX-License-Identifier: Apache-2.0 * diff --git a/system/monkey/monkey_utils.h b/graphics/input/monkey/monkey_utils.h similarity index 95% rename from system/monkey/monkey_utils.h rename to graphics/input/monkey/monkey_utils.h index 618c0c3a562..59e63b57733 100644 --- a/system/monkey/monkey_utils.h +++ b/graphics/input/monkey/monkey_utils.h @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/system/monkey/monkey_utils.h + * apps/graphics/input/monkey/monkey_utils.h * * SPDX-License-Identifier: Apache-2.0 * @@ -20,8 +20,8 @@ * ****************************************************************************/ -#ifndef __APPS_SYSTEM_MONKEY_MONKEY_UTILS_H -#define __APPS_SYSTEM_MONKEY_MONKEY_UTILS_H +#ifndef __APPS_GRAPHICS_INPUT_MONKEY_MONKEY_UTILS_H +#define __APPS_GRAPHICS_INPUT_MONKEY_MONKEY_UTILS_H /**************************************************************************** * Included Files @@ -105,4 +105,4 @@ FAR const char *monkey_event_type2name(enum monkey_event_e event); } #endif -#endif /* __APPS_SYSTEM_MONKEY_MONKEY_UTILS_H */ +#endif /* __APPS_GRAPHICS_INPUT_MONKEY_MONKEY_UTILS_H */ diff --git a/system/input/CMakeLists.txt b/system/input/CMakeLists.txt deleted file mode 100644 index 17d07e6a5e6..00000000000 --- a/system/input/CMakeLists.txt +++ /dev/null @@ -1,35 +0,0 @@ -# ############################################################################## -# apps/system/input/CMakeLists.txt -# -# SPDX-License-Identifier: Apache-2.0 -# -# Licensed to the Apache Software Foundation (ASF) under one or more contributor -# license agreements. See the NOTICE file distributed with this work for -# additional information regarding copyright ownership. The ASF licenses this -# file to you under the Apache License, Version 2.0 (the "License"); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. -# -# ############################################################################## - -if(CONFIG_SYSTEM_INPUT) - nuttx_add_application( - MODULE - ${CONFIG_SYSTEM_INPUT} - NAME - input - STACKSIZE - ${CONFIG_SYSTEM_INPUT_STACKSIZE} - PRIORITY - ${CONFIG_SYSTEM_INPUT_PRIORITY} - SRCS - input.c) -endif() diff --git a/system/input/Kconfig b/system/input/Kconfig deleted file mode 100644 index 7e176364382..00000000000 --- a/system/input/Kconfig +++ /dev/null @@ -1,28 +0,0 @@ -# -# For a description of the syntax of this configuration file, -# see the file kconfig-language.txt in the NuttX tools repository. -# - -menuconfig SYSTEM_INPUT - tristate "Enable input tool" - default n - depends on INPUT_UINPUT - ---help--- - Enable support for a command line input tool. - -if SYSTEM_INPUT - -config SYSTEM_INPUT_STACKSIZE - int "system/input stack size" - default DEFAULT_TASK_STACKSIZE - ---help--- - The size of stack allocated for the input task. - -config SYSTEM_INPUT_PRIORITY - int "input priority" - default 100 - ---help--- - The priority of the input task. - - -endif # SYSTEM_INPUT diff --git a/system/input/Make.defs b/system/input/Make.defs deleted file mode 100644 index e1fe92b7ecd..00000000000 --- a/system/input/Make.defs +++ /dev/null @@ -1,25 +0,0 @@ -############################################################################ -# apps/system/input/Make.defs -# -# SPDX-License-Identifier: Apache-2.0 -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. The -# ASF licenses this file to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance with the -# License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -# -############################################################################ - -ifneq ($(CONFIG_SYSTEM_INPUT),) -CONFIGURED_APPS += $(APPDIR)/system/input -endif diff --git a/system/input/Makefile b/system/input/Makefile deleted file mode 100644 index 75c5c6bdac7..00000000000 --- a/system/input/Makefile +++ /dev/null @@ -1,32 +0,0 @@ -############################################################################ -# apps/system/input/Makefile -# -# SPDX-License-Identifier: Apache-2.0 -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. The -# ASF licenses this file to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance with the -# License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -# -############################################################################ - -include $(APPDIR)/Make.defs - -PROGNAME = input -PRIORITY = $(CONFIG_SYSTEM_INPUT_PRIORITY) -STACKSIZE = $(CONFIG_SYSTEM_INPUT_STACKSIZE) -MODULE = $(CONFIG_SYSTEM_INPUT) - -MAINSRC = input.c - -include $(APPDIR)/Application.mk diff --git a/system/monkey/CMakeLists.txt b/system/monkey/CMakeLists.txt deleted file mode 100644 index ec7ab1e9184..00000000000 --- a/system/monkey/CMakeLists.txt +++ /dev/null @@ -1,38 +0,0 @@ -# ############################################################################## -# apps/system/monkey/CMakeLists.txt -# -# SPDX-License-Identifier: Apache-2.0 -# -# Licensed to the Apache Software Foundation (ASF) under one or more contributor -# license agreements. See the NOTICE file distributed with this work for -# additional information regarding copyright ownership. The ASF licenses this -# file to you under the Apache License, Version 2.0 (the "License"); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations under -# the License. -# -# ############################################################################## - -if(CONFIG_SYSTEM_MONKEY) - file(GLOB CURRENT_SRCS *.c) - list(REMOVE_ITEM CURRENT_SRCS monkey_main.c) - set(SRCS monkey_main.c ${CURRENT_SRCS}) - nuttx_add_application( - NAME - monkey - PRIORITY - ${CONFIG_SYSTEM_MONKEY_PRIORITY} - STACKSIZE - ${CONFIG_SYSTEM_MONKEY_STACKSIZE} - MODULE - ${CONFIG_SYSTEM_MONKEY} - SRCS - ${SRCS}) -endif() diff --git a/system/monkey/Kconfig b/system/monkey/Kconfig deleted file mode 100644 index 9c84a040f7d..00000000000 --- a/system/monkey/Kconfig +++ /dev/null @@ -1,27 +0,0 @@ -# -# For a description of the syntax of this configuration file, -# see the file kconfig-language.txt in the NuttX tools repository. -# - -menuconfig SYSTEM_MONKEY - tristate "Monkey test" - select UINPUT_TOUCH - select UINPUT_BUTTONS - select LIBC_PRINT_EXTENSION - default n - -if SYSTEM_MONKEY - -config SYSTEM_MONKEY_PRIORITY - int "Task priority" - default 110 - -config SYSTEM_MONKEY_STACKSIZE - int "Stack size" - default 4096 - -config SYSTEM_MONKEY_REC_DIR_PATH - string "Recorder directory path" - default "/data/monkey" - -endif diff --git a/system/monkey/Make.defs b/system/monkey/Make.defs deleted file mode 100644 index 21e780a7713..00000000000 --- a/system/monkey/Make.defs +++ /dev/null @@ -1,25 +0,0 @@ -############################################################################ -# apps/system/monkey/Make.defs -# -# SPDX-License-Identifier: Apache-2.0 -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. The -# ASF licenses this file to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance with the -# License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -# -############################################################################ - -ifneq ($(CONFIG_SYSTEM_MONKEY),) -CONFIGURED_APPS += $(APPDIR)/system/monkey -endif diff --git a/system/monkey/Makefile b/system/monkey/Makefile deleted file mode 100644 index e7a26a16f18..00000000000 --- a/system/monkey/Makefile +++ /dev/null @@ -1,36 +0,0 @@ -############################################################################ -# apps/system/monkey/Makefile -# -# SPDX-License-Identifier: Apache-2.0 -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. The -# ASF licenses this file to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance with the -# License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -# -############################################################################ - -include $(APPDIR)/Make.defs - -# Monkey test example - -PROGNAME = monkey -PRIORITY = $(CONFIG_SYSTEM_MONKEY_PRIORITY) -STACKSIZE = $(CONFIG_SYSTEM_MONKEY_STACKSIZE) -MODULE = $(CONFIG_SYSTEM_MONKEY) - -MAINSRC = monkey_main.c - -CSRCS += $(filter-out monkey_main.c, $(wildcard *.c)) - -include $(APPDIR)/Application.mk From 36b117c00ab570bde3f0186ec745cf20189eeb06 Mon Sep 17 00:00:00 2001 From: liuchan3 Date: Wed, 19 Mar 2025 14:49:56 +0800 Subject: [PATCH 378/391] apps/graphics: Refactor monkey using input generator library Signed-off-by: liuchan3 --- graphics/input/CMakeLists.txt | 2 + graphics/input/Kconfig | 3 +- graphics/input/monkey/monkey.c | 37 +++++++++-- graphics/input/monkey/monkey_dev.c | 85 ++++++++++++-------------- graphics/input/monkey/monkey_dev.h | 2 +- graphics/input/monkey/monkey_event.c | 91 +++++++--------------------- graphics/input/monkey/monkey_main.c | 2 +- graphics/input/monkey/monkey_proc.c | 48 ++++----------- graphics/input/monkey/monkey_type.h | 2 + graphics/input/monkey/monkey_utils.c | 42 +------------ graphics/input/monkey/monkey_utils.h | 6 -- 11 files changed, 113 insertions(+), 207 deletions(-) diff --git a/graphics/input/CMakeLists.txt b/graphics/input/CMakeLists.txt index 57abc0fc68e..b9ae1adecb3 100644 --- a/graphics/input/CMakeLists.txt +++ b/graphics/input/CMakeLists.txt @@ -41,6 +41,8 @@ if(CONFIG_GRAPHICS_INPUT_MONKEY) ${CONFIG_GRAPHICS_INPUT_MONKEY_STACKSIZE} MODULE ${CONFIG_GRAPHICS_INPUT_MONKEY} + DEPENDS + input_generator SRCS ${SRCS}) endif() diff --git a/graphics/input/Kconfig b/graphics/input/Kconfig index a2719fc90b2..126898bec76 100644 --- a/graphics/input/Kconfig +++ b/graphics/input/Kconfig @@ -4,7 +4,7 @@ # config GRAPHICS_INPUT_GENERATOR - bool "Input generator library" + bool default n ---help--- This is a simple input generator library that can be used to @@ -14,6 +14,7 @@ menuconfig GRAPHICS_INPUT_MONKEY tristate "Monkey test" select UINPUT_TOUCH select UINPUT_BUTTONS + select GRAPHICS_INPUT_GENERATOR select LIBC_PRINT_EXTENSION default n diff --git a/graphics/input/monkey/monkey.c b/graphics/input/monkey/monkey.c index c79e9475160..3ba0d10b311 100644 --- a/graphics/input/monkey/monkey.c +++ b/graphics/input/monkey/monkey.c @@ -25,6 +25,7 @@ ****************************************************************************/ #include +#include #include #include #include @@ -41,8 +42,6 @@ #define MONKEY_DEV_PATH_TOUCH "/dev/input0" #define MONKEY_DEV_PATH_BUTTON "/dev/buttons" -#define MONKEY_DEV_PATH_UTOUCH "/dev/utouch" -#define MONKEY_DEV_PATH_UBUTTON "/dev/ubutton" #define MONKEY_DEV_CREATE_MATCH(monkey, type_mask, type) \ do { \ @@ -60,6 +59,23 @@ do { \ } \ } while (0) +#define MONKEY_DEV_CREATE_UINPUT(monkey, _type) \ +do { \ + if (input_gen_query_device(monkey->input_gen_ctx, INPUT_GEN_DEV_##_type)) \ + { \ + FAR struct monkey_dev_s *dev = calloc(1, sizeof(struct monkey_dev_s)); \ + if (!dev) \ + { \ + MONKEY_LOG_ERROR("Failed to create virtual device"); \ + goto failed; \ + } \ + dev->type = MONKEY_DEV_TYPE_##_type; \ + dev->is_available = true; \ + (monkey)->devs[(monkey)->dev_num] = dev; \ + (monkey)->dev_num++; \ + } \ +} while (0) + /**************************************************************************** * Public Functions ****************************************************************************/ @@ -75,8 +91,15 @@ FAR struct monkey_s *monkey_create(int dev_type_mask) if (MONKEY_IS_UINPUT_TYPE(dev_type_mask)) { - MONKEY_DEV_CREATE_MATCH(monkey, dev_type_mask, UTOUCH); - MONKEY_DEV_CREATE_MATCH(monkey, dev_type_mask, UBUTTON); + if (input_gen_create(&monkey->input_gen_ctx, + MONKEY_GET_DEV_TYPE(dev_type_mask)) < 0) + { + MONKEY_LOG_ERROR("input generator create failed"); + goto failed; + } + + MONKEY_DEV_CREATE_UINPUT(monkey, UTOUCH); + MONKEY_DEV_CREATE_UINPUT(monkey, UBUTTON); } else { @@ -110,6 +133,12 @@ void monkey_delete(FAR struct monkey_s *monkey) int i; MONKEY_ASSERT_NULL(monkey); + if (monkey->input_gen_ctx) + { + input_gen_reset_devices(monkey->input_gen_ctx, INPUT_GEN_DEV_ALL); + input_gen_destroy(monkey->input_gen_ctx); + } + for (i = 0; i < monkey->dev_num; i++) { monkey_dev_delete(monkey->devs[i]); diff --git a/graphics/input/monkey/monkey_dev.c b/graphics/input/monkey/monkey_dev.c index 47c1a82f1ba..ec63d8d7977 100644 --- a/graphics/input/monkey/monkey_dev.c +++ b/graphics/input/monkey/monkey_dev.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -48,41 +49,43 @@ * Name: utouch_write ****************************************************************************/ -static void utouch_write(int fd, int x, int y, int touch_down) +static void utouch_write(input_gen_ctx_t input_gen_ctx, + FAR const struct monkey_dev_state_s *state) { struct touch_sample_s sample; + sample.npoints = 1; + input_gen_fill_point(sample.point, state->data.touch.x, + state->data.touch.y, + state->data.touch.is_pressed ? TOUCH_DOWN : TOUCH_UP); - if (touch_down) + if (input_gen_write_raw(input_gen_ctx, INPUT_GEN_DEV_UTOUCH, &sample, + sizeof(struct touch_sample_s)) < 0) { - sample.point[0].x = x; - sample.point[0].y = y; - sample.point[0].pressure = 42; - sample.point[0].flags = TOUCH_DOWN | TOUCH_ID_VALID | - TOUCH_POS_VALID | TOUCH_PRESSURE_VALID; + MONKEY_LOG_WARN("unsupported device type: %d", INPUT_GEN_DEV_UTOUCH); + return; } - else - { - sample.point[0].flags = TOUCH_UP | TOUCH_ID_VALID; - } - - sample.npoints = 1; - sample.point[0].h = 1; - sample.point[0].w = 1; - write(fd, &sample, sizeof(struct touch_sample_s)); MONKEY_LOG_INFO("%s at x = %d, y = %d", - touch_down ? "PRESS " : "RELEASE", x, y); + state->data.touch.is_pressed ? "PRESS" : "RELEASE", + state->data.touch.x, state->data.touch.y); } /**************************************************************************** * Name: ubutton_write ****************************************************************************/ -static void ubutton_write(int fd, uint32_t btn_bits) +static void ubutton_write(input_gen_ctx_t input_gen_ctx, + FAR const struct monkey_dev_state_s *state) { - btn_buttonset_t buttonset = btn_bits; - write(fd, &buttonset, sizeof(buttonset)); - MONKEY_LOG_INFO("btn = 0x%08X", btn_bits); + btn_buttonset_t buttonset = state->data.button.value; + if (input_gen_write_raw(input_gen_ctx, INPUT_GEN_DEV_UBUTTON, &buttonset, + sizeof(buttonset)) < 0) + { + MONKEY_LOG_WARN("unsupported device type: %d", INPUT_GEN_DEV_UBUTTON); + return; + } + + MONKEY_LOG_INFO("btn = 0x%08X", state->data.button.value); } /**************************************************************************** @@ -152,18 +155,12 @@ FAR struct monkey_dev_s *monkey_dev_create(FAR const char *dev_path, int fd; MONKEY_ASSERT_NULL(dev_path); + MONKEY_ASSERT(!MONKEY_IS_UINPUT_TYPE(type)); dev = calloc(1, sizeof(struct monkey_dev_s)); MONKEY_ASSERT_NULL(dev); - if (MONKEY_IS_UINPUT_TYPE(type)) - { - oflag = O_RDWR | O_NONBLOCK; - } - else - { - oflag = O_RDONLY | O_NONBLOCK; - } + oflag = O_RDONLY | O_NONBLOCK; fd = open(dev_path, oflag); if (fd < 0) @@ -204,13 +201,6 @@ void monkey_dev_delete(FAR struct monkey_dev_s *dev) if (dev->fd > 0) { - /* Reset input state */ - - struct monkey_dev_state_s state; - memset(&state, 0, sizeof(state)); - state.type = dev->type; - monkey_dev_set_state(dev, &state); - MONKEY_LOG_NOTICE("close fd: %d", dev->fd); close(dev->fd); } @@ -222,23 +212,24 @@ void monkey_dev_delete(FAR struct monkey_dev_s *dev) * Name: monkey_dev_set_state ****************************************************************************/ -void monkey_dev_set_state(FAR struct monkey_dev_s *dev, +void monkey_dev_set_state(input_gen_ctx_t input_gen_ctx, FAR const struct monkey_dev_state_s *state) { - MONKEY_ASSERT_NULL(dev); + MONKEY_ASSERT_NULL(input_gen_ctx); - switch (MONKEY_GET_DEV_TYPE(dev->type)) + switch (MONKEY_GET_DEV_TYPE(state->type)) { case MONKEY_DEV_TYPE_TOUCH: - utouch_write(dev->fd, - state->data.touch.x, - state->data.touch.y, - state->data.touch.is_pressed); - break; + { + utouch_write(input_gen_ctx, state); + break; + } case MONKEY_DEV_TYPE_BUTTON: - ubutton_write(dev->fd, state->data.button.value); - break; + { + ubutton_write(input_gen_ctx, state); + break; + } default: break; @@ -280,7 +271,7 @@ bool monkey_dev_get_state(FAR struct monkey_dev_s *dev, } /**************************************************************************** - * Name: monkey_dev_get_state + * Name: monkey_dev_get_type ****************************************************************************/ enum monkey_dev_type_e monkey_dev_get_type( diff --git a/graphics/input/monkey/monkey_dev.h b/graphics/input/monkey/monkey_dev.h index cdfcd4b6ceb..48a76f36edf 100644 --- a/graphics/input/monkey/monkey_dev.h +++ b/graphics/input/monkey/monkey_dev.h @@ -69,7 +69,7 @@ void monkey_dev_delete(FAR struct monkey_dev_s *dev); * Name: monkey_dev_set_state ****************************************************************************/ -void monkey_dev_set_state(FAR struct monkey_dev_s *dev, +void monkey_dev_set_state(input_gen_ctx_t input_gen_ctx, FAR const struct monkey_dev_state_s *state); /**************************************************************************** diff --git a/graphics/input/monkey/monkey_event.c b/graphics/input/monkey/monkey_event.c index 3f8239186ad..a8fac696c0f 100644 --- a/graphics/input/monkey/monkey_event.c +++ b/graphics/input/monkey/monkey_event.c @@ -26,47 +26,12 @@ #include #include +#include #include "monkey_dev.h" #include "monkey_event.h" #include "monkey_log.h" #include "monkey_utils.h" -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: monkey_exec_darg - ****************************************************************************/ - -static bool monkey_exec_darg(FAR struct monkey_dev_s *dev, - FAR struct monkey_dev_state_s *state, - FAR const struct monkey_event_param_s *param) -{ - int t = 0; - uint32_t start; - state->data.touch.is_pressed = true; - - start = monkey_tick_get(); - - while (t < param->duration) - { - t = monkey_tick_elaps(monkey_tick_get(), start); - state->data.touch.x = monkey_map(t, 0, param->duration, - param->x1, param->x2); - state->data.touch.y = monkey_map(t, 0, param->duration, - param->y1, param->y2); - monkey_dev_set_state(dev, state); - - if (usleep(1000) < 0) - { - return false; - } - } - - return true; -} - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -143,60 +108,46 @@ bool monkey_event_exec(FAR struct monkey_s *monkey, FAR const struct monkey_event_param_s *param) { bool retval = false; - struct monkey_dev_state_s state; - memset(&state, 0, sizeof(struct monkey_dev_state_s)); - state.type = monkey_dev_get_type(dev); - + enum monkey_dev_type_e dev_type = monkey_dev_get_type(dev); MONKEY_LOG_INFO("dev=0x%x event=%d(%s) duration=%d" " x1=%d y1=%d x2=%d y2=%d", - state.type, + dev_type, param->event, monkey_event_type2name(param->event), param->duration, param->x1, param->y1, param->x2, param->y2); - if (state.type & MONKEY_DEV_TYPE_TOUCH) + if (dev_type & MONKEY_DEV_TYPE_TOUCH) { - state.data.touch.x = param->x1; - state.data.touch.y = param->y1; - state.data.touch.is_pressed = true; - monkey_dev_set_state(dev, &state); - if (param->event == MONKEY_EVENT_DRAG) { - retval = monkey_exec_darg(dev, &state, param); + retval = !input_gen_drag(monkey->input_gen_ctx, + param->x1, param->y1, + param->x2, param->y2, + param->duration); } else { - retval = usleep(param->duration * 1000) == 0; + /* Use swipe with same start and end point to simulate click or + * longpress. + */ + + retval = !input_gen_swipe(monkey->input_gen_ctx, + param->x1, param->y1, + param->x1, param->y1, + param->duration); } - - if (!retval) - { - MONKEY_LOG_NOTICE("detect monkey killed"); - } - - state.data.touch.is_pressed = false; - monkey_dev_set_state(dev, &state); } - else if (state.type & MONKEY_DEV_TYPE_BUTTON) + else if (dev_type & MONKEY_DEV_TYPE_BUTTON) { - /* press button */ - - state.data.button.value = 1 << monkey->config.btn_bit; - monkey_dev_set_state(dev, &state); - - retval = usleep(param->duration * 1000) == 0; - - /* release button */ - - state.data.button.value = 0; - monkey_dev_set_state(dev, &state); + retval = !input_gen_button_longpress(monkey->input_gen_ctx, + 1 << monkey->config.btn_bit, + param->duration); } else { - MONKEY_LOG_WARN("unsupport device type: %d", state.type); + MONKEY_LOG_WARN("unsupported device type: %d", dev_type); } return retval; diff --git a/graphics/input/monkey/monkey_main.c b/graphics/input/monkey/monkey_main.c index 72fdc6bd43a..43b0561c0cf 100644 --- a/graphics/input/monkey/monkey_main.c +++ b/graphics/input/monkey/monkey_main.c @@ -532,7 +532,7 @@ static enum monkey_wait_res_e monkey_wait(uint32_t ms) } else { - MONKEY_LOG_ERROR("Unknow error: %d", errcode); + MONKEY_LOG_ERROR("Unknown error: %d", errcode); } } else if (ret == SIGTSTP) diff --git a/graphics/input/monkey/monkey_proc.c b/graphics/input/monkey/monkey_proc.c index 9bd0ccd015f..fb09b074d7d 100644 --- a/graphics/input/monkey/monkey_proc.c +++ b/graphics/input/monkey/monkey_proc.c @@ -41,10 +41,10 @@ ****************************************************************************/ /**************************************************************************** - * Name: monkey_update_uinput_ramdom + * Name: monkey_update_uinput_random ****************************************************************************/ -static bool monkey_update_uinput_ramdom(FAR struct monkey_s *monkey) +static bool monkey_update_uinput_random(FAR struct monkey_s *monkey) { int i; bool retval = false; @@ -65,29 +65,15 @@ static bool monkey_update_uinput_ramdom(FAR struct monkey_s *monkey) return retval; } -/**************************************************************************** - * Name: monkey_search_dev - ****************************************************************************/ - -static FAR struct monkey_dev_s *monkey_search_dev( - FAR struct monkey_s *monkey, - enum monkey_dev_type_e type) -{ - int i; - for (i = 0; i < monkey->dev_num; i++) - { - FAR struct monkey_dev_s *dev = monkey->devs[i]; - if (type == dev->type) - { - return dev; - } - } - - return NULL; -} - /**************************************************************************** * Name: monkey_recorder_get_next + * + * Description: + * Gets the next recorder state + * + * Returned Value: + * 0 on error, 1 on end of file, 2 on success. + * ****************************************************************************/ static int monkey_recorder_get_next(FAR struct monkey_s *monkey, @@ -149,7 +135,6 @@ static bool monkey_update_uinput_playback(FAR struct monkey_s *monkey) struct monkey_dev_state_s next_state; uint32_t tick_elaps; - FAR struct monkey_dev_s *dev; int num_of_get; @@ -168,18 +153,7 @@ static bool monkey_update_uinput_playback(FAR struct monkey_s *monkey) memset(&monkey->playback_ctx, 0, sizeof(monkey->playback_ctx)); monkey_recorder_reset(monkey->recorder); case 2: - dev = monkey_search_dev(monkey, - MONKEY_UINPUT_TYPE_MASK | cur_state.type); - - if (dev) - { - monkey_dev_set_state(dev, &cur_state); - } - else - { - MONKEY_LOG_WARN("unsupport device type: %d", cur_state.type); - } - + monkey_dev_set_state(monkey->input_gen_ctx, &cur_state); tick_elaps = monkey_tick_elaps(next_time_stamp, cur_time_stamp); monkey_set_period(monkey, tick_elaps); break; @@ -203,7 +177,7 @@ static bool monkey_update_uinput(FAR struct monkey_s *monkey) if (monkey->mode == MONKEY_MODE_RANDOM) { - retval = monkey_update_uinput_ramdom(monkey); + retval = monkey_update_uinput_random(monkey); } else if(monkey->mode == MONKEY_MODE_PLAYBACK) { diff --git a/graphics/input/monkey/monkey_type.h b/graphics/input/monkey/monkey_type.h index 46dc644adc0..90fe442b715 100644 --- a/graphics/input/monkey/monkey_type.h +++ b/graphics/input/monkey/monkey_type.h @@ -27,6 +27,7 @@ * Included Files ****************************************************************************/ +#include #include #include @@ -124,6 +125,7 @@ struct monkey_s FAR struct monkey_dev_s *devs[MONKEY_DEV_MAX_NUM]; int dev_num; FAR struct monkey_recorder_s *recorder; + input_gen_ctx_t input_gen_ctx; struct { struct monkey_dev_state_s state; diff --git a/graphics/input/monkey/monkey_utils.c b/graphics/input/monkey/monkey_utils.c index 829f81399bf..57c6c4face9 100644 --- a/graphics/input/monkey/monkey_utils.c +++ b/graphics/input/monkey/monkey_utils.c @@ -155,44 +155,6 @@ bool monkey_dir_check(FAR const char *dir_path) return retval; } -/**************************************************************************** - * Name: monkey_map - ****************************************************************************/ - -int monkey_map(int x, int min_in, int max_in, int min_out, int max_out) -{ - if (max_in >= min_in && x >= max_in) - { - return max_out; - } - - if (max_in >= min_in && x <= min_in) - { - return min_out; - } - - if (max_in <= min_in && x <= max_in) - { - return max_out; - } - - if (max_in <= min_in && x >= min_in) - { - return min_out; - } - - /* The equation should be: - * ((x - min_in) * delta_out) / delta in) + min_out - * To avoid rounding error reorder the operations: - * (x - min_in) * (delta_out / delta_min) + min_out - */ - - int delta_in = max_in - min_in; - int delta_out = max_out - min_out; - - return ((x - min_in) * delta_out) / delta_in + min_out; -} - /**************************************************************************** * Name: monkey_dev_type2name ****************************************************************************/ @@ -210,7 +172,7 @@ FAR const char *monkey_dev_type2name(enum monkey_dev_type_e type) } } - return "unknow"; + return "unknown"; } /**************************************************************************** @@ -254,5 +216,5 @@ FAR const char *monkey_event_type2name(enum monkey_event_e event) break; } - return "unknow"; + return "unknown"; } diff --git a/graphics/input/monkey/monkey_utils.h b/graphics/input/monkey/monkey_utils.h index 59e63b57733..3577390e3f0 100644 --- a/graphics/input/monkey/monkey_utils.h +++ b/graphics/input/monkey/monkey_utils.h @@ -76,12 +76,6 @@ void monkey_get_localtime_str(FAR char *str_buf, size_t buf_size); bool monkey_dir_check(FAR const char *dir_path); -/**************************************************************************** - * Name: monkey_map - ****************************************************************************/ - -int monkey_map(int x, int min_in, int max_in, int min_out, int max_out); - /**************************************************************************** * Name: monkey_dev_type2name ****************************************************************************/ From 6f93e401aad540a8ceccdd2bfecd3eb9ce09c6bb Mon Sep 17 00:00:00 2001 From: liuchan3 Date: Wed, 19 Mar 2025 21:34:53 +0800 Subject: [PATCH 379/391] apps/graphics: Refactor the input tool using input generator library Signed-off-by: liuchan3 --- graphics/input/CMakeLists.txt | 2 + graphics/input/Kconfig | 3 +- graphics/input/generator/input.c | 311 ++++++++++++++----------------- 3 files changed, 149 insertions(+), 167 deletions(-) diff --git a/graphics/input/CMakeLists.txt b/graphics/input/CMakeLists.txt index b9ae1adecb3..2ec8eb86fb9 100644 --- a/graphics/input/CMakeLists.txt +++ b/graphics/input/CMakeLists.txt @@ -57,6 +57,8 @@ if(CONFIG_GRAPHICS_INPUT_TOOL) ${CONFIG_GRAPHICS_INPUT_TOOL_STACKSIZE} PRIORITY ${CONFIG_GRAPHICS_INPUT_TOOL_PRIORITY} + DEPENDS + input_generator SRCS generator/input.c) endif() diff --git a/graphics/input/Kconfig b/graphics/input/Kconfig index 126898bec76..c9094ef82dd 100644 --- a/graphics/input/Kconfig +++ b/graphics/input/Kconfig @@ -39,7 +39,8 @@ menuconfig GRAPHICS_INPUT_TOOL default n select UINPUT_TOUCH select UINPUT_BUTTONS - select UINPUT_KEYBOARD + select UINPUT_MOUSE + select GRAPHICS_INPUT_GENERATOR ---help--- Enable support for a command line input tool. diff --git a/graphics/input/generator/input.c b/graphics/input/generator/input.c index bf7cab40f11..a501acfdcef 100644 --- a/graphics/input/generator/input.c +++ b/graphics/input/generator/input.c @@ -27,17 +27,18 @@ #include #include #include +#include +#include #include -#include -#include /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ -#define DEFATLT_INTERVAL 30 -#define DEFATLT_DISTANCE 10 +#define SWIPE_DEFAULT_DURATION 300 +#define DRAG_DEFAULT_DURATION 500 +#define BUTTON_LONGPRESS_DEFAULT_DURATION 1000 #define DELAY_MS(ms) usleep((ms) * 1000) #define ABS(a) ((a) > 0 ? (a) : -(a)) @@ -48,22 +49,25 @@ struct input_cmd_s { - const char *cmd; /* Command name */ - int (*func)(int argc, char **argv); /* Function corresponding to command */ + /* Command name */ + + const char *cmd; + + /* Function corresponding to command */ + + int (*func)(input_gen_ctx_t ctx, int argc, char **argv); }; /**************************************************************************** * Private Function Prototypes ****************************************************************************/ -static int input_button(int argc, char **argv); -static int input_help(int argc, char **argv); -static int input_keydown(int argc, char **argv); -static int input_keyup(int argc, char **argv); -static int input_sleep(int argc, char **argv); -static void input_utouch_move(int fd, int x, int y, int pendown); -static int input_utouch_tap(int argc, char **argv); -static int input_utouch_swipe(int argc, char **argv); +static int input_button(input_gen_ctx_t ctx, int argc, char **argv); +static int input_help(input_gen_ctx_t ctx, int argc, char **argv); +static int input_sleep(input_gen_ctx_t ctx, int argc, char **argv); +static int input_utouch_tap(input_gen_ctx_t ctx, int argc, char **argv); +static int input_utouch_swipe(input_gen_ctx_t ctx, int argc, char **argv); +static int input_wheel(input_gen_ctx_t ctx, int argc, char **argv); /**************************************************************************** * Private Data @@ -71,14 +75,15 @@ static int input_utouch_swipe(int argc, char **argv); static const struct input_cmd_s g_input_cmd_list[] = { - {"help", input_help }, - {"sleep", input_sleep }, - {"tap", input_utouch_tap }, - {"swipe", input_utouch_swipe}, - {"button", input_button }, - {"keyup", input_keyup }, - {"keydown", input_keydown }, - {NULL, NULL } + {"help", input_help }, + {"sleep", input_sleep }, + {"tap", input_utouch_tap }, + {"swipe", input_utouch_swipe}, + {"drag", input_utouch_swipe}, + {"draganddrop", input_utouch_swipe}, + {"button", input_button }, + {"wheel", input_wheel }, + {NULL, NULL } }; /**************************************************************************** @@ -86,40 +91,63 @@ static const struct input_cmd_s g_input_cmd_list[] = ****************************************************************************/ /**************************************************************************** - * Name: input_utouch_move + * Name: parse_arg_to_int16 ****************************************************************************/ -static void input_utouch_move(int fd, int x, int y, int pendown) +static int parse_arg_to_int16(const char *arg, int16_t *result) { - struct touch_sample_s sample; /* Sampled touch point data */ + char *endptr; + long val; + + if (!arg || arg[0] == '\0') + { + return 1; + } - /* Handle the change from pen down to pen up */ + errno = 0; + val = strtol(arg, &endptr, 10); - if (pendown != TOUCH_DOWN) + if (errno != 0 || *endptr != '\0' || arg == endptr || + val < -32768 || val > 32767) { - sample.point[0].flags = TOUCH_UP | TOUCH_ID_VALID; + return 1; } - else + + *result = (int16_t)val; + return 0; +} + +/**************************************************************************** + * Name: parse_arg_to_uint32 + ****************************************************************************/ + +static int parse_arg_to_uint32(const char *arg, uint32_t *result) +{ + char *endptr; + uintmax_t val; + + if (!arg || arg[0] == '\0') { - sample.point[0].x = x; - sample.point[0].y = y; - sample.point[0].pressure = 42; - sample.point[0].flags = TOUCH_DOWN | TOUCH_ID_VALID | - TOUCH_POS_VALID | TOUCH_PRESSURE_VALID; + return 1; } - sample.npoints = 1; - sample.point[0].h = 1; - sample.point[0].w = 1; + errno = 0; + val = strtoumax(arg, &endptr, 0); + + if (errno != 0 || *endptr != '\0' || arg == endptr || val > UINT32_MAX) + { + return 1; + } - write(fd, &sample, sizeof(struct touch_sample_s)); + *result = (uint32_t)val; + return 0; } /**************************************************************************** * Name: input_sleep ****************************************************************************/ -static int input_sleep(int argc, char **argv) +static int input_sleep(input_gen_ctx_t ctx, int argc, char **argv) { if (argc != 2) { @@ -134,202 +162,141 @@ static int input_sleep(int argc, char **argv) * Name: input_utouch_tap ****************************************************************************/ -static int input_utouch_tap(int argc, char **argv) +static int input_utouch_tap(input_gen_ctx_t ctx, int argc, char **argv) { - int fd; - int x; - int y; - int interval = DEFATLT_INTERVAL; + int16_t x; + int16_t y; - if (argc < 3 || argc > 4) + if (argc != 3) { return -EINVAL; } - if (argc == 4) - { - interval = atoi(argv[3]); - } - - x = atoi(argv[1]); - y = atoi(argv[2]); - - fd = open("/dev/utouch", O_WRONLY); - if (fd < 0) + if (parse_arg_to_int16(argv[1], &x) || parse_arg_to_int16(argv[2], &y)) { - return -errno; + return -EINVAL; } - input_utouch_move(fd, x, y, TOUCH_DOWN); - DELAY_MS(interval); - input_utouch_move(fd, 0, 0, TOUCH_UP); - close(fd); - - return 0; + return input_gen_tap(ctx, x, y); } /**************************************************************************** * Name: input_utouch_swipe ****************************************************************************/ -static int input_utouch_swipe(int argc, char **argv) +static int input_utouch_swipe(input_gen_ctx_t ctx, int argc, char **argv) { - int i; - int fd; - int x0; - int x1; - int y0; - int y1; - int count; - int duration; - int distance = DEFATLT_DISTANCE; - int interval = DEFATLT_INTERVAL; - - if (argc < 5 || argc > 7) + int16_t x1; + int16_t x2; + int16_t y1; + int16_t y2; + bool is_swipe = strcmp(argv[0], "swipe") == 0; + uint32_t duration = is_swipe ? SWIPE_DEFAULT_DURATION + : DRAG_DEFAULT_DURATION; + + if (argc < 5 || argc > 6) { return -EINVAL; } - x0 = atoi(argv[1]); - x1 = atoi(argv[3]); - y0 = atoi(argv[2]); - y1 = atoi(argv[4]); - - fd = open("/dev/utouch", O_WRONLY); - if (fd < 0) + if (parse_arg_to_int16(argv[1], &x1) || parse_arg_to_int16(argv[3], &x2) || + parse_arg_to_int16(argv[2], &y1) || parse_arg_to_int16(argv[4], &y2)) { - return -errno; + return -EINVAL; } /* Number of times to calculate reports */ - if (argc >= 5) + if (argc > 5) { - duration = atoi(argv[5]); - } - - if (argc >= 6) - { - distance = atoi(argv[6]); - distance = distance == 0 ? DEFATLT_DISTANCE : distance; - } - - count = MAX(ABS(x0 - x1), ABS(y0 - y1)) / distance; - interval = duration == 0 ? DEFATLT_INTERVAL : duration / count; - - for (i = 0; i <= count; i++) - { - int x = x0 + (x1 - x0) / count * i; - int y = y0 + (y1 - y0) / count * i; - - input_utouch_move(fd, x, y, TOUCH_DOWN); - DELAY_MS(interval); + if (parse_arg_to_uint32(argv[5], &duration)) + { + return -EINVAL; + } } - input_utouch_move(fd, x1, y1, TOUCH_UP); - close(fd); - return 0; + return is_swipe ? input_gen_swipe(ctx, x1, y1, x2, y2, duration) + : input_gen_drag(ctx, x1, y1, x2, y2, duration); } -static int input_button(int argc, char **argv) +/**************************************************************************** + * Name: input_button + ****************************************************************************/ + +static int input_button(input_gen_ctx_t ctx, int argc, char **argv) { - int fd; btn_buttonset_t button; + uint32_t duration = 0; + int result = -EINVAL; - if (argc != 2) + if (argc < 2 || argc > 3) { - return -EINVAL; + return result; } - button = strtoul(argv[1], NULL, 0); - fd = open("/dev/ubutton", O_WRONLY); - if (fd < 0) + if (parse_arg_to_uint32(argv[1], &button)) { - return -errno; + return result; } - write(fd, &button, sizeof(button)); - close(fd); - - return 0; -} - -/**************************************************************************** - * Name: input_keyup - ****************************************************************************/ - -static int input_keyup(int argc, char **argv) -{ - int fd; - struct keyboard_event_s key; - - if (argc != 2 || argv[1] == NULL) + if (argc == 3) { - return -EINVAL; + if (parse_arg_to_uint32(argv[2], &duration)) + { + return -EINVAL; + } } - fd = open("/dev/ukeyboard", O_WRONLY); - if (fd < 0) + if (duration) { - return -errno; + result = input_gen_button_longpress(ctx, button, duration); + } + else + { + result = input_gen_button_click(ctx, button); } - key.code = strtoul(argv[1], NULL, 0); - key.type = KEYBOARD_RELEASE; - - write(fd, &key, sizeof(struct keyboard_event_s)); - close(fd); - return 0; + return result; } /**************************************************************************** - * Name: input_keydown + * Name: input_wheel ****************************************************************************/ -static int input_keydown(int argc, char **argv) +static int input_wheel(input_gen_ctx_t ctx, int argc, char **argv) { - int fd; - struct keyboard_event_s key; + int16_t wheel; - if (argc != 2 || argv[1] == NULL) + if (argc != 2) { return -EINVAL; } - fd = open("/dev/ukeyboard", O_WRONLY); - if (fd < 0) + if (parse_arg_to_int16(argv[1], &wheel)) { - return -errno; + return -EINVAL; } - key.code = strtoul(argv[1], NULL, 0); - key.type = KEYBOARD_PRESS; - - write(fd, &key, sizeof(struct keyboard_event_s)); - close(fd); - return 0; + return input_gen_mouse_wheel(ctx, wheel); } /**************************************************************************** * Name: intput_help ****************************************************************************/ -static int input_help(int argc, char **argv) +static int input_help(input_gen_ctx_t ctx, int argc, char **argv) { printf("Usage: input [...]\n"); - printf("The commands and default sources are:\n" + printf("The commands are:\n" "\thelp\n" "\tsleep \n" - "\ttap [interval(ms)]\n" - "\tswipe [duration(ms)] [distance(pix)]\n" - "\tbutton \n" - "\tkeyup: , input keyup 0x61\n" - "\tkeydown: , input keydown 0x61\n" - "\tinterval: Time interval between two reports of sample\n" + "\ttap \n" + "\tswipe [duration(ms)]\n" + "\tdrag | draganddrop [duration(ms)]\n" + "\tbutton [duration(ms)]\n" + "\twheel \n" "\tduration: Duration of sliding\n" - "\tdistance: Report the pixel distance of the sample twice\n" "\tbuttonvalue: button value in hex format\n" - "\tkeycode: x11 key code, hexadecimal format\n" ); return 0; @@ -351,27 +318,39 @@ int main(int argc, char **argv) { int i; int ret = -EINVAL; + input_gen_ctx_t input_gen_ctx; if (argv[1] == NULL) { goto errout; } + if (input_gen_create(&input_gen_ctx, INPUT_GEN_DEV_ALL) < 0) + { + printf("Failed to create input generator\n"); + return EXIT_FAILURE; + } + for (i = 0; g_input_cmd_list[i].cmd != NULL; i++) { /* Matching the function corresponding to the command */ if (strcmp(g_input_cmd_list[i].cmd, argv[1]) == 0) { - ret = g_input_cmd_list[i].func(argc - 1, &argv[1]); + ret = g_input_cmd_list[i].func(input_gen_ctx, argc - 1, &argv[1]); break; } } + if (input_gen_destroy(input_gen_ctx) < 0) + { + return EXIT_FAILURE; + } + errout: if (ret != 0) { - input_help(argc, argv); + input_help(NULL, argc, argv); return EXIT_FAILURE; } From fdf6f57d6c99c3fb06885fca4ef22e4e7f5b7e48 Mon Sep 17 00:00:00 2001 From: liuchan3 Date: Fri, 13 Jun 2025 16:39:52 +0800 Subject: [PATCH 380/391] graphics/input: Adjust input tool priority and sampling rate Align to monkey's priority, with a sampling rate similar to a real touch. Signed-off-by: liuchan3 --- graphics/input/Kconfig | 2 +- graphics/input/generator/input_gen_event.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/graphics/input/Kconfig b/graphics/input/Kconfig index c9094ef82dd..08430e8d80e 100644 --- a/graphics/input/Kconfig +++ b/graphics/input/Kconfig @@ -54,7 +54,7 @@ config GRAPHICS_INPUT_TOOL_STACKSIZE config GRAPHICS_INPUT_TOOL_PRIORITY int "input priority" - default 100 + default 110 ---help--- The priority of the input task. diff --git a/graphics/input/generator/input_gen_event.c b/graphics/input/generator/input_gen_event.c index d2de2b77f72..64637bb8560 100644 --- a/graphics/input/generator/input_gen_event.c +++ b/graphics/input/generator/input_gen_event.c @@ -293,7 +293,7 @@ static int input_gen_motion(input_gen_ctx_t ctx, { uint32_t elapsed = input_gen_tick_elapsed(input_gen_tick_get(), start); ret = input_gen_write_motion(dev->fd, fingers, nfingers, elapsed); - if (ret == -EAGAIN && usleep(1000) < 0) + if (ret == -EAGAIN && usleep(8 * 1000) < 0) { nwarn("WARNING: Maybe interrupted by signal\n"); input_gen_ungrab(dev); From 056f04d170a9f79f6eceea5bf11ba184ea6afd47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niccol=C3=B2=20Maggioni?= Date: Tue, 12 Aug 2025 20:36:37 +0200 Subject: [PATCH 381/391] tools/mksymtab: Replace deprecated fgrep usages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In most modern distros, fgrep is deprecated in favor of "grep -F" Signed-off-by: Niccolò Maggioni --- tools/mksymtab.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/mksymtab.sh b/tools/mksymtab.sh index 9c2a0cf9271..1f9d7ed8c24 100755 --- a/tools/mksymtab.sh +++ b/tools/mksymtab.sh @@ -72,10 +72,10 @@ if [ -z "$varlist" ]; then if [ ! -z "$execlist" ]; then # Get all undefined symbol names - varlist=`nm $execlist 2>/dev/null | fgrep ' U ' | sed -e "s/^[ ]*//g" | cut -d' ' -f2 | sort | uniq` + varlist=`nm $execlist 2>/dev/null | grep -F ' U ' | sed -e "s/^[ ]*//g" | cut -d' ' -f2 | sort | uniq` # Get all defined symbol names - deflist=`nm $execlist 2>/dev/null | fgrep -v -e ' U ' -e ':' | sed -e "s/^[0-9a-z]* //g" | cut -d' ' -f2 | sort | uniq` + deflist=`nm $execlist 2>/dev/null | grep -F -v -e ' U ' -e ':' | sed -e "s/^[0-9a-z]* //g" | cut -d' ' -f2 | sort | uniq` # Remove the intersection between them, and the remaining symbols are found in the main image common=`echo "$varlist" | tr ' ' '\n' | grep -Fxf <(echo "$deflist" | tr ' ' '\n') | tr '\n' ' '` From b0726955a0afde3b48b7d55d8a932eee4b1a35ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niccol=C3=B2=20Maggioni?= Date: Tue, 12 Aug 2025 20:36:01 +0200 Subject: [PATCH 382/391] fsutils/libtinycbor: Update TinyCBOR to 0.6.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update the TinyCBOR serialization library to the latest 0.6.1 tagged release. Signed-off-by: Niccolò Maggioni --- fsutils/libtinycbor/Makefile | 3 +- fsutils/libtinycbor/fix_open_memstream.patch | 36 +++++++++++--------- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/fsutils/libtinycbor/Makefile b/fsutils/libtinycbor/Makefile index 552df22cfd9..8d3424567c4 100644 --- a/fsutils/libtinycbor/Makefile +++ b/fsutils/libtinycbor/Makefile @@ -23,7 +23,7 @@ include $(APPDIR)/Make.defs TINYCBOR_URL ?= "https://github.com/intel/tinycbor/archive" -TINYCBOR_VERSION ?= 3cba6b11aaa0f6f674cd56ebaa573c4b65f71ee7 +TINYCBOR_VERSION ?= c0aad2fb2137a31b9845fbaae3653540c410f215 TINYCBOR_UNPACKNAME = tinycbor @@ -51,6 +51,7 @@ CSRCS += tinycbor/cborvalidation.c CSRCS += tinycbor/open_memstream.c CFLAGS += -std=c99 +CFLAGS += -DCBOR_NO_HALF_FLOAT_TYPE clean:: $(call DELFILE, $(OBJS)) diff --git a/fsutils/libtinycbor/fix_open_memstream.patch b/fsutils/libtinycbor/fix_open_memstream.patch index 031f3d2c183..832eff712f9 100644 --- a/fsutils/libtinycbor/fix_open_memstream.patch +++ b/fsutils/libtinycbor/fix_open_memstream.patch @@ -1,31 +1,33 @@ -From a66a373a9417d3f481e9346286d93e33fac8e616 Mon Sep 17 00:00:00 2001 -From: Lee Lup Yuen -Date: Wed, 5 Jan 2022 08:32:38 +0800 -Subject: [PATCH] Fix open_memstream.c compilation - diff --git a/tinycbor/open_memstream.c b/tinycbor/open_memstream.c index 3365378..37a0d08 100644 --- a/tinycbor/open_memstream.c +++ b/tinycbor/open_memstream.c -@@ -32,7 +32,7 @@ +@@ -32,13 +32,13 @@ #include #include - + -#if defined(__unix__) || defined(__APPLE__) +#if defined(__unix__) || defined(__APPLE__) || defined(__NuttX__) # include #endif - #ifdef __APPLE__ -@@ -41,6 +41,9 @@ typedef int LenType; - #elif __linux__ +-#ifdef __APPLE__ ++#if defined(__APPLE__) + typedef int RetType; + typedef int LenType; +-#elif __linux__ ++#elif defined(__linux__) || defined(__NuttX__) typedef ssize_t RetType; typedef size_t LenType; -+#elif __NuttX__ -+typedef ssize_t RetType; -+typedef size_t LenType; #else - # error "Cannot implement open_memstream!" - #endif --- -2.34.1 +@@ -99,9 +99,9 @@ FILE *open_memstream(char **bufptr, size_t *lenptr) + *bufptr = NULL; + *lenptr = 0; +-#ifdef __APPLE__ ++#if defined(__APPLE__) + return funopen(b, NULL, write_to_buffer, NULL, close_buffer); +-#elif __linux__ ++#elif defined(__linux__) || defined(__NuttX__) + static const cookie_io_functions_t vtable = { + NULL, + write_to_buffer, From d8dcc9926e2e76ac2e3a32aa2e9a8e7d8a99ae7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niccol=C3=B2=20Maggioni?= Date: Tue, 12 Aug 2025 20:34:13 +0200 Subject: [PATCH 383/391] crypto/libsodium: Update libsodium to 1.0.20 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update the libsodium crypto library to the latest 1.0.20 tagged release. Signed-off-by: Niccolò Maggioni --- ...ix-cannot-find-file-sodium-version.h.patch | 6 ++--- crypto/libsodium/Makefile | 22 +++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/crypto/libsodium/0002-fix-cannot-find-file-sodium-version.h.patch b/crypto/libsodium/0002-fix-cannot-find-file-sodium-version.h.patch index c4d5a41f8a2..46ca45dd767 100644 --- a/crypto/libsodium/0002-fix-cannot-find-file-sodium-version.h.patch +++ b/crypto/libsodium/0002-fix-cannot-find-file-sodium-version.h.patch @@ -23,10 +23,10 @@ index 00000000..e1f24c52 + +#include "export.h" + -+#define SODIUM_VERSION_STRING "1.0.18" ++#define SODIUM_VERSION_STRING "1.0.20" + -+#define SODIUM_LIBRARY_VERSION_MAJOR 11 -+#define SODIUM_LIBRARY_VERSION_MINOR 0 ++#define SODIUM_LIBRARY_VERSION_MAJOR 26 ++#define SODIUM_LIBRARY_VERSION_MINOR 2 + + +#ifdef __cplusplus diff --git a/crypto/libsodium/Makefile b/crypto/libsodium/Makefile index 68318a7175f..2ad47c9dc79 100644 --- a/crypto/libsodium/Makefile +++ b/crypto/libsodium/Makefile @@ -23,17 +23,17 @@ include $(APPDIR)/Make.defs LIBSODIUM_VERSION = $(patsubst "%",%,$(strip $(CONFIG_LIBSODIUM_VERSION))) -LIBSODIUM_URL ?= "https://github.com/jedisct1/libsodium/archive" +LIBSODIUM_URL ?= "https://github.com/jedisct1/libsodium/releases/download/$(LIBSODIUM_VERSION)-RELEASE" -LIBSODIUM_ZIP = $(LIBSODIUM_VERSION).zip +LIBSODIUM_TARGZ = "libsodium-$(LIBSODIUM_VERSION).tar.gz" LIBSODIUM_UNPACKNAME = libsodium -UNPACK ?= unzip -q -o +UNPACK ?= tar -xaf LIBSODIUM_UNPACKLIBDIR = $(LIBSODIUM_UNPACKNAME)$(DELIM)src$(DELIM)$(LIBSODIUM_UNPACKNAME) LIBSODIUM_UNPACKTESTDIR = $(LIBSODIUM_UNPACKNAME)$(DELIM)test$(DELIM)default -CSRCS += $(shell find $(LIBSODIUM_UNPACKLIBDIR) -name "*.c") +CSRCS += $(shell if [ -d "$(LIBSODIUM_UNPACKLIBDIR)" ]; then find "$(LIBSODIUM_UNPACKLIBDIR)" -name "*.c"; fi) CFLAGS += ${INCDIR_PREFIX}$(APPDIR)/crypto/libsodium/libsodium/src/libsodium/include/sodium CFLAGS += -DDEV_MODE -DCONFIGURED=1 CFLAGS += -Wno-unused-function -Wno-undef -Wno-unused-variable -Wno-deprecated-declarations \ @@ -48,13 +48,13 @@ PRIORITY = $(CONFIG_LIBSODIUM_TEST_PRIORITY) STACKSIZE = $(CONFIG_LIBSODIUM_TEST_STACKSIZE) endif -$(LIBSODIUM_ZIP): - @echo "Downloading: $(LIBSODIUM_URL)/$(LIBSODIUM_ZIP)" - $(Q) $(call DOWNLOAD,$(LIBSODIUM_URL),$(LIBSODIUM_ZIP)) +$(LIBSODIUM_TARGZ): + @echo "Downloading: $(LIBSODIUM_URL)/$(LIBSODIUM_TARGZ)" + $(Q) $(call DOWNLOAD,$(LIBSODIUM_URL),$(LIBSODIUM_TARGZ)) -$(LIBSODIUM_UNPACKNAME): $(LIBSODIUM_ZIP) - @echo "Unpacking: $(LIBSODIUM_ZIP) -> $(LIBSODIUM_UNPACKNAME)" - $(Q) $(UNPACK) $(LIBSODIUM_ZIP) +$(LIBSODIUM_UNPACKNAME): $(LIBSODIUM_TARGZ) + @echo "Unpacking: $(LIBSODIUM_TARGZ) -> $(LIBSODIUM_UNPACKNAME)" + $(Q) $(UNPACK) $(LIBSODIUM_TARGZ) $(Q) mv $(LIBSODIUM_UNPACKNAME)-$(LIBSODIUM_VERSION) $(LIBSODIUM_UNPACKNAME) $(Q) echo "Patching $(LIBSODIUM_UNPACKNAME)" $(Q) patch -p1 -d $(LIBSODIUM_UNPACKNAME) < 0001-fix-multiple-definition-bug-in-libsodium-test.patch @@ -68,4 +68,4 @@ distclean:: $(Q) rm -rf $(LIBSODIUM_UNPACKNAME) endif -include $(APPDIR)/Application.mk \ No newline at end of file +include $(APPDIR)/Application.mk From 14a39ee7ce11512747629ad401c6b440602b2c80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niccol=C3=B2=20Maggioni?= Date: Thu, 14 Aug 2025 16:24:30 +0200 Subject: [PATCH 384/391] examples/tmp112: Add new example for TMP112 temperature sensor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a new example that shows how to read the temperature from a TMP112 sensor registered on the I2C bus. Signed-off-by: Niccolò Maggioni --- examples/tmp112/CMakeLists.txt | 35 +++++++++++++++++ examples/tmp112/Kconfig | 36 ++++++++++++++++++ examples/tmp112/Make.defs | 25 ++++++++++++ examples/tmp112/Makefile | 36 ++++++++++++++++++ examples/tmp112/tmp112_main.c | 69 ++++++++++++++++++++++++++++++++++ 5 files changed, 201 insertions(+) create mode 100644 examples/tmp112/CMakeLists.txt create mode 100644 examples/tmp112/Kconfig create mode 100644 examples/tmp112/Make.defs create mode 100644 examples/tmp112/Makefile create mode 100644 examples/tmp112/tmp112_main.c diff --git a/examples/tmp112/CMakeLists.txt b/examples/tmp112/CMakeLists.txt new file mode 100644 index 00000000000..7f75995bbbb --- /dev/null +++ b/examples/tmp112/CMakeLists.txt @@ -0,0 +1,35 @@ +# ############################################################################## +# apps/examples/tmp112/CMakeLists.txt +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_EXAMPLES_TMP112) + nuttx_add_application( + NAME + ${CONFIG_EXAMPLES_TMP112_PROGNAME} + PRIORITY + ${CONFIG_EXAMPLES_TMP112_PRIORITY} + STACKSIZE + ${CONFIG_EXAMPLES_TMP112_STACKSIZE} + MODULE + ${CONFIG_EXAMPLES_TMP112} + SRCS + tmp112_main.c) +endif() diff --git a/examples/tmp112/Kconfig b/examples/tmp112/Kconfig new file mode 100644 index 00000000000..a033ab2a573 --- /dev/null +++ b/examples/tmp112/Kconfig @@ -0,0 +1,36 @@ +# +# For a description of the syntax of this configuration file, +# see the file kconfig-language.txt in the NuttX tools repository. +# + +config EXAMPLES_TMP112 + tristate "TMP112 temperature sensor example" + default n + depends on SENSORS_TMP112 + ---help--- + Enable the TMP112 example + +if EXAMPLES_TMP112 + +config EXAMPLES_TMP112_PROGNAME + string "Program name" + default "tmp112" + ---help--- + This is the name of the program that will be used when the NSH ELF + program is installed. + +config EXAMPLES_TMP112_PRIORITY + int "TMP112 task priority" + default 100 + +config EXAMPLES_TMP112_STACKSIZE + int "TMP112 stack size" + default DEFAULT_TASK_STACKSIZE + +config EXAMPLES_TMP112_DEVPATH + string "TMP112 device path" + default "/dev/temp0" + ---help--- + The default path to the TMP112 temperature sensor device + +endif diff --git a/examples/tmp112/Make.defs b/examples/tmp112/Make.defs new file mode 100644 index 00000000000..097f312681b --- /dev/null +++ b/examples/tmp112/Make.defs @@ -0,0 +1,25 @@ +############################################################################ +# apps/examples/tmp112/Make.defs +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +ifneq ($(CONFIG_EXAMPLES_TMP112),) +CONFIGURED_APPS += $(APPDIR)/examples/tmp112 +endif diff --git a/examples/tmp112/Makefile b/examples/tmp112/Makefile new file mode 100644 index 00000000000..745220032fe --- /dev/null +++ b/examples/tmp112/Makefile @@ -0,0 +1,36 @@ +############################################################################ +# apps/examples/tmp112/Makefile +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +include $(APPDIR)/Make.defs + +# TMP112 temperature sensor example built-in application info + +PROGNAME = $(CONFIG_EXAMPLES_TMP112_PROGNAME) +PRIORITY = $(CONFIG_EXAMPLES_TMP112_PRIORITY) +STACKSIZE = $(CONFIG_EXAMPLES_TMP112_STACKSIZE) +MODULE = $(CONFIG_EXAMPLES_TMP112) + +# TMP112 temperature sensor example + +MAINSRC = tmp112_main.c + +include $(APPDIR)/Application.mk diff --git a/examples/tmp112/tmp112_main.c b/examples/tmp112/tmp112_main.c new file mode 100644 index 00000000000..0fbf6f0f958 --- /dev/null +++ b/examples/tmp112/tmp112_main.c @@ -0,0 +1,69 @@ +/**************************************************************************** + * apps/examples/tmp112/tmp112_main.c + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +#include +#include + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: tmp112_main + ****************************************************************************/ + +int main(int argc, FAR char *argv[]) +{ + int fd; + int ret; + float sample; + + fd = open(CONFIG_EXAMPLES_TMP112_DEVPATH, O_RDONLY); + if (fd < 0) + { + printf("Failed to open TMP112 sensor at %s: %s (%d)\n", + CONFIG_EXAMPLES_TMP112_DEVPATH, strerror(errno), errno); + return EXIT_FAILURE; + } + + ret = read(fd, &sample, sizeof(float)); + if (ret != sizeof(sample)) + { + perror("Could not read"); + ret = EXIT_FAILURE; + } + else + { + printf("TMP112 = %.03f degrees Celsius\n", sample); + ret = EXIT_SUCCESS; + } + + close(fd); + + return ret; +} From dfd1eb0672b515779e86f7af7285692c2f473b34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niccol=C3=B2=20Maggioni?= Date: Tue, 19 Aug 2025 17:30:50 +0200 Subject: [PATCH 385/391] examples/ads7046: Add new example for ADS7046 ADC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a new example that shows how to read a sample from an ADS7046 ADC sensor registered on the SPI bus. Signed-off-by: Niccolò Maggioni --- examples/ads7046/CMakeLists.txt | 35 +++++++++++++ examples/ads7046/Kconfig | 36 +++++++++++++ examples/ads7046/Make.defs | 25 +++++++++ examples/ads7046/Makefile | 36 +++++++++++++ examples/ads7046/ads7046_main.c | 90 +++++++++++++++++++++++++++++++++ 5 files changed, 222 insertions(+) create mode 100644 examples/ads7046/CMakeLists.txt create mode 100644 examples/ads7046/Kconfig create mode 100644 examples/ads7046/Make.defs create mode 100644 examples/ads7046/Makefile create mode 100644 examples/ads7046/ads7046_main.c diff --git a/examples/ads7046/CMakeLists.txt b/examples/ads7046/CMakeLists.txt new file mode 100644 index 00000000000..6e875a149aa --- /dev/null +++ b/examples/ads7046/CMakeLists.txt @@ -0,0 +1,35 @@ +# ############################################################################## +# apps/examples/ads7046/CMakeLists.txt +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more contributor +# license agreements. See the NOTICE file distributed with this work for +# additional information regarding copyright ownership. The ASF licenses this +# file to you under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# +# ############################################################################## + +if(CONFIG_EXAMPLES_ADS7046) + nuttx_add_application( + NAME + ${CONFIG_EXAMPLES_ADS7046_PROGNAME} + PRIORITY + ${CONFIG_EXAMPLES_ADS7046_PRIORITY} + STACKSIZE + ${CONFIG_EXAMPLES_ADS7046_STACKSIZE} + MODULE + ${CONFIG_EXAMPLES_ADS7046} + SRCS + ads7046_main.c) +endif() diff --git a/examples/ads7046/Kconfig b/examples/ads7046/Kconfig new file mode 100644 index 00000000000..c2d825a60fa --- /dev/null +++ b/examples/ads7046/Kconfig @@ -0,0 +1,36 @@ +# +# For a description of the syntax of this configuration file, +# see the file kconfig-language.txt in the NuttX tools repository. +# + +config EXAMPLES_ADS7046 + tristate "ADS7046 ADC example" + default n + depends on ADC_ADS7046 + ---help--- + Enable the ADS7046 example + +if EXAMPLES_ADS7046 + +config EXAMPLES_ADS7046_PROGNAME + string "Program name" + default "ads7046" + ---help--- + This is the name of the program that will be used when the NSH ELF + program is installed. + +config EXAMPLES_ADS7046_PRIORITY + int "ADS7046 task priority" + default 100 + +config EXAMPLES_ADS7046_STACKSIZE + int "ADS7046 stack size" + default DEFAULT_TASK_STACKSIZE + +config EXAMPLES_ADS7046_DEVPATH + string "ADS7046 device path" + default "/dev/adc0" + ---help--- + The default path to the ADS7046 ADC device + +endif diff --git a/examples/ads7046/Make.defs b/examples/ads7046/Make.defs new file mode 100644 index 00000000000..171c570f445 --- /dev/null +++ b/examples/ads7046/Make.defs @@ -0,0 +1,25 @@ +############################################################################ +# apps/examples/ads7046/Make.defs +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +ifneq ($(CONFIG_EXAMPLES_ADS7046),) +CONFIGURED_APPS += $(APPDIR)/examples/ads7046 +endif diff --git a/examples/ads7046/Makefile b/examples/ads7046/Makefile new file mode 100644 index 00000000000..310ccea67c4 --- /dev/null +++ b/examples/ads7046/Makefile @@ -0,0 +1,36 @@ +############################################################################ +# apps/examples/ads7046/Makefile +# +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. The +# ASF licenses this file to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance with the +# License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +############################################################################ + +include $(APPDIR)/Make.defs + +# ADS7046 ADC example built-in application info + +PROGNAME = $(CONFIG_EXAMPLES_ADS7046_PROGNAME) +PRIORITY = $(CONFIG_EXAMPLES_ADS7046_PRIORITY) +STACKSIZE = $(CONFIG_EXAMPLES_ADS7046_STACKSIZE) +MODULE = $(CONFIG_EXAMPLES_ADS7046) + +# ADS7046 ADC example + +MAINSRC = ads7046_main.c + +include $(APPDIR)/Application.mk diff --git a/examples/ads7046/ads7046_main.c b/examples/ads7046/ads7046_main.c new file mode 100644 index 00000000000..1b0ca725327 --- /dev/null +++ b/examples/ads7046/ads7046_main.c @@ -0,0 +1,90 @@ +/**************************************************************************** + * apps/examples/ads7046/ads7046_main.c + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* As per the datasheet, the ADS7046 returns the following readings: + * INPUT VOLTAGE (AINP - AINM) DESCRIPTION HEX + * -------------------------------------- ------------------------ --- + * <= 1 LSB Negative full-scale code 000 + * 1 LSB to 2 LSB - 001 + * V_REF / 2 to V_REF / 2 + 1 LSB Mid code 7FF + * V_REF / 2 + 1 LSB to V_REF / 2 + 2 LSB - 800 + * >= V_REF - 1 LSB Positive full-scale code FFF + */ + +#define SAMPLE_TO_PCT(sample) (((sample) * 100) / 0xfff) + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: ads7046_main + ****************************************************************************/ + +int main(const int argc, FAR char *argv[]) +{ + UNUSED(argc); + UNUSED(argv); + + int ret; + int fd; + uint16_t sample; + + fd = open(CONFIG_EXAMPLES_ADS7046_DEVPATH, O_RDONLY); + if (fd < 0) + { + printf("Failed to open %s: %s (%d)\n", CONFIG_EXAMPLES_ADS7046_DEVPATH, + strerror(errno), errno); + return EXIT_FAILURE; + } + + ret = ioctl(fd, ANIOC_ADS7046_READ, &sample); + if (ret != OK) + { + perror("Could not ioctl fd"); + close(fd); + return EXIT_FAILURE; + } + + printf("ADS7046: hex=%x, dec=%"PRIu16", adc_percentage=%u%%\n", + sample, sample, SAMPLE_TO_PCT(sample)); + + close(fd); + + return EXIT_SUCCESS; +} From 78bae4f14f242c47dfd65d5d5a1fc83e2f789807 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Mon, 7 Jul 2025 13:18:21 +0900 Subject: [PATCH 386/391] system/dd: portability to non-nuttx platforms while this is not a goal for this repository, it's convenient for me (hopefully for some others too) to be able to build this for other platforms. an obvious downside is to have a few more ifdefs. tested with: ``` /opt/wasi-sdk-25.0/bin/clang -Wall -Oz -s -o dd.wasm dd_main.c ``` Signed-off-by: YAMAMOTO Takashi --- system/dd/dd_main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/system/dd/dd_main.c b/system/dd/dd_main.c index 4ab595b078b..a67698608d0 100644 --- a/system/dd/dd_main.c +++ b/system/dd/dd_main.c @@ -31,7 +31,9 @@ #include #include +#if defined(__NuttX__) #include +#endif #include #include #include @@ -246,11 +248,15 @@ static int dd_verify(FAR struct dd_s *dd) if (memcmp(dd->buffer, buffer, dd->nbytes) != 0) { +#if defined(__NuttX__) char msg[32]; snprintf(msg, sizeof(msg), "infile sector %d", sector); lib_dumpbuffer(msg, dd->buffer, dd->nbytes); snprintf(msg, sizeof(msg), "\noutfile sector %d", sector); lib_dumpbuffer(msg, buffer, dd->nbytes); +#else + printf("%s: sector %d differs unexpectedly\n", g_dd, sector); +#endif ret = ERROR; break; } From 93ced081dcab9efd4dbadfce823e7163e0be35b2 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Tue, 26 Aug 2025 15:21:00 +0900 Subject: [PATCH 387/391] system/dd/dd_main.c: replace `#if defined` with `#ifdef` Although I personally prefer the former, at least one reviewer preferred the latter. I coundn't find project-wide preferences. Anyway, this is not important for me. Signed-off-by: YAMAMOTO Takashi --- system/dd/dd_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/system/dd/dd_main.c b/system/dd/dd_main.c index a67698608d0..f73d9a999c1 100644 --- a/system/dd/dd_main.c +++ b/system/dd/dd_main.c @@ -24,14 +24,14 @@ * Included Files ****************************************************************************/ -#if defined(__NuttX__) +#ifdef __NuttX__ #include #endif #include #include -#if defined(__NuttX__) +#ifdef __NuttX__ #include #endif #include @@ -248,7 +248,7 @@ static int dd_verify(FAR struct dd_s *dd) if (memcmp(dd->buffer, buffer, dd->nbytes) != 0) { -#if defined(__NuttX__) +#ifdef __NuttX__ char msg[32]; snprintf(msg, sizeof(msg), "infile sector %d", sector); lib_dumpbuffer(msg, dd->buffer, dd->nbytes); From 71ce94a13ec725ea969002d63818074f18fd4ae3 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Tue, 26 Aug 2025 15:24:17 +0900 Subject: [PATCH 388/391] system/dd/dd_main.c: fix a typo in a comment Found by the CI. Signed-off-by: YAMAMOTO Takashi --- system/dd/dd_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/dd/dd_main.c b/system/dd/dd_main.c index f73d9a999c1..e666274e18f 100644 --- a/system/dd/dd_main.c +++ b/system/dd/dd_main.c @@ -81,7 +81,7 @@ struct dd_s uint32_t nsectors; /* Number of sectors to transfer */ uint32_t skip; /* The number of sectors skipped on input */ uint32_t seek; /* The number of sectors seeked on output */ - int oflags; /* The open flags on output deivce */ + int oflags; /* The open flags on output device */ bool eof; /* true: The end of the input or output file has been hit */ size_t sectsize; /* Size of one sector */ size_t nbytes; /* Number of valid bytes in the buffer */ From 0e65af606f53f3fa0ba52a86514ef7d23986887a Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Tue, 26 Aug 2025 16:12:42 +0900 Subject: [PATCH 389/391] mbedtls: Add an option to build ssl_client2 test program Signed-off-by: YAMAMOTO Takashi --- crypto/mbedtls/.gitignore | 1 + crypto/mbedtls/Kconfig | 25 +++++++++++++++++++++++ crypto/mbedtls/Makefile | 43 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 69 insertions(+) diff --git a/crypto/mbedtls/.gitignore b/crypto/mbedtls/.gitignore index d96514d8d41..247a661f55a 100644 --- a/crypto/mbedtls/.gitignore +++ b/crypto/mbedtls/.gitignore @@ -1,2 +1,3 @@ /mbedtls +/mbedtls-framework /*.zip diff --git a/crypto/mbedtls/Kconfig b/crypto/mbedtls/Kconfig index 9870a1b9ec0..53b043017d5 100644 --- a/crypto/mbedtls/Kconfig +++ b/crypto/mbedtls/Kconfig @@ -788,6 +788,31 @@ config MBEDTLS_APP_SELFTEST_STACKSIZE endif # MBEDTLS_APP_SELFTEST +config MBEDTLS_APP_SSL_CLIENT2 + bool "Mbed TLS ssl_client2 sample program" + default n + ---help--- + Enable the Mbed TLS ssl_client2 + +if MBEDTLS_APP_SSL_CLIENT2 + +config MBEDTLS_APP_SSL_CLIENT2_PROGNAME + string "Program name" + default "ssl_client2" + ---help--- + This is the name of the program that will be used when the NSH ELF + program is installed. + +config MBEDTLS_APP_SSL_CLIENT2_PRIORITY + int "ssl_client2 task priority" + default 100 + +config MBEDTLS_APP_SSL_CLIENT2_STACKSIZE + int "ssl_client2 stack size" + default MBEDTLS_DEFAULT_TASK_STACKSIZE + +endif # MBEDTLS_APP_SSL_CLIENT2 + endif # MBEDTLS_APPS endif # CRYPTO_MBEDTLS diff --git a/crypto/mbedtls/Makefile b/crypto/mbedtls/Makefile index 3428aa0e9b1..33038411132 100644 --- a/crypto/mbedtls/Makefile +++ b/crypto/mbedtls/Makefile @@ -37,6 +37,13 @@ UNPACK ?= unzip -q -o MBEDTLS_UNPACKLIBDIR = $(MBEDTLS_UNPACKNAME)$(DELIM)library MBEDTLS_UNPACKPROGDIR = $(MBEDTLS_UNPACKNAME)$(DELIM)programs +MBEDTLS_FRAMEWORK_URL ?= "https://github.com/Mbed-TLS/mbedtls-framework/archive" + +MBEDTLS_FRAMEWORK_VERSION = df3307f2b4fe512def60886024f7be8fd1523ccd +MBEDTLS_FRAMEWORK_ZIP = $(MBEDTLS_FRAMEWORK_VERSION).zip + +MBEDTLS_FRAMEWORK_UNPACKNAME = mbedtls-framework + # This lets Mbed TLS better use some of the POSIX features we have CFLAGS += ${DEFINE_PREFIX}unix @@ -64,6 +71,10 @@ $(MBEDTLS_ZIP): @echo "Downloading: $(MBEDTLS_URL)/$(MBEDTLS_ZIP)" $(Q) curl -O -L $(MBEDTLS_URL)/$(MBEDTLS_ZIP) +$(MBEDTLS_FRAMEWORK_ZIP): + @echo "Downloading: $(MBEDTLS_FRAMEWORK_URL)/$(MBEDTLS_FRAMEWORK_ZIP)" + $(Q) curl -O -L $(MBEDTLS_FRAMEWORK_URL)/$(MBEDTLS_FRAMEWORK_ZIP) + $(MBEDTLS_UNPACKNAME): $(MBEDTLS_ZIP) @echo "Unpacking: $(MBEDTLS_ZIP) -> $(MBEDTLS_UNPACKNAME)" $(Q) $(UNPACK) $(MBEDTLS_ZIP) @@ -73,6 +84,11 @@ $(MBEDTLS_UNPACKNAME): $(MBEDTLS_ZIP) $(Q) patch -p1 -d $(MBEDTLS_UNPACKNAME) < 0003-Fix-MBEDTLS_SSL_DTLS_CONNECTION_ID_COMPAT-warning.patch $(Q) touch $(MBEDTLS_UNPACKNAME) +$(MBEDTLS_FRAMEWORK_UNPACKNAME): $(MBEDTLS_FRAMEWORK_ZIP) + @echo "Unpacking: $(MBEDTLS_ZIP) -> $(MBEDTLS_FRAMEWORK_UNPACKNAME)" + $(Q) $(UNPACK) $(MBEDTLS_FRAMEWORK_ZIP) + $(Q) mv mbedtls-framework-$(MBEDTLS_FRAMEWORK_VERSION) $(MBEDTLS_FRAMEWORK_UNPACKNAME) + # Download and unpack tarball if no git repo found ifeq ($(wildcard $(MBEDTLS_UNPACKNAME)/.git),) context:: $(MBEDTLS_UNPACKNAME) @@ -106,6 +122,33 @@ STACKSIZE += $(CONFIG_MBEDTLS_APP_SELFTEST_STACKSIZE) MAINSRC += $(MBEDTLS_UNPACKPROGDIR)/test/selftest.c endif +ifeq ($(CONFIG_MBEDTLS_APP_SSL_CLIENT2),y) + +PROGNAME += $(CONFIG_MBEDTLS_APP_SSL_CLIENT2_PROGNAME) +PRIORITY += $(CONFIG_MBEDTLS_APP_SSL_CLIENT2_PRIORITY) +STACKSIZE += $(CONFIG_MBEDTLS_APP_SSL_CLIENT2_STACKSIZE) + +MAINSRC += $(MBEDTLS_UNPACKPROGDIR)/ssl/ssl_client2.c +CSRCS += $(MBEDTLS_UNPACKPROGDIR)/ssl/ssl_test_lib.c +CSRCS += $(MBEDTLS_UNPACKPROGDIR)/test/query_config.c +CSRCS += $(MBEDTLS_UNPACKNAME)/tests/src/certs.c +CSRCS += $(MBEDTLS_FRAMEWORK_UNPACKNAME)/tests/src/helpers.c +CSRCS += $(MBEDTLS_FRAMEWORK_UNPACKNAME)/tests/src/psa_crypto_helpers.c +CFLAGS += ${INCDIR_PREFIX}$(MBEDTLS_UNPACKLIBDIR) +CFLAGS += ${INCDIR_PREFIX}$(MBEDTLS_UNPACKNAME)/tests/include +CFLAGS += ${INCDIR_PREFIX}$(MBEDTLS_FRAMEWORK_UNPACKNAME)/tests/include +CFLAGS += ${INCDIR_PREFIX}$(MBEDTLS_FRAMEWORK_UNPACKNAME)/tests/programs +endif + +# Download and unpack tarball if no git repo found +ifeq ($(wildcard $(MBEDTLS_FRAMEWORK_UNPACKNAME)/.git),) +context:: $(MBEDTLS_FRAMEWORK_UNPACKNAME) + +distclean:: + $(call DELDIR, $(MBEDTLS_FRAMEWORK_UNPACKNAME)) + $(call DELFILE, $(MBEDTLS_FRAMEWORK_ZIP)) +endif + endif # Configuration alternative implementation From 7ac03cfceff4e7156560c2c972e70904a8790767 Mon Sep 17 00:00:00 2001 From: Michal Lenc Date: Wed, 27 Aug 2025 09:58:41 +0200 Subject: [PATCH 390/391] boot/nxboot/loader/boot.c: avoid unwanted confirm on double update Following steps led to incorrect behavior: - upload update image - restart device and perform the update - upload the same update image again without confirming This led to the unwanted confirm of the update image. This change ensures the update image is not confirmed by uploading the same image to the update slot. The correct behavior is to perform revert to the last stable image if this occurs. Signed-off-by: Michal Lenc --- boot/nxboot/loader/boot.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/boot/nxboot/loader/boot.c b/boot/nxboot/loader/boot.c index f7a24c7cd34..6de9659ac02 100644 --- a/boot/nxboot/loader/boot.c +++ b/boot/nxboot/loader/boot.c @@ -313,6 +313,8 @@ static enum nxboot_update_type nxboot_progress(nxboot_progress_end); return NXBOOT_UPDATE_TYPE_UPDATE; } + + flash_partition_erase_first_sector(update); } nxboot_progress(nxboot_progress_end); @@ -643,12 +645,14 @@ int nxboot_get_state(struct nxboot_state *state) else if (IS_INTERNAL_MAGIC(primary_header.magic)) { recovery_pointer = primary_header.magic & NXBOOT_RECOVERY_PTR_MASK; - if (recovery_pointer == NXBOOT_SECONDARY_SLOT_NUM) + if (recovery_pointer == NXBOOT_SECONDARY_SLOT_NUM && + IS_INTERNAL_MAGIC(secondary_header.magic)) { state->primary_confirmed = primary_header.crc == secondary_header.crc; } - else if (recovery_pointer == NXBOOT_TERTIARY_SLOT_NUM) + else if (recovery_pointer == NXBOOT_TERTIARY_SLOT_NUM && + IS_INTERNAL_MAGIC(tertiary_header.magic)) { state->primary_confirmed = primary_header.crc == tertiary_header.crc; From 61e82925dc8dd8e9cb9544ef8b0b0f218a6d68c7 Mon Sep 17 00:00:00 2001 From: Tiago Medicci Date: Mon, 25 Aug 2025 13:28:35 -0300 Subject: [PATCH 391/391] examples/i2schar: Implement loopback mode check This commit implements the loopback mode for the i2schar example application. This mode - available only when both RX and TX are enabled - allows the user to test the I2S buses when the TX pin is connected to the RX pin. This is done by pre-filling a buffer with known data (additionally, it checks the peripheral's data width to format the data in the buffer accordingly) and passing it for both the transmitter and the receiver threads. This buffer is written to the TX and the received buffer is compared to the known buffer. Signed-off-by: Tiago Medicci --- examples/i2schar/i2schar.h | 3 +- examples/i2schar/i2schar_main.c | 295 ++++++++++++++++++++++++- examples/i2schar/i2schar_receiver.c | 61 ++++- examples/i2schar/i2schar_transmitter.c | 35 +-- 4 files changed, 358 insertions(+), 36 deletions(-) diff --git a/examples/i2schar/i2schar.h b/examples/i2schar/i2schar.h index fb73a6c40e1..73e9f6ea37f 100644 --- a/examples/i2schar/i2schar.h +++ b/examples/i2schar/i2schar.h @@ -73,7 +73,7 @@ #endif #ifndef CONFIG_EXAMPLES_I2SCHAR_BUFSIZE -# define CONFIG_EXAMPLES_I2SCHAR_BUFSIZE 256 +# define CONFIG_EXAMPLES_I2SCHAR_BUFSIZE 256 #endif /**************************************************************************** @@ -83,6 +83,7 @@ struct i2schar_state_s { bool initialized; + bool loopback; FAR char *devpath; #ifdef CONFIG_EXAMPLES_I2SCHAR_TX int txcount; diff --git a/examples/i2schar/i2schar_main.c b/examples/i2schar/i2schar_main.c index ea5d6850ff5..dec7b70c1bb 100644 --- a/examples/i2schar/i2schar_main.c +++ b/examples/i2schar/i2schar_main.c @@ -34,6 +34,10 @@ #include #include #include +#include +#include +#include +#include #include "i2schar.h" @@ -91,12 +95,18 @@ static void i2schar_help(FAR struct i2schar_state_s *i2schar) printf("Usage: i2schar [OPTIONS]\n"); printf("\nArguments are \"sticky\".\n"); printf("For example, once the I2C character device is\n"); - printf("specified, that device will be re-used until it is changed.\n"); + printf("specified, that device will be reused until it is changed.\n"); printf("\n\"sticky\" OPTIONS include:\n"); printf(" [-p devpath] selects the I2C character device path. " "Default: %s Current: %s\n", CONFIG_EXAMPLES_I2SCHAR_DEVPATH, g_i2schar.devpath ? g_i2schar.devpath : "NONE"); +#if defined(CONFIG_EXAMPLES_I2SCHAR_TX) && defined(CONFIG_EXAMPLES_I2SCHAR_RX) + printf(" [-l [0|1]] enables/disables loopback mode " + "(0=disable, 1=enable, no value=enable). " + "Default: disabled Current: %s\n", + g_i2schar.loopback ? "enabled" : "disabled"); +#endif #ifdef CONFIG_EXAMPLES_I2SCHAR_TX printf(" [-t count] selects the number of audio buffers to send. " "Default: %d Current: %d\n", @@ -175,8 +185,81 @@ static void parse_args(FAR struct i2schar_state_s *i2schar, index += nargs; break; +#if defined(CONFIG_EXAMPLES_I2SCHAR_TX) && defined(CONFIG_EXAMPLES_I2SCHAR_RX) + case 'l': + + /* Check if a value is provided */ + + if (ptr[2] == '\0' && index + 1 < argc && + argv[index + 1][0] != '-') + { + /* Value provided as next argument */ + + long loopback = strtol(argv[index + 1], NULL, 10); + + if (loopback == 0) + { + i2schar->loopback = false; + } + else if (loopback == 1) + { + i2schar->loopback = true; + } + else + { + printf("Invalid loopback value: %ld (must be 0 or 1)\n", + loopback); + exit(1); + } + + index += 2; + } + else if (ptr[2] == '\0') + { + /* No value provided, default to enable */ + + i2schar->loopback = true; + index += 1; + } + + else + { + /* Value provided as part of the same argument */ + + long loopback = strtol(&ptr[2], NULL, 10); + + if (loopback == 0) + { + i2schar->loopback = false; + } + else if (loopback == 1) + { + i2schar->loopback = true; + } + else + { + printf("Invalid loopback value: %ld (must be 0 or 1)\n", + loopback); + exit(1); + } + + index += 1; + } + break; +#endif + #ifdef CONFIG_EXAMPLES_I2SCHAR_RX case 'r': +#if defined(CONFIG_EXAMPLES_I2SCHAR_TX) && defined(CONFIG_EXAMPLES_I2SCHAR_RX) + if (i2schar->loopback) + { + printf("i2schar_main: Warning: -r argument " + "ignored in loopback mode\n"); + index += 1; + break; + } +#endif + nargs = arg_decimal(&argv[index], &value); if (value < 0) { @@ -191,6 +274,16 @@ static void parse_args(FAR struct i2schar_state_s *i2schar, #ifdef CONFIG_EXAMPLES_I2SCHAR_TX case 't': +#if defined(CONFIG_EXAMPLES_I2SCHAR_TX) && defined(CONFIG_EXAMPLES_I2SCHAR_RX) + if (i2schar->loopback) + { + printf("i2schar_main: Warning: -t argument " + "ignored in loopback mode\n"); + index += 1; + break; + } +#endif + nargs = arg_decimal(&argv[index], &value); if (value < 0) { @@ -215,6 +308,107 @@ static void parse_args(FAR struct i2schar_state_s *i2schar, } } +#ifdef CONFIG_EXAMPLES_I2SCHAR_TX + +/**************************************************************************** + * Name: i2schar_prepare_tx_buffer + ****************************************************************************/ + +static struct ap_buffer_s *i2schar_prepare_tx_buffer(uint32_t data_width) +{ + FAR struct ap_buffer_s *apb; + struct audio_buf_desc_s desc; + int ret; + int j; + uint32_t crap = 0; + + /* Allocate an audio buffer of the configured size */ + + desc.numbytes = CONFIG_EXAMPLES_I2SCHAR_BUFSIZE; + desc.u.pbuffer = &apb; + + ret = apb_alloc(&desc); + if (ret < 0) + { + printf("i2schar_prepare_tx_buffer: ERROR: failed to " + "allocate buffer: %d\n", ret); + return NULL; + } + + /* Fill the audio buffer with sequential data based on data width */ + + if (data_width == 8) + { + uint8_t *ptr8 = (uint8_t *)apb->samp; + + /* 8-bit data: fill with sequential bytes */ + + for (j = 0; j < CONFIG_EXAMPLES_I2SCHAR_BUFSIZE; j++) + { + *ptr8++ = crap++; + } + } + else if (data_width == 16) + { + /* 16-bit data: fill with sequential 16-bit values */ + + uint16_t *ptr16 = (uint16_t *)apb->samp; + int samples_16bit = CONFIG_EXAMPLES_I2SCHAR_BUFSIZE / 2; + for (j = 0; j < samples_16bit; j++) + { + *ptr16++ = crap++; + } + } + else if (data_width == 24) + { + /* 24-bit data: fill with sequential 24-bit values (3 bytes each) */ + + uint8_t *ptr8 = apb->samp; + int samples_24bit = CONFIG_EXAMPLES_I2SCHAR_BUFSIZE / 3; + for (j = 0; j < samples_24bit; j++) + { + /* Store 24-bit value in little-endian format */ + + *ptr8++ = crap & 0xff; + *ptr8++ = (crap >> 8) & 0xff; + *ptr8++ = (crap >> 16) & 0xff; + crap++; + } + } + else if (data_width == 32) + { + /* 32-bit data: fill with sequential 32-bit values */ + + uint32_t *ptr32 = (uint32_t *)apb->samp; + int samples_32bit = CONFIG_EXAMPLES_I2SCHAR_BUFSIZE / 4; + for (j = 0; j < samples_32bit; j++) + { + *ptr32++ = crap++; + } + } + else + { + uint8_t *ptr = (uint8_t *)apb->samp; + + /* Unknown data width, fall back to byte-by-byte */ + + printf("i2schar_prepare_tx_buffer: Unknown data width %"PRIu32", " + "using byte mode\n", data_width); + for (j = 0, ptr = apb->samp; j < CONFIG_EXAMPLES_I2SCHAR_BUFSIZE; j++) + { + *ptr++ = crap++; + } + } + + apb->nbytes = CONFIG_EXAMPLES_I2SCHAR_BUFSIZE; + + printf("i2schar_prepare_tx_buffer: Prepared transmitter buffer " + "with %"PRIu32"-bit data\n", data_width); + + return apb; +} +#endif + /**************************************************************************** * Public Functions ****************************************************************************/ @@ -229,6 +423,7 @@ int main(int argc, FAR char *argv[]) pthread_addr_t result; #ifdef CONFIG_EXAMPLES_I2SCHAR_TX pthread_t transmitter; + int fd; #endif #ifdef CONFIG_EXAMPLES_I2SCHAR_RX pthread_t receiver; @@ -236,6 +431,8 @@ int main(int argc, FAR char *argv[]) #if defined(CONFIG_EXAMPLES_I2SCHAR_RX) & defined(CONFIG_EXAMPLES_I2SCHAR_TX) struct sched_param param; #endif + FAR struct ap_buffer_s *transmitter_apb = NULL; + uint32_t data_width = 16; /* Default data width */ int ret; UNUSED(ret); @@ -269,6 +466,10 @@ int main(int argc, FAR char *argv[]) g_i2schar.rxcount = CONFIG_EXAMPLES_I2SCHAR_RXBUFFERS; #endif +#if defined(CONFIG_EXAMPLES_I2SCHAR_TX) && defined(CONFIG_EXAMPLES_I2SCHAR_RX) + g_i2schar.loopback = false; /* Default to disabled */ +#endif + g_i2schar.initialized = true; } @@ -276,6 +477,66 @@ int main(int argc, FAR char *argv[]) parse_args(&g_i2schar, argc, argv); +#ifdef CONFIG_EXAMPLES_I2SCHAR_TX + + /* Get I2S configuration parameters to set data width */ + + fd = open(g_i2schar.devpath, O_RDONLY); + if (fd >= 0) + { + ret = ioctl(fd, I2SIOC_GTXDATAWIDTH, (unsigned long)&data_width); + if (ret >= 0) + { + printf("i2schar_main: TX data width: %" PRIu32 " bits\n", + data_width); + } + else + { + printf("i2schar_main: Failed to get TX data width: %d\n", ret); + printf("i2schar_main: Using default data width: %" PRIu32 " " + "bits\n", data_width); + } + + close(fd); + } + else + { + printf("i2schar_main: Failed to open device for data width query: " + "%d\n", errno); + printf("i2schar_main: Using default data width: %" PRIu32 " bits\n", + data_width); + } + + /* Always prepare the transmitter buffer when transmitter is enabled */ + + transmitter_apb = i2schar_prepare_tx_buffer(data_width); + + if (transmitter_apb == NULL) + { + printf("i2schar_main: ERROR: failed to prepare transmitter buffer\n"); + return EXIT_FAILURE; + } +#endif + +#if defined(CONFIG_EXAMPLES_I2SCHAR_TX) && defined(CONFIG_EXAMPLES_I2SCHAR_RX) + + /* Handle loopback mode */ + + if (g_i2schar.loopback) + { + printf("i2schar_main: Loopback mode enabled\n"); + + /* In loopback mode, we only send/receive one buffer each */ + + g_i2schar.txcount = 1; + g_i2schar.rxcount = 1; + } + else + { + printf("i2schar_main: Loopback mode disabled\n"); + } +#endif + sched_lock(); #ifdef CONFIG_EXAMPLES_I2SCHAR_RX /* Start the receiver thread */ @@ -301,7 +562,9 @@ int main(int argc, FAR char *argv[]) /* Start the receiver */ - ret = pthread_create(&receiver, &attr, i2schar_receiver, NULL); + ret = pthread_create(&receiver, &attr, i2schar_receiver, + g_i2schar.loopback ? \ + (pthread_addr_t)transmitter_apb : NULL); if (ret != OK) { sched_unlock(); @@ -325,7 +588,8 @@ int main(int argc, FAR char *argv[]) /* Start the transmitter */ - ret = pthread_create(&transmitter, &attr, i2schar_transmitter, NULL); + ret = pthread_create(&transmitter, &attr, i2schar_transmitter, + (pthread_addr_t)transmitter_apb); if (ret != OK) { sched_unlock(); @@ -349,6 +613,13 @@ int main(int argc, FAR char *argv[]) { printf("i2schar_main: ERROR: pthread_join failed: %d\n", ret); } +#if defined(CONFIG_EXAMPLES_I2SCHAR_TX) && defined(CONFIG_EXAMPLES_I2SCHAR_RX) + else if (g_i2schar.loopback && result != NULL) + { + printf("i2schar_main: ERROR: Loopback verification failed\n"); + ret = EXIT_FAILURE; + } +#endif #endif #ifdef CONFIG_EXAMPLES_I2SCHAR_RX @@ -358,7 +629,23 @@ int main(int argc, FAR char *argv[]) { printf("i2schar_main: ERROR: pthread_join failed: %d\n", ret); } +#if defined(CONFIG_EXAMPLES_I2SCHAR_TX) && defined(CONFIG_EXAMPLES_I2SCHAR_RX) + else if (g_i2schar.loopback && result != NULL) + { + printf("i2schar_main: ERROR: Loopback verification failed\n"); + ret = EXIT_FAILURE; + } +#endif +#endif + +#ifdef CONFIG_EXAMPLES_I2SCHAR_TX + /* Clean up transmitter buffer if it was allocated */ + + if (transmitter_apb != NULL) + { + apb_free(transmitter_apb); + } #endif - return EXIT_SUCCESS; + return ret; } diff --git a/examples/i2schar/i2schar_receiver.c b/examples/i2schar/i2schar_receiver.c index 843381ccc5a..fdcc0c8ba7c 100644 --- a/examples/i2schar/i2schar_receiver.c +++ b/examples/i2schar/i2schar_receiver.c @@ -33,6 +33,7 @@ #include #include #include +#include #include @@ -79,12 +80,15 @@ pthread_addr_t i2schar_receiver(pthread_addr_t arg) { FAR struct ap_buffer_s *apb; + FAR struct ap_buffer_s *transmitter_apb = (FAR struct ap_buffer_s *)arg; struct audio_buf_desc_s desc; int bufsize; int nread; int ret; int fd; int i; + int j; + bool loopback = (transmitter_apb != NULL); /* Open the I2C character device */ @@ -101,7 +105,7 @@ pthread_addr_t i2schar_receiver(pthread_addr_t arg) for (i = 0; i < g_i2schar.rxcount; i++) { - /* Allocate an audio buffer of the configured size */ + /* Allocate an audio buffer of the configured size for receiving data */ desc.numbytes = CONFIG_EXAMPLES_I2SCHAR_BUFSIZE; desc.u.pbuffer = &apb; @@ -118,7 +122,13 @@ pthread_addr_t i2schar_receiver(pthread_addr_t arg) bufsize = sizeof(struct ap_buffer_s) + CONFIG_EXAMPLES_I2SCHAR_BUFSIZE; - /* Then receifve into the buffer */ + if (loopback) + { + printf("i2schar_receiver: Using allocated buffer for " + "loopback verification\n"); + } + + /* Then receive into the buffer */ do { @@ -137,6 +147,7 @@ pthread_addr_t i2schar_receiver(pthread_addr_t arg) printf("i2schar_receiver: ERROR: read failed: %d\n", errcode); close(fd); + apb_free(apb); pthread_exit(NULL); } } @@ -145,6 +156,7 @@ pthread_addr_t i2schar_receiver(pthread_addr_t arg) printf("i2schar_receiver: ERROR: partial read: %d\n", nread); close(fd); + apb_free(apb); pthread_exit(NULL); } else @@ -154,6 +166,51 @@ pthread_addr_t i2schar_receiver(pthread_addr_t arg) } while (nread != bufsize); + /* Print received buffer data (first 16 bytes) regardless of mode */ + + printf("i2schar_receiver: Received data (first 16 bytes): "); + for (j = 0; j < 16 && j < CONFIG_EXAMPLES_I2SCHAR_BUFSIZE; j++) + { + printf("0x%02x ", ((uint8_t *)apb->samp)[j]); + } + + printf("\n"); + + /* Verify the received data in loopback mode */ + + if (loopback) + { + /* Compare the received data with the expected transmitter buffer */ + + if (memcmp(apb->samp, transmitter_apb->samp, + CONFIG_EXAMPLES_I2SCHAR_BUFSIZE) == 0) + { + printf("i2schar_receiver: Loopback verification PASSED - " + "data matches expected\n"); + } + else + { + printf("i2schar_receiver: Loopback verification FAILED - " + "data mismatch!\n"); + printf("i2schar_receiver: Expected data (first 16 bytes): "); + for (j = 0; + j < 16 && j < CONFIG_EXAMPLES_I2SCHAR_BUFSIZE; j++) + { + printf("0x%02x ", + ((uint8_t *)transmitter_apb->samp)[j]); + } + + printf("\n"); + close(fd); + apb_free(apb); + pthread_exit((pthread_addr_t)1); /* Return error */ + } + } + + /* Free the buffer after use */ + + apb_free(apb); + /* Make sure that the transmitter thread has a chance to run */ pthread_yield(); diff --git a/examples/i2schar/i2schar_transmitter.c b/examples/i2schar/i2schar_transmitter.c index 2fb9ded0f9b..df1560ac6e0 100644 --- a/examples/i2schar/i2schar_transmitter.c +++ b/examples/i2schar/i2schar_transmitter.c @@ -33,6 +33,7 @@ #include #include #include +#include #include @@ -79,17 +80,13 @@ pthread_addr_t i2schar_transmitter(pthread_addr_t arg) { FAR struct ap_buffer_s *apb; - struct audio_buf_desc_s desc; - uint8_t crap; - uint8_t *ptr; + FAR struct ap_buffer_s *transmitter_apb = (FAR struct ap_buffer_s *)arg; int bufsize; int nwritten; - int ret; int fd; int i; - int j; - /* Open the I2C character device */ + /* Open the I2S character device */ fd = open(g_i2schar.devpath, O_WRONLY); if (fd < 0) @@ -102,33 +99,13 @@ pthread_addr_t i2schar_transmitter(pthread_addr_t arg) /* Loop for the requested number of times */ - for (i = 0, crap = 0; i < g_i2schar.txcount; i++) + for (i = 0; i < g_i2schar.txcount; i++) { - /* Allocate an audio buffer of the configured size */ - - desc.numbytes = CONFIG_EXAMPLES_I2SCHAR_BUFSIZE; - desc.u.pbuffer = &apb; - - ret = apb_alloc(&desc); - if (ret < 0) - { - printf("i2schar_transmitter:" - "ERROR: failed to allocate buffer %d: %d\n", i + 1, ret); - close(fd); - pthread_exit(NULL); - } + /* Use the provided transmitter buffer */ + apb = transmitter_apb; bufsize = sizeof(struct ap_buffer_s) + CONFIG_EXAMPLES_I2SCHAR_BUFSIZE; - /* Fill the audio buffer with crap */ - - for (j = 0, ptr = apb->samp; j < CONFIG_EXAMPLES_I2SCHAR_BUFSIZE; j++) - { - *ptr++ = crap++; - } - - apb->nbytes = CONFIG_EXAMPLES_I2SCHAR_BUFSIZE; - /* Then send the buffer */ do