[PATCH v2] c-user: Generate interrupt manager documentation

2021-04-26 Thread Sebastian Huber
The documentation is a consolidation of the comments in Doxygen markup
and the documentation sources in Sphinx markup.  The documentation was
transfered to interface specification items.  The documentation source
files were generated from the items by a script.

Update #3993.
---
Here is the updated document for review:

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

v2:

* Clarify service of pending interrupts in the interrupt enable
  directives.

 c-user/glossary.rst   |5 +
 c-user/interrupt/directives.rst   | 1250 +
 c-user/interrupt/introduction.rst |  101 ++-
 3 files changed, 1012 insertions(+), 344 deletions(-)

diff --git a/c-user/glossary.rst b/c-user/glossary.rst
index 33d3097..b3527a7 100644
--- a/c-user/glossary.rst
+++ b/c-user/glossary.rst
@@ -928,6 +928,11 @@ Glossary
 target
 The system on which the application will ultimately execute.
 
+target architecture
+The target architecture is the instruction set architecture (ISA) of 
the
+:term:`target`.  Some RTEMS features depend on the target 
architecture.  For
+the details consult the *RTEMS CPU Architecture Supplement*.
+
 TAS
 This term is an acronym for Test-And-Set.
 
diff --git a/c-user/interrupt/directives.rst b/c-user/interrupt/directives.rst
index 95181db..2b15fd6 100644
--- a/c-user/interrupt/directives.rst
+++ b/c-user/interrupt/directives.rst
@@ -1,521 +1, @@
 .. SPDX-License-Identifier: CC-BY-SA-4.0
 
+.. Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
 .. Copyright (C) 1988, 2008 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
+.. worded better please post a report or patch to an RTEMS mailing list
+.. or raise a bug report:
+..
+.. https://www.rtems.org/bugs.html
+..
+.. For information on updating and regenerating please refer to the How-To
+.. section in the Software Requirements Engineering chapter of the
+.. RTEMS Software Engineering manual.  The manual is provided as a part of
+.. a release.  For development sources please refer to the online
+.. documentation at:
+..
+.. https://docs.rtems.org
+
+.. _InterruptManagerDirectives:
+
 Directives
 ==
 
-This section details the interrupt manager's directives.  A subsection is
-dedicated to each of this manager's directives and describes the calling
-sequence, related constants, usage, and status codes.
+This section details the directives of the Interrupt Manager. A subsection is
+dedicated to each of this manager's directives and lists the calling sequence,
+parameters, description, return values, and notes of the directive.
+
+.. Generated from spec:/rtems/intr/if/catch
 
 .. raw:: latex
 
-   \clearpage
+\clearpage
 
+.. index:: rtems_interrupt_catch()
 .. index:: establish an ISR
 .. index:: install an ISR
-.. index:: rtems_interrupt_catch
 
-.. _rtems_interrupt_catch:
+.. _InterfaceRtemsInterruptCatch:
 
-INTERRUPT_CATCH - Establish an ISR
---
+rtems_interrupt_catch()
+---
+
+Establishes an interrupt service routine.
+
+.. rubric:: CALLING SEQUENCE:
+
+.. code-block:: c
+
+rtems_status_code rtems_interrupt_catch(
+  rtems_isr_entry new_isr_handler,
+  rtems_vector_number vector,
+  rtems_isr_entry*old_isr_handler
+);
+
+.. rubric:: PARAMETERS:
+
+``new_isr_handler``
+This parameter is the new interrupt service routine.
+
+``vector``
+This parameter is the interrupt vector number.
+
+``old_isr_handler``
+This parameter is the pointer to an :c:type:`rtems_isr_entry` variable.
+When the directive call is successful, the previous interrupt service
+routine established for this interrupt vector will be stored in this
+variable.
+
+.. rubric:: DESCRIPTION:
+
+This directive establishes an interrupt service routine (ISR) for the interrupt
+specified by the ``vector`` number.  The ``new_isr_handler`` parameter
+specifies the entry point of the ISR.  The entry point of the previous ISR for
+the specified vector is returned in ``old_isr_handler``.
+
+To release an interrupt vector, pass the old handler's address obtained when
+the vector was first capture.
+
+.. rubric:: RETURN VALUES:
+
+:c:macro:`RTEMS_SUCCESSFUL`
+The requested operation was successful.
+
+:c:macro:`RTEMS_INVALID_NUMBER`
+The interrupt vector number was illegal.
+
+:c:macro:`RTEMS_INVALID_ADDRESS`
+The ``new_isr_handler`` parameter was `NULL
+`_.
+
+:c:macro:`RTEMS_INVALID_ADDRESS`
+The ``old_isr_handler`` parameter was `NULL
+`_.
 
-CALLING SEQUENCE:
-.. code-block:: c
+.. rubric:: CONSTRAINTS:
 
-rtems_status_code rtems_interrupt_catch(
-  rtems_isr_entry  new_isr_handler,
-  rtems_vect

Re: [PATCH v2] STM32 lwIP addition and CMake support

2021-04-26 Thread Gedare Bloom
Hi Robin,

I'm wading in here a little bit late, but I want to address a couple things.

First, if we will move forward with this, it would be best to separate
the functional patch from the build patch. I.e., split the cmake stuff
from the driver/code improvements. That said, see the following 2
points whether this is worth doing.

Second, I don't know that I will be in favor of adding cmake to
anything other than the rtems-examples repo. The reason for this is
that it creates a heavy maintenance burden. Bringing it into one of
our release repos means we need to make sure the cmake build will work
on all supported hosts (Linux, freebsd, Mac, Windows) before we cut
releases. This is a big burden for our already over-taxed release
procedures.

Third, I have serious concerns about the license at
http://www.st.com/SLA0044   To me, #5 is a non-starter. Please see if
STM provides the code under any other license, or if there is someone
to contact to negotiate a better license. We can accept a BSD-style
licence with vendor device restrictions in device driver/HAL code, but
this license has too many poorly-worded clauses that it induces a big
legal concern that I'm not comfortable about accepting.

If the third point isn't addressed, then I don't know how we will
proceed. Probably, we need to figure out a technical approach that
allows this code to live by itself and not be distributed/bundled with
any other software by us, and instead write some scripting to help
users to fetch and build the code themselves and to incur the legal
compliance problems on themselves. With some warnings provided by us,
of course. :)  I'm willing to help/supervise with that if you want to
push forward with figuring out how to accommodate proprietary
encumbered non-free drivers, but we can't merge them directly into our
code base unless the license is agreeable. Some vendors (Xilinx, TI)
have been good about fixing their licenses when we point out to them
that they don't work as expected. Maybe STM will too.

Gedare

On Mon, Apr 26, 2021 at 3:25 AM Robin Mueller  wrote:
>
> This patch adds CMake support to RTEMS lwIP.
> It also improves the architecture to make integration
> of new BSPs easier.
>
> https://github.com/rmspacefish/rtems-stm32-lwip is a self-contained
> repository to test the lwIP integration for the arm/stm32h7
> and arm/nucleo-h743zi BSP.
>
> The STM32 port includes the LAN driver (lan8742.c), the
> primary port functions in ethernetif.c and some application code
> taken from CubeH7, which can serve as a starting point for
> implementations and was also tailored to RTEMS.
>
> The common source file were refactored to be more generic and independent
> of the used BSP.
>
> More information can also be found in the README, which also specifies
> how to build with CMake. The waf build system still needs to be adapted
> to perform the same function.
> ---
>  .gitignore|  10 +
>  .gitmodules   |   1 +
>  CMakeLists.txt|  76 ++
>  README.md |  32 +
>  cmake/PortSelect.cmake|  12 +
>  lwip-to-rtems.py  |   0
>  lwip/CMakeLists.txt   |   2 +
>  lwip/ports/CMakeLists.txt |   2 +
>  lwip/ports/drivers/CMakeLists.txt |  20 +
>  .../drivers/{eth_lwip.c => rtems_lwip.c}  | 181 +++--
>  .../drivers/{eth_lwip.h => rtems_lwip.h}  |  79 +-
>  .../{eth_lwip_default.h => rtems_lwip_conf.h} |  30 +-
>  lwip/ports/drivers/stm32h7/CMakeLists.txt |  14 +
>  lwip/ports/drivers/stm32h7/app_dhcp.c | 217 +
>  lwip/ports/drivers/stm32h7/app_ethernet.c | 187 +
>  lwip/ports/drivers/stm32h7/ethernetif.c   | 758 ++
>  .../drivers/stm32h7/include/CMakeLists.txt|   7 +
>  .../stm32h7/include/lwip_port/app_dhcp.h  |  38 +
>  .../stm32h7/include/lwip_port/app_ethernet.h  |  56 ++
>  .../stm32h7/include/lwip_port/ethernetif.h|  56 ++
>  lwip/ports/drivers/stm32h7/lan8742.c  | 664 +++
>  lwip/ports/drivers/stm32h7/lan8742.h  | 448 +++
>  .../stm32h7/template/lwipopts_template.h  | 289 +++
>  lwip/ports/drivers/tms570/CMakeLists.txt  |   4 +
>  .../ports/drivers/{ => tms570}/phy_dp83848h.c |   0
>  .../ports/drivers/{ => tms570}/phy_dp83848h.h |   0
>  .../tms570/template/lwipopts_template.h   |  75 ++
>  lwip/ports/drivers/{ => tms570}/ti_drv_emac.h |   0
>  lwip/ports/drivers/{ => tms570}/ti_drv_mdio.h |   0
>  lwip/ports/drivers/{ => tms570}/tms570_emac.h |   0
>  .../ports/drivers/{ => tms570}/tms570_netif.c |  11 +-
>  .../ports/drivers/{ => tms570}/tms570_netif.h |  31 +
>  lwip/ports/os/CMakeLists.txt  |   1 +
>  lwip/ports/os/rtems/CMakeLists.txt|   9 +
>  lwip/ports/os/rtems/arch/CMakeLists.txt   |   4 +
>  lwip/ports/os/rtems/arch/cc.h |   3 +
>  l

Re: [PATCH v4] psx13: Reworked and relicensed

2021-04-26 Thread Gedare Bloom
Looks ok, confirm you tested with/without debug, and go ahead and push.

On Mon, Apr 26, 2021 at 10:10 AM Ryan Long  wrote:
>
> Changed the way the tests were structured, added rtems_test_assert()'s,
> updated psx13.scn and the license.
>
> Update #3899
> ---
>  testsuites/psxtests/psx13/main.c|  37 +-
>  testsuites/psxtests/psx13/psx13.scn |  21 +-
>  testsuites/psxtests/psx13/test.c| 852 
> 
>  3 files changed, 328 insertions(+), 582 deletions(-)
>
> diff --git a/testsuites/psxtests/psx13/main.c 
> b/testsuites/psxtests/psx13/main.c
> index 20788b3..f9e7907 100644
> --- a/testsuites/psxtests/psx13/main.c
> +++ b/testsuites/psxtests/psx13/main.c
> @@ -1,14 +1,37 @@
> -/*
> - *  Simple test program -- simplified version of sample test hello.
> +/*  SPDX-License-Identifier: BSD-2-Clause */
> +
> +/**
> + *  @file
>   *
> - *  COPYRIGHT (c) 1989-2009.
> - *  On-Line Applications Research Corporation (OAR).
> + *  @brief Simple test program -- simplified version of sample test hello.
>   *
> - *  The license and distribution terms for this file may be
> - *  found in the file LICENSE in this distribution or at
> - *  http://www.rtems.org/license/LICENSE.
>   */
>
> +/*
> + *  COPYRIGHT (c) 1989-2009, 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
> + * 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.
> + */
>
>  #ifdef HAVE_CONFIG_H
>  #include "config.h"
> diff --git a/testsuites/psxtests/psx13/psx13.scn 
> b/testsuites/psxtests/psx13/psx13.scn
> index 428a931..efa79c9 100644
> --- a/testsuites/psxtests/psx13/psx13.scn
> +++ b/testsuites/psxtests/psx13/psx13.scn
> @@ -1,16 +1,7 @@
> -*** POSIX TEST 13 ***
> +*** BEGIN OF TEST PSX 13 ***
> +*** TEST VERSION: 6.0.0.75f80242186af2dde0c5bc7272a119e3b78d7ba0
> +*** TEST STATE: EXPECTED_PASS
> +*** TEST BUILD: RTEMS_DEBUG RTEMS_POSIX_API
> +*** TEST TOOLS: 10.2.1 20210309 (RTEMS 6, RSB 
> 5e449fb5c2cb6812a238f9f9764fd339cbbf05c2, Newlib d10d0d9)
>
> -Files initialized successfully.
> -Testing device_lseek()... Failed!!!
> -Testing dup() Failed!!!
> -Testing dup2()... Success.
> -Testing fdatasync().. Success.
> -Testing umask().. Success.
> -Testing utime().. Success.
> -Testing utimes().. Success.
> -Testing fsync().. Success.
> -Testing pathconf()... Success.
> -Testing fpathconf().. Success.
> -Testing sync()..
> -
> -*** END OF TEST PSX13 ***
> +*** END OF TEST PSX 13 ***
> diff --git a/testsuites/psxtests/psx13/test.c 
> b/testsuites/psxtests/psx13/test.c
> index 79b24c2..a82242b 100644
> --- a/testsuites/psxtests/psx13/test.c
> +++ b/testsuites/psxtests/psx13/test.c
> @@ -1,26 +1,49 @@
> -/*
> - *  Psx13
> - *  Chris Bond (working under Jennifer's account)
> +/*  SPDX-License-Identifier: BSD-2-Clause */
> +
> +/**
> + *  @file
>   *
> - *  This test exercises the following routines:
> + *  @brief This tests various file system functions.
>   *
> - * device_lseek - test implemented
> - * dup  - test implemented
> - * dup2 - test implemented
> - * fdatasync- test implemented
> - * fsync- test implemented
> - * pathconf - test implemented
> - * fpathconf- test implemented
> - * umask- test implemented
> - * utime- test implemented
> - * utimes   - test implemented
> + *  This test exercises the following routines:
>   *
> - *  COPYRIGHT (c) 1989-2009.
> + * - lseek()
> + * - dup()
> + * - dup2()
> + * - fdatasync()
> + * - fsync()
> + * - pathconf()
> + * - fpathconf()
> + * - umask()
> + * - utime()
> + * - uti

Re: [PATCH] c-user: Generate scheduling concepts documentation

2021-04-26 Thread Gedare Bloom
looks good.

On Fri, Apr 23, 2021 at 1:15 PM Sebastian Huber
 wrote:
>
> The documentation is a consolidation of the comments in Doxygen markup
> and the documentation sources in Sphinx markup.  The documentation was
> transfered to interface specification items.  The documentation source
> files were generated from the items by a script.
>
> Update #3993.
> ---
>
> Here is the updated document for review:
>
> https://ftp.rtems.org/pub/rtems/people/sebh/c-user.pdf
>
>  c-user/scheduling-concepts/directives.rst   | 885 +---
>  c-user/scheduling-concepts/introduction.rst |  86 +-
>  2 files changed, 646 insertions(+), 325 deletions(-)
>
> diff --git a/c-user/scheduling-concepts/directives.rst 
> b/c-user/scheduling-concepts/directives.rst
> index 5b1246f..f80c5bd 100644
> --- a/c-user/scheduling-concepts/directives.rst
> +++ b/c-user/scheduling-concepts/directives.rst
> @@ -1,424 +1,701 @@
>  .. SPDX-License-Identifier: CC-BY-SA-4.0
>
> -.. Copyright (C) 1988, 2008 On-Line Applications Research Corporation (OAR)
> +.. Copyright (C) 2013, 2021 embedded brains GmbH 
> (http://www.embedded-brains.de)
> +.. Copyright (C) 1988, 2017 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
> +.. worded better please post a report or patch to an RTEMS mailing list
> +.. or raise a bug report:
> +..
> +.. https://www.rtems.org/bugs.html
> +..
> +.. For information on updating and regenerating please refer to the How-To
> +.. section in the Software Requirements Engineering chapter of the
> +.. RTEMS Software Engineering manual.  The manual is provided as a part of
> +.. a release.  For development sources please refer to the online
> +.. documentation at:
> +..
> +.. https://docs.rtems.org
> +
> +.. _SchedulerManagerDirectives:
>
>  Directives
>  ==
>
> -This section details the scheduler manager.  A subsection is dedicated to 
> each
> -of these services and describes the calling sequence, related constants, 
> usage,
> -and status codes.
> +This section details the directives of the Scheduler Manager. A subsection is
> +dedicated to each of this manager's directives and lists the calling 
> sequence,
> +parameters, description, return values, and notes of the directive.
> +
> +.. Generated from spec:/rtems/scheduler/if/ident
>
>  .. raw:: latex
>
> -   \clearpage
> +\clearpage
>
> -.. _rtems_scheduler_ident:
> +.. index:: rtems_scheduler_ident()
>
> -SCHEDULER_IDENT - Get ID of a scheduler
> 
> +.. _InterfaceRtemsSchedulerIdent:
> +
> +rtems_scheduler_ident()
> +---
> +
> +Identifies a scheduler by the object name.
> +
> +.. rubric:: CALLING SEQUENCE:
> +
> +.. code-block:: c
> +
> +rtems_status_code rtems_scheduler_ident( rtems_name name, rtems_id *id );
> +
> +.. rubric:: PARAMETERS:
> +
> +``name``
> +This parameter is the scheduler name to look up.
> +
> +``id``
> +This parameter is the pointer to an object identifier variable.  When the
> +directive call is successful, the identifier of the scheduler will be
> +stored in this variable.
>
> -CALLING SEQUENCE:
> -.. code-block:: c
> +.. rubric:: DESCRIPTION:
>
> -rtems_status_code rtems_scheduler_ident(
> -rtems_name  name,
> -rtems_id   *id
> -);
> +This directive obtains a scheduler identifier associated with the scheduler
> +name specified in ``name``.
>
> -DIRECTIVE STATUS CODES:
> -.. list-table::
> - :class: rtems-table
> +.. rubric:: RETURN VALUES:
>
> - * - ``RTEMS_SUCCESSFUL``
> -   - Successful operation.
> - * - ``RTEMS_INVALID_ADDRESS``
> -   - The ``id`` parameter is ``NULL``.
> - * - ``RTEMS_INVALID_NAME``
> -   - Invalid scheduler name.
> +:c:macro:`RTEMS_SUCCESSFUL`
> +The requested operation was successful.
>
> -DESCRIPTION:
> -Identifies a scheduler by its name.  The scheduler name is determined by
> -the scheduler configuration.  See :ref:`ConfigurationSchedulerTable`
> -and :ref:`CONFIGURE_SCHEDULER_NAME`.
> +:c:macro:`RTEMS_INVALID_NAME`
> +There was no scheduler associated with the name.
>
> -NOTES:
> -None.
> +:c:macro:`RTEMS_INVALID_ADDRESS`
> +The ``id`` parameter was `NULL
> +`_.
> +
> +.. rubric:: NOTES:
> +
> +The scheduler name is determined by the scheduler configuration.
> +
> +The scheduler identifier is used with other scheduler related directives to
> +access the scheduler.
> +
> +.. 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.
> +
> +.. Generated from spec:/rtems/scheduler/if/ident-by-processor
>
>  .. raw:: latex
>
> -   \clearpage
> +\clearpage
> +
> +.. inde

Re: [PATCH v1 1/3] cpukit: Add signal mapping support

2021-04-26 Thread Gedare Bloom
On Fri, Apr 23, 2021 at 8:28 AM Kinsey Moore  wrote:
>
> On 4/20/2021 01:44, Chris Johns wrote:
> > On 20/4/21 4:38 pm, Sebastian Huber wrote:
> >> On 20/04/2021 08:30, Chris Johns wrote:
> >>> On 20/4/21 3:54 pm, Sebastian Huber wrote:
>  On 20/04/2021 07:30, Chris Johns wrote:
> 
> > We need a way for libdebugger or any other piece of software to capture 
> > and
> > cascade the call. If this can be done on aarch64 then I am happy.
>  The fatal error extensions execute in a user controllable order. You can 
>  for
>  example register a libdebugger handler which deals with break point 
>  exceptions
>  before the signal mapping handler is called.
> 
>  Synchronous exceptions should end up in an RTEMS_FATAL_SOURCE_EXCEPTION 
>  fatal
>  error. The fatal code is a pointer to rtems_exception_frame
>  (CPU_Exception_frame). In this data structure should be the complete 
>  state of
>  the interrupted context (which could be also an interrupt handler). If 
>  you want
>  to resume execution of the interrupted context, then we need an API for 
>  this
>  (setters/getters and some sort of a longjmp()).
> >>> I do not think the fatal error handler support is suitable for a 
> >>> debugger, the
> >>> frame maybe on the wrong stack. It was more complicated to implement than 
> >>> this
> >>> and the reality of what is needed on the ARM required lots more. The 
> >>> fatal error
> >>> handler handles fatal errors however surviving a data abort and then 
> >>> continuing
> >>> in the correct CPU context/space and stack is much harder to do 
> >>>
> >>> https://git.rtems.org/rtems/tree/cpukit/libdebugger/rtems-debugger-arm.c#n1454
> >>>
> >>> That code has to work with all data and states saved.
> >> Yes, this code is the "some sort of a longjump()". The code mentioned above
> >> doesn't seem to be necessarily libdebugger-specific.
> > Ah OK we agree :). I would love to see that happen.
> >
> > The fatal error handler API would then be built on an exception management 
> > API.
> > I personally believe this is a key piece of functionality RTEMS would 
> > benefit
> > from. It would make adding signal support easy.
>
>
> My initial thoughts on an exception management API (EMAPI):
>
> additional CPU port requirements for EMAPI support:
>  provide functions which operate on CPU Exception Frame (CEF)
>  get address of exception
>  get exception class (these will be as granular as possible
> while still being arch-agnostic)
>  set address to resume execution as instruction after exception
>  set address to resume execution (arbitrary)
>
>  upon exception, creates CEF on thread stack and calls into EMAPI
>  upon return from EMAPI, restores CEF and returns to normal execution
>
> EMAPI:
>  No architecture-specific information is directly exposed
>  CEF is provided as a handle on which to operate
>  architecture-specific details can be pulled from CEF if necessary
>
>
>  handler gets CEF as only argument
>  handler return value determines whether it took final actions based
> on the CEF
>
>  handler list is ordered based on priority, but not otherwise keyed
>  a handler that takes a final action prevents execution of
> further handlers
>
>  lowest priority handler is always present (frame dump and fatal
> extensions run here)
>

I think this belongs in a new thread for discussion and easier
search/reference in future. This smells important :)

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


Re: RTEMS on PolarFire SoC ICICLE Kit FPGA

2021-04-26 Thread Hesham Almatary
On Sun, 25 Apr 2021 at 21:04, somesh deshmukh
 wrote:
>
> Hi Hesham,
>
> Comments added below and please find the attached device tree source file.
>
> Regards,
> Somesh
>
> On Sun, Apr 25, 2021 at 12:34 AM Hesham Almatary 
>  wrote:
>>
>> Hello Somesh,
>>
>> On Sat, 24 Apr 2021 at 20:52, somesh deshmukh
>>  wrote:
>> >
>> > Hi,
>> >
>> > The diff between the changed files is mentioned below. The default riscv 
>> > clock driver is recently updated and it includes the changes I was 
>> > proposing.
>> >
>> > --- /rtems/bsps/riscv/riscv/console/console-config.c 2021-04-23 
>> > 16:01:13.355468092 +0530
>> > +++ /quick-start/rtems/bsps/riscv/riscv/console/console-config.c 
>> > 2021-04-24 21:08:55.0 +0530
>> > @@ -91,7 +91,7 @@
>> >  stdout_path = "";
>> >}
>> >
>> > -#if RISCV_ENABLE_FRDME310ARTY_SUPPORT != 0
>> > +#if ((RISCV_ENABLE_FRDME310ARTY_SUPPORT != 0) || 
>> > (RISCV_CONSOLE_MAX_NS16550_DEVICES > 0))
>> >int root;
>> >int soc;
>> >root = fdt_path_offset(fdt, "/");
>> > @@ -318,7 +318,7 @@
>> >
>> >  rtems_termios_device_install(
>> >path,
>> > -  &ns16550_handler_interrupt,
>> > +  &ns16550_handler_polled,
>> Doesn't your UART support interrupts? Could you also paste your DTS?
>
>>> Yes, my UART supports interrupt mode but in the console-config.c 
> line 234 and 235 we are assigning the ns16550_polled_putchar and 
> ns16550_polled_getchar for write and read respectively. Because of this 
> assignment I wanted to initialize the console as ns16550_handler_polled.
> >> But this is not the issue I faced, I was facing a problem in 
> riscv_get_console_node(diff have the change I made). Without that change, I 
> was not able to read the console_node correctly for ns16550.
Yeah please submit a separate patch for that so that we can review and push it.

>>
>>
>> >NULL,
>> >&ctx->base
>> >  );
>> >
>> > --- /rtems/spec/build/bsps/riscv/riscv/bsprv64imafdcmedany.yml 2021-04-23 
>> > 16:01:13.563436275 +0530
>> > +++ /quick-start/rtems/spec/build/bsps/riscv/riscv/bsprv64imafdcmedany.yml 
>> > 2021-03-26 14:30:37.454515153 +0530
>> > @@ -12,7 +12,7 @@
>> >  install: []
>> >  links:
>> >  - role: build-dependency
>> > -  uid: ../../opto2
>> > +  uid: ../../opto0
>> >  - role: build-dependency
>> >uid: grp
>> >  source: []
>> >
>> > --- /rtems/bsps/riscv/shared/start/start.S 2021-04-23 16:01:13.359467480 
>> > +0530
>> > +++ /quick-start/rtems/bsps/riscv/shared/start/start.S 2021-03-18 
>> > 11:16:47.608079073 +0530
>> > @@ -74,17 +74,18 @@
>> >   LADDR sp, _ISR_Stack_area_end
>> >  #endif
>> >
>> > +/* Clear .bss */
>> > +LADDR a0, bsp_section_bss_begin
>> > +li a1, 0
>> > +LADDR a2, bsp_section_bss_size
>> > +call memset
>> > +
>> That shouldn't be a bug on the RTEMS side. It seems like your placed
>> FDT overlaps with RAM/BSS area. How/where are you embedding the FDT?
>
> >> Yes. The fdt overlaps with the BSS area. The DTB is available at 
> 0x8000 location and the same address is passed to
> >> #a1 register. The bsp_fdt_blob is getting address from .BSS section.
>
Right, it is the RTEMS allocated bsp_fdt_blob that's placed in the
BSS. If you can submit another patch for that it will be great. Please
read https://docs.rtems.org/branches/master/user/support/contrib.html

> >> #ifdef BSP_START_COPY_FDT_FROM_U_BOOT
> >>  li  a1, 0x8000
> >> mv a0, a1
> >> call bsp_fdt_copy
>
> >> This is the startup code that copies the fdt blob address in a1 
> register manually. after this, the bsp_fdt_cpoy will copy the
> >>  fdt blob from 0x8000 to local memory.
>
> Sections:
> Idx Name   SizeVMA
> LMA   File off  Algn  Flags
>  13 .bss   00013ae8  80124e40  80124e40  00025d98  
> 2**6  ALLOC
>
> SYMBOL TABLE:
> 80127ac0 l O .bss 0001 bsp_fdt_blob
>
>
>>
>>
>> >  #ifdef BSP_START_COPY_FDT_FROM_U_BOOT
>> >   mv a0, a1
>> >   call bsp_fdt_copy
>> >  #endif
>> >
>> > - /* Clear .bss */
>> > - LADDR a0, bsp_section_bss_begin
>> > - li a1, 0
>> > - LADDR a2, bsp_section_bss_size
>> > - call memset
>> > -
>> >  #ifdef RTEMS_SMP
>> >   /* Give go to secondary processors */
>> >   LADDR t0, .Lsecondary_processor_go
>> >
>> > Let me know if you have any comments/suggestions for the above changes.
>> >
>> > Regards,
>> > Somesh
>> >
>> > On Fri, Apr 23, 2021 at 5:15 PM Joel Sherrill  wrote:
>> >>
>> >> I agree with Karel that a diff posted would be appreciated. It.would be 
>> >> nice to see this worked through and merged. Also updates to the Users 
>> >> Guide on this.
>> >>
>> >> On Thu, Apr 22, 2021, 10:52 PM somesh deshmukh 
>> >>  wrote:
>> >>>
>> >>> I was able to test the rtems hello-world example and ticker example on 
>> >>> the polarfire soc icicle kit.
>> >>>
>> >>> A little background about Polarfire SoC ICICLE Kit.
>> >>> The PolarFire SoC Icicle kit is a low-cos

Re: [PATCH] c-user: Generate interrupt manager documentation

2021-04-26 Thread Joel Sherrill
On Mon, Apr 26, 2021 at 1:36 PM Sebastian Huber <
sebastian.hu...@embedded-brains.de> wrote:

> On 26/04/2021 20:30, Gedare Bloom wrote:
>
> > I need clarification on a subtle point, which exists prior to your
> > change. It may be that I just don't understand what we mean by "The
> > directive will not cause the calling task to be preempted.", but does
> > rtems_interrupt_enable() and rtems_interrupt_flash() introduce a
> > preemption point? The documentation suggests it does not, but I am not
> > so clear. What about rtems_interrupt_lock_acquire() and
> > rtems_interrupt_lock_release()? Similar kind of thinking applies.
> > Calling these directives can cause a scheduling invocation due to, for
> > example, a deferred clock tick interrupt or a block/unblock operation.
> > This can cause the task to be preempted? Or do I misunderstand.
> Maybe we should give a hint, that enabling maskable interrupts may
> result immediately in an interrupt service which may result in a
> preemption of the calling task. Strictly, this preemption is not done by
> the calling task. The calling task doesn't invoke the scheduler or
> perform a thread dispatch directly.
>

Gedare and I chatted about this and this was my explanation. It you wrote
a test to see a preemption as a side-effect of enable/flash, it would fail
because it does not directly cause one.

On a SMP system with the synchronization to disable interrupts on all
cores, I assume this also holds.

A hint is definitely worth providing. The same logic applies to any
method. If you get an interrupt while in it, you could get preempted
while the method doesn't directly cause the preemption.

--joel

>
> --
> 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
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH] c-user: Generate interrupt manager documentation

2021-04-26 Thread Sebastian Huber

On 26/04/2021 20:30, Gedare Bloom wrote:


I need clarification on a subtle point, which exists prior to your
change. It may be that I just don't understand what we mean by "The
directive will not cause the calling task to be preempted.", but does
rtems_interrupt_enable() and rtems_interrupt_flash() introduce a
preemption point? The documentation suggests it does not, but I am not
so clear. What about rtems_interrupt_lock_acquire() and
rtems_interrupt_lock_release()? Similar kind of thinking applies.
Calling these directives can cause a scheduling invocation due to, for
example, a deferred clock tick interrupt or a block/unblock operation.
This can cause the task to be preempted? Or do I misunderstand.
Maybe we should give a hint, that enabling maskable interrupts may 
result immediately in an interrupt service which may result in a 
preemption of the calling task. Strictly, this preemption is not done by 
the calling task. The calling task doesn't invoke the scheduler or 
perform a thread dispatch directly.


--
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] c-user: Generate interrupt manager documentation

2021-04-26 Thread Gedare Bloom
I need clarification on a subtle point, which exists prior to your
change. It may be that I just don't understand what we mean by "The
directive will not cause the calling task to be preempted.", but does
rtems_interrupt_enable() and rtems_interrupt_flash() introduce a
preemption point? The documentation suggests it does not, but I am not
so clear. What about rtems_interrupt_lock_acquire() and
rtems_interrupt_lock_release()? Similar kind of thinking applies.
Calling these directives can cause a scheduling invocation due to, for
example, a deferred clock tick interrupt or a block/unblock operation.
This can cause the task to be preempted? Or do I misunderstand.

One more comment below for Sebastian:
On Fri, Apr 23, 2021 at 7:38 AM Sebastian Huber
 wrote:
>
> -INTERRUPT_FLASH - Flash Interrupts
> ---
> +rtems_interrupt_flash()
> +---
> +
> +Flashes interrupts on the current processor.
> +
> +.. rubric:: CALLING SEQUENCE:
> +
> +.. code-block:: c
> +
> +#define rtems_interrupt_flash( isr_cookie )
> +
> +.. rubric:: PARAMETERS:
>
> -CALLING SEQUENCE:
> -.. code-block:: c
> +``isr_cookie``
> +This parameter is the previous interrupt level.
>
> -void rtems_interrupt_flash(
> -  rtems_interrupt_level level
> -);
> +.. rubric:: DESCRIPTION:
>
> -DIRECTIVE STATUS CODES:
> -NONE
> +This directive is functionally equivalent to a calling
delete 'a'
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: Implimenting timer_monotonic

2021-04-26 Thread Gedare Bloom
On Thu, Apr 22, 2021 at 1:39 PM zack_on_the_speed_chanel
 wrote:
>
> Hello,
>
> So in looking at the ticket i realized it was more the making the test and 
> only testing the creation of a timer object. I  also have to implement the 
> monotonic timer. Right now it seems like a monumental task for me currently.

What ticket?

We first need the test case. It can be a helpful contribution even if
you can't be the one to write the implementation, we can add the test
case code to the ticket and hopefully you or someone else can use it
when they try to make the implementation work.

> I began to  look at the code for timergettime. I'm looking at how the value 
> of "now" (current time)  will differ  monotonic vs realtime. Currently now is 
> set to Watchdog.ticks.  I understand in timergettime that most of it is  
> getting if the timer expired and putting it into the timespec.
> I also have a  question about the setting of the overrun in settimer's  
> _POSIX_Timer_TSR fuction. I'm wondering about how overrun is set, because it 
> is incriminated and set to zero in the function?
>

there is pthread_kill() between increment and set to zero. So there is
a context switch here, and you don't know what might happen in
between.

>
>
>
> Thanks
> Zack
> ___
> 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 rtems-docs v2] legacy-networking: Add note with build instructions for rtems-net-legacy

2021-04-26 Thread Joel Sherrill
Looks good.

On Mon, Apr 26, 2021, 9:32 AM Vijay Kumar Banerjee  wrote:

> On Mon, Apr 26, 2021 at 8:23 AM Joel Sherrill  wrote:
> >
> >
> >
> > On Thu, Apr 22, 2021 at 8:58 PM Vijay Kumar Banerjee 
> wrote:
> >>
> >> ---
> >>  legacy-networking/index.rst   |  1 +
> >>  legacy-networking/quick_start.rst | 33 +++
> >>  2 files changed, 34 insertions(+)
> >>  create mode 100644 legacy-networking/quick_start.rst
> >>
> >> diff --git a/legacy-networking/index.rst b/legacy-networking/index.rst
> >> index b85119d..acbfd35 100644
> >> --- a/legacy-networking/index.rst
> >> +++ b/legacy-networking/index.rst
> >> @@ -22,6 +22,7 @@ RTEMS Legacy Network User Manual (|version|).
> >> :numbered:
> >>
> >> preface
> >> +   quick_start
> >> network_task_structure
> >> networking_driver
> >> using_networking_rtems_app
> >> diff --git a/legacy-networking/quick_start.rst
> b/legacy-networking/quick_start.rst
> >> new file mode 100644
> >> index 000..fc2fee5
> >> --- /dev/null
> >> +++ b/legacy-networking/quick_start.rst
> >> @@ -0,0 +1,33 @@
> >> +.. SPDX-License-Identifier: CC-BY-SA-4.0
> >> +
> >> +Quick Start
> >> +###
> >> +
> >> +This legacy networking is now a standalone repository and needs to be
> built
> >> +separately.
> >> +
> >> +The repository can be found here:
> https://git.rtems.org/rtems-net-legacy/
> >> +
> >> +There's an RSB recipe to build rtems-net-legacy. Here's an example of
> building
> >> +rtems-net-legacy using RSB for powerpc beatnik BSP with rtems version
> 6:
> >
> >
> > I think we try to say CPU/BSP for powerpc/beatnik.
>
> Pushed with this change. Does it look good?
>
> https://git.rtems.org/rtems-docs/commit/?id=199cc8e5764881e3fd83966c842c25c055444b86
>
> >
> > Fix this and push it IMO.
> >
> >>
> >> +
> >> +  .. code-block:: shell
> >> +
> >> +../source-builder/sb-set-builder \
> >> +--prefix=/path/to/rtems/prefix \
> >> +6/rtems-net-legacy \
> >> +--host=powerpc-rtems6 \
> >> +--with-rtems-bsp=beatnik
> >> +
> >> +Manually building the rtems-net-legacy repo:
> >> +
> >> +  .. code-block:: shell
> >> +
> >> +git submodule init
> >> +git submodule update
> >> +./waf configure --prefix=/path/to/rtems/prefix
> >> +./waf
> >> +./waf install
> >> +
> >> +Please refer to README.waf in rtems-net-legacy repository for more
> details on
> >> +using waf with legacy networking.
> >> --
> >> 2.26.2
> >>
> >> ___
> >> 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 v4] psx13: Reworked and relicensed

2021-04-26 Thread Ryan Long
Changed the way the tests were structured, added rtems_test_assert()'s,
updated psx13.scn and the license.

Update #3899
---
 testsuites/psxtests/psx13/main.c|  37 +-
 testsuites/psxtests/psx13/psx13.scn |  21 +-
 testsuites/psxtests/psx13/test.c| 852 
 3 files changed, 328 insertions(+), 582 deletions(-)

diff --git a/testsuites/psxtests/psx13/main.c b/testsuites/psxtests/psx13/main.c
index 20788b3..f9e7907 100644
--- a/testsuites/psxtests/psx13/main.c
+++ b/testsuites/psxtests/psx13/main.c
@@ -1,14 +1,37 @@
-/*
- *  Simple test program -- simplified version of sample test hello.
+/*  SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ *  @file
  *
- *  COPYRIGHT (c) 1989-2009.
- *  On-Line Applications Research Corporation (OAR).
+ *  @brief Simple test program -- simplified version of sample test hello.
  *
- *  The license and distribution terms for this file may be
- *  found in the file LICENSE in this distribution or at
- *  http://www.rtems.org/license/LICENSE.
  */
 
+/*
+ *  COPYRIGHT (c) 1989-2009, 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
+ * 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.
+ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
diff --git a/testsuites/psxtests/psx13/psx13.scn 
b/testsuites/psxtests/psx13/psx13.scn
index 428a931..efa79c9 100644
--- a/testsuites/psxtests/psx13/psx13.scn
+++ b/testsuites/psxtests/psx13/psx13.scn
@@ -1,16 +1,7 @@
-*** POSIX TEST 13 ***
+*** BEGIN OF TEST PSX 13 ***
+*** TEST VERSION: 6.0.0.75f80242186af2dde0c5bc7272a119e3b78d7ba0
+*** TEST STATE: EXPECTED_PASS
+*** TEST BUILD: RTEMS_DEBUG RTEMS_POSIX_API
+*** TEST TOOLS: 10.2.1 20210309 (RTEMS 6, RSB 
5e449fb5c2cb6812a238f9f9764fd339cbbf05c2, Newlib d10d0d9)
 
-Files initialized successfully.
-Testing device_lseek()... Failed!!!
-Testing dup() Failed!!!
-Testing dup2()... Success.
-Testing fdatasync().. Success.
-Testing umask().. Success.
-Testing utime().. Success.
-Testing utimes().. Success.
-Testing fsync().. Success.
-Testing pathconf()... Success.
-Testing fpathconf().. Success.
-Testing sync().. 
-
-*** END OF TEST PSX13 ***
+*** END OF TEST PSX 13 ***
diff --git a/testsuites/psxtests/psx13/test.c b/testsuites/psxtests/psx13/test.c
index 79b24c2..a82242b 100644
--- a/testsuites/psxtests/psx13/test.c
+++ b/testsuites/psxtests/psx13/test.c
@@ -1,26 +1,49 @@
-/*
- *  Psx13
- *  Chris Bond (working under Jennifer's account)
+/*  SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ *  @file
  *
- *  This test exercises the following routines:
+ *  @brief This tests various file system functions.
  *
- * device_lseek - test implemented
- * dup  - test implemented
- * dup2 - test implemented
- * fdatasync- test implemented
- * fsync- test implemented
- * pathconf - test implemented
- * fpathconf- test implemented
- * umask- test implemented
- * utime- test implemented
- * utimes   - test implemented
+ *  This test exercises the following routines:
  *
- *  COPYRIGHT (c) 1989-2009.
+ * - lseek()
+ * - dup()
+ * - dup2()
+ * - fdatasync()
+ * - fsync()
+ * - pathconf()
+ * - fpathconf()
+ * - umask()
+ * - utime()
+ * - utimes()
+ * - sync()
+ */
+
+/*
+ *  COPYRIGHT (c) 1989-2009, 2021.
  *  On-Line Applications Research Corporation (OAR).
  *
- *  The license and distribution terms for this file may be
- *  found in the file LICENSE in this distribution or at
- *  http://www.rtems.org/license/LICENSE.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are 

RE: [PATCH v3] psx13: Reworked and relicensed

2021-04-26 Thread Ryan Long
Didn't realize I screwed up my rebase. I thought the "Update #3899" had been 
added. Sending again.

-Original Message-
From: Ryan Long  
Sent: Monday, April 26, 2021 10:00 AM
To: devel@rtems.org
Cc: Ryan Long 
Subject: [PATCH v3] psx13: Reworked and relicensed

Changed the way the tests were structured, added rtems_test_assert()'s, updated 
psx13.scn and the license.
---
 testsuites/psxtests/psx13/main.c|  37 +-
 testsuites/psxtests/psx13/psx13.scn |  21 +-
 testsuites/psxtests/psx13/test.c| 852 
 3 files changed, 328 insertions(+), 582 deletions(-)

diff --git a/testsuites/psxtests/psx13/main.c b/testsuites/psxtests/psx13/main.c
index 20788b3..f9e7907 100644
--- a/testsuites/psxtests/psx13/main.c
+++ b/testsuites/psxtests/psx13/main.c
@@ -1,14 +1,37 @@
-/*
- *  Simple test program -- simplified version of sample test hello.
+/*  SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ *  @file
  *
- *  COPYRIGHT (c) 1989-2009.
- *  On-Line Applications Research Corporation (OAR).
+ *  @brief Simple test program -- simplified version of sample test hello.
  *
- *  The license and distribution terms for this file may be
- *  found in the file LICENSE in this distribution or at
- *  http://www.rtems.org/license/LICENSE.
  */
 
+/*
+ *  COPYRIGHT (c) 1989-2009, 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
+ * 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.
+ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
diff --git a/testsuites/psxtests/psx13/psx13.scn 
b/testsuites/psxtests/psx13/psx13.scn
index 428a931..efa79c9 100644
--- a/testsuites/psxtests/psx13/psx13.scn
+++ b/testsuites/psxtests/psx13/psx13.scn
@@ -1,16 +1,7 @@
-*** POSIX TEST 13 ***
+*** BEGIN OF TEST PSX 13 ***
+*** TEST VERSION: 6.0.0.75f80242186af2dde0c5bc7272a119e3b78d7ba0
+*** TEST STATE: EXPECTED_PASS
+*** TEST BUILD: RTEMS_DEBUG RTEMS_POSIX_API
+*** TEST TOOLS: 10.2.1 20210309 (RTEMS 6, RSB 
+5e449fb5c2cb6812a238f9f9764fd339cbbf05c2, Newlib d10d0d9)
 
-Files initialized successfully.
-Testing device_lseek()... Failed!!!
-Testing dup() Failed!!!
-Testing dup2()... Success.
-Testing fdatasync().. Success.
-Testing umask().. Success.
-Testing utime().. Success.
-Testing utimes().. Success.
-Testing fsync().. Success.
-Testing pathconf()... Success.
-Testing fpathconf().. Success.
-Testing sync().. 
-
-*** END OF TEST PSX13 ***
+*** END OF TEST PSX 13 ***
diff --git a/testsuites/psxtests/psx13/test.c b/testsuites/psxtests/psx13/test.c
index 79b24c2..a82242b 100644
--- a/testsuites/psxtests/psx13/test.c
+++ b/testsuites/psxtests/psx13/test.c
@@ -1,26 +1,49 @@
-/*
- *  Psx13
- *  Chris Bond (working under Jennifer's account)
+/*  SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ *  @file
  *
- *  This test exercises the following routines:
+ *  @brief This tests various file system functions.
  *
- * device_lseek - test implemented
- * dup  - test implemented
- * dup2 - test implemented
- * fdatasync- test implemented
- * fsync- test implemented
- * pathconf - test implemented
- * fpathconf- test implemented
- * umask- test implemented
- * utime- test implemented
- * utimes   - test implemented
+ *  This test exercises the following routines:
  *
- *  COPYRIGHT (c) 1989-2009.
+ * - lseek()
+ * - dup()
+ * - dup2()
+ * - fdatasync()
+ * - fsync()
+ * - pathconf()
+ * - fpathconf()
+ * - umask()
+ * - utime()
+ * - utimes()
+ * - sync()
+ */
+
+/*
+ *  COPYRIGHT (c) 1989-2009, 2021.
  *  On-Line Applications Research Corpo

[PATCH v3] psx13: Reworked and relicensed

2021-04-26 Thread Ryan Long
Changed the way the tests were structured, added rtems_test_assert()'s,
updated psx13.scn and the license.
---
 testsuites/psxtests/psx13/main.c|  37 +-
 testsuites/psxtests/psx13/psx13.scn |  21 +-
 testsuites/psxtests/psx13/test.c| 852 
 3 files changed, 328 insertions(+), 582 deletions(-)

diff --git a/testsuites/psxtests/psx13/main.c b/testsuites/psxtests/psx13/main.c
index 20788b3..f9e7907 100644
--- a/testsuites/psxtests/psx13/main.c
+++ b/testsuites/psxtests/psx13/main.c
@@ -1,14 +1,37 @@
-/*
- *  Simple test program -- simplified version of sample test hello.
+/*  SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ *  @file
  *
- *  COPYRIGHT (c) 1989-2009.
- *  On-Line Applications Research Corporation (OAR).
+ *  @brief Simple test program -- simplified version of sample test hello.
  *
- *  The license and distribution terms for this file may be
- *  found in the file LICENSE in this distribution or at
- *  http://www.rtems.org/license/LICENSE.
  */
 
+/*
+ *  COPYRIGHT (c) 1989-2009, 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
+ * 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.
+ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
diff --git a/testsuites/psxtests/psx13/psx13.scn 
b/testsuites/psxtests/psx13/psx13.scn
index 428a931..efa79c9 100644
--- a/testsuites/psxtests/psx13/psx13.scn
+++ b/testsuites/psxtests/psx13/psx13.scn
@@ -1,16 +1,7 @@
-*** POSIX TEST 13 ***
+*** BEGIN OF TEST PSX 13 ***
+*** TEST VERSION: 6.0.0.75f80242186af2dde0c5bc7272a119e3b78d7ba0
+*** TEST STATE: EXPECTED_PASS
+*** TEST BUILD: RTEMS_DEBUG RTEMS_POSIX_API
+*** TEST TOOLS: 10.2.1 20210309 (RTEMS 6, RSB 
5e449fb5c2cb6812a238f9f9764fd339cbbf05c2, Newlib d10d0d9)
 
-Files initialized successfully.
-Testing device_lseek()... Failed!!!
-Testing dup() Failed!!!
-Testing dup2()... Success.
-Testing fdatasync().. Success.
-Testing umask().. Success.
-Testing utime().. Success.
-Testing utimes().. Success.
-Testing fsync().. Success.
-Testing pathconf()... Success.
-Testing fpathconf().. Success.
-Testing sync().. 
-
-*** END OF TEST PSX13 ***
+*** END OF TEST PSX 13 ***
diff --git a/testsuites/psxtests/psx13/test.c b/testsuites/psxtests/psx13/test.c
index 79b24c2..a82242b 100644
--- a/testsuites/psxtests/psx13/test.c
+++ b/testsuites/psxtests/psx13/test.c
@@ -1,26 +1,49 @@
-/*
- *  Psx13
- *  Chris Bond (working under Jennifer's account)
+/*  SPDX-License-Identifier: BSD-2-Clause */
+
+/**
+ *  @file
  *
- *  This test exercises the following routines:
+ *  @brief This tests various file system functions.
  *
- * device_lseek - test implemented
- * dup  - test implemented
- * dup2 - test implemented
- * fdatasync- test implemented
- * fsync- test implemented
- * pathconf - test implemented
- * fpathconf- test implemented
- * umask- test implemented
- * utime- test implemented
- * utimes   - test implemented
+ *  This test exercises the following routines:
  *
- *  COPYRIGHT (c) 1989-2009.
+ * - lseek()
+ * - dup()
+ * - dup2()
+ * - fdatasync()
+ * - fsync()
+ * - pathconf()
+ * - fpathconf()
+ * - umask()
+ * - utime()
+ * - utimes()
+ * - sync()
+ */
+
+/*
+ *  COPYRIGHT (c) 1989-2009, 2021.
  *  On-Line Applications Research Corporation (OAR).
  *
- *  The license and distribution terms for this file may be
- *  found in the file LICENSE in this distribution or at
- *  http://www.rtems.org/license/LICENSE.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted prov

Re: [PATCH rtems-docs v2] legacy-networking: Add note with build instructions for rtems-net-legacy

2021-04-26 Thread Vijay Kumar Banerjee
On Mon, Apr 26, 2021 at 8:23 AM Joel Sherrill  wrote:
>
>
>
> On Thu, Apr 22, 2021 at 8:58 PM Vijay Kumar Banerjee  wrote:
>>
>> ---
>>  legacy-networking/index.rst   |  1 +
>>  legacy-networking/quick_start.rst | 33 +++
>>  2 files changed, 34 insertions(+)
>>  create mode 100644 legacy-networking/quick_start.rst
>>
>> diff --git a/legacy-networking/index.rst b/legacy-networking/index.rst
>> index b85119d..acbfd35 100644
>> --- a/legacy-networking/index.rst
>> +++ b/legacy-networking/index.rst
>> @@ -22,6 +22,7 @@ RTEMS Legacy Network User Manual (|version|).
>> :numbered:
>>
>> preface
>> +   quick_start
>> network_task_structure
>> networking_driver
>> using_networking_rtems_app
>> diff --git a/legacy-networking/quick_start.rst 
>> b/legacy-networking/quick_start.rst
>> new file mode 100644
>> index 000..fc2fee5
>> --- /dev/null
>> +++ b/legacy-networking/quick_start.rst
>> @@ -0,0 +1,33 @@
>> +.. SPDX-License-Identifier: CC-BY-SA-4.0
>> +
>> +Quick Start
>> +###
>> +
>> +This legacy networking is now a standalone repository and needs to be built
>> +separately.
>> +
>> +The repository can be found here: https://git.rtems.org/rtems-net-legacy/
>> +
>> +There's an RSB recipe to build rtems-net-legacy. Here's an example of 
>> building
>> +rtems-net-legacy using RSB for powerpc beatnik BSP with rtems version 6:
>
>
> I think we try to say CPU/BSP for powerpc/beatnik.

Pushed with this change. Does it look good?
https://git.rtems.org/rtems-docs/commit/?id=199cc8e5764881e3fd83966c842c25c055444b86

>
> Fix this and push it IMO.
>
>>
>> +
>> +  .. code-block:: shell
>> +
>> +../source-builder/sb-set-builder \
>> +--prefix=/path/to/rtems/prefix \
>> +6/rtems-net-legacy \
>> +--host=powerpc-rtems6 \
>> +--with-rtems-bsp=beatnik
>> +
>> +Manually building the rtems-net-legacy repo:
>> +
>> +  .. code-block:: shell
>> +
>> +git submodule init
>> +git submodule update
>> +./waf configure --prefix=/path/to/rtems/prefix
>> +./waf
>> +./waf install
>> +
>> +Please refer to README.waf in rtems-net-legacy repository for more details 
>> on
>> +using waf with legacy networking.
>> --
>> 2.26.2
>>
>> ___
>> 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 rtems-docs v2] legacy-networking: Add note with build instructions for rtems-net-legacy

2021-04-26 Thread Joel Sherrill
On Thu, Apr 22, 2021 at 8:58 PM Vijay Kumar Banerjee 
wrote:

> ---
>  legacy-networking/index.rst   |  1 +
>  legacy-networking/quick_start.rst | 33 +++
>  2 files changed, 34 insertions(+)
>  create mode 100644 legacy-networking/quick_start.rst
>
> diff --git a/legacy-networking/index.rst b/legacy-networking/index.rst
> index b85119d..acbfd35 100644
> --- a/legacy-networking/index.rst
> +++ b/legacy-networking/index.rst
> @@ -22,6 +22,7 @@ RTEMS Legacy Network User Manual (|version|).
> :numbered:
>
> preface
> +   quick_start
> network_task_structure
> networking_driver
> using_networking_rtems_app
> diff --git a/legacy-networking/quick_start.rst
> b/legacy-networking/quick_start.rst
> new file mode 100644
> index 000..fc2fee5
> --- /dev/null
> +++ b/legacy-networking/quick_start.rst
> @@ -0,0 +1,33 @@
> +.. SPDX-License-Identifier: CC-BY-SA-4.0
> +
> +Quick Start
> +###
> +
> +This legacy networking is now a standalone repository and needs to be
> built
> +separately.
> +
> +The repository can be found here: https://git.rtems.org/rtems-net-legacy/
> +
> +There's an RSB recipe to build rtems-net-legacy. Here's an example of
> building
> +rtems-net-legacy using RSB for powerpc beatnik BSP with rtems version 6:
>

I think we try to say CPU/BSP for powerpc/beatnik.

Fix this and push it IMO.


> +
> +  .. code-block:: shell
> +
> +../source-builder/sb-set-builder \
> +--prefix=/path/to/rtems/prefix \
> +6/rtems-net-legacy \
> +--host=powerpc-rtems6 \
> +--with-rtems-bsp=beatnik
> +
> +Manually building the rtems-net-legacy repo:
> +
> +  .. code-block:: shell
> +
> +git submodule init
> +git submodule update
> +./waf configure --prefix=/path/to/rtems/prefix
> +./waf
> +./waf install
> +
> +Please refer to README.waf in rtems-net-legacy repository for more
> details on
> +using waf with legacy networking.
> --
> 2.26.2
>
> ___
> 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 rtems] Makefile.am: Remove legacy networking files

2021-04-26 Thread Vijay Kumar Banerjee
On Mon, Apr 26, 2021 at 7:40 AM Joel Sherrill  wrote:
>
> This has lingered too long. Please feel free to push it.
>
Pushed. Thanks.

> On Sat, Apr 24, 2021 at 11:27 PM Vijay Kumar Banerjee  wrote:
>>
>> ---
>>  bsps/headers.am   |   8 -
>>  bsps/shared/grlib-sources.am  |   4 -
>>  bsps/shared/shared-sources.am |  14 --
>>  c/src/lib/libbsp/arm/atsam/Makefile.am|   5 -
>>  c/src/lib/libbsp/arm/csb336/Makefile.am   |   5 -
>>  c/src/lib/libbsp/arm/csb337/Makefile.am   |   4 -
>>  c/src/lib/libbsp/arm/edb7312/Makefile.am  |   4 -
>>  c/src/lib/libbsp/arm/gumstix/Makefile.am  |   3 -
>>  c/src/lib/libbsp/arm/lpc24xx/Makefile.am  |   8 -
>>  c/src/lib/libbsp/arm/lpc32xx/Makefile.am  |   7 -
>>  c/src/lib/libbsp/arm/rtl22xx/Makefile.am  |   4 -
>>  c/src/lib/libbsp/bfin/bf537Stamp/Makefile.am  |   5 -
>>  c/src/lib/libbsp/i386/pc386/Makefile.am   |   7 -
>>  c/src/lib/libbsp/lm32/lm32_evr/Makefile.am|   4 -
>>  c/src/lib/libbsp/lm32/milkymist/Makefile.am   |   4 -
>>  c/src/lib/libbsp/m68k/av5282/Makefile.am  |   4 -
>>  c/src/lib/libbsp/m68k/gen68360/Makefile.am|   4 -
>>  c/src/lib/libbsp/m68k/genmcf548x/Makefile.am  |   4 -
>>  c/src/lib/libbsp/m68k/mcf5235/Makefile.am |   4 -
>>  c/src/lib/libbsp/m68k/mcf5329/Makefile.am |   4 -
>>  c/src/lib/libbsp/m68k/mvme162/Makefile.am |   4 -
>>  c/src/lib/libbsp/m68k/mvme167/Makefile.am |   4 -
>>  c/src/lib/libbsp/m68k/uC5282/Makefile.am  |   4 -
>>  c/src/lib/libbsp/mips/csb350/Makefile.am  |   4 -
>>  c/src/lib/libbsp/powerpc/beatnik/Makefile.am  |  16 +-
>>  c/src/lib/libbsp/powerpc/gen5200/Makefile.am  |   4 -
>>  c/src/lib/libbsp/powerpc/gen83xx/Makefile.am  |   6 -
>>  .../lib/libbsp/powerpc/haleakala/Makefile.am  |   4 -
>>  .../powerpc/motorola_powerpc/Makefile.am  |   6 -
>>  .../lib/libbsp/powerpc/mpc55xxevb/Makefile.am |   6 -
>>  .../lib/libbsp/powerpc/mpc8260ads/Makefile.am |   5 -
>>  c/src/lib/libbsp/powerpc/mvme3100/Makefile.am |   4 -
>>  c/src/lib/libbsp/powerpc/mvme5500/Makefile.am |   6 -
>>  c/src/lib/libbsp/powerpc/psim/Makefile.am |   4 -
>>  c/src/lib/libbsp/powerpc/qoriq/Makefile.am|   6 -
>>  c/src/lib/libbsp/powerpc/tqm8xx/Makefile.am   |   5 -
>>  c/src/lib/libbsp/powerpc/virtex/Makefile.am   |   9 -
>>  c/src/lib/libbsp/riscv/griscv/Makefile.am |   6 -
>>  c/src/lib/libbsp/sparc/erc32/Makefile.am  |   4 -
>>  c/src/lib/libbsp/sparc/leon2/Makefile.am  |   5 -
>>  c/src/lib/libbsp/sparc/leon3/Makefile.am  |   8 -
>>  c/src/make/Makefile.am|   2 -
>>  cpukit/Makefile.am| 175 +-
>>  cpukit/headers.am |   1 -
>>  testsuites/libtests/Makefile.am   |  69 ---
>>  testsuites/samples/Makefile.am|  23 ---
>>  46 files changed, 6 insertions(+), 490 deletions(-)
>>
>> diff --git a/bsps/headers.am b/bsps/headers.am
>> index ee82952635..b89e5c2b28 100644
>> --- a/bsps/headers.am
>> +++ b/bsps/headers.am
>> @@ -116,32 +116,24 @@ include_libchip_HEADERS =
>>  include_libchip_HEADERS += ../../bsps/include/libchip/am29lv160.h
>>  include_libchip_HEADERS += ../../bsps/include/libchip/ata.h
>>  include_libchip_HEADERS += ../../bsps/include/libchip/ata_internal.h
>> -include_libchip_HEADERS += ../../bsps/include/libchip/cs8900.h
>>  include_libchip_HEADERS += ../../bsps/include/libchip/disp_hcms29xx.h
>>  include_libchip_HEADERS += ../../bsps/include/libchip/ds1375-rtc.h
>>  include_libchip_HEADERS += ../../bsps/include/libchip/greth.h
>>  include_libchip_HEADERS += ../../bsps/include/libchip/i2c-2b-eeprom.h
>>  include_libchip_HEADERS += ../../bsps/include/libchip/i2c-ds1621.h
>>  include_libchip_HEADERS += ../../bsps/include/libchip/i2c-sc620.h
>> -include_libchip_HEADERS += ../../bsps/include/libchip/i82586var.h
>>  include_libchip_HEADERS += ../../bsps/include/libchip/icm7170.h
>>  include_libchip_HEADERS += ../../bsps/include/libchip/ide_ctrl.h
>>  include_libchip_HEADERS += ../../bsps/include/libchip/ide_ctrl_cfg.h
>>  include_libchip_HEADERS += ../../bsps/include/libchip/ide_ctrl_io.h
>> -include_libchip_HEADERS += ../../bsps/include/libchip/if_dcreg.h
>> -include_libchip_HEADERS += ../../bsps/include/libchip/if_fxpvar.h
>>  include_libchip_HEADERS += ../../bsps/include/libchip/m48t08.h
>>  include_libchip_HEADERS += ../../bsps/include/libchip/mc146818a.h
>>  include_libchip_HEADERS += ../../bsps/include/libchip/mc68681.h
>>  include_libchip_HEADERS += ../../bsps/include/libchip/ns16550.h
>>  include_libchip_HEADERS += ../../bsps/include/libchip/ns16550_p.h
>> -include_libchip_HEADERS += ../../bsps/include/libchip/open_eth.h
>>  include_libchip_HEADERS += ../../bsps/include/libchip/rtc.h
>>  include_libchip_HEADERS += ../../bsps/include/libchip/serial.h
>>  include_libchip_HEADERS += ../../bsps/include/libchip/sersupp.h
>> -include_libchip_HEADERS += ../../bsps/inc

Re: [PATCH rtems] Makefile.am: Remove legacy networking files

2021-04-26 Thread Joel Sherrill
This has lingered too long. Please feel free to push it.

On Sat, Apr 24, 2021 at 11:27 PM Vijay Kumar Banerjee 
wrote:

> ---
>  bsps/headers.am   |   8 -
>  bsps/shared/grlib-sources.am  |   4 -
>  bsps/shared/shared-sources.am |  14 --
>  c/src/lib/libbsp/arm/atsam/Makefile.am|   5 -
>  c/src/lib/libbsp/arm/csb336/Makefile.am   |   5 -
>  c/src/lib/libbsp/arm/csb337/Makefile.am   |   4 -
>  c/src/lib/libbsp/arm/edb7312/Makefile.am  |   4 -
>  c/src/lib/libbsp/arm/gumstix/Makefile.am  |   3 -
>  c/src/lib/libbsp/arm/lpc24xx/Makefile.am  |   8 -
>  c/src/lib/libbsp/arm/lpc32xx/Makefile.am  |   7 -
>  c/src/lib/libbsp/arm/rtl22xx/Makefile.am  |   4 -
>  c/src/lib/libbsp/bfin/bf537Stamp/Makefile.am  |   5 -
>  c/src/lib/libbsp/i386/pc386/Makefile.am   |   7 -
>  c/src/lib/libbsp/lm32/lm32_evr/Makefile.am|   4 -
>  c/src/lib/libbsp/lm32/milkymist/Makefile.am   |   4 -
>  c/src/lib/libbsp/m68k/av5282/Makefile.am  |   4 -
>  c/src/lib/libbsp/m68k/gen68360/Makefile.am|   4 -
>  c/src/lib/libbsp/m68k/genmcf548x/Makefile.am  |   4 -
>  c/src/lib/libbsp/m68k/mcf5235/Makefile.am |   4 -
>  c/src/lib/libbsp/m68k/mcf5329/Makefile.am |   4 -
>  c/src/lib/libbsp/m68k/mvme162/Makefile.am |   4 -
>  c/src/lib/libbsp/m68k/mvme167/Makefile.am |   4 -
>  c/src/lib/libbsp/m68k/uC5282/Makefile.am  |   4 -
>  c/src/lib/libbsp/mips/csb350/Makefile.am  |   4 -
>  c/src/lib/libbsp/powerpc/beatnik/Makefile.am  |  16 +-
>  c/src/lib/libbsp/powerpc/gen5200/Makefile.am  |   4 -
>  c/src/lib/libbsp/powerpc/gen83xx/Makefile.am  |   6 -
>  .../lib/libbsp/powerpc/haleakala/Makefile.am  |   4 -
>  .../powerpc/motorola_powerpc/Makefile.am  |   6 -
>  .../lib/libbsp/powerpc/mpc55xxevb/Makefile.am |   6 -
>  .../lib/libbsp/powerpc/mpc8260ads/Makefile.am |   5 -
>  c/src/lib/libbsp/powerpc/mvme3100/Makefile.am |   4 -
>  c/src/lib/libbsp/powerpc/mvme5500/Makefile.am |   6 -
>  c/src/lib/libbsp/powerpc/psim/Makefile.am |   4 -
>  c/src/lib/libbsp/powerpc/qoriq/Makefile.am|   6 -
>  c/src/lib/libbsp/powerpc/tqm8xx/Makefile.am   |   5 -
>  c/src/lib/libbsp/powerpc/virtex/Makefile.am   |   9 -
>  c/src/lib/libbsp/riscv/griscv/Makefile.am |   6 -
>  c/src/lib/libbsp/sparc/erc32/Makefile.am  |   4 -
>  c/src/lib/libbsp/sparc/leon2/Makefile.am  |   5 -
>  c/src/lib/libbsp/sparc/leon3/Makefile.am  |   8 -
>  c/src/make/Makefile.am|   2 -
>  cpukit/Makefile.am| 175 +-
>  cpukit/headers.am |   1 -
>  testsuites/libtests/Makefile.am   |  69 ---
>  testsuites/samples/Makefile.am|  23 ---
>  46 files changed, 6 insertions(+), 490 deletions(-)
>
> diff --git a/bsps/headers.am b/bsps/headers.am
> index ee82952635..b89e5c2b28 100644
> --- a/bsps/headers.am
> +++ b/bsps/headers.am
> @@ -116,32 +116,24 @@ include_libchip_HEADERS =
>  include_libchip_HEADERS += ../../bsps/include/libchip/am29lv160.h
>  include_libchip_HEADERS += ../../bsps/include/libchip/ata.h
>  include_libchip_HEADERS += ../../bsps/include/libchip/ata_internal.h
> -include_libchip_HEADERS += ../../bsps/include/libchip/cs8900.h
>  include_libchip_HEADERS += ../../bsps/include/libchip/disp_hcms29xx.h
>  include_libchip_HEADERS += ../../bsps/include/libchip/ds1375-rtc.h
>  include_libchip_HEADERS += ../../bsps/include/libchip/greth.h
>  include_libchip_HEADERS += ../../bsps/include/libchip/i2c-2b-eeprom.h
>  include_libchip_HEADERS += ../../bsps/include/libchip/i2c-ds1621.h
>  include_libchip_HEADERS += ../../bsps/include/libchip/i2c-sc620.h
> -include_libchip_HEADERS += ../../bsps/include/libchip/i82586var.h
>  include_libchip_HEADERS += ../../bsps/include/libchip/icm7170.h
>  include_libchip_HEADERS += ../../bsps/include/libchip/ide_ctrl.h
>  include_libchip_HEADERS += ../../bsps/include/libchip/ide_ctrl_cfg.h
>  include_libchip_HEADERS += ../../bsps/include/libchip/ide_ctrl_io.h
> -include_libchip_HEADERS += ../../bsps/include/libchip/if_dcreg.h
> -include_libchip_HEADERS += ../../bsps/include/libchip/if_fxpvar.h
>  include_libchip_HEADERS += ../../bsps/include/libchip/m48t08.h
>  include_libchip_HEADERS += ../../bsps/include/libchip/mc146818a.h
>  include_libchip_HEADERS += ../../bsps/include/libchip/mc68681.h
>  include_libchip_HEADERS += ../../bsps/include/libchip/ns16550.h
>  include_libchip_HEADERS += ../../bsps/include/libchip/ns16550_p.h
> -include_libchip_HEADERS += ../../bsps/include/libchip/open_eth.h
>  include_libchip_HEADERS += ../../bsps/include/libchip/rtc.h
>  include_libchip_HEADERS += ../../bsps/include/libchip/serial.h
>  include_libchip_HEADERS += ../../bsps/include/libchip/sersupp.h
> -include_libchip_HEADERS += ../../bsps/include/libchip/smc9.h
> -include_libchip_HEADERS += ../../bsps/include/libchip/smc9exp.h
> -include_libchip_HEADERS += ../../bsps/include/libchip/sonic.h
>

Re: rtems-bootstrap failed on master

2021-04-26 Thread Sebastian Huber

On 26/04/2021 14:30, Joel Sherrill wrote:




On Mon, Apr 26, 2021 at 7:10 AM Sebastian Huber 
> wrote:


Hello,

since the old build system no longer works, I suggest to remove it
now:

https://git.rtems.org/sebh/rtems.git/commit/?h=remove-old-build-system



Nice move but no. Still have waf blockers on the kernel RSB recipe
Nobody updated the kernel RSB recipes in the last eight months, so why 
this this a blocker?

and rtems-bsp-builder.

https://devel.rtems.org/ticket/4145 
https://devel.rtems.org/ticket/4124 
We should focus on adding pre-commit checks in CI pipelines instead of 
doing post-commit builds.
Vijay made a minor mistake removing the legacy stack and I am sure he 
will fix it.
Keeping this build system zombie alive just burns time which could be 
spent elsewhere.


--
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: rtems-bootstrap failed on master

2021-04-26 Thread Joel Sherrill
On Mon, Apr 26, 2021 at 7:10 AM Sebastian Huber <
sebastian.hu...@embedded-brains.de> wrote:

> Hello,
>
> since the old build system no longer works, I suggest to remove it now:
>
> https://git.rtems.org/sebh/rtems.git/commit/?h=remove-old-build-system


Nice move but no. Still have waf blockers on the kernel RSB recipe and
rtems-bsp-builder.

https://devel.rtems.org/ticket/4145
https://devel.rtems.org/ticket/4124

Vijay made a minor mistake removing the legacy stack and I am sure he will
fix it.

--joel


--joel

>
>
>  Forwarded Message 
> Subject:rtems-bootstrap failed on master
> Date:   Mon, 26 Apr 2021 13:49:26 +0200
> From:   Pierre FICHEUX 
> To: rtems-us...@rtems.org 
>
>
>
> Hi,
>
> When using rtems-bootstrap on master branch of rtems, I got "automake:
> error: cannot open < libnetworking/headers.am : No
> such file or directory"
> autoreconf: automake failed with exit status: 1
>   13/119: autoreconf: testsuites/samples/configure.ac  >
>   14/119: autoreconf: testsuites/smptests/configure.ac <
> http://configure.ac>
>   15/119: autoreconf: testsuites/rhealstone/configure.ac
> 
>   16/119: autoreconf: c/configure.ac 
> error: error: autoreconf: autoreconf -i --no-recursive
> Bootstrap FAILED
>
> I use automake/autoconf from RTEMS (not from Ubuntu). Any idea?
>
> thx
> --
>
> Pierre FICHEUX -/- CTO Smile ECS, France -\-pierre.fich...@smile.fr
> 
>   http://www.smile.fr  
>   https://smile.eu/fr/offres/embarque-iot  <
> https://smile.eu/fr/offres/embarque-iot>
> I would love to change the world, but they won't give me the source code
>
> ___
> 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

Fwd: rtems-bootstrap failed on master

2021-04-26 Thread Sebastian Huber

Hello,

since the old build system no longer works, I suggest to remove it now:

https://git.rtems.org/sebh/rtems.git/commit/?h=remove-old-build-system

 Forwarded Message 
Subject:rtems-bootstrap failed on master
Date:   Mon, 26 Apr 2021 13:49:26 +0200
From:   Pierre FICHEUX 
To: rtems-us...@rtems.org 



Hi,

When using rtems-bootstrap on master branch of rtems, I got "automake: 
error: cannot open < libnetworking/headers.am : No 
such file or directory"

autoreconf: automake failed with exit status: 1
 13/119: autoreconf: testsuites/samples/configure.ac 
 14/119: autoreconf: testsuites/smptests/configure.ac 
 15/119: autoreconf: testsuites/rhealstone/configure.ac 


 16/119: autoreconf: c/configure.ac 
error: error: autoreconf: autoreconf -i --no-recursive
Bootstrap FAILED

I use automake/autoconf from RTEMS (not from Ubuntu). Any idea?

thx
--

Pierre FICHEUX -/- CTO Smile ECS, France -\-pierre.fich...@smile.fr  

 http://www.smile.fr  
 https://smile.eu/fr/offres/embarque-iot  

I would love to change the world, but they won't give me the source code

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

[PATCH] rtems: Change rtems_task_get_affinity() status

2021-04-26 Thread Sebastian Huber
Return RTEMS_INVALID_SIZE if the processor set is too small to contain
the processor affinity set of the task.
---
 cpukit/include/rtems/score/schedulerimpl.h | 2 +-
 cpukit/include/rtems/score/status.h| 2 ++
 cpukit/score/src/schedulergetaffinity.c| 2 +-
 testsuites/smptests/smpaffinity01/init.c   | 2 +-
 testsuites/sptests/spscheduler01/init.c| 2 +-
 5 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/cpukit/include/rtems/score/schedulerimpl.h 
b/cpukit/include/rtems/score/schedulerimpl.h
index 397789372c..65c600b583 100644
--- a/cpukit/include/rtems/score/schedulerimpl.h
+++ b/cpukit/include/rtems/score/schedulerimpl.h
@@ -695,7 +695,7 @@ RTEMS_INLINE_ROUTINE const Processor_mask 
*_Scheduler_Get_processors(
  *
  * @retval STATUS_SUCCESSFUL The operation succeeded.
  *
- * @retval STATUS_INVALID_NUMBER The processor set was too small.
+ * @retval STATUS_INVALID_SIZE The processor set was too small.
  */
 Status_Control _Scheduler_Get_affinity(
   Thread_Control *the_thread,
diff --git a/cpukit/include/rtems/score/status.h 
b/cpukit/include/rtems/score/status.h
index ba3910d40d..236ae52d7b 100644
--- a/cpukit/include/rtems/score/status.h
+++ b/cpukit/include/rtems/score/status.h
@@ -118,6 +118,8 @@ typedef enum {
 STATUS_BUILD( STATUS_CLASSIC_INVALID_NUMBER, EINVAL ),
   STATUS_INVALID_PRIORITY =
 STATUS_BUILD( STATUS_CLASSIC_INVALID_PRIORITY, EINVAL ),
+  STATUS_INVALID_SIZE =
+STATUS_BUILD( STATUS_CLASSIC_INVALID_SIZE, EINVAL ),
   STATUS_MAXIMUM_COUNT_EXCEEDED =
 STATUS_BUILD( STATUS_CLASSIC_UNSATISFIED, EOVERFLOW ),
   STATUS_MESSAGE_INVALID_SIZE =
diff --git a/cpukit/score/src/schedulergetaffinity.c 
b/cpukit/score/src/schedulergetaffinity.c
index 99dc53609d..867b25e0ea 100644
--- a/cpukit/score/src/schedulergetaffinity.c
+++ b/cpukit/score/src/schedulergetaffinity.c
@@ -51,7 +51,7 @@ Status_Control _Scheduler_Get_affinity(
   _Scheduler_Release_critical( scheduler, &lock_context );
 
   if ( status == PROCESSOR_MASK_COPY_LOSSLESS ) {
-return STATUS_INVALID_NUMBER;
+return STATUS_INVALID_SIZE;
   }
 
   return STATUS_SUCCESSFUL;
diff --git a/testsuites/smptests/smpaffinity01/init.c 
b/testsuites/smptests/smpaffinity01/init.c
index 5d79259e9f..9ec687d816 100644
--- a/testsuites/smptests/smpaffinity01/init.c
+++ b/testsuites/smptests/smpaffinity01/init.c
@@ -85,7 +85,7 @@ void Validate_getaffinity_errors(void)
 "Init - rtems_task_get_affinity - Invalid cpusetsize - 
RTEMS_INVALID_NUMBER"
   );
   sc = rtems_task_get_affinity( Init_id,  1, &cpuset );
-  rtems_test_assert( sc == RTEMS_INVALID_NUMBER );
+  rtems_test_assert( sc == RTEMS_INVALID_SIZE );
 
   /* Verify rtems_task_get_affinity validates cpuset */
   puts("Init - rtems_task_get_affinity - Invalid cpuset - 
RTEMS_INVALID_ADDRESS");
diff --git a/testsuites/sptests/spscheduler01/init.c 
b/testsuites/sptests/spscheduler01/init.c
index 5ed17057d3..69fcea6c57 100644
--- a/testsuites/sptests/spscheduler01/init.c
+++ b/testsuites/sptests/spscheduler01/init.c
@@ -139,7 +139,7 @@ static void test_task_get_set_affinity(void)
   rtems_test_assert(sc == RTEMS_INVALID_ADDRESS);
 
   sc = task_get_affinity(RTEMS_SELF, 0, &cpuset);
-  rtems_test_assert(sc == RTEMS_INVALID_NUMBER);
+  rtems_test_assert(sc == RTEMS_INVALID_SIZE);
 
   sc = task_set_affinity(RTEMS_SELF, 0, &cpuset);
   rtems_test_assert(sc == RTEMS_INVALID_NUMBER);
-- 
2.26.2

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


[PATCH] Return status code for _Scheduler_Set_affinity()

2021-04-26 Thread Sebastian Huber
This avoids having conditional statements to get the API-specific status
code.
---
 cpukit/include/rtems/score/scheduler.h| 12 ++---
 cpukit/include/rtems/score/scheduleredfsmp.h  |  9 ---
 cpukit/include/rtems/score/schedulerimpl.h| 27 ---
 .../score/schedulerpriorityaffinitysmp.h  |  6 ++---
 cpukit/posix/src/pthreadcreate.c  |  4 +--
 cpukit/posix/src/pthreadsetaffinitynp.c   |  7 ++---
 cpukit/rtems/src/tasksetaffinity.c|  7 ++---
 .../score/src/schedulerdefaultsetaffinity.c   |  2 +-
 cpukit/score/src/scheduleredfsmp.c|  6 ++---
 .../score/src/schedulerpriorityaffinitysmp.c  |  8 +++---
 cpukit/score/src/schedulersetaffinity.c   | 20 +++---
 11 files changed, 63 insertions(+), 45 deletions(-)

diff --git a/cpukit/include/rtems/score/scheduler.h 
b/cpukit/include/rtems/score/scheduler.h
index 7a566cf44d..da1e030ab8 100644
--- a/cpukit/include/rtems/score/scheduler.h
+++ b/cpukit/include/rtems/score/scheduler.h
@@ -21,6 +21,7 @@
 #define _RTEMS_SCORE_SCHEDULER_H
 
 #include 
+#include 
 
 #ifdef __cplusplus
 extern "C" {
@@ -228,7 +229,7 @@ typedef struct {
 
 #if defined(RTEMS_SMP)
   /** @see _Scheduler_Set_affinity() */
-  bool ( *set_affinity )(
+  Status_Control ( *set_affinity )(
 const Scheduler_Control *,
 Thread_Control *,
 Scheduler_Node *,
@@ -581,10 +582,13 @@ void _Scheduler_default_Start_idle(
* @param node This parameter is unused.
* @param affinity The new processor affinity set for the thread.
*
-   * @retval true The processor set of the scheduler is a subset of the 
affinity set.
-   * @retval false The processor set of the scheduler is not a subset of the 
affinity set.
+* @retval STATUS_SUCCESSFUL The affinity is a subset of the online
+*   processors.
+*
+* @retval STATUS_INVALID_NUMBER The affinity is not a subset of the online
+*   processors.
*/
-  bool _Scheduler_default_Set_affinity(
+  Status_Control _Scheduler_default_Set_affinity(
 const Scheduler_Control *scheduler,
 Thread_Control  *thread,
 Scheduler_Node  *node,
diff --git a/cpukit/include/rtems/score/scheduleredfsmp.h 
b/cpukit/include/rtems/score/scheduleredfsmp.h
index 69dcd1ab3f..6fef6fb86a 100644
--- a/cpukit/include/rtems/score/scheduleredfsmp.h
+++ b/cpukit/include/rtems/score/scheduleredfsmp.h
@@ -330,10 +330,13 @@ void _Scheduler_EDF_SMP_Start_idle(
  * @param node This parameter is unused.
  * @param affinity The new processor affinity set for the thread.
  *
- * @retval true The processor set of the scheduler is a subset of the affinity 
set.
- * @retval false The processor set of the scheduler is not a subset of the 
affinity set.
+ * @retval STATUS_SUCCESSFUL The processor set of the scheduler is a subset of
+ *   the affinity set.
+ *
+ * @retval STATUS_INVALID_NUMBER The processor set of the scheduler is not a
+ *   subset of the affinity set.
  */
-bool _Scheduler_EDF_SMP_Set_affinity(
+Status_Control _Scheduler_EDF_SMP_Set_affinity(
   const Scheduler_Control *scheduler,
   Thread_Control  *thread,
   Scheduler_Node  *node,
diff --git a/cpukit/include/rtems/score/schedulerimpl.h 
b/cpukit/include/rtems/score/schedulerimpl.h
index 65c600b583..595d6291b4 100644
--- a/cpukit/include/rtems/score/schedulerimpl.h
+++ b/cpukit/include/rtems/score/schedulerimpl.h
@@ -711,10 +711,12 @@ Status_Control _Scheduler_Get_affinity(
  * @param node This parameter is unused.
  * @param affinity The processor mask to check.
  *
- * @retval true @a affinity is a subset of the online processors.
- * @retval false @a affinity is not a subset of the online processors.
+ * @retval STATUS_SUCCESSFUL The affinity is a subset of the online processors.
+ *
+ * @retval STATUS_INVALID_NUMBER The affinity is not a subset of the online
+ *   processors.
  */
-RTEMS_INLINE_ROUTINE bool _Scheduler_default_Set_affinity_body(
+RTEMS_INLINE_ROUTINE Status_Control _Scheduler_default_Set_affinity_body(
   const Scheduler_Control *scheduler,
   Thread_Control  *the_thread,
   Scheduler_Node  *node,
@@ -724,7 +726,12 @@ RTEMS_INLINE_ROUTINE bool 
_Scheduler_default_Set_affinity_body(
   (void) scheduler;
   (void) the_thread;
   (void) node;
-  return _Processor_mask_Is_subset( affinity, _SMP_Get_online_processors() );
+
+  if ( !_Processor_mask_Is_subset( affinity, _SMP_Get_online_processors() ) ) {
+return STATUS_INVALID_NUMBER;
+  }
+
+  return STATUS_SUCCESSFUL;
 }
 
 /**
@@ -734,10 +741,12 @@ RTEMS_INLINE_ROUTINE bool 
_Scheduler_default_Set_affinity_body(
  * @param cpusetsize The size of @a cpuset.
  * @param cpuset The cpuset to set the affinity.
  *
- * @retval true The operation succeeded.
- * @retval false The operation did not succeed.
+ * @retval STATUS_SUCCESSFUL The operation succeeded.
+ *
+ * @retval STATUS_INVALID_NUMBER The processor set was not a valid new
+ *   processor affinity set for the thread.
  */
-bool _Scheduler_S

[PATCH] Return status code for _Thread_Start()

2021-04-26 Thread Sebastian Huber
This avoids having conditional statements to get the API-specific status
code.
---
 cpukit/include/rtems/score/threadimpl.h | 7 +++
 cpukit/posix/src/pthreadcreate.c| 5 ++---
 cpukit/rtems/src/taskstart.c| 7 ---
 cpukit/score/src/threadstart.c  | 6 +++---
 4 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/cpukit/include/rtems/score/threadimpl.h 
b/cpukit/include/rtems/score/threadimpl.h
index d9c0779b08..5dfd142b92 100644
--- a/cpukit/include/rtems/score/threadimpl.h
+++ b/cpukit/include/rtems/score/threadimpl.h
@@ -260,12 +260,11 @@ void _Thread_Free(
  * @param[in, out] is the ISR lock context which shall be used to disable the
  *   local interrupts before the call of this routine.
  *
- * @retval true The thread was in the dormant state and was sucessefully
- *   started.
+ * @retval STATUS_SUCCESSFUL The thread start was successful.
  *
- * @retval false Otherwise.
+ * @retval STATUS_INCORRECT_STATE The thread was already started.
  */
-bool _Thread_Start(
+Status_Control _Thread_Start(
   Thread_Control *the_thread,
   const Thread_Entry_information *entry,
   ISR_lock_Context   *lock_context
diff --git a/cpukit/posix/src/pthreadcreate.c b/cpukit/posix/src/pthreadcreate.c
index f53cd5e310..055d304699 100644
--- a/cpukit/posix/src/pthreadcreate.c
+++ b/cpukit/posix/src/pthreadcreate.c
@@ -74,7 +74,6 @@ int pthread_create(
   boolvalid;
   Thread_Configurationconfig;
   Status_Control  status;
-  boolok;
   Thread_Control *the_thread;
   Thread_Control *executing;
   int schedpolicy = SCHED_RR;
@@ -289,7 +288,7 @@ int pthread_create(
*  POSIX threads are allocated and started in one operation.
*/
   _ISR_lock_ISR_disable( &lock_context );
-  ok = _Thread_Start( the_thread, &entry, &lock_context );
+  status = _Thread_Start( the_thread, &entry, &lock_context );
 
   #if defined(RTEMS_DEBUG)
 /*
@@ -298,7 +297,7 @@ int pthread_create(
  *  NOTE: This can only happen if someone slips in and touches the
  *thread while we are creating it.
  */
-if ( !ok ) {
+if ( status != STATUS_SUCCESSFUL ) {
   _Thread_Free( &_POSIX_Threads_Information, the_thread );
   _Objects_Allocator_unlock();
   return EINVAL;
diff --git a/cpukit/rtems/src/taskstart.c b/cpukit/rtems/src/taskstart.c
index da29240961..eca9b5795d 100644
--- a/cpukit/rtems/src/taskstart.c
+++ b/cpukit/rtems/src/taskstart.c
@@ -21,6 +21,7 @@
 #endif
 
 #include 
+#include 
 #include 
 
 rtems_status_code rtems_task_start(
@@ -40,7 +41,7 @@ rtems_status_code rtems_task_start(
   };
   Thread_Control   *the_thread;
   ISR_lock_Context  lock_context;
-  bool  ok;
+  Status_Controlstatus;
 
   the_thread = _Thread_Get( id, &lock_context );
 
@@ -54,7 +55,7 @@ rtems_status_code rtems_task_start(
 return RTEMS_INVALID_ID;
   }
 
-  ok = _Thread_Start( the_thread, &entry, &lock_context );
+  status = _Thread_Start( the_thread, &entry, &lock_context );
 
-  return ok ? RTEMS_SUCCESSFUL : RTEMS_INCORRECT_STATE;
+  return _Status_Get( status );
 }
diff --git a/cpukit/score/src/threadstart.c b/cpukit/score/src/threadstart.c
index e75c536a2c..8c1732a35a 100644
--- a/cpukit/score/src/threadstart.c
+++ b/cpukit/score/src/threadstart.c
@@ -24,7 +24,7 @@
 #include 
 #include 
 
-bool _Thread_Start(
+Status_Control _Thread_Start(
   Thread_Control *the_thread,
   const Thread_Entry_information *entry,
   ISR_lock_Context   *lock_context
@@ -36,7 +36,7 @@ bool _Thread_Start(
 
   if ( !_States_Is_dormant( the_thread->current_state ) ) {
 _Thread_State_release( the_thread, lock_context );
-return false;
+return STATUS_INCORRECT_STATE;
   }
 
   the_thread->Start.Entry = *entry;
@@ -49,5 +49,5 @@ bool _Thread_Start(
   _User_extensions_Thread_start( the_thread );
 
   _Thread_Dispatch_enable( cpu_self );
-  return true;
+  return STATUS_SUCCESSFUL;
 }
-- 
2.26.2

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


Re: [PATCH] Implementation for STM32 HAL_GetTick using RTEMS

2021-04-26 Thread Sebastian Huber

Thanks, I checked it in with a minor format fix.

--
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

[PATCH v2] STM32 lwIP addition and CMake support

2021-04-26 Thread Robin Mueller
This patch adds CMake support to RTEMS lwIP.
It also improves the architecture to make integration
of new BSPs easier.

https://github.com/rmspacefish/rtems-stm32-lwip is a self-contained
repository to test the lwIP integration for the arm/stm32h7
and arm/nucleo-h743zi BSP.

The STM32 port includes the LAN driver (lan8742.c), the
primary port functions in ethernetif.c and some application code
taken from CubeH7, which can serve as a starting point for
implementations and was also tailored to RTEMS.

The common source file were refactored to be more generic and independent
of the used BSP.

More information can also be found in the README, which also specifies
how to build with CMake. The waf build system still needs to be adapted
to perform the same function.
---
 .gitignore|  10 +
 .gitmodules   |   1 +
 CMakeLists.txt|  76 ++
 README.md |  32 +
 cmake/PortSelect.cmake|  12 +
 lwip-to-rtems.py  |   0
 lwip/CMakeLists.txt   |   2 +
 lwip/ports/CMakeLists.txt |   2 +
 lwip/ports/drivers/CMakeLists.txt |  20 +
 .../drivers/{eth_lwip.c => rtems_lwip.c}  | 181 +++--
 .../drivers/{eth_lwip.h => rtems_lwip.h}  |  79 +-
 .../{eth_lwip_default.h => rtems_lwip_conf.h} |  30 +-
 lwip/ports/drivers/stm32h7/CMakeLists.txt |  14 +
 lwip/ports/drivers/stm32h7/app_dhcp.c | 217 +
 lwip/ports/drivers/stm32h7/app_ethernet.c | 187 +
 lwip/ports/drivers/stm32h7/ethernetif.c   | 758 ++
 .../drivers/stm32h7/include/CMakeLists.txt|   7 +
 .../stm32h7/include/lwip_port/app_dhcp.h  |  38 +
 .../stm32h7/include/lwip_port/app_ethernet.h  |  56 ++
 .../stm32h7/include/lwip_port/ethernetif.h|  56 ++
 lwip/ports/drivers/stm32h7/lan8742.c  | 664 +++
 lwip/ports/drivers/stm32h7/lan8742.h  | 448 +++
 .../stm32h7/template/lwipopts_template.h  | 289 +++
 lwip/ports/drivers/tms570/CMakeLists.txt  |   4 +
 .../ports/drivers/{ => tms570}/phy_dp83848h.c |   0
 .../ports/drivers/{ => tms570}/phy_dp83848h.h |   0
 .../tms570/template/lwipopts_template.h   |  75 ++
 lwip/ports/drivers/{ => tms570}/ti_drv_emac.h |   0
 lwip/ports/drivers/{ => tms570}/ti_drv_mdio.h |   0
 lwip/ports/drivers/{ => tms570}/tms570_emac.h |   0
 .../ports/drivers/{ => tms570}/tms570_netif.c |  11 +-
 .../ports/drivers/{ => tms570}/tms570_netif.h |  31 +
 lwip/ports/os/CMakeLists.txt  |   1 +
 lwip/ports/os/rtems/CMakeLists.txt|   9 +
 lwip/ports/os/rtems/arch/CMakeLists.txt   |   4 +
 lwip/ports/os/rtems/arch/cc.h |   3 +
 lwip/ports/os/rtems/arch/sys_arch.c   |  32 +-
 lwip/ports/os/rtems/arch/sys_arch.h   |  18 +-
 lwip/src/CMakeLists.txt   |   4 +
 lwip/src/api/CMakeLists.txt   |  11 +
 lwip/src/core/CMakeLists.txt  |  28 +
 lwip/src/core/ipv4/CMakeLists.txt |  10 +
 lwip/src/core/ipv6/CMakeLists.txt |  11 +
 lwip/src/include/CMakeLists.txt   |   7 +
 lwip/src/include/lwip/sys.h   |   1 -
 lwip/src/netif/CMakeLists.txt |  10 +
 lwip/{ports/os => test}/lwipopts.h|   0
 waf   |   0
 48 files changed, 3319 insertions(+), 130 deletions(-)
 create mode 100644 CMakeLists.txt
 create mode 100644 README.md
 create mode 100644 cmake/PortSelect.cmake
 mode change 100755 => 100644 lwip-to-rtems.py
 create mode 100644 lwip/CMakeLists.txt
 create mode 100644 lwip/ports/CMakeLists.txt
 create mode 100644 lwip/ports/drivers/CMakeLists.txt
 rename lwip/ports/drivers/{eth_lwip.c => rtems_lwip.c} (57%)
 rename lwip/ports/drivers/{eth_lwip.h => rtems_lwip.h} (56%)
 rename lwip/ports/drivers/{eth_lwip_default.h => rtems_lwip_conf.h} (68%)
 create mode 100644 lwip/ports/drivers/stm32h7/CMakeLists.txt
 create mode 100644 lwip/ports/drivers/stm32h7/app_dhcp.c
 create mode 100644 lwip/ports/drivers/stm32h7/app_ethernet.c
 create mode 100644 lwip/ports/drivers/stm32h7/ethernetif.c
 create mode 100644 lwip/ports/drivers/stm32h7/include/CMakeLists.txt
 create mode 100644 lwip/ports/drivers/stm32h7/include/lwip_port/app_dhcp.h
 create mode 100644 lwip/ports/drivers/stm32h7/include/lwip_port/app_ethernet.h
 create mode 100644 lwip/ports/drivers/stm32h7/include/lwip_port/ethernetif.h
 create mode 100644 lwip/ports/drivers/stm32h7/lan8742.c
 create mode 100644 lwip/ports/drivers/stm32h7/lan8742.h
 create mode 100644 lwip/ports/drivers/stm32h7/template/lwipopts_template.h
 create mode 100644 lwip/ports/drivers/tms570/CMakeLists.txt
 rename lwip/ports/drivers/{ => tms570}/phy_dp83848h.c (100%)
 rename lwip/ports/drivers/{ => tms570}/phy_dp83848h.h (100%)
 create mode 100644 lwip/ports/drivers/tms570/template/lwipopt

[PATCH] Implementation for STM32 HAL_GetTick using RTEMS

2021-04-26 Thread Robin Mueller
Uses configured millisecond per ticks
---
 bsps/arm/stm32h7/start/bspstart.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/bsps/arm/stm32h7/start/bspstart.c 
b/bsps/arm/stm32h7/start/bspstart.c
index 7ae39f1410..75af44352f 100644
--- a/bsps/arm/stm32h7/start/bspstart.c
+++ b/bsps/arm/stm32h7/start/bspstart.c
@@ -35,8 +35,7 @@
 /* Get number of milliseconds elapsed since startup */
 uint32_t HAL_GetTick(void)
 {
-  uint64_t temp = rtems_clock_get_uptime_nanoseconds() / (1000 * 1000);
-  return temp;
+  return rtems_clock_get_ticks_since_boot() * 
rtems_configuration_get_milliseconds_per_tick();
 }
 
 uint32_t stm32h7_systick_frequency(void)
-- 
2.25.1

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


[PATCH 2/2] Simplify get affinitiy directives

2021-04-26 Thread Sebastian Huber
There is no need to disable thread dispatching to get the affinity of a
task.
---
 cpukit/posix/src/pthreadgetaffinitynp.c | 3 ---
 cpukit/rtems/src/taskgetaffinity.c  | 3 ---
 2 files changed, 6 deletions(-)

diff --git a/cpukit/posix/src/pthreadgetaffinitynp.c 
b/cpukit/posix/src/pthreadgetaffinitynp.c
index b904aea36c..f30ae54c2a 100644
--- a/cpukit/posix/src/pthreadgetaffinitynp.c
+++ b/cpukit/posix/src/pthreadgetaffinitynp.c
@@ -38,7 +38,6 @@ int pthread_getaffinity_np(
 {
   Thread_Control   *the_thread;
   ISR_lock_Context  lock_context;
-  Per_CPU_Control  *cpu_self;
   Status_Controlstatus;
 
   if ( cpuset == NULL ) {
@@ -51,7 +50,6 @@ int pthread_getaffinity_np(
 return ESRCH;
   }
 
-  cpu_self = _Thread_Dispatch_disable_critical( &lock_context );
   _Thread_State_acquire_critical( the_thread, &lock_context );
 
   status = _Scheduler_Get_affinity(
@@ -61,7 +59,6 @@ int pthread_getaffinity_np(
   );
 
   _Thread_State_release( the_thread, &lock_context );
-  _Thread_Dispatch_enable( cpu_self );
   return _POSIX_Get_error( status );
 }
 
diff --git a/cpukit/rtems/src/taskgetaffinity.c 
b/cpukit/rtems/src/taskgetaffinity.c
index 6ced283393..09349c2da9 100644
--- a/cpukit/rtems/src/taskgetaffinity.c
+++ b/cpukit/rtems/src/taskgetaffinity.c
@@ -33,7 +33,6 @@ rtems_status_code rtems_task_get_affinity(
 {
   Thread_Control   *the_thread;
   ISR_lock_Context  lock_context;
-  Per_CPU_Control  *cpu_self;
   Status_Controlstatus;
 
   if ( cpuset == NULL ) {
@@ -52,7 +51,6 @@ rtems_status_code rtems_task_get_affinity(
 return RTEMS_INVALID_ID;
   }
 
-  cpu_self = _Thread_Dispatch_disable_critical( &lock_context );
   _Thread_State_acquire_critical( the_thread, &lock_context );
 
   status = _Scheduler_Get_affinity(
@@ -62,6 +60,5 @@ rtems_status_code rtems_task_get_affinity(
   );
 
   _Thread_State_release( the_thread, &lock_context );
-  _Thread_Dispatch_enable( cpu_self );
   return _Status_Get( status );
 }
-- 
2.26.2

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


[PATCH 1/2] Return status code for _Scheduler_Get_affinity()

2021-04-26 Thread Sebastian Huber
This avoids having conditional expressions to the API-specific status
code.
---
 cpukit/include/rtems/score/schedulerimpl.h | 7 ---
 cpukit/posix/src/pthreadgetaffinitynp.c| 7 ---
 cpukit/posix/src/pthreadgetattrnp.c| 7 ---
 cpukit/rtems/src/taskgetaffinity.c | 7 ---
 cpukit/score/src/schedulergetaffinity.c| 9 +++--
 5 files changed, 23 insertions(+), 14 deletions(-)

diff --git a/cpukit/include/rtems/score/schedulerimpl.h 
b/cpukit/include/rtems/score/schedulerimpl.h
index c545615919..397789372c 100644
--- a/cpukit/include/rtems/score/schedulerimpl.h
+++ b/cpukit/include/rtems/score/schedulerimpl.h
@@ -693,10 +693,11 @@ RTEMS_INLINE_ROUTINE const Processor_mask 
*_Scheduler_Get_processors(
  * @param cpusetsize The size of @a cpuset.
  * @param[out] cpuset The cpuset that serves as destination for the copy 
operation
  *
- * @retval true The copy operation was lossless.
- * @retval false The copy operation was not lossless
+ * @retval STATUS_SUCCESSFUL The operation succeeded.
+ *
+ * @retval STATUS_INVALID_NUMBER The processor set was too small.
  */
-bool _Scheduler_Get_affinity(
+Status_Control _Scheduler_Get_affinity(
   Thread_Control *the_thread,
   size_t  cpusetsize,
   cpu_set_t  *cpuset
diff --git a/cpukit/posix/src/pthreadgetaffinitynp.c 
b/cpukit/posix/src/pthreadgetaffinitynp.c
index 977f82c69b..b904aea36c 100644
--- a/cpukit/posix/src/pthreadgetaffinitynp.c
+++ b/cpukit/posix/src/pthreadgetaffinitynp.c
@@ -28,6 +28,7 @@
 
 #include 
 #include 
+#include 
 
 int pthread_getaffinity_np(
   pthread_t  thread,
@@ -38,7 +39,7 @@ int pthread_getaffinity_np(
   Thread_Control   *the_thread;
   ISR_lock_Context  lock_context;
   Per_CPU_Control  *cpu_self;
-  bool  ok;
+  Status_Controlstatus;
 
   if ( cpuset == NULL ) {
 return EFAULT;
@@ -53,7 +54,7 @@ int pthread_getaffinity_np(
   cpu_self = _Thread_Dispatch_disable_critical( &lock_context );
   _Thread_State_acquire_critical( the_thread, &lock_context );
 
-  ok = _Scheduler_Get_affinity(
+  status = _Scheduler_Get_affinity(
 the_thread,
 cpusetsize,
 cpuset
@@ -61,7 +62,7 @@ int pthread_getaffinity_np(
 
   _Thread_State_release( the_thread, &lock_context );
   _Thread_Dispatch_enable( cpu_self );
-  return ok ? 0 : EINVAL;
+  return _POSIX_Get_error( status );
 }
 
 #endif
diff --git a/cpukit/posix/src/pthreadgetattrnp.c 
b/cpukit/posix/src/pthreadgetattrnp.c
index eae29d1de7..5572fb98a5 100644
--- a/cpukit/posix/src/pthreadgetattrnp.c
+++ b/cpukit/posix/src/pthreadgetattrnp.c
@@ -26,6 +26,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -41,7 +42,7 @@ int pthread_getattr_np(
   Thread_CPU_budget_algorithms  budget_algorithm;
   const Scheduler_Control  *scheduler;
   Priority_Control  priority;
-  bool  ok;
+  Status_Controlstatus;
 
   if ( attr == NULL ) {
 return EINVAL;
@@ -82,7 +83,7 @@ int pthread_getattr_np(
 
   attr->affinityset = &attr->affinitysetpreallocated;
   attr->affinitysetsize = sizeof( attr->affinitysetpreallocated );
-  ok = _Scheduler_Get_affinity(
+  status = _Scheduler_Get_affinity(
 the_thread,
 attr->affinitysetsize,
 attr->affinityset
@@ -102,5 +103,5 @@ int pthread_getattr_np(
   attr->schedpolicy =
 _POSIX_Thread_Translate_to_sched_policy( budget_algorithm );
 
-  return ok ? 0 : EINVAL;
+  return _POSIX_Get_error( status );
 }
diff --git a/cpukit/rtems/src/taskgetaffinity.c 
b/cpukit/rtems/src/taskgetaffinity.c
index d08c2d6835..6ced283393 100644
--- a/cpukit/rtems/src/taskgetaffinity.c
+++ b/cpukit/rtems/src/taskgetaffinity.c
@@ -21,6 +21,7 @@
 #endif
 
 #include 
+#include 
 #include 
 #include 
 
@@ -33,7 +34,7 @@ rtems_status_code rtems_task_get_affinity(
   Thread_Control   *the_thread;
   ISR_lock_Context  lock_context;
   Per_CPU_Control  *cpu_self;
-  bool  ok;
+  Status_Controlstatus;
 
   if ( cpuset == NULL ) {
 return RTEMS_INVALID_ADDRESS;
@@ -54,7 +55,7 @@ rtems_status_code rtems_task_get_affinity(
   cpu_self = _Thread_Dispatch_disable_critical( &lock_context );
   _Thread_State_acquire_critical( the_thread, &lock_context );
 
-  ok = _Scheduler_Get_affinity(
+  status = _Scheduler_Get_affinity(
 the_thread,
 cpusetsize,
 cpuset
@@ -62,5 +63,5 @@ rtems_status_code rtems_task_get_affinity(
 
   _Thread_State_release( the_thread, &lock_context );
   _Thread_Dispatch_enable( cpu_self );
-  return ok ? RTEMS_SUCCESSFUL : RTEMS_INVALID_NUMBER;
+  return _Status_Get( status );
 }
diff --git a/cpukit/score/src/schedulergetaffinity.c 
b/cpukit/score/src/schedulergetaffinity.c
index 87be699f5b..99dc53609d 100644
--- a/cpukit/score/src/schedulergetaffinity.c
+++ b/cpukit/score/src/schedulergetaffinity.c
@@ -27,7 +27,7 @@
 
 #include 
 
-bool _Scheduler_Get_affinity(
+Status_Control _Scheduler_Get_affinity(
   Thread_Control *the_thread,
   size_t  cpusetsize,
   cpu_set_t  *c