RE: [PATCH] Tester: Added pc386 bsp support

2020-02-05 Thread Lou Woods
> On 5/2/20 3:34 am, Lou Woods wrote:
> > Added pc386 BSP support to rtems-tester.
> 
> How does this differ from pc.ini? Why is a copy needed?
The bsp specified is different pc686 versus pc386. On second thought, perhaps 
the patch can be discarded.  The execution is no different for the two BSPs, 
right?  The only difference would be the BSP name on the test report, would you 
agree?
> 
> https://git.rtems.org/rtems-tools/tree/tester/rtems/testing/bsps/pc.ini
> 
> Chris

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


[PATCH] Tester: Added pc386 bsp support

2020-02-04 Thread Lou Woods
Added pc386 BSP support to rtems-tester.
---
 tester/rtems/testing/bsps/pc386.ini | 37 +
 1 file changed, 37 insertions(+)
 create mode 100644 tester/rtems/testing/bsps/pc386.ini

diff --git a/tester/rtems/testing/bsps/pc386.ini 
b/tester/rtems/testing/bsps/pc386.ini
new file mode 100644
index 000..c137342
--- /dev/null
+++ b/tester/rtems/testing/bsps/pc386.ini
@@ -0,0 +1,37 @@
+#
+# RTEMS Tools Project (http://www.rtems.org/)
+# Copyright 2010-2017 Chris Johns (chr...@rtems.org)
+# All rights reserved.
+#
+# This file is part of the RTEMS Tools package in 'rtems-tools'.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# 1. Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+#
+# 2. Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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.
+#
+
+[pc386]
+bsp   = pc386
+arch  = i386
+jobs  = 1
+tester= %{_rtscripts}/tftp.cfg
+test_restarts = 3
+requires  = bsp_tty_dev, target_on_command, target_off_command, 
target_reset_command
-- 
1.8.3.1

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


PC386 BSP Serial Console Problems

2020-01-29 Thread Lou Woods
Hello all,

I've been working on getting an old PC based SBC (Winsystems EBC-855) up and 
running in our RTEMS lab and I'm having a problem getting the serial console to 
work.  The VGA console is works, however when the executable is started with 
the -console=/dev/com1 command line argument the output to COM1 is 
unprintable/incorrect characters AKA garbage.  The serial output looks like a 
baud rate mismatch.  It is almost like baud rate is just a little off.  
Unfortunately, I don't have the means to measure the actual baud rate.

Has anyone done this recently?

I'm using the latest RTEMS head, pc386 BSP, and ticker test.  I've been testing 
this configuration by chain loading TFTP via IPXE which seems to work well.  In 
order to verify my end to end configuration works, I also tested this on a Dell 
Optiplex 755 Intel Core 2 Duo computer.  With this configuration I was able 
verify the same serial corruption exists on this computer under RTEMS and I was 
able to demonstrate that while running Windows I could use the same serial 
port, cabling, baud rates and serial host computer for serial communications.

The BSP is configured to use 9600bps 8-N-1 with no flow control by default.
Here is how RTEMS is configured:
../rtems/configure --target=i386-rtems5 --enable-rtemsbsp=pc386 
IDE_USE_PRIMARY_INTERFACE=0 --prefix=/home/woods/pc386/bsp-install/ 
--disable-networking --enable-posix --disable-smp --disable-multiprocessing 
--enable-tests --enable-cxx --enable-maintainer-mode

The serial host is a Raspberry Pi 3 running Debian (Raspian) Stretch.

These are the things I've tried, not in combination:
- sweeping the baud rate on the serial host while holding the board at 9600 8N1
- trying different baud rates in lock-step board and serial host.
- various combination of hardware flow control, parity, word size, stop bits.
- Winsystems board talking to a Windows PC running Foxterm.
- Running RTEMS 4.11 branch with current i386 toolschain - exe hangs, haven't 
tracked down error yet.
- COM2 port on the Winsystems board.
- Changing the clock rate for the baud-rate divisor in RTEMS
- 3 wire serial communications with RX, TX, and GND

Does anyone have any ideas?  I will open a ticket on this as well.

Thanks,
Lou Woods
OAR
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

[PATCH] zynq-uart: Added support to conditionally flush UART before reset.

2020-01-28 Thread Lou Woods
From: Lou Woods 

Added support to flush the UART's transmit hardware buffer before
resetting the UART if the transmit enable bit is set initially.

This flush allows for delivery of remaining characters left
behind by the bootloader before the RTEMS init.

It was found that when booting with TFTP from the latest U-Boot for
the Zynq (U-Boot git hash 6cb87cbb1475f668689f95911d1521ee6ba7f55c)
on the Zedboard, the system truncated the TFTP boot messages and
printed invalid characters to the terminal.  This serial corruption
interfered with the RTEMS testsuite output indicating the start
of a test.  Flushing out the TX buffer before resetting the UART
restored the missing TFTP boot messages and stopped the invalid
characters from being printed.
---
 bsps/arm/shared/serial/zynq-uart.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/bsps/arm/shared/serial/zynq-uart.c 
b/bsps/arm/shared/serial/zynq-uart.c
index 92a8c86..10b32a5 100644
--- a/bsps/arm/shared/serial/zynq-uart.c
+++ b/bsps/arm/shared/serial/zynq-uart.c
@@ -123,6 +123,11 @@ void zynq_uart_initialize(rtems_termios_device_context 
*base)
   uint32_t brgr = 0x3e;
   uint32_t bauddiv = 0x6;
 
+  if ((regs->control & ZYNQ_UART_CONTROL_TXEN) > 0) {
+/* Empty the TX buffer in case data is left from the bootloader */
+zynq_uart_reset_tx_flush(ctx);
+  }
+
   zynq_cal_baud_rate(ZYNQ_UART_DEFAULT_BAUD, , , regs->mode);
 
   regs->control &= ~(ZYNQ_UART_CONTROL_RXEN | ZYNQ_UART_CONTROL_TXEN);
-- 
1.8.3.1

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


Link issue on xilinx_zynq_a9_qemu BSP on rtems-libbsd head

2020-01-15 Thread Lou Woods
Hello all,

I just pulled from the master of both rtems 
(362cf319d44e7e64987f12aa36ea030e6298c586) and rtems-libbsd 
(d892051f37c2c4ad7f345f6a817ea3d38e56a431) trees and ran into an couple 
undefined references when linking an application outside of the tree.  The 
application doesn't directly use either symbol and has worked unmodified on 
older trees.  This build issue is not present when using the 5-freebsd-12 
branch of rtems-libbsd on the same application code.  I can move forward with 
the 5-freebsd-12 branch so this isn't a show stopper for me.

$ make
arm-rtems5-gcc --pipe -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard 
-mtune=cortex-a9 -O0 -g -ffunction-sections -fdata-sections -Wall 
-Wmissing-prototypes -Wimplicit-function-declaration -Wstrict-prototypes 
-Wnested-externs -B 
/home/woods/zynq-quickstart-trial/bsp-install/arm-rtems5/xilinx_zynq_a9_qemu/lib/
 -specs bsp_specs -qrtems init.c  -o init.exe -lbsd -lm -ltelnetd
/data/home/woods/zynq-quickstart-trial/tools/bin/../lib/gcc/arm-rtems5/7.5.0/../../../../arm-rtems5/bin/ld:
 
/home/woods/zynq-quickstart-trial/bsp-install/arm-rtems5/xilinx_zynq_a9_qemu/lib/libbsd.a(uipc_mbuf.c.18.o):
 in function `m_unmappedtouio':
/data/home/woods/zynq-quickstart-trial/rtems-libbsd/build/arm-rtems5-xilinx_zynq_a9_qemu-default/../../freebsd/sys/kern/uipc_mbuf.c:1813:
 undefined reference to `PHYS_TO_VM_PAGE'
/data/home/woods/zynq-quickstart-trial/tools/bin/../lib/gcc/arm-rtems5/7.5.0/../../../../arm-rtems5/bin/ld:
 
/data/home/woods/zynq-quickstart-trial/rtems-libbsd/build/arm-rtems5-xilinx_zynq_a9_qemu-default/../../freebsd/sys/kern/uipc_mbuf.c:1814:
 undefined reference to `uiomove_fromphys'
collect2: error: ld returned 1 exit status
make: *** [init.exe] Error 1

RTEMS was configured like this:
../rtems/configure --prefix=${rw}/bsp-install --target=arm-rtems5 \
 --enable-rtemsbsp=xilinx_zynq_a9_qemu --disable-networking

libbsd was configured like this:
$ git clone git://git.rtems.org/rtems-libbsd.git
$ cd ./rtems-libbsd
$ git submodule init
$ git submodule update rtems_waf
$ python3 ./waf configure --rtems-tools=${rw}/tools --rtems=${rw}/bsp-install \
 --prefix=${rw}/bsp-install --rtems-bsps=arm/xilinx_zynq_a9_qemu
$ python3 ./waf
$ python3 ./waf install

Makefile

include $(RTEMS_MAKEFILE_PATH)/Makefile.inc
include $(RTEMS_MAKEFILE_PATH)/make/target.cfg
include $(RTEMS_CUSTOM)

all: init.exe

CFLAGS += -B ${RTEMS_MAKEFILE_PATH}/lib/ -specs bsp_specs -qrtems

init.exe: init.c
$(CC) $(CFLAGS) init.c  -o $@ -lbsd -lm -ltelnetd

 clean:
 init.exe  

If any other information can be useful, please let me know.

Thanks,
Lou Woods
On-Line Applications Research

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


RE: [PATCH] tester: Prefer '_' as test state separator char

2020-01-07 Thread Lou Woods
To add some test data to this topic, I applied this patch to rtems-tools and 
ran the testsuite on the BeagleBone Black.  See the results below.
The testsuite completed without error.

Passed:578
Failed: 13
User Input:  6
Expected Fail:   0
Indeterminate:   0
Benchmark:   3
Timeout: 1
Invalid: 1
Wrong Version:   0
Wrong Build: 0
Wrong Tools: 0
--
Total: 602
Failures:
 i2c01.exe
 termios09.exe
 psxfenv01.exe
 spcache01.exe
 spconfig02.exe
 spintrcritical01.exe
 spintrcritical02.exe
 spintrcritical03.exe
 spintrcritical04.exe
 spintrcritical05.exe
 spsysinit01.exe
 tmcontext01.exe
 tmtimer01.exe
User Input:
 dl10.exe
 monitor.exe
 termios.exe
 top.exe
 capture.exe
 fileio.exe
Benchmark:
 dhrystone.exe
 linpack.exe
 whetstone.exe
Timeouts:
 dl06.exe
Invalid:
 mouse01.exe
Average test time: 0:00:14.840996
Testing time : 2:28:54.279823

> -Original Message-
> From: devel  On Behalf Of Sebastian Huber
> Sent: Wednesday, December 18, 2019 2:29 AM
> To: rtems-de...@rtems.org
> Subject: Re: [PATCH] tester: Prefer '_' as test state separator char
> 
> Hello Chris,
> 
> if this change is all right for you I would push it and update the RSB to 
> pick up
> the recent fixes in the tools.
> 
> --
> 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

[PATCH 2/2] mqueueopen.c: Changed thread release order to priority

2019-08-29 Thread Lou Woods
From: Lou Woods 

Changed the POSIX message queue thread release order from
FIFO to priority per the Open Group Specification.
http://pubs.opengroup.org/onlinepubs/9699919799/functions/mq_receive.html

closes #3791.
---
 cpukit/posix/src/mqueueopen.c | 16 +++-
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/cpukit/posix/src/mqueueopen.c b/cpukit/posix/src/mqueueopen.c
index 4bb8025..f613002 100644
--- a/cpukit/posix/src/mqueueopen.c
+++ b/cpukit/posix/src/mqueueopen.c
@@ -90,16 +90,22 @@ static mqd_t _POSIX_Message_queue_Create(
   the_mq->oflag = oflag;
 
   /*
-   *  NOTE: That thread blocking discipline should be based on the
-   *  current scheduling policy.
+   *  NOTE: That thread blocking discipline is priority based on text from the
+   *  Open Group cited below.  This is not a new requirement and was present
+   *  in the 1997 specification.
*
-   *  Joel: Cite POSIX or OpenGroup on above statement so we can determine
-   *if it is a real requirement.
+   *  mq_receive() Description Paragraph 4:
+   *If more than one thread is waiting to receive a message when a message
+   *arrives at an empty queue and the Priority Scheduling option is
+   *supported, then the thread of highest priority that has been waiting
+   *the longest shall be selected to receive the message.
+   *  http://pubs.opengroup.org/onlinepubs/9699919799/functions/mq_receive.html
+   *  The Open Group Base Specifications Issue 7, 2018 edition
*/
   if (
 !_CORE_message_queue_Initialize(
   _mq->Message_queue,
-  CORE_MESSAGE_QUEUE_DISCIPLINES_FIFO,
+  CORE_MESSAGE_QUEUE_DISCIPLINES_PRIORITY,
   attr->mq_maxmsg,
   attr->mq_msgsize
 )
-- 
1.8.3.1

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


[PATCH 1/2] psxmsgq05: Added priority unblocking mq tests

2019-08-29 Thread Lou Woods
From: Lou Woods 

This test exercises the unblocking order of a POSIX
message queue

-Added psxmsgq05 test to the make structure.
-Added tests, doc, and scn output.

updates #3791.
---
 testsuites/psxtests/Makefile.am |  10 +
 testsuites/psxtests/configure.ac|   1 +
 testsuites/psxtests/psxmsgq05/init.c| 440 
 testsuites/psxtests/psxmsgq05/psxmsgq05.doc |  42 +++
 testsuites/psxtests/psxmsgq05/psxmsgq05.scn |   4 +
 testsuites/psxtests/psxmsgq05/system.h  |  56 
 6 files changed, 553 insertions(+)
 mode change 100755 => 100644 testsuites/psxtests/Makefile.am
 create mode 100644 testsuites/psxtests/psxmsgq05/init.c
 create mode 100644 testsuites/psxtests/psxmsgq05/psxmsgq05.doc
 create mode 100644 testsuites/psxtests/psxmsgq05/psxmsgq05.scn
 create mode 100644 testsuites/psxtests/psxmsgq05/system.h

diff --git a/testsuites/psxtests/Makefile.am b/testsuites/psxtests/Makefile.am
old mode 100755
new mode 100644
index c12b036..52c9644
--- a/testsuites/psxtests/Makefile.am
+++ b/testsuites/psxtests/Makefile.am
@@ -685,6 +685,16 @@ psxmsgq04_CPPFLAGS = $(AM_CPPFLAGS) 
$(TEST_FLAGS_psxmsgq04) \
$(support_includes) -I$(top_srcdir)/include
 endif
 
+if TEST_psxmsgq05
+psx_tests += psxmsgq05
+psx_screens += psxmsgq05/psxmsgq05.scn
+psx_docs += psxmsgq05/psxmsgq05.doc
+psxmsgq05_SOURCES = psxmsgq05/init.c psxmsgq05/system.h \
+   include/pmacros.h ../support/src/test_support.c
+psxmsgq05_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_psxmsgq05) \
+   $(support_includes) -I$(top_srcdir)/include
+endif
+
 if TEST_psxmutexattr01
 psx_tests += psxmutexattr01
 psx_screens += psxmutexattr01/psxmutexattr01.scn
diff --git a/testsuites/psxtests/configure.ac b/testsuites/psxtests/configure.ac
index bb44bb8..32d143a 100644
--- a/testsuites/psxtests/configure.ac
+++ b/testsuites/psxtests/configure.ac
@@ -112,6 +112,7 @@ RTEMS_TEST_CHECK([psxmsgq01])
 RTEMS_TEST_CHECK([psxmsgq02])
 RTEMS_TEST_CHECK([psxmsgq03])
 RTEMS_TEST_CHECK([psxmsgq04])
+RTEMS_TEST_CHECK([psxmsgq05])
 RTEMS_TEST_CHECK([psxmutexattr01])
 RTEMS_TEST_CHECK([psxndbm01])
 RTEMS_TEST_CHECK([psxobj01])
diff --git a/testsuites/psxtests/psxmsgq05/init.c 
b/testsuites/psxtests/psxmsgq05/init.c
new file mode 100644
index 000..ab06156
--- /dev/null
+++ b/testsuites/psxtests/psxmsgq05/init.c
@@ -0,0 +1,440 @@
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (C) 2019 On-Line Applications Research.  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 COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#define CONFIGURE_INIT
+#include "system.h"
+
+#include/* For O_* constants */
+#include 
+#include 
+#include 
+#include 
+
+#include "test_support.h"
+
+const char rtems_test_name[] = "PSXMSGQ 5";
+
+#define DEFAULT_WAIT 5
+#define DEFAULT_BUFFER_SIZE 4
+#define TASKS 2
+
+struct task_args {
+  mqd_t *p_main_msgQ;
+  sem_t *p_task_sem;
+  int wait_timeout;
+  bool receive_test;
+};
+
+/* forward declarations to avoid warnings */
+static int test_msgQ_unblock_order(
+  bool  receive_test,/* true to test receive order, false for
+send order */
+  bool *task1_released,  /* set by function to indicate task1 was
+released */
+  bool *task2_released   /* set by function to indicate task2 was
+released */
+);
+static void *taskEntry( void *arg );
+
+/* The taskEntry function calls send or receive on the provided message queue
+ * and will block waiting to receive or send a message depending on the
+ * receive_test flag.  Once the tasked is unblocked it wi

[PATCH 1/2] namespace.h: Reversed additional hidden names.

2019-05-06 Thread Lou Woods
From: Lou Woods 

These hidden names were unresolved external symbols in
libbsd when loaded by the RTL.

The symbols _nanosleep, _accept, _select, and _listen are used
by rcmd.c and needed to be mapped to the correct name.
These symbols were removed from un-namespace.h as well.
---
 freebsd/lib/libc/include/namespace.h| 4 
 freebsd/lib/libc/include/un-namespace.h | 3 ---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/freebsd/lib/libc/include/namespace.h 
b/freebsd/lib/libc/include/namespace.h
index 08a8c67..4485aee 100644
--- a/freebsd/lib/libc/include/namespace.h
+++ b/freebsd/lib/libc/include/namespace.h
@@ -256,8 +256,11 @@
 #define _getprogname   getprogname
 #define _getsockname   getsockname
 #ifdef __rtems__
+#define _acceptaccept
 #define _bind  bind
 #define _getsockoptgetsockopt
+#define _listenlisten
+#define _nanosleep nanosleep
 #define _poll  poll
 #define _pthread_getspecific   pthread_getspecific
 #define _pthread_key_createpthread_key_create
@@ -268,6 +271,7 @@
 #define _pthread_rwlock_unlock pthread_rwlock_unlock
 #define _pthread_rwlock_wrlock pthread_rwlock_wrlock
 #define _pthread_setspecific   pthread_setspecific
+#define _selectselect
 #endif /* __rtems__ */
 
 #endif /* _NAMESPACE_H_ */
diff --git a/freebsd/lib/libc/include/un-namespace.h 
b/freebsd/lib/libc/include/un-namespace.h
index 33c7b00..126ae03 100644
--- a/freebsd/lib/libc/include/un-namespace.h
+++ b/freebsd/lib/libc/include/un-namespace.h
@@ -32,7 +32,6 @@
 #define _UN_NAMESPACE_H_
 
 #ifdef __rtems__
-#undef accept
 #undef __acl_aclcheck_fd
 #undef __acl_delete_fd
 #undef __acl_get_fd
@@ -62,7 +61,6 @@
 #undef getsockopt
 #undef ioctl
 #undef kevent
-#undef listen
 #undef nanosleep
 #undef open
 #undef openat
@@ -195,7 +193,6 @@
 #undef recvfrom
 #undef recvmsg
 #undef recvmmsg
-#undef select
 #undef sem_close
 #undef sem_destroy
 #undef sem_getvalue
-- 
1.8.3.1

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


[PATCH 2/2] rcmd.c: Removed references to unsupported functions

2019-05-06 Thread Lou Woods
From: Lou Woods 

rcmdsh() and innetgr() are referenced by rcmd, but aren’t available
in libbsd and are unresolvable external symbols when libbsd.a is
processed by the RTL.

innetgr() is part of netgroup and could be ported in at some point
in the future.

rcmdsh() uses fork() and exec() so uses of rcmdsh function have been
removed.
---
 freebsd/lib/libc/net/rcmd.c | 20 
 1 file changed, 20 insertions(+)

diff --git a/freebsd/lib/libc/net/rcmd.c b/freebsd/lib/libc/net/rcmd.c
index bc6a583..a35faa7 100644
--- a/freebsd/lib/libc/net/rcmd.c
+++ b/freebsd/lib/libc/net/rcmd.c
@@ -64,7 +64,9 @@ __FBSDID("$FreeBSD$");
 #include "un-namespace.h"
 #include "libc_private.h"
 
+#ifndef __rtems__ /* netgroup/innetgr not supported in RTEMS */
 extern int innetgr( const char *, const char *, const char *, const char * );
+#endif /* __rtems__ */
 
 #define max(a, b)  ((a > b) ? a : b)
 
@@ -98,6 +100,7 @@ rcmd_af(char **ahost, int rport, const char *locuser, const 
char *remuser,
char num[8];
static char canonnamebuf[MAXDNAME]; /* is it proper here? */
 
+#ifndef __rtems__ /* rcmdsh not supported in RTEMS */
/* call rcmdsh() with specified remote shell if appropriate. */
if (!issetugid() && (p = getenv("RSH"))) {
struct servent *sp = getservbyname("shell", "tcp");
@@ -115,6 +118,7 @@ rcmd_af(char **ahost, int rport, const char *locuser, const 
char *remuser,
return (rcmdsh(ahost, rport, locuser, remuser,
cmd, NULL));
}
+#endif /* __rtems__ */
 
pid = getpid();
 
@@ -624,17 +628,25 @@ __ivaliduser_sa(FILE *hostf, const struct sockaddr 
*raddr, socklen_t salen,
break;
}
if (buf[1] == '@')  /* match a host by netgroup */
+#ifndef __rtems__
hostok = hname[0] != '\0' &&
innetgr([2], hname, NULL, ypdomain);
+#else /* __rtems__ */
+   return(-1);
+#endif /* __rtems__ */
else/* match a host by addr */
hostok = __icheckhost(raddr, salen,
  (char *)[1]);
break;
case '-': /* reject '-' hosts and all their users */
if (buf[1] == '@') {
+#ifndef __rtems__
if (hname[0] == '\0' ||
innetgr([2], hname, NULL, ypdomain))
return(-1);
+#else /* __rtems__ */
+   return(-1);
+#endif /* __rtems__ */
} else {
if (__icheckhost(raddr, salen,
 (char *)[1]))
@@ -652,7 +664,11 @@ __ivaliduser_sa(FILE *hostf, const struct sockaddr *raddr, 
socklen_t salen,
break;
}
if (*(user+1) == '@')  /* match a user by netgroup */
+#ifndef __rtems__
userok = innetgr(user+2, NULL, ruser, ypdomain);
+#else /* __rtems__ */
+   return(-1);
+#endif /* __rtems__ */
else   /* match a user by direct specification */
userok = !(strcmp(ruser, user+1));
break;
@@ -661,9 +677,13 @@ __ivaliduser_sa(FILE *hostf, const struct sockaddr *raddr, 
socklen_t salen,
if (!*(user+1))
return(-1);
if (*(user+1) == '@') {
+#ifndef __rtems__
if (innetgr(user+2, NULL,
ruser, ypdomain))
return(-1);
+#else /* __rtems__ */
+   return(-1);
+#endif /* __rtems__ */
} else {
if (!strcmp(ruser, user+1))
return(-1);
-- 
1.8.3.1

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

RE: [PATCH 2/2] rcmd.c: Removed references to unsupported functions

2019-05-06 Thread Lou Woods
All,
I verified that rcmdsh isn't part of libbsd, but as Chris pointed out I didn't 
add the pre-processor guards according to the CONTRIBUTING.md guide.  I'll fix 
my mistakes on that and resubmit.  Sorry about that.  

Lou

> -Original Message-
> From: devel  On Behalf Of Joel Sherrill
> Sent: Monday, May 6, 2019 9:31 AM
> To: Peter Dufault 
> Cc: Lou Woods ; RTEMS Devel  devel@rtems.org>
> Subject: Re: [PATCH 2/2] rcmd.c: Removed references to unsupported
> functions
> 
> 
> 
> On Mon, May 6, 2019 at 8:49 AM  <mailto:dufa...@hda.com> > wrote:
> 
> 
> 
> 
>   On May 6, 2019, at 01:02 , Sebastian Huber
>  <mailto:sebastian.hu...@embedded-brains.de> > wrote:
> 
>   On 05/05/2019 03:00, Chris Johns wrote:
> 
> 
>   On 5/5/19 12:21 am, Joel Sherrill wrote:
> 
> 
>   Sorry for missing that it actually was
> referenced
> 
>   Rcmd can and should work. Rcmdsh will not
> ever and should be removed from libbsd.
> 
>   Does rcmd need testing? It clearly had no test
> since it wouldn't have linked.
> 
> 
> 
>   Yes that would be great. Testing libbsd is a
> complicated.
> 
> 
> 
>   If it is used by applications it should be tested, otherwise we
> should remove it from the build to make it a little faster and reduce the
> maintenance costs of libbsd.
> 
> 
> 
>   It is used.  The use may be removed (this is a port from vxWorks) but
> as part of a baseline it is used.
> 
> 
> Just to be specific again. rcmd() can be made to work. rcmdsh() uses fork()
> and exec() so will never work.
> 
> Lou's patch added conditionals to rcmd() to get around missing netgroup
> methods and avoid invoking rcmdsh() on one path.
> 
> An update to this patch (or a follow up) needs to remove rcmdsh* from the
> rtems-libbsd source
> 
> I suppose Lou also needs to add a test that verifies rcmd() works.
> 
> --joel
> 
> 
> 
> 
> 
>   Peter
>   -
>   Peter Dufault
>   HD Associates, Inc.  Software and System Engineering
> 
> 
>   This email is delivered through the public internet using protocols
> subject to interception and tampering.
> 

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


[PATCH 2/2] rcmd.c: Removed references to unsupported functions

2019-05-03 Thread Lou Woods
From: Lou Woods 

rcmdsh() and innetgr() are referenced by rcmd, but aren’t available
in libbsd and are unresolvable external symbols when libbsd.a is
processed by the RTL.

innetgr() is part of netgroup and could be ported in at some point
in the future.

rcmdsh() uses fork() and exec() so uses of rcmdsh function have been
removed.
---
 freebsd/lib/libc/net/rcmd.c | 22 ++
 1 file changed, 22 insertions(+)

diff --git a/freebsd/lib/libc/net/rcmd.c b/freebsd/lib/libc/net/rcmd.c
index bc6a583..08d1a78 100644
--- a/freebsd/lib/libc/net/rcmd.c
+++ b/freebsd/lib/libc/net/rcmd.c
@@ -64,7 +64,9 @@ __FBSDID("$FreeBSD$");
 #include "un-namespace.h"
 #include "libc_private.h"
 
+#ifndef __rtems__ /* netgroup/innetgr not supported in RTEMS */
 extern int innetgr( const char *, const char *, const char *, const char * );
+#endif
 
 #define max(a, b)  ((a > b) ? a : b)
 
@@ -98,6 +100,8 @@ rcmd_af(char **ahost, int rport, const char *locuser, const 
char *remuser,
char num[8];
static char canonnamebuf[MAXDNAME]; /* is it proper here? */
 
+#ifndef __rtems__ /* rcmdsh not supported in RTEMS */
+
/* call rcmdsh() with specified remote shell if appropriate. */
if (!issetugid() && (p = getenv("RSH"))) {
struct servent *sp = getservbyname("shell", "tcp");
@@ -116,6 +120,8 @@ rcmd_af(char **ahost, int rport, const char *locuser, const 
char *remuser,
cmd, NULL));
}
 
+#endif
+
pid = getpid();
 
memset(, 0, sizeof(hints));
@@ -624,17 +630,25 @@ __ivaliduser_sa(FILE *hostf, const struct sockaddr 
*raddr, socklen_t salen,
break;
}
if (buf[1] == '@')  /* match a host by netgroup */
+#ifndef __rtems__
hostok = hname[0] != '\0' &&
innetgr([2], hname, NULL, ypdomain);
+#else
+   return(-1);
+#endif
else/* match a host by addr */
hostok = __icheckhost(raddr, salen,
  (char *)[1]);
break;
case '-': /* reject '-' hosts and all their users */
if (buf[1] == '@') {
+#ifndef __rtems__
if (hname[0] == '\0' ||
innetgr([2], hname, NULL, ypdomain))
return(-1);
+#else
+   return(-1);
+#endif
} else {
if (__icheckhost(raddr, salen,
 (char *)[1]))
@@ -652,7 +666,11 @@ __ivaliduser_sa(FILE *hostf, const struct sockaddr *raddr, 
socklen_t salen,
break;
}
if (*(user+1) == '@')  /* match a user by netgroup */
+#ifndef __rtems__
userok = innetgr(user+2, NULL, ruser, ypdomain);
+#else
+   return(-1);
+#endif
else   /* match a user by direct specification */
userok = !(strcmp(ruser, user+1));
break;
@@ -661,9 +679,13 @@ __ivaliduser_sa(FILE *hostf, const struct sockaddr *raddr, 
socklen_t salen,
if (!*(user+1))
return(-1);
if (*(user+1) == '@') {
+#ifndef __rtems__
if (innetgr(user+2, NULL,
ruser, ypdomain))
return(-1);
+#else
+   return(-1);
+#endif
} else {
if (!strcmp(ruser, user+1))
return(-1);
-- 
1.8.3.1

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

[PATCH 1/2] namespace.h: Reversed additional hidden names.

2019-05-03 Thread Lou Woods
From: Lou Woods 

These hidden names were unresolved external symbols in
libbsd when loaded by the RTL.

The symbols _nanosleep, _accept, _select, and _listen are used
by rcmd.c and needed to be mapped to the correct name.
These symbols were removed from un-namespace.h as well.
---
 freebsd/lib/libc/include/namespace.h| 4 
 freebsd/lib/libc/include/un-namespace.h | 3 ---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/freebsd/lib/libc/include/namespace.h 
b/freebsd/lib/libc/include/namespace.h
index 08a8c67..4485aee 100644
--- a/freebsd/lib/libc/include/namespace.h
+++ b/freebsd/lib/libc/include/namespace.h
@@ -256,8 +256,11 @@
 #define _getprogname   getprogname
 #define _getsockname   getsockname
 #ifdef __rtems__
+#define _acceptaccept
 #define _bind  bind
 #define _getsockoptgetsockopt
+#define _listenlisten
+#define _nanosleep nanosleep
 #define _poll  poll
 #define _pthread_getspecific   pthread_getspecific
 #define _pthread_key_createpthread_key_create
@@ -268,6 +271,7 @@
 #define _pthread_rwlock_unlock pthread_rwlock_unlock
 #define _pthread_rwlock_wrlock pthread_rwlock_wrlock
 #define _pthread_setspecific   pthread_setspecific
+#define _selectselect
 #endif /* __rtems__ */
 
 #endif /* _NAMESPACE_H_ */
diff --git a/freebsd/lib/libc/include/un-namespace.h 
b/freebsd/lib/libc/include/un-namespace.h
index 33c7b00..126ae03 100644
--- a/freebsd/lib/libc/include/un-namespace.h
+++ b/freebsd/lib/libc/include/un-namespace.h
@@ -32,7 +32,6 @@
 #define _UN_NAMESPACE_H_
 
 #ifdef __rtems__
-#undef accept
 #undef __acl_aclcheck_fd
 #undef __acl_delete_fd
 #undef __acl_get_fd
@@ -62,7 +61,6 @@
 #undef getsockopt
 #undef ioctl
 #undef kevent
-#undef listen
 #undef nanosleep
 #undef open
 #undef openat
@@ -195,7 +193,6 @@
 #undef recvfrom
 #undef recvmsg
 #undef recvmmsg
-#undef select
 #undef sem_close
 #undef sem_destroy
 #undef sem_getvalue
-- 
1.8.3.1

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


[PATCH] Fully disabled seemingly unsupported zynq_uart_set_attributes handler

2019-03-26 Thread Lou Woods
From: Lou Woods 

---
 bsps/arm/xilinx-zynq/console/zynq-uart.c | 16 +++-
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/bsps/arm/xilinx-zynq/console/zynq-uart.c 
b/bsps/arm/xilinx-zynq/console/zynq-uart.c
index fa91f3f..9c21f6f 100644
--- a/bsps/arm/xilinx-zynq/console/zynq-uart.c
+++ b/bsps/arm/xilinx-zynq/console/zynq-uart.c
@@ -262,12 +262,16 @@ static void zynq_uart_write_support(
 #endif
 }
 
+/*
+ * Disable this because the initialization is done by code generated
+ * by the Xilinx code generator.
+ */
+#if 0
 static bool zynq_uart_set_attributes(
   rtems_termios_device_context *context,
   const struct termios *term
 )
 {
-#if 0
   volatile zynq_uart *regs = zynq_uart_get_regs(minor);
   uint32_t brgr = 0;
   uint32_t bauddiv = 0;
@@ -283,14 +287,16 @@ static bool zynq_uart_set_attributes(
   regs->control |= ZYNQ_UART_CONTROL_RXEN | ZYNQ_UART_CONTROL_TXEN;
 
   return true;
-#else
-  return false;
-#endif
 }
+#endif
 
 const rtems_termios_device_handler zynq_uart_handler = {
   .first_open = zynq_uart_first_open,
-  .set_attributes = zynq_uart_set_attributes,
+#if 0
+  .set_attributes = zynq_uart_set_attributes;
+#else
+  .set_attributes = NULL,
+#endif
   .write = zynq_uart_write_support,
 #ifdef ZYNQ_CONSOLE_USE_INTERRUPTS
   .last_close = zynq_uart_last_close,
-- 
1.8.3.1

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


[PATCH] Disable zynq_uart_set_attributes that prevents console input

2019-03-26 Thread Lou Woods
From: Lou Woods 

This patch fully disables the zynq_uart_set_attributes handler that had  
previously been commented out, but was returning false.  This prevented 
fileio.exe from blocking on the rtems_shell_wait_for_input call.

Lou Woods (1):
  Fully disabled seemingly unsupported zynq_uart_set_attributes handler

 bsps/arm/xilinx-zynq/console/zynq-uart.c | 16 +++-
 1 file changed, 11 insertions(+), 5 deletions(-)

-- 
1.8.3.1

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


[PATCH 3/3] Fixed ability to enable polling on the console using configure for imx7

2019-03-26 Thread Lou Woods
From: Lou Woods 

---
 bsps/arm/imx/console/console-config.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/bsps/arm/imx/console/console-config.c 
b/bsps/arm/imx/console/console-config.c
index 8b8d9fb..d28f3c9 100644
--- a/bsps/arm/imx/console/console-config.c
+++ b/bsps/arm/imx/console/console-config.c
@@ -33,7 +33,7 @@
 typedef struct {
   rtems_termios_device_context base;
   volatile imx_uart *regs;
-#ifdef CONSOLE_USE_INTERRUPTS
+#if CONSOLE_USE_INTERRUPTS
   rtems_vector_number irq;
   int tx_in_progress;
 #endif
@@ -111,7 +111,7 @@ static void imx_uart_init_context(
   rtems_termios_device_context_initialize(>base, "UART");
   node = fdt_path_offset(fdt, serial);
   ctx->regs = imx_get_reg_of_node(fdt, node);
-#ifdef CONSOLE_USE_INTERRUPTS
+#if CONSOLE_USE_INTERRUPTS
   ctx->irq = imx_get_irq_of_node(fdt, node, 0);
 #endif
 }
@@ -178,7 +178,7 @@ BSP_output_char_function_type BSP_output_char = 
imx_output_char_init;
 
 BSP_polling_getchar_function_type BSP_poll_char = NULL;
 
-#ifdef CONSOLE_USE_INTERRUPTS
+#if CONSOLE_USE_INTERRUPTS
 static void imx_uart_interrupt(void *arg)
 {
   rtems_termios_tty *tty;
@@ -242,7 +242,7 @@ static bool imx_uart_first_open(
 {
   imx_uart_context *ctx;
   volatile imx_uart *regs;
-#ifdef CONSOLE_USE_INTERRUPTS
+#if CONSOLE_USE_INTERRUPTS
   rtems_status_code sc;
   uint32_t ufcr;
 #endif
@@ -257,7 +257,7 @@ static bool imx_uart_first_open(
   rtems_termios_set_initial_baud(tty, 115200);
   imx_uart_set_attributes(base, term);
 
-#ifdef CONSOLE_USE_INTERRUPTS
+#if CONSOLE_USE_INTERRUPTS
   ufcr = regs->ufcr;
   ufcr = IMX_UART_UFCR_RXTL_SET(ufcr, 16);
   ufcr = IMX_UART_UFCR_TXTL_SET(ufcr, IMX_UART_TX_FIFO_LEVEL);
@@ -285,7 +285,7 @@ static void imx_uart_last_close(
   rtems_libio_open_close_args_t *args
 )
 {
-#ifdef CONSOLE_USE_INTERRUPTS
+#if CONSOLE_USE_INTERRUPTS
   imx_uart_context *ctx;
 
   ctx = (imx_uart_context *) base;
@@ -299,7 +299,7 @@ static void imx_uart_write(
   size_t len
 )
 {
-#ifdef CONSOLE_USE_INTERRUPTS
+#if CONSOLE_USE_INTERRUPTS
   imx_uart_context *ctx;
   volatile imx_uart *regs;
   int n;
@@ -339,7 +339,7 @@ static const rtems_termios_device_handler imx_uart_handler 
= {
   .last_close = imx_uart_last_close,
   .write = imx_uart_write,
   .set_attributes = imx_uart_set_attributes,
-#ifdef CONSOLE_USE_INTERRUPTS
+#if CONSOLE_USE_INTERRUPTS
   .mode = TERMIOS_IRQ_DRIVEN
 #else
   .poll_read = imx_uart_read_polled,
-- 
1.8.3.1

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


[PATCH 2/3] Fixed ability to enable polling on the console using configure for atsamv

2019-03-26 Thread Lou Woods
From: Lou Woods 

---
 bsps/arm/atsam/console/console.c | 28 ++--
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/bsps/arm/atsam/console/console.c b/bsps/arm/atsam/console/console.c
index d51d2ac..4a6c339 100644
--- a/bsps/arm/atsam/console/console.c
+++ b/bsps/arm/atsam/console/console.c
@@ -29,7 +29,7 @@ typedef struct {
   rtems_vector_number irq;
   uint32_t id;
   bool console;
-#ifdef ATSAM_CONSOLE_USE_INTERRUPTS
+#if ATSAM_CONSOLE_USE_INTERRUPTS
   bool transmitting;
 #endif
 } atsam_usart_context;
@@ -56,7 +56,7 @@ static atsam_usart_context atsam_usart_instances[] = {
 #endif
 };
 
-#ifdef ATSAM_CONSOLE_USE_INTERRUPTS
+#if ATSAM_CONSOLE_USE_INTERRUPTS
 static void atsam_usart_interrupt(void *arg)
 {
   rtems_termios_tty *tty = arg;
@@ -144,7 +144,7 @@ static bool atsam_usart_first_open(
 {
   atsam_usart_context *ctx = (atsam_usart_context *) base;
   Usart *regs = ctx->regs;
-#ifdef ATSAM_CONSOLE_USE_INTERRUPTS
+#if ATSAM_CONSOLE_USE_INTERRUPTS
   rtems_status_code sc;
 #endif
 
@@ -156,7 +156,7 @@ static bool atsam_usart_first_open(
   rtems_termios_set_initial_baud(tty, ATSAM_CONSOLE_BAUD);
   atsam_usart_set_attributes(base, term);
 
-#ifdef ATSAM_CONSOLE_USE_INTERRUPTS
+#if ATSAM_CONSOLE_USE_INTERRUPTS
   regs->US_IER = US_IDR_RXRDY;
   sc = rtems_interrupt_handler_install(
 ctx->irq,
@@ -181,7 +181,7 @@ static void atsam_usart_last_close(
 {
   atsam_usart_context *ctx = (atsam_usart_context *) base;
 
-#ifdef ATSAM_CONSOLE_USE_INTERRUPTS
+#if ATSAM_CONSOLE_USE_INTERRUPTS
   rtems_interrupt_handler_remove(ctx->irq, atsam_usart_interrupt, tty);
 #endif
 
@@ -199,7 +199,7 @@ static void atsam_usart_write(
   atsam_usart_context *ctx = (atsam_usart_context *) base;
   Usart *regs = ctx->regs;
 
-#ifdef ATSAM_CONSOLE_USE_INTERRUPTS
+#if ATSAM_CONSOLE_USE_INTERRUPTS
   if (len > 0) {
 ctx->transmitting = true;
 regs->US_THR = buf[0];
@@ -240,7 +240,7 @@ static const rtems_termios_device_handler 
atsam_usart_handler = {
   .last_close = atsam_usart_last_close,
   .write = atsam_usart_write,
   .set_attributes = atsam_usart_set_attributes,
-#ifdef ATSAM_CONSOLE_USE_INTERRUPTS
+#if ATSAM_CONSOLE_USE_INTERRUPTS
   .mode = TERMIOS_IRQ_DRIVEN
 #else
   .poll_read = atsam_usart_read,
@@ -254,7 +254,7 @@ typedef struct {
   rtems_vector_number irq;
   uint32_t id;
   bool console;
-#ifdef ATSAM_CONSOLE_USE_INTERRUPTS
+#if ATSAM_CONSOLE_USE_INTERRUPTS
   bool transmitting;
 #endif
 } atsam_uart_context;
@@ -295,7 +295,7 @@ static atsam_uart_context atsam_uart_instances[] = {
 #endif
 };
 
-#ifdef ATSAM_CONSOLE_USE_INTERRUPTS
+#if ATSAM_CONSOLE_USE_INTERRUPTS
 static void atsam_uart_interrupt(void *arg)
 {
   rtems_termios_tty *tty = arg;
@@ -370,7 +370,7 @@ static bool atsam_uart_first_open(
 {
   atsam_uart_context *ctx = (atsam_uart_context *) base;
   Uart *regs = ctx->regs;
-#ifdef ATSAM_CONSOLE_USE_INTERRUPTS
+#if ATSAM_CONSOLE_USE_INTERRUPTS
   rtems_status_code sc;
 #endif
 
@@ -382,7 +382,7 @@ static bool atsam_uart_first_open(
   rtems_termios_set_initial_baud(tty, ATSAM_CONSOLE_BAUD);
   atsam_uart_set_attributes(base, term);
 
-#ifdef ATSAM_CONSOLE_USE_INTERRUPTS
+#if ATSAM_CONSOLE_USE_INTERRUPTS
   regs->UART_IER = UART_IDR_RXRDY;
   sc = rtems_interrupt_handler_install(
 ctx->irq,
@@ -407,7 +407,7 @@ static void atsam_uart_last_close(
 {
   atsam_uart_context *ctx = (atsam_uart_context *) base;
 
-#ifdef ATSAM_CONSOLE_USE_INTERRUPTS
+#if ATSAM_CONSOLE_USE_INTERRUPTS
   rtems_interrupt_handler_remove(ctx->irq, atsam_uart_interrupt, tty);
 #endif
 
@@ -425,7 +425,7 @@ static void atsam_uart_write(
   atsam_uart_context *ctx = (atsam_uart_context *) base;
   Uart *regs = ctx->regs;
 
-#ifdef ATSAM_CONSOLE_USE_INTERRUPTS
+#if ATSAM_CONSOLE_USE_INTERRUPTS
   if (len > 0) {
 ctx->transmitting = true;
 regs->UART_THR = buf[0];
@@ -466,7 +466,7 @@ static const rtems_termios_device_handler 
atsam_uart_handler = {
   .last_close = atsam_uart_last_close,
   .write = atsam_uart_write,
   .set_attributes = atsam_uart_set_attributes,
-#ifdef ATSAM_CONSOLE_USE_INTERRUPTS
+#if ATSAM_CONSOLE_USE_INTERRUPTS
   .mode = TERMIOS_IRQ_DRIVEN
 #else
   .poll_read = atsam_uart_read,
-- 
1.8.3.1

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


[PATCH 0/3] Fixed ability to enable console polling for certain BSPs

2019-03-26 Thread Lou Woods
From: Lou Woods 

I discovered that I was not able to turn off interrupt-based console mode on 
the 
Xilinx Zynq BSP under Qemu via the configure command.  The fix simply exchanges 
#ifdef XXX_CONSOLE_USE_INTERRUPTS for 
#if XXX_CONSOLE_USE_INTERRUPTS for the BSP specific console code.

The error pattern existed for to atsamv and imx7, so they were fixed as well.  
I've tested the fix on the Zynq Qemu BSP and compiled the other two BSPs.

Lou Woods (3):
  Fixed ability to enable polling on the console using configure for
Zynq
  Fixed ability to enable polling on the console using configure for
atsamv
  Fixed ability to enable polling on the console using configure for
imx7

 bsps/arm/atsam/console/console.c | 28 ++--
 bsps/arm/imx/console/console-config.c| 16 
 bsps/arm/xilinx-zynq/console/zynq-uart.c | 12 ++--
 3 files changed, 28 insertions(+), 28 deletions(-)

-- 
1.8.3.1

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


[PATCH 1/3] Fixed ability to enable polling on the console using configure for Zynq

2019-03-26 Thread Lou Woods
From: Lou Woods 

---
 bsps/arm/xilinx-zynq/console/zynq-uart.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/bsps/arm/xilinx-zynq/console/zynq-uart.c 
b/bsps/arm/xilinx-zynq/console/zynq-uart.c
index 9c21f6f..0230664 100644
--- a/bsps/arm/xilinx-zynq/console/zynq-uart.c
+++ b/bsps/arm/xilinx-zynq/console/zynq-uart.c
@@ -129,7 +129,7 @@ void zynq_uart_initialize(rtems_termios_device_context 
*base)
 | ZYNQ_UART_CONTROL_RSTTO;
 }
 
-#ifdef ZYNQ_CONSOLE_USE_INTERRUPTS
+#if ZYNQ_CONSOLE_USE_INTERRUPTS
 static void zynq_uart_interrupt(void *arg)
 {
   rtems_termios_tty *tty = arg;
@@ -164,7 +164,7 @@ static bool zynq_uart_first_open(
   rtems_libio_open_close_args_t *args
 )
 {
-#ifdef ZYNQ_CONSOLE_USE_INTERRUPTS
+#if ZYNQ_CONSOLE_USE_INTERRUPTS
   zynq_uart_context *ctx = (zynq_uart_context *) base;
   volatile zynq_uart *regs = ctx->regs;
   rtems_status_code sc;
@@ -173,7 +173,7 @@ static bool zynq_uart_first_open(
   rtems_termios_set_initial_baud(tty, ZYNQ_UART_DEFAULT_BAUD);
   zynq_uart_initialize(base);
 
-#ifdef ZYNQ_CONSOLE_USE_INTERRUPTS
+#if ZYNQ_CONSOLE_USE_INTERRUPTS
   regs->rx_timeout = 32;
   regs->rx_fifo_trg_lvl = ZYNQ_UART_FIFO_DEPTH / 2;
   regs->irq_dis = 0x;
@@ -194,7 +194,7 @@ static bool zynq_uart_first_open(
   return true;
 }
 
-#ifdef ZYNQ_CONSOLE_USE_INTERRUPTS
+#if ZYNQ_CONSOLE_USE_INTERRUPTS
 static void zynq_uart_last_close(
   rtems_termios_tty *tty,
   rtems_termios_device_context *base,
@@ -240,7 +240,7 @@ static void zynq_uart_write_support(
   size_t len
 )
 {
-#ifdef ZYNQ_CONSOLE_USE_INTERRUPTS
+#if ZYNQ_CONSOLE_USE_INTERRUPTS
   zynq_uart_context *ctx = (zynq_uart_context *) base;
   volatile zynq_uart *regs = ctx->regs;
 
@@ -298,7 +298,7 @@ const rtems_termios_device_handler zynq_uart_handler = {
   .set_attributes = NULL,
 #endif
   .write = zynq_uart_write_support,
-#ifdef ZYNQ_CONSOLE_USE_INTERRUPTS
+#if ZYNQ_CONSOLE_USE_INTERRUPTS
   .last_close = zynq_uart_last_close,
   .mode = TERMIOS_IRQ_DRIVEN
 #else
-- 
1.8.3.1

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


OAR is standing up hardware testing capabilities / EVB5200 issue

2019-02-06 Thread Lou Woods
Hi,

With the help of Chris Johns and Joel Sherrill, I've set up a means to download 
and test the RTEMS test suite on the BeagleBone Black and Freescale EVB5200B 
(Icecube).  The BBB passed 569 of the 590 tests. There were 12 failures, but 
these could be test framework related.  I haven't investigated them yet.  I 
appreciate your help guys.

I'm having issues with the EVB5200 though.  Of the 591 tests only 1 passed.  
Each test I investigated simply reset the board as soon as U-Boot transferred 
control.  I'm using the latest icecube BSP build fresh from the git master.  
The log snippet at the bottom is from RTEMS tester and demonstrates a typical 
failure.  As seen below I'm using the load address 0x100 and the entry 
point 0x4 per the wiki page: https://devel.rtems.org/wiki/TBR/BSP/Gen5200

The only test that passes is the minimum test.  I've also manually built hello 
and tested it outside of the test framework with the same result.  Any ideas?

Here is the mkimg script:
$ cat bin/rtems-icecube-mkimg
#! /bin/sh

OBJCOPY_FOR_TARGET=powerpc-rtems5-objcopy
OBJCOPY="$OBJCOPY_FOR_TARGET"

START_ADDR=0x4
ENTRY_ADDR=0x4

for EXE_NAME in $*
do
  if [ ! -f $EXE_NAME ]; then
   echo "error: not found: $EXE_NAME"
   exit 1
  fi
  echo "Image: $EXE_NAME"
  ${OBJCOPY} -R -S -O binary "$EXE_NAME" "$EXE_NAME.bin" || exit 1
  cat "$EXE_NAME.bin" | gzip -9 >"$EXE_NAME.gz"
  mkimage \
   -A ppc -O rtems -T kernel -a $START_ADDR -e $ENTRY_ADDR -n "RTEMS" \
   -d "$EXE_NAME.gz" "$EXE_NAME.img"
done

exit 0

The EVB5200 U-Boot boot command is:
bootcmd=dhcp; setenv serverip 192.168.1.94; tftp 100 icecube.img; bootm; 
reset


Tester run log snippet:
=>  tftp: ./powerpc-rtems5/c/icecube/testsuites/benchmarks/linpack.exe.img
] BOOTP broadcast 1
] DHCP client bound to address 192.168.1.82
] Using FEC ETHERNET device
] TFTP from server 192.168.1.94; our IP address is 192.168.1.82
] Filename 'icecube.img'.
] Load address: 0x100
] Loading: #
] done
] Bytes transferred = 66040 (101f8 hex)
] ## Booting image at 0100 ...
]Image Name:   RTEMS
]Image Type:   PowerPC RTEMS Kernel Image (gzip compressed)
]Data Size:65976 Bytes = 64.4 kB
]Load Address: 0004
]Entry Point:  0004
]Uncompressing Kernel Image ... OK
] ## Transferring control to RTEMS (at address 0004) ...
]
]
] U-Boot 1.1.3 (Apr  5 2006 - 21:06:06)
]
] CPU:   MPC5200 v2.2 at 462 MHz
]Bus 132 MHz, IPB 132 MHz, PCI 33 MHz
] Board: Freescale MPC5200 (Lite5200B)

Thanks for any help you can provide,
Lou
OARCorp
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel