Re: [PATCH] spec/aarch64: Enable previously unbuildable tests

2021-10-19 Thread Sebastian Huber

On 19/10/2021 23:15, Kinsey Moore wrote:

The spconfig01 and spmisc01 tests were disabled for all AArch64 BSPs due
to a toolchain issue preventing them from compiling correctly. The
binutils version that contains the fix has been released and integrated
into RSB such that these two tests now build and operate correctly.


It is great, that this was fixed.

--
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.hu...@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH 3/4] rtemsbsd/nfsclient: Fix the error code return value

2021-10-19 Thread Sebastian Huber



On 20/10/2021 05:16, chr...@rtems.org wrote:

+   errno = 0;
+   return 0;


I think setting errno if no error occurred is not allowed.

--
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.hu...@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH] testsuite/spcache01: Clear allocated coherent cache memory

2021-10-19 Thread Chris Johns
On 20/10/21 2:46 am, Christian MAUDERER wrote:
> Am 19.10.21 um 16:48 schrieb Sebastian Huber:
>>
>>
>> On 18/10/2021 23:08, Chris Johns wrote:
>>> On 18/10/21 8:37 pm, Sebastian Huber wrote:
 On 18/10/2021 09:53, Chris Johns wrote:
> On 18/10/21 4:50 pm, Sebastian Huber wrote:
>> On 18/10/2021 07:19,chr...@rtems.org   wrote:
>>> From: Chris Johns
>>>
>>> - Coherent cache memory is used in libbsd for things like descriptors
>>>  and it optionally clears the memory on allocation. Test is works.
>> There is no guarantee that memset() and memcpy() work with cache coherent
>> memory. Such memory areas may disallow misaligned access for example.
> That seems reasonable however this change about testing the implicit
> requirements we have that memset works. LibBSD requires memset works ...
>
> https://git.rtems.org/rtems-libbsd/tree/rtemsbsd/rtems/rtems-kernel-bus-dma.c?h=6-freebsd-12#n260
>
>
 Using memset() here could be a bug in libbsd.
>>> Yes, I also think so.
>>>
>>> But what is a suitable mechanism to make sure the arch or BSP handle it
>>> correctly? Maybe a clear routine in libbsd using the bus space API? That
>>> interface has to work or the drivers will not work.
>>
>> I think we had similar issues on another BSP. Christian, do you remember how
>> we solved this?
>>
> 
> I remember mainly problems with copying memory. I think the last time it
> resulted in an ugly "copy_from/to_io" function on the atsam:
> 
>   https://git.rtems.org/rtems/tree/bsps/arm/atsam/start/iocopy.c
> 

Thanks.

> The bus_space_* functions should work. Only problem is that a valid
> bus_space_tag is missing in this context. I think x86 uses it. I think for all
> other platforms it is unused.

I used the direct methods because it is internal and I think it is safe to
assume this is a linear address being returned from the allocator?

I have posted a patch which is working on the Versal. It is not optimized and
does not attempt to detect alignments to use larger word sizes for faster
clears. The amount of memory being allocated is not large.

Chris
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

[PATCH 4/4] Add support for Xilinx Versal APAC

2021-10-19 Thread chrisj
From: Chris Johns 

---
 libbsd.py |   1 +
 rtemsbsd/include/bsp/nexus-devices.h  |   9 +
 .../include/machine/rtems-bsd-nexus-bus.h |  28 +++
 rtemsbsd/sys/arm64/xilinx/versal_slcr.c   | 223 ++
 rtemsbsd/sys/arm64/xilinx/versal_slcr.h   |  86 +++
 5 files changed, 347 insertions(+)
 create mode 100644 rtemsbsd/sys/arm64/xilinx/versal_slcr.c
 create mode 100644 rtemsbsd/sys/arm64/xilinx/versal_slcr.h

diff --git a/libbsd.py b/libbsd.py
index b27b95d8..7593e9ba 100644
--- a/libbsd.py
+++ b/libbsd.py
@@ -1478,6 +1478,7 @@ class dev_net(builder.Module):
 self.addRTEMSKernelSourceFiles(
 [
 'sys/dev/mii/ksz8091rnb_50MHz.c',
+'sys/arm64/xilinx/versal_slcr.c',
 'sys/arm64/xilinx/zynqmp_slcr.c',
 ],
 mm.generator['source']()
diff --git a/rtemsbsd/include/bsp/nexus-devices.h 
b/rtemsbsd/include/bsp/nexus-devices.h
index 4c13e868..46df17b4 100644
--- a/rtemsbsd/include/bsp/nexus-devices.h
+++ b/rtemsbsd/include/bsp/nexus-devices.h
@@ -126,6 +126,15 @@ RTEMS_BSD_DRIVER_XILINX_ZYNQMP_SDHCI0;
 RTEMS_BSD_DRIVER_XILINX_ZYNQMP_SDHCI1;
 RTEMS_BSD_DRIVER_MMC;
 
+#elif defined(LIBBSP_AARCH64_XILINX_VERSAL_BSP_H)
+
+#include 
+
+RTEMS_BSD_DRIVER_XILINX_VERSAL_SLCR;
+RTEMS_BSD_DRIVER_XILINX_VERSAL_CGEM0(VERSAL_IRQ_ETHERNET_0);
+RTEMS_BSD_DRIVER_XILINX_VERSAL_CGEM1(VERSAL_IRQ_ETHERNET_1);
+RTEMS_BSD_DRIVER_UKPHY;
+
 #elif defined(LIBBSP_ARM_ATSAM_BSP_H)
 
 RTEMS_BSD_DRIVER_USB;
diff --git a/rtemsbsd/include/machine/rtems-bsd-nexus-bus.h 
b/rtemsbsd/include/machine/rtems-bsd-nexus-bus.h
index f0987513..9e1e725a 100644
--- a/rtemsbsd/include/machine/rtems-bsd-nexus-bus.h
+++ b/rtemsbsd/include/machine/rtems-bsd-nexus-bus.h
@@ -139,6 +139,26 @@ extern "C" {
   &zynqmp_slcr_res[0])
 #endif /* RTEMS_BSD_DRIVER_XILINX_ZYNQMP_SLCR */
 
+/*
+ * Xilinx Versal System Level Control Registers (SLCR).
+ */
+#if !defined(RTEMS_BSD_DRIVER_XILINX_VERSAL_SLCR)
+  /*
+   * Hard IP part of the Versal so a fixed address.
+   */
+  #define RTEMS_BSD_DRIVER_XILINX_VERSAL_SLCR   \
+static const rtems_bsd_device_resource versal_slcr_res[] = {\
+  { \
+.type = RTEMS_BSD_RES_MEMORY,   \
+.start_request = 0, \
+.start_actual = 0xf000  \
+  } \
+};  \
+RTEMS_BSD_DEFINE_NEXUS_DEVICE(versal_slcr, 0,   \
+  RTEMS_ARRAY_SIZE(versal_slcr_res),   \
+  &versal_slcr_res[0])
+#endif /* RTEMS_BSD_DRIVER_XILINX_VERSAL_SLCR */
+
 /*
  * Xilinx ZynqMP Arasan SDIO Driver.
  */
@@ -489,6 +509,14 @@ extern "C" {
   #define RTEMS_BSD_DRIVER_XILINX_ZYNQMP_CGEM3(_irq)   \
 RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM(3, 0xff0e, _irq)
 #endif /* RTEMS_BSD_DRIVER_XILINX_ZYNQMP_CGEM3 */
+#if !defined(RTEMS_BSD_DRIVER_XILINX_VERSAL_CGEM0)
+  #define RTEMS_BSD_DRIVER_XILINX_VERSAL_CGEM0(_irq)   \
+RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM(0, 0xff0c, _irq)
+#endif /* RTEMS_BSD_DRIVER_XILINX_VERSAL_CGEM0 */
+#if !defined(RTEMS_BSD_DRIVER_XILINX_VERSAL_CGEM1)
+  #define RTEMS_BSD_DRIVER_XILINX_VERSAL_CGEM1(_irq)\
+RTEMS_BSD_DRIVER_XILINX_ZYNQ_CGEM(1, 0xff0d, _irq)
+#endif /* RTEMS_BSD_DRIVER_XILINX_VERSAL_CGEM1 */
 
 /*
  * Designware/Synopsys Ethernet MAC Controller.
diff --git a/rtemsbsd/sys/arm64/xilinx/versal_slcr.c 
b/rtemsbsd/sys/arm64/xilinx/versal_slcr.c
new file mode 100644
index ..74ebde91
--- /dev/null
+++ b/rtemsbsd/sys/arm64/xilinx/versal_slcr.c
@@ -0,0 +1,223 @@
+#include 
+
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Copyright (c) 2021 Chris Johns 
+ * All rights reserved.
+ *
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSE

[PATCH 3/4] rtemsbsd/nfsclient: Fix the error code return value

2021-10-19 Thread chrisj
From: Chris Johns 

---
 rtemsbsd/fs/nfsclient/nfs.c | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/rtemsbsd/fs/nfsclient/nfs.c b/rtemsbsd/fs/nfsclient/nfs.c
index fe8d8412..5a6e8fae 100644
--- a/rtemsbsd/fs/nfsclient/nfs.c
+++ b/rtemsbsd/fs/nfsclient/nfs.c
@@ -963,16 +963,16 @@ rtems_nfs_initialize(
tryret = nfs_tryproto(ai, &args);
if (tryret == TRYRET_SUCCESS) {
error = nfs_trymount(mt_entry, ai, &args, 
fspath, data);
-   if (RTEMS_DEBUG)
-   printf("nfs: mount: (%d) %s\n", error, 
strerror(error));
+   if (RTEMS_DEBUG)
+   printf("nfs: mount: (%d) %s\n", 
error, strerror(error));
break;
} else {
error = EIO;
if (RTEMS_DEBUG)
printf("nfs: mount: %s\n", args.errstr);
+   }
}
}
-   }
 
freeaddrinfo(args.ai_nfs);
 
@@ -984,6 +984,8 @@ out:
if (fspath != NULL) {
rtems_bsd_rootfs_rmdir(fspath);
}
+ rtems_set_errno_and_return_minus_one(error);
}
-   return error;
+   errno = 0;
+   return 0;
 }
-- 
2.19.1

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH 2/4] waf: Move the tools/BSP include path to be last

2021-10-19 Thread chrisj
From: Chris Johns 

- This change lets you rebuild libbsd after it is installed
---
 waf_libbsd.py | 29 +
 1 file changed, 21 insertions(+), 8 deletions(-)

diff --git a/waf_libbsd.py b/waf_libbsd.py
index 97e6d6ee..0901537e 100644
--- a/waf_libbsd.py
+++ b/waf_libbsd.py
@@ -2,7 +2,7 @@
 """LibBSD build configuration to waf integration module.
 """
 
-# Copyright (c) 2015, 2020 Chris Johns . All rights reserved.
+# Copyright (c) 2015, 2021 Chris Johns . All rights reserved.
 #
 # Copyright (c) 2009, 2015 embedded brains GmbH.  All rights reserved.
 #
@@ -62,6 +62,13 @@ def _add_flags_if_not_present(current_flags, addional_flags):
 if flag not in current_flags:
 current_flags.append(flag)
 
+def _remove_bsp_include_path(bsp_include_path, current_flags):
+# this does not handle quted strings; maybe needed
+for bsp_path in bsp_include_path:
+if bsp_path in current_flags:
+current_flags = [flag for flag in current_flags if flag != 
bsp_path]
+return current_flags
+
 #
 # The waf builder for libbsd.
 #
@@ -190,6 +197,12 @@ class Builder(builder.ModuleManager):
 _add_flags_if_not_present(conf.env.CFLAGS, section_flags)
 _add_flags_if_not_present(conf.env.CXXFLAGS, section_flags)
 _add_flags_if_not_present(conf.env.LINKFLAGS, 
["-Wl,--gc-sections"])
+conf.env.CFLAGS = _remove_bsp_include_path(conf.env.IFLAGS,
+   conf.env.CFLAGS)
+conf.env.CXXFLAGS = _remove_bsp_include_path(conf.env.IFLAGS,
+
conf.env.CXXFLAGS)
+conf.env.LINKFLAGS = _remove_bsp_include_path(conf.env.IFLAGS,
+  conf.env.LINKFLAGS)
 
 def build(self, bld):
 #
@@ -236,7 +249,7 @@ class Builder(builder.ModuleManager):
 inc_paths = sorted(include_paths)
 inc_paths.remove('build')
 inc_paths.remove('cpu')
-includes = {}
+includes = { 'bsp': [p[2:] for p in bld.env.IFLAGS] }
 for inc in inc_paths:
 includes[inc] = include_paths[inc]
 # cpu include paths must be the first searched
@@ -431,7 +444,7 @@ class Builder(builder.ModuleManager):
 bld.objects(target='kvmsymbols',
 features='c',
 cflags=cflags,
-includes=kvmsymbols_includes + includes['kernel'],
+includes=kvmsymbols_includes + includes['kernel'] + 
includes['bsp'],
 source=kvmsymbols['files']['all']['default'][0])
 libbsd_use += ["kvmsymbols"]
 
@@ -486,7 +499,7 @@ class Builder(builder.ModuleManager):
 bld.objects(target='lex_%s' % (lex['sym']),
 features='c',
 cflags=cflags,
-includes=lexIncludes + includes['user'],
+includes=lexIncludes + includes['user'] + 
includes['bsp'],
 defines=defines + lexDefines,
 source=lex['file'][:-2] + '.c')
 libbsd_use += ['lex_%s' % (lex['sym'])]
@@ -526,7 +539,7 @@ class Builder(builder.ModuleManager):
 bld.objects(target='yacc_%s' % (yaccSym),
 features='c',
 cflags=cflags,
-includes=yaccIncludes + includes['user'],
+includes=yaccIncludes + includes['user'] + 
includes['bsp'],
 defines=defines + yaccDefines,
 source=yaccFile[:-2] + '.c')
 libbsd_use += ['yacc_%s' % (yaccSym)]
@@ -560,7 +573,7 @@ class Builder(builder.ModuleManager):
 cflags=cflags + bld_cflags,
 cxxflags=cxxflags,
 includes=sorted(build.get('includes', [])) +
-includes[space],
+includes[space] + includes['bsp'],
 defines=defines,
 source=bld_sources)
 libbsd_use += [target]
@@ -580,7 +593,7 @@ class Builder(builder.ModuleManager):
   features='c cxx',
   cflags=cflags,
   cxxflags=cxxflags,
-  includes=includes['kernel'],
+  includes=includes['kernel'] + includes['bsp'],
   defines=defines,
   source=bld_sources,
   use=libbsd_use)
@@ -657,7 +670,7 @@ class Builder(builder.ModuleManager):
 bld.program(target='%s.exe' % (testName),
 features='cprogram',
 cflags=cflags,
-incl

[PATCH 1/4] rtemsbsd: Clear bus DMA memory a byte at a time

2021-10-19 Thread chrisj
From: Chris Johns 

- memset may be optimized for performance and might work
  with device type memory. Clear a byte at a time.
---
 rtemsbsd/rtems/rtems-kernel-bus-dma.c | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/rtemsbsd/rtems/rtems-kernel-bus-dma.c 
b/rtemsbsd/rtems/rtems-kernel-bus-dma.c
index 45c4287d..1d28f62c 100644
--- a/rtemsbsd/rtems/rtems-kernel-bus-dma.c
+++ b/rtemsbsd/rtems/rtems-kernel-bus-dma.c
@@ -9,7 +9,7 @@
  */
 
 /*
- * Copyright (c) 2009-2012 embedded brains GmbH.  
+ * Copyright (c) 2009-2012 embedded brains GmbH.
  * All rights reserved.
  *
  *  embedded brains GmbH
@@ -258,7 +258,12 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddr, int 
flags,
(*mapp)->buffer_size = dmat->maxsize;
 
if ((flags & BUS_DMA_ZERO) != 0) {
-   memset(*vaddr, 0, dmat->maxsize);
+   unsigned char* mem = *vaddr;
+   int len = dmat->maxsize;
+   while (len-- > 0) {
+   bsp_bus_space_write_1(mem, 0);
+   mem++;
+   }
}
 
return (0);
-- 
2.19.1

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH] spec/aarch64: Enable previously unbuildable tests

2021-10-19 Thread Kinsey Moore
The spconfig01 and spmisc01 tests were disabled for all AArch64 BSPs due
to a toolchain issue preventing them from compiling correctly. The
binutils version that contains the fix has been released and integrated
into RSB such that these two tests now build and operate correctly.
---
 spec/build/bsps/aarch64/a53/tsta53.yml  | 4 
 spec/build/bsps/aarch64/a72/tsta72.yml  | 4 
 spec/build/bsps/aarch64/xilinx-versal/tstqemu.yml   | 4 
 spec/build/bsps/aarch64/xilinx-versal/tstvck190.yml | 4 
 spec/build/bsps/aarch64/xilinx-zynqmp/tstqemu.yml   | 4 
 spec/build/bsps/aarch64/xilinx-zynqmp/tstzu3eg.yml  | 3 ---
 6 files changed, 23 deletions(-)

diff --git a/spec/build/bsps/aarch64/a53/tsta53.yml 
b/spec/build/bsps/aarch64/a53/tsta53.yml
index 6876d23f56..6af1b186a3 100644
--- a/spec/build/bsps/aarch64/a53/tsta53.yml
+++ b/spec/build/bsps/aarch64/a53/tsta53.yml
@@ -4,10 +4,6 @@ actions:
 # expected to fail, don't compile these
 minimum: exclude
 
-# don't compile due to toolchain issues
-spconfig01: exclude
-spmisc01: exclude
-
 # tests that are passing intermittently
 spcpucounter01: indeterminate
 rtmonuse: indeterminate
diff --git a/spec/build/bsps/aarch64/a72/tsta72.yml 
b/spec/build/bsps/aarch64/a72/tsta72.yml
index 6876d23f56..6af1b186a3 100644
--- a/spec/build/bsps/aarch64/a72/tsta72.yml
+++ b/spec/build/bsps/aarch64/a72/tsta72.yml
@@ -4,10 +4,6 @@ actions:
 # expected to fail, don't compile these
 minimum: exclude
 
-# don't compile due to toolchain issues
-spconfig01: exclude
-spmisc01: exclude
-
 # tests that are passing intermittently
 spcpucounter01: indeterminate
 rtmonuse: indeterminate
diff --git a/spec/build/bsps/aarch64/xilinx-versal/tstqemu.yml 
b/spec/build/bsps/aarch64/xilinx-versal/tstqemu.yml
index 8828185cd8..a02232b239 100644
--- a/spec/build/bsps/aarch64/xilinx-versal/tstqemu.yml
+++ b/spec/build/bsps/aarch64/xilinx-versal/tstqemu.yml
@@ -4,10 +4,6 @@ actions:
 # expected to fail
 minimum: exclude
 
-# don't compile due to toolchain issues, see RTEMS issue #4218
-spconfig01: exclude
-spmisc01: exclude
-
 build-type: option
 copyrights:
 - Copyright (C) 2021 Gedare Bloom 
diff --git a/spec/build/bsps/aarch64/xilinx-versal/tstvck190.yml 
b/spec/build/bsps/aarch64/xilinx-versal/tstvck190.yml
index 4f9a21e9d7..cbc1c7e381 100644
--- a/spec/build/bsps/aarch64/xilinx-versal/tstvck190.yml
+++ b/spec/build/bsps/aarch64/xilinx-versal/tstvck190.yml
@@ -4,10 +4,6 @@ actions:
 # expected to produce a fatal-error when run
 minimum: exclude
 
-# don't compile due to toolchain issues, see RTEMS issue #4218
-spconfig01: exclude
-spmisc01: exclude
-
 build-type: option
 copyrights:
 - Copyright (C) 2021 Gedare Bloom 
diff --git a/spec/build/bsps/aarch64/xilinx-zynqmp/tstqemu.yml 
b/spec/build/bsps/aarch64/xilinx-zynqmp/tstqemu.yml
index 80d338fda1..e0c1b9a137 100644
--- a/spec/build/bsps/aarch64/xilinx-zynqmp/tstqemu.yml
+++ b/spec/build/bsps/aarch64/xilinx-zynqmp/tstqemu.yml
@@ -4,10 +4,6 @@ actions:
 # expected to fail
 minimum: exclude
 
-# don't compile due to toolchain issues
-spconfig01: exclude
-spmisc01: exclude
-
 # tests that are passing intermittently
 spcpucounter01: indeterminate
 rtmonuse: indeterminate
diff --git a/spec/build/bsps/aarch64/xilinx-zynqmp/tstzu3eg.yml 
b/spec/build/bsps/aarch64/xilinx-zynqmp/tstzu3eg.yml
index 8bf646b1d4..6cd6dc0954 100644
--- a/spec/build/bsps/aarch64/xilinx-zynqmp/tstzu3eg.yml
+++ b/spec/build/bsps/aarch64/xilinx-zynqmp/tstzu3eg.yml
@@ -4,9 +4,6 @@ actions:
 # expected to produce a fatal-error when run
 minimum: exclude
 
-# don't compile due to toolchain issues, see RTEMS issue #4218
-spconfig01: exclude
-spmisc01: exclude
 build-type: option
 copyrights:
 - Copyright (C) 2020 On-Line Applications Research (OAR)
-- 
2.30.2

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH] testsuite/spcache01: Clear allocated coherent cache memory

2021-10-19 Thread Christian MAUDERER

Am 19.10.21 um 16:48 schrieb Sebastian Huber:



On 18/10/2021 23:08, Chris Johns wrote:

On 18/10/21 8:37 pm, Sebastian Huber wrote:

On 18/10/2021 09:53, Chris Johns wrote:

On 18/10/21 4:50 pm, Sebastian Huber wrote:

On 18/10/2021 07:19,chr...@rtems.org   wrote:

From: Chris Johns

- Coherent cache memory is used in libbsd for things like descriptors
 and it optionally clears the memory on allocation. Test is 
works.
There is no guarantee that memset() and memcpy() work with cache 
coherent

memory. Such memory areas may disallow misaligned access for example.

That seems reasonable however this change about testing the implicit
requirements we have that memset works. LibBSD requires memset works 
...


https://git.rtems.org/rtems-libbsd/tree/rtemsbsd/rtems/rtems-kernel-bus-dma.c?h=6-freebsd-12#n260 




Using memset() here could be a bug in libbsd.

Yes, I also think so.

But what is a suitable mechanism to make sure the arch or BSP handle it
correctly? Maybe a clear routine in libbsd using the bus space API? That
interface has to work or the drivers will not work.


I think we had similar issues on another BSP. Christian, do you remember 
how we solved this?




I remember mainly problems with copying memory. I think the last time it 
resulted in an ugly "copy_from/to_io" function on the atsam:


  https://git.rtems.org/rtems/tree/bsps/arm/atsam/start/iocopy.c

The bus_space_* functions should work. Only problem is that a valid 
bus_space_tag is missing in this context. I think x86 uses it. I think 
for all other platforms it is unused.


Best regards

Christian
--

embedded brains GmbH
Herr Christian MAUDERER
Dornierstr. 4
82178 Puchheim
Germany
email: christian.maude...@embedded-brains.de
phone: +49-89-18 94 741 - 18
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

[PATCH v2] c-user: Document new clock manager directives

2021-10-19 Thread Sebastian Huber
Add new clock manager directives to get all times provided by the
timehands.

Update #4527.
---
For an updated document to review see:

https://ftp.rtems.org/pub/rtems/people/sebh/c-user.pdf

v2: Clarify boot time.

 c-user/clock/directives.rst   | 835 ++
 c-user/clock/introduction.rst |  81 
 2 files changed, 916 insertions(+)

diff --git a/c-user/clock/directives.rst b/c-user/clock/directives.rst
index bdb7680..8f2d7ea 100644
--- a/c-user/clock/directives.rst
+++ b/c-user/clock/directives.rst
@@ -224,6 +224,841 @@ The following constraints apply to this directive:
   Applications which are restricted to only use interfaces of the pre-qualified
   feature set of RTEMS shall not use the directive.
 
+.. Generated from spec:/rtems/clock/if/get-realtime
+
+.. raw:: latex
+
+\clearpage
+
+.. index:: rtems_clock_get_realtime()
+
+.. _InterfaceRtemsClockGetRealtime:
+
+rtems_clock_get_realtime()
+--
+
+Gets the time elapsed since the :term:`Unix epoch` measured using
+:term:`CLOCK_REALTIME` in seconds and nanoseconds format.
+
+.. rubric:: CALLING SEQUENCE:
+
+.. code-block:: c
+
+void rtems_clock_get_realtime( struct timespec *time_snapshot );
+
+.. rubric:: PARAMETERS:
+
+``time_snapshot``
+This parameter is the pointer to a `struct timespec
+`_ object.  The time
+elapsed since the :term:`Unix epoch` measured using the
+:term:`CLOCK_REALTIME` at some time point during the directive call will be
+stored in this object.  Calling the directive with a pointer equal to `NULL
+`_ is undefined behaviour.
+
+.. rubric:: NOTES:
+
+The directive accesses a device provided by the :term:`Clock Driver` to get the
+time in the highest precision available to the system.  Alternatively, the
+:ref:`InterfaceRtemsClockGetRealtimeCoarse` directive may be used to get the
+time with less precision and less runtime overhead.
+
+See :ref:`InterfaceRtemsClockGetRealtimeBintime` and
+:ref:`InterfaceRtemsClockGetRealtimeTimeval` to get the time in alternative
+formats.
+
+.. rubric:: CONSTRAINTS:
+
+The following constraints apply to this directive:
+
+* The directive may be called from within any runtime context.
+
+* The directive will not cause the calling task to be preempted.
+
+* The directive requires a :term:`Clock Driver`.
+
+.. Generated from spec:/rtems/clock/if/get-realtime-bintime
+
+.. raw:: latex
+
+\clearpage
+
+.. index:: rtems_clock_get_realtime_bintime()
+
+.. _InterfaceRtemsClockGetRealtimeBintime:
+
+rtems_clock_get_realtime_bintime()
+--
+
+Gets the time elapsed since the :term:`Unix epoch` measured using
+:term:`CLOCK_REALTIME` in binary time format.
+
+.. rubric:: CALLING SEQUENCE:
+
+.. code-block:: c
+
+void rtems_clock_get_realtime_bintime( struct bintime *time_snapshot );
+
+.. rubric:: PARAMETERS:
+
+``time_snapshot``
+This parameter is the pointer to a :c:type:`bintime` object.  The time
+elapsed since the :term:`Unix epoch` measured using the
+:term:`CLOCK_REALTIME` at some time point during the directive call will be
+stored in this object.  Calling the directive with a pointer equal to `NULL
+`_ is undefined behaviour.
+
+.. rubric:: NOTES:
+
+The directive accesses a device provided by the :term:`Clock Driver` to get the
+time in the highest precision available to the system.  Alternatively, the
+:ref:`InterfaceRtemsClockGetRealtimeCoarseBintime` directive may be used to get
+the time with less precision and less runtime overhead.
+
+See :ref:`InterfaceRtemsClockGetRealtime` and
+:ref:`InterfaceRtemsClockGetRealtimeTimeval` to get the time in alternative
+formats.
+
+.. rubric:: CONSTRAINTS:
+
+The following constraints apply to this directive:
+
+* The directive may be called from within any runtime context.
+
+* The directive will not cause the calling task to be preempted.
+
+* The directive requires a :term:`Clock Driver`.
+
+.. Generated from spec:/rtems/clock/if/get-realtime-timeval
+
+.. raw:: latex
+
+\clearpage
+
+.. index:: rtems_clock_get_realtime_timeval()
+
+.. _InterfaceRtemsClockGetRealtimeTimeval:
+
+rtems_clock_get_realtime_timeval()
+--
+
+Gets the time elapsed since the :term:`Unix epoch` measured using
+:term:`CLOCK_REALTIME` in seconds and microseconds format.
+
+.. rubric:: CALLING SEQUENCE:
+
+.. code-block:: c
+
+void rtems_clock_get_realtime_timeval( struct timeval *time_snapshot );
+
+.. rubric:: PARAMETERS:
+
+``time_snapshot``
+This parameter is the pointer to a `struct timeval
+
`_
+object.  The time elapsed since the :term:`Unix epoch` measured using the
+:term:`CLOCK_REALTIME` at some time point during the directive call will be
+stored in this object.  Ca

Re: [PATCH] rtems: Fix rate monotonic statistics

2021-10-19 Thread Sebastian Huber

On 12/10/2021 08:44, Sebastian Huber wrote:

On 12/10/2021 08:36, Sebastian Huber wrote:
diff --git a/cpukit/libcsupport/src/__times.c 
b/cpukit/libcsupport/src/__times.c

index 7bb7e0e9ca..a37c662654 100644
--- a/cpukit/libcsupport/src/__times.c
+++ b/cpukit/libcsupport/src/__times.c
@@ -65,7 +65,8 @@ clock_t _times(
 *  of ticks since boot and the number of ticks executed by this
 *  this thread.
 */
-  _Thread_Get_CPU_time_used( _Thread_Get_executing(), &cpu_time_used );
+  cpu_time_used =
+    _Thread_Get_CPU_time_used_after_last_reset( 
_Thread_Get_executing() );

    ptms->tms_utime = ((clock_t) cpu_time_used) / tick_interval;
    return ptms->tms_stime;


Should the tms_utime be affected by rtems_cpu_useage_report()?


Any comments with respect to this patch?

--
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.hu...@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH] testsuite/spcache01: Clear allocated coherent cache memory

2021-10-19 Thread Sebastian Huber



On 18/10/2021 23:08, Chris Johns wrote:

On 18/10/21 8:37 pm, Sebastian Huber wrote:

On 18/10/2021 09:53, Chris Johns wrote:

On 18/10/21 4:50 pm, Sebastian Huber wrote:

On 18/10/2021 07:19,chr...@rtems.org   wrote:

From: Chris Johns

- Coherent cache memory is used in libbsd for things like descriptors
     and it optionally clears the memory on allocation. Test is works.

There is no guarantee that memset() and memcpy() work with cache coherent
memory. Such memory areas may disallow misaligned access for example.

That seems reasonable however this change about testing the implicit
requirements we have that memset works. LibBSD requires memset works ...

https://git.rtems.org/rtems-libbsd/tree/rtemsbsd/rtems/rtems-kernel-bus-dma.c?h=6-freebsd-12#n260


Using memset() here could be a bug in libbsd.

Yes, I also think so.

But what is a suitable mechanism to make sure the arch or BSP handle it
correctly? Maybe a clear routine in libbsd using the bus space API? That
interface has to work or the drivers will not work.


I think we had similar issues on another BSP. Christian, do you remember 
how we solved this?


--
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.hu...@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

RE: [PATCH] rtems/6: Update binutils to 2.37

2021-10-19 Thread Ryan Long
Ticket 4218 closed

-Original Message-
From: Joel Sherrill  
Sent: Tuesday, October 19, 2021 9:37 AM
To: Ryan Long 
Cc: Chris Johns ; rtems-de...@rtems.org 
Subject: Re: [PATCH] rtems/6: Update binutils to 2.37

I just pushed it.

Ryan.. please check that the ticket got updated correctly.

On Tue, Oct 19, 2021 at 7:44 AM Ryan Long  wrote:
>
> It hasn't been pushed yet. You had asked if there was a ticket that needed to 
> be closed with that patch since it was fixing an issue we've had with 
> aarch64. I responded to the email, but I guess I forgot to send in V2 with 
> the ticket that it was supposed to close.
>
> -Original Message-
> From: devel  On Behalf Of Chris Johns
> Sent: Monday, October 18, 2021 6:09 PM
> To: j...@rtems.org
> Cc: rtems-de...@rtems.org 
> Subject: Re: [PATCH] rtems/6: Update binutils to 2.37
>
> On 19/10/21 9:23 am, Joel Sherrill wrote:
> > Was there something wrong with Ryan's patch to do this? He also 
> > bumped RTEMS 7 tools.
>
> No not at all.
>
> > You reviewed it. :)
>
> I thought I had reviewed it and I checked the repo today and could not see 
> anything. Is it pushed?
>
> Chris
> ___
> devel mailing list
> devel@rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH 2/2] score: Optimize default idle task stack allocator

2021-10-19 Thread Sebastian Huber
Update #4524.
---
 cpukit/score/src/stackallocatorforidle.c | 12 +---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/cpukit/score/src/stackallocatorforidle.c 
b/cpukit/score/src/stackallocatorforidle.c
index 7c4fd10c7d..8a3b1e5d25 100644
--- a/cpukit/score/src/stackallocatorforidle.c
+++ b/cpukit/score/src/stackallocatorforidle.c
@@ -31,6 +31,7 @@
 
 #include 
 #include 
+#include 
 
 /**
  * @brief Default stack allocator allocate for idle handler.
@@ -41,18 +42,23 @@
  * The default allocator for IDLE thread stacks gets the memory from a
  * statically allocated area provided via confdefs.h.
  *
- * @param cpu Index of the CPU for the IDLE thread using this stack
+ * @param cpu_index Index of the CPU for the IDLE thread using this stack
  * @param stack_size The size of the stack area to allocate in bytes.
  *
  * @retval NULL Not enough memory (never returned).
  * @retval other Pointer to begin of stack area.
  */
 static void *_Stack_Allocator_allocate_for_idle_default(
-  uint32_t  cpu,
+  uint32_t  cpu_index,
   size_tstack_size
 )
 {
-  return &_Thread_Idle_stacks[ cpu * stack_size ];
+#if defined(RTMS_SMP)
+  return &_Thread_Idle_stacks[ cpu_index * stack_size ];
+#else
+  _Assert( cpu_index == 0 );
+  return &_Thread_Idle_stacks[ 0 ];
+#endif
 }
 
 const Stack_Allocator_allocate_for_idle _Stack_Allocator_allocate_for_idle =
-- 
2.31.1

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH 1/2] rtems: Regenerate for IDLE task allocator option

2021-10-19 Thread Sebastian Huber
Update #4524.
---
 cpukit/doxygen/appl-config.h  | 28 +++-
 cpukit/include/rtems/config.h | 30 ++
 2 files changed, 45 insertions(+), 13 deletions(-)

diff --git a/cpukit/doxygen/appl-config.h b/cpukit/doxygen/appl-config.h
index bbeb438bec..c0e5b0b717 100644
--- a/cpukit/doxygen/appl-config.h
+++ b/cpukit/doxygen/appl-config.h
@@ -3,7 +3,7 @@
 /*
  * Copyright (C) 2019, 2021 embedded brains GmbH 
(http://www.embedded-brains.de)
  * Copyright (C) 2010 Gedare Bloom
- * Copyright (C) 1988, 2008 On-Line Applications Research Corporation (OAR)
+ * Copyright (C) 1988, 2021 On-Line Applications Research Corporation (OAR)
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -4671,6 +4671,32 @@
  */
 #define CONFIGURE_TASK_STACK_ALLOCATOR_AVOIDS_WORK_SPACE
 
+/* Generated from spec:/acfg/if/task-stack-allocator-for-idle */
+
+/**
+ * @brief This configuration option is an initializer define.
+ *
+ * The value of this configuration option is the address for the stack
+ * allocator allocate handler used to allocate the task stack of each IDLE
+ * task.
+ *
+ * @par Default Value
+ * The default value is ``_Stack_Allocator_allocate_for_idle_default``, which
+ * indicates that IDLE task stacks will be allocated from an area statically
+ * allocated by .
+ *
+ * @par Value Constraints
+ * The value of this configuration option shall be defined to a valid function
+ * pointer of the type ``void *( *allocate )( uint32_t, size_t )``.
+ *
+ * @par Notes
+ * This configuration option is independent of the other thread stack allocator
+ * configuration options.  It is assumed that any memory allocated for the
+ * stack of an IDLE task will not be from the RTEMS Workspace or the memory
+ * statically allocated by default.
+ */
+#define CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE
+
 /* Generated from spec:/acfg/if/task-stack-allocator-init */
 
 /**
diff --git a/cpukit/include/rtems/config.h b/cpukit/include/rtems/config.h
index 7b15bc34a2..32dd662b3e 100644
--- a/cpukit/include/rtems/config.h
+++ b/cpukit/include/rtems/config.h
@@ -10,6 +10,7 @@
  */
 
 /*
+ * Copyright (C) 2021 On-Line Applications Research Corporation (OAR)
  * Copyright (C) 2009, 2021 embedded brains GmbH 
(http://www.embedded-brains.de)
  *
  * Redistribution and use in source and binary forms, with or without
@@ -302,6 +303,23 @@ uint32_t rtems_configuration_get_maximum_extensions( void 
);
 #define rtems_configuration_get_number_of_initial_extensions() \
   ((uint32_t) _User_extensions_Initial_count)
 
+/* Generated from spec:/rtems/config/if/get-stack-allocate-for-idle-hook */
+
+/**
+ * @ingroup RTEMSAPIConfig
+ *
+ * @brief Gets the thread stack allocator allocate hook used to allocate the
+ *   stack of each IDLE task configured for this application.
+ *
+ * @return Returns the thread stack allocator allocate hook used to allocate
+ *   the stack of each IDLE task configured for this application.
+ *
+ * @par Notes
+ * See #CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE.
+ */
+#define rtems_configuration_get_stack_allocate_for_idle_hook() \
+  _Stack_Allocator_allocate_for_idle
+
 /* Generated from spec:/rtems/config/if/get-stack-allocate-hook */
 
 /**
@@ -368,18 +386,6 @@ uint32_t rtems_configuration_get_maximum_extensions( void 
);
  */
 #define rtems_configuration_get_stack_free_hook() _Stack_Allocator_free
 
-/**
- * @ingroup RTEMSAPIConfig
- *
- * @brief Gets the IDLE thread stack allocator hook configured for this
- *   application.
- *
- * @return Returns the IDLE thread stack allocator hook configured for this
- *   application.
- */
-#define rtems_configuration_get_stack_allocate_for_idle_hook() \
-  (_Stack_Allocator_allocate_for_idle)
-
 /* Generated from spec:/rtems/config/if/get-stack-space-size */
 
 /**
-- 
2.31.1

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH] c-user: Regenerate for IDLE task allocator option

2021-10-19 Thread Sebastian Huber
Update #4524.
---
 c-user/config/task-stack-alloc.rst | 71 --
 1 file changed, 37 insertions(+), 34 deletions(-)

diff --git a/c-user/config/task-stack-alloc.rst 
b/c-user/config/task-stack-alloc.rst
index 36b780b..0e2ec10 100644
--- a/c-user/config/task-stack-alloc.rst
+++ b/c-user/config/task-stack-alloc.rst
@@ -1,7 +1,7 @@
 .. SPDX-License-Identifier: CC-BY-SA-4.0
 
 .. Copyright (C) 2020, 2021 embedded brains GmbH 
(http://www.embedded-brains.de)
-.. Copyright (C) 1988, 2008 On-Line Applications Research Corporation (OAR)
+.. Copyright (C) 1988, 2021 On-Line Applications Research Corporation (OAR)
 
 .. This file is part of the RTEMS quality process and was automatically
 .. generated.  If you find something that needs to be fixed or
@@ -93,6 +93,42 @@ NOTES:
 This configuration option may be used if a custom task stack allocator is
 configured, see :ref:`CONFIGURE_TASK_STACK_ALLOCATOR`.
 
+.. Generated from spec:/acfg/if/task-stack-allocator-for-idle
+
+.. index:: CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE
+.. index:: task stack allocator for IDLE tasks
+
+.. _CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE:
+
+CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE
+---
+
+CONSTANT:
+``CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE``
+
+OPTION TYPE:
+This configuration option is an initializer define.
+
+DEFAULT VALUE:
+The default value is ``_Stack_Allocator_allocate_for_idle_default``, which
+indicates that IDLE task stacks will be allocated from an area statically
+allocated by .
+
+VALUE CONSTRAINTS:
+The value of this configuration option shall be defined to a valid function
+pointer of the type ``void *( *allocate )( uint32_t, size_t )``.
+
+DESCRIPTION:
+The value of this configuration option is the address for the stack 
allocator
+allocate handler used to allocate the task stack of each
+:term:`IDLE task`.
+
+NOTES:
+This configuration option is independent of the other thread stack 
allocator
+configuration options.  It is assumed that any memory allocated for the 
stack
+of an :term:`IDLE task` will not be from the RTEMS Workspace or the
+memory statically allocated by default.
+
 .. Generated from spec:/acfg/if/task-stack-allocator-init
 
 .. index:: CONFIGURE_TASK_STACK_ALLOCATOR_INIT
@@ -214,36 +250,3 @@ DESCRIPTION:
 NOTES:
 This configuration option may be used if a custom task stack allocator is
 configured, see :ref:`CONFIGURE_TASK_STACK_ALLOCATOR`.
-
-.. index:: _CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE
-.. index:: IDLE task stack allocator
-
-.. _CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE:
-
-CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE

-
-CONSTANT:
-``CONFIGURE_TASK_STACK_ALLOCATOR_FOR_IDLE``
-
-OPTION TYPE:
-This configuration option is an initializer define.
-
-DEFAULT VALUE:
-The default value is ``_Stack_Allocator_allocate_for_idle``, which
-indicates that IDLE task stacks will be allocated from an area statically
-reserved by ```.
-
-VALUE CONSTRAINTS:
-The value of this configuration option shall be defined to a valid
-function pointer of the type ``void *( *allocate )( uint32_t, size_t )``.
-
-DESCRIPTION:
-The value of this configuration option is the address for the the
-IDLE stack allocator allocate handler.
-
-NOTES:
-This configuration option is independent of the other thread stack 
allocator
-configuration options. It is assumed that any memory allocated for IDLE
-task stacks will not be from the RTEMS Workspace or the memory statically
-reserved by default.
-- 
2.31.1

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH] rtems/6: Update binutils to 2.37

2021-10-19 Thread Joel Sherrill
I just pushed it.

Ryan.. please check that the ticket got updated correctly.

On Tue, Oct 19, 2021 at 7:44 AM Ryan Long  wrote:
>
> It hasn't been pushed yet. You had asked if there was a ticket that needed to 
> be closed with that patch since it was fixing an issue we've had with 
> aarch64. I responded to the email, but I guess I forgot to send in V2 with 
> the ticket that it was supposed to close.
>
> -Original Message-
> From: devel  On Behalf Of Chris Johns
> Sent: Monday, October 18, 2021 6:09 PM
> To: j...@rtems.org
> Cc: rtems-de...@rtems.org 
> Subject: Re: [PATCH] rtems/6: Update binutils to 2.37
>
> On 19/10/21 9:23 am, Joel Sherrill wrote:
> > Was there something wrong with Ryan's patch to do this? He also bumped
> > RTEMS 7 tools.
>
> No not at all.
>
> > You reviewed it. :)
>
> I thought I had reviewed it and I checked the repo today and could not see 
> anything. Is it pushed?
>
> Chris
> ___
> devel mailing list
> devel@rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


RE: [PATCH v2] rtems-kernel: Implement kernel recipe using waf

2021-10-19 Thread Ryan Long
ping

-Original Message-
From: Ryan Long 
Sent: Wednesday, October 13, 2021 5:08 PM
To: devel@rtems.org
Cc: Ryan Long 
Subject: [PATCH v2] rtems-kernel: Implement kernel recipe using waf

Closes #4145
---
 rtems/config/tools/rtems-kernel-6.cfg  |   6 +-
 rtems/config/tools/rtems-kernel-common.cfg |  91 +--
 source-builder/sb/options.py   | 136 +++--
 3 files changed, 119 insertions(+), 114 deletions(-)

diff --git a/rtems/config/tools/rtems-kernel-6.cfg 
b/rtems/config/tools/rtems-kernel-6.cfg
index f1d0990..9120862 100644
--- a/rtems/config/tools/rtems-kernel-6.cfg
+++ b/rtems/config/tools/rtems-kernel-6.cfg
@@ -2,10 +2,10 @@
 # RTEMS 5
 #
 
-%define rtems_kernel_version 3ec5f20484cc4201e1d7b87844505644533b6148
-%hash sha512 rtems-kernel-%{rtems_kernel_version}.tar.bz2 \
-  
BjMKrf5n1YR6IpiZrY5TUEzKATPRJxA2/6m6f833DdRu+RyLxccXqA4gHRdVUqFelFNQ3o0XdG4o1naBKYfhkQ==
+%define rtems_kernel_version 3bb97a30b17b6c138dead3e3a6b329c3b301cdb3
 
+%hash sha512 rtems-kernel-%{rtems_kernel_version}.tar.gz \
+  
+m/ogwrJj4X60ewDIbV6WRj1MJa/22gQHQd56XiNMfvCr0nsvcXdkXKAObLIGYIGYfUyEwlV
+k3SRjjRFkFalDGQ==
 #
 # The RTEMS build instructions.
 #
diff --git a/rtems/config/tools/rtems-kernel-common.cfg 
b/rtems/config/tools/rtems-kernel-common.cfg
index 157c7a4..2986580 100644
--- a/rtems/config/tools/rtems-kernel-common.cfg
+++ b/rtems/config/tools/rtems-kernel-common.cfg
@@ -38,6 +38,15 @@
 %define rtems_bsp %{with_rtems_bsp}
 
 #
+# Configuration file used with waf
+#
+%ifn %{defined _bspconfig}
+%define config_file config-%{_target}-%{rtems_bsp}.ini
+%else
+%define config_file %{_bspconfig}
+%endif
+
+#
 # If no tools are provided use the prefix.
 #
 %ifn %{defined with_tools}
@@ -98,14 +107,6 @@ URL: https://www.rtems.org/
  %define rtems_posix 0
 %endif
 
-%if %{defined with_rtems_legacy_network}
- %define rtems_networking 1
-%endif
-
-%if %{defined with_rtems_cxx}
- %define rtems_cxx 1
-%endif
-
 %if %{defined with_rtems_bspopts}
  %define bspopts %{with_rtems_bspopts}
 %endif
@@ -151,24 +152,28 @@ URL:   https://www.rtems.org/
 %if %{defined without_rtemsbsp}
  %error Option --without-rtemsbsp is not supported.
 %endif
+
 %if %{defined without_rtems_tests}
- %define with_rtems_tests no
+ %define rtems_tests False
+ %define rtems_sample_tests False
 %endif
 %if %{defined with_rtems_tests}
  %if %{with_rtems_tests} == 1
-  %define with_rtems_tests yes
+   %define rtems_tests True
+   %define rtems_sample_tests True
  %endif
- %if %{with_rtems_tests} == yes || \
- %{with_rtems_tests} == no || \
- %{with_rtems_tests} == samples
-  %define rtems_tests %{with_rtems_tests}
+  %if %{with_rtems_tests} == samples
+  %define rtems_tests False
+  %define rtems_sample_tests True
  %endif
 %endif
 %if %{defined with_rtems_smp}
  %define rtems_smp 1
 %endif
 %if %{defined with_rtems_legacy_network}
- %define rtems_networking 1
+ echo "RTEMS legacy network has been removed."
+ echo "Please review and update your configuration."
+ exit 1
 %endif
 %if %{defined with_rtems_bspopts}
  %define rtems_bspopts %{with_rtems_bspopts}
@@ -178,7 +183,9 @@ URL: https://www.rtems.org/
 # If C++ defined for the tool set use it to control RTEMS's setting..
 #
 %if %{defined enable_cxx}
- %define rtems_cxx %{enable_cxx}
+ echo CXX has been removed."
+ echo "Please review and update your configuration."
+ exit 1
 %endif
 
 #
@@ -188,14 +195,9 @@ URL:https://www.rtems.org/
 %ifn %{defined rtems_posix}
  %define rtems_posix 1
 %endif
-%ifn %{defined rtems_networking}
- %define rtems_networking 0
-%endif
-%ifn %{defined rtems_cxx}
- %define rtems_cxx 1
-%endif
 %ifn %{defined rtems_tests}
- %define rtems_tests samples
+ %define rtems_tests False
+ %define rtems_sample_tests True
 %endif
 %ifn %{defined rtems_bspopts}
  %define rtems_bspopts %{nil}
@@ -213,8 +215,7 @@ URL: https://www.rtems.org/
 %if %{defined _internal_autotools_path}
   export PATH="%{_internal_autotools_path}/bin:${PATH}"
 %endif
-./bootstrap -c
-./rtems-bootstrap
+./waf distclean
   %endif
   cd ..
 
@@ -225,32 +226,34 @@ URL:   https://www.rtems.org/
   else
 build_dir="build"
   fi
+
+  cd ${source_dir_rtems}
+
+%ifn %{defined _bspconfig}
+  cpu=`echo %{_target} | cut -d- -f1`
+  echo "[${cpu}/%{rtems_bsp}]" > %{config_file}
+  echo "RTEMS_POSIX_API = %{?rtems_posix:True}%{!?rtems_posix:False}" 
+>> %{config_file}
+  echo "RTEMS_SMP = %{?rtems_smp:True}%{!?rtems_smp:False}" >> 
+%{config_file}
+  echo "BUILD_TESTS = %{rtems_tests}" >> %{config_file}
+  echo "BUILD_SAMPLES = %{rtems_sample_tests}" >> %{config_file} %endif
+
   mkdir -p ${build_dir}
-  cd ${build_dir}
-
-  ../${source_dir_rtems}/configure \
---build=%{_build} --host=%{_host} \
---target=%{_target} \
---enable-rtemsbsp="%{rtems_bsp}" \
-%{?rtems_cxx:--enable-cxx}%{!?rtems_cxx:--disable-cxx} \
-%{?rtems_posix:--enable-posix}%{!?rtems

RE: [PATCH] rtems/6: Update binutils to 2.37

2021-10-19 Thread Ryan Long
It hasn't been pushed yet. You had asked if there was a ticket that needed to 
be closed with that patch since it was fixing an issue we've had with aarch64. 
I responded to the email, but I guess I forgot to send in V2 with the ticket 
that it was supposed to close.

-Original Message-
From: devel  On Behalf Of Chris Johns
Sent: Monday, October 18, 2021 6:09 PM
To: j...@rtems.org
Cc: rtems-de...@rtems.org 
Subject: Re: [PATCH] rtems/6: Update binutils to 2.37

On 19/10/21 9:23 am, Joel Sherrill wrote:
> Was there something wrong with Ryan's patch to do this? He also bumped 
> RTEMS 7 tools.

No not at all.

> You reviewed it. :)

I thought I had reviewed it and I checked the repo today and could not see 
anything. Is it pushed?

Chris
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel