libbsd update to FreeBSD head (2017-01-09)

2017-01-10 Thread Sebastian Huber

Hello,

I updated the libbsd from FreeBSD 9.3 to FreeBSD head (2017-01-09). This 
is a very big jump in terms of FreeBSD development. The main goal is to 
catch up with FreeBSD and unify the baseline of the different parts of 
the libbsd. The network, USB and SD/MMC card parts used different 
FreeBSD versions. Thus, using an USB network component didn't work 
before due to incompatible network stack interfaces. There will be some 
work to do for each supported BSP after the update, e.g. adjustment of 
network interface drivers. I guess the x86 support is now broken.


I created a "freebsd-9.3" branch before the update.

--
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail  : sebastian.hu...@embedded-brains.de
PGP : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.

___
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

New class "RTEMS Application Development" in Munich/Germany, May3-5, 2017

2017-01-10 Thread Thomas Doerfler
Hello,

we are currently planning an open RTEMS class "RTEMS Application
Development" in Munich/Germany to start on

May 3, 2017.

This class has is main focus on application development based on the
RTEMS kernel.

Maybe you or some of your colleagues like to join in? See our updated
website

http://www.embedded-brains.de/en/rtems-real-time-operating-system/rtems-training-courses/

for more details.

Now it is time to register. Please send us an email or use the website
form if you and/or your colleagues are interested to attend, so we can
reserve seats for you.

BTW: The registration period closes on April 12.

wkr,
Thomas Doerfler.

-- 

embedded brains GmbH
Thomas Doerfler
Dornierstr. 4
D-82178 Puchheim
Germany
email: thomas.doerf...@embedded-brains.de
Phone: +49-89-18 94 741-12
Fax:   +49-89-18 94 741-09
PGP: Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

[PATCH 1/4] score: Format thread state defines

2017-01-10 Thread Sebastian Huber
Specify all 32-bits in a thread state define.
---
 cpukit/score/include/rtems/score/statesimpl.h | 54 +--
 1 file changed, 27 insertions(+), 27 deletions(-)

diff --git a/cpukit/score/include/rtems/score/statesimpl.h 
b/cpukit/score/include/rtems/score/statesimpl.h
index 17b7342..e321a34 100644
--- a/cpukit/score/include/rtems/score/statesimpl.h
+++ b/cpukit/score/include/rtems/score/statesimpl.h
@@ -37,59 +37,59 @@ extern "C" {
  */
 
 /** This macro corresponds to a task being ready. */
-#define STATES_READY   0x0
+#define STATES_READY   0x
 /** This macro corresponds to a task being created but not yet started. */
-#define STATES_DORMANT 0x1
+#define STATES_DORMANT 0x0001
 /** This macro corresponds to a task being suspended. */
-#define STATES_SUSPENDED   0x2
+#define STATES_SUSPENDED   0x0002
 /** This macro corresponds to a task which is waiting for a timeout. */
-#define STATES_DELAYING0x8
+#define STATES_DELAYING0x0008
 /** This macro corresponds to a task waiting until a specific TOD. */
-#define STATES_WAITING_FOR_TIME0x00010
+#define STATES_WAITING_FOR_TIME0x0010
 /** This macro corresponds to a task waiting for a variable length buffer. */
-#define STATES_WAITING_FOR_BUFFER  0x00020
+#define STATES_WAITING_FOR_BUFFER  0x0020
 /** This macro corresponds to a task waiting for a fixed size segment. */
-#define STATES_WAITING_FOR_SEGMENT 0x00040
+#define STATES_WAITING_FOR_SEGMENT 0x0040
 /** This macro corresponds to a task waiting for a message. */
-#define STATES_WAITING_FOR_MESSAGE 0x00080
+#define STATES_WAITING_FOR_MESSAGE 0x0080
 /** This macro corresponds to a task waiting for an event. */
-#define STATES_WAITING_FOR_EVENT   0x00100
+#define STATES_WAITING_FOR_EVENT   0x0100
 /** This macro corresponds to a task waiting for a semaphore. */
-#define STATES_WAITING_FOR_SEMAPHORE   0x00200
+#define STATES_WAITING_FOR_SEMAPHORE   0x0200
 /** This macro corresponds to a task waiting for a mutex. */
-#define STATES_WAITING_FOR_MUTEX   0x00400
+#define STATES_WAITING_FOR_MUTEX   0x0400
 /** This macro corresponds to a task waiting for a condition variable. */
-#define STATES_WAITING_FOR_CONDITION_VARIABLE  0x00800
+#define STATES_WAITING_FOR_CONDITION_VARIABLE  0x0800
 /** This macro corresponds to a task waiting for a join while exiting. */
-#define STATES_WAITING_FOR_JOIN_AT_EXIT0x01000
+#define STATES_WAITING_FOR_JOIN_AT_EXIT0x1000
 /** This macro corresponds to a task waiting for a reply to an MPCI request. */
-#define STATES_WAITING_FOR_RPC_REPLY   0x02000
+#define STATES_WAITING_FOR_RPC_REPLY   0x2000
 /** This macro corresponds to a task waiting for a period. */
-#define STATES_WAITING_FOR_PERIOD  0x04000
+#define STATES_WAITING_FOR_PERIOD  0x4000
 /** This macro corresponds to a task waiting for a signal. */
-#define STATES_WAITING_FOR_SIGNAL  0x08000
+#define STATES_WAITING_FOR_SIGNAL  0x8000
 /** This macro corresponds to a task waiting for a barrier. */
-#define STATES_WAITING_FOR_BARRIER 0x1
+#define STATES_WAITING_FOR_BARRIER 0x0001
 /** This macro corresponds to a task waiting for a RWLock. */
-#define STATES_WAITING_FOR_RWLOCK  0x2
+#define STATES_WAITING_FOR_RWLOCK  0x0002
 /** This macro corresponds to a task waiting for a system event. */
-#define STATES_WAITING_FOR_SYSTEM_EVENT0x4
+#define STATES_WAITING_FOR_SYSTEM_EVENT0x0004
 /** This macro corresponds to a task waiting for BSD wakeup. */
-#define STATES_WAITING_FOR_BSD_WAKEUP  0x8
+#define STATES_WAITING_FOR_BSD_WAKEUP  0x0008
 /** This macro corresponds to a task being held by the debugger. */
-#define STATES_DEBUGGER0x10
+#define STATES_DEBUGGER0x0010
 /** This macro corresponds to a task being a zombie. */
-#define STATES_ZOMBIE  0x20
+#define STATES_ZOMBIE  0x0020
 /** This macro corresponds to a task those life is changing. */
-#define STATES_LIFE_IS_CHANGING0x80
+#define STATES_LIFE_IS_CHANGING0x0080
 /** This macro corresponds to a task waiting for a join. */
-#define STATES_WAITING_FOR_JOIN0x100
+#define STATES_WAITING_FOR_JOIN0x0100
 /** This macro corresponds to a task waiting for a  mutex. */
-#define STATES_WAITING_FOR_SYS_LOCK_MUTEX  0x200
+#define STATES_WAITING_FOR_SYS_LOCK_M

[PATCH 4/4] score: Optimize thread state values

2017-01-10 Thread Sebastian Huber
---
 cpukit/score/include/rtems/score/statesimpl.h | 118 +++---
 1 file changed, 70 insertions(+), 48 deletions(-)

diff --git a/cpukit/score/include/rtems/score/statesimpl.h 
b/cpukit/score/include/rtems/score/statesimpl.h
index 5386b3e..424bcdc 100644
--- a/cpukit/score/include/rtems/score/statesimpl.h
+++ b/cpukit/score/include/rtems/score/statesimpl.h
@@ -33,71 +33,93 @@ extern "C" {
 
 /*
  *  The following constants define the individual states which may be
- *  be used to compose and manipulate a thread's state.
+ *  be used to compose and manipulate a thread's state.  More frequently used
+ *  states should use lower value bits to ease the use of immediate values on
+ *  RISC architectures.
  */
 
 /** This macro corresponds to a task being ready. */
 #define STATES_READY   0x
-/** This macro corresponds to a task being created but not yet started. */
-#define STATES_DORMANT 0x0001
-/** This macro corresponds to a task being suspended. */
-#define STATES_SUSPENDED   0x0002
-/** This macro corresponds to a task which is waiting for a timeout. */
-#define STATES_DELAYING0x0008
-/** This macro corresponds to a task waiting until a specific TOD. */
-#define STATES_WAITING_FOR_TIME0x0010
-/** This macro corresponds to a task waiting for a fixed size segment. */
-#define STATES_WAITING_FOR_SEGMENT 0x0040
-/** This macro corresponds to a task waiting for a message. */
-#define STATES_WAITING_FOR_MESSAGE 0x0080
-/** This macro corresponds to a task waiting for an event. */
-#define STATES_WAITING_FOR_EVENT   0x0100
-/** This macro corresponds to a task waiting for a semaphore. */
-#define STATES_WAITING_FOR_SEMAPHORE   0x0200
+
+/**
+ * @brief This macro corresponds to a task which is blocked on a thread queue
+ * embedded in an object with an identifier.
+ *
+ * This thread state bit is intended to ease debugging and improve system
+ * diagnostics, see _Thread_Wait_get_id().
+ */
+#define STATES_THREAD_QUEUE_WITH_IDENTIFIER0x0001
+
 /** This macro corresponds to a task waiting for a mutex. */
-#define STATES_WAITING_FOR_MUTEX   0x0400
+#define STATES_WAITING_FOR_MUTEX   0x0002
+
+/** This macro corresponds to a task waiting for a semaphore. */
+#define STATES_WAITING_FOR_SEMAPHORE   0x0004
+
+/** This macro corresponds to a task waiting for an event. */
+#define STATES_WAITING_FOR_EVENT   0x0008
+
+/** This macro corresponds to a task waiting for a system event. */
+#define STATES_WAITING_FOR_SYSTEM_EVENT0x0010
+
+/** This macro corresponds to a task waiting for a message. */
+#define STATES_WAITING_FOR_MESSAGE 0x0020
+
 /** This macro corresponds to a task waiting for a condition variable. */
-#define STATES_WAITING_FOR_CONDITION_VARIABLE  0x0800
-/** This macro corresponds to a task waiting for a join while exiting. */
-#define STATES_WAITING_FOR_JOIN_AT_EXIT0x1000
-/** This macro corresponds to a task waiting for a reply to an MPCI request. */
-#define STATES_WAITING_FOR_RPC_REPLY   0x2000
+#define STATES_WAITING_FOR_CONDITION_VARIABLE  0x0040
+
+/** This macro corresponds to a task waiting for a futex. */
+#define STATES_WAITING_FOR_FUTEX   0x0080
+
+/** This macro corresponds to a task waiting for BSD wakeup. */
+#define STATES_WAITING_FOR_BSD_WAKEUP  0x0010
+
+/** This macro corresponds to a task which is waiting for a timeout. */
+#define STATES_DELAYING0x0200
+
 /** This macro corresponds to a task waiting for a period. */
-#define STATES_WAITING_FOR_PERIOD  0x4000
+#define STATES_WAITING_FOR_PERIOD  0x0400
+
 /** This macro corresponds to a task waiting for a signal. */
-#define STATES_WAITING_FOR_SIGNAL  0x8000
+#define STATES_WAITING_FOR_SIGNAL  0x0800
+
 /** This macro corresponds to a task waiting for a barrier. */
-#define STATES_WAITING_FOR_BARRIER 0x0001
+#define STATES_WAITING_FOR_BARRIER 0x1000
+
 /** This macro corresponds to a task waiting for a RWLock. */
-#define STATES_WAITING_FOR_RWLOCK  0x0002
-/** This macro corresponds to a task waiting for a system event. */
-#define STATES_WAITING_FOR_SYSTEM_EVENT0x0004
-/** This macro corresponds to a task waiting for BSD wakeup. */
-#define STATES_WAITING_FOR_BSD_WAKEUP  0x0008
-/** This macro corresponds to a task being held by the debugger. */
-#define STATES_DEBUGGER0x0010
-/** This macro corresponds to a task being a zombie. */
-#define STATES_ZOMBIE  0x0020
-/** This macro corresponds to a task those life is changing. */
-#define STATES_LIFE_IS_CHANGING   

[PATCH 2/4] score: Delete STATES_WAITING_FOR_BUFFER

2017-01-10 Thread Sebastian Huber
---
 cpukit/libdebugger/rtems-debugger-threads.c   |  1 -
 cpukit/libmisc/monitor/mon-prmisc.c   |  2 --
 cpukit/score/include/rtems/score/statesimpl.h | 20 +---
 3 files changed, 1 insertion(+), 22 deletions(-)

diff --git a/cpukit/libdebugger/rtems-debugger-threads.c 
b/cpukit/libdebugger/rtems-debugger-threads.c
index 89c1b9e..aa4cb72 100644
--- a/cpukit/libdebugger/rtems-debugger-threads.c
+++ b/cpukit/libdebugger/rtems-debugger-threads.c
@@ -519,7 +519,6 @@ rtems_debugger_thread_state_str(rtems_debugger_thread* 
thread,
 { "LIFE",   STATES_LIFE_IS_CHANGING },
 { "SUSP",   STATES_SUSPENDED },
 { "Wbar",   STATES_WAITING_FOR_BARRIER },
-{ "Wbuf",   STATES_WAITING_FOR_BUFFER },
 { "Wcvar",  STATES_WAITING_FOR_CONDITION_VARIABLE },
 { "Wevnt",  STATES_WAITING_FOR_EVENT },
 { "Wisig",  STATES_INTERRUPTIBLE_BY_SIGNAL },
diff --git a/cpukit/libmisc/monitor/mon-prmisc.c 
b/cpukit/libmisc/monitor/mon-prmisc.c
index a49b084..5f10df1 100644
--- a/cpukit/libmisc/monitor/mon-prmisc.c
+++ b/cpukit/libmisc/monitor/mon-prmisc.c
@@ -112,14 +112,12 @@ rtems_monitor_dump_priority(rtems_task_priority priority)
 return fprintf(stdout,"%3" PRId32, priority);
 }
 
-
 static const rtems_assoc_t rtems_monitor_state_assoc[] = {
 { "DELAY",  STATES_DELAYING, 0 },
 { "DORM",   STATES_DORMANT, 0 },
 { "LIFE",   STATES_LIFE_IS_CHANGING, 0 },
 { "SUSP",   STATES_SUSPENDED, 0 },
 { "Wbar",   STATES_WAITING_FOR_BARRIER, 0 },
-{ "Wbuf",   STATES_WAITING_FOR_BUFFER, 0 },
 { "Wcvar",  STATES_WAITING_FOR_CONDITION_VARIABLE, 0 },
 { "Wevnt",  STATES_WAITING_FOR_EVENT, 0 },
 { "Wisig",  STATES_INTERRUPTIBLE_BY_SIGNAL, 0 },
diff --git a/cpukit/score/include/rtems/score/statesimpl.h 
b/cpukit/score/include/rtems/score/statesimpl.h
index e321a34..82bcd79 100644
--- a/cpukit/score/include/rtems/score/statesimpl.h
+++ b/cpukit/score/include/rtems/score/statesimpl.h
@@ -46,8 +46,6 @@ extern "C" {
 #define STATES_DELAYING0x0008
 /** This macro corresponds to a task waiting until a specific TOD. */
 #define STATES_WAITING_FOR_TIME0x0010
-/** This macro corresponds to a task waiting for a variable length buffer. */
-#define STATES_WAITING_FOR_BUFFER  0x0020
 /** This macro corresponds to a task waiting for a fixed size segment. */
 #define STATES_WAITING_FOR_SEGMENT 0x0040
 /** This macro corresponds to a task waiting for a message. */
@@ -99,8 +97,7 @@ extern "C" {
 #define STATES_WAITING_FOR_SYS_LOCK_CONDITION  0x2000
 
 /** This macro corresponds to a task waiting for a local object operation. */
-#define STATES_LOCALLY_BLOCKED ( STATES_WAITING_FOR_BUFFER | \
- STATES_WAITING_FOR_SEGMENT| \
+#define STATES_LOCALLY_BLOCKED ( STATES_WAITING_FOR_SEGMENT| \
  STATES_WAITING_FOR_MESSAGE| \
  STATES_WAITING_FOR_SEMAPHORE  | \
  STATES_WAITING_FOR_MUTEX  | \
@@ -238,21 +235,6 @@ RTEMS_INLINE_ROUTINE bool _States_Is_delaying (
 }
 
 /**
- * This function returns true if the WAITING_FOR_BUFFER state is set in
- * the_states, and false otherwise.
- *
- * @param[in] the_states is the task state set to test
- *
- * @return This method returns true if the desired state condition is set.
- */
-RTEMS_INLINE_ROUTINE bool _States_Is_waiting_for_buffer (
-  States_Control the_states
-)
-{
-   return (the_states & STATES_WAITING_FOR_BUFFER);
-}
-
-/**
  * This function returns true if the WAITING_FOR_SEGMENT state is set in
  * the_states, and false otherwise.
  *
-- 
1.8.4.5

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


[PATCH 3/4] score: Add STATES_THREAD_QUEUE_WITH_IDENTIFIER

2017-01-10 Thread Sebastian Huber
Add thread state bit to identify thread queues that are embedded in an
object with identifier.
---
 cpukit/libdebugger/rtems-debugger-threads.c|  8 +++-
 cpukit/libmisc/monitor/mon-prmisc.c| 22 --
 cpukit/posix/src/condwaitsupp.c|  3 ++-
 cpukit/rtems/src/msgmp.c   |  4 ++--
 cpukit/rtems/src/semmp.c   |  2 +-
 cpukit/score/include/rtems/score/coresemimpl.h |  2 +-
 cpukit/score/include/rtems/score/statesimpl.h  | 25 +
 cpukit/score/src/condition.c   |  2 +-
 cpukit/score/src/corebarrierwait.c |  2 +-
 cpukit/score/src/coremsgseize.c|  2 +-
 cpukit/score/src/coremsgsubmit.c   |  2 +-
 cpukit/score/src/coremutexseize.c  |  2 +-
 cpukit/score/src/corerwlockobtainread.c|  2 +-
 cpukit/score/src/corerwlockobtainwrite.c   |  2 +-
 cpukit/score/src/futex.c   |  2 +-
 cpukit/score/src/mutex.c   |  2 +-
 cpukit/score/src/semaphore.c   |  2 +-
 cpukit/score/src/threadwaitgetid.c | 10 +-
 18 files changed, 45 insertions(+), 51 deletions(-)

diff --git a/cpukit/libdebugger/rtems-debugger-threads.c 
b/cpukit/libdebugger/rtems-debugger-threads.c
index aa4cb72..2e9cf06 100644
--- a/cpukit/libdebugger/rtems-debugger-threads.c
+++ b/cpukit/libdebugger/rtems-debugger-threads.c
@@ -521,7 +521,7 @@ rtems_debugger_thread_state_str(rtems_debugger_thread* 
thread,
 { "Wbar",   STATES_WAITING_FOR_BARRIER },
 { "Wcvar",  STATES_WAITING_FOR_CONDITION_VARIABLE },
 { "Wevnt",  STATES_WAITING_FOR_EVENT },
-{ "Wisig",  STATES_INTERRUPTIBLE_BY_SIGNAL },
+{ "ISIG" ,  STATES_INTERRUPTIBLE_BY_SIGNAL },
 { "Wjatx",  STATES_WAITING_FOR_JOIN_AT_EXIT },
 { "Wjoin",  STATES_WAITING_FOR_JOIN },
 { "Wmsg" ,  STATES_WAITING_FOR_MESSAGE },
@@ -532,10 +532,8 @@ rtems_debugger_thread_state_str(rtems_debugger_thread* 
thread,
 { "Wseg",   STATES_WAITING_FOR_SEGMENT },
 { "Wsem",   STATES_WAITING_FOR_SEMAPHORE },
 { "Wsig",   STATES_WAITING_FOR_SIGNAL },
-{ "Wslcnd", STATES_WAITING_FOR_SYS_LOCK_CONDITION },
-{ "Wslftx", STATES_WAITING_FOR_SYS_LOCK_FUTEX },
-{ "Wslmtx", STATES_WAITING_FOR_SYS_LOCK_MUTEX },
-{ "Wslsem", STATES_WAITING_FOR_SYS_LOCK_SEMAPHORE },
+{ "Wfutex", STATES_WAITING_FOR_FUTEX },
+{ "TQID",   STATES_THREAD_QUEUE_WITH_IDENTIFIER },
 { "Wsysev", STATES_WAITING_FOR_SYSTEM_EVENT },
 { "Wtime",  STATES_WAITING_FOR_TIME },
 { "Wwkup",  STATES_WAITING_FOR_BSD_WAKEUP },
diff --git a/cpukit/libmisc/monitor/mon-prmisc.c 
b/cpukit/libmisc/monitor/mon-prmisc.c
index 5f10df1..5bb4d42 100644
--- a/cpukit/libmisc/monitor/mon-prmisc.c
+++ b/cpukit/libmisc/monitor/mon-prmisc.c
@@ -112,29 +112,31 @@ rtems_monitor_dump_priority(rtems_task_priority priority)
 return fprintf(stdout,"%3" PRId32, priority);
 }
 
+#define WITH_ID(state) (STATES_THREAD_QUEUE_WITH_IDENTIFIER | state)
+
 static const rtems_assoc_t rtems_monitor_state_assoc[] = {
 { "DELAY",  STATES_DELAYING, 0 },
 { "DORM",   STATES_DORMANT, 0 },
 { "LIFE",   STATES_LIFE_IS_CHANGING, 0 },
 { "SUSP",   STATES_SUSPENDED, 0 },
-{ "Wbar",   STATES_WAITING_FOR_BARRIER, 0 },
-{ "Wcvar",  STATES_WAITING_FOR_CONDITION_VARIABLE, 0 },
+{ "Wbar",   WITH_ID(STATES_WAITING_FOR_BARRIER), 0 },
+{ "Wcvar",  WITH_ID(STATES_WAITING_FOR_CONDITION_VARIABLE), 0 },
 { "Wevnt",  STATES_WAITING_FOR_EVENT, 0 },
 { "Wisig",  STATES_INTERRUPTIBLE_BY_SIGNAL, 0 },
 { "Wjatx",  STATES_WAITING_FOR_JOIN_AT_EXIT, 0 },
 { "Wjoin",  STATES_WAITING_FOR_JOIN, 0 },
-{ "Wmsg" ,  STATES_WAITING_FOR_MESSAGE, 0 },
-{ "Wmutex", STATES_WAITING_FOR_MUTEX, 0 },
+{ "Wmsg" ,  WITH_ID(STATES_WAITING_FOR_MESSAGE), 0 },
+{ "Wmutex", WITH_ID(STATES_WAITING_FOR_MUTEX), 0 },
 { "WRATE",  STATES_WAITING_FOR_PERIOD, 0 },
 { "Wrpc",   STATES_WAITING_FOR_RPC_REPLY, 0 },
-{ "Wrwlk",  STATES_WAITING_FOR_RWLOCK, 0 },
+{ "Wrwlk",  WITH_ID(STATES_WAITING_FOR_RWLOCK), 0 },
 { "Wseg",   STATES_WAITING_FOR_SEGMENT, 0 },
-{ "Wsem",   STATES_WAITING_FOR_SEMAPHORE, 0 },
+{ "Wsem",   WITH_ID(STATES_WAITING_FOR_SEMAPHORE), 0 },
 { "Wsig",   STATES_WAITING_FOR_SIGNAL, 0 },
-{ "Wslcnd", STATES_WAITING_FOR_SYS_LOCK_CONDITION, 0 },
-{ "Wslftx", STATES_WAITING_FOR_SYS_LOCK_FUTEX, 0 },
-{ "Wslmtx", STATES_WAITING_FOR_SYS_LOCK_MUTEX, 0 },
-{ "Wslsem", STATES_WAITING_FOR_SYS_LOCK_SEMAPHORE, 0 },
+{ "Wcvar",  STATES_WAITING_FOR_CONDITION_VARIABLE, 0 },
+{ "Wfutex", STATES_WAITING_FOR_FUTEX, 0 },
+{ "Wmutex", STATES_WAITING_FOR_MUTEX, 0 },
+{ "Wsem",   STATES_WAITING_FOR_SEMAPHORE, 0 },
 { "Wsysev", STATES_WAITING_FOR_SYSTEM_EVENT, 0 },
 { "Wtime",  STATES_WAITING_FOR_TIME, 0 },
 { "Wwkup",  STATES_WAITING_FOR_BSD_WAKEUP, 0 },
diff --git a/cpukit/posix/src/condwaitsupp.c b/cpukit/p

[PATCH 1/2] Add support for posix_devctl()

2017-01-10 Thread Joel Sherrill
---
 cpukit/libcsupport/Makefile.am|3 +-
 cpukit/libcsupport/src/devctl.c   |   72 ++
 cpukit/posix/src/sysconf.c|2 +
 testsuites/psxtests/Makefile.am   |3 +
 testsuites/psxtests/configure.ac  |1 +
 testsuites/psxtests/psxdevctl01/Makefile.am   |   23 ++
 testsuites/psxtests/psxdevctl01/main.c|   50 +
 testsuites/psxtests/psxdevctl01/psxdevctl01.doc   |   23 ++
 testsuites/psxtests/psxdevctl01/psxdevctl01.scn   |4 +
 testsuites/psxtests/psxdevctl01/test.c|   81 +
 testsuites/psxtests/psxhdrs/Makefile.am   |3 +
 testsuites/psxtests/psxhdrs/devctl/posix_devctl.c |   37 ++
 12 files changed, 301 insertions(+), 1 deletions(-)
 create mode 100644 cpukit/libcsupport/src/devctl.c
 create mode 100644 testsuites/psxtests/psxdevctl01/Makefile.am
 create mode 100644 testsuites/psxtests/psxdevctl01/main.c
 create mode 100644 testsuites/psxtests/psxdevctl01/psxdevctl01.doc
 create mode 100644 testsuites/psxtests/psxdevctl01/psxdevctl01.scn
 create mode 100644 testsuites/psxtests/psxdevctl01/test.c
 create mode 100644 testsuites/psxtests/psxhdrs/devctl/posix_devctl.c

diff --git a/cpukit/libcsupport/Makefile.am b/cpukit/libcsupport/Makefile.am
index bf78fa0..c9d2c7b 100644
--- a/cpukit/libcsupport/Makefile.am
+++ b/cpukit/libcsupport/Makefile.am
@@ -138,7 +138,8 @@ libcsupport_a_SOURCES += src/printertask.c
 libcsupport_a_SOURCES += $(LIBC_GLUE_C_FILES) $(PASSWORD_GROUP_C_FILES) \
 $(TERMINAL_IDENTIFICATION_C_FILES) $(SYSTEM_CALL_C_FILES) \
 $(DIRECTORY_SCAN_C_FILES) $(ID_C_FILES) src/envlock.c \
-$(TERMIOS_C_FILES) src/getpagesize.c src/getrusage.c
+$(TERMIOS_C_FILES) src/getpagesize.c src/getrusage.c src/devctl.c
+
 
 libcsupport_a_SOURCES += src/flockfile.c src/funlockfile.c src/ftrylockfile.c
 
diff --git a/cpukit/libcsupport/src/devctl.c b/cpukit/libcsupport/src/devctl.c
new file mode 100644
index 000..353e0a5
--- /dev/null
+++ b/cpukit/libcsupport/src/devctl.c
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2016 Joel Sherrill .  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#define _POSIX_26_C_SOURCE
+
+#include 
+#include 
+#include 
+
+int posix_devctl(
+  intfd,
+  intdcmd,
+  void *restrict dev_data_ptr,
+  size_t nbyte,
+  int *restrict  dev_info_ptr
+)
+{
+  /*
+   * The POSIX 1003.26 standard allows for library implementations
+   * that implement posix_devctl() using ioctl(). In this case,
+   * the extra parameters are largely ignored.
+   *
+   * The FACE Technical Standard requires only that FIONBIO
+   * be supported for sockets.
+   *
+   * This method appears to be rarely implemented and there are
+   * no known required use cases for this method beyond those 
+   * from ther FACE Technical Standard.
+   */
+
+  /*
+   * POSIX 1003.26 mentions that nbyte must be non-negative but this
+   * doesn't make sense because size_t is guaranteed to be unsigned.
+   */
+
+  /*
+   * Since this is implemented on top of ioctl(), the device information
+   * is not going to be passed down. Fill it in with zero so the behavior
+   * is defined.
+   */
+  if (dev_info_ptr != NULL) {
+*dev_info_ptr = 0;
+  }
+
+  return ioctl(fd, dcmd, dev_data_ptr);
+}
diff --git a/cpukit/posix/src/sysconf.c b/cpukit/posix/src/sysconf.c
index 0e7b1e5..c5f66f6 100644
--- a/cpukit/posix/src/sysconf.c
+++ b/cpukit/posix/src/sysconf.c
@@ -51,6 +51,8 @@ long sysconf(
   return (long) rtems_configuration_get_maximum_processors();
 case _SC_NPROCESSORS_ONLN:

[PATCH 2/2] Remove obsolete __RTEMS_HAVE_SYS_CPUSET_H__

2017-01-10 Thread Joel Sherrill
---
 cpukit/configure.ac  |7 --
 cpukit/libcsupport/Makefile.am   |2 +-
 cpukit/libcsupport/src/devctl.c  |   72 
 cpukit/libcsupport/src/posix_devctl.c|   72 
 cpukit/posix/include/rtems/posix/pthreadimpl.h   |2 +-
 cpukit/posix/src/pthread.c   |   10 +--
 cpukit/posix/src/pthreadattrcompare.c|   30 +++
 cpukit/posix/src/pthreadcreate.c |6 +-
 cpukit/rtems/include/rtems/rtems/tasks.h |4 -
 cpukit/rtems/src/schedulergetprocessorset.c  |4 -
 cpukit/rtems/src/taskgetaffinity.c   |3 -
 cpukit/rtems/src/tasksetaffinity.c   |3 -
 cpukit/score/include/rtems/score/cpuset.h|4 -
 cpukit/score/include/rtems/score/cpusetimpl.h|3 -
 cpukit/score/include/rtems/score/scheduler.h |6 +-
 cpukit/score/include/rtems/score/schedulerimpl.h |4 -
 cpukit/score/src/cpuset.c|4 -
 cpukit/score/src/cpusetprintsupport.c|   95 +++---
 cpukit/score/src/schedulergetaffinity.c  |4 -
 cpukit/score/src/schedulersetaffinity.c  |4 -
 testsuites/psxtests/configure.ac |3 -
 testsuites/smptests/configure.ac |4 -
 testsuites/smptests/smpaffinity01/init.c |   12 ---
 testsuites/sptests/Makefile.am   |3 -
 testsuites/sptests/configure.ac  |4 -
 testsuites/sptests/spcpuset01/init.c |   13 ---
 testsuites/sptests/spcpuset01/system.h   |2 -
 testsuites/sptests/spcpuset01/test.c |2 -
 testsuites/sptests/spscheduler01/init.c  |4 -
 29 files changed, 143 insertions(+), 243 deletions(-)
 delete mode 100644 cpukit/libcsupport/src/devctl.c
 create mode 100644 cpukit/libcsupport/src/posix_devctl.c

diff --git a/cpukit/configure.ac b/cpukit/configure.ac
index 3ebf596..4410bf1 100644
--- a/cpukit/configure.ac
+++ b/cpukit/configure.ac
@@ -119,7 +119,6 @@ RTEMS_CHECK_FUNC([pthread_getaffinity_np],[
 RTEMS_CHECK_FUNC([pthread_getattr_np],[
   #define _GNU_SOURCE
   #include ])
-AC_CHECK_HEADERS([sys/cpuset.h])
 
 # This was added to newlib in August 2014 to improve conformance.
 # Disable use of internal definition if it is present.
@@ -252,12 +251,6 @@ RTEMS_CPUOPT([RTEMS_VERSION],
   [RTEMS version string])
 
 ## Header file differences that need to be known in .h after install
-RTEMS_CPUOPT([__RTEMS_HAVE_SYS_CPUSET_H__],
-  [test x"${ac_cv_header_sys_cpuset_h}" = x"yes"],
-  [1],
-  [indicate if  is present in toolset])
-
-## Header file differences that need to be known in .h after install
 RTEMS_CPUOPT([__RTEMS_HAVE_DECL_SIGALTSTACK__],
   [test x"${ac_cv_have_decl_sigaltstack}" = x"yes"],
   [1],
diff --git a/cpukit/libcsupport/Makefile.am b/cpukit/libcsupport/Makefile.am
index c9d2c7b..559ad81 100644
--- a/cpukit/libcsupport/Makefile.am
+++ b/cpukit/libcsupport/Makefile.am
@@ -138,7 +138,7 @@ libcsupport_a_SOURCES += src/printertask.c
 libcsupport_a_SOURCES += $(LIBC_GLUE_C_FILES) $(PASSWORD_GROUP_C_FILES) \
 $(TERMINAL_IDENTIFICATION_C_FILES) $(SYSTEM_CALL_C_FILES) \
 $(DIRECTORY_SCAN_C_FILES) $(ID_C_FILES) src/envlock.c \
-$(TERMIOS_C_FILES) src/getpagesize.c src/getrusage.c src/devctl.c
+$(TERMIOS_C_FILES) src/getpagesize.c src/getrusage.c src/posix_devctl.c
 
 
 libcsupport_a_SOURCES += src/flockfile.c src/funlockfile.c src/ftrylockfile.c
diff --git a/cpukit/libcsupport/src/devctl.c b/cpukit/libcsupport/src/devctl.c
deleted file mode 100644
index 353e0a5..000
--- a/cpukit/libcsupport/src/devctl.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2016 Joel Sherrill .  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *notice, this list of conditions and the following disclaimer in the
- *documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE

Re: libbsd update to FreeBSD head (2017-01-09)

2017-01-10 Thread Gedare Bloom
Thanks for the great effort. Is it your intention to attempt to track
the FreeBSD head with libbsd?

On Tue, Jan 10, 2017 at 5:10 AM, Sebastian Huber
 wrote:
> Hello,
>
> I updated the libbsd from FreeBSD 9.3 to FreeBSD head (2017-01-09). This is
> a very big jump in terms of FreeBSD development. The main goal is to catch
> up with FreeBSD and unify the baseline of the different parts of the libbsd.
> The network, USB and SD/MMC card parts used different FreeBSD versions.
> Thus, using an USB network component didn't work before due to incompatible
> network stack interfaces. There will be some work to do for each supported
> BSP after the update, e.g. adjustment of network interface drivers. I guess
> the x86 support is now broken.
>
> I created a "freebsd-9.3" branch before the update.
>
> --
> Sebastian Huber, embedded brains GmbH
>
> Address : Dornierstr. 4, D-82178 Puchheim, Germany
> Phone   : +49 89 189 47 41-16
> Fax : +49 89 189 47 41-09
> E-Mail  : sebastian.hu...@embedded-brains.de
> PGP : Public key available on request.
>
> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
>
> ___
> 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
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH 1/2] Add support for posix_devctl()

2017-01-10 Thread Gedare Bloom
two typos below:

On Tue, Jan 10, 2017 at 6:57 PM, Joel Sherrill  wrote:
> ---
>  cpukit/libcsupport/Makefile.am|3 +-
>  cpukit/libcsupport/src/devctl.c   |   72 ++
>  cpukit/posix/src/sysconf.c|2 +
>  testsuites/psxtests/Makefile.am   |3 +
>  testsuites/psxtests/configure.ac  |1 +
>  testsuites/psxtests/psxdevctl01/Makefile.am   |   23 ++
>  testsuites/psxtests/psxdevctl01/main.c|   50 +
>  testsuites/psxtests/psxdevctl01/psxdevctl01.doc   |   23 ++
>  testsuites/psxtests/psxdevctl01/psxdevctl01.scn   |4 +
>  testsuites/psxtests/psxdevctl01/test.c|   81 
> +
>  testsuites/psxtests/psxhdrs/Makefile.am   |3 +
>  testsuites/psxtests/psxhdrs/devctl/posix_devctl.c |   37 ++
>  12 files changed, 301 insertions(+), 1 deletions(-)
>  create mode 100644 cpukit/libcsupport/src/devctl.c
>  create mode 100644 testsuites/psxtests/psxdevctl01/Makefile.am
>  create mode 100644 testsuites/psxtests/psxdevctl01/main.c
>  create mode 100644 testsuites/psxtests/psxdevctl01/psxdevctl01.doc
>  create mode 100644 testsuites/psxtests/psxdevctl01/psxdevctl01.scn
>  create mode 100644 testsuites/psxtests/psxdevctl01/test.c
>  create mode 100644 testsuites/psxtests/psxhdrs/devctl/posix_devctl.c
>
> diff --git a/cpukit/libcsupport/Makefile.am b/cpukit/libcsupport/Makefile.am
> index bf78fa0..c9d2c7b 100644
> --- a/cpukit/libcsupport/Makefile.am
> +++ b/cpukit/libcsupport/Makefile.am
> @@ -138,7 +138,8 @@ libcsupport_a_SOURCES += src/printertask.c
>  libcsupport_a_SOURCES += $(LIBC_GLUE_C_FILES) $(PASSWORD_GROUP_C_FILES) \
>  $(TERMINAL_IDENTIFICATION_C_FILES) $(SYSTEM_CALL_C_FILES) \
>  $(DIRECTORY_SCAN_C_FILES) $(ID_C_FILES) src/envlock.c \
> -$(TERMIOS_C_FILES) src/getpagesize.c src/getrusage.c
> +$(TERMIOS_C_FILES) src/getpagesize.c src/getrusage.c src/devctl.c
> +
>
>  libcsupport_a_SOURCES += src/flockfile.c src/funlockfile.c src/ftrylockfile.c
>
> diff --git a/cpukit/libcsupport/src/devctl.c b/cpukit/libcsupport/src/devctl.c
> new file mode 100644
> index 000..353e0a5
> --- /dev/null
> +++ b/cpukit/libcsupport/src/devctl.c
> @@ -0,0 +1,72 @@
> +/*
> + * Copyright (c) 2016 Joel Sherrill .  All rights reserved.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + * 1. Redistributions of source code must retain the above copyright
> + *notice, this list of conditions and the following disclaimer.
> + * 2. Redistributions in binary form must reproduce the above copyright
> + *notice, this list of conditions and the following disclaimer in the
> + *documentation and/or other materials provided with the distribution.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
> + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
> + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
> + * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
> + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
> + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
> + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
> + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
> + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
> + * SUCH DAMAGE.
> + */
> +
> +#if HAVE_CONFIG_H
> +#include "config.h"
> +#endif
> +
> +#define _POSIX_26_C_SOURCE
> +
> +#include 
> +#include 
> +#include 
> +
> +int posix_devctl(
> +  intfd,
> +  intdcmd,
> +  void *restrict dev_data_ptr,
> +  size_t nbyte,
> +  int *restrict  dev_info_ptr
> +)
> +{
> +  /*
> +   * The POSIX 1003.26 standard allows for library implementations
> +   * that implement posix_devctl() using ioctl(). In this case,
> +   * the extra parameters are largely ignored.
> +   *
> +   * The FACE Technical Standard requires only that FIONBIO
> +   * be supported for sockets.
> +   *
> +   * This method appears to be rarely implemented and there are
> +   * no known required use cases for this method beyond those
> +   * from ther FACE Technical Standard.
typo: ther -> the

> diff --git a/testsuites/psxtests/psxdevctl01/psxdevctl01.doc 
> b/testsuites/psxtests/psxdevctl01/psxdevctl01.doc
> new file mode 100644
> index 000..606e0d5
> --- /dev/null
> +++ b/testsuites/psxtests/psxdevctl01/psxdevctl01.doc
> @@ -0,0 +1,23 @@
> +#  COPYRIGHT (c) 2016.
> +#  On-Line Applications Research Corporation (OAR).
> +#
> +#  The license and distribution terms for this file may be
> +#  found in the file LICENSE in this distribution or at
> 

Re: libbsd update to FreeBSD head (2017-01-09)

2017-01-10 Thread Sebastian Huber

On 11/01/17 02:28, Gedare Bloom wrote:

Thanks for the great effort. Is it your intention to attempt to track
the FreeBSD head with libbsd?


An automated and regular update would be nice, but my TODO list is 
already quite long.


What we should definitely avoid in the future is an import from 
different FreeBSD versions. This made the current update quite time 
consuming.


--
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail  : sebastian.hu...@embedded-brains.de
PGP : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.

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

Re: [PATCH 2/2] Remove obsolete __RTEMS_HAVE_SYS_CPUSET_H__

2017-01-10 Thread Sebastian Huber



On 11/01/17 00:57, Joel Sherrill wrote:

diff --git a/cpukit/libcsupport/src/devctl.c b/cpukit/libcsupport/src/devctl.c
deleted file mode 100644
index 353e0a5..000
--- a/cpukit/libcsupport/src/devctl.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2016 Joel Sherrill.  All rights reserved.


Are you sure you want to delete this stuff from patch 1 in patch 2?

--
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail  : sebastian.hu...@embedded-brains.de
PGP : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.

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


Re: [PATCH 1/2] Add support for posix_devctl()

2017-01-10 Thread Sebastian Huber
I didn't find a posix_devctl() in FreeBSD and glibc. Is there a 
reference implementation? Which systems do actually use this stuff?


--
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail  : sebastian.hu...@embedded-brains.de
PGP : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.

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