[PATCH] rtems: Remove RTEMS_MP_NOT_CONFIGURED error

2020-06-15 Thread Sebastian Huber
Some objects can be created with a local or global scope in a
multiprocessing network. In non-multiprocessing configurations setting
the scope to local or global had no effect since such a system can be
viewed as a multiprocessing network with just one node. One and all
nodes is the same in such a network. However, if multiprocessing was
configured, creation of a global object in a single node network
resulted in an RTEMS_MP_NOT_CONFIGURED error. Remove this error
condition for symmetry to the non-multiprocessing setup. This is in line
with the task affinity behaviour in SMP systems.

Update #4005.
---
 cpukit/rtems/src/msgqcreate.c |  8 ---
 cpukit/rtems/src/partcreate.c |  6 ++---
 cpukit/rtems/src/semcreate.c  |  7 ++
 cpukit/rtems/src/taskcreate.c | 12 --
 testsuites/sptests/sp04/init.c|  2 +-
 testsuites/sptests/sp12/init.c|  2 +-
 testsuites/sptests/sp13/init.c|  2 +-
 testsuites/sptests/sp15/init.c|  2 +-
 testsuites/sptests/spmsgq_err01/init.c| 21 --
 .../sptests/spmsgq_err01/spmsgq_err01.scn |  1 -
 testsuites/sptests/sppartition_err01/init.c   | 22 ---
 .../sppartition_err01/sppartition_err01.scn   |  1 -
 testsuites/sptests/spsem_err01/init.c | 21 --
 .../sptests/spsem_err01/spsem_err01.scn   |  1 -
 testsuites/sptests/sptask_err03/init.c| 22 ---
 .../sptests/sptask_err03/sptask_err03.scn |  1 -
 16 files changed, 18 insertions(+), 113 deletions(-)

diff --git a/cpukit/rtems/src/msgqcreate.c b/cpukit/rtems/src/msgqcreate.c
index 9d4e8cdfd6..3741347cc9 100644
--- a/cpukit/rtems/src/msgqcreate.c
+++ b/cpukit/rtems/src/msgqcreate.c
@@ -52,9 +52,11 @@ rtems_status_code rtems_message_queue_create(
 return RTEMS_INVALID_ADDRESS;
 
 #if defined(RTEMS_MULTIPROCESSING)
-  if ( (is_global = _Attributes_Is_global( attribute_set ) ) &&
-   !_System_state_Is_multiprocessing )
-return RTEMS_MP_NOT_CONFIGURED;
+  if ( !_System_state_Is_multiprocessing ) {
+attribute_set = _Attributes_Clear( attribute_set, RTEMS_GLOBAL );
+  }
+
+  is_global = _Attributes_Is_global( attribute_set );
 #endif
 
   if ( count == 0 )
diff --git a/cpukit/rtems/src/partcreate.c b/cpukit/rtems/src/partcreate.c
index 2aefce8067..9aa5e80bf1 100644
--- a/cpukit/rtems/src/partcreate.c
+++ b/cpukit/rtems/src/partcreate.c
@@ -66,9 +66,9 @@ rtems_status_code rtems_partition_create(
 return RTEMS_INVALID_ADDRESS;
 
 #if defined(RTEMS_MULTIPROCESSING)
-  if ( _Attributes_Is_global( attribute_set ) &&
-   !_System_state_Is_multiprocessing )
-return RTEMS_MP_NOT_CONFIGURED;
+  if ( !_System_state_Is_multiprocessing ) {
+attribute_set = _Attributes_Clear( attribute_set, RTEMS_GLOBAL );
+  }
 #endif
 
   the_partition = _Partition_Allocate();
diff --git a/cpukit/rtems/src/semcreate.c b/cpukit/rtems/src/semcreate.c
index 6cdd877cce..b57b635d85 100644
--- a/cpukit/rtems/src/semcreate.c
+++ b/cpukit/rtems/src/semcreate.c
@@ -57,11 +57,8 @@ rtems_status_code rtems_semaphore_create(
 return RTEMS_INVALID_ADDRESS;
 
 #if defined(RTEMS_MULTIPROCESSING)
-  if (
-_Attributes_Is_global( attribute_set )
-  && !_System_state_Is_multiprocessing
-  ) {
-return RTEMS_MP_NOT_CONFIGURED;
+  if ( !_System_state_Is_multiprocessing ) {
+attribute_set = _Attributes_Clear( attribute_set, RTEMS_GLOBAL );
   }
 #endif
 
diff --git a/cpukit/rtems/src/taskcreate.c b/cpukit/rtems/src/taskcreate.c
index 288eafa5c7..b430d3c705 100644
--- a/cpukit/rtems/src/taskcreate.c
+++ b/cpukit/rtems/src/taskcreate.c
@@ -111,15 +111,11 @@ rtems_status_code rtems_task_create(
   }
 
 #if defined(RTEMS_MULTIPROCESSING)
-  if ( _Attributes_Is_global( the_attribute_set ) ) {
-
-is_global = true;
-
-if ( !_System_state_Is_multiprocessing )
-  return RTEMS_MP_NOT_CONFIGURED;
+  if ( !_System_state_Is_multiprocessing ) {
+the_attribute_set = _Attributes_Clear( the_attribute_set, RTEMS_GLOBAL );
+  }
 
-  } else
-is_global = false;
+  is_global = _Attributes_Is_global( the_attribute_set );
 #endif
 
   /*
diff --git a/testsuites/sptests/sp04/init.c b/testsuites/sptests/sp04/init.c
index 11aae46ea3..b163aec8ed 100644
--- a/testsuites/sptests/sp04/init.c
+++ b/testsuites/sptests/sp04/init.c
@@ -84,7 +84,7 @@ rtems_task Init(
  1,
  RTEMS_MINIMUM_STACK_SIZE * 2,
  RTEMS_PREEMPT|RTEMS_TIMESLICE,
- RTEMS_DEFAULT_ATTRIBUTES,
+ RTEMS_GLOBAL,
  _id[ 2 ]
   );
   directive_failed( status, "rtems_task_create of TA2" );
diff --git a/testsuites/sptests/sp12/init.c b/testsuites/sptests/sp12/init.c
index 789f7e3249..7aa09d3676 100644
--- a/testsuites/sptests/sp12/init.c
+++ b/testsuites/sptests/sp12/init.c
@@ -73,7 +73,7 @@ rtems_task Init(
   status = rtems_semaphore_create(
 Semaphore_name[ 3 ],
 1,
-RTEMS_DEFAULT_ATTRIBUTES,
+RTEMS_GLOBAL,
 

[PATCH] c-user: Remove RTEMS_MP_NOT_CONFIGURED error

2020-06-15 Thread Sebastian Huber
Some objects can be created with a local or global scope in a
multiprocessing network. In non-multiprocessing configurations setting
the scope to local or global had no effect since such a system can be
viewed as a multiprocessing network with just one node. One and all
nodes is the same in such a network. However, if multiprocessing was
configured, creation of a global object in a single node network
resulted in an RTEMS_MP_NOT_CONFIGURED error. Remove this error
condition for symmetry to the non-multiprocessing setup. This is in line
with the task affinity behaviour in SMP systems.

Close #4005.
---
 c-user/message_manager.rst   | 2 --
 c-user/partition_manager.rst | 2 --
 c-user/semaphore_manager.rst | 2 --
 c-user/task_manager.rst  | 2 --
 4 files changed, 8 deletions(-)

diff --git a/c-user/message_manager.rst b/c-user/message_manager.rst
index 0289dca..8115609 100644
--- a/c-user/message_manager.rst
+++ b/c-user/message_manager.rst
@@ -255,8 +255,6 @@ DIRECTIVE STATUS CODES:
- too many queues created
  * - ``RTEMS_UNSATISFIED``
- unable to allocate message buffers
- * - ``RTEMS_MP_NOT_CONFIGURED``
-   - multiprocessing not configured
  * - ``RTEMS_TOO_MANY``
- too many global objects
 
diff --git a/c-user/partition_manager.rst b/c-user/partition_manager.rst
index 765881f..bc30de2 100644
--- a/c-user/partition_manager.rst
+++ b/c-user/partition_manager.rst
@@ -177,8 +177,6 @@ DIRECTIVE STATUS CODES:
- ``buffer_size`` is not an integral multiple of the pointer size
  * - ``RTEMS_INVALID_SIZE``
- ``buffer_size`` is less than two times the pointer size
- * - ``RTEMS_MP_NOT_CONFIGURED``
-   - multiprocessing not configured
  * - ``RTEMS_TOO_MANY``
- too many global objects
 
diff --git a/c-user/semaphore_manager.rst b/c-user/semaphore_manager.rst
index 13058f3..31a3c79 100644
--- a/c-user/semaphore_manager.rst
+++ b/c-user/semaphore_manager.rst
@@ -358,8 +358,6 @@ DIRECTIVE STATUS CODES:
- invalid attribute set
  * - ``RTEMS_INVALID_NUMBER``
- invalid starting count for binary semaphore
- * - ``RTEMS_MP_NOT_CONFIGURED``
-   - multiprocessing not configured
  * - ``RTEMS_TOO_MANY``
- too many global objects
 
diff --git a/c-user/task_manager.rst b/c-user/task_manager.rst
index c3919f4..2db8abc 100644
--- a/c-user/task_manager.rst
+++ b/c-user/task_manager.rst
@@ -671,8 +671,6 @@ DIRECTIVE STATUS CODES:
 - invalid task name
   * - ``RTEMS_INVALID_PRIORITY``
 - invalid task priority
-  * - ``RTEMS_MP_NOT_CONFIGURED``
-- multiprocessing not configured
   * - ``RTEMS_TOO_MANY``
 - too many tasks created
   * - ``RTEMS_UNSATISFIED``
-- 
2.26.2

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


Re: Use of RTEMS_GLOBAL in non-multiprocessing configurations?

2020-06-15 Thread Sebastian Huber

On 15/06/2020 20:23, Joel Sherrill wrote:




On Mon, Jun 15, 2020 at 11:28 AM Sebastian Huber 
> wrote:


On 15/06/2020 18:24, Sebastian Huber wrote:

> On 15/06/2020 18:13, Joel Sherrill wrote:
>
>> On Mon, Jun 15, 2020 at 10:52 AM Sebastian Huber
>> mailto:sebastian.hu...@embedded-brains.de>
>> >> wrote:
>>
>>     Hello,
>>
>>     should the use of RTEMS_GLOBAL be an error in
>>     rtems_semaphore_create(),
>>     rtems_task_create(), rtems_message_queue_create(), and
>>     rtems_partition_create() if RTEMS was configured without
>>     multiprocessing
>>     enabled?
>>
>>
>> Based on the original use cases, I would say no. The idea was that
>> you could create
>> objects and attach to them to limit cohesion. The intention was to
>> avoid the use of
>> global variables for sharing object Ids.  If I offer a service
via a
>> message queue
>> globally and my library/service is deployed in a non-MP
>> configuration, it should still
>> work. For tasks, that would imply events. For partitions, it just
>> means the memory is
>> available to "the system" which is a single processor.
>
> Ok, but I think this is a bit inconsistent to the
>
> #if defined(RTEMS_MULTIPROCESSING)
>   if (
>     _Attributes_Is_global( attribute_set )
>   && !_System_state_Is_multiprocessing
>   ) {
>     return RTEMS_MP_NOT_CONFIGURED;
>   }
> #endif
>
> error case. If your system has only one node and is configured for
> multiprocessing shouldn't this behave exactly as an uniprocessor
> system with multiprocessing disabled?


Agreed. With 30 years of hindsight, we should ensure that affinity and
this setting follow the same behavior rule.


I added a ticket for this:

https://devel.rtems.org/ticket/4005

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

Re: Help in figuring out score objects in RTEMS and ticket #3131

2020-06-15 Thread Gedare Bloom
On Mon, Jun 15, 2020 at 11:29 AM Utkarsh Rai  wrote:
>
>
>
>
> On Mon, Jun 15, 2020 at 6:46 PM Joel Sherrill  wrote:
>>
>>
>>
>> On Wed, Jun 10, 2020 at 7:34 PM Utkarsh Rai  wrote:
>>>
>>> Hello,
>>> For my GSoC project, user-configurable thread stack protection, I need to 
>>> track, allocate, and manipulate attributes of shared as well as protected 
>>> stacks. Dr.Gedare suggested that tracking them with score objects would be 
>>> a good idea. He also indicated a good place to start and understand score 
>>> objects would be through this ticket.
>>>
>>> From the information that I could find in docs, my understanding of score 
>>> objects is that they are a type of directive that helps introduce 
>>> modularity to RTEMS as various types of RTEMS objects like message queues, 
>>> semaphores, etc. can use the same set of directives for 
>>> allocation/deallocation and control of their object types.
>>
>>
>> It is probably easier for you to think about the score as a collection of 
>> core classes that are reused across the public APIs. They do have strong 
>> modularity but they also ensure that the correct and optimized behavior is 
>> present across both the Classic and POSIX APIs. For example, a mutex can be 
>> optimized and made computer science correct just once and both the POSIX and 
>> Classic APIs benefit. Whether you call this layering, modularity, packaging, 
>> or classes is OK.
>>
>> If you look at the Doxygen, you will see there is even a bit of inheritance.
>>
>>>
>>> Some of the examples of the implementation that I could find used 
>>> _Object_Iniitialize_information()
>>> to initialize the object type, then _Object_Allocate()/Free() 
>>> allocate/de-allocate the object. Object_Id is used to control the object 
>>> type. My confusion is, how do we use object IDs to refer to and control the 
>>> allocated objects?
>>
>>
>> Every public API with an ID uses the score Object Handler to convert that ID 
>> into an instance to an object (base class) which is cast to an instance of 
>> the proper API type. An object has a name, ID, and a chain node. Any object 
>> can be put on lists. This is important because that's how the inactive set 
>> of each class of objects is managed. Various things are put on FIFO lists.
>>
>> The Chain handler which defines the Node structure and the Red-Black Tree 
>> are the foundation of many RTEMS data structures/algorithms.
>
>
> In the case of my project, I need to track and set the attributes of 
> protected and shared stacks. The current implementation looks like this, 
> maybe the APIs need to be in the public space, and if not, the stacks need to 
> be tracked by score objects. I suppose the important question is,  what are 
> the expectations as to how a mergeable implementation of this should look 
> like?
>

Any resource managed by RTEMS should offer some API and mechanisms to
configure it. The current mmap/shm implementation missed that point
when I created it, and should be fixed.

>>
>>>
>>>
>>> I also have some confusion in the above-mentioned ticket, it says-
>>> 'The mmap_h handler should construct a mapping object. A destructor is 
>>> currently missing. Maybe the mmap_h handler should use a flag to deal with 
>>> construction and destruction.'
>>>  I am unclear as to how the mmap_h handler should precisely look like and 
>>> where should it be defined?
>>
>>
>> I don't think this will be useful for your project. This is only used to 
>> provide a BSP specific mechanism to attach memory. This is primarily used in 
>> paravirtualized environments to allow the BSP to map memory shared with 
>> other address spaces. Without a hypervisor or host under RTEMS, this isn't 
>> going to be used. Although I think Gedare has at least one use case beyond 
>> this for it.
>>

There might be uses for it in libbsd, where there are portability
issues for applications that expect a functional mmap to exist. I
don't remember right off the top of my head though.

>> I think the stack allocator/deallocator hooks will be more useful.
>>
>>
>>>
>>> I would be grateful if you can provide some help in figuring this out.
>>>
>>> Regards,
>>> Utkarsh
>>>
>>> ___
>>> 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: GSoC 2020: [rtems/rsb]: Error while adding ptp support. This time building for xilinx_zynq_a9_qemu

2020-06-15 Thread Heinz Junkes
If you want to get ahead, just make a version that already has a configure, then
you can save yourself the trouble with autoconf. I'd put that in the back.
Heinz 


> On 15. Jun 2020, at 20:46, Mritunjay Sharma  
> wrote:
> 
> Hello everyone, 
> 
> The latest update is that by changing a couple of things in 
> source-builder/config/ptpd-2-1.cfg which are:
> 
> "%source setup ptpd -q -n ptpd-%{ptpd_version}
> %patch setup ptpd -p1
> 
> +automake --add-missing 
> +autoreconf --install --force 
> cd ${build_top}
> 
> %build"
> 
> GitHub Link: 
> https://github.com/RTEMS/rtems-source-builder/commit/413ea684f1e8672f921ce80abbc59f1e352acbc2
> 
> The earlier configure: error: cannot find install-sh, install.sh, or shtool 
> in build-aux "../ptpd-master"/build-aux has gone
> but another error has come as follows:
> 
> "configure.ac:28: installing './compile'
> configure.ac:16: installing './install-sh'
> configure.ac:16: installing './missing'
> configure.ac:13: error: required file 'config.h.in' not found
> src/Makefile.am: installing './depcomp'
> shell cmd failed: /bin/sh -ex  
> /home/mritunjay/development/rtems/rsb/rtems/build/ptpd-master-arm-rtems5-1/do-build
> error: building ptpd-master-arm-rtems5-1"
> 
> What can be the reason for this? Should I create another tar of this and set 
> it as the source?
> The trace and report are attached. The tutorial by Heinz has again helped me 
> a lot! 
> Thank you for that again!
> 
> Thanks,
> Mritunjay
> 
> 
> On Sun, Jun 14, 2020 at 3:07 AM Mritunjay Sharma 
>  wrote:
> First of all Heinz, I would like to thank you for such a wonderful guide 
> which really helped me fix a lot of errors. 
> After following your advice, I made certain changes to make PTPd work, 
> few errors came again but I managed to remove them with the use of Google. 
> 
> However, the recent most error has caught me in a fix and I am still trying 
> to figure it out where I went wrong. 
> 
> https://github.com/mritunjaysharma394/rtems-source-builder/tree/master/source-builder
> https://github.com/ptpd/ptpd/compare/master...mritunjaysharma394:master
> 
> The above two links will tell what changes I have made and the error that I 
> am receiving now is: 
> "configure: WARNING: unrecognized options: --disable-shared
> configure: error: cannot find install-sh, install.sh, or shtool in build-aux 
> "../ptpd-master"/build-aux
> shell cmd failed: /bin/sh -ex  
> /home/mritunjay/development/rtems/rsb/rtems/build/ptpd-master-arm-rtems5-1/do-build
> error: building ptpd-master-arm-rtems5-1"
> 
> 
> I have attached the trace log file and error report. 
> I tried to google and made few more changes in ptpd Makefile.am but it didn't 
> help.
> 
> It will be very kind of you all to help me figure out on how to tackle this 
> bug.
> 
> Thanks
> Mritunjay
> 
> On Sun, Jun 7, 2020 at 10:19 AM junkes  wrote:
> This is an unusually long text for the mailing list. I tried to write a kind 
> of tutorial using an example for a GSOC student. I'm looking forward to the 
> comments from the pros and can write it down completely. 
> 
> Hello, Mritunjay
> 
> if I understood it correctly, one idea of the rtems source builder is to make 
> existing 
> software packages usable for RTEMS. Most existing software packages do not 
> work without 
> changes in the RTEMS environment. You have already noticed this with ptpd ;-) 
> 
> The most common auto-tools and configure have trouble making the correct 
> assumptions for the rtems environment. Here you have to intervene. This can 
> be done with the builder-cfg files. 
> 
> This is a bit of hard work and you have to approach it with small steps. 
> You also have to use not so clean tricks in different places. When you have 
> achieved the integration you can/must then try to optimize it so that it 
> becomes 
> generally valid. 
> 
> That's my policy. Maybe the others here in the maillist have more ideas, also 
> for me. 
> 
> I have now tried to implement what I mean using a similar example (openntp). 
> Unfortunately, I haven't finished yet, but I hope to clear a few hurdles for 
> you. 
> 
> I was doing some digging around and I came across this: 
> https://github.com/openntpd-portable/openntpd-portable 
> 
> Here I was then confronted with the same problems as you with autoreconf etc. 
> Here it 
> didn't work, just run autoreconf twice and generate a tar-file for 
> installation like 
> I did with the ptpd from github. 
> Then I found this: 
> https://artfiles.org/openbsd/OpenNTPD/openntpd-6.2p3.tar.gz 
> 
> Now I have made a "standard" config file for rsb: 
> 
> # 
> # OpenNTPd 6.2p3 Version 1. 
> # 
> # This configuration file configure's, make's and install's OpenNTPd. 
> # 
> 
> %if %{release} == %{nil} 
> %define release 1 
> %endif 
> 
> Name:  openntpd-%{openntpd_version}-%{_host}-%{release} 
> Summary:   NTP is the Network Time Protocol. 
> Version:   %{openntpd_version} 
> Release:   %{release} 
> URL:   https://github.com/openntpd-portable 
> 
> # 
> # 

Re: Use of RTEMS_GLOBAL in non-multiprocessing configurations?

2020-06-15 Thread Gedare Bloom
On Mon, Jun 15, 2020 at 12:30 PM Joel Sherrill  wrote:
>
>
>
> On Mon, Jun 15, 2020 at 1:01 PM Sebastian Huber 
>  wrote:
>>
>> On 15/06/2020 18:28, Sebastian Huber wrote:
>>
>> > On 15/06/2020 18:24, Sebastian Huber wrote:
>> >
>> >> On 15/06/2020 18:13, Joel Sherrill wrote:
>> >>
>> >>> On Mon, Jun 15, 2020 at 10:52 AM Sebastian Huber
>> >>> > >>> > wrote:
>> >>>
>> >>> Hello,
>> >>>
>> >>> should the use of RTEMS_GLOBAL be an error in
>> >>> rtems_semaphore_create(),
>> >>> rtems_task_create(), rtems_message_queue_create(), and
>> >>> rtems_partition_create() if RTEMS was configured without
>> >>> multiprocessing
>> >>> enabled?
>> >>>
>> >>>
>> >>> Based on the original use cases, I would say no. The idea was that
>> >>> you could create
>> >>> objects and attach to them to limit cohesion. The intention was to
>> >>> avoid the use of
>> >>> global variables for sharing object Ids.  If I offer a service via a
>> >>> message queue
>> >>> globally and my library/service is deployed in a non-MP
>> >>> configuration, it should still
>> >>> work. For tasks, that would imply events. For partitions, it just
>> >>> means the memory is
>> >>> available to "the system" which is a single processor.
>> >>
>> >> Ok, but I think this is a bit inconsistent to the
>> >>
>> >> #if defined(RTEMS_MULTIPROCESSING)
>> >>   if (
>> >> _Attributes_Is_global( attribute_set )
>> >>   && !_System_state_Is_multiprocessing
>> >>   ) {
>> >> return RTEMS_MP_NOT_CONFIGURED;
>> >>   }
>> >> #endif
>> >>
>> >> error case. If your system has only one node and is configured for
>> >> multiprocessing shouldn't this behave exactly as an uniprocessor
>> >> system with multiprocessing disabled?
>> >
>> > The background for this question is that I go though the entire
>> > Classic API and write specification items for it. The specification
>> > items include the API documentation:
>> >
>> > https://devel.rtems.org/ticket/3993
>> >
>> > I will probably add some text similar to the one in your e-mail to
>> > explain that the use of RTEMS_GLOBAL is all right in
>> > non-multiprocessing configurations.
>>
>> How should I name this property of an object? Is it the scope of the
>> object (see
>> https://man7.org/linux/man-pages/man3/pthread_attr_setscope.3.html) or
>> the visibility of the object?
>>
I think this usually refers to "Global" scope, which is equivalent to
visibility in this case. Visibility usually is a concept introduced in
OOP, where you can pass around opaque objects (the object is in scope,
but not visible). My $0.02 on that one ...

>> Is "node in a multiprocessing network" a good phrase? I would like to
>> make it a bit easier to separate if from SMP.
>
>
> Although I know that the multiprocessing configuration has been user over
> an MPI network, its main deployment was shared bus computing with
> at least one bank of shared RAM. Think VMEBus CPU cards with a
> dedicated RAM card for shared message processing. Some CPU cards
> did have dual-ported RAM (hence the manager)[1] and  then some RAM
> on a CPU card served the role of the dedicated RAM card.
>
> I never saw one but there are reflective memory cards which could result
> in two card cages seeing the same memory contents.
>
> In that context, any ideas for something better than multiprocessing network
> as a term?
>

I'm reminded of partitioned global address space (PGAS).

> It needs to be in the glossary. I googled shared memory computing but that
> didn't give me what I wanted either.  Gedare needed for academic view.
>
> [1] the dual-ported memory manager was in the original RTEID specification
> and it is certainly the least useful capability defined in it. :)
>
> --joel
> ___
> devel mailing list
> devel@rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: Use of RTEMS_GLOBAL in non-multiprocessing configurations?

2020-06-15 Thread Joel Sherrill
On Mon, Jun 15, 2020 at 1:01 PM Sebastian Huber <
sebastian.hu...@embedded-brains.de> wrote:

> On 15/06/2020 18:28, Sebastian Huber wrote:
>
> > On 15/06/2020 18:24, Sebastian Huber wrote:
> >
> >> On 15/06/2020 18:13, Joel Sherrill wrote:
> >>
> >>> On Mon, Jun 15, 2020 at 10:52 AM Sebastian Huber
> >>>  >>> > wrote:
> >>>
> >>> Hello,
> >>>
> >>> should the use of RTEMS_GLOBAL be an error in
> >>> rtems_semaphore_create(),
> >>> rtems_task_create(), rtems_message_queue_create(), and
> >>> rtems_partition_create() if RTEMS was configured without
> >>> multiprocessing
> >>> enabled?
> >>>
> >>>
> >>> Based on the original use cases, I would say no. The idea was that
> >>> you could create
> >>> objects and attach to them to limit cohesion. The intention was to
> >>> avoid the use of
> >>> global variables for sharing object Ids.  If I offer a service via a
> >>> message queue
> >>> globally and my library/service is deployed in a non-MP
> >>> configuration, it should still
> >>> work. For tasks, that would imply events. For partitions, it just
> >>> means the memory is
> >>> available to "the system" which is a single processor.
> >>
> >> Ok, but I think this is a bit inconsistent to the
> >>
> >> #if defined(RTEMS_MULTIPROCESSING)
> >>   if (
> >> _Attributes_Is_global( attribute_set )
> >>   && !_System_state_Is_multiprocessing
> >>   ) {
> >> return RTEMS_MP_NOT_CONFIGURED;
> >>   }
> >> #endif
> >>
> >> error case. If your system has only one node and is configured for
> >> multiprocessing shouldn't this behave exactly as an uniprocessor
> >> system with multiprocessing disabled?
> >
> > The background for this question is that I go though the entire
> > Classic API and write specification items for it. The specification
> > items include the API documentation:
> >
> > https://devel.rtems.org/ticket/3993
> >
> > I will probably add some text similar to the one in your e-mail to
> > explain that the use of RTEMS_GLOBAL is all right in
> > non-multiprocessing configurations.
>
> How should I name this property of an object? Is it the scope of the
> object (see
> https://man7.org/linux/man-pages/man3/pthread_attr_setscope.3.html) or
> the visibility of the object?
>
> Is "node in a multiprocessing network" a good phrase? I would like to
> make it a bit easier to separate if from SMP.
>

Although I know that the multiprocessing configuration has been user over
an MPI network, its main deployment was shared bus computing with
at least one bank of shared RAM. Think VMEBus CPU cards with a
dedicated RAM card for shared message processing. Some CPU cards
did have dual-ported RAM (hence the manager)[1] and  then some RAM
on a CPU card served the role of the dedicated RAM card.

I never saw one but there are reflective memory cards which could result
in two card cages seeing the same memory contents.

In that context, any ideas for something better than multiprocessing network
as a term?

It needs to be in the glossary. I googled shared memory computing but that
didn't give me what I wanted either.  Gedare needed for academic view.

[1] the dual-ported memory manager was in the original RTEID specification
and it is certainly the least useful capability defined in it. :)

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

Re: Use of RTEMS_GLOBAL in non-multiprocessing configurations?

2020-06-15 Thread Joel Sherrill
On Mon, Jun 15, 2020 at 11:28 AM Sebastian Huber <
sebastian.hu...@embedded-brains.de> wrote:

> On 15/06/2020 18:24, Sebastian Huber wrote:
>
> > On 15/06/2020 18:13, Joel Sherrill wrote:
> >
> >> On Mon, Jun 15, 2020 at 10:52 AM Sebastian Huber
> >>  >> > wrote:
> >>
> >> Hello,
> >>
> >> should the use of RTEMS_GLOBAL be an error in
> >> rtems_semaphore_create(),
> >> rtems_task_create(), rtems_message_queue_create(), and
> >> rtems_partition_create() if RTEMS was configured without
> >> multiprocessing
> >> enabled?
> >>
> >>
> >> Based on the original use cases, I would say no. The idea was that
> >> you could create
> >> objects and attach to them to limit cohesion. The intention was to
> >> avoid the use of
> >> global variables for sharing object Ids.  If I offer a service via a
> >> message queue
> >> globally and my library/service is deployed in a non-MP
> >> configuration, it should still
> >> work. For tasks, that would imply events. For partitions, it just
> >> means the memory is
> >> available to "the system" which is a single processor.
> >
> > Ok, but I think this is a bit inconsistent to the
> >
> > #if defined(RTEMS_MULTIPROCESSING)
> >   if (
> > _Attributes_Is_global( attribute_set )
> >   && !_System_state_Is_multiprocessing
> >   ) {
> > return RTEMS_MP_NOT_CONFIGURED;
> >   }
> > #endif
> >
> > error case. If your system has only one node and is configured for
> > multiprocessing shouldn't this behave exactly as an uniprocessor
> > system with multiprocessing disabled?
>

Agreed. With 30 years of hindsight, we should ensure that affinity and
this setting follow the same behavior rule.

>
> The background for this question is that I go though the entire Classic
> API and write specification items for it. The specification items
> include the API documentation:
>
> https://devel.rtems.org/ticket/3993
>
> I will probably add some text similar to the one in your e-mail to
> explain that the use of RTEMS_GLOBAL is all right in non-multiprocessing
> configurations.
>

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

Re: Use of RTEMS_GLOBAL in non-multiprocessing configurations?

2020-06-15 Thread Sebastian Huber

On 15/06/2020 18:28, Sebastian Huber wrote:


On 15/06/2020 18:24, Sebastian Huber wrote:


On 15/06/2020 18:13, Joel Sherrill wrote:

On Mon, Jun 15, 2020 at 10:52 AM Sebastian Huber 
> wrote:


    Hello,

    should the use of RTEMS_GLOBAL be an error in
    rtems_semaphore_create(),
    rtems_task_create(), rtems_message_queue_create(), and
    rtems_partition_create() if RTEMS was configured without
    multiprocessing
    enabled?


Based on the original use cases, I would say no. The idea was that 
you could create
objects and attach to them to limit cohesion. The intention was to 
avoid the use of
global variables for sharing object Ids.  If I offer a service via a 
message queue
globally and my library/service is deployed in a non-MP 
configuration, it should still
work. For tasks, that would imply events. For partitions, it just 
means the memory is

available to "the system" which is a single processor.


Ok, but I think this is a bit inconsistent to the

#if defined(RTEMS_MULTIPROCESSING)
  if (
    _Attributes_Is_global( attribute_set )
  && !_System_state_Is_multiprocessing
  ) {
    return RTEMS_MP_NOT_CONFIGURED;
  }
#endif

error case. If your system has only one node and is configured for 
multiprocessing shouldn't this behave exactly as an uniprocessor 
system with multiprocessing disabled? 


The background for this question is that I go though the entire 
Classic API and write specification items for it. The specification 
items include the API documentation:


https://devel.rtems.org/ticket/3993

I will probably add some text similar to the one in your e-mail to 
explain that the use of RTEMS_GLOBAL is all right in 
non-multiprocessing configurations.


How should I name this property of an object? Is it the scope of the 
object (see 
https://man7.org/linux/man-pages/man3/pthread_attr_setscope.3.html) or 
the visibility of the object?


Is "node in a multiprocessing network" a good phrase? I would like to 
make it a bit easier to separate if from SMP.


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

Re: Help in figuring out score objects in RTEMS and ticket #3131

2020-06-15 Thread Utkarsh Rai
On Mon, Jun 15, 2020 at 6:46 PM Joel Sherrill  wrote:

>
>
> On Wed, Jun 10, 2020 at 7:34 PM Utkarsh Rai 
> wrote:
>
>> Hello,
>> For my GSoC project, user-configurable thread stack protection, I need to
>> track, allocate, and manipulate attributes of shared as well as protected
>> stacks. Dr.Gedare suggested that tracking them with score objects would be
>> a good idea. He also indicated a good place to start and understand
>> score objects would be through this ticket.
>> 
>>
>> From the information that I could find in docs, my understanding of score
>> objects is that they are a type of directive that
>> helps introduce modularity to RTEMS as various types of RTEMS objects like
>> message queues, semaphores, etc. can use the same set of directives for
>> allocation/deallocation and control of their object types.
>>
>
> It is probably easier for you to think about the score as a collection of
> core classes that are reused across the public APIs. They do have strong
> modularity but they also ensure that the correct and optimized behavior is
> present across both the Classic and POSIX APIs. For example, a mutex can be
> optimized and made computer science correct just once and both the POSIX
> and Classic APIs benefit. Whether you call this layering, modularity,
> packaging, or classes is OK.
>
> If you look at the Doxygen, you will see there is even a bit of
> inheritance.
>
>
>> Some of the examples of the implementation that I could find used
>> _Object_Iniitialize_information()
>> to initialize the object type, then _Object_Allocate()/Free()
>> allocate/de-allocate the object. Object_Id is used to control the object
>> type. My confusion is, how do we use object IDs to refer to and control the
>> allocated objects?
>>
>
> Every public API with an ID uses the score Object Handler to convert that
> ID into an instance to an object (base class) which is cast to an instance
> of the proper API type. An object has a name, ID, and a chain node. Any
> object can be put on lists. This is important because that's how the
> inactive set of each class of objects is managed. Various things are put on
> FIFO lists.
>
> The Chain handler which defines the Node structure and the Red-Black Tree
> are the foundation of many RTEMS data structures/algorithms.
>

In the case of my project, I need to track and set the attributes of
protected and shared stacks. The current implementation looks like this
,
maybe the APIs need to be in the public space, and if not, the stacks need
to be tracked by score objects. I suppose the important question is,  what
are the expectations as to how a mergeable implementation of this should
look like?


>
>>
>> I also have some confusion in the above-mentioned ticket, it says-
>> 'The mmap_h handler should construct a mapping object. A destructor is
>> currently missing. Maybe the mmap_h handler should use a flag to deal with
>> construction and destruction.'
>>  I am unclear as to how the mmap_h handler should precisely look like
>> and where should it be defined?
>>
>
> I don't think this will be useful for your project. This is only used to
> provide a BSP specific mechanism to attach memory. This is primarily used
> in paravirtualized environments to allow the BSP to map memory shared with
> other address spaces. Without a hypervisor or host under RTEMS, this isn't
> going to be used. Although I think Gedare has at least one use case beyond
> this for it.
>
> I think the stack allocator/deallocator hooks will be more useful.
>

>
>> I would be grateful if you can provide some help in figuring this out.
>>
>> Regards,
>> Utkarsh
>>
>> ___
>> 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: Use of RTEMS_GLOBAL in non-multiprocessing configurations?

2020-06-15 Thread Sebastian Huber

On 15/06/2020 18:24, Sebastian Huber wrote:


On 15/06/2020 18:13, Joel Sherrill wrote:

On Mon, Jun 15, 2020 at 10:52 AM Sebastian Huber 
> wrote:


    Hello,

    should the use of RTEMS_GLOBAL be an error in
    rtems_semaphore_create(),
    rtems_task_create(), rtems_message_queue_create(), and
    rtems_partition_create() if RTEMS was configured without
    multiprocessing
    enabled?


Based on the original use cases, I would say no. The idea was that 
you could create
objects and attach to them to limit cohesion. The intention was to 
avoid the use of
global variables for sharing object Ids.  If I offer a service via a 
message queue
globally and my library/service is deployed in a non-MP 
configuration, it should still
work. For tasks, that would imply events. For partitions, it just 
means the memory is

available to "the system" which is a single processor.


Ok, but I think this is a bit inconsistent to the

#if defined(RTEMS_MULTIPROCESSING)
  if (
    _Attributes_Is_global( attribute_set )
  && !_System_state_Is_multiprocessing
  ) {
    return RTEMS_MP_NOT_CONFIGURED;
  }
#endif

error case. If your system has only one node and is configured for 
multiprocessing shouldn't this behave exactly as an uniprocessor 
system with multiprocessing disabled? 


The background for this question is that I go though the entire Classic 
API and write specification items for it. The specification items 
include the API documentation:


https://devel.rtems.org/ticket/3993

I will probably add some text similar to the one in your e-mail to 
explain that the use of RTEMS_GLOBAL is all right in non-multiprocessing 
configurations.


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

Re: Use of RTEMS_GLOBAL in non-multiprocessing configurations?

2020-06-15 Thread Sebastian Huber

On 15/06/2020 18:13, Joel Sherrill wrote:

On Mon, Jun 15, 2020 at 10:52 AM Sebastian Huber 
> wrote:


Hello,

should the use of RTEMS_GLOBAL be an error in
rtems_semaphore_create(),
rtems_task_create(), rtems_message_queue_create(), and
rtems_partition_create() if RTEMS was configured without
multiprocessing
enabled?


Based on the original use cases, I would say no. The idea was that you 
could create
objects and attach to them to limit cohesion. The intention was to 
avoid the use of
global variables for sharing object Ids.  If I offer a service via a 
message queue
globally and my library/service is deployed in a non-MP configuration, 
it should still
work. For tasks, that would imply events. For partitions, it just 
means the memory is

available to "the system" which is a single processor.


Ok, but I think this is a bit inconsistent to the

#if defined(RTEMS_MULTIPROCESSING)
  if (
    _Attributes_Is_global( attribute_set )
  && !_System_state_Is_multiprocessing
  ) {
    return RTEMS_MP_NOT_CONFIGURED;
  }
#endif

error case. If your system has only one node and is configured for 
multiprocessing shouldn't this behave exactly as an uniprocessor system 
with multiprocessing disabled?


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

Re: Changes to libbsd for Applications?

2020-06-15 Thread Joel Sherrill
On Mon, Jun 15, 2020 at 10:44 AM Sebastian Huber <
sebastian.hu...@embedded-brains.de> wrote:

> On 15/06/2020 17:06, Joel Sherrill wrote:
>
> >
> > Lou put together a simple networked application example which was last
> > touched back in January. It doesn't compile now. It appears that a
> > number of headers have moved so the network_inif.h file has at least a
> > half dozen includes which don't work now. I am attaching the files and
> > would appreciate advice/help/changes to make it work again.
> Missing ./waf install?
>

More stupid than that. Typo in the install path so it was almost where I
thought it was supposed to be.

It really has been Monday here. :(

Thanks

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

Re: Use of RTEMS_GLOBAL in non-multiprocessing configurations?

2020-06-15 Thread Joel Sherrill
On Mon, Jun 15, 2020 at 10:52 AM Sebastian Huber <
sebastian.hu...@embedded-brains.de> wrote:

> Hello,
>
> should the use of RTEMS_GLOBAL be an error in rtems_semaphore_create(),
> rtems_task_create(), rtems_message_queue_create(), and
> rtems_partition_create() if RTEMS was configured without multiprocessing
> enabled?
>

Based on the original use cases, I would say no. The idea was that you
could create
objects and attach to them to limit cohesion. The intention was to avoid
the use of
global variables for sharing object Ids.  If I offer a service via a
message queue
globally and my library/service is deployed in a non-MP configuration, it
should still
work. For tasks, that would imply events. For partitions, it just means the
memory is
available to "the system" which is a single processor.

--joel

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

Re: [PATCH] Added APA terms

2020-06-15 Thread Sebastian Huber

On 15/06/2020 16:38, Richi Dubey wrote:


---
  c-user/glossary.rst | 13 -
  1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/c-user/glossary.rst b/c-user/glossary.rst
index 86350a8..589d41b 100644
--- a/c-user/glossary.rst
+++ b/c-user/glossary.rst
@@ -1,6 +1,6 @@
  .. SPDX-License-Identifier: CC-BY-SA-4.0
  
-.. Copyright (C) 2017, 2019 embedded brains GmbH (http://www.embedded-brains.de)

+.. Copyright (C) 2017, 2020 embedded brains GmbH 
(http://www.embedded-brains.de)

The stuff should probably have your copyright.

  .. Copyright (C) 1988, 1998 On-Line Applications Research Corporation (OAR)
  
  Glossary

@@ -16,6 +16,10 @@ Glossary
  A term used to describe an object which has been created by an
  application.
  
+APA

+Arbitrary Processor Affinity.
+In this model, a thread is allowed to have an arbitrary affinity to 
the processor set, rather than a global mapping from one thread to all 
processors or one thread to one processor. It has two variants, :term:`Weak 
APA` and :term:`Strong APA`


Please fix the line width (max. 79 chars). Please have a look at the 
phrase for acronyms:


https://docs.rtems.org/branches/master/eng/req/howto.html#glossary-specification


+
  aperiodic task
  A task which must execute only at irregular intervals and has only a 
soft
  deadline.
@@ -777,6 +781,9 @@ Glossary
  :term:`return value` to indicate a successful operation or error
  conditions.
  
+Strong APA

+Strong APA is a specialization of :term:`APA`. In this model, on the 
arrival of a :term:`thread`, every thread reachable from the newly arrived 
thread is checked to see if an existing thread can be shifted (or deallocated 
its processor)
It is a "model" of what? What means "arrival", "reachable from", and 
"shifted"?

  and the newly arrived thread take its place if the newly arrived thread has a 
higher priority. Similar analysis is done when a thread finishes its execution 
(Here, the terms task and thread have interchangeable definitions).

Task/thread statement is superfluous.

:cite:`Cerqueira:2014:LPA`

Please make sure that your text is built from complete sentences.

+
  suspend
  A term used to describe a task that is not competing for the CPU 
because it
  has had a ``rtems_task_suspend`` directive.
@@ -905,6 +912,10 @@ Glossary
  Message queues, regions, and semaphores have a wait queue associated 
with
  them.
  
+Weak APA

+Weak APA is a specialization of :term:`APA`. This refers to Linux's 
pull push implementation of APA model. On the arrival of a thread, the thread 
is scheduled when a processor in its affinity set is idle or a processor is 
executing a thread which is at a lower priority.
+:cite:`Cerqueira:2014:LPA`
+
  YAML
  This term is an acronym for `YAML Ain't Markup Language 
`_.
  

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


Use of RTEMS_GLOBAL in non-multiprocessing configurations?

2020-06-15 Thread Sebastian Huber

Hello,

should the use of RTEMS_GLOBAL be an error in rtems_semaphore_create(), 
rtems_task_create(), rtems_message_queue_create(), and 
rtems_partition_create() if RTEMS was configured without multiprocessing 
enabled?


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


Re: Changes to libbsd for Applications?

2020-06-15 Thread Sebastian Huber

On 15/06/2020 17:06, Joel Sherrill wrote:



Lou put together a simple networked application example which was last 
touched back in January. It doesn't compile now. It appears that a 
number of headers have moved so the network_inif.h file has at least a 
half dozen includes which don't work now. I am attaching the files and 
would appreciate advice/help/changes to make it work again.

Missing ./waf install?
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH rtems-tools] trace: Use c++14 instead of c++11 if possible

2020-06-15 Thread Christian Mauderer
Ping.

Currently shouldn't be a matter for much hosts (less than 20 including
FreeBSD, Fedora, Arch, openSUSE according to distrowatch [1]) but I
assume that llvm 10 will spread fast.


[1]
http://distrowatch.org/search.php?pkg=llvm=greaterequal=10=InLatest#pkgsearch


On 08/06/2020 08:52, Christian Mauderer wrote:
> llvm version 10 uses features from c++14 standard in the headers. With
> that, the record/record-main-lttng.cc doesn't build any more. This patch
> makes sure that c++14 is used if it is available.
> ---
>  trace/wscript | 6 +-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/trace/wscript b/trace/wscript
> index 656f92b..53a1ab4 100644
> --- a/trace/wscript
> +++ b/trace/wscript
> @@ -45,6 +45,7 @@ def configure(conf):
>  if conf.check(header_name='zlib.h', features='cxx', mandatory=False):
>  conf.check_cxx(lib = 'z')
>  conf.check_cxx(lib = 'ws2_32', mandatory=False)
> +conf.check_cxx(cxxflags='-std=c++14', mandatory=False, 
> define_name="HAVE_STD_CXX14")
>  conf.write_config_header('config.h')
>  
>  def build(bld):
> @@ -60,7 +61,10 @@ def build(bld):
>  conf['warningflags'] = ['-Wall', '-Wextra', '-pedantic']
>  conf['optflags'] = bld.env.C_OPTS
>  conf['cflags'] = ['-pipe', '-g'] + conf['optflags']
> -conf['cxxflags'] = ['-std=c++11'] + conf['cflags']
> +cxxstd = '-std=c++11'
> +if bld.env.HAVE_STD_CXX14:
> +cxxstd = '-std=c++14'
> +conf['cxxflags'] = [cxxstd] + conf['cflags']
>  conf['linkflags'] = ['-g']
>  conf['lib'] = []
>  if bld.env.LIB_WS2_32:
> 
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Changes to libbsd for Applications?

2020-06-15 Thread Joel Sherrill
Hi

Lou put together a simple networked application example which was last
touched back in January. It doesn't compile now. It appears that a number
of headers have moved so the network_inif.h file has at least a half dozen
includes which don't work now. I am attaching the files and would
appreciate advice/help/changes to make it work again.

It really is a simple example. It worked on the zynq qemu for sure.

Thanks.

--joel


Makefile
Description: Binary data


network_init.h
Description: Binary data


init.c
Description: Binary data
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH] Added APA terms

2020-06-15 Thread Richi Dubey
Hi,

Please ignore the first commit. I sent it directly from rtems-qual which
was a mistake.

Thanks

On Mon, Jun 15, 2020 at 8:08 PM Richi Dubey  wrote:

> ---
>  c-user/glossary.rst | 13 -
>  1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/c-user/glossary.rst b/c-user/glossary.rst
> index 86350a8..589d41b 100644
> --- a/c-user/glossary.rst
> +++ b/c-user/glossary.rst
> @@ -1,6 +1,6 @@
>  .. SPDX-License-Identifier: CC-BY-SA-4.0
>
> -.. Copyright (C) 2017, 2019 embedded brains GmbH (
> http://www.embedded-brains.de)
> +.. Copyright (C) 2017, 2020 embedded brains GmbH (
> http://www.embedded-brains.de)
>  .. Copyright (C) 1988, 1998 On-Line Applications Research Corporation
> (OAR)
>
>  Glossary
> @@ -16,6 +16,10 @@ Glossary
>  A term used to describe an object which has been created by an
>  application.
>
> +APA
> +Arbitrary Processor Affinity.
> +In this model, a thread is allowed to have an arbitrary affinity
> to the processor set, rather than a global mapping from one thread to all
> processors or one thread to one processor. It has two variants, :term:`Weak
> APA` and :term:`Strong APA`
> +
>  aperiodic task
>  A task which must execute only at irregular intervals and has
> only a soft
>  deadline.
> @@ -777,6 +781,9 @@ Glossary
>  :term:`return value` to indicate a successful operation or error
>  conditions.
>
> +Strong APA
> +Strong APA is a specialization of :term:`APA`. In this model, on
> the arrival of a :term:`thread`, every thread reachable from the newly
> arrived thread is checked to see if an existing thread can be shifted (or
> deallocated its processor) and the newly arrived thread take its place if
> the newly arrived thread has a higher priority. Similar analysis is done
> when a thread finishes its execution (Here, the terms task and thread have
> interchangeable definitions). :cite:`Cerqueira:2014:LPA`
> +
>  suspend
>  A term used to describe a task that is not competing for the CPU
> because it
>  has had a ``rtems_task_suspend`` directive.
> @@ -905,6 +912,10 @@ Glossary
>  Message queues, regions, and semaphores have a wait queue
> associated with
>  them.
>
> +Weak APA
> +Weak APA is a specialization of :term:`APA`. This refers to
> Linux's pull push implementation of APA model. On the arrival of a thread,
> the thread is scheduled when a processor in its affinity set is idle or a
> processor is executing a thread which is at a lower priority.
> +:cite:`Cerqueira:2014:LPA`
> +
>  YAML
>  This term is an acronym for `YAML Ain't Markup Language <
> https://yaml.org/>`_.
>
> --
> 2.17.1
>
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

[PATCH] Added APA terms

2020-06-15 Thread Richi Dubey
---
 c-user/glossary.rst | 13 -
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/c-user/glossary.rst b/c-user/glossary.rst
index 86350a8..589d41b 100644
--- a/c-user/glossary.rst
+++ b/c-user/glossary.rst
@@ -1,6 +1,6 @@
 .. SPDX-License-Identifier: CC-BY-SA-4.0
 
-.. Copyright (C) 2017, 2019 embedded brains GmbH 
(http://www.embedded-brains.de)
+.. Copyright (C) 2017, 2020 embedded brains GmbH 
(http://www.embedded-brains.de)
 .. Copyright (C) 1988, 1998 On-Line Applications Research Corporation (OAR)
 
 Glossary
@@ -16,6 +16,10 @@ Glossary
 A term used to describe an object which has been created by an
 application.
 
+APA
+Arbitrary Processor Affinity.
+In this model, a thread is allowed to have an arbitrary affinity to 
the processor set, rather than a global mapping from one thread to all 
processors or one thread to one processor. It has two variants, :term:`Weak 
APA` and :term:`Strong APA`
+
 aperiodic task
 A task which must execute only at irregular intervals and has only a 
soft
 deadline.
@@ -777,6 +781,9 @@ Glossary
 :term:`return value` to indicate a successful operation or error
 conditions.
 
+Strong APA
+Strong APA is a specialization of :term:`APA`. In this model, on the 
arrival of a :term:`thread`, every thread reachable from the newly arrived 
thread is checked to see if an existing thread can be shifted (or deallocated 
its processor) and the newly arrived thread take its place if the newly arrived 
thread has a higher priority. Similar analysis is done when a thread finishes 
its execution (Here, the terms task and thread have interchangeable 
definitions). :cite:`Cerqueira:2014:LPA`
+
 suspend
 A term used to describe a task that is not competing for the CPU 
because it
 has had a ``rtems_task_suspend`` directive.
@@ -905,6 +912,10 @@ Glossary
 Message queues, regions, and semaphores have a wait queue associated 
with
 them.
 
+Weak APA
+Weak APA is a specialization of :term:`APA`. This refers to Linux's 
pull push implementation of APA model. On the arrival of a thread, the thread 
is scheduled when a processor in its affinity set is idle or a processor is 
executing a thread which is at a lower priority.
+:cite:`Cerqueira:2014:LPA`
+
 YAML
 This term is an acronym for `YAML Ain't Markup Language 
`_.
 
-- 
2.17.1

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


[PATCH] Added APA terms

2020-06-15 Thread Richi Dubey
---
 c-user/glossary.rst | 923 
 1 file changed, 923 insertions(+)
 create mode 100644 c-user/glossary.rst

diff --git a/c-user/glossary.rst b/c-user/glossary.rst
new file mode 100644
index 000..589d41b
--- /dev/null
+++ b/c-user/glossary.rst
@@ -0,0 +1,923 @@
+.. SPDX-License-Identifier: CC-BY-SA-4.0
+
+.. Copyright (C) 2017, 2020 embedded brains GmbH 
(http://www.embedded-brains.de)
+.. Copyright (C) 1988, 1998 On-Line Applications Research Corporation (OAR)
+
+Glossary
+
+
+.. glossary::
+:sorted:
+
+ABI
+This term is an acronym for Application Binary Interface.
+
+active
+A term used to describe an object which has been created by an
+application.
+
+APA
+Arbitrary Processor Affinity.
+In this model, a thread is allowed to have an arbitrary affinity to 
the processor set, rather than a global mapping from one thread to all 
processors or one thread to one processor. It has two variants, :term:`Weak 
APA` and :term:`Strong APA`
+
+aperiodic task
+A task which must execute only at irregular intervals and has only a 
soft
+deadline.
+
+API
+This term is an acronym for Application Programming Interface.
+
+application
+In this document, software which makes use of RTEMS.
+
+ASR
+This term is an acronym for :term:`Asynchronous Signal Routine`.
+
+assembler language
+The assembler language is a programming language which can be 
translated very
+easily into machine code and data.  For this project assembler 
languages are
+restricted to languages accepted by the :term:`GNU` assembler
+program for the target architectures.
+
+asynchronous
+Not related in order or timing to other occurrences in the system.
+
+Asynchronous Signal Routine
+Similar to a hardware interrupt except that it is associated with a 
task
+and is run in the context of a task.  The directives provided by the
+signal manager are used to service signals.
+
+atomic operations
+Atomic operations are defined in terms of :term:`C11`.
+
+awakened
+A term used to describe a task that has been unblocked and may be
+scheduled to the CPU.
+
+big endian
+A data representation scheme in which the bytes composing a numeric 
value
+are arranged such that the most significant byte is at the lowest
+address.
+
+bit-mapped
+A data encoding scheme in which each bit in a variable is used to
+represent something different.  This makes for compact data
+representation.
+
+block
+A physically contiguous area of memory.
+
+blocked task
+The task state entered by a task which has been previously started and
+cannot continue execution until the reason for waiting has been
+satisfied.  Blocked tasks are not an element of the set of ready tasks 
of
+a scheduler instance.
+
+Board Support Package
+A collection of device initialization and control routines specific to 
a
+particular type of board or collection of boards.
+
+broadcast
+To simultaneously send a message to a logical set of destinations.
+
+BSP
+This term is an acronym for :term:`Board Support Package`.
+
+buffer
+A fixed length block of memory allocated from a partition.
+
+C language
+The C language for this project is defined in terms of
+:term:`C11`.
+
+C++11
+The standard ISO/IEC 14882:2011.
+
+C11
+The standard ISO/IEC 9899:2011.
+
+calling convention
+The processor and compiler dependent rules which define the mechanism
+used to invoke subroutines in a high-level language.  These rules 
define
+the passing of arguments, the call and return mechanism, and the 
register
+set which must be preserved.
+
+CCB
+This term is an acronym for Change Control Board.
+
+Central Processing Unit
+This term is equivalent to the terms processor and microprocessor.
+
+chain
+A data structure which allows for efficient dynamic addition and 
removal
+of elements.  It differs from an array in that it is not limited to a
+predefined size.
+
+cluster
+We have clustered scheduling in case the set of processors of a system 
is
+partitioned into non-empty pairwise disjoint subsets.  These subsets 
are
+called clusters.  Clusters with a cardinality of one are partitions.
+Each cluster is owned by exactly one scheduler instance.
+
+coalesce
+The process of merging adjacent holes into a single larger hole.
+Sometimes this process is referred to as garbage collection.
+
+Configuration Table
+A table which contains information used to tailor RTEMS for a 
particular
+application.
+
+context
+   

Re: Help in figuring out score objects in RTEMS and ticket #3131

2020-06-15 Thread Joel Sherrill
On Wed, Jun 10, 2020 at 7:34 PM Utkarsh Rai  wrote:

> Hello,
> For my GSoC project, user-configurable thread stack protection, I need to
> track, allocate, and manipulate attributes of shared as well as protected
> stacks. Dr.Gedare suggested that tracking them with score objects would be
> a good idea. He also indicated a good place to start and understand
> score objects would be through this ticket.
> 
>
> From the information that I could find in docs, my understanding of score
> objects is that they are a type of directive that
> helps introduce modularity to RTEMS as various types of RTEMS objects like
> message queues, semaphores, etc. can use the same set of directives for
> allocation/deallocation and control of their object types.
>

It is probably easier for you to think about the score as a collection of
core classes that are reused across the public APIs. They do have strong
modularity but they also ensure that the correct and optimized behavior is
present across both the Classic and POSIX APIs. For example, a mutex can be
optimized and made computer science correct just once and both the POSIX
and Classic APIs benefit. Whether you call this layering, modularity,
packaging, or classes is OK.

If you look at the Doxygen, you will see there is even a bit of inheritance.


> Some of the examples of the implementation that I could find used
> _Object_Iniitialize_information()
> to initialize the object type, then _Object_Allocate()/Free()
> allocate/de-allocate the object. Object_Id is used to control the object
> type. My confusion is, how do we use object IDs to refer to and control the
> allocated objects?
>

Every public API with an ID uses the score Object Handler to convert that
ID into an instance to an object (base class) which is cast to an instance
of the proper API type. An object has a name, ID, and a chain node. Any
object can be put on lists. This is important because that's how the
inactive set of each class of objects is managed. Various things are put on
FIFO lists.

The Chain handler which defines the Node structure and the Red-Black Tree
are the foundation of many RTEMS data structures/algorithms.


>
> I also have some confusion in the above-mentioned ticket, it says-
> 'The mmap_h handler should construct a mapping object. A destructor is
> currently missing. Maybe the mmap_h handler should use a flag to deal with
> construction and destruction.'
>  I am unclear as to how the mmap_h handler should precisely look like and
> where should it be defined?
>

I don't think this will be useful for your project. This is only used to
provide a BSP specific mechanism to attach memory. This is primarily used
in paravirtualized environments to allow the BSP to map memory shared with
other address spaces. Without a hypervisor or host under RTEMS, this isn't
going to be used. Although I think Gedare has at least one use case beyond
this for it.

I think the stack allocator/deallocator hooks will be more useful.


> I would be grateful if you can provide some help in figuring this out.
>
> Regards,
> Utkarsh
>
> ___
> 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 2/2] Adding strong and weak definitions

2020-06-15 Thread Sebastian Huber

On 15/06/2020 14:33, Richi Dubey wrote:


Hi,

rtems_to_spec and ./spec2doc, both are giving similar error:

$ ./spec2doc.py
Traceback (most recent call last):
  File "./spec2doc.py", line 41, in 
    main()
  File "./spec2doc.py", line 37, in main
    rtemsqual.glossary.generate(config["glossary"], item_cache)
  File "/home/richi/rtems-qual/rtemsqual/glossary.py", line 137, in 
generate

    _generate_project_glossary(config["project-target"], project_glossary)
  File "/home/richi/rtems-qual/rtemsqual/glossary.py", line 108, in 
_generate_project_glossary

    content = _generate_glossary_content(glossary.uid_to_item)
  File "/home/richi/rtems-qual/rtemsqual/glossary.py", line 68, in 
_generate_glossary_content

    text = SphinxMapper(item).substitute(item["text"])
  File "/home/richi/rtems-qual/rtemsqual/items.py", line 317, in 
substitute

    return ItemTemplate(text).substitute(self)
  File "/usr/lib/python3.6/string.py", line 130, in substitute
    return self.pattern.sub(convert, self.template)
  File "/usr/lib/python3.6/string.py", line 123, in convert
    return str(mapping[named])
  File "/home/richi/rtems-qual/rtemsqual/items.py", line 307, in 
__getitem__

    return self.map(identifier)[1]
  File "/home/richi/rtems-qual/rtemsqual/items.py", line 299, in map
    item = self._item.map(uid)
  File "/home/richi/rtems-qual/rtemsqual/items.py", line 188, in map
    return self._item_cache[self.to_abs_uid(abs_or_rel_uid)]
  File "/home/richi/rtems-qual/rtemsqual/items.py", line 334, in 
__getitem__

    return self._items[uid]
KeyError: '/glossary/apa'
(env)

I can't find apa.yml in the glossary as well. What might be wrong?
The assertion is not really user friendly, however, you figured out the 
error quite well. There is no apa.yml in the glossary directory. This 
means you have to add it.

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

Re: [PATCH 2/2] Adding strong and weak definitions

2020-06-15 Thread Richi Dubey
Hi,

rtems_to_spec and ./spec2doc, both are giving similar error:

$ ./spec2doc.py
Traceback (most recent call last):
  File "./spec2doc.py", line 41, in 
main()
  File "./spec2doc.py", line 37, in main
rtemsqual.glossary.generate(config["glossary"], item_cache)
  File "/home/richi/rtems-qual/rtemsqual/glossary.py", line 137, in generate
_generate_project_glossary(config["project-target"], project_glossary)
  File "/home/richi/rtems-qual/rtemsqual/glossary.py", line 108, in
_generate_project_glossary
content = _generate_glossary_content(glossary.uid_to_item)
  File "/home/richi/rtems-qual/rtemsqual/glossary.py", line 68, in
_generate_glossary_content
text = SphinxMapper(item).substitute(item["text"])
  File "/home/richi/rtems-qual/rtemsqual/items.py", line 317, in substitute
return ItemTemplate(text).substitute(self)
  File "/usr/lib/python3.6/string.py", line 130, in substitute
return self.pattern.sub(convert, self.template)
  File "/usr/lib/python3.6/string.py", line 123, in convert
return str(mapping[named])
  File "/home/richi/rtems-qual/rtemsqual/items.py", line 307, in __getitem__
return self.map(identifier)[1]
  File "/home/richi/rtems-qual/rtemsqual/items.py", line 299, in map
item = self._item.map(uid)
  File "/home/richi/rtems-qual/rtemsqual/items.py", line 188, in map
return self._item_cache[self.to_abs_uid(abs_or_rel_uid)]
  File "/home/richi/rtems-qual/rtemsqual/items.py", line 334, in __getitem__
return self._items[uid]
KeyError: '/glossary/apa'
(env)

I can't find apa.yml in the glossary as well. What might be wrong?

strongapa.yml:

SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
copyrights:
- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
enabled-by: true
glossary-type: term
links:
- role: glossary-member
  uid: ../glossary-general
term: Strong APA
text:
  Strong APA is a specialization of ${apa:/term}.
  In this model, on the arrival of a ${thread:/term}, every thread
  reachable from the newly arrived thread is checked to see if an
  existing thread can be shifted (or deallocated its processor) and
  the newly arrived thread take its place if the newly arrived thread
  has a higher priority. Similar analysis is done when a thread finishes
  its execution (Here, the terms task and thread have interchangeable
  definitions).
  :cite:`Cerqueira:2014:LPA`
type: glossary

On Mon, Jun 15, 2020 at 5:04 PM Sebastian Huber <
sebastian.hu...@embedded-brains.de> wrote:

> On 15/06/2020 13:32, Richi Dubey wrote:
>
> > Thanks for your quick response. I am getting the following error:
> >
> > richi@YouAreAmazing:~/rtems-qual$ git pull
> > Already up to date.
> > richi@YouAreAmazing:~/rtems-qual$ ./spec2doc.py
> >   File "./spec2doc.py", line 31
> > def main() -> None:
> >^
> > SyntaxError: invalid syntax
> >
> > Is it because I am running Python 2.7.17?
> Please read the README.md.
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

[PATCH] c-user: Mention possible preemptions

2020-06-15 Thread Sebastian Huber
Mention that object create/delete may case the calling task to be
preempted due to the object allocator mutex.
---
 c-user/barrier_manager.rst   | 6 +-
 c-user/dual_ports_memory_manager.rst | 8 +---
 c-user/message_manager.rst   | 6 +-
 c-user/partition_manager.rst | 6 --
 c-user/rate_monotonic_manager.rst| 6 --
 c-user/semaphore_manager.rst | 6 +-
 c-user/user_extensions.rst   | 7 ---
 7 files changed, 32 insertions(+), 13 deletions(-)

diff --git a/c-user/barrier_manager.rst b/c-user/barrier_manager.rst
index dc50eb5..4438f9c 100644
--- a/c-user/barrier_manager.rst
+++ b/c-user/barrier_manager.rst
@@ -218,7 +218,8 @@ DESCRIPTION:
 the tasks waiting at the barrier unblocked.
 
 NOTES:
-This directive will not cause the calling task to be preempted.
+This directive may cause the calling task to be preempted due to an
+obtain and release of the object allocator mutex.
 
 The following barrier attribute constants are defined by RTEMS:
 
@@ -309,6 +310,9 @@ DESCRIPTION:
 barrier is reclaimed by RTEMS.
 
 NOTES:
+This directive may cause the calling task to be preempted due to an
+obtain and release of the object allocator mutex.
+
 The calling task will be preempted if it is enabled by the task's execution
 mode and a higher priority local task is waiting on the deleted barrier.
 The calling task will NOT be preempted if all of the tasks that are waiting
diff --git a/c-user/dual_ports_memory_manager.rst 
b/c-user/dual_ports_memory_manager.rst
index 2c864ad..a8b7183 100644
--- a/c-user/dual_ports_memory_manager.rst
+++ b/c-user/dual_ports_memory_manager.rst
@@ -142,11 +142,12 @@ DESCRIPTION:
 is not used to store the DPCB.
 
 NOTES:
+This directive may cause the calling task to be preempted due to an
+obtain and release of the object allocator mutex.
+
 The internal_address and external_address parameters must be on a four byte
 boundary.
 
-This directive will not cause the calling task to be preempted.
-
 .. raw:: latex
 
\clearpage
@@ -222,7 +223,8 @@ DESCRIPTION:
 DPCB for the deleted dual-ported memory area is reclaimed by RTEMS.
 
 NOTES:
-This directive will not cause the calling task to be preempted.
+This directive may cause the calling task to be preempted due to an
+obtain and release of the object allocator mutex.
 
 The calling task does not have to be the task that created the port.  Any
 local task that knows the port id can delete the port.
diff --git a/c-user/message_manager.rst b/c-user/message_manager.rst
index 3132f2c..0289dca 100644
--- a/c-user/message_manager.rst
+++ b/c-user/message_manager.rst
@@ -273,7 +273,8 @@ DESCRIPTION:
 specified, waiting tasks are serviced in First In-First Out order.
 
 NOTES:
-This directive will not cause the calling task to be preempted.
+This directive may cause the calling task to be preempted due to an
+obtain and release of the object allocator mutex.
 
 The following message queue attribute constants are defined by RTEMS:
 
@@ -396,6 +397,9 @@ DESCRIPTION:
 message buffers is reclaimed by RTEMS.
 
 NOTES:
+This directive may cause the calling task to be preempted due to an
+obtain and release of the object allocator mutex.
+
 The calling task will be preempted if its preemption mode is enabled and
 one or more local tasks with a higher priority than the calling task are
 waiting on the deleted queue.  The calling task will NOT be preempted if
diff --git a/c-user/partition_manager.rst b/c-user/partition_manager.rst
index 0590c0b..765881f 100644
--- a/c-user/partition_manager.rst
+++ b/c-user/partition_manager.rst
@@ -192,7 +192,8 @@ DESCRIPTION:
 local PTCB free pool and initializes it.
 
 NOTES:
-This directive will not cause the calling task to be preempted.
+This directive may cause the calling task to be preempted due to an
+obtain and release of the object allocator mutex.
 
 The partition buffer area specified by the ``starting_address`` must be
 properly aligned.  It must be possible to directly store target
@@ -360,7 +361,8 @@ DESCRIPTION:
 deleted partition is reclaimed by RTEMS.
 
 NOTES:
-This directive will not cause the calling task to be preempted.
+This directive may cause the calling task to be preempted due to an
+obtain and release of the object allocator mutex.
 
 The calling task does not have to be the task that created the partition.
 Any local task that knows the partition id can delete the partition.
diff --git a/c-user/rate_monotonic_manager.rst 
b/c-user/rate_monotonic_manager.rst
index 6152005..e9241bc 100644
--- a/c-user/rate_monotonic_manager.rst
+++ b/c-user/rate_monotonic_manager.rst
@@ -666,7 +666,8 @@ DESCRIPTION:
 pool and initializes it.
 
 NOTES:
-This directive will not cause the calling task to be preempted.
+This directive may cause the calling 

Re: [PATCH 2/2] Adding strong and weak definitions

2020-06-15 Thread Sebastian Huber

On 15/06/2020 13:32, Richi Dubey wrote:


Thanks for your quick response. I am getting the following error:

richi@YouAreAmazing:~/rtems-qual$ git pull
Already up to date.
richi@YouAreAmazing:~/rtems-qual$ ./spec2doc.py
  File "./spec2doc.py", line 31
    def main() -> None:
               ^
SyntaxError: invalid syntax

Is it because I am running Python 2.7.17?

Please read the README.md.
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH 2/2] Adding strong and weak definitions

2020-06-15 Thread Richi Dubey
Hi,

Thanks for your quick response. I am getting the following error:

richi@YouAreAmazing:~/rtems-qual$ git pull
Already up to date.
richi@YouAreAmazing:~/rtems-qual$ ./spec2doc.py
  File "./spec2doc.py", line 31
def main() -> None:
   ^
SyntaxError: invalid syntax

Is it because I am running Python 2.7.17?


On Wed, Jun 10, 2020 at 9:07 PM Sebastian Huber <
sebastian.hu...@embedded-brains.de> wrote:

> On 10/06/2020 16:41, Richi Dubey wrote:
>
> > Hi,
> >
> > Please mark the following required changes:
> >
> > 1) Add: cd rtems-qual/
> > After git clone and before git submodule init.
> >
> > 2) I am getting the following error on running git submodule update:
> >
> > richi@YouAreAmazing:~/rtems-qual$ git submodule update
> > Cloning into '/home/richi/rtems-qual/external/rsb'...
> > Cloning into '/home/richi/rtems-qual/external/rtems'...
> > Cloning into '/home/richi/rtems-qual/external/rtems-docs'...
> > Submodule path 'external/rsb': checked out
> > '9482a1b33b4c8552f6affa582664b4ac25f9cdf4'
> > error: Server does not allow request for unadvertised object
> > aaa638b1550e94b37df382474fe4785a6cc7d350
> > Fetched in submodule path 'external/rtems', but it did not contain
> > aaa638b1550e94b37df382474fe4785a6cc7d350. Direct fetching of that
> > commit failed.
> >
> > I don't understand this error.
>
> Sorry, I fixed this issue. Please do a:
>
> git pull
>
> git submodule init
>
> git submodule update
>
> make env
>
> >
> > 3) Is the space in ". env/bin/activate" intentional?
>
> Yes:
>
>
> https://unix.stackexchange.com/questions/114300/whats-the-meaning-of-a-dot-before-a-command-in-shell
>
> >
> > 4) I do not know how to use cite, Can i use it directly in the text
> field?
> Yes, just use :cite:`XYZ` in the text field.
> >
> > 5) When I run ./spec2doc.py, I get the following error:
> >
> > (env) richi@YouAreAmazing:~/rtems-qual$ ./spec2doc.py
> > Traceback (most recent call last):
> >File "./spec2doc.py", line 41, in 
> >  main()
> >File "./spec2doc.py", line 34, in main
> >  item_cache = rtemsqual.items.ItemCache(config["spec"])
> >File "/home/richi/rtems-qual/rtemsqual/items.py", line 331, in
> __init__
> >  self._load_items(config)
> >File "/home/richi/rtems-qual/rtemsqual/items.py", line 403, in
> _load_items
> >  self._load_items_recursive(path, path, cache_dir)
> >File "/home/richi/rtems-qual/rtemsqual/items.py", line 381, in
> > _load_items_recursive
> >  for name in os.listdir(path):
> > FileNotFoundError: [Errno 2] No such file or directory:
> 'external/rtems/spec'
> >
> > Is it because I messed something up in the strongapa.yml ?
> >
> > My /spec/glossary/strongapa.yml is :
> >
> > SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
> > copyrights:
> > - Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de
> )
> > enabled-by: true
> > glossary-type: term
> > links:
> > - role: glossary-member
> >uid: ../glossary-general
> > term: Strong APA
> > text:
>
> Maybe start with:
>
> Strong APA is a specialization of ${apa:/term}.
>
> >In this model, on the arrival of a task, every task reachable
>
> task -> thread
>
> For the first use of thread use: ${thread:/term}
>
> >from the newly arrived task is checked to see if an existing
> >task can be shifted(or deallocated its processor) and newly
> space before (
> >arrived task can take its place if the newly arrived task has
> >a higher priority. Similar analysis is done when a task
> >finishes its execution (Here task and thread have interchangeable
> >defintions).
> >:cite:`Cerqueira:2014:LPA`.
> > type: glossary
> >
> >
> >
> > Please tell me how to resolve this error.
> >
> > Thanks,
> > Richi.
> >
> > On Mon, Jun 8, 2020 at 1:13 PM Sebastian Huber
> >  wrote:
> >> On 07/06/2020 15:36, Sebastian Huber wrote:
> >>
> >>> On 06/06/2020 15:09, Richi Dubey wrote:
> >>>
>  Hii,
> 
>  Thanks for your review.
> 
> > The glossary is generated from specification items:
> >
> > https://git.rtems.org/sebh/rtems-qual.git/tree/spec/glos/term
> >
> > I will work on a documentation how this works in the next days.
>  Have you already submitted one? If yes, could you please send me the
>  link to it. If no, Do I need to wait and learn that before sending in
>  the new patch?
> >>> Yes, I sent a patch for the RTEMS Software Engineering manual:
> >>>
> >>> https://lists.rtems.org/pipermail/devel/2020-June/060036.html
> >>>
> >>> I will probably check it in tomorrow.
> >> I updated the documentation:
> >>
> >>
> https://docs.rtems.org/branches/master/eng/req/howto.html#getting-started
> >>
> >> Could you please try to add the new glossary terms using the method
> >> described in this how-to. You are some sort of a beta tester for this.
> >> If anything is unclear, then please complain immediately.
> >>
>
___
devel mailing list
devel@rtems.org

Re: Help in figuring out score objects in RTEMS and ticket #3131

2020-06-15 Thread Utkarsh Rai
With the help of Dr.Gedare and a bit of digging, I was able to understand
the file system design concept in RTEMS. This is what I was able to gather-

 > The object-oriented design of the file system refers to the fact that
the virtual file-system layer provides a framework upon which different
filesystems can be built.

> For example, the file_sytems_operations_table defines the various
operations required by a file system(mount, unmount, path evaluation), the
rtems_filesystem_file_handlers_r table defines the various functions(open,
write, read, etc.) that act on a node in a file-system also this is where
the mmap_h handler is defined.

>The file system defines its implementation of the above operations and
registers it in the corresponding table, whenever a system call is made,
the registered handler is invoked and changes to the file are done.

So my question is,  do we have to define the mmap_h in the IMFS file system
layer(as I could not find an implementation for this handler) and then
register it in the file_handlers table and then use this in mmap? Or do we
already have a generic mmap_h implementation that I can use?


On Thu, Jun 11, 2020 at 6:04 AM Utkarsh Rai  wrote:

> Hello,
> For my GSoC project, user-configurable thread stack protection, I need to
> track, allocate, and manipulate attributes of shared as well as protected
> stacks. Dr.Gedare suggested that tracking them with score objects would be
> a good idea. He also indicated a good place to start and understand
> score objects would be through this ticket.
> 
>
> From the information that I could find in docs, my understanding of score
> objects is that they are a type of directive that
> helps introduce modularity to RTEMS as various types of RTEMS objects like
> message queues, semaphores, etc. can use the same set of directives for
> allocation/deallocation and control of their object types.
>
> Some of the examples of the implementation that I could find used
> _Object_Iniitialize_information()
> to initialize the object type, then _Object_Allocate()/Free()
> allocate/de-allocate the object. Object_Id is used to control the object
> type. My confusion is, how do we use object IDs to refer to and control the
> allocated objects?
>
> I also have some confusion in the above-mentioned ticket, it says-
> 'The mmap_h handler should construct a mapping object. A destructor is
> currently missing. Maybe the mmap_h handler should use a flag to deal with
> construction and destruction.'
>  I am unclear as to how the mmap_h handler should precisely look like and
> where should it be defined?
> I would be grateful if you can provide some help in figuring this out.
>
> Regards,
> Utkarsh
>
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel