AW: [PATCH v3 00/11] ENABLE PPS API in RTEMS6

2022-05-11 Thread Gabriel.Moyano
> This is the 3rd version of the patches for enabling the PPS API in RTEMS6.
> It contains the changes suggested by Sebastian from yesterday (03/05/2022).
> 
> Gabriel Moyano (11):
>   kern_ntptime.c: Disable freebsd features
>   kern_ntptime.c: Add lmax() qmin() definitions
>   kern_tc.c: Add atomic dependencies required by the PPS API
>   kern_tc.c: Replace FREEBSD event mechanism by adding pointers to
> function
>   timecounter.h: Rename tc_getfrequency() to
> _Timecounter_Get_frequency()
>   kern_tc.c: Add definitions required by PPS API
>   kern_tc.c: Enable PPS API support
>   kern_ntptime.c: Add define in order to remove warning
>   timepps.h: PPS_SYNC defined by default
>   timecounter.h: Add _Timecounter_Discipline()
>   testsuites/sptests: Add sppps01 test
> 
>  cpukit/include/rtems/score/timecounter.h  |  25 
>  cpukit/include/sys/timepps.h  |  32 
>  cpukit/include/sys/timetc.h   |   3 +
>  cpukit/score/src/kern_ntptime.c   |  19 +--
>  cpukit/score/src/kern_tc.c|  54 ++-
>  spec/build/testsuites/sptests/grp.yml |   2 +
>  spec/build/testsuites/sptests/sppps01.yml |  19 +++
>  testsuites/sptests/sppps01/init.c | 173 ++
>  8 files changed, 312 insertions(+), 15 deletions(-)  create mode 100644 
> spec/build/testsuites/sptests/sppps01.yml
>  create mode 100644 testsuites/sptests/sppps01/init.c

Is there any feedback for improvement? Or are these commits ready to be pushed?
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: AW: [PATCH v3 00/11] ENABLE PPS API in RTEMS6

2022-05-11 Thread Sebastian Huber

On 11/05/2022 13:53, gabriel.moy...@dlr.de wrote:

Is there any feedback for improvement? Or are these commits ready to be pushed?


Sorry for the delay, but I was busy with other things in the last days. 
I will have a look at the patch set in the next days. In general, it 
looks good.


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

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

Re: [PATCH 3/8] tcpdump: Make loop monitor cooperative

2022-05-11 Thread Joel Sherrill
Should these be inside an ifdef rtems conditional? Isn't this code
originally from FreeBSD?

--joel

On Wed, May 11, 2022 at 1:56 AM Sebastian Huber <
sebastian.hu...@embedded-brains.de> wrote:

> This helps a bit if the fgetc() is non-blocking.
>
> Update #4650.
> ---
>  freebsd/contrib/tcpdump/tcpdump.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/freebsd/contrib/tcpdump/tcpdump.c
> b/freebsd/contrib/tcpdump/tcpdump.c
> index b1e7f0d1..74c878a3 100644
> --- a/freebsd/contrib/tcpdump/tcpdump.c
> +++ b/freebsd/contrib/tcpdump/tcpdump.c
> @@ -139,6 +139,7 @@ The Regents of the University of California.  All
> rights reserved.\n";
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #define setpriority(a, b, c)
> @@ -1224,6 +1225,8 @@ pcap_loop_monitor(rtems_task_argument arg)
> pcap_breakloop(pd);
> break;
> }
> +
> +   sched_yield();
> }
>
> rtems_task_delete(RTEMS_SELF);
> --
> 2.35.3
>
> ___
> 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/8] tcpdump: Make loop monitor cooperative

2022-05-11 Thread Sebastian Huber

On 11/05/2022 16:56, Joel Sherrill wrote:
Should these be inside an ifdef rtems conditional? Isn't this code 
originally from FreeBSD?


This code is not from FreeBSD.

--
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 0/8] tcpdump: Fix dumping to file and reading from file

2022-05-11 Thread Chris Johns
OK and thanks. The destructor is a nice addition.

I still think running tcpdump on rtems is fun to watch apart from being useful
when things do not work.

Chris

On 11/5/2022 4:56 pm, Sebastian Huber wrote:
> This patch is for the 5-freebsd-12, 6-freebsd-12, and master branches of
> libbsd.
> 
> Sebastian Huber (8):
>   tcpdump01: New test
>   Add program destructor support
>   tcpdump: Make loop monitor cooperative
>   tcpdump: Use rtems_task_exit()
>   tcpdump: Close pcap dumper at program exit
>   tcpdump: No loop monitor if reading from file
>   tcpdump: Ensure loop monitor termination
>   tcpdump: Do not use signals and chroot
> 
>  freebsd/contrib/tcpdump/tcpdump.c|  95 --
>  libbsd.py|   1 +
>  rtemsbsd/include/machine/rtems-bsd-program.h |   6 +
>  rtemsbsd/rtems/program-internal.h|   7 +
>  rtemsbsd/rtems/rtems-program.c   |  51 
>  testsuite/tcpdump01/test_main.c  | 292 +++
>  6 files changed, 428 insertions(+), 24 deletions(-)
>  create mode 100644 testsuite/tcpdump01/test_main.c
> 
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH v1] score:fix smp priority affinity scheduler yeild problem

2022-05-11 Thread tianye
From: Tian Ye 

---
 .../rtems/score/schedulerpriorityaffinitysmp.h |  7 ++-
 .../score/src/schedulerpriorityaffinitysmp.c   | 18 ++
 2 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/cpukit/include/rtems/score/schedulerpriorityaffinitysmp.h 
b/cpukit/include/rtems/score/schedulerpriorityaffinitysmp.h
index 498ffcb7aa..bac3ad786e 100644
--- a/cpukit/include/rtems/score/schedulerpriorityaffinitysmp.h
+++ b/cpukit/include/rtems/score/schedulerpriorityaffinitysmp.h
@@ -54,7 +54,7 @@ extern "C" {
   { \
 _Scheduler_priority_SMP_Initialize, \
 _Scheduler_default_Schedule, \
-_Scheduler_priority_SMP_Yield, \
+_Scheduler_priority_affinity_SMP_Yield, \
 _Scheduler_priority_affinity_SMP_Block, \
 _Scheduler_priority_affinity_SMP_Unblock, \
 _Scheduler_priority_affinity_SMP_Update_priority, \
@@ -107,6 +107,11 @@ void _Scheduler_priority_affinity_SMP_Block(
   Scheduler_Node  *node
 );
 
+void _Scheduler_priority_affinity_SMP_Yield(
+  const Scheduler_Control *scheduler,
+  Thread_Control  *thread,
+  Scheduler_Node  *node
+);
 /**
  * @brief Unblocks a thread.
  *
diff --git a/cpukit/score/src/schedulerpriorityaffinitysmp.c 
b/cpukit/score/src/schedulerpriorityaffinitysmp.c
index 86ef7bf83e..d59917340d 100644
--- a/cpukit/score/src/schedulerpriorityaffinitysmp.c
+++ b/cpukit/score/src/schedulerpriorityaffinitysmp.c
@@ -576,3 +576,21 @@ bool _Scheduler_priority_affinity_SMP_Set_affinity(
 
   return true;
 }
+
+void _Scheduler_priority_affinity_SMP_Yield(
+  const Scheduler_Control *scheduler,
+  Thread_Control  *thread,
+  Scheduler_Node  *node
+)
+{
+  Scheduler_Context *context = _Scheduler_Get_context( scheduler );
+
+  _Scheduler_SMP_Yield(
+context,
+thread,
+node,
+_Scheduler_priority_SMP_Extract_from_ready,
+_Scheduler_priority_affinity_SMP_Enqueue,
+_Scheduler_priority_affinity_SMP_Enqueue_scheduled
+  );
+}
-- 
2.25.1

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