[PATCH 6] Fixes for headers included in C++
Hi, Looking at an EPICS utility exposed some issues with RTEMS 5 headers when included in C++ programs. These patches address some of the issues with RTEMS 6 headers when included in C++. I tested this by generating a C++ source file of all the headers for an installed Versal (aarch64) BSP. Some defines and a few headers that needed to be include before others was added. The headers that should not be directly included were removed. I did not test SMP or MP. These should be checked and any issues fixed. The testing exposed some installed header issues that have also been resolved. The tickets 4705 and 4706 are for this work. It is not complete and we should check it before releasing RTEMS 6. It is hard to sort out in releases. Chris ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH 2/5] spec/bsps/aarch64: Install ELF machine types for libdl
From: Chris Johns Updates #4705 --- spec/build/cpukit/cpuaarch64.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spec/build/cpukit/cpuaarch64.yml b/spec/build/cpukit/cpuaarch64.yml index 70d80f0b6c..2be2923a30 100644 --- a/spec/build/cpukit/cpuaarch64.yml +++ b/spec/build/cpukit/cpuaarch64.yml @@ -13,6 +13,9 @@ install: source: - cpukit/score/cpu/aarch64/include/libcpu/mmu-vmsav8-64.h - cpukit/score/cpu/aarch64/include/libcpu/vectors.h +- destination: ${BSP_INCLUDEDIR}/machine + source: + - cpukit/score/cpu/aarch64/include/machine/elf_machdep.h - destination: ${BSP_INCLUDEDIR}/rtems source: - cpukit/score/cpu/aarch64/include/rtems/asm.h -- 2.24.1 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH 3/5] spec/librtemscpu: Fix installed headers
From: Chris Johns - pci.h is only for sparc - keyimpl.h is not referenced and so not needed Updates #4705 --- spec/build/cpukit/librtemscpu.yml | 2 -- spec/build/cpukit/objpci.yml | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/spec/build/cpukit/librtemscpu.yml b/spec/build/cpukit/librtemscpu.yml index 1270ca131b..1afbb34e8a 100644 --- a/spec/build/cpukit/librtemscpu.yml +++ b/spec/build/cpukit/librtemscpu.yml @@ -23,7 +23,6 @@ install: - cpukit/include/md5.h - cpukit/include/memory.h - cpukit/include/mqueue.h - - cpukit/include/pci.h - cpukit/include/poll.h - cpukit/include/rtems.h - cpukit/include/sha256.h @@ -220,7 +219,6 @@ install: - cpukit/include/rtems/posix/barrierimpl.h - cpukit/include/rtems/posix/condimpl.h - cpukit/include/rtems/posix/key.h - - cpukit/include/rtems/posix/keyimpl.h - cpukit/include/rtems/posix/mmanimpl.h - cpukit/include/rtems/posix/mqueue.h - cpukit/include/rtems/posix/mqueueimpl.h diff --git a/spec/build/cpukit/objpci.yml b/spec/build/cpukit/objpci.yml index 21935e4592..500c20b04c 100644 --- a/spec/build/cpukit/objpci.yml +++ b/spec/build/cpukit/objpci.yml @@ -11,6 +11,7 @@ includes: [] install: - destination: ${BSP_INCLUDEDIR}/pci source: + - cpukit/include/pci.h - cpukit/include/pci/access.h - cpukit/include/pci/cfg.h - cpukit/include/pci/cfg_auto.h -- 2.24.1 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH 1/5] spec/bsps: Do not install tm27.h
From: Chris Johns Updates #4705 --- spec/build/bsps/aarch64/a53/obj.yml| 1 - spec/build/bsps/aarch64/a72/obj.yml| 1 - spec/build/bsps/aarch64/xilinx-versal/obj.yml | 1 - spec/build/bsps/aarch64/xilinx-zynqmp/obj.yml | 1 - spec/build/bsps/arm/altera-cyclone-v/bspalteracyclonev.yml | 1 - spec/build/bsps/arm/atsam/bspatsam.yml | 1 - spec/build/bsps/arm/beagle/obj.yml | 1 - spec/build/bsps/arm/csb336/bspcsb336.yml | 1 - spec/build/bsps/arm/csb337/obj.yml | 1 - spec/build/bsps/arm/edb7312/bspedb7312.yml | 1 - spec/build/bsps/arm/fvp/obj.yml| 1 - spec/build/bsps/arm/gumstix/bspgumstix.yml | 1 - spec/build/bsps/arm/imx/bspimx.yml | 1 - spec/build/bsps/arm/imxrt/bspimxrt.yml | 1 - spec/build/bsps/arm/lm3s69xx/obj.yml | 1 - spec/build/bsps/arm/lpc176x/obj.yml| 1 - spec/build/bsps/arm/lpc24xx/obj.yml| 1 - spec/build/bsps/arm/lpc32xx/obj.yml| 1 - spec/build/bsps/arm/raspberrypi/obj.yml| 1 - spec/build/bsps/arm/realview-pbx-a9/bsprealviewpbxa9.yml | 1 - spec/build/bsps/arm/rtl22xx/obj.yml| 1 - spec/build/bsps/arm/smdk2410/bspsmdk2410.yml | 1 - spec/build/bsps/arm/stm32f4/obj.yml| 1 - spec/build/bsps/arm/stm32h7/obj.yml| 1 - spec/build/bsps/arm/tms570/obj.yml | 1 - spec/build/bsps/arm/xen/bspxen.yml | 1 - spec/build/bsps/arm/xilinx-zynq/obj.yml| 1 - spec/build/bsps/arm/xilinx-zynqmp/bspxilinxzynqmp.yml | 1 - spec/build/bsps/bfin/TLL6527M/bsptll6527m.yml | 1 - spec/build/bsps/bfin/bf537Stamp/bspbf537stamp.yml | 1 - spec/build/bsps/bfin/eZKit533/bspezkit533.yml | 1 - spec/build/bsps/i386/pc386/obj.yml | 1 - spec/build/bsps/lm32/lm32_evr/obj.yml | 1 - spec/build/bsps/lm32/milkymist/bspmilkymist.yml| 1 - spec/build/bsps/m68k/av5282/bspav5282.yml | 1 - spec/build/bsps/m68k/csb360/bspcsb360.yml | 1 - spec/build/bsps/m68k/gen68340/bspgen68340.yml | 1 - spec/build/bsps/m68k/gen68360/obj.yml | 1 - spec/build/bsps/m68k/genmcf548x/obj.yml| 1 - spec/build/bsps/m68k/mcf5206elite/bspmcf5206elite.yml | 1 - spec/build/bsps/m68k/mcf52235/bspmcf52235.yml | 1 - spec/build/bsps/m68k/mcf5225x/bspmcf5225x.yml | 1 - spec/build/bsps/m68k/mcf5235/bspmcf5235.yml| 1 - spec/build/bsps/m68k/mcf5329/bspmcf5329.yml| 1 - spec/build/bsps/m68k/mrm332/bspmrm332.yml | 1 - spec/build/bsps/m68k/mvme147/bspmvme147.yml| 1 - spec/build/bsps/m68k/mvme147s/bspmvme147s.yml | 1 - spec/build/bsps/m68k/mvme162/obj.yml | 1 - spec/build/bsps/m68k/mvme167/bspmvme167.yml| 1 - spec/build/bsps/m68k/uC5282/bspuc5282.yml | 1 - spec/build/bsps/microblaze/microblaze_fpga/obj.yml | 1 - spec/build/bsps/mips/csb350/bspcsb350.yml | 1 - spec/build/bsps/mips/hurricane/bsphurricane.yml| 1 - spec/build/bsps/mips/jmr3904/bspjmr3904.yml| 1 - spec/build/bsps/mips/malta/bspmalta.yml| 1 - spec/build/bsps/mips/rbtx4925/bsprbtx4925.yml | 1 - spec/build/bsps/mips/rbtx4938/bsprbtx4938.yml | 1 - spec/build/bsps/moxie/moxiesim/bspmoxiesim.yml | 1 - spec/build/bsps/nios2/nios2_iss/bspnios2iss.yml| 1 - spec/build/bsps/or1k/generic_or1k/bspgenericor1k.yml | 1 - spec/build/bsps/powerpc/beatnik/bspbeatnik.yml | 1 - spec/build/bsps/powerpc/gen5200/obj.yml| 1 - spec/build/bsps/powerpc/gen83xx/obj.yml| 1 - spec/build/bsps/powerpc/motorola_powerpc/obj.yml | 1 - spec/build/bsps/powerpc/mpc55xxevb/obj.yml | 1 - spec/build/bsps/powerpc/mpc8260ads/bspmpc8260ads.yml | 1 - spec/build/bsps/powerpc/mvme3100/bspmvme3100.yml | 1 - spec/build/bsps/powerpc/mvme5500/bspmvme5500.yml | 1 - spec/build/bsps/powerpc/psim/bsppsim.yml | 1 - spec/build/bsps/powerpc/qemuppc/bspqemuppc.yml | 1 - spec/build/bsps/powerpc/qoriq/obj.yml | 1 - spec/build/bsps/powerpc/ss555/bspss555.yml | 1 - spec/build/bsps/powerpc/t32mppc/bspt32mppc.yml | 1 - spec/build/bsps/powerpc/tqm8xx/obj.yml | 1 - spec/build/bsps/powerpc/virtex/bspvirtex.yml | 1 - spec/build
[PATCH 4/5] cpukit/include: Fixes for C++
From: Chris Johns Updates #4706 --- cpukit/include/linux/rbtree.h | 10 +- cpukit/include/rtems/capture.h| 4 ++-- cpukit/include/rtems/score/priority.h | 4 ++-- cpukit/include/rtems/score/priorityimpl.h | 2 +- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/cpukit/include/linux/rbtree.h b/cpukit/include/linux/rbtree.h index b6ec864d06..fc6caad582 100644 --- a/cpukit/include/linux/rbtree.h +++ b/cpukit/include/linux/rbtree.h @@ -30,6 +30,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + #define rb_node RBTree_Node #define rb_left Node.rbe_left @@ -109,7 +113,7 @@ static inline struct rb_node *rb_last( struct rb_root *root ) static inline void rb_replace_node( struct rb_node *victim, - struct rb_node *replacement, + struct rb_node *replacement, struct rb_root *root ) { @@ -151,4 +155,8 @@ static inline struct rb_node *rb_parent( struct rb_node *node ) node = next \ ) +#ifdef __cplusplus +} +#endif + #endif /* _LINUX_RBTREE_H */ diff --git a/cpukit/include/rtems/capture.h b/cpukit/include/rtems/capture.h index c37d652211..4ab638ec24 100644 --- a/cpukit/include/rtems/capture.h +++ b/cpukit/include/rtems/capture.h @@ -838,7 +838,7 @@ rtems_capture_task_flags (rtems_tcb* tcb) static inline rtems_capture_control* rtems_capture_task_control (rtems_tcb* tcb) { - return tcb->Capture.control; + return (rtems_capture_control*) tcb->Capture.control; } /** @@ -853,7 +853,7 @@ rtems_capture_task_control (rtems_tcb* tcb) static inline uint32_t rtems_capture_task_control_flags (rtems_tcb* tcb) { - rtems_capture_control* control = tcb->Capture.control; + rtems_capture_control* control = rtems_capture_task_control (tcb); if (!control) return 0; return control->flags; diff --git a/cpukit/include/rtems/score/priority.h b/cpukit/include/rtems/score/priority.h index 6f6cc12bac..aa29fef8c0 100644 --- a/cpukit/include/rtems/score/priority.h +++ b/cpukit/include/rtems/score/priority.h @@ -45,12 +45,12 @@ #include #include -struct _Scheduler_Control; - #ifdef __cplusplus extern "C" { #endif +struct _Scheduler_Control; + /** * @defgroup RTEMSScorePriority Priority Handler * diff --git a/cpukit/include/rtems/score/priorityimpl.h b/cpukit/include/rtems/score/priorityimpl.h index 55cddf53be..5a9a1673f6 100644 --- a/cpukit/include/rtems/score/priorityimpl.h +++ b/cpukit/include/rtems/score/priorityimpl.h @@ -403,7 +403,7 @@ RTEMS_INLINE_ROUTINE bool _Priority_Less( const Priority_Control *the_left; const Priority_Node*the_right; - the_left = left; + the_left = (const Priority_Control*) left; the_right = RTEMS_CONTAINER_OF( right, Priority_Node, Node.RBTree ); return *the_left < the_right->priority; -- 2.24.1 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH 5/5] cpukit/include: Fix including in C++
From: Chris Johns UPdates #4706 --- cpukit/include/link_elf.h | 8 cpukit/include/rtems/posix/muteximpl.h| 7 +++ cpukit/include/rtems/posix/pthreadattrimpl.h | 2 +- cpukit/include/rtems/rtl/rtl-obj.h| 20 +++ cpukit/include/rtems/rtl/rtl.h| 2 +- cpukit/include/rtems/score/scheduleredfimpl.h | 4 ++-- cpukit/include/rtems/score/tls.h | 2 +- 7 files changed, 32 insertions(+), 13 deletions(-) diff --git a/cpukit/include/link_elf.h b/cpukit/include/link_elf.h index 6cab3c2c7f..6483c021fd 100644 --- a/cpukit/include/link_elf.h +++ b/cpukit/include/link_elf.h @@ -13,6 +13,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + enum sections { rap_text = 0, @@ -76,4 +80,8 @@ int _rtld_linkmap_add (rtems_rtl_obj* obj); * Remove link map from the list. */ void _rtld_linkmap_delete (rtems_rtl_obj* obj); + +#ifdef __cplusplus +} +#endif #endif /* _LINK_ELF_H_ */ diff --git a/cpukit/include/rtems/posix/muteximpl.h b/cpukit/include/rtems/posix/muteximpl.h index e2b4e187d1..ff1b7b1643 100644 --- a/cpukit/include/rtems/posix/muteximpl.h +++ b/cpukit/include/rtems/posix/muteximpl.h @@ -4,8 +4,8 @@ * @file * * @brief Private Inlined Routines for POSIX Mutex's. - * - * This include file contains the static inline implementation of the private + * + * This include file contains the static inline implementation of the private * inlined routines for POSIX mutex's. */ @@ -123,7 +123,7 @@ RTEMS_INLINE_ROUTINE POSIX_Mutex_Protocol _POSIX_Mutex_Get_protocol( unsigned long flags ) { - return flags & POSIX_MUTEX_PROTOCOL_MASK; + return (POSIX_Mutex_Protocol) (flags & POSIX_MUTEX_PROTOCOL_MASK); } RTEMS_INLINE_ROUTINE bool _POSIX_Mutex_Is_recursive( @@ -465,4 +465,3 @@ bool _POSIX_Mutex_Auto_initialization( POSIX_Mutex_Control *the_mutex ); #endif /* end of include file */ - diff --git a/cpukit/include/rtems/posix/pthreadattrimpl.h b/cpukit/include/rtems/posix/pthreadattrimpl.h index b94c6fc193..e1211c2861 100644 --- a/cpukit/include/rtems/posix/pthreadattrimpl.h +++ b/cpukit/include/rtems/posix/pthreadattrimpl.h @@ -91,7 +91,7 @@ RTEMS_INLINE_ROUTINE void _POSIX_Threads_Get_sched_param_sporadic( #if defined(RTEMS_POSIX_API) const POSIX_API_Control *api; - api = the_thread->API_Extensions[ THREAD_API_POSIX ]; + api = (const POSIX_API_Control*) the_thread->API_Extensions[ THREAD_API_POSIX ]; param->sched_ss_low_priority = _POSIX_Priority_From_core( scheduler, api->Sporadic.Low_priority.priority diff --git a/cpukit/include/rtems/rtl/rtl-obj.h b/cpukit/include/rtems/rtl/rtl-obj.h index 33951e10d1..6b47eb1205 100644 --- a/cpukit/include/rtems/rtl/rtl-obj.h +++ b/cpukit/include/rtems/rtl/rtl-obj.h @@ -250,7 +250,7 @@ struct rtems_rtl_obj size_t tramps_size; /**< Size of the trampoline memory. */ void* tramp_brk;/**< Trampoline memory allocator. MD * relocators can take memory from the - * break upto the size. */ + * break up to the size. */ size_t tramp_relocs; /**< Number of slots reserved for * relocs. The remainder are for * unresolved symbols. */ @@ -352,7 +352,7 @@ static inline bool rtems_rtl_obj_text_inside (const rtems_rtl_obj* obj, { return (address >= obj->text_base) && -(address < (obj->text_base + obj->text_size)); +((char*) address < ((char*) obj->text_base + obj->text_size)); } /** @@ -386,6 +386,18 @@ static inline bool rtems_rtl_obj_has_symbol (const rtems_rtl_obj* obj, sym < (obj->global_table + obj->global_syms)); } +/** + * Is there space in the trampoline memory for a trapoline. + * + * @param obj The object file's descriptor to check for available space. + * @param size The size to be allocated. + * @retval bool Returns @true if the space is available. + */ +static inline size_t rtems_rtl_obj_tramp_avail_space (const rtems_rtl_obj* obj) +{ + return (char*) obj->tramp_brk - (char*) obj->trampoline; +} + /** * Is there space in the trampoline memory for a trapoline. * @@ -397,7 +409,7 @@ static inline bool rtems_rtl_obj_has_tramp_space (const rtems_rtl_obj* obj, const size_t size) { return (obj->trampoline != NULL && - ((obj->tramp_brk - obj->trampoline) + size) <= obj->tramps_size); + (rtems_rtl_obj_tramp_avail_space (obj) + size) <= obj->tramps_size); } /** @@ -421,7 +433,7 @@ static inline size_t rtems_rtl_obj_trampoline_slots (const rtems_rtl_obj* obj) static inline size_t rtems_rtl_obj_trampolines (const rtems_rtl_obj* obj) { return obj->trampoline == NULL || obj->tramp_size == 0 ? -0 : (obj->tramp_brk - obj->trampoline) / obj->tramp
Re: [PATCH v2 1/1] bsp/riscv: Work area size based on /memory node in fdt
On Thu, 18 Aug 2022 at 13:55, Daniel Cederman wrote: > > I missed your comment, but have made the change now. Are there any > instructions on how to run the RISCV BSP tests on QEMU or Spike? I could not > get it to work. Do I need a special version of QEMU or Spike? > Thanks! AFAIR, you need to run the "medany" RISC-V variants for QEMU, I'd use rtems-tester. No special QEMU version is needed. > On 2022-08-18 10:24, Hesham Almatary wrote: > > All good, I'd just replace the "end == 0" with "end == NULL" as per my > comment above. Also please test on other RISC-V QEMU platforms to make > sure nothing got broken. > > On Wed, 17 Aug 2022 at 14:10, Joel Sherrill wrote: > > I'm ok with this if Hesham acks as well. > > --joel > > On Wed, Aug 17, 2022 at 6:35 AM Daniel Cederman wrote: > > Uses the first entry in the /memory node to determine the end of the > work area. Falls back on linker symbol if unable to parse the node. > --- > bsps/riscv/shared/start/bspgetworkarea.c | 144 +++ > spec/build/bsps/riscv/riscv/obj.yml | 1 + > 2 files changed, 145 insertions(+) > create mode 100644 bsps/riscv/shared/start/bspgetworkarea.c > > diff --git a/bsps/riscv/shared/start/bspgetworkarea.c > b/bsps/riscv/shared/start/bspgetworkarea.c > new file mode 100644 > index 00..1fa051d25e > --- /dev/null > +++ b/bsps/riscv/shared/start/bspgetworkarea.c > @@ -0,0 +1,144 @@ > +/* SPDX-License-Identifier: BSD-2-Clause */ > + > +/** > + * @file > + * > + * @brief BSP specific initialization support routines > + * > + */ > + > +/* > + * COPYRIGHT (c) 1989-2020. > + * On-Line Applications Research Corporation (OAR). > + * Cobham Gaisler AB. > + * > + * 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 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. > + */ > + > +#include > +#include > + > +#include > + > +#include > + > +/* > + * These are provided by the linkcmds for ALL of the BSPs which use this > file. > + */ > +extern char WorkAreaBase[]; > +extern char RamEnd[]; > + > +static Memory_Area _Memory_Areas[ 1 ]; > + > +static const char memory_path[] = "/memory"; > + > +static void* get_end_of_memory_from_fdt(void) > +{ > + const void *fdt; > + const void *val; > + int node; > + int parent; > + int ac; > + int sc; > + int len; > + uintptr_t start; > + uintptr_t size; > + > + fdt = bsp_fdt_get(); > + > + node = fdt_path_offset_namelen( > +fdt, > +memory_path, > +(int) sizeof(memory_path) - 1 > + ); > + > + if (node < 0) { > +return NULL; > + } > + > + parent = fdt_parent_offset(fdt, node); > + if (parent < 0) { > +return NULL; > + } > + > + ac = fdt_address_cells(fdt, parent); > + if (ac != 1 && ac != 2) { > +return NULL; > + } > + > + sc = fdt_size_cells(fdt, parent); > + if (sc != 1 && sc != 2) { > +return NULL; > + } > + > + if (sc > ac) { > +return NULL; > + } > + > + val = fdt_getprop(fdt, node, "reg", &len); > + if (len < sc + ac) { > +return NULL; > + } > + > + if (ac == 1) { > +start = fdt32_to_cpu(((fdt32_t *)val)[0]); > +size = fdt32_to_cpu(((fdt32_t *)val)[1]); > + } > + > + if (ac == 2) { > +start = fdt64_to_cpu(((fdt64_t *)val)[0]); > + > +if (sc == 1) > + size = fdt32_to_cpu(((fdt32_t *)(val+8))[0]); > +else > + size = fdt64_to_cpu(((fdt64_t *)val)[1]); > + } > + > + return (void*) (start + size); > +} > + > +static void bsp_memory_initialize( void ) > +{ > + void *end; > + > + /* get end of memory from the "/memory" node in the fdt */ > + end = get_end_of_memory_from_fdt(); > + if (end == 0) { > +/* fall back to linker symbol if "/memory" node not found or invalid */ > +end = RamEnd; > + } > + _Memory_Initialize( &_Memory_Areas[
Re: [PATCH v2 1/1] bsp/riscv: Work area size based on /memory node in fdt
On 2022-08-19 11:16, Hesham Almatary wrote: On Thu, 18 Aug 2022 at 13:55, Daniel Cederman wrote: I missed your comment, but have made the change now. Are there any instructions on how to run the RISCV BSP tests on QEMU or Spike? I could not get it to work. Do I need a special version of QEMU or Spike? Thanks! AFAIR, you need to run the "medany" RISC-V variants for QEMU, I'd use rtems-tester. No special QEMU version is needed. Thanks! I had to change "-m 64M -kernel" to "-m 128M -bios" to get it to run. Got the same result both with and without the patch for rv64imafd_medany: Passed: 653 Failed: 16 User Input: 5 Expected Fail: 0 Indeterminate: 0 Benchmark: 3 Timeout: 5 Test too long: 0 Invalid: 0 Wrong Version: 0 Wrong Build: 0 Wrong Tools: 0 Wrong Header: 0 -- Total: 682 Failures: exit03.exe ttest02.exe psx12.exe smpirqs01.exe sp69.exe spintrcritical24.exe spsysinit01.exe ts-fatal-scheduler-requires-exactly-one-processor.exe ts-fatal-start-of-mandatory-processor-failed.exe ts-validation-1.exe ts-validation-one-cpu-0.exe minimum.exe smpstart01.exe ts-fatal-smp.exe ts-performance-no-clock-0.exe ts-validation-intr.exe User Input: monitor.exe termios.exe top.exe fileio.exe capture.exe Benchmark: dhrystone.exe linpack.exe whetstone.exe Timeouts: ts-fatal-start-on-not-online-processor.exe ts-validation-0.exe ts-validation-no-clock-0.exe ts-validation-smp-only-0.exe ts-validation-timecounter-smp-0.exe On 2022-08-18 10:24, Hesham Almatary wrote: All good, I'd just replace the "end == 0" with "end == NULL" as per my comment above. Also please test on other RISC-V QEMU platforms to make sure nothing got broken. On Wed, 17 Aug 2022 at 14:10, Joel Sherrill wrote: I'm ok with this if Hesham acks as well. --joel On Wed, Aug 17, 2022 at 6:35 AM Daniel Cederman wrote: Uses the first entry in the /memory node to determine the end of the work area. Falls back on linker symbol if unable to parse the node. --- bsps/riscv/shared/start/bspgetworkarea.c | 144 +++ spec/build/bsps/riscv/riscv/obj.yml | 1 + 2 files changed, 145 insertions(+) create mode 100644 bsps/riscv/shared/start/bspgetworkarea.c diff --git a/bsps/riscv/shared/start/bspgetworkarea.c b/bsps/riscv/shared/start/bspgetworkarea.c new file mode 100644 index 00..1fa051d25e --- /dev/null +++ b/bsps/riscv/shared/start/bspgetworkarea.c @@ -0,0 +1,144 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + +/** + * @file + * + * @brief BSP specific initialization support routines + * + */ + +/* + * COPYRIGHT (c) 1989-2020. + * On-Line Applications Research Corporation (OAR). + * Cobham Gaisler AB. + * + * 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 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. + */ + +#include +#include + +#include + +#include + +/* + * These are provided by the linkcmds for ALL of the BSPs which use this file. + */ +extern char WorkAreaBase[]; +extern char RamEnd[]; + +static Memory_Area _Memory_Areas[ 1 ]; + +static const char memory_path[] = "/memory"; + +static void* get_end_of_memory_from_fdt(void) +{ + const void *fdt; + const void *val; + int node; + int parent; + int ac; + int sc; + int len; + uintptr_t start; + uintptr_t size; + + fdt = bsp_fdt_get(); + + node = fdt_path_offset_namelen( +fdt, +memory_path, +(int) sizeof(memory_path) - 1 + ); + + if (node < 0) { +return NULL; + } + + parent = fdt_parent_offset(fdt, node); + if (parent < 0) { +return NULL; + } + + ac = fdt_address_cells(fdt, parent); + if (ac != 1 && ac != 2) { +return NULL; + } + + sc = fdt_size_cells(fdt, parent); + if (sc != 1 && sc != 2) { +return
Re: [PATCH v2 1/1] bsp/riscv: Work area size based on /memory node in fdt
On Fri, 19 Aug 2022 at 13:36, Daniel Cederman wrote: > On 2022-08-19 11:16, Hesham Almatary wrote: > > On Thu, 18 Aug 2022 at 13:55, Daniel Cederman > wrote: > >> I missed your comment, but have made the change now. Are there any > instructions on how to run the RISCV BSP tests on QEMU or Spike? I could > not get it to work. Do I need a special version of QEMU or Spike? > >> > > Thanks! AFAIR, you need to run the "medany" RISC-V variants for QEMU, > > I'd use rtems-tester. No special QEMU version is needed. > > Thanks! I had to change "-m 64M -kernel" to "-m 128M -bios" to get it to > run. Got the same result both with and without the patch for > rv64imafd_medany: > Great! Thanks for testing. A patch to fix that in tester will be greatly appreciated. I thought I submitted the -bios change before but apparently not. > > Passed:653 > Failed: 16 > User Input: 5 > Expected Fail: 0 > Indeterminate: 0 > Benchmark: 3 > Timeout: 5 > Test too long: 0 > Invalid: 0 > Wrong Version: 0 > Wrong Build: 0 > Wrong Tools: 0 > Wrong Header:0 > -- > Total: 682 > Failures: > exit03.exe > ttest02.exe > psx12.exe > smpirqs01.exe > sp69.exe > spintrcritical24.exe > spsysinit01.exe > ts-fatal-scheduler-requires-exactly-one-processor.exe > ts-fatal-start-of-mandatory-processor-failed.exe > ts-validation-1.exe > ts-validation-one-cpu-0.exe > minimum.exe > smpstart01.exe > ts-fatal-smp.exe > ts-performance-no-clock-0.exe > ts-validation-intr.exe > User Input: > monitor.exe > termios.exe > top.exe > fileio.exe > capture.exe > Benchmark: > dhrystone.exe > linpack.exe > whetstone.exe > Timeouts: > ts-fatal-start-on-not-online-processor.exe > ts-validation-0.exe > ts-validation-no-clock-0.exe > ts-validation-smp-only-0.exe > ts-validation-timecounter-smp-0.exe > > >> On 2022-08-18 10:24, Hesham Almatary wrote: > >> > >> All good, I'd just replace the "end == 0" with "end == NULL" as per my > >> comment above. Also please test on other RISC-V QEMU platforms to make > >> sure nothing got broken. > >> > >> On Wed, 17 Aug 2022 at 14:10, Joel Sherrill wrote: > >> > >> I'm ok with this if Hesham acks as well. > >> > >> --joel > >> > >> On Wed, Aug 17, 2022 at 6:35 AM Daniel Cederman > wrote: > >> > >> Uses the first entry in the /memory node to determine the end of the > >> work area. Falls back on linker symbol if unable to parse the node. > >> --- > >> bsps/riscv/shared/start/bspgetworkarea.c | 144 +++ > >> spec/build/bsps/riscv/riscv/obj.yml | 1 + > >> 2 files changed, 145 insertions(+) > >> create mode 100644 bsps/riscv/shared/start/bspgetworkarea.c > >> > >> diff --git a/bsps/riscv/shared/start/bspgetworkarea.c > b/bsps/riscv/shared/start/bspgetworkarea.c > >> new file mode 100644 > >> index 00..1fa051d25e > >> --- /dev/null > >> +++ b/bsps/riscv/shared/start/bspgetworkarea.c > >> @@ -0,0 +1,144 @@ > >> +/* SPDX-License-Identifier: BSD-2-Clause */ > >> + > >> +/** > >> + * @file > >> + * > >> + * @brief BSP specific initialization support routines > >> + * > >> + */ > >> + > >> +/* > >> + * COPYRIGHT (c) 1989-2020. > >> + * On-Line Applications Research Corporation (OAR). > >> + * Cobham Gaisler AB. > >> + * > >> + * 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 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. > >> + */ > >> + > >> +#include > >> +#include > >> + > >> +#include > >> + > >> +#include > >> + > >> +/* > >> + * These are provided by the linkcmds for ALL of the BSPs which use > this file. > >> + */ > >> +extern char Work
[PATCH 1/2] tester: Add option to specify how to load image with QEMU
Defaults to "-kernel", but can be changed to, for example, "-bios". --- tester/rtems/testing/qemu.cfg | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tester/rtems/testing/qemu.cfg b/tester/rtems/testing/qemu.cfg index 3c51bee..0b592ef 100644 --- a/tester/rtems/testing/qemu.cfg +++ b/tester/rtems/testing/qemu.cfg @@ -78,6 +78,9 @@ %ifn %{defined bsp_qemu_extra_opts} %define bsp_qemu_extra_opts %{nil} %endif +%ifn %{defined bsp_qemu_image_type} + %define bsp_qemu_image_type -kernel +%endif %define qemu_cmd qemu-system-%{bsp_arch} %define qemu_opts %{bsp_qemu_opts} %{bsp_qemu_cov_opts} @@ -85,4 +88,4 @@ # # Executable # -%execute %{qemu_cmd} %{qemu_opts} %{bsp_qemu_extra_opts} -kernel %{test_executable} +%execute %{qemu_cmd} %{qemu_opts} %{bsp_qemu_extra_opts} %{bsp_qemu_image_type} %{test_executable} -- 2.34.1 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH 2/2] tester: Load RISC-V image using -bios and increase memory size
This avoids overlapping the RTEMS image with the builtin opensbi image and the location of the fdt. --- tester/rtems/testing/bsps/rv64imafd_medany.ini | 3 ++- tester/rtems/testing/bsps/rv64imafdc_medany.ini | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tester/rtems/testing/bsps/rv64imafd_medany.ini b/tester/rtems/testing/bsps/rv64imafd_medany.ini index 15137df..9a09518 100644 --- a/tester/rtems/testing/bsps/rv64imafd_medany.ini +++ b/tester/rtems/testing/bsps/rv64imafd_medany.ini @@ -32,4 +32,5 @@ bsp = rv64imafd_medany arch = riscv64 tester= %{_rtscripts}/qemu.cfg -bsp_qemu_opts = -no-reboot -nographic %{qemu_opts_no_net} -machine virt -m 64M +bsp_qemu_image_type = -bios +bsp_qemu_opts = -no-reboot -nographic %{qemu_opts_no_net} -machine virt -m 128M diff --git a/tester/rtems/testing/bsps/rv64imafdc_medany.ini b/tester/rtems/testing/bsps/rv64imafdc_medany.ini index 30abd50..cd4fe47 100644 --- a/tester/rtems/testing/bsps/rv64imafdc_medany.ini +++ b/tester/rtems/testing/bsps/rv64imafdc_medany.ini @@ -33,4 +33,5 @@ bsp = rv64imafdc_medany arch = riscv64 tester= %{_rtscripts}/qemu.cfg -bsp_qemu_opts = -no-reboot -nographic %{qemu_opts_no_net} -machine virt -m 64M +bsp_qemu_image_type = -bios +bsp_qemu_opts = -no-reboot -nographic %{qemu_opts_no_net} -machine virt -m 128M -- 2.34.1 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
[PATCH] Add POSIX Timer FACE Behavior Configuration
--- config.yml | 2 ++ spec/acfg/if/group-face.yml| 30 ++ spec/acfg/if/posix-timer-face-behavior.yml | 23 +++ 3 files changed, 55 insertions(+) create mode 100644 spec/acfg/if/group-face.yml create mode 100644 spec/acfg/if/posix-timer-face-behavior.yml diff --git a/config.yml b/config.yml index 9c5719d..0c4b547 100644 --- a/config.yml +++ b/config.yml @@ -89,6 +89,8 @@ appl-config: target: modules/rtems-docs/c-user/config/device-driver.rst - uid: /acfg/if/group-eventrecord target: modules/rtems-docs/c-user/config/event-record.rst + - uid: /acfg/if/group-face +target: modules/rtems-docs/c-user/config/face.rst - uid: /acfg/if/group-filesystem target: modules/rtems-docs/c-user/config/filesystem.rst - uid: /acfg/if/group-general diff --git a/spec/acfg/if/group-face.yml b/spec/acfg/if/group-face.yml new file mode 100644 index 000..a4feb85 --- /dev/null +++ b/spec/acfg/if/group-face.yml @@ -0,0 +1,30 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +copyrights: +- Copyright (C) 2022 On-Line Applications Research Corporation (OAR) +description: | + This section describes configuration options related to adapting + RTEMS behavior to be aligned with the FACE Technical Standard. + The FACE Technical Standard is a product of the FACE Consortium + which operates under the Open Group. The FACE Consortium was founded + by avionics organizations to improve the portability of cockpit software + across various platforms. It addresses technical and business concerns. + + Most important from an RTEMS perspective, the FACE Technical Standard + defines four POSIX profiles: Security, Safety Base, Safety Extended, and + the General Purpose Profile. Each has an increasingly larger subset of + POSIX APIs. In the Security and Safety profiles, ARINC 653 is required. + It is optional in the General Purpose Profile. + + The RTEMS Project has been tracking alignment with the FACE POSIX profiles + and they are included in the "RTEMS POSIX 1003.1 Compliance Guide." +enabled-by: true +index-entries: [] +interface-type: appl-config-group +links: +- role: interface-placement + uid: ../../if/domain +- role: requirement-refinement + uid: ../../req/applconfig +name: FACE Technical Standard Related Configuration +text: '' +type: interface diff --git a/spec/acfg/if/posix-timer-face-behavior.yml b/spec/acfg/if/posix-timer-face-behavior.yml new file mode 100644 index 000..3ab094f --- /dev/null +++ b/spec/acfg/if/posix-timer-face-behavior.yml @@ -0,0 +1,23 @@ +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause +appl-config-option-type: feature-enable +copyrights: +- Copyright (C) 2022 On-Line Applications Research Corporation (OAR) +description: | + If this configuration option is defined, then POSIX timers may + not be created to use the CLOCK_REALTIME. Per POSIX, this is allowed + behavior but per the FACE Technical Standard, it is not. Using POSIX + timers based on CLOCK_REALTIME (e.g., time of day) is unsafe for + real-time safety systems as setting CLOCK_REALTIME will perturb any + active timers. + + If this option is not defined, POSIX timers may be created to use the + CLOCK_REALTIME in compliance with the POSIX specification. +enabled-by: true +index-entries: [] +interface-type: appl-config-option +links: +- role: appl-config-group-member + uid: group-face +name: CONFIGURE_POSIX_TIMERS_FACE_BEHAVIOR +notes: null +type: interface -- 1.8.3.1 ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
rtems-central vs rtems/rtems-docs
Hi I just posted my patch to rtems-central. Unfortunately, when I ran spec2modules.py, other changes were propagated to rtems and rtems-docs. Sebastian.. can you verify that all is in sync before my patch? Thanks. --joel ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
-Werror on amd64 BSP makes it to installed package configuration file
Hi Stephen tripped across this and I'm reporting it because it is going to take some discussion to resolve. Stephen is using the .pc files to create a configuration file for the FACE Conformance Test Suite. This is now basically working for multiple BSPs. The amd64 includes -Werror in its BSP compiler options and is the only BSP to do so. (1) Do we want a BSP to include -Werror? amd64 being the only one and use having a history of chasing warnings after gcc upgrades. (2) I though warning flags were filtered out on the install. I'm not finding the code to do it but shouldn't this be filtered out like the other warning flags? Any other thoughts? --joel ___ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
Re: -Werror on amd64 BSP makes it to installed package configuration file
> On 20 Aug 2022, at 3:39 am, Joel Sherrill wrote: > > Hi > > Stephen tripped across this and I'm reporting it because it is going to > take some discussion to resolve. > > Stephen is using the .pc files to create a configuration file > for the FACE Conformance Test Suite. This is now basically working > for multiple BSPs. The amd64 includes -Werror in its BSP compiler > options and is the only BSP to do so. Looks like a bug to me. It should not be in the standard CFLAGS returned by pkgconfig. > (1) Do we want a BSP to include -Werror? amd64 being the only one > and use having a history of chasing warnings after gcc upgrades. Yes remove. Chris > (2) I though warning flags were filtered out on the install. I'm not finding > the code to do it but shouldn't this be filtered out like the other warning > flags? > > Any other thoughts? > > --joel > ___ > 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: -Werror on amd64 BSP makes it to installed package configuration file
On Fri, Aug 19, 2022, 3:00 PM Chris Johns wrote: > > On 20 Aug 2022, at 3:39 am, Joel Sherrill wrote: > > > > Hi > > > > Stephen tripped across this and I'm reporting it because it is going to > > take some discussion to resolve. > > > > Stephen is using the .pc files to create a configuration file > > for the FACE Conformance Test Suite. This is now basically working > > for multiple BSPs. The amd64 includes -Werror in its BSP compiler > > options and is the only BSP to do so. > > Looks like a bug to me. It should not be in the standard CFLAGS returned > by pkgconfig. Is there code.on our side filtering flags that missed this? I grep'ed for Werror and Wall but didn't find anything. > > > (1) Do we want a BSP to include -Werror? amd64 being the only one > > and use having a history of chasing warnings after gcc upgrades. > > Yes remove. Ok but is this the only way to remove a warning from the PC file? > > > Chris > > > (2) I though warning flags were filtered out on the install. I'm not > finding > > the code to do it but shouldn't this be filtered out like the other > warning flags? > > > > Any other thoughts? > > > > --joel > > ___ > > 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