about GSoC2016 Students' Proposals table

2016-03-29 Thread 황원준
Hello all, 
I submitted the proposal about Jailhouse hypervisor at Google Summer of Code 
page.
But there is no my proposal in RTEMS Tracking page's Students' Proposals table.
If there is no a proposal, would that be rejected?
 
I knew that projects announced date is April 23. 
are there ways to know projects result earlier?
 
 
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: about GSoC2016 Students' Proposals table

2016-03-29 Thread Gedare Bloom
On Tue, Mar 29, 2016 at 3:09 AM, 황원준  wrote:

> Hello all,
>
> I submitted the proposal about Jailhouse hypervisor at Google Summer of
> Code page.
>
> But there is no my proposal in RTEMS Tracking page's Students' Proposals
> table.
>
> If there is no a proposal, would that be rejected?
>
>
>
No, however you should try to register an account on our wiki and add
yourself to that table.


> I knew that projects announced date is April 23.
>
> are there ways to know projects result earlier?
>
>
>
No. Only the official announcement from Google can let you know.


>
>
> ___
> 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] confdefs.h hack

2016-03-29 Thread Sebastian Huber
Not to be committed. How can we fix this?
---
 cpukit/sapi/include/confdefs.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cpukit/sapi/include/confdefs.h b/cpukit/sapi/include/confdefs.h
index 2018c4e..6c55cdb 100644
--- a/cpukit/sapi/include/confdefs.h
+++ b/cpukit/sapi/include/confdefs.h
@@ -132,7 +132,7 @@ extern rtems_initialization_tasks_table 
Initialization_tasks[];
  * are used by calls like open(2) and read(2).
  */
 #ifndef CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS
-  #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 3
+  #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 64
 #endif
 
 /**
@@ -2076,7 +2076,7 @@ extern rtems_initialization_tasks_table 
Initialization_tasks[];
* This is an internal parameter.
*/
   #define CONFIGURE_TASKS \
-(CONFIGURE_MAXIMUM_TASKS + CONFIGURE_LIBBLOCK_TASKS)
+(CONFIGURE_MAXIMUM_TASKS + CONFIGURE_LIBBLOCK_TASKS + 4)
 
   /**
* This macro calculates the memory required for task variables.
-- 
1.8.4.5

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


[PATCH 1/2] bsp/motorola_powerpc: Add MPCI support for Qemu

2016-03-29 Thread Sebastian Huber
---
 .../libbsp/powerpc/motorola_powerpc/Makefile.am|   2 +
 .../libbsp/powerpc/motorola_powerpc/include/bsp.h  |  10 +
 .../libbsp/powerpc/motorola_powerpc/shmsupp/mpci.c | 379 +
 3 files changed, 391 insertions(+)
 create mode 100644 c/src/lib/libbsp/powerpc/motorola_powerpc/shmsupp/mpci.c

diff --git a/c/src/lib/libbsp/powerpc/motorola_powerpc/Makefile.am 
b/c/src/lib/libbsp/powerpc/motorola_powerpc/Makefile.am
index e09820608..3576b75 100644
--- a/c/src/lib/libbsp/powerpc/motorola_powerpc/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/motorola_powerpc/Makefile.am
@@ -136,6 +136,8 @@ noinst_PROGRAMS += ne2000.rel
 ne2000_rel_SOURCES   = ../../i386/pc386/ne2000/ne2000.c
 ne2000_rel_CPPFLAGS  = $(AM_CPPFLAGS) $(ne2000_CPPFLAGS)
 ne2000_rel_LDFLAGS   = $(RTEMS_RELLDFLAGS)
+
+libbsp_a_SOURCES += shmsupp/mpci.c
 endif
 endif
 
diff --git a/c/src/lib/libbsp/powerpc/motorola_powerpc/include/bsp.h 
b/c/src/lib/libbsp/powerpc/motorola_powerpc/include/bsp.h
index 493a37d..26960dc 100644
--- a/c/src/lib/libbsp/powerpc/motorola_powerpc/include/bsp.h
+++ b/c/src/lib/libbsp/powerpc/motorola_powerpc/include/bsp.h
@@ -241,6 +241,16 @@ void zero_bss(void);
  */
 void VIA_isa_bridge_interrupts_setup(void);
 
+#if defined(RTEMS_MULTIPROCESSING) && defined(RTEMS_NETWORKING)
+
+extern rtems_mpci_table net_mpci_table;
+
+#define CONFIGURE_MP_MPCI_TABLE_POINTER &net_mpci_table
+
+#define MPCI_Print_statistics() do { } while (0)
+
+#endif /* defined(RTEMS_MULTIPROCESSING) && defined(RTEMS_NETWORKING) */
+
 #endif
 
 #ifdef __cplusplus
diff --git a/c/src/lib/libbsp/powerpc/motorola_powerpc/shmsupp/mpci.c 
b/c/src/lib/libbsp/powerpc/motorola_powerpc/shmsupp/mpci.c
new file mode 100644
index 000..e7bc3ce
--- /dev/null
+++ b/c/src/lib/libbsp/powerpc/motorola_powerpc/shmsupp/mpci.c
@@ -0,0 +1,379 @@
+/*
+ * Copyright (c) 2016 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.
+ */
+
+#include 
+
+#if defined(RTEMS_MULTIPROCESSING) && defined(RTEMS_NETWORKING)
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#define MAX_PACKET_SIZE 512
+
+#define MAX_NODES 2
+
+#define PACKET_COUNT (32 * MAX_NODES)
+
+#define IP_ADDR_SIZE 16
+
+#define MPCI_PORT 1234
+
+typedef struct {
+  rtems_chain_node node;
+  uint32_t dest;
+  char data[MAX_PACKET_SIZE];
+} net_mpci_packet;
+
+typedef struct {
+  rtems_chain_control outbound_packets;
+  rtems_id outbound_server;
+  RTEMS_INTERRUPT_LOCK_MEMBER(outbound_lock)
+  rtems_chain_control free_packets;
+  RTEMS_INTERRUPT_LOCK_MEMBER(free_lock)
+  int outbound_fds[MAX_NODES];
+  int inbound_fds[MAX_NODES - 1];
+  int inbound_nfds;
+  net_mpci_packet packets[PACKET_COUNT];
+  char ip_addr[IP_ADDR_SIZE];
+} net_mpci_context;
+
+static net_mpci_context net_mpci_instance;
+
+static net_mpci_packet *net_mpci_get_outbound_packet(net_mpci_context *ctx)
+{
+  rtems_interrupt_lock_context lock_context;
+  rtems_chain_node *node;
+
+  rtems_interrupt_lock_acquire(&ctx->outbound_lock, &lock_context);
+  node = rtems_chain_get_unprotected(&ctx->outbound_packets);
+  rtems_interrupt_lock_release(&ctx->outbound_lock, &lock_context);
+
+  return (net_mpci_packet *) node;
+}
+
+static void net_mpci_free_packet(
+  net_mpci_context *ctx,
+  net_mpci_packet *packet
+)
+{
+  rtems_interrupt_lock_context lock_context;
+
+  rtems_interrupt_lock_acquire(&ctx->free_lock, &lock_context);
+  rtems_chain_prepend_unprotected(&ctx->free_packets, &packet->node);
+  rtems_interrupt_lock_release(&ctx->free_lock, &lock_context);
+}
+
+static void net_mpci_write(
+  net_mpci_context *ctx,
+  net_mpci_packet *packet,
+  uint32_t dest
+)
+{
+  ssize_t n =
+write(ctx->outbound_fds[dest - 1], &packet->data[0], sizeof(packet->data));
+  assert(n == MAX_PACKET_SIZE);
+}
+
+static void net_mpci_dest_to_ip_addr(uint32_t dest, char ip_addr[IP_ADDR_SIZE])
+{
+  int n = snprintf(&ip_addr[0], IP_ADDR_SIZE, "10.0.1.%" PRIu32, dest);
+  assert(n < IP_ADDR_SIZE);
+}
+
+static void net_mpci_outbound_server(rtems_task_argument arg)
+{
+  net_mpci_context *ctx = (net_mpci_context *) arg;
+  uint32_t n = _Objects_Maximum_nodes;
+  uint32_t self = _Objects_Local_node;
+  uint32_t dest;
+
+  for (dest = 1; dest <= n; ++dest) {
+if (dest != self) {
+  int fd;
+  char ip_addr[IP_ADDR_SIZE];
+  struct sockaddr_in addr;
+  int ok;
+  int rv;
+
+  fd = socket(PF_INET, SOCK_STREAM, 0);
+  assert(fd >= 0);
+
+  net_mpci_dest_to_ip_addr(dest, ip_addr);
+
+  memset(&addr, 0, sizeof(addr));
+  addr.sin_family = AF_INET;
+  addr.sin_port = htons(MPCI_PORT);
+  ok = inet_aton(&ip_addr[0], &addr.sin_addr);
+  assert(ok != 0);
+
+  

Re: [PATCH 2/2] confdefs.h hack

2016-03-29 Thread Sebastian Huber

On 29/03/16 13:47, Sebastian Huber wrote:

Not to be committed. How can we fix this?


I was able to run all MP tests except mp14 successfully using Qemu and a 
virtual network. The TCP/IP based MPCI support is basically BSP 
independent and should work for all BSPs that support a network 
interface driver in the old network stack. So, maybe this MPCI driver 
should move to libchip. I am not sure how we should address the 
confdefs.h issue.


The mp14 test seems to use a global partition. Does this make sense in a 
non-shared memory setup, e.g. message passing via TCP/IP?


--
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] confdefs.h hack

2016-03-29 Thread Gedare Bloom
On Tue, Mar 29, 2016 at 7:51 AM, Sebastian Huber
 wrote:
> On 29/03/16 13:47, Sebastian Huber wrote:
>>
>> Not to be committed. How can we fix this?
>
>
> I was able to run all MP tests except mp14 successfully using Qemu and a
> virtual network. The TCP/IP based MPCI support is basically BSP independent
> and should work for all BSPs that support a network interface driver in the
> old network stack. So, maybe this MPCI driver should move to libchip. I am
> not sure how we should address the confdefs.h issue.
>
This makes sense. You could add a new configure flag for the driver
then, e.g. CONFIGURE_MPCI_DRIVER_ENABLED or something to control the
confdefs ++bloat.

> The mp14 test seems to use a global partition. Does this make sense in a
> non-shared memory setup, e.g. message passing via TCP/IP?
>
I doubt it makes sense. You need to have a lot of middleware to get a
(partitioned) global address space to work over a message passing
interface. It has been done before e.g. to use UPC/OpenMP over MPI,
but I don't think this is necessarily good in our case.

> --
> 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] pc386: Add virtio network driver

2016-03-29 Thread Jinhyun
diff --git a/c/src/lib/libbsp/i386/pc386/Makefile.am
b/c/src/lib/libbsp/i386/pc386/Makefile.am
index d9af7dd..da50c67 100644
--- a/c/src/lib/libbsp/i386/pc386/Makefile.am
+++ b/c/src/lib/libbsp/i386/pc386/Makefile.am
@@ -232,6 +232,19 @@ noinst_PROGRAMS += 3c509.rel
 3c509_rel_LDFLAGS += -Wl,--undefined=ep_board
 endif
 
+if HAS_NETWORKING
+vtnet_CPPFLAGS = -D__INSIDE_RTEMS_BSD_TCPIP_STACK__
+noinst_PROGRAMS += vtnet.rel
+vtnet_rel_SOURCES = virtio/if_vtnet.c
+vtnet_rel_SOURCES += virtio/if_vtnet.h
+vtnet_rel_SOURCES += virtio/virtio_pci.c
+vtnet_rel_SOURCES += virtio/virtio_pci.h
+vtnet_rel_SOURCES += virtio/virtio.c
+vtnet_rel_SOURCES += virtio/virtio.h
+vtnet_rel_CPPFLAGS = $(AM_CPPFLAGS) $(vtnet_CPPFLAGS)
+vtnet_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
+endif
+
 libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/cache.rel
 libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/page.rel
 libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/score.rel
@@ -246,6 +259,7 @@ if HAS_NETWORKING
 libbsp_a_LIBADD += ne2000.rel
 libbsp_a_LIBADD += wd8003.rel
 libbsp_a_LIBADD += 3c509.rel
+libbsp_a_LIBADD += vtnet.rel
 endif
 
 EXTRA_DIST += HOWTO
diff --git a/c/src/lib/libbsp/i386/pc386/virtio/if_vtnet.c
b/c/src/lib/libbsp/i386/pc386/virtio/if_vtnet.c
new file mode 100644
index 000..4fcd92c
--- /dev/null
+++ b/c/src/lib/libbsp/i386/pc386/virtio/if_vtnet.c
@@ -0,0 +1,1032 @@
+/**
+ * @file if_vtnet.c
+ * @brief Driver for virtio network devices
+ */
+
+/*
+ * Copyright (c) 2016 Jin-Hyun Kim 
+ *   and Hyun-Wook Jin 
+ * Ported from FreeBSD to RTEMS March 16, http://sslab.konkuk.ac.kr
+ *
+ * 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.
+ */
+
+/*-
+ * Copyright (c) 2011, Bryan Venteicher 
+ * 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 unmodified, 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 ``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 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.
+ *
+ */
+
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+
+#include 
+
+#include "virtio.h"
+#include "virtio_pci.h"
+#include "if_vtnet.h"
+
+static struct vtnet_softc vtnet_softc;
+static rtems_interval vtnet_ticksPerSecond;
+
+int rtems_vtnet_driver_attach(
+  struct rtems_bsdnet_ifconfig *config,
+  int   attaching
+)
+{
+  struct vtnet_softc *sc;
+  int ret;
+
+  printk( "rtems_vtnet_driver_attach start\n" );
+
+  sc = &vtnet_softc;
+  memset( sc, 0, sizeof( struct vtnet_softc ) );
+
+  /* Set up timing values */
+  vtnet_ticksPerSecond = rtems_clock_get_ticks_per_second();
+
+  printk( "\tAttaching virtio pci...\n" );
+  ret = vtpci_attach( config, &sc->vtpci_softc );
+
+  if ( ret ) {
+printk( "vtpci_attach fail...\n" );
+  }
+
+  /* Alloc virtqueues */
+  printk( "\tAllocating virtqueues...\n" );
+  ret = vtnet_alloc_virtqueues( sc );
+
+  if ( ret ) {
+printk( "vtnet_alloc_virtqueues fail...\n" );
+  }
+
+  /* Setup interrupt */
+  printk( "\tSetup interrupt...\n" );
+  ret = vtnet_setup_intr( &sc->vtpci_softc );
+
+  if ( ret ) {
+printk( "vtpci_setup_intr fail...\n" );
+  }
+
+  /* Setup interface */
+  printk( "\tSetup interface...\n" );
+  ret = vtnet_setup_interface( sc, config );
+
+  if ( ret ) {
+printk( "vtnet_setup_interface fail...\n" );
+  }
+
+  printk( "rtems_vtnet_driver_attach end\n" );
+
+  return 0;
+}
+
+static int vtnet_alloc_virtqueues( struct vtnet_softc *sc )
+{
+  uint16_t val16;
+  int  size, error;
+
+  /* Init virtio_net_hdr */
+  memset( &sc->vtnet_net_hdr, 0, sizeof( struct virtio_net_hdr ) );
+
+  /* Select virtqueue 0 */
+  vtpci_io_write_2( &sc->vtpci_softc,
+VIRTIO_PCI_QUEUE_SEL,
+VIRTIO_PCI_QUEUE_SEL_RX );
+  val16 = vtpci_io_read_2( &sc->vtpci_softc

Re: Advice Wanted on sonic.c Indentation Warning

2016-03-29 Thread Martin Galvan
Hi again, I'm attaching the patch for review. It compiles fine for erc32,
though I couldn't test the samples (I don't have any sparc boards, and QEMU only
has leon3 and sun-4m).

I wrote to Amar about my write access but I didn't hear back from him.
Is there a way to check if my account exists using ssh? E.g. for sourceware
we have 'ssh sourceware.org alive'.

---
 c/src/libchip/network/sonic.c | 24 +++-
 1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/c/src/libchip/network/sonic.c b/c/src/libchip/network/sonic.c
index 1cd6cba..6e69b9e 100644
--- a/c/src/libchip/network/sonic.c
+++ b/c/src/libchip/network/sonic.c
@@ -826,19 +826,17 @@ SONIC_STATIC void sonic_rda_wait(
* driver has to move the RRP back *two* entries to
* reuse the receive buffer holding the giant packet.
*/
-  for (i = 0 ; i < 2 ; i++) {
-if ((*sc->read_register)( rp, SONIC_REG_RRP ) ==
-(*sc->read_register)( rp, SONIC_REG_RSA ))
-  (*sc->write_register)(
-rp,
-SONIC_REG_RRP,
-(*sc->read_register)( rp, SONIC_REG_REA )
-  );
-  (*sc->write_register)(
- rp,
- SONIC_REG_RRP,
- (*sc->read_register)(rp, SONIC_REG_RRP) - 
sizeof(ReceiveResource_t)
-  );
+  for (i = 0; i < 2; ++i) {
+  uint32_t rrp = (*sc->read_register)( rp, SONIC_REG_RRP );
+  const uint32_t rsa = (*sc->read_register)( rp, SONIC_REG_RSA );
+
+  if (rrp == rsa) {
+  const uint32_t rea = (*sc->read_register)( rp, SONIC_REG_REA );
+  (*sc->write_register)( rp, SONIC_REG_RRP, rea );
+  }
+
+  rrp = (*sc->read_register)(rp, SONIC_REG_RRP);
+  (*sc->write_register)( rp, SONIC_REG_RRP, rrp - 
sizeof(ReceiveResource_t) );
   }
 
   /*
-- 
2.8.0

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


Re: [PATCH] pc386: Add virtio network driver

2016-03-29 Thread Joel Sherrill
Hi

Thanks for the submission. My comments are going to be very general.

+ Can you document which version of the FreeBSD source files this is based
up? Perhaps an svn revision/branch and a list of the exact files in their
source
tree? This has been a historical problem when trying to track future
changes.

+ What were the nature of the rtems specific changes? Are they cleanly
ifdef'ed so a diff against the original FreeBSD source shows ifdef additions
and blocks of RTEMS specific code added?

+ I didn't see any instructions on how to use this. What type of setup is
needed?

I am pretty sure I actually reviewed a conference paper on this work and
am excited to see it submitted. Let's just make it top notch on usability
and maintainability.

--joel

On Tue, Mar 29, 2016 at 8:47 AM, Jinhyun  wrote:

> diff --git a/c/src/lib/libbsp/i386/pc386/Makefile.am
> b/c/src/lib/libbsp/i386/pc386/Makefile.am
> index d9af7dd..da50c67 100644
> --- a/c/src/lib/libbsp/i386/pc386/Makefile.am
> +++ b/c/src/lib/libbsp/i386/pc386/Makefile.am
> @@ -232,6 +232,19 @@ noinst_PROGRAMS += 3c509.rel
>  3c509_rel_LDFLAGS += -Wl,--undefined=ep_board
>  endif
>
> +if HAS_NETWORKING
> +vtnet_CPPFLAGS = -D__INSIDE_RTEMS_BSD_TCPIP_STACK__
> +noinst_PROGRAMS += vtnet.rel
> +vtnet_rel_SOURCES = virtio/if_vtnet.c
> +vtnet_rel_SOURCES += virtio/if_vtnet.h
> +vtnet_rel_SOURCES += virtio/virtio_pci.c
> +vtnet_rel_SOURCES += virtio/virtio_pci.h
> +vtnet_rel_SOURCES += virtio/virtio.c
> +vtnet_rel_SOURCES += virtio/virtio.h
> +vtnet_rel_CPPFLAGS = $(AM_CPPFLAGS) $(vtnet_CPPFLAGS)
> +vtnet_rel_LDFLAGS = $(RTEMS_RELLDFLAGS)
> +endif
> +
>  libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/cache.rel
>  libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/page.rel
>  libbsp_a_LIBADD += ../../../libcpu/@RTEMS_CPU@/score.rel
> @@ -246,6 +259,7 @@ if HAS_NETWORKING
>  libbsp_a_LIBADD += ne2000.rel
>  libbsp_a_LIBADD += wd8003.rel
>  libbsp_a_LIBADD += 3c509.rel
> +libbsp_a_LIBADD += vtnet.rel
>  endif
>
>  EXTRA_DIST += HOWTO
> diff --git a/c/src/lib/libbsp/i386/pc386/virtio/if_vtnet.c
> b/c/src/lib/libbsp/i386/pc386/virtio/if_vtnet.c
> new file mode 100644
> index 000..4fcd92c
> --- /dev/null
> +++ b/c/src/lib/libbsp/i386/pc386/virtio/if_vtnet.c
> @@ -0,0 +1,1032 @@
> +/**
> + * @file if_vtnet.c
> + * @brief Driver for virtio network devices
> + */
> +
> +/*
> + * Copyright (c) 2016 Jin-Hyun Kim 
> + *   and Hyun-Wook Jin 
> + * Ported from FreeBSD to RTEMS March 16, http://sslab.konkuk.ac.kr
> + *
> + * 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.
> + */
> +
> +/*-
> + * Copyright (c) 2011, Bryan Venteicher 
> + * 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 unmodified, 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 ``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 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.
> + *
> + */
> +
> +#include 
> +#include 
> +
> +#include 
> +#include 
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include 
> +
> +#include 
> +#include 
> +
> +#include 
> +
> +#include "virtio.h"
> +#include "virtio_pci.h"
> +#include "if_vtnet.h"
> +
> +static struct vtnet_softc vtnet_softc;
> +static rtems_interval vtnet_ticksPerSecond;
> +
> +int rtems_vtnet_driver_attach(
> +  struct rtems_bsdnet_ifconfig *config,
> +  int   attaching
> +)
> +{
> +  struct vtnet_softc *sc;
> +  int ret;
> +
> +  printk( "rtems_vtnet_driver_attach start\n" );
> +
> +  sc = &vtnet_softc;
> +  memset( sc, 0, sizeof( struct vtnet_softc ) );
> +
> +  /* Set up timing values */
> +  vtnet_ticksPerSecond = rtems_clock_get_ticks_per_second();
> +
> +  printk( "\tAttaching virtio pci...\n" );
> +  ret = vtpci_attach( config, &sc->vtpci_softc );
>

Re: [PATCH 2/2] confdefs.h hack

2016-03-29 Thread Joel Sherrill
On Tue, Mar 29, 2016 at 7:48 AM, Gedare Bloom  wrote:

> On Tue, Mar 29, 2016 at 7:51 AM, Sebastian Huber
>  wrote:
> > On 29/03/16 13:47, Sebastian Huber wrote:
> >>
> >> Not to be committed. How can we fix this?
> >
> >
> > I was able to run all MP tests except mp14 successfully using Qemu and a
> > virtual network. The TCP/IP based MPCI support is basically BSP
> independent
> > and should work for all BSPs that support a network interface driver in
> the
> > old network stack. So, maybe this MPCI driver should move to libchip. I
> am
> > not sure how we should address the confdefs.h issue.
> >
> This makes sense. You could add a new configure flag for the driver
> then, e.g. CONFIGURE_MPCI_DRIVER_ENABLED or something to control the
> confdefs ++bloat.
>
>
There is already CONFIGURE_MP_MPCI_TABLE_POINTER which is really
an older name for what you are suggesting. For consistency, it could be
renamed.

You should have "mpci net" and "mpci shm" and let the bsp.h select. There is
precedence for bsp.h to set defaults for confdefs.h.

Disclaimer: And yes.. the public interface for bsp.h isn't as well defined
as we
would like but I am trying to trim down what's included and start moving
things
to bspimpl.h to get a few examples that are cleaner.

Wasn't your other configuration issue that you wanted a server thread and
some resources per core?


> > The mp14 test seems to use a global partition. Does this make sense in a
> > non-shared memory setup, e.g. message passing via TCP/IP?
> >
> I doubt it makes sense. You need to have a lot of middleware to get a
> (partitioned) global address space to work over a message passing
> interface. It has been done before e.g. to use UPC/OpenMP over MPI,
> but I don't think this is necessarily good in our case.
>
>
No. It does not make sense.

Long ago, there was an MPCI implementation over MPI but I personally
never saw it. I don't know how they dealt with this.

Thinking generically, I would say we need a way to say global partitions
are not
supported by a particular MPCI.

FWIW should the "HAS OWN TABLE" support in confdefs.h disappear? I would
really hope that no one ever writes their own configuration by hand. :)


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

Patch Series to remove from

2016-03-29 Thread Joel Sherrill
Hi

I know I flooded the list for the patch series to remove clockdrv.h from
various bsp.h files and remove the warnings introduced.

I am on the downhill side of testing a similar patch for removing
 from  and it looks like it will result in even
more small patches to keep them one per BSP.

Is it worth submitting these to devel@ for review? Or should I just push
them to keep the traffic down. No one wants to review 90-100 patches which
remove a line from bsp.h and maybe add it back to a console.c. :)

Any heartburn if I just push them?

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

[PATCH] Obsolete rtems_clock_get() directive.

2016-03-29 Thread Joel Sherrill
This service was marked as deprecated long prior to the 4.11 release
series and is now being removed.

closes #2676.
---
 c/src/ada-tests/mptests/mp01/mptest.adb|8 +-
 c/src/ada-tests/samples/ticker/sptest.adb  |4 +-
 c/src/ada-tests/sptests/sp01/sptest.adb|4 +-
 c/src/ada-tests/sptests/sp03/sptest.adb|8 +-
 c/src/ada-tests/sptests/sp04/sptest.adb|   28 ++--
 c/src/ada-tests/sptests/sp09/sptest.adb|   27 ++--
 c/src/ada-tests/sptests/sp11/sptest.adb|   16 +-
 c/src/ada-tests/sptests/sp19/sptest.adp|8 +-
 c/src/ada-tests/sptests/sp20/sptest.adb|   10 +-
 c/src/ada-tests/sptests/sp22/sptest.adb|   12 +-
 c/src/ada-tests/sptests/sp24/sptest.adb|4 +-
 c/src/ada-tests/tmtests/tm08/tmtest.adb|5 +-
 c/src/ada-tests/tmtests/tm08/tmtest.ads|1 -
 c/src/ada-tests/tmtests/tmoverhd/dummy_rtems.adb   |8 +-
 c/src/ada-tests/tmtests/tmoverhd/dummy_rtems.ads   |5 +-
 c/src/ada-tests/tmtests/tmoverhd/tmtest.adb|4 +-
 c/src/ada/rtems-clock.adb  |   16 --
 c/src/ada/rtems-clock.ads  |   22 ---
 .../make/custom/xilinx_zynq_a9_qemu.cfg|3 +
 cpukit/rtems/Makefile.am   |1 -
 cpukit/rtems/include/rtems/rtems/clock.h   |   41 -
 cpukit/rtems/src/clockget.c|   67 
 doc/user/clock.t   |  167 
 testsuites/sptests/Makefile.am |2 +-
 testsuites/sptests/configure.ac|1 -
 testsuites/sptests/spclockget/Makefile.am  |   22 ---
 testsuites/sptests/spclockget/init.c   |   99 
 testsuites/sptests/spclockget/spclockget.doc   |   19 ---
 testsuites/sptests/spclockget/spclockget.scn   |8 -
 testsuites/tmtests/tmoverhd/dumrtems.h |2 +-
 testsuites/tmtests/tmoverhd/testtask.c |9 +-
 31 files changed, 109 insertions(+), 522 deletions(-)
 delete mode 100644 cpukit/rtems/src/clockget.c
 delete mode 100644 testsuites/sptests/spclockget/Makefile.am
 delete mode 100644 testsuites/sptests/spclockget/init.c
 delete mode 100644 testsuites/sptests/spclockget/spclockget.doc
 delete mode 100644 testsuites/sptests/spclockget/spclockget.scn

diff --git a/c/src/ada-tests/mptests/mp01/mptest.adb 
b/c/src/ada-tests/mptests/mp01/mptest.adb
index 779d124..b76a1af 100644
--- a/c/src/ada-tests/mptests/mp01/mptest.adb
+++ b/c/src/ada-tests/mptests/mp01/mptest.adb
@@ -146,8 +146,8 @@ package body MPTEST is
   RTEMS.TASKS.IDENT( RTEMS.SELF, RTEMS.SEARCH_ALL_NODES, TID, STATUS );
   TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF SELF" );

-  RTEMS.CLOCK.GET( RTEMS.CLOCK.GET_TOD, TIME'ADDRESS, STATUS );
-  TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET" );
+  RTEMS.CLOCK.GET_TOD( TIME, STATUS );
+  TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" );
 
   TEST_SUPPORT.PUT_NAME( 
  MPTEST.TASK_NAME( TEST_SUPPORT.TASK_NUMBER( TID ) ),
@@ -164,8 +164,8 @@ package body MPTEST is
   );
   TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" );
   
-  RTEMS.CLOCK.GET( RTEMS.CLOCK.GET_TOD, TIME'ADDRESS, STATUS );
-  TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET" );
+  RTEMS.CLOCK.GET_TOD( TIME, STATUS );
+  TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" );
 
   TEST_SUPPORT.PUT_NAME( 
  MPTEST.TASK_NAME( TEST_SUPPORT.TASK_NUMBER( TID ) ),
diff --git a/c/src/ada-tests/samples/ticker/sptest.adb 
b/c/src/ada-tests/samples/ticker/sptest.adb
index cfc33c7..2de8b35 100644
--- a/c/src/ada-tests/samples/ticker/sptest.adb
+++ b/c/src/ada-tests/samples/ticker/sptest.adb
@@ -129,8 +129,8 @@ package body SPTEST is

   loop
 
- RTEMS.CLOCK.GET( RTEMS.CLOCK.GET_TOD, TIME'ADDRESS, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET" );
+ RTEMS.CLOCK.GET_TOD( TIME, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" );
 
  if TIME.SECOND >= 35 then
 TEXT_IO.PUT_LINE( "*** END OF CLOCK TICK TEST ***" );
diff --git a/c/src/ada-tests/sptests/sp01/sptest.adb 
b/c/src/ada-tests/sptests/sp01/sptest.adb
index 53dc5dd..46e48e9 100644
--- a/c/src/ada-tests/sptests/sp01/sptest.adb
+++ b/c/src/ada-tests/sptests/sp01/sptest.adb
@@ -129,8 +129,8 @@ package body SPTEST is

   loop
 
- RTEMS.CLOCK.GET( RTEMS.CLOCK.GET_TOD, TIME'ADDRESS, STATUS );
- TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET" );
+ RTEMS.CLOCK.GET_TOD( TIME, STATUS );
+ TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" );
 
  if TIME.SECOND >= 35 then
 TEXT_IO.PUT_LINE( "*** END OF TEST 1 ***" );
diff --git a/c/src/ada-tests/sptests/sp03/sptest.adb 
b/c/src/ada-tests/sptest

[PATCH 2/5] posix/src/condattr*etpshared.c: Clean up and improve comments

2016-03-29 Thread Joel Sherrill
---
 cpukit/posix/src/condattrgetpshared.c | 13 +++--
 cpukit/posix/src/condattrsetpshared.c | 14 ++
 2 files changed, 5 insertions(+), 22 deletions(-)

diff --git a/cpukit/posix/src/condattrgetpshared.c 
b/cpukit/posix/src/condattrgetpshared.c
index e1427df..92918cb 100644
--- a/cpukit/posix/src/condattrgetpshared.c
+++ b/cpukit/posix/src/condattrgetpshared.c
@@ -1,8 +1,8 @@
 /**
- *  @file
+ * @file
  *
- *  @brief Get the Process-Shared Condition Variable Attributes
- *  @ingroup POSIXAPI
+ * @brief Get the Process-Shared Condition Variable Attributes
+ * @ingroup POSIXAPI
  */
 
 /*
@@ -22,14 +22,7 @@
 #include 
 
 #include 
-#include 
-#include 
-#include 
 
-/**
- *  11.4.1 Condition Variable Initialization Attributes,
- *P1003.1c/Draft 10, p. 96
- */
 int pthread_condattr_getpshared(
   const pthread_condattr_t *attr,
   int  *pshared
diff --git a/cpukit/posix/src/condattrsetpshared.c 
b/cpukit/posix/src/condattrsetpshared.c
index b67..3128ad7 100644
--- a/cpukit/posix/src/condattrsetpshared.c
+++ b/cpukit/posix/src/condattrsetpshared.c
@@ -1,12 +1,12 @@
 /**
  * @file
  *
- * @brief Initialize Condition Variable Attributes
+ * @brief Set the Process-Shared Condition Variable Attributes
  * @ingroup POSIXAPI
  */
 
 /*
- *  COPYRIGHT (c) 1989-2007.
+ *  COPYRIGHT (c) 1989-2007, 2016.
  *  On-Line Applications Research Corporation (OAR).
  *
  *  The license and distribution terms for this file may be
@@ -21,16 +21,6 @@
 #include 
 #include 
 
-#include 
-#include 
-#include 
-#include 
-
-/*
- *  11.4.1 Condition Variable Initialization Attributes,
- *P1003.1c/Draft 10, p. 96
- */
-
 int pthread_condattr_setpshared(
   pthread_condattr_t *attr,
   int pshared
-- 
1.8.3.1

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


[PATCH 1/5] Add pthread_getconcurrency() and pthread_setconcurrency()

2016-03-29 Thread Joel Sherrill
This is the very simple implementation specified by the Open Group
for implementations with 1:1 kernel thread to user thread mappings.

http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_getconcurrency.html

updates #2680.
---
 cpukit/posix/Makefile.am   |  1 +
 cpukit/posix/src/pthreadconcurrency.c  | 42 
 testsuites/psxtests/Makefile.am|  2 +-
 testsuites/psxtests/configure.ac   |  1 +
 testsuites/psxtests/psxconcurrency01/Makefile.am   | 23 +
 testsuites/psxtests/psxconcurrency01/init.c| 58 ++
 .../psxtests/psxconcurrency01/psxconcurrency01.doc | 25 ++
 .../psxtests/psxconcurrency01/psxconcurrency01.scn |  5 ++
 testsuites/psxtests/psxhdrs/Makefile.am|  2 +
 .../psxhdrs/pthread/pthread_getconcurrency.c   | 34 +
 .../psxhdrs/pthread/pthread_setconcurrency.c   | 37 ++
 11 files changed, 229 insertions(+), 1 deletion(-)
 create mode 100644 cpukit/posix/src/pthreadconcurrency.c
 create mode 100644 testsuites/psxtests/psxconcurrency01/Makefile.am
 create mode 100644 testsuites/psxtests/psxconcurrency01/init.c
 create mode 100644 testsuites/psxtests/psxconcurrency01/psxconcurrency01.doc
 create mode 100644 testsuites/psxtests/psxconcurrency01/psxconcurrency01.scn
 create mode 100644 testsuites/psxtests/psxhdrs/pthread/pthread_getconcurrency.c
 create mode 100644 testsuites/psxtests/psxhdrs/pthread/pthread_setconcurrency.c

diff --git a/cpukit/posix/Makefile.am b/cpukit/posix/Makefile.am
index dcedf5b..a72daae 100644
--- a/cpukit/posix/Makefile.am
+++ b/cpukit/posix/Makefile.am
@@ -126,6 +126,7 @@ libposix_a_SOURCES += src/pthreadatfork.c 
src/pthreadattrdestroy.c \
 src/pthreadattrsetstack.c src/pthreadattrsetstacksize.c \
 src/pthreadgetattrnp.c \
 src/pthreadattrgetguardsize.c src/pthread.c \
+src/pthreadconcurrency.c \
 src/pthreadcreate.c src/pthreaddetach.c src/pthreadequal.c \
 src/pthreadexit.c src/pthreadgetcpuclockid.c \
 src/pthreadgetschedparam.c \
diff --git a/cpukit/posix/src/pthreadconcurrency.c 
b/cpukit/posix/src/pthreadconcurrency.c
new file mode 100644
index 000..7e9c9c0
--- /dev/null
+++ b/cpukit/posix/src/pthreadconcurrency.c
@@ -0,0 +1,42 @@
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+/**
+ * @file
+ *
+ * @brief Pthread Get/Set Concurrency
+ * @ingroup POSIXAPI
+ *
+ * Per the Open Group specification, when user pthreads are mapped 1:1
+ * onto kernel threads, the implementation simply tracks an internal
+ * variable whose initial value is 0. If it is set, subsequent calls to
+ * obtain the value return that previously set.
+ */
+
+/*
+ *  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
+ *  http://www.rtems.org/license/LICENSE.
+ */
+
+#include 
+#include 
+
+static int pthread_concurrency_level;
+
+int pthread_getconcurrency(void)
+{
+  return pthread_concurrency_level;
+}
+
+int pthread_setconcurrency(
+  int new_level
+)
+{
+  pthread_concurrency_level = new_level;
+  return 0;
+}
diff --git a/testsuites/psxtests/Makefile.am b/testsuites/psxtests/Makefile.am
index bb89cde..6dd5649 100644
--- a/testsuites/psxtests/Makefile.am
+++ b/testsuites/psxtests/Makefile.am
@@ -7,7 +7,7 @@ _SUBDIRS += psxhdrs psx01 psx02 psx03 psx04 psx05 psx06 psx07 
psx08 psx09 \
 psxaio01 psxaio02 psxaio03 \
 psxalarm01 psxautoinit01 psxautoinit02 psxbarrier01 \
 psxcancel psxcancel01 psxclassic01 psxcleanup psxcleanup01 \
-psxcond01 psxconfig01 psxenosys \
+psxconcurrency01 psxcond01 psxconfig01 psxenosys \
 psxitimer psxmsgq01 psxmsgq02 psxmsgq03 psxmsgq04 \
 psxmutexattr01 psxobj01 psxrwlock01 psxsem01 psxsignal01 psxsignal02 \
 psxsignal03 psxsignal04 psxsignal05 psxsignal06 \
diff --git a/testsuites/psxtests/configure.ac b/testsuites/psxtests/configure.ac
index 67ef83e..779e0b5 100644
--- a/testsuites/psxtests/configure.ac
+++ b/testsuites/psxtests/configure.ac
@@ -143,6 +143,7 @@ psxcleanup01/Makefile
 psxcleanup02/Makefile
 psxclock/Makefile
 psxclock01/Makefile
+psxconcurrency01/Makefile
 psxcond01/Makefile
 psxconfig01/Makefile
 psxeintr_join/Makefile
diff --git a/testsuites/psxtests/psxconcurrency01/Makefile.am 
b/testsuites/psxtests/psxconcurrency01/Makefile.am
new file mode 100644
index 000..2be4ebb
--- /dev/null
+++ b/testsuites/psxtests/psxconcurrency01/Makefile.am
@@ -0,0 +1,23 @@
+
+rtems_tests_PROGRAMS = psxconcurrency01
+psxconcurrency01_SOURCES = init.c ../include/pmacros.h
+
+dist_rtems_tests_DATA = psxconcurrency01.scn
+dist_rtems_tests_DATA += psxconcurrency01.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+
+AM_CPPFLAGS += -I$(top_srcdir)/include
+AM_CPPFLAGS += -I$(top_srcdir)/..

[PATCH 3/5] conddefaultattributes.c: Add default clock to structure.

2016-03-29 Thread Joel Sherrill
---
 cpukit/posix/src/conddefaultattributes.c | 13 ++---
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/cpukit/posix/src/conddefaultattributes.c 
b/cpukit/posix/src/conddefaultattributes.c
index 84fdbc8..9b0837e 100644
--- a/cpukit/posix/src/conddefaultattributes.c
+++ b/cpukit/posix/src/conddefaultattributes.c
@@ -6,7 +6,7 @@
  */
 
 /*
- *  COPYRIGHT (c) 1989-2007.
+ *  COPYRIGHT (c) 1989-2007, 2016.
  *  On-Line Applications Research Corporation (OAR).
  *
  *  The license and distribution terms for this file may be
@@ -19,18 +19,17 @@
 #endif
 
 #include 
-#include 
 
 #include 
-#include 
-#include 
-#include 
 
 /*
  *  The default condition variable attributes structure.
  */
 
 const pthread_condattr_t _POSIX_Condition_variables_Default_attributes = {
-  true,  /* is_initialized */
-  PTHREAD_PROCESS_PRIVATE/* process_shared */
+  .is_initialized = true,
+  .clock  = CLOCK_REALTIME,
+#if defined(_POSIX_THREAD_PROCESS_SHARED)
+  .process_shared = PTHREAD_PROCESS_PRIVATE
+#endif
 };
-- 
1.8.3.1

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


[PATCH] [RSB] use updated newlib revision for or1k

2016-03-29 Thread Hesham Almatary
---
 rtems/config/4.12/rtems-or1k.bset   |  2 +-
 rtems/config/tools/rtems-gcc-4.9.3-newlib-git-1.cfg | 13 +
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 rtems/config/tools/rtems-gcc-4.9.3-newlib-git-1.cfg

diff --git a/rtems/config/4.12/rtems-or1k.bset 
b/rtems/config/4.12/rtems-or1k.bset
index 7d8baba..fe6a23d 100644
--- a/rtems/config/4.12/rtems-or1k.bset
+++ b/rtems/config/4.12/rtems-or1k.bset
@@ -38,7 +38,7 @@
 4.12/rtems-autotools
 devel/expat-2.1.0-1
 tools/rtems-binutils-2.26-1
-tools/rtems-gcc-4.9.3-newlib-2.2.0-20150423-1.cfg
+tools/rtems-gcc-4.9.3-newlib-git-1.cfg
 tools/rtems-tools-4.12-1
 tools/rtems-gdb-7.11-1
 
diff --git a/rtems/config/tools/rtems-gcc-4.9.3-newlib-git-1.cfg 
b/rtems/config/tools/rtems-gcc-4.9.3-newlib-git-1.cfg
new file mode 100644
index 000..ad95302
--- /dev/null
+++ b/rtems/config/tools/rtems-gcc-4.9.3-newlib-git-1.cfg
@@ -0,0 +1,13 @@
+#
+# GCC 4.9.3., Newlib GIT
+#
+
+%define gcc_version4.9.3
+%define newlib_version 8b1ede3ce11d53292036aadfcfb6043df0235f9c
+
+%hash md5 gcc-%{gcc_version}.tar.bz2 6f831b4d251872736e8e9cc09746f327
+
+#
+# The gcc/newlib build instructions.
+#
+%include tools/rtems-gcc-4.9-newlib-git-1.cfg
-- 
2.8.0.rc3

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


Re: [PATCH] [RSB] use updated newlib revision for or1k

2016-03-29 Thread Joel Sherrill
I am OK with this if you want to push it.

I guess you saw that I plan/hope to bump the newlib and gcc versions
on all targets I can when the next newlib snapshot comes out.

--joel

On Tue, Mar 29, 2016 at 5:23 PM, Hesham Almatary 
wrote:

> ---
>  rtems/config/4.12/rtems-or1k.bset   |  2 +-
>  rtems/config/tools/rtems-gcc-4.9.3-newlib-git-1.cfg | 13 +
>  2 files changed, 14 insertions(+), 1 deletion(-)
>  create mode 100644 rtems/config/tools/rtems-gcc-4.9.3-newlib-git-1.cfg
>
> diff --git a/rtems/config/4.12/rtems-or1k.bset
> b/rtems/config/4.12/rtems-or1k.bset
> index 7d8baba..fe6a23d 100644
> --- a/rtems/config/4.12/rtems-or1k.bset
> +++ b/rtems/config/4.12/rtems-or1k.bset
> @@ -38,7 +38,7 @@
>  4.12/rtems-autotools
>  devel/expat-2.1.0-1
>  tools/rtems-binutils-2.26-1
> -tools/rtems-gcc-4.9.3-newlib-2.2.0-20150423-1.cfg
> +tools/rtems-gcc-4.9.3-newlib-git-1.cfg
>  tools/rtems-tools-4.12-1
>  tools/rtems-gdb-7.11-1
>
> diff --git a/rtems/config/tools/rtems-gcc-4.9.3-newlib-git-1.cfg
> b/rtems/config/tools/rtems-gcc-4.9.3-newlib-git-1.cfg
> new file mode 100644
> index 000..ad95302
> --- /dev/null
> +++ b/rtems/config/tools/rtems-gcc-4.9.3-newlib-git-1.cfg
> @@ -0,0 +1,13 @@
> +#
> +# GCC 4.9.3., Newlib GIT
> +#
> +
> +%define gcc_version4.9.3
> +%define newlib_version 8b1ede3ce11d53292036aadfcfb6043df0235f9c
> +
> +%hash md5 gcc-%{gcc_version}.tar.bz2 6f831b4d251872736e8e9cc09746f327
> +
> +#
> +# The gcc/newlib build instructions.
> +#
> +%include tools/rtems-gcc-4.9-newlib-git-1.cfg
> --
> 2.8.0.rc3
>
> ___
> 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

Correcting Location of Header Files in Source Tree

2016-03-29 Thread Joel Sherrill
Hi

There are a handful of header files which are in the wrong place in the
source tree in cpukit. So far, I haven't found one which needs to change
the installed view.

The ones I have identified so far are:

+ device driver interface definitions in libcsupport/include which should
now
be in cpukit/include. Some were not under rtems/ but were installed there.

+ confdefs.h is in sapi/include but should be sapi/include/rtems/confdefs.h
based  on its installed location.

I don't expect any of these to impact user code and will be testing
thoroughly.

Any comments or other misplaced files I should look into?

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

Re: [PATCH] [RSB] use updated newlib revision for or1k

2016-03-29 Thread Hesham Almatary
Building RTEMS without this patch will fail with some nfs and rpc libs
since newlib version is outdated (March 2015).

On Wed, Mar 30, 2016 at 10:03 AM Joel Sherrill  wrote:

> I am OK with this if you want to push it.
>
> I guess you saw that I plan/hope to bump the newlib and gcc versions
> on all targets I can when the next newlib snapshot comes out.
>
> --joel
>
> On Tue, Mar 29, 2016 at 5:23 PM, Hesham Almatary  > wrote:
>
>> ---
>>  rtems/config/4.12/rtems-or1k.bset   |  2 +-
>>  rtems/config/tools/rtems-gcc-4.9.3-newlib-git-1.cfg | 13 +
>>  2 files changed, 14 insertions(+), 1 deletion(-)
>>  create mode 100644 rtems/config/tools/rtems-gcc-4.9.3-newlib-git-1.cfg
>>
>> diff --git a/rtems/config/4.12/rtems-or1k.bset
>> b/rtems/config/4.12/rtems-or1k.bset
>> index 7d8baba..fe6a23d 100644
>> --- a/rtems/config/4.12/rtems-or1k.bset
>> +++ b/rtems/config/4.12/rtems-or1k.bset
>> @@ -38,7 +38,7 @@
>>  4.12/rtems-autotools
>>  devel/expat-2.1.0-1
>>  tools/rtems-binutils-2.26-1
>> -tools/rtems-gcc-4.9.3-newlib-2.2.0-20150423-1.cfg
>> +tools/rtems-gcc-4.9.3-newlib-git-1.cfg
>>  tools/rtems-tools-4.12-1
>>  tools/rtems-gdb-7.11-1
>>
>> diff --git a/rtems/config/tools/rtems-gcc-4.9.3-newlib-git-1.cfg
>> b/rtems/config/tools/rtems-gcc-4.9.3-newlib-git-1.cfg
>> new file mode 100644
>> index 000..ad95302
>> --- /dev/null
>> +++ b/rtems/config/tools/rtems-gcc-4.9.3-newlib-git-1.cfg
>> @@ -0,0 +1,13 @@
>> +#
>> +# GCC 4.9.3., Newlib GIT
>> +#
>> +
>> +%define gcc_version4.9.3
>> +%define newlib_version 8b1ede3ce11d53292036aadfcfb6043df0235f9c
>> +
>> +%hash md5 gcc-%{gcc_version}.tar.bz2 6f831b4d251872736e8e9cc09746f327
>> +
>> +#
>> +# The gcc/newlib build instructions.
>> +#
>> +%include tools/rtems-gcc-4.9-newlib-git-1.cfg
>>
> --
>> 2.8.0.rc3
>>
>> ___
>> 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] [RSB] use updated newlib revision for or1k

2016-03-29 Thread Joel Sherrill
On Tue, Mar 29, 2016 at 6:08 PM, Hesham Almatary 
wrote:

> Building RTEMS without this patch will fail with some nfs and rpc libs
> since newlib version is outdated (March 2015).
>
> Then this will fix one of the two repeating BSP build failures. :)

If you can fix the sh4 BSP, then another gets knocked off. lol


> On Wed, Mar 30, 2016 at 10:03 AM Joel Sherrill  wrote:
>
>> I am OK with this if you want to push it.
>>
>> I guess you saw that I plan/hope to bump the newlib and gcc versions
>> on all targets I can when the next newlib snapshot comes out.
>>
>> --joel
>>
>> On Tue, Mar 29, 2016 at 5:23 PM, Hesham Almatary <
>> heshamelmat...@gmail.com> wrote:
>>
>>> ---
>>>  rtems/config/4.12/rtems-or1k.bset   |  2 +-
>>>  rtems/config/tools/rtems-gcc-4.9.3-newlib-git-1.cfg | 13 +
>>>  2 files changed, 14 insertions(+), 1 deletion(-)
>>>  create mode 100644 rtems/config/tools/rtems-gcc-4.9.3-newlib-git-1.cfg
>>>
>>> diff --git a/rtems/config/4.12/rtems-or1k.bset
>>> b/rtems/config/4.12/rtems-or1k.bset
>>> index 7d8baba..fe6a23d 100644
>>> --- a/rtems/config/4.12/rtems-or1k.bset
>>> +++ b/rtems/config/4.12/rtems-or1k.bset
>>> @@ -38,7 +38,7 @@
>>>  4.12/rtems-autotools
>>>  devel/expat-2.1.0-1
>>>  tools/rtems-binutils-2.26-1
>>> -tools/rtems-gcc-4.9.3-newlib-2.2.0-20150423-1.cfg
>>> +tools/rtems-gcc-4.9.3-newlib-git-1.cfg
>>>  tools/rtems-tools-4.12-1
>>>  tools/rtems-gdb-7.11-1
>>>
>>> diff --git a/rtems/config/tools/rtems-gcc-4.9.3-newlib-git-1.cfg
>>> b/rtems/config/tools/rtems-gcc-4.9.3-newlib-git-1.cfg
>>> new file mode 100644
>>> index 000..ad95302
>>> --- /dev/null
>>> +++ b/rtems/config/tools/rtems-gcc-4.9.3-newlib-git-1.cfg
>>> @@ -0,0 +1,13 @@
>>> +#
>>> +# GCC 4.9.3., Newlib GIT
>>> +#
>>> +
>>> +%define gcc_version4.9.3
>>> +%define newlib_version 8b1ede3ce11d53292036aadfcfb6043df0235f9c
>>> +
>>> +%hash md5 gcc-%{gcc_version}.tar.bz2 6f831b4d251872736e8e9cc09746f327
>>> +
>>> +#
>>> +# The gcc/newlib build instructions.
>>> +#
>>> +%include tools/rtems-gcc-4.9-newlib-git-1.cfg
>>>
>> --
>>> 2.8.0.rc3
>>>
>>> ___
>>> 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] [RSB] use updated newlib revision for or1k

2016-03-29 Thread Hesham Almatary
On Wed, Mar 30, 2016 at 10:15 AM Joel Sherrill  wrote:

> On Tue, Mar 29, 2016 at 6:08 PM, Hesham Almatary  > wrote:
>
>> Building RTEMS without this patch will fail with some nfs and rpc libs
>> since newlib version is outdated (March 2015).
>>
>> Then this will fix one of the two repeating BSP build failures. :)
>
> If you can fix the sh4 BSP, then another gets knocked off. lol
>
>
I guess the fix won't be the same. I checked RSB rtems-sh.bset and it's
already using the latest gcc-6 and newlib versions (default).


> On Wed, Mar 30, 2016 at 10:03 AM Joel Sherrill  wrote:
>>
>>> I am OK with this if you want to push it.
>>>
>>> I guess you saw that I plan/hope to bump the newlib and gcc versions
>>> on all targets I can when the next newlib snapshot comes out.
>>>
>>> --joel
>>>
>>> On Tue, Mar 29, 2016 at 5:23 PM, Hesham Almatary <
>>> heshamelmat...@gmail.com> wrote:
>>>
 ---
  rtems/config/4.12/rtems-or1k.bset   |  2 +-
  rtems/config/tools/rtems-gcc-4.9.3-newlib-git-1.cfg | 13 +
  2 files changed, 14 insertions(+), 1 deletion(-)
  create mode 100644 rtems/config/tools/rtems-gcc-4.9.3-newlib-git-1.cfg

 diff --git a/rtems/config/4.12/rtems-or1k.bset
 b/rtems/config/4.12/rtems-or1k.bset
 index 7d8baba..fe6a23d 100644
 --- a/rtems/config/4.12/rtems-or1k.bset
 +++ b/rtems/config/4.12/rtems-or1k.bset
 @@ -38,7 +38,7 @@
  4.12/rtems-autotools
  devel/expat-2.1.0-1
  tools/rtems-binutils-2.26-1
 -tools/rtems-gcc-4.9.3-newlib-2.2.0-20150423-1.cfg
 +tools/rtems-gcc-4.9.3-newlib-git-1.cfg
  tools/rtems-tools-4.12-1
  tools/rtems-gdb-7.11-1

 diff --git a/rtems/config/tools/rtems-gcc-4.9.3-newlib-git-1.cfg
 b/rtems/config/tools/rtems-gcc-4.9.3-newlib-git-1.cfg
 new file mode 100644
 index 000..ad95302
 --- /dev/null
 +++ b/rtems/config/tools/rtems-gcc-4.9.3-newlib-git-1.cfg
 @@ -0,0 +1,13 @@
 +#
 +# GCC 4.9.3., Newlib GIT
 +#
 +
 +%define gcc_version4.9.3
 +%define newlib_version 8b1ede3ce11d53292036aadfcfb6043df0235f9c
 +
 +%hash md5 gcc-%{gcc_version}.tar.bz2 6f831b4d251872736e8e9cc09746f327
 +
 +#
 +# The gcc/newlib build instructions.
 +#
 +%include tools/rtems-gcc-4.9-newlib-git-1.cfg

>>> --
 2.8.0.rc3

 ___
 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: Correcting Location of Header Files in Source Tree

2016-03-29 Thread Gedare Bloom
Amar might have a long list.

On Tue, Mar 29, 2016 at 7:07 PM, Joel Sherrill  wrote:
> Hi
>
> There are a handful of header files which are in the wrong place in the
> source tree in cpukit. So far, I haven't found one which needs to change
> the installed view.
>
> The ones I have identified so far are:
>
> + device driver interface definitions in libcsupport/include which should
> now
> be in cpukit/include. Some were not under rtems/ but were installed there.
>
> + confdefs.h is in sapi/include but should be sapi/include/rtems/confdefs.h
> based  on its installed location.
>
> I don't expect any of these to impact user code and will be testing
> thoroughly.
>
> Any comments or other misplaced files I should look into?
>
> --joel
>
> ___
> devel mailing list
> devel@rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH] bsp/pc386: Fix --console=/--printk argument parsing.

2016-03-29 Thread Chris Johns
---
 .../lib/libbsp/i386/pc386/console/console_select.c | 62 ++
 1 file changed, 41 insertions(+), 21 deletions(-)

diff --git a/c/src/lib/libbsp/i386/pc386/console/console_select.c 
b/c/src/lib/libbsp/i386/pc386/console/console_select.c
index 3fb31ec..7b40f97 100644
--- a/c/src/lib/libbsp/i386/pc386/console/console_select.c
+++ b/c/src/lib/libbsp/i386/pc386/console/console_select.c
@@ -33,6 +33,8 @@
   #include 
 #endif
 
+#include 
+
 /*
  * Forward prototype
  */
@@ -137,14 +139,19 @@ static void parse_com1_com4_enable(void)
   }
 }
 
+extern char* bsp_boot_cmdline;
+
 static bool parse_printk_or_console(
   const char*param,
   rtems_device_minor_number *minor_out
 )
 {
-  static const char *opt;
-  char   working[64] = "";
-  char  *p;
+  static const char *opt;
+  const char*option;
+  const char*comma;
+  size_t length;
+  size_t index;
+  rtems_device_minor_number  minor;
 
   /*
* Check the command line for the type of mode the console is.
@@ -155,30 +162,43 @@ static bool parse_printk_or_console(
   }
 
   /*
-   * bsp_cmdline_arg() returns pointer to a string. It may not be the
-   * last string on the command line.
+   * Fine the length, there can be more command line visible.
*/
-  strncpy( working, opt, sizeof(working) );
-  p = strchr( working, ' ' );
-  if ( p ) {
-*p = '\0';
+  length = 0;
+  while ((opt[length] != ' ') && (opt[length] != '\0')) {
+++length;
+if (length > NAME_MAX) {
+  printk("invalid option (%s): too long\n", param);
+  return false;
+}
   }
 
-  const char*comma;
-  size_t length = NAME_MAX;
-  rtems_device_minor_number  minor;
-  char  *option = working;
-
   /*
* Only match up to a comma or NULL
*/
-  comma = strchr (option, ',');
+  index = 0;
+  while ((opt[index] != '=') && (index < length)) {
+++index;
+  }
+
+  if (opt[index] != '=') {
+printk("invalid option (%s): no equals\n", param);
+return false;
+  }
+
+  ++index;
+  option = &opt[index];
 
-  if ( comma ) {
-length = comma - option;
+  while ((opt[index] != ',') && (index < length)) {
+++index;
   }
 
-  option += strnlen(param, 32);
+  if (opt[index] == ',')
+comma = &opt[index];
+  else
+comma = NULL;
+
+  length = &opt[index] - option;
 
   if ( !bsp_find_console_entry( option, length, &minor ) ) {
 return false;
@@ -186,10 +206,10 @@ static bool parse_printk_or_console(
 
   *minor_out = minor;
   if (comma) {
-console_tbl *conscfg;
+console_tbl *conscfg = &Console_Configuration_Ports[minor];
+
+option = comma + 1;
 
-comma += 1;
-conscfg = &Console_Configuration_Ports[minor];
 if (strncmp (option, "115200", sizeof ("115200") - 1) == 0)
   conscfg->pDeviceParams = (void *)115200;
 else if (strncmp (option, "57600", sizeof ("57600") - 1) == 0)
-- 
2.3.0

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


Re: [PATCH] [RSB] use updated newlib revision for or1k

2016-03-29 Thread Stefan Wallentowitz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Hesham,

there is also a GCC-6 snapshot available:
https://github.com/openrisc/newlib/releases/tag/gcc6-preview

This was the GCC version used in the other architectures last week, so
maybe it makes sense to bump to this GCC version, too.

Best,
Stefan
-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iEYEARECAAYFAlb7Y20ACgkQuMYtsrn2U9xDqACgosg/yDD8YBaJaPFqdiBH+CBQ
ZZUAoIWMCHPtP0N3TgO3zTT4bSxrC3n7
=knxA
-END PGP SIGNATURE-
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH] [RSB] use updated newlib revision for or1k

2016-03-29 Thread Sebastian Huber



On 30/03/16 07:26, Stefan Wallentowitz wrote:

there is also a GCC-6 snapshot available:
https://github.com/openrisc/newlib/releases/tag/gcc6-preview

This was the GCC version used in the other architectures last week, so
maybe it makes sense to bump to this GCC version, too.


Are there any plans to integrate the or1k stuff into the FSF GCC?

--
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] [RSB] use updated newlib revision for or1k

2016-03-29 Thread Stefan Wallentowitz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 30.03.2016 07:29, Sebastian Huber wrote:
> 
> 
> On 30/03/16 07:26, Stefan Wallentowitz wrote:
>> there is also a GCC-6 snapshot available: 
>> https://github.com/openrisc/newlib/releases/tag/gcc6-preview
>> 
>> This was the GCC version used in the other architectures last
>> week, so maybe it makes sense to bump to this GCC version, too.
> 
> Are there any plans to integrate the or1k stuff into the FSF GCC?
> 

Hi Sebastian,

this is unfortunately not possible due to one missing FSF copyright
assignment of the original author. We have repeatedly tried to
convince him or find a proper workaround, but do not have a solution.
But we are keeping up with upstream GCC pretty fast currently.

If you accidentally know somehow who would be interested to rewrite
the GCC port from scratch..

Cheers,
Stefan
-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iEYEARECAAYFAlb7aKkACgkQuMYtsrn2U9wbjgCffW0gkH6MDa2T/SnwGGFkXLWe
s9oAnAyqPfD8jNiXSdDsfOZW3QIn2anE
=BBl7
-END PGP SIGNATURE-
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel