Re: [PATCH] bsps/raspberrypi/console: Fix default console device

2021-05-20 Thread Alan Cudmore
Hi Niteesh,
I tried your firmware, booting directly instead of using u-boot. I was
able to get the RTEMS 5 branch to run on the Raspberry Pi Zero, but I
still cannot get the master/6 branch to run. I need some time to do
additional tests. I was also going to re-try your patch and see if I
can run the master branch and your firmware with the Pi 3.

Our GSOC student just started a RPi improvement project, so I think
the first step should be to sort all of this out.
I'm pretty busy right now, but I'll see if I can continue testing in
the next few days. I want to try loading from u-boot next.

Alan


On Thu, May 20, 2021 at 12:52 AM Niteesh G. S.  wrote:
>
> ping.
>
> On Tue, May 11, 2021 at 1:09 AM Niteesh G. S.  wrote:
>>
>> Hello Gedare,
>>
>> On Mon, May 10, 2021 at 8:57 PM Gedare Bloom  wrote:
>>>
>>> On Thu, May 6, 2021 at 8:49 AM Niteesh G. S.  wrote:
>>> >
>>> > Hi Alan,
>>> >
>>> > On Thu, May 6, 2021 at 6:12 PM Alan Cudmore  
>>> > wrote:
>>> >>
>>> >> Hi Niteesh,
>>> >>
>>> >> I was hoping to try this out as soon as I get some time. No later than 
>>> >> weekend. So if nobody else is able to check it out, I will be able to 
>>> >> provide some feedback soon.
>>> >>
>>> >> I should be able to bring up the console on a RPi Zero W and RPi3, 
>>> >> correct?
>>> >
>>> > the consoles should work on Zero W and Pi3 by default. They only fail to 
>>> > work when  CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
>>> > this option is used. This is because when that option is used it calls 
>>> > console_initialize which checks if any boot options were present if none 
>>> > were
>>> > given it defaults to pl011 which is the secondary UART in Zero w and Pi3 
>>> > so we get no output. This patch defaults to the primary UART instead of
>>> > pl011 depending on the board.
>>> > Also, this patch should be applied on RTEMS 5 since we started supporting 
>>> > Pi3 and Zero w from RTEMS 5.
>>> >
>>> You'll need to provide a separate patch with a ticket to close on 5
>>> for a backport. Wait until you get the approval for the master branch
>>> though.
>>
>> OK. I'll create a ticket and request for a backport once this is pushed on
>> to the current master
>>
>> Thanks,
>> Niteesh.
>>>
>>>
>>> > Thanks,
>>> > Niteesh.
>>> >
>>> >
>>> >>
>>> >> Thanks,
>>> >>
>>> >> Alan
>>> >>
>>> >>
>>> >>
>>> >> From: Niteesh G. S.
>>> >> Sent: Thursday, May 6, 2021 4:29 AM
>>> >> To: Joel Sherrill; Christian Mauderer
>>> >> Cc: rtems-de...@rtems.org
>>> >> Subject: Re: [PATCH] bsps/raspberrypi/console: Fix default console device
>>> >>
>>> >>
>>> >>
>>> >> ping.
>>> >>
>>> >>
>>> >>
>>> >> On Sat, May 1, 2021 at 9:47 PM Niteesh G. S.  
>>> >> wrote:
>>> >>
>>> >> On Sat, May 1, 2021 at 8:31 PM Joel Sherrill  wrote:
>>> >>
>>> >>
>>> >>
>>> >> On Sat, May 1, 2021, 8:53 AM Niteesh G. S.  wrote:
>>> >>
>>> >> Just to provide more context,
>>> >>
>>> >> When the CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER option is used
>>> >>
>>> >> and no --console option is provided, the console driver defaults to 
>>> >> PL011.
>>> >>
>>> >> In raspberry pi 3 and other models whose primary UART is not PL011, we 
>>> >> get no output.
>>> >>
>>> >> This patch fixes that by linking the primary UART to the console device.
>>> >>
>>> >>
>>> >>
>>> >> Thanks,
>>> >>
>>> >> Niteesh
>>> >>
>>> >>
>>> >>
>>> >> On Sat, May 1, 2021 at 7:05 PM G S Niteesh Babu  
>>> >> wrote:
>>> >>
>>> >> When no console argument is given, the driver defaults to pl011
>>> >> this results in no output in case of Rpi3 whose primary uart is
>>> >> miniuart.
>>> >> This patch fixes that by defaulting to the primary uart when no
>>> >> console option is provided.
>>> >>
>>> >>
>>> >>
>>> >> Does the default need to vary by model?
>>> >>
>>> >> Yes, the primary UART is different across models.
>>> >>
>>> >>
>>> >>
>>> >> Rpi's have two UARTs PL011 and miniuart, on models which have Bluetooth
>>> >>
>>> >> the PL011 is used to talk to the Bluetooth and miniuart acts as the 
>>> >> primary UART.
>>> >>
>>> >> Now we can change this by adding miniuart-bt to config.txt but the 
>>> >> miniuart is
>>> >>
>>> >> based on the VPU core and requires to add another option which sets the 
>>> >> core to
>>> >>
>>> >> a fixed freq.
>>> >>
>>> >>
>>> >>
>>> >> ---
>>> >>  bsps/arm/raspberrypi/console/console-config.c | 12 +---
>>> >>  1 file changed, 9 insertions(+), 3 deletions(-)
>>> >>
>>> >> diff --git a/bsps/arm/raspberrypi/console/console-config.c 
>>> >> b/bsps/arm/raspberrypi/console/console-config.c
>>> >> index 6b8eb80aa4..bd3a8d34c2 100644
>>> >> --- a/bsps/arm/raspberrypi/console/console-config.c
>>> >> +++ b/bsps/arm/raspberrypi/console/console-config.c
>>> >> @@ -165,10 +165,16 @@ static void console_select( void )
>>> >>  }
>>> >>}else {
>>> >>  /**
>>> >> - * If no command line option was given, default to PL011.
>>> >> + * If no console option was given we default to the primary uarts.
>>> >> + * The initialization of the uart's and BSP_output_char is

RE: [PATCH v2] legacy nfs.c: Change filesystem utime_h handler to utimens_h

2021-05-20 Thread Ryan Long
ping

-Original Message-
From: Ryan Long  
Sent: Monday, May 3, 2021 1:41 PM
To: devel@rtems.org
Cc: Ryan Long 
Subject: [PATCH v2] legacy nfs.c: Change filesystem utime_h handler to utimens_h

Changed nfs_utime() to nfs_utimens(), changed the arguments to use a timespec 
array instead of individual variables for access and modified time.

Updates #4400
---
 nfsclient/src/nfs.c | 50 +-
 1 file changed, 25 insertions(+), 25 deletions(-)

diff --git a/nfsclient/src/nfs.c b/nfsclient/src/nfs.c index bc9a2c6..72fefb9 
100644
--- a/nfsclient/src/nfs.c
+++ b/nfsclient/src/nfs.c
@@ -2050,19 +2050,19 @@ static int nfs_rmnod(
return rv;
 }
 
-static int nfs_utime(
+static int nfs_utimens(
const rtems_filesystem_location_info_t  *pathloc, /* IN */
-   time_t   actime,  /* IN */
-   time_t   modtime  /* IN */
+   struct timespec  times[2] /* IN */
+
 )
 {
 sattr  arg;
 
/* TODO: add rtems EPOCH - UNIX EPOCH seconds */
-   arg.atime.seconds  = actime;
-   arg.atime.useconds = 0;
-   arg.mtime.seconds  = modtime;
-   arg.mtime.useconds = 0;
+   arg.atime.seconds  = times[0].tv_sec;
+   arg.atime.useconds = times[0].tv_nsec / 1000;
+   arg.mtime.seconds  = times[1].tv_sec;
+   arg.mtime.useconds = times[1].tv_nsec / 1000;
 
return nfs_sattr(pathloc->node_access, &arg, SATTR_ATIME | 
SATTR_MTIME);  }
@@ -2254,25 +2254,25 @@ sattr   arg;
 }
 
 const struct _rtems_filesystem_operations_table nfs_fs_ops = {
-   .lock_h = nfs_lock,
-   .unlock_h   = nfs_unlock,
-   .eval_path_h= nfs_eval_path,
-   .link_h = nfs_link,
+   .lock_h= nfs_lock,
+   .unlock_h  = nfs_unlock,
+   .eval_path_h   = nfs_eval_path,
+   .link_h= nfs_link,
.are_nodes_equal_h = nfs_are_nodes_equal,
-   .mknod_h= nfs_mknod,
-   .rmnod_h= nfs_rmnod,
-   .fchmod_h   = nfs_fchmod,
-   .chown_h= nfs_chown,
-   .clonenod_h = nfs_clonenode,
-   .freenod_h  = nfs_freenode,
-   .mount_h= rtems_filesystem_default_mount,
-   .unmount_h  = rtems_filesystem_default_unmount,
-   .fsunmount_me_h = nfs_fsunmount_me,
-   .utime_h= nfs_utime,
-   .symlink_h  = nfs_symlink,
-   .readlink_h = nfs_readlink,
-   .rename_h   = nfs_rename,
-   .statvfs_h  = rtems_filesystem_default_statvfs
+   .mknod_h   = nfs_mknod,
+   .rmnod_h   = nfs_rmnod,
+   .fchmod_h  = nfs_fchmod,
+   .chown_h   = nfs_chown,
+   .clonenod_h= nfs_clonenode,
+   .freenod_h = nfs_freenode,
+   .mount_h   = rtems_filesystem_default_mount,
+   .unmount_h = rtems_filesystem_default_unmount,
+   .fsunmount_me_h= nfs_fsunmount_me,
+   .utimens_h = nfs_utimens,
+   .symlink_h = nfs_symlink,
+   .readlink_h= nfs_readlink,
+   .rename_h  = nfs_rename,
+   .statvfs_h = rtems_filesystem_default_statvfs
 };
 
 /*
--
1.8.3.1

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


RE: [PATCH v2] libbsd nfs.c: Change filesystem utime_h handler to utimens_h

2021-05-20 Thread Ryan Long
ping

-Original Message-
From: Ryan Long  
Sent: Monday, May 3, 2021 1:41 PM
To: devel@rtems.org
Cc: Ryan Long 
Subject: [PATCH v2] libbsd nfs.c: Change filesystem utime_h handler to utimens_h

Changed nfs_utime() to nfs_utimens(), changed the arguments to use a timespec 
array instead of individual variables for access and modified time.

Updates #4400
---
 rtemsbsd/nfsclient/nfs.c | 50 
 1 file changed, 25 insertions(+), 25 deletions(-)

diff --git a/rtemsbsd/nfsclient/nfs.c b/rtemsbsd/nfsclient/nfs.c index 
3b8a592..baada6c 100644
--- a/rtemsbsd/nfsclient/nfs.c
+++ b/rtemsbsd/nfsclient/nfs.c
@@ -2058,19 +2058,19 @@ static int nfs_rmnod(
return rv;
 }
 
-static int nfs_utime(
+static int nfs_utimens(
const rtems_filesystem_location_info_t  *pathloc, /* IN */
-   time_t   actime,  /* IN */
-   time_t   modtime  /* IN */
+   struct timespec  times[2] /* IN */
+
 )
 {
 sattr  arg;
 
/* TODO: add rtems EPOCH - UNIX EPOCH seconds */
-   arg.atime.seconds  = actime;
-   arg.atime.useconds = 0;
-   arg.mtime.seconds  = modtime;
-   arg.mtime.useconds = 0;
+   arg.atime.seconds  = times[0].tv_sec;
+   arg.atime.useconds = times[0].tv_nsec / 1000;
+   arg.mtime.seconds  = times[1].tv_sec;
+   arg.mtime.useconds = times[1].tv_nsec / 1000;
 
return nfs_sattr(pathloc->node_access, &arg, SATTR_ATIME | 
SATTR_MTIME);  }
@@ -2262,25 +2262,25 @@ sattr   arg;
 }
 
 const struct _rtems_filesystem_operations_table nfs_fs_ops = {
-   .lock_h = nfs_lock,
-   .unlock_h   = nfs_unlock,
-   .eval_path_h= nfs_eval_path,
-   .link_h = nfs_link,
+   .lock_h= nfs_lock,
+   .unlock_h  = nfs_unlock,
+   .eval_path_h   = nfs_eval_path,
+   .link_h= nfs_link,
.are_nodes_equal_h = nfs_are_nodes_equal,
-   .mknod_h= nfs_mknod,
-   .rmnod_h= nfs_rmnod,
-   .fchmod_h   = nfs_fchmod,
-   .chown_h= nfs_chown,
-   .clonenod_h = nfs_clonenode,
-   .freenod_h  = nfs_freenode,
-   .mount_h= rtems_filesystem_default_mount,
-   .unmount_h  = rtems_filesystem_default_unmount,
-   .fsunmount_me_h = nfs_fsunmount_me,
-   .utime_h= nfs_utime,
-   .symlink_h  = nfs_symlink,
-   .readlink_h = nfs_readlink,
-   .rename_h   = nfs_rename,
-   .statvfs_h  = rtems_filesystem_default_statvfs
+   .mknod_h   = nfs_mknod,
+   .rmnod_h   = nfs_rmnod,
+   .fchmod_h  = nfs_fchmod,
+   .chown_h   = nfs_chown,
+   .clonenod_h= nfs_clonenode,
+   .freenod_h = nfs_freenode,
+   .mount_h   = rtems_filesystem_default_mount,
+   .unmount_h = rtems_filesystem_default_unmount,
+   .fsunmount_me_h= nfs_fsunmount_me,
+   .utimens_h = nfs_utimens,
+   .symlink_h = nfs_symlink,
+   .readlink_h= nfs_readlink,
+   .rename_h  = nfs_rename,
+   .statvfs_h = rtems_filesystem_default_statvfs
 };
 
 /*
--
1.8.3.1

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


[PATCH] sysconf: Removed sysconf(515)

2021-05-20 Thread Ryan Long
GCC originally needed this 20 years ago. No longer needed, so it
is being removed.

Closes #4391
---
 cpukit/posix/src/sysconf.c| 4 
 testsuites/psxtests/psxsysconf/init.c | 8 
 2 files changed, 12 deletions(-)

diff --git a/cpukit/posix/src/sysconf.c b/cpukit/posix/src/sysconf.c
index 1696ec5..439a27e 100644
--- a/cpukit/posix/src/sysconf.c
+++ b/cpukit/posix/src/sysconf.c
@@ -54,10 +54,6 @@ long sysconf(
   return (long) rtems_scheduler_get_processor_maximum();
 case _SC_POSIX_26_VERSION:
   return (long) _POSIX_26_VERSION;
-#if defined(__sparc__)
-case 515: /* Solaris _SC_STACK_PROT */
-  return 0;
-#endif
 default:
   rtems_set_errno_and_return_minus_one( EINVAL );
   }
diff --git a/testsuites/psxtests/psxsysconf/init.c 
b/testsuites/psxtests/psxsysconf/init.c
index a008af3..66d6dd3 100644
--- a/testsuites/psxtests/psxsysconf/init.c
+++ b/testsuites/psxtests/psxsysconf/init.c
@@ -83,14 +83,6 @@ void *POSIX_Init(
   == (long) rtems_scheduler_get_processor_maximum()
   );
 
-#if defined(__sparc__)
-  /* Solaris _SC_STACK_PROT - 515 */
-  sc = sysconf( _SC_PAGESIZE );
-  printf( "sysconf - (SPARC only) _SC_STACK_PROT=%ld\n", sc );
-  if ( sc == -1 )
-   rtems_test_exit(0);
-#endif
-
   TEST_END();
   rtems_test_exit( 0 );
 
-- 
1.8.3.1

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


Re: [PATCH] rtems-bsp-builder: Change to waf build system

2021-05-20 Thread Joel Sherrill
The BSP Builder builds multiple BSPs at the same time. At one point, I
thought waf had a problem with that. Has that been resolved.

Are the config files and build directories sufficiently unique
(BSP only isn't unique enough I think) for this to work with waf?

This is a step in the right direction but still might have issues with
concurrency. Just asking.

--joel

On Thu, May 20, 2021 at 12:13 AM Chris Johns  wrote:

> Looks fine (on my phone)
>
> Thanks for this
>
> > On 20 May 2021, at 1:25 am, Ryan Long  wrote:
> >
> > Closes #4124
> > ---
> > config/rtems-bsps.ini | 28 ++--
> > tester/rt/check.py| 35 ++-
> > 2 files changed, 40 insertions(+), 23 deletions(-)
> >
> > diff --git a/config/rtems-bsps.ini b/config/rtems-bsps.ini
> > index 93156fb..d5de667 100644
> > --- a/config/rtems-bsps.ini
> > +++ b/config/rtems-bsps.ini
> > @@ -156,23 +156,23 @@ smp-network-debug = config:base, config:smp,
> config:network, config:debug
> > #
> > # Base set of configure options every build needs.
> > #
> > -base = --target=@ARCH@-rtems@RTEMS_VERSION@
> > -   --enable-rtemsbsp=@BSP@
> > -   --prefix=@PREFIX@
> > +base = --prefix=@PREFIX@
> > +   --top=@RTEMS@
> > +   --rtems-config=config-@ARCH@-@BSP@-@BUILD@.ini
> > #
> > # Tests.
> > #
> > -tests = --enable-tests
> > +tests = BUILD_TESTS=True
> > #
> > # The options for each varations.
> > #
> > -debug = --enable-rtems-debug
> > -no-debug  = --disable-rtems-debug
> > -profiling = --enable-profiling
> > -no-profiling  = --disable-profiling
> > -smp   = --enable-smp
> > -no-smp= --disable-smp
> > -posix = --enable-posix
> > -no-posix  = --disable-posix
> > -network   = --enable-networking
> > -no-network= --disable-networking
> > +debug = RTEMS_DEBUG=True
> > +no-debug  = RTEMS_DEBUG=False
> > +profiling = RTEMS_PROFILING=True
> > +no-profiling  = RTEMS_PROFILING=False
> > +smp   = RTEMS_SMP=True
> > +no-smp= RTEMS_SMP=False
> > +posix = RTEMS_POSIX_API=True
> > +no-posix  = RTEMS_POSIX_API=False
> > +network   = RTEMS_NETWORKING=True
> > +no-network= RTEMS_NETWORKING=False
> > diff --git a/tester/rt/check.py b/tester/rt/check.py
> > index 2a38d99..95fa47e 100755
> > --- a/tester/rt/check.py
> > +++ b/tester/rt/check.py
> > @@ -906,7 +906,9 @@ class build_jobs:
> > remove += [b for b in self.builds if e in b.split('-')]
> > self.builds = [b for b in self.builds if b not in remove]
> > self.build_set = { }
> > -exclude_options = ' ' + config.exclude_options(self.arch,
> self.bsp)
> > +exclude_options = config.exclude_options(self.arch, self.bsp)
> > +if exclude_options != '':
> > +exclude_options = ' ' + exclude_options
> > for build in self.builds:
> > self.build_set[build] = config.build_options(build) +
> exclude_options
> >
> > @@ -938,9 +940,7 @@ class builder:
> >  'BSP' : '.*libbsp/.*',
> >  'LibCPU'  : '.*libcpu/.*',
> >  'Shared'  : '.*shared/.*' })
> > -if not path.exists(path.join(rtems, 'configure')) or \
> > -   not path.exists(path.join(rtems, 'Makefile.in')) or \
> > -   not path.exists(path.join(rtems, 'cpukit')):
> > +if not path.exists(path.join(rtems, 'waf')):
> > raise error.general('RTEMS source path does not look like
> RTEMS')
> >
> > def _bsps(self, arch):
> > @@ -952,15 +952,30 @@ class builder:
> > job_index = 1
> > for job in jobs:
> > tag = '%*d/%d' % (max_job_size, job_index, len(jobs))
> > +commands = self._commands(job, build_job_count)
> > +self._create_config(job, commands)
> > build_jobs += [arch_bsp_builder(self.results,
> > job,
> > -self._commands(job,
> build_job_count),
> > +commands,
> > self.build_dir,
> > tag)]
> > job_index += 1
> > set_max_build_label(build_jobs)
> > return build_jobs
> >
> > +def _create_config(self, job, commands):
> > +filename = 'config-%s-%s-%s.ini' % (job.arch, job.bsp,
> job.build)
> > +cfg_file = open(path.join(self.rtems, filename),'w+')
> > +cfg_file.write('[%s/%s]' + os.linsep() % (job.arch, job.bsp))
> > +new_cfg_cmds = []
> > +for option in commands['configure'].split():
> > +if 'waf' in option or '--' in option or 'configure' in
> option:
> > +new_cfg_cmds += [option]
> > +else:
> > +cfg_file.write(option + 

[PATCH v2] sysconf: Remove sysconf(515)

2021-05-20 Thread Ryan Long
GCC originally needed this 20 years ago. No longer needed, so it
is being removed.

Closes #4391
---
 cpukit/posix/src/sysconf.c| 4 
 testsuites/psxtests/psxsysconf/init.c | 8 
 2 files changed, 12 deletions(-)

diff --git a/cpukit/posix/src/sysconf.c b/cpukit/posix/src/sysconf.c
index 1696ec5..439a27e 100644
--- a/cpukit/posix/src/sysconf.c
+++ b/cpukit/posix/src/sysconf.c
@@ -54,10 +54,6 @@ long sysconf(
   return (long) rtems_scheduler_get_processor_maximum();
 case _SC_POSIX_26_VERSION:
   return (long) _POSIX_26_VERSION;
-#if defined(__sparc__)
-case 515: /* Solaris _SC_STACK_PROT */
-  return 0;
-#endif
 default:
   rtems_set_errno_and_return_minus_one( EINVAL );
   }
diff --git a/testsuites/psxtests/psxsysconf/init.c 
b/testsuites/psxtests/psxsysconf/init.c
index a008af3..66d6dd3 100644
--- a/testsuites/psxtests/psxsysconf/init.c
+++ b/testsuites/psxtests/psxsysconf/init.c
@@ -83,14 +83,6 @@ void *POSIX_Init(
   == (long) rtems_scheduler_get_processor_maximum()
   );
 
-#if defined(__sparc__)
-  /* Solaris _SC_STACK_PROT - 515 */
-  sc = sysconf( _SC_PAGESIZE );
-  printf( "sysconf - (SPARC only) _SC_STACK_PROT=%ld\n", sc );
-  if ( sc == -1 )
-   rtems_test_exit(0);
-#endif
-
   TEST_END();
   rtems_test_exit( 0 );
 
-- 
1.8.3.1

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


Writing code that takes time to run

2021-05-20 Thread Richi Dubey
Hi,

We are thinking of writing a piece of code that takes some time to run (it
would be amazing if it takes around 2 secs to run on hardware, but we would
be happy with something that takes a few milliseconds as well).

We tried writing this:

  for(int i = 0; i<1000; ++i){
  fib2 = fib0 + fib1;
  fib0 = fib1;
  fib1 = fib2;
  }

which takes few milliseconds when tested on qemu, but only takes few
microseconds on a real board. Do you have any suggestions of what else we
can do?

We want to write a code that is context switch safe (so, we can't simply
check the time before a loop, run an infinite loop that keeps checking
current time and stops after a few seconds - because this logic would fail
if there happens a context switch inside the loop and the task gets the
control back after a few seconds). We also don't want to do a wake_after()
since we want the task to be running on the cpu during the entire time (it
is okay if the task gets preempted due to a higher priority process), and
not voluntarily giving the control to some other task.

Any suggestions? The aim is to see the affect of a task getting removed
from the cpu due to task shifting by the newly arrived task (in strong apa
vs non task shifting scheduler).

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

Re: Writing code that takes time to run

2021-05-20 Thread Joel Sherrill
On Thu, May 20, 2021 at 9:54 AM Richi Dubey  wrote:

> Hi,
>
> We are thinking of writing a piece of code that takes some time to run (it
> would be amazing if it takes around 2 secs to run on hardware, but we would
> be happy with something that takes a few milliseconds as well).
>
> We tried writing this:
>
>   for(int i = 0; i<1000; ++i){
>   fib2 = fib0 + fib1;
>   fib0 = fib1;
>   fib1 = fib2;
>   }
>
> which takes few milliseconds when tested on qemu, but only takes few
> microseconds on a real board. Do you have any suggestions of what else we
> can do?
>
> We want to write a code that is context switch safe (so, we can't simply
> check the time before a loop, run an infinite loop that keeps checking
> current time and stops after a few seconds - because this logic would fail
> if there happens a context switch inside the loop and the task gets the
> control back after a few seconds). We also don't want to do a wake_after()
> since we want the task to be running on the cpu during the entire time (it
> is okay if the task gets preempted due to a higher priority process), and
> not voluntarily giving the control to some other task.
>

The crypt test takes a long time to run. You could lift cases from there
until you hit the time you want.

>
> Any suggestions? The aim is to see the affect of a task getting removed
> from the cpu due to task shifting by the newly arrived task (in strong apa
> vs non task shifting scheduler).
>
> Thank you.
> ___
> 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: Writing code that takes time to run

2021-05-20 Thread Jan.Sommer
Hi Richi,

You can checkout the T_busy functions here: 
https://git.rtems.org/rtems/tree/cpukit/include/rtems/test.h#n2390
uint_fast32_t T_get_one_clock_tick_busy(void) gives you the busy count for one 
tick.

You can then calculate the number of cycles you need to wait for you desired 
certain time and pass it to: void T_busy(uint_fast32_t)
This should give you comparably accurate results over different platforms.

Best regards,

Jan



From: devel  On Behalf Of Richi Dubey
Sent: Thursday, May 20, 2021 4:53 PM
To: rtems-de...@rtems.org 
Subject: Writing code that takes time to run

Hi,

We are thinking of writing a piece of code that takes some time to run (it 
would be amazing if it takes around 2 secs to run on hardware, but we would be 
happy with something that takes a few milliseconds as well).

We tried writing this:

  for(int i = 0; i<1000; ++i){
  fib2 = fib0 + fib1;
  fib0 = fib1;
  fib1 = fib2;
  }

which takes few milliseconds when tested on qemu, but only takes few 
microseconds on a real board. Do you have any suggestions of what else we can 
do?

We want to write a code that is context switch safe (so, we can't simply check 
the time before a loop, run an infinite loop that keeps checking current time 
and stops after a few seconds - because this logic would fail if there happens 
a context switch inside the loop and the task gets the control back after a few 
seconds). We also don't want to do a wake_after() since we want the task to be 
running on the cpu during the entire time (it is okay if the task gets 
preempted due to a higher priority process), and not voluntarily giving the 
control to some other task.

Any suggestions? The aim is to see the affect of a task getting removed from 
the cpu due to task shifting by the newly arrived task (in strong apa vs non 
task shifting scheduler).

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

[PATCH] score: Fix _Thread_Cancel()

2021-05-20 Thread Sebastian Huber
The _Thread_Cancel() (in contrast to _Thread_Restart() which used a
similar code block) may have produced ready threads with an active timer
in case the thread to cancel had its thread life protection enabled. The
problem was this code block:

Priority_Control priority;

_Thread_Add_life_change_request( the_thread );

if ( _Thread_Is_life_change_allowed( previous ) ) {
  _Thread_State_release( the_thread, &lock_context );

  _Thread_queue_Extract_with_proxy( the_thread );
  _Thread_Timer_remove( the_thread );
} else {
  _Thread_Clear_state_locked( the_thread, STATES_SUSPENDED );
  _Thread_State_release( the_thread, &lock_context );
}

priority = _Thread_Get_priority( executing );
_Thread_Raise_real_priority( the_thread, priority );
_Thread_Remove_life_change_request( the_thread );

The life change request should only be added/removed if a life change is
allowed (see _Thread_Restart()).  Add
_Thread_Consider_life_change_request() and use it in _Thread_Cancel()
and _Thread_Restart().

Close #4435.
---
 cpukit/score/src/threadrestart.c | 50 
 1 file changed, 25 insertions(+), 25 deletions(-)

diff --git a/cpukit/score/src/threadrestart.c b/cpukit/score/src/threadrestart.c
index 933faee61b..58fcd89159 100644
--- a/cpukit/score/src/threadrestart.c
+++ b/cpukit/score/src/threadrestart.c
@@ -403,6 +403,25 @@ static void _Thread_Set_exit_value(
   the_thread->Life.exit_value = exit_value;
 }
 
+static void _Thread_Consider_life_change_request(
+  Thread_Control*the_thread,
+  Thread_Life_state  previous,
+  ISR_lock_Context  *lock_context
+)
+{
+  if ( _Thread_Is_life_change_allowed( previous ) ) {
+_Thread_Add_life_change_request( the_thread );
+_Thread_State_release( the_thread, lock_context );
+
+_Thread_queue_Extract_with_proxy( the_thread );
+_Thread_Timer_remove( the_thread );
+_Thread_Remove_life_change_request( the_thread );
+  } else {
+_Thread_Clear_state_locked( the_thread, STATES_SUSPENDED );
+_Thread_State_release( the_thread, lock_context );
+  }
+}
+
 void _Thread_Cancel(
   Thread_Control *the_thread,
   Thread_Control *executing,
@@ -433,21 +452,13 @@ void _Thread_Cancel(
   } else {
 Priority_Control priority;
 
-_Thread_Add_life_change_request( the_thread );
-
-if ( _Thread_Is_life_change_allowed( previous ) ) {
-  _Thread_State_release( the_thread, &lock_context );
-
-  _Thread_queue_Extract_with_proxy( the_thread );
-  _Thread_Timer_remove( the_thread );
-} else {
-  _Thread_Clear_state_locked( the_thread, STATES_SUSPENDED );
-  _Thread_State_release( the_thread, &lock_context );
-}
-
+_Thread_Consider_life_change_request(
+  the_thread,
+  previous,
+  &lock_context
+);
 priority = _Thread_Get_priority( executing );
 _Thread_Raise_real_priority( the_thread, priority );
-_Thread_Remove_life_change_request( the_thread );
   }
 
   _Thread_Dispatch_enable( cpu_self );
@@ -559,18 +570,7 @@ Status_Control _Thread_Restart(
 THREAD_LIFE_RESTARTING,
 ignored_life_states
   );
-
-  if ( _Thread_Is_life_change_allowed( previous ) ) {
-_Thread_Add_life_change_request( the_thread );
-_Thread_State_release( the_thread, lock_context );
-
-_Thread_queue_Extract_with_proxy( the_thread );
-_Thread_Timer_remove( the_thread );
-_Thread_Remove_life_change_request( the_thread );
-  } else {
-_Thread_Clear_state_locked( the_thread, STATES_SUSPENDED );
-_Thread_State_release( the_thread, lock_context );
-  }
+  _Thread_Consider_life_change_request( the_thread, previous, lock_context );
 
   _Thread_queue_Context_initialize( &queue_context );
   _Thread_queue_Context_clear_priority_updates( &queue_context );
-- 
2.26.2

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


Re: Writing code that takes time to run

2021-05-20 Thread Joel Sherrill
On Thu, May 20, 2021 at 10:05 AM  wrote:

> Hi Richi,
>
>
>
> You can checkout the T_busy functions here:
> https://git.rtems.org/rtems/tree/cpukit/include/rtems/test.h#n2390
>
> uint_fast32_t T_get_one_clock_tick_busy(void) gives you the busy count
> for one tick.
>
>
>
> You can then calculate the number of cycles you need to wait for you
> desired certain time and pass it to: void T_busy(uint_fast32_t)
>
> This should give you comparably accurate results over different platforms.
>

That's certainly a better method than what I suggested.

--joel

>
>
> Best regards,
>
>
>
> Jan
>
>
>
>
>
>
>
> *From:* devel  *On Behalf Of *Richi Dubey
> *Sent:* Thursday, May 20, 2021 4:53 PM
> *To:* rtems-de...@rtems.org 
> *Subject:* Writing code that takes time to run
>
>
>
> Hi,
>
>
>
> We are thinking of writing a piece of code that takes some time to run (it
> would be amazing if it takes around 2 secs to run on hardware, but we would
> be happy with something that takes a few milliseconds as well).
>
>
>
> We tried writing this:
>
>
>
>   for(int i = 0; i<1000; ++i){
>   fib2 = fib0 + fib1;
>   fib0 = fib1;
>   fib1 = fib2;
>   }
>
>
>
> which takes few milliseconds when tested on qemu, but only takes few
> microseconds on a real board. Do you have any suggestions of what else we
> can do?
>
>
>
> We want to write a code that is context switch safe (so, we can't simply
> check the time before a loop, run an infinite loop that keeps checking
> current time and stops after a few seconds - because this logic would fail
> if there happens a context switch inside the loop and the task gets the
> control back after a few seconds). We also don't want to do a wake_after()
> since we want the task to be running on the cpu during the entire time (it
> is okay if the task gets preempted due to a higher priority process), and
> not voluntarily giving the control to some other task.
>
>
>
> Any suggestions? The aim is to see the affect of a task getting removed
> from the cpu due to task shifting by the newly arrived task (in strong apa
> vs non task shifting scheduler).
>
>
>
> Thank you.
> ___
> 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] score: Fix _Thread_Cancel()

2021-05-20 Thread Joel Sherrill
Is there a test case for this situation?

On Thu, May 20, 2021 at 10:18 AM Sebastian Huber <
sebastian.hu...@embedded-brains.de> wrote:

> The _Thread_Cancel() (in contrast to _Thread_Restart() which used a
> similar code block) may have produced ready threads with an active timer
> in case the thread to cancel had its thread life protection enabled. The
> problem was this code block:
>
> Priority_Control priority;
>
> _Thread_Add_life_change_request( the_thread );
>
> if ( _Thread_Is_life_change_allowed( previous ) ) {
>   _Thread_State_release( the_thread, &lock_context );
>
>   _Thread_queue_Extract_with_proxy( the_thread );
>   _Thread_Timer_remove( the_thread );
> } else {
>   _Thread_Clear_state_locked( the_thread, STATES_SUSPENDED );
>   _Thread_State_release( the_thread, &lock_context );
> }
>
> priority = _Thread_Get_priority( executing );
> _Thread_Raise_real_priority( the_thread, priority );
> _Thread_Remove_life_change_request( the_thread );
>
> The life change request should only be added/removed if a life change is
> allowed (see _Thread_Restart()).  Add
> _Thread_Consider_life_change_request() and use it in _Thread_Cancel()
> and _Thread_Restart().
>
> Close #4435.
> ---
>  cpukit/score/src/threadrestart.c | 50 
>  1 file changed, 25 insertions(+), 25 deletions(-)
>
> diff --git a/cpukit/score/src/threadrestart.c
> b/cpukit/score/src/threadrestart.c
> index 933faee61b..58fcd89159 100644
> --- a/cpukit/score/src/threadrestart.c
> +++ b/cpukit/score/src/threadrestart.c
> @@ -403,6 +403,25 @@ static void _Thread_Set_exit_value(
>the_thread->Life.exit_value = exit_value;
>  }
>
> +static void _Thread_Consider_life_change_request(
> +  Thread_Control*the_thread,
> +  Thread_Life_state  previous,
> +  ISR_lock_Context  *lock_context
> +)
> +{
> +  if ( _Thread_Is_life_change_allowed( previous ) ) {
> +_Thread_Add_life_change_request( the_thread );
> +_Thread_State_release( the_thread, lock_context );
> +
> +_Thread_queue_Extract_with_proxy( the_thread );
> +_Thread_Timer_remove( the_thread );
> +_Thread_Remove_life_change_request( the_thread );
> +  } else {
> +_Thread_Clear_state_locked( the_thread, STATES_SUSPENDED );
> +_Thread_State_release( the_thread, lock_context );
> +  }
> +}
> +
>  void _Thread_Cancel(
>Thread_Control *the_thread,
>Thread_Control *executing,
> @@ -433,21 +452,13 @@ void _Thread_Cancel(
>} else {
>  Priority_Control priority;
>
> -_Thread_Add_life_change_request( the_thread );
> -
> -if ( _Thread_Is_life_change_allowed( previous ) ) {
> -  _Thread_State_release( the_thread, &lock_context );
> -
> -  _Thread_queue_Extract_with_proxy( the_thread );
> -  _Thread_Timer_remove( the_thread );
> -} else {
> -  _Thread_Clear_state_locked( the_thread, STATES_SUSPENDED );
> -  _Thread_State_release( the_thread, &lock_context );
> -}
> -
> +_Thread_Consider_life_change_request(
> +  the_thread,
> +  previous,
> +  &lock_context
> +);
>  priority = _Thread_Get_priority( executing );
>  _Thread_Raise_real_priority( the_thread, priority );
> -_Thread_Remove_life_change_request( the_thread );
>}
>
>_Thread_Dispatch_enable( cpu_self );
> @@ -559,18 +570,7 @@ Status_Control _Thread_Restart(
>  THREAD_LIFE_RESTARTING,
>  ignored_life_states
>);
> -
> -  if ( _Thread_Is_life_change_allowed( previous ) ) {
> -_Thread_Add_life_change_request( the_thread );
> -_Thread_State_release( the_thread, lock_context );
> -
> -_Thread_queue_Extract_with_proxy( the_thread );
> -_Thread_Timer_remove( the_thread );
> -_Thread_Remove_life_change_request( the_thread );
> -  } else {
> -_Thread_Clear_state_locked( the_thread, STATES_SUSPENDED );
> -_Thread_State_release( the_thread, lock_context );
> -  }
> +  _Thread_Consider_life_change_request( the_thread, previous,
> lock_context );
>
>_Thread_queue_Context_initialize( &queue_context );
>_Thread_queue_Context_clear_priority_updates( &queue_context );
> --
> 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] score: Fix _Thread_Cancel()

2021-05-20 Thread Sebastian Huber

On 20/05/2021 17:30, Joel Sherrill wrote:

Is there a test case for this situation?


Not in the current test suite. I write currently the specification for 
rtems_task_restart() and the validation tests. My plan is to start with 
the integration of the new validation test suites after they are 
finished in Q3 this year.


--
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] score: Fix _Thread_Cancel()

2021-05-20 Thread Joel Sherrill
On Thu, May 20, 2021, 10:33 AM Sebastian Huber <
sebastian.hu...@embedded-brains.de> wrote:

> On 20/05/2021 17:30, Joel Sherrill wrote:
> > Is there a test case for this situation?
>
> Not in the current test suite. I write currently the specification for
> rtems_task_restart() and the validation tests. My plan is to start with
> the integration of the new validation test suites after they are
> finished in Q3 this year.
>

Ok.

Fwiw there are a number of places where score coverage is missing a d needs
attention

>
> --
> 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] score: Fix _Thread_Cancel()

2021-05-20 Thread Sebastian Huber

On 20/05/2021 17:35, Joel Sherrill wrote:



On Thu, May 20, 2021, 10:33 AM Sebastian Huber 
> wrote:


On 20/05/2021 17:30, Joel Sherrill wrote:
 > Is there a test case for this situation?

Not in the current test suite. I write currently the specification for
rtems_task_restart() and the validation tests. My plan is to start with
the integration of the new validation test suites after they are
finished in Q3 this year.


Ok.

Fwiw there are a number of places where score coverage is missing a d 
needs attention


The table based specification approach covers a lot of cases and paths 
through the code. I think we will get MC/DC at source code level (not 
binary code level) for most functions (maybe except some thread queue 
code). For example, the rtems_task_restart() work in progress table 
looks currently like this:


Status = Ok, FatalError = Nop, Argument = Set, Scheduler = Nop, 
RestartExtensions = Yes


* Id = Executing, Dormant = No, Suspended = No, Restarting = { Yes, 
No }, Terminating = { No, Yes }, Protected = { Yes, No }, Context = 
Task, State = Ready, Timer = Inactive, RealPriority = Initial, 
ThreadDispatch = Enabled


Status = Ok, FatalError = Nop, Argument = Set, Scheduler = 
UpdatePriority, RestartExtensions = Yes


* Id = Executing, Dormant = No, Suspended = No, Restarting = { Yes, 
No }, Terminating = { No, Yes }, Protected = { Yes, No }, Context = 
Task, State = Ready, Timer = Inactive, RealPriority = Changed, 
ThreadDispatch = Enabled


Status = Ok, FatalError = Nop, Argument = Set, Scheduler = Unblock, 
RestartExtensions = Yes


* Id = Executing, Dormant = No, Suspended = Yes, Restarting = { 
Yes, No }, Terminating = { No, Yes }, Protected = { Yes, No }, Context = 
Task, State = Ready, Timer = Inactive, RealPriority = Initial, 
ThreadDispatch = Enabled


Status = Ok, FatalError = Nop, Argument = Set, Scheduler = 
UnblockUpdatePriority, RestartExtensions = Yes


* Id = Executing, Dormant = No, Suspended = Yes, Restarting = { 
Yes, No }, Terminating = { No, Yes }, Protected = { Yes, No }, Context = 
Task, State = Ready, Timer = Inactive, RealPriority = Changed, 
ThreadDispatch = Enabled


Status = NA, FatalError = Yes, Argument = NA, Scheduler = Nop, 
RestartExtensions = Nop


* Id = Executing, Dormant = No, Suspended = { No, Yes }, Restarting 
= { Yes, No }, Terminating = { No, Yes }, Protected = { Yes, No }, 
Context = Task, State = Ready, Timer = Inactive, RealPriority = { 
Initial, Changed }, ThreadDispatch = Disabled


Status = Ok, FatalError = Nop, Argument = Set, Scheduler = Nop, 
RestartExtensions = Nop


* Id = { Other, Executing }, Dormant = No, Suspended = No, 
Restarting = { Yes, No }, Terminating = { No, Yes }, Protected = { Yes, 
No }, Context = Interrupt, State = { Enqueued, Blocked }, Timer = { 
Active, Inactive }, RealPriority = Initial, ThreadDispatch = Disabled


* Id = { Other, Executing }, Dormant = No, Suspended = No, 
Restarting = { Yes, No }, Terminating = { No, Yes }, Protected = { Yes, 
No }, Context = Interrupt, State = Ready, Timer = Inactive, RealPriority 
= Initial, ThreadDispatch = Disabled


* Id = Other, Dormant = No, Suspended = No, Restarting = { Yes, No 
}, Terminating = { No, Yes }, Protected = { Yes, No }, Context = Task, 
State = { Enqueued, Blocked }, Timer = { Active, Inactive }, 
RealPriority = Initial, ThreadDispatch = { Enabled, Disabled }


* Id = Other, Dormant = No, Suspended = No, Restarting = { Yes, No 
}, Terminating = { No, Yes }, Protected = { Yes, No }, Context = Task, 
State = Ready, Timer = Inactive, RealPriority = Initial, ThreadDispatch 
= { Enabled, Disabled }


Status = Ok, FatalError = Nop, Argument = Set, Scheduler = 
UpdatePriority, RestartExtensions = Nop


* Id = { Other, Executing }, Dormant = No, Suspended = No, 
Restarting = { Yes, No }, Terminating = { No, Yes }, Protected = { Yes, 
No }, Context = Interrupt, State = { Enqueued, Blocked }, Timer = { 
Active, Inactive }, RealPriority = Changed, ThreadDispatch = Disabled


* Id = { Other, Executing }, Dormant = No, Suspended = No, 
Restarting = { Yes, No }, Terminating = { No, Yes }, Protected = { Yes, 
No }, Context = Interrupt, State = Ready, Timer = Inactive, RealPriority 
= Changed, ThreadDispatch = Disabled


* Id = Other, Dormant = No, Suspended = No, Restarting = { Yes, No 
}, Terminating = { No, Yes }, Protected = { Yes, No }, Context = Task, 
State = { Enqueued, Blocked }, Timer = { Active, Inactive }, 
RealPriority = Changed, ThreadDispatch = { Enabled, Disabled }


* Id = Other, Dormant = No, Suspended = No, Restarting = { Yes, No 
}, Terminating = { No, Yes }, Protected = { Yes, No }, Context = Task, 
State = Ready, Timer = Inactive, RealPriority = Changed, ThreadDispatch 
= { Enabled, Disabled }


Status = Ok, FatalError = Nop, Argument = Set, Scheduler = Unblock, 
RestartExtensions = Nop


* Id = { Other, Executing }, Dormant = No, Su

RTEMS Documentation build problem

2021-05-20 Thread Jeff Mayes
Hi all,

I'm trying to build the RTEMS Documentation, but having a problem with 
sphinxcontrib-bibtex.  It's been a long time since I've tried this, so maybe 
there's a configuration problem on my end.  Anyway, I've pulled down the 
rtems-docs repo and tried to follow the instructions in the README.  
Installation of all the tools seems good, but running waf configure fails.

Thanks in advance for any advice.
Jeff

$ ./waf configure -v --pdf --singlehtml --prefix=/home/mayes/Documents/rtems
...
...
Checking for 'sphinxcontrib.bibtex'  : 11:18:46 runner ' 
/home/mayes/sphinx/bin/sphinx-build -b html -D extensions=sphinxcontrib.bibtex 
-c . . out '
not found (see README.txt)
The configuration failed
(complete log in /home/mayes/rtems-docs/build/config.log)


Here's the relevant output from the build/config.log file:

Checking for 'sphinxcontrib.bibtex'
[1/1] Processing 
^[[01;34mbuild/.conf_check_4f991dacd3d42895f236eb1da8e20c9e/testbuild/contents.rst^[[0m

/home/mayes/sphinx/bin/sphinx-build -b html -D extensions=sphinxcontrib.bibtex 
-c . . out
out: Running Sphinx v4.0.2
making output directory... done
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 1 source files that are out of date
updating environment: [new config] 1 added, 0 changed, 0 removed
reading sources... [100%] contents


err: WARNING: could not open bibtex file 
/home/mayes/rtems-docs/build/.conf_check_4f991dacd3d42895f236eb1da8e20c9e/testbuild/refs.bib.
WARNING: Since v2.0, Sphinx uses "index" as root_doc by default. Please add 
"root_doc = 'contents'" to your conf.py.

Extension error (sphinxcontrib.bibtex.domain):
Handler  for event 'env-updated' threw 
an exception (exception: 'index')

from /home/mayes/rtems-docs/user: Test does not build: Traceback (most recent 
call last):
  File 
"/home/mayes/rtems-docs/.waf3-2.0.19-1f3c580272b15a03d2566843c5fe872a/waflib/Configure.py",
 line 333, in run_build
bld.compile()
  File 
"/home/mayes/rtems-docs/.waf3-2.0.19-1f3c580272b15a03d2566843c5fe872a/waflib/Tools/errcheck.py",
 line 140, in check_compile
ret=self.orig_compile()
  File 
"/home/mayes/rtems-docs/.waf3-2.0.19-1f3c580272b15a03d2566843c5fe872a/waflib/Build.py",
 line 176, in compile
raise Errors.BuildError(self.producer.error)
waflib.Errors.BuildError: Build failed
-> task in '' failed with exit status 2:
{task 140180890500232: ${BIN_SPHINX_BUILD} -b html -D 
extensions=sphinxcontrib.bibtex -c . . out contents.rst -> }
' /home/mayes/sphinx/bin/sphinx-build -b html -D 
extensions=sphinxcontrib.bibtex -c . . out '

not found (see README.txt)
from /home/mayes/rtems-docs/user: The configuration failed
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH 0/3] Thread exit/cancel changes

2021-05-20 Thread Sebastian Huber

Hello,

this patch set probably got lost in all the e-mails. I work currently on 
the thread exit/cancel specification and would like to specify this 
behaviour.


On 17/05/2021 15:06, Sebastian Huber wrote:

Sebastian Huber (3):
   rtems: Return RTEMS_CALLED_FROM_ISR
   score: Simplify calling _Thread_Exit()
   posix: Allow pthread_cancel() from within ISRs

  cpukit/include/rtems/score/threadimpl.h | 13 +++--
  cpukit/posix/src/cancel.c   | 25 -
  cpukit/posix/src/pthreadexit.c  | 11 +---
  cpukit/rtems/src/taskdelete.c   | 20 +++
  cpukit/rtems/src/taskexit.c | 15 +-
  cpukit/score/src/threadrestart.c| 15 --
  testsuites/psxtests/psxcancel01/init.c  | 72 ++---
  7 files changed, 80 insertions(+), 91 deletions(-)



--
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] score: Fix _Thread_Cancel()

2021-05-20 Thread Gedare Bloom
On Thu, May 20, 2021 at 9:18 AM Sebastian Huber
 wrote:
>
> The _Thread_Cancel() (in contrast to _Thread_Restart() which used a
> similar code block) may have produced ready threads with an active timer
> in case the thread to cancel had its thread life protection enabled. The
> problem was this code block:
>
> Priority_Control priority;
>
> _Thread_Add_life_change_request( the_thread );
>
> if ( _Thread_Is_life_change_allowed( previous ) ) {
>   _Thread_State_release( the_thread, &lock_context );
>
>   _Thread_queue_Extract_with_proxy( the_thread );
>   _Thread_Timer_remove( the_thread );
> } else {
>   _Thread_Clear_state_locked( the_thread, STATES_SUSPENDED );
>   _Thread_State_release( the_thread, &lock_context );
> }
>
> priority = _Thread_Get_priority( executing );
> _Thread_Raise_real_priority( the_thread, priority );
> _Thread_Remove_life_change_request( the_thread );
>
> The life change request should only be added/removed if a life change is
> allowed (see _Thread_Restart()).  Add
> _Thread_Consider_life_change_request() and use it in _Thread_Cancel()
> and _Thread_Restart().
>
> Close #4435.
> ---
>  cpukit/score/src/threadrestart.c | 50 
>  1 file changed, 25 insertions(+), 25 deletions(-)
>
> diff --git a/cpukit/score/src/threadrestart.c 
> b/cpukit/score/src/threadrestart.c
> index 933faee61b..58fcd89159 100644
> --- a/cpukit/score/src/threadrestart.c
> +++ b/cpukit/score/src/threadrestart.c
> @@ -403,6 +403,25 @@ static void _Thread_Set_exit_value(
>the_thread->Life.exit_value = exit_value;
>  }
>
> +static void _Thread_Consider_life_change_request(

Minor, I'd prefer "_Thread_Try_life_change_request("

> +  Thread_Control*the_thread,
> +  Thread_Life_state  previous,
> +  ISR_lock_Context  *lock_context
> +)
> +{
> +  if ( _Thread_Is_life_change_allowed( previous ) ) {
> +_Thread_Add_life_change_request( the_thread );
> +_Thread_State_release( the_thread, lock_context );
> +
> +_Thread_queue_Extract_with_proxy( the_thread );
> +_Thread_Timer_remove( the_thread );
> +_Thread_Remove_life_change_request( the_thread );
> +  } else {
> +_Thread_Clear_state_locked( the_thread, STATES_SUSPENDED );
> +_Thread_State_release( the_thread, lock_context );
> +  }
> +}
> +
>  void _Thread_Cancel(
>Thread_Control *the_thread,
>Thread_Control *executing,
> @@ -433,21 +452,13 @@ void _Thread_Cancel(
>} else {
>  Priority_Control priority;
>
> -_Thread_Add_life_change_request( the_thread );
> -
> -if ( _Thread_Is_life_change_allowed( previous ) ) {
> -  _Thread_State_release( the_thread, &lock_context );
> -
> -  _Thread_queue_Extract_with_proxy( the_thread );
> -  _Thread_Timer_remove( the_thread );
> -} else {
> -  _Thread_Clear_state_locked( the_thread, STATES_SUSPENDED );
> -  _Thread_State_release( the_thread, &lock_context );
> -}
> -
> +_Thread_Consider_life_change_request(
> +  the_thread,
> +  previous,
> +  &lock_context
> +);
>  priority = _Thread_Get_priority( executing );
>  _Thread_Raise_real_priority( the_thread, priority );
> -_Thread_Remove_life_change_request( the_thread );
>}
>
>_Thread_Dispatch_enable( cpu_self );
> @@ -559,18 +570,7 @@ Status_Control _Thread_Restart(
>  THREAD_LIFE_RESTARTING,
>  ignored_life_states
>);
> -
> -  if ( _Thread_Is_life_change_allowed( previous ) ) {
> -_Thread_Add_life_change_request( the_thread );
> -_Thread_State_release( the_thread, lock_context );
> -
> -_Thread_queue_Extract_with_proxy( the_thread );
> -_Thread_Timer_remove( the_thread );
> -_Thread_Remove_life_change_request( the_thread );
> -  } else {
> -_Thread_Clear_state_locked( the_thread, STATES_SUSPENDED );
> -_Thread_State_release( the_thread, lock_context );
> -  }
> +  _Thread_Consider_life_change_request( the_thread, previous, lock_context );
>
>_Thread_queue_Context_initialize( &queue_context );
>_Thread_queue_Context_clear_priority_updates( &queue_context );
> --
> 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 1/2] Fix the linux specific include

2021-05-20 Thread chrisj
From: Chris Johns 

---
 common/latex.py | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/common/latex.py b/common/latex.py
index a1b3917..17d3015 100644
--- a/common/latex.py
+++ b/common/latex.py
@@ -4,10 +4,6 @@
 
 import os
 import re
-try:
-from distro import linux_distribution
-except:
-from platform import linux_distribution
 
 package_test_preamble = ['\\newif\\ifsphinxKeepOldNames 
\\sphinxKeepOldNamestrue',
  '\documentclass[a4paper,11pt,english]{report}']
@@ -85,6 +81,10 @@ def tex_test(test):
 def host_name():
 uname = os.uname()
 if uname[0] == 'Linux':
+try:
+from distro import linux_distribution
+except:
+from platform import linux_distribution
 distro = linux_distribution()
 name = '%s/%s' % (uname[0], distro[0])
 version = distro[1]
-- 
2.24.3 (Apple Git-128)

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


[PATCH 2/2] Fix the bibtex extension configure test

2021-05-20 Thread chrisj
From: Chris Johns 

---
 common/waf.py | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/common/waf.py b/common/waf.py
index 3806209..fa9aecb 100644
--- a/common/waf.py
+++ b/common/waf.py
@@ -181,10 +181,12 @@ def check_sphinx_extension(ctx, extension):
 def run_sphinx(bld):
 rst_node = bld.srcnode.make_node('testbuild/contents.rst')
 rst_node.parent.mkdir()
-rst_node.write('.. COMMENT test sphinx\n')
+rst_node.write('.. COMMENT test sphinx' + os.linesep)
 bib_node = bld.srcnode.make_node('testbuild/refs.bib')
+bib_node.write(os.linesep)
 conf_node = bld.srcnode.make_node('testbuild/conf.py')
-conf_node.write("bibtex_bibfiles = ['refs.bib']\n")
+conf_node.write(os.linesep.join(["master_doc='contents'",
+ "bibtex_bibfiles = ['refs.bib']"]))
 bld(rule = bld.kw['rule'], source = rst_node)
 
 ctx.start_msg("Checking for '%s'" % (extension))
-- 
2.24.3 (Apple Git-128)

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


Re: RTEMS Documentation build problem

2021-05-20 Thread Chris Johns
On 21/5/21 4:28 am, Jeff Mayes wrote:
> I’m trying to build the RTEMS Documentation, but having a problem with
> sphinxcontrib-bibtex.  It’s been a long time since I’ve tried this, so maybe
> there’s a configuration problem on my end.  Anyway, I’ve pulled down the
> rtems-docs repo and tried to follow the instructions in the README. 
> Installation of all the tools seems good, but running waf configure fails.

Please apply ...

https://lists.rtems.org/pipermail/devel/2021-May/067386.html
https://lists.rtems.org/pipermail/devel/2021-May/067387.html

And if this works let me know and I will push them to master.

I tripped over a problem on MacOS building the doco with python3 venv and the
latest from pip. These changes let me build the html dooc.

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


RE: RTEMS Documentation build problem

2021-05-20 Thread Jeff Mayes
Patches applied and yes indeed that fixed it.  I'm on CentOS 7.
Thank you Chris!
Jeff


>-Original Message-
>From: Chris Johns 
>Sent: Thursday, May 20, 2021 5:18 PM
>To: Jeff Mayes ; devel@rtems.org
>Subject: Re: RTEMS Documentation build problem
>
>On 21/5/21 4:28 am, Jeff Mayes wrote:
>> I'm trying to build the RTEMS Documentation, but having a problem with
>> sphinxcontrib-bibtex.  It's been a long time since I've tried this, so
>> maybe there's a configuration problem on my end.  Anyway, I've pulled
>> down the rtems-docs repo and tried to follow the instructions in the
>README.
>> Installation of all the tools seems good, but running waf configure fails.
>
>Please apply ...
>
>https://lists.rtems.org/pipermail/devel/2021-May/067386.html
>https://lists.rtems.org/pipermail/devel/2021-May/067387.html
>
>And if this works let me know and I will push them to master.
>
>I tripped over a problem on MacOS building the doco with python3 venv and
>the latest from pip. These changes let me build the html dooc.
>
>Chris
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH rtems 1/2] telnetd.c: Remove RTEMS_NETWORKING check

2021-05-20 Thread Vijay Kumar Banerjee
Hi,


On Thu, Apr 22, 2021 at 12:21 PM Gedare Bloom  wrote:
>
> I guess there's not much else to do here without a network stack API
> to manipulate the network task(s).
>
> Is there a ticket to fix the lack of ability to configure and access
> network task priorities? I'm guessing libbsd and lwip will both need
> to figure out how to do this somehow. The design isn't obvious to me
> right now.
>

I somehow missed this before.
I raised a ticket: https://devel.rtems.org/ticket/4436
Is this ok to be pushed with this ticked number mentioned in the comment?


Best regards,
Vijay

> On Thu, Apr 22, 2021 at 12:07 PM Vijay Kumar Banerjee  wrote:
> >
> > Ping :)
> >
> > On Tue, Apr 13, 2021 at 11:45 PM Vijay Kumar Banerjee  
> > wrote:
> > >
> > > Set the priority manually to make telnetd compatible with the
> > > ---
> > >  cpukit/telnetd/telnetd.c | 11 +--
> > >  1 file changed, 1 insertion(+), 10 deletions(-)
> > >
> > > diff --git a/cpukit/telnetd/telnetd.c b/cpukit/telnetd/telnetd.c
> > > index b8adec297a..7dad2f2f92 100644
> > > --- a/cpukit/telnetd/telnetd.c
> > > +++ b/cpukit/telnetd/telnetd.c
> > > @@ -58,10 +58,6 @@
> > >  #include 
> > >  #include 
> > >
> > > -#ifdef RTEMS_NETWORKING
> > > -#include 
> > > -#endif
> > > -
> > >  #define TELNETD_EVENT_SUCCESS RTEMS_EVENT_0
> > >
> > >  #define TELNETD_EVENT_ERROR RTEMS_EVENT_1
> > > @@ -400,12 +396,7 @@ rtems_status_code rtems_telnetd_start(const 
> > > rtems_telnetd_config_table* config)
> > >ctx->server_socket = -1;
> > >LIST_INIT(&ctx->free_sessions);
> > >
> > > -  /* Check priority */
> > > -#ifdef RTEMS_NETWORKING
> > > -  if (ctx->config.priority == 0) {
> > > -ctx->config.priority = rtems_bsdnet_config.network_task_priority;
> > > -  }
> > > -#endif
> > > +  /* Set priority */
> > >if (ctx->config.priority == 0) {
> > >  ctx->config.priority = 100;
> > >}
> > > --
> > > 2.26.2
> > >
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH rtems v2] testsuites: Remove telnetd01

2021-05-20 Thread Vijay Kumar Banerjee
Hi,

In the last review, the commit message wasn't clear, I fixed it in this version.
Does this look Ok to be merged?

Best regards,
Vijay

On Thu, Apr 22, 2021 at 8:02 PM Vijay Kumar Banerjee  wrote:
>
> telnetd01 test cannot be run without a network stack, so this test is being
> moved to the rtems-net-legacy repository.
> ---
>  spec/build/testsuites/libtests/grp.yml   |   2 -
>  spec/build/testsuites/libtests/telnetd01.yml |  22 
>  testsuites/libtests/telnetd01/init.c | 120 ---
>  testsuites/libtests/telnetd01/telnetd01.doc  |  24 
>  testsuites/libtests/telnetd01/telnetd01.scn  |  11 --
>  5 files changed, 179 deletions(-)
>  delete mode 100644 spec/build/testsuites/libtests/telnetd01.yml
>  delete mode 100644 testsuites/libtests/telnetd01/init.c
>  delete mode 100644 testsuites/libtests/telnetd01/telnetd01.doc
>  delete mode 100644 testsuites/libtests/telnetd01/telnetd01.scn
>
> diff --git a/spec/build/testsuites/libtests/grp.yml 
> b/spec/build/testsuites/libtests/grp.yml
> index 5695fc7f06..20a593a5d3 100644
> --- a/spec/build/testsuites/libtests/grp.yml
> +++ b/spec/build/testsuites/libtests/grp.yml
> @@ -258,8 +258,6 @@ links:
>uid: tar02
>  - role: build-dependency
>uid: tar03
> -- role: build-dependency
> -  uid: telnetd01
>  - role: build-dependency
>uid: termios
>  - role: build-dependency
> diff --git a/spec/build/testsuites/libtests/telnetd01.yml 
> b/spec/build/testsuites/libtests/telnetd01.yml
> deleted file mode 100644
> index 9f5bda84d9..00
> --- a/spec/build/testsuites/libtests/telnetd01.yml
> +++ /dev/null
> @@ -1,22 +0,0 @@
> -SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
> -build-type: test-program
> -cflags: []
> -copyrights:
> -- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
> -cppflags: []
> -cxxflags: []
> -enabled-by:
> -- RTEMS_NETWORKING
> -features: c cprogram
> -includes:
> -- cpukit/libnetworking
> -ldflags: []
> -links: []
> -source:
> -- testsuites/libtests/telnetd01/init.c
> -stlib: []
> -target: testsuites/libtests/telnetd01.exe
> -type: build
> -use-after:
> -- telnetd
> -use-before: []
> diff --git a/testsuites/libtests/telnetd01/init.c 
> b/testsuites/libtests/telnetd01/init.c
> deleted file mode 100644
> index a17126bf41..00
> --- a/testsuites/libtests/telnetd01/init.c
> +++ /dev/null
> @@ -1,120 +0,0 @@
> -/*
> - * Copyright (c) 2018 embedded brains GmbH.  All rights reserved.
> - *
> - *  embedded brains GmbH
> - *  Dornierstr. 4
> - *  82178 Puchheim
> - *  Germany
> - *  
> - *
> - * 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.
> - */
> -
> -#ifdef HAVE_CONFIG_H
> -#include "config.h"
> -#endif
> -
> -#include 
> -#include 
> -#include 
> -
> -#include 
> -#include 
> -#include 
> -
> -#include 
> -
> -const char rtems_test_name[] = "TELNETD 1";
> -
> -struct rtems_bsdnet_config rtems_bsdnet_config;
> -
> -static void command(char *device_name, void *arg)
> -{
> -}
> -
> -static void test_command_null(void)
> -{
> -  static const rtems_telnetd_config_table config = {
> -.command = NULL
> -  };
> -  rtems_status_code sc;
> -
> -  sc = rtems_telnetd_start(&config);
> -  rtems_test_assert(sc == RTEMS_INVALID_ADDRESS);
> -}
> -
> -static void test_cannot_start_server_task(void)
> -{
> -  static const rtems_telnetd_config_table config = {
> -.command = command,
> -.priority = UINT32_MAX
> -  };
> -  rtems_status_code sc;
> -
> -  sc = rtems_telnetd_start(&config);
> -  rtems_test_assert(sc == RTEMS_UNSATISFIED);
> -}
> -
> -static void test_successful_start(void)
> -{
> -  static const rtems_telnetd_config_table config = {
> -.command = command,
> -.stack_size = RTEMS_MINIMUM_STACK_SIZE
> -  };
> -  rtems_status_code sc;
> -
> -  sc = rtems_telnetd_start(&config);
> -  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
> -}
> -
> -static void test_already_started(void)
> -{
> -  static const rtems_telnetd_config_table config = {
> -.command = command
> -  };
> -  rtems_status_code sc;
> -
> -  sc = rtems_telnetd_start(&config);
> -  rtems_test_assert(sc == RTEMS_RESOURCE_IN_USE);
> -}
> -
> -static rtems_task Init(rtems_task_argument argument)
> -{
> -  int rv;
> -
> -  TEST_BEGIN();
> -
> -  rv = rtems_bsdnet_initialize_network();
> -  rtems_test_assert(rv == 0);
> -
> -  test_command_null();
> -  test_cannot_start_server_task();
> -  test_successful_start();
> -  test_already_started();
> -
> -  TEST_END();
> -  rtems_test_exit(0);
> -}
> -
> -#define CONFIGURE_INIT
> -
> -#define CONFIGURE_MICROSECONDS_PER_TICK 1
> -
> -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
> -#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER
> -
> -#define CONFIGURE_MAXIMUM_FILE_DESCRIPTORS (3 + 1 + 5 * 4)
> -
> -#define CONFIGURE_MAXIMUM_TASKS 8
> -
> -#define CONFIGURE_MAXIMUM_POSIX_KEYS 1
> -
> -#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_IN

Re: [PATCH rtems v2] testsuites: Remove telnetd01

2021-05-20 Thread Joel Sherrill
Sure. Push it.

On Thu, May 20, 2021, 6:36 PM Vijay Kumar Banerjee  wrote:

> Hi,
>
> In the last review, the commit message wasn't clear, I fixed it in this
> version.
> Does this look Ok to be merged?
>
> Best regards,
> Vijay
>
> On Thu, Apr 22, 2021 at 8:02 PM Vijay Kumar Banerjee 
> wrote:
> >
> > telnetd01 test cannot be run without a network stack, so this test is
> being
> > moved to the rtems-net-legacy repository.
> > ---
> >  spec/build/testsuites/libtests/grp.yml   |   2 -
> >  spec/build/testsuites/libtests/telnetd01.yml |  22 
> >  testsuites/libtests/telnetd01/init.c | 120 ---
> >  testsuites/libtests/telnetd01/telnetd01.doc  |  24 
> >  testsuites/libtests/telnetd01/telnetd01.scn  |  11 --
> >  5 files changed, 179 deletions(-)
> >  delete mode 100644 spec/build/testsuites/libtests/telnetd01.yml
> >  delete mode 100644 testsuites/libtests/telnetd01/init.c
> >  delete mode 100644 testsuites/libtests/telnetd01/telnetd01.doc
> >  delete mode 100644 testsuites/libtests/telnetd01/telnetd01.scn
> >
> > diff --git a/spec/build/testsuites/libtests/grp.yml
> b/spec/build/testsuites/libtests/grp.yml
> > index 5695fc7f06..20a593a5d3 100644
> > --- a/spec/build/testsuites/libtests/grp.yml
> > +++ b/spec/build/testsuites/libtests/grp.yml
> > @@ -258,8 +258,6 @@ links:
> >uid: tar02
> >  - role: build-dependency
> >uid: tar03
> > -- role: build-dependency
> > -  uid: telnetd01
> >  - role: build-dependency
> >uid: termios
> >  - role: build-dependency
> > diff --git a/spec/build/testsuites/libtests/telnetd01.yml
> b/spec/build/testsuites/libtests/telnetd01.yml
> > deleted file mode 100644
> > index 9f5bda84d9..00
> > --- a/spec/build/testsuites/libtests/telnetd01.yml
> > +++ /dev/null
> > @@ -1,22 +0,0 @@
> > -SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
> > -build-type: test-program
> > -cflags: []
> > -copyrights:
> > -- Copyright (C) 2020 embedded brains GmbH (
> http://www.embedded-brains.de)
> > -cppflags: []
> > -cxxflags: []
> > -enabled-by:
> > -- RTEMS_NETWORKING
> > -features: c cprogram
> > -includes:
> > -- cpukit/libnetworking
> > -ldflags: []
> > -links: []
> > -source:
> > -- testsuites/libtests/telnetd01/init.c
> > -stlib: []
> > -target: testsuites/libtests/telnetd01.exe
> > -type: build
> > -use-after:
> > -- telnetd
> > -use-before: []
> > diff --git a/testsuites/libtests/telnetd01/init.c
> b/testsuites/libtests/telnetd01/init.c
> > deleted file mode 100644
> > index a17126bf41..00
> > --- a/testsuites/libtests/telnetd01/init.c
> > +++ /dev/null
> > @@ -1,120 +0,0 @@
> > -/*
> > - * Copyright (c) 2018 embedded brains GmbH.  All rights reserved.
> > - *
> > - *  embedded brains GmbH
> > - *  Dornierstr. 4
> > - *  82178 Puchheim
> > - *  Germany
> > - *  
> > - *
> > - * 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.
> > - */
> > -
> > -#ifdef HAVE_CONFIG_H
> > -#include "config.h"
> > -#endif
> > -
> > -#include 
> > -#include 
> > -#include 
> > -
> > -#include 
> > -#include 
> > -#include 
> > -
> > -#include 
> > -
> > -const char rtems_test_name[] = "TELNETD 1";
> > -
> > -struct rtems_bsdnet_config rtems_bsdnet_config;
> > -
> > -static void command(char *device_name, void *arg)
> > -{
> > -}
> > -
> > -static void test_command_null(void)
> > -{
> > -  static const rtems_telnetd_config_table config = {
> > -.command = NULL
> > -  };
> > -  rtems_status_code sc;
> > -
> > -  sc = rtems_telnetd_start(&config);
> > -  rtems_test_assert(sc == RTEMS_INVALID_ADDRESS);
> > -}
> > -
> > -static void test_cannot_start_server_task(void)
> > -{
> > -  static const rtems_telnetd_config_table config = {
> > -.command = command,
> > -.priority = UINT32_MAX
> > -  };
> > -  rtems_status_code sc;
> > -
> > -  sc = rtems_telnetd_start(&config);
> > -  rtems_test_assert(sc == RTEMS_UNSATISFIED);
> > -}
> > -
> > -static void test_successful_start(void)
> > -{
> > -  static const rtems_telnetd_config_table config = {
> > -.command = command,
> > -.stack_size = RTEMS_MINIMUM_STACK_SIZE
> > -  };
> > -  rtems_status_code sc;
> > -
> > -  sc = rtems_telnetd_start(&config);
> > -  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
> > -}
> > -
> > -static void test_already_started(void)
> > -{
> > -  static const rtems_telnetd_config_table config = {
> > -.command = command
> > -  };
> > -  rtems_status_code sc;
> > -
> > -  sc = rtems_telnetd_start(&config);
> > -  rtems_test_assert(sc == RTEMS_RESOURCE_IN_USE);
> > -}
> > -
> > -static rtems_task Init(rtems_task_argument argument)
> > -{
> > -  int rv;
> > -
> > -  TEST_BEGIN();
> > -
> > -  rv = rtems_bsdnet_initialize_network();
> > -  rtems_test_assert(rv == 0);
> > -
> > -  test_command_null();
> > -  test_cannot_start_server_task();
> > -  test_successful_start();
> > -  test_already_started();
> > -
> > -  TEST_END();
> > -  rtems_test_exit(0)

Re: [PATCH rtems v2] testsuites: Remove telnetd01

2021-05-20 Thread Vijay Kumar Banerjee
On Thu, May 20, 2021 at 5:49 PM Joel Sherrill  wrote:
>
> Sure. Push it.
>
Thanks. Pushed.

> On Thu, May 20, 2021, 6:36 PM Vijay Kumar Banerjee  wrote:
>>
>> Hi,
>>
>> In the last review, the commit message wasn't clear, I fixed it in this 
>> version.
>> Does this look Ok to be merged?
>>
>> Best regards,
>> Vijay
>>
>> On Thu, Apr 22, 2021 at 8:02 PM Vijay Kumar Banerjee  wrote:
>> >
>> > telnetd01 test cannot be run without a network stack, so this test is being
>> > moved to the rtems-net-legacy repository.
>> > ---
>> >  spec/build/testsuites/libtests/grp.yml   |   2 -
>> >  spec/build/testsuites/libtests/telnetd01.yml |  22 
>> >  testsuites/libtests/telnetd01/init.c | 120 ---
>> >  testsuites/libtests/telnetd01/telnetd01.doc  |  24 
>> >  testsuites/libtests/telnetd01/telnetd01.scn  |  11 --
>> >  5 files changed, 179 deletions(-)
>> >  delete mode 100644 spec/build/testsuites/libtests/telnetd01.yml
>> >  delete mode 100644 testsuites/libtests/telnetd01/init.c
>> >  delete mode 100644 testsuites/libtests/telnetd01/telnetd01.doc
>> >  delete mode 100644 testsuites/libtests/telnetd01/telnetd01.scn
>> >
>> > diff --git a/spec/build/testsuites/libtests/grp.yml 
>> > b/spec/build/testsuites/libtests/grp.yml
>> > index 5695fc7f06..20a593a5d3 100644
>> > --- a/spec/build/testsuites/libtests/grp.yml
>> > +++ b/spec/build/testsuites/libtests/grp.yml
>> > @@ -258,8 +258,6 @@ links:
>> >uid: tar02
>> >  - role: build-dependency
>> >uid: tar03
>> > -- role: build-dependency
>> > -  uid: telnetd01
>> >  - role: build-dependency
>> >uid: termios
>> >  - role: build-dependency
>> > diff --git a/spec/build/testsuites/libtests/telnetd01.yml 
>> > b/spec/build/testsuites/libtests/telnetd01.yml
>> > deleted file mode 100644
>> > index 9f5bda84d9..00
>> > --- a/spec/build/testsuites/libtests/telnetd01.yml
>> > +++ /dev/null
>> > @@ -1,22 +0,0 @@
>> > -SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
>> > -build-type: test-program
>> > -cflags: []
>> > -copyrights:
>> > -- Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
>> > -cppflags: []
>> > -cxxflags: []
>> > -enabled-by:
>> > -- RTEMS_NETWORKING
>> > -features: c cprogram
>> > -includes:
>> > -- cpukit/libnetworking
>> > -ldflags: []
>> > -links: []
>> > -source:
>> > -- testsuites/libtests/telnetd01/init.c
>> > -stlib: []
>> > -target: testsuites/libtests/telnetd01.exe
>> > -type: build
>> > -use-after:
>> > -- telnetd
>> > -use-before: []
>> > diff --git a/testsuites/libtests/telnetd01/init.c 
>> > b/testsuites/libtests/telnetd01/init.c
>> > deleted file mode 100644
>> > index a17126bf41..00
>> > --- a/testsuites/libtests/telnetd01/init.c
>> > +++ /dev/null
>> > @@ -1,120 +0,0 @@
>> > -/*
>> > - * Copyright (c) 2018 embedded brains GmbH.  All rights reserved.
>> > - *
>> > - *  embedded brains GmbH
>> > - *  Dornierstr. 4
>> > - *  82178 Puchheim
>> > - *  Germany
>> > - *  
>> > - *
>> > - * 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.
>> > - */
>> > -
>> > -#ifdef HAVE_CONFIG_H
>> > -#include "config.h"
>> > -#endif
>> > -
>> > -#include 
>> > -#include 
>> > -#include 
>> > -
>> > -#include 
>> > -#include 
>> > -#include 
>> > -
>> > -#include 
>> > -
>> > -const char rtems_test_name[] = "TELNETD 1";
>> > -
>> > -struct rtems_bsdnet_config rtems_bsdnet_config;
>> > -
>> > -static void command(char *device_name, void *arg)
>> > -{
>> > -}
>> > -
>> > -static void test_command_null(void)
>> > -{
>> > -  static const rtems_telnetd_config_table config = {
>> > -.command = NULL
>> > -  };
>> > -  rtems_status_code sc;
>> > -
>> > -  sc = rtems_telnetd_start(&config);
>> > -  rtems_test_assert(sc == RTEMS_INVALID_ADDRESS);
>> > -}
>> > -
>> > -static void test_cannot_start_server_task(void)
>> > -{
>> > -  static const rtems_telnetd_config_table config = {
>> > -.command = command,
>> > -.priority = UINT32_MAX
>> > -  };
>> > -  rtems_status_code sc;
>> > -
>> > -  sc = rtems_telnetd_start(&config);
>> > -  rtems_test_assert(sc == RTEMS_UNSATISFIED);
>> > -}
>> > -
>> > -static void test_successful_start(void)
>> > -{
>> > -  static const rtems_telnetd_config_table config = {
>> > -.command = command,
>> > -.stack_size = RTEMS_MINIMUM_STACK_SIZE
>> > -  };
>> > -  rtems_status_code sc;
>> > -
>> > -  sc = rtems_telnetd_start(&config);
>> > -  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
>> > -}
>> > -
>> > -static void test_already_started(void)
>> > -{
>> > -  static const rtems_telnetd_config_table config = {
>> > -.command = command
>> > -  };
>> > -  rtems_status_code sc;
>> > -
>> > -  sc = rtems_telnetd_start(&config);
>> > -  rtems_test_assert(sc == RTEMS_RESOURCE_IN_USE);
>> > -}
>> > -
>> > -static rtems_task Init(rtems_task_argument argument)
>> > -{
>> > -  int rv;
>> > -
>> > -  TEST_BEGIN();
>> > -
>> > -  rv = rtems_bsdn

Re: [PATCH rtems 1/2] telnetd.c: Remove RTEMS_NETWORKING check

2021-05-20 Thread Gedare Bloom
Seems fine by me, but wait until Monday to let anyone complain if they want.

On Thu, May 20, 2021 at 5:35 PM Vijay Kumar Banerjee  wrote:
>
> Hi,
>
>
> On Thu, Apr 22, 2021 at 12:21 PM Gedare Bloom  wrote:
> >
> > I guess there's not much else to do here without a network stack API
> > to manipulate the network task(s).
> >
> > Is there a ticket to fix the lack of ability to configure and access
> > network task priorities? I'm guessing libbsd and lwip will both need
> > to figure out how to do this somehow. The design isn't obvious to me
> > right now.
> >
>
> I somehow missed this before.
> I raised a ticket: https://devel.rtems.org/ticket/4436
> Is this ok to be pushed with this ticked number mentioned in the comment?
>
>
> Best regards,
> Vijay
>
> > On Thu, Apr 22, 2021 at 12:07 PM Vijay Kumar Banerjee  
> > wrote:
> > >
> > > Ping :)
> > >
> > > On Tue, Apr 13, 2021 at 11:45 PM Vijay Kumar Banerjee  
> > > wrote:
> > > >
> > > > Set the priority manually to make telnetd compatible with the
> > > > ---
> > > >  cpukit/telnetd/telnetd.c | 11 +--
> > > >  1 file changed, 1 insertion(+), 10 deletions(-)
> > > >
> > > > diff --git a/cpukit/telnetd/telnetd.c b/cpukit/telnetd/telnetd.c
> > > > index b8adec297a..7dad2f2f92 100644
> > > > --- a/cpukit/telnetd/telnetd.c
> > > > +++ b/cpukit/telnetd/telnetd.c
> > > > @@ -58,10 +58,6 @@
> > > >  #include 
> > > >  #include 
> > > >
> > > > -#ifdef RTEMS_NETWORKING
> > > > -#include 
> > > > -#endif
> > > > -
> > > >  #define TELNETD_EVENT_SUCCESS RTEMS_EVENT_0
> > > >
> > > >  #define TELNETD_EVENT_ERROR RTEMS_EVENT_1
> > > > @@ -400,12 +396,7 @@ rtems_status_code rtems_telnetd_start(const 
> > > > rtems_telnetd_config_table* config)
> > > >ctx->server_socket = -1;
> > > >LIST_INIT(&ctx->free_sessions);
> > > >
> > > > -  /* Check priority */
> > > > -#ifdef RTEMS_NETWORKING
> > > > -  if (ctx->config.priority == 0) {
> > > > -ctx->config.priority = rtems_bsdnet_config.network_task_priority;
> > > > -  }
> > > > -#endif
> > > > +  /* Set priority */
> > > >if (ctx->config.priority == 0) {
> > > >  ctx->config.priority = 100;
> > > >}
> > > > --
> > > > 2.26.2
> > > >
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH rtems 1/2] telnetd.c: Remove RTEMS_NETWORKING check

2021-05-20 Thread Gedare Bloom
Well, since you pushed 2/2, you should push 1/2 (unless there are
different patch series?)

We should prefer to review and merge all/none of a series.

On Thu, May 20, 2021 at 9:56 PM Gedare Bloom  wrote:
>
> Seems fine by me, but wait until Monday to let anyone complain if they want.
>
> On Thu, May 20, 2021 at 5:35 PM Vijay Kumar Banerjee  wrote:
> >
> > Hi,
> >
> >
> > On Thu, Apr 22, 2021 at 12:21 PM Gedare Bloom  wrote:
> > >
> > > I guess there's not much else to do here without a network stack API
> > > to manipulate the network task(s).
> > >
> > > Is there a ticket to fix the lack of ability to configure and access
> > > network task priorities? I'm guessing libbsd and lwip will both need
> > > to figure out how to do this somehow. The design isn't obvious to me
> > > right now.
> > >
> >
> > I somehow missed this before.
> > I raised a ticket: https://devel.rtems.org/ticket/4436
> > Is this ok to be pushed with this ticked number mentioned in the comment?
> >
> >
> > Best regards,
> > Vijay
> >
> > > On Thu, Apr 22, 2021 at 12:07 PM Vijay Kumar Banerjee  
> > > wrote:
> > > >
> > > > Ping :)
> > > >
> > > > On Tue, Apr 13, 2021 at 11:45 PM Vijay Kumar Banerjee  
> > > > wrote:
> > > > >
> > > > > Set the priority manually to make telnetd compatible with the
> > > > > ---
> > > > >  cpukit/telnetd/telnetd.c | 11 +--
> > > > >  1 file changed, 1 insertion(+), 10 deletions(-)
> > > > >
> > > > > diff --git a/cpukit/telnetd/telnetd.c b/cpukit/telnetd/telnetd.c
> > > > > index b8adec297a..7dad2f2f92 100644
> > > > > --- a/cpukit/telnetd/telnetd.c
> > > > > +++ b/cpukit/telnetd/telnetd.c
> > > > > @@ -58,10 +58,6 @@
> > > > >  #include 
> > > > >  #include 
> > > > >
> > > > > -#ifdef RTEMS_NETWORKING
> > > > > -#include 
> > > > > -#endif
> > > > > -
> > > > >  #define TELNETD_EVENT_SUCCESS RTEMS_EVENT_0
> > > > >
> > > > >  #define TELNETD_EVENT_ERROR RTEMS_EVENT_1
> > > > > @@ -400,12 +396,7 @@ rtems_status_code rtems_telnetd_start(const 
> > > > > rtems_telnetd_config_table* config)
> > > > >ctx->server_socket = -1;
> > > > >LIST_INIT(&ctx->free_sessions);
> > > > >
> > > > > -  /* Check priority */
> > > > > -#ifdef RTEMS_NETWORKING
> > > > > -  if (ctx->config.priority == 0) {
> > > > > -ctx->config.priority = rtems_bsdnet_config.network_task_priority;
> > > > > -  }
> > > > > -#endif
> > > > > +  /* Set priority */
> > > > >if (ctx->config.priority == 0) {
> > > > >  ctx->config.priority = 100;
> > > > >}
> > > > > --
> > > > > 2.26.2
> > > > >
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH 2/2] Fix the bibtex extension configure test

2021-05-20 Thread Gedare Bloom
ok

On Thu, May 20, 2021 at 4:15 PM  wrote:
>
> From: Chris Johns 
>
> ---
>  common/waf.py | 6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/common/waf.py b/common/waf.py
> index 3806209..fa9aecb 100644
> --- a/common/waf.py
> +++ b/common/waf.py
> @@ -181,10 +181,12 @@ def check_sphinx_extension(ctx, extension):
>  def run_sphinx(bld):
>  rst_node = bld.srcnode.make_node('testbuild/contents.rst')
>  rst_node.parent.mkdir()
> -rst_node.write('.. COMMENT test sphinx\n')
> +rst_node.write('.. COMMENT test sphinx' + os.linesep)
>  bib_node = bld.srcnode.make_node('testbuild/refs.bib')
> +bib_node.write(os.linesep)
>  conf_node = bld.srcnode.make_node('testbuild/conf.py')
> -conf_node.write("bibtex_bibfiles = ['refs.bib']\n")
> +conf_node.write(os.linesep.join(["master_doc='contents'",
> + "bibtex_bibfiles = ['refs.bib']"]))
>  bld(rule = bld.kw['rule'], source = rst_node)
>
>  ctx.start_msg("Checking for '%s'" % (extension))
> --
> 2.24.3 (Apple Git-128)
>
> ___
> 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 3/3] posix: Allow pthread_cancel() from within ISRs

2021-05-20 Thread Gedare Bloom
These looked ok to me, I skimmed before but forgot to ACK...

On Mon, May 17, 2021 at 7:07 AM Sebastian Huber
 wrote:
>
> Close #4413.
> ---
>  cpukit/posix/src/cancel.c  | 13 ++---
>  testsuites/psxtests/psxcancel01/init.c | 72 +++---
>  2 files changed, 45 insertions(+), 40 deletions(-)
>
> diff --git a/cpukit/posix/src/cancel.c b/cpukit/posix/src/cancel.c
> index f2636e6a97..aa4a434037 100644
> --- a/cpukit/posix/src/cancel.c
> +++ b/cpukit/posix/src/cancel.c
> @@ -38,14 +38,6 @@ int pthread_cancel( pthread_t thread )
>Thread_Control   *executing;
>Per_CPU_Control  *cpu_self;
>
> -  /*
> -   *  Don't even think about deleting a resource from an ISR.
> -   */

But I really appreciated the irony of removing this comment.

> -
> -  if ( _ISR_Is_in_progress() ) {
> -return EPROTO;
> -  }
> -
>the_thread = _Thread_Get( thread, &lock_context );
>
>if ( the_thread == NULL ) {
> @@ -55,7 +47,10 @@ int pthread_cancel( pthread_t thread )
>cpu_self = _Per_CPU_Get();
>executing = _Per_CPU_Get_executing( cpu_self );
>
> -  if ( the_thread == executing ) {
> +  if (
> +the_thread == executing &&
> +!_Per_CPU_Is_ISR_in_progress( cpu_self )
> +  ) {
>  _ISR_lock_ISR_enable( &lock_context );
>  _Thread_Exit( PTHREAD_CANCELED, THREAD_LIFE_TERMINATING );
>} else {
> diff --git a/testsuites/psxtests/psxcancel01/init.c 
> b/testsuites/psxtests/psxcancel01/init.c
> index d87295ccd1..b0da991bad 100644
> --- a/testsuites/psxtests/psxcancel01/init.c
> +++ b/testsuites/psxtests/psxcancel01/init.c
> @@ -18,38 +18,37 @@ const char rtems_test_name[] = "PSXCANCEL 1";
>
>  /* forward declarations to avoid warnings */
>  void *POSIX_Init(void *argument);
> -rtems_timer_service_routine Cancel_duringISR_TSR(
> -  rtems_id  ignored_id,
> -  void *ignored_address
> -);
> -rtems_timer_service_routine SetState_duringISR_TSR(
> -  rtems_id  ignored_id,
> -  void *ignored_address
> -);
> -rtems_timer_service_routine SetType_duringISR_TSR(
> -  rtems_id  ignored_id,
> -  void *ignored_address
> -);
> -void doit(
> -  rtems_timer_service_routine (*TSR)(rtems_id, void *),
> -  const char   *method
> -);
>
> -volatile int TSR_occurred;
> -volatile int TSR_status;
> +static volatile int TSR_occurred;
> +
> +static volatile int TSR_status;
> +
> +static rtems_id  timer_id;
>
> -rtems_id  timer_id;
> +static pthread_t thread;
>
> -rtems_timer_service_routine Cancel_duringISR_TSR(
> +static void *suspend_self( void *arg )
> +{
> +  rtems_status_code status;
> +
> +  (void) arg;
> +
> +  status = rtems_task_suspend( RTEMS_SELF);
> +  rtems_test_assert( status == RTEMS_SUCCESSFUL );
> +
> +  return NULL;
> +}
> +
> +static rtems_timer_service_routine Cancel_duringISR_TSR(
>rtems_id  ignored_id,
>void *ignored_address
>  )
>  {
> -  TSR_status = pthread_cancel( pthread_self() );
> +  TSR_status = pthread_cancel( thread );
>TSR_occurred = 1;
>  }
>
> -rtems_timer_service_routine SetState_duringISR_TSR(
> +static rtems_timer_service_routine SetState_duringISR_TSR(
>rtems_id  ignored_id,
>void *ignored_address
>  )
> @@ -60,7 +59,7 @@ rtems_timer_service_routine SetState_duringISR_TSR(
>TSR_occurred = 1;
>  }
>
> -rtems_timer_service_routine SetType_duringISR_TSR(
> +static rtems_timer_service_routine SetType_duringISR_TSR(
>rtems_id  ignored_id,
>void *ignored_address
>  )
> @@ -71,9 +70,10 @@ rtems_timer_service_routine SetType_duringISR_TSR(
>TSR_occurred = 1;
>  }
>
> -void doit(
> +static void doit(
>rtems_timer_service_routine (*TSR)(rtems_id, void *),
> -  const char   *method
> +  const char   *method,
> +  int   expected_status
>  )
>  {
>rtems_intervalstart;
> @@ -97,11 +97,11 @@ void doit(
>  printf( "%s did not occur\n", method );
>  rtems_test_exit(0);
>}
> -  if ( TSR_status != EPROTO ) {
> +  if ( TSR_status != expected_status ) {
>  printf( "%s returned %s\n", method, strerror(TSR_status) );
>  rtems_test_exit(0);
>}
> -  printf( "%s - from ISR returns EPROTO - OK\n", method );
> +  printf( "%s - from ISR returns expected status - OK\n", method );
>
>  }
>
> @@ -110,6 +110,8 @@ void *POSIX_Init(
>  )
>  {
>rtems_status_code status;
> +  int   eno;
> +  void *value;
>
>TEST_BEGIN();
>
> @@ -119,9 +121,17 @@ void *POSIX_Init(
>);
>rtems_test_assert( !status );
>
> -  doit( Cancel_duringISR_TSR, "pthread_cancel" );
> -  doit( SetState_duringISR_TSR, "pthread_setcancelstate" );
> -  doit( SetType_duringISR_TSR, "pthread_setcanceltype" );
> +  eno = pthread_create( &thread, NULL, suspend_self, NULL );
> +  rtems_test_assert( eno == 0 );
> +
> +  doit( Cancel_duringISR_TSR, "pthread_cancel", 0 );
> +  doit( SetState_duringISR_TSR, "pthread_setcancelstate", EPROTO );
> +  doit( SetType_duringISR_TSR, "pthread_setcanceltype", EPROTO );
> +
> +  value = NULL;
> +  en

Re: [PATCH v2] sysconf: Remove sysconf(515)

2021-05-20 Thread Gedare Bloom
looks good

On Thu, May 20, 2021 at 7:25 AM Ryan Long  wrote:
>
> GCC originally needed this 20 years ago. No longer needed, so it
> is being removed.
>
> Closes #4391
> ---
>  cpukit/posix/src/sysconf.c| 4 
>  testsuites/psxtests/psxsysconf/init.c | 8 
>  2 files changed, 12 deletions(-)
>
> diff --git a/cpukit/posix/src/sysconf.c b/cpukit/posix/src/sysconf.c
> index 1696ec5..439a27e 100644
> --- a/cpukit/posix/src/sysconf.c
> +++ b/cpukit/posix/src/sysconf.c
> @@ -54,10 +54,6 @@ long sysconf(
>return (long) rtems_scheduler_get_processor_maximum();
>  case _SC_POSIX_26_VERSION:
>return (long) _POSIX_26_VERSION;
> -#if defined(__sparc__)
> -case 515: /* Solaris _SC_STACK_PROT */
> -  return 0;
> -#endif
>  default:
>rtems_set_errno_and_return_minus_one( EINVAL );
>}
> diff --git a/testsuites/psxtests/psxsysconf/init.c 
> b/testsuites/psxtests/psxsysconf/init.c
> index a008af3..66d6dd3 100644
> --- a/testsuites/psxtests/psxsysconf/init.c
> +++ b/testsuites/psxtests/psxsysconf/init.c
> @@ -83,14 +83,6 @@ void *POSIX_Init(
>== (long) rtems_scheduler_get_processor_maximum()
>);
>
> -#if defined(__sparc__)
> -  /* Solaris _SC_STACK_PROT - 515 */
> -  sc = sysconf( _SC_PAGESIZE );
> -  printf( "sysconf - (SPARC only) _SC_STACK_PROT=%ld\n", sc );
> -  if ( sc == -1 )
> -   rtems_test_exit(0);
> -#endif
> -
>TEST_END();
>rtems_test_exit( 0 );
>
> --
> 1.8.3.1
>
> ___
> 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 1/2] telnetd.c: Remove RTEMS_NETWORKING check

2021-05-20 Thread Vijay Kumar Banerjee
On Thu, May 20, 2021 at 9:57 PM Gedare Bloom  wrote:
>
> Well, since you pushed 2/2, you should push 1/2 (unless there are
> different patch series?)
>
Pushed.

> We should prefer to review and merge all/none of a series.
>
Ok, Understood. Thanks.

> On Thu, May 20, 2021 at 9:56 PM Gedare Bloom  wrote:
> >
> > Seems fine by me, but wait until Monday to let anyone complain if they want.
> >
> > On Thu, May 20, 2021 at 5:35 PM Vijay Kumar Banerjee  
> > wrote:
> > >
> > > Hi,
> > >
> > >
> > > On Thu, Apr 22, 2021 at 12:21 PM Gedare Bloom  wrote:
> > > >
> > > > I guess there's not much else to do here without a network stack API
> > > > to manipulate the network task(s).
> > > >
> > > > Is there a ticket to fix the lack of ability to configure and access
> > > > network task priorities? I'm guessing libbsd and lwip will both need
> > > > to figure out how to do this somehow. The design isn't obvious to me
> > > > right now.
> > > >
> > >
> > > I somehow missed this before.
> > > I raised a ticket: https://devel.rtems.org/ticket/4436
> > > Is this ok to be pushed with this ticked number mentioned in the comment?
> > >
> > >
> > > Best regards,
> > > Vijay
> > >
> > > > On Thu, Apr 22, 2021 at 12:07 PM Vijay Kumar Banerjee  
> > > > wrote:
> > > > >
> > > > > Ping :)
> > > > >
> > > > > On Tue, Apr 13, 2021 at 11:45 PM Vijay Kumar Banerjee 
> > > > >  wrote:
> > > > > >
> > > > > > Set the priority manually to make telnetd compatible with the
> > > > > > ---
> > > > > >  cpukit/telnetd/telnetd.c | 11 +--
> > > > > >  1 file changed, 1 insertion(+), 10 deletions(-)
> > > > > >
> > > > > > diff --git a/cpukit/telnetd/telnetd.c b/cpukit/telnetd/telnetd.c
> > > > > > index b8adec297a..7dad2f2f92 100644
> > > > > > --- a/cpukit/telnetd/telnetd.c
> > > > > > +++ b/cpukit/telnetd/telnetd.c
> > > > > > @@ -58,10 +58,6 @@
> > > > > >  #include 
> > > > > >  #include 
> > > > > >
> > > > > > -#ifdef RTEMS_NETWORKING
> > > > > > -#include 
> > > > > > -#endif
> > > > > > -
> > > > > >  #define TELNETD_EVENT_SUCCESS RTEMS_EVENT_0
> > > > > >
> > > > > >  #define TELNETD_EVENT_ERROR RTEMS_EVENT_1
> > > > > > @@ -400,12 +396,7 @@ rtems_status_code rtems_telnetd_start(const 
> > > > > > rtems_telnetd_config_table* config)
> > > > > >ctx->server_socket = -1;
> > > > > >LIST_INIT(&ctx->free_sessions);
> > > > > >
> > > > > > -  /* Check priority */
> > > > > > -#ifdef RTEMS_NETWORKING
> > > > > > -  if (ctx->config.priority == 0) {
> > > > > > -ctx->config.priority = 
> > > > > > rtems_bsdnet_config.network_task_priority;
> > > > > > -  }
> > > > > > -#endif
> > > > > > +  /* Set priority */
> > > > > >if (ctx->config.priority == 0) {
> > > > > >  ctx->config.priority = 100;
> > > > > >}
> > > > > > --
> > > > > > 2.26.2
> > > > > >
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: Writing code that takes time to run

2021-05-20 Thread Richi Dubey
Hi,

Thanks for your quick responses!

The suggestion certainly is helpful, we are going to try it out. I'll post
the result here.

On Thu, May 20, 2021 at 8:57 PM Joel Sherrill  wrote:

>
>
> On Thu, May 20, 2021 at 10:05 AM  wrote:
>
>> Hi Richi,
>>
>>
>>
>> You can checkout the T_busy functions here:
>> https://git.rtems.org/rtems/tree/cpukit/include/rtems/test.h#n2390
>>
>> uint_fast32_t T_get_one_clock_tick_busy(void) gives you the busy count
>> for one tick.
>>
>>
>>
>> You can then calculate the number of cycles you need to wait for you
>> desired certain time and pass it to: void T_busy(uint_fast32_t)
>>
>> This should give you comparably accurate results over different platforms.
>>
>
> That's certainly a better method than what I suggested.
>
> --joel
>
>>
>>
>> Best regards,
>>
>>
>>
>> Jan
>>
>>
>>
>>
>>
>>
>>
>> *From:* devel  *On Behalf Of *Richi Dubey
>> *Sent:* Thursday, May 20, 2021 4:53 PM
>> *To:* rtems-de...@rtems.org 
>> *Subject:* Writing code that takes time to run
>>
>>
>>
>> Hi,
>>
>>
>>
>> We are thinking of writing a piece of code that takes some time to run
>> (it would be amazing if it takes around 2 secs to run on hardware, but we
>> would be happy with something that takes a few milliseconds as well).
>>
>>
>>
>> We tried writing this:
>>
>>
>>
>>   for(int i = 0; i<1000; ++i){
>>   fib2 = fib0 + fib1;
>>   fib0 = fib1;
>>   fib1 = fib2;
>>   }
>>
>>
>>
>> which takes few milliseconds when tested on qemu, but only takes few
>> microseconds on a real board. Do you have any suggestions of what else we
>> can do?
>>
>>
>>
>> We want to write a code that is context switch safe (so, we can't simply
>> check the time before a loop, run an infinite loop that keeps checking
>> current time and stops after a few seconds - because this logic would fail
>> if there happens a context switch inside the loop and the task gets the
>> control back after a few seconds). We also don't want to do a wake_after()
>> since we want the task to be running on the cpu during the entire time (it
>> is okay if the task gets preempted due to a higher priority process), and
>> not voluntarily giving the control to some other task.
>>
>>
>>
>> Any suggestions? The aim is to see the affect of a task getting removed
>> from the cpu due to task shifting by the newly arrived task (in strong apa
>> vs non task shifting scheduler).
>>
>>
>>
>> Thank you.
>> ___
>> 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

How to debug on leon3 with sis and gdb

2021-05-20 Thread Richi Dubey
Hi,

A test fails at the assert(sc==RTEMS_SUCCESSFUL) after a call to
rtems_task_set_affinity.

So, following the docs , I
figured out where the break point should be set:

---

$ ~/quick-start/rtems/6/bin/sparc-rtems6-sis -leon3 -m 4
~/sis-quick-start/src/rtems/build/sparc/leon3/testsuites/smptests/smpschedstrongapa01.exe

 SIS - SPARC/RISCV instruction simulator 2.26,  copyright Jiri Gaisler 2020
 Bug-reports to j...@gaisler.se

 LEON3 emulation enabled, 4 cpus online, delta 50 clocks

 Loaded
/home/richi/sis-quick-start/src/rtems/build/sparc/leon3/testsuites/smptests/smpschedstrongapa01.exe,
entry 0x4000
cpu0> hi 10
trace history length = 10
cpu0> run
Waking CPU 1
Waking CPU 2
Waking CPU 3
assertion "sc == RTEMS_SUCCESSFUL" failed: file
"../../../testsuites/smptests/smpschedstrongapa01/init.c", line 264,
function: Init
cpu 0 in error mode (tt = 0x80)
   423950  4000f9e0:  91d02000   ta  0x0
cpu0> hi
   423922  40019d40:  90100018   mov  %i0, %o0
   423923  4000f9e4:  82102001   mov  1, %g1
   423924  4000f9e8:  8418   mov  %o0, %g2
   423925  4000f9ec:  8619   mov  %o1, %g3
   423926  4000f9f0:  91d02000   ta  0x0
   423928  4800:  a148   mov  %psr, %l0
   423929  4804:  2910003e   sethi  %hi(0x4000f800), %l4
   423930  4808:  81c521e0   jmp  %l4 + 0x1e0
   423932  480c:  a6102080   mov  128, %l3
   423933  4000f9e0:  91d02000   ta  0x0
cpu0> reg

 INS   LOCALS  OUTS GLOBALS
   0:  0007   F3001FC6   0007   
   1:  4002F008   4000F9F0      0001
   2:  40029CF8   4000F9F4   4002F008   0007
   3:  000A   0080   40020400   4002F008
   4:  0073   4000F800   000E   
   5:  40029C00      0004   
   6:  4002EEE0   4002A250   4002EE78   4002CD00
   7:  40019D3C   4002CD00   4000EC80   

 psr: F3001FC6   wim: 0008   tbr: 4800   y: 

  pc: 4000F9E0 = 91D02000 ta  0x0
 npc: 4000F9E4 = 82102001 mov  1, %g1
 IU in error mode

cpu0> quit
---
So the breakpoint has to be set at the second last instruction at address
0x480c

But when I try to debug this with gdb keeping the sis as remote target, it
does not work:

-
$ ~/quick-start/rtems/6/bin/sparc-rtems6-gdb
~/sis-quick-start/src/rtems/build/sparc/leon3/testsuites/smptests/smpschedstrongapa01.exe
GNU gdb (GDB) 10.1.90.20210409-git
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "--host=x86_64-linux-gnu --target=sparc-rtems6".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
.
Find the GDB manual and other documentation resources online at:
.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from
/home/richi/sis-quick-start/src/rtems/build/sparc/leon3/testsuites/smptests/smpschedstrongapa01.exe...
(gdb) tar sim -leon3
Undefined target command: "sim -leon3".  Try "help target".
(gdb) target extended-remote localhost:1234
Remote debugging using localhost:1234
0x in ?? ()
(gdb) load
Loading section .text, size 0x218f0 lma 0x4000
Loading section .rtemsroset, size 0x90 lma 0x400218f0
Loading section .data, size 0x530 lma 0x40029980
Start address 0x4000, load size 138928
Transfer rate: 3083 KB/sec, 271 bytes/write.
(gdb) bre 0x480c
Function "0x480c" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (0x480c) pending.
(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program:
/home/richi/sis-quick-start/src/rtems/build/sparc/leon3/testsuites/smptests/smpschedstrongapa01.exe


Program received signal SIGTERM, Terminated.
syscall () at ../../../cpukit/score/cpu/sparc/syscall.S:44
44 ta 0 ! syscall 1, halt with %g1,%g2,%g3 info
(gdb)



And the output on the other terminal is:


$ ~/quick-start/rtems/6/bin/sparc-rtems6-sis -leon3 -m 4 -gdb

 SIS - SPARC/RISCV instruction simulator 2.26,  copyright Jiri Gaisler 2020
 Bug-reports to j...@gaisler.se

 LEON3 emulation enabled, 4 cpus online, delta 50 clocks

gdb: listening on port 1234 connected
X4000,0:#72
Waking CPU 1
Waking CPU 2
Waking CPU 3
assertion "sc == RTEMS_SUCCESSFUL" failed: file
"../../../testsuites/smptests/smpschedstrongapa01/init.c", line 264,
function: Init


So, is there a way I can debug this? Can I use si or

Re: [PATCH] score: Fix _Thread_Cancel()

2021-05-20 Thread Sebastian Huber

On 20/05/2021 22:33, Gedare Bloom wrote:

+static void _Thread_Consider_life_change_request(

Minor, I'd prefer "_Thread_Try_life_change_request("



Yes, this is better, thanks for the suggestion.

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