Commit 98bdcac8 authored by yoogx's avatar yoogx
Browse files

* Add case for RTEMS 5

            For openaadl/ocarina#146
parent 05f57881
......@@ -5,13 +5,15 @@
*
* For more informations, please visit http://taste.tuxfamily.org/wiki
*
* Copyright (C) 2007-2009 Telecom ParisTech, 2010-2017 ESA & ISAE.
* Copyright (C) 2007-2009 Telecom ParisTech, 2010-2018 ESA & ISAE.
*/
#ifndef __PO_HI_COMMON_H__
#define __PO_HI_COMMON_H__
#include <deployment.h>
/* deployment.h sets macro on required drivers, this file is generated
by Ocarina */
#if (defined (RTEMS_POSIX) || defined (__PO_HI_RTEMS_CLASSIC_API))
#if defined (__PO_HI_NEED_DRIVER_ETH_LEON) || \
......@@ -36,15 +38,12 @@
#include <amba.h>
#include <bsp/grspw.h>
#include <drvmgr/ambapp_bus.h>
#define CONFIGURE_INIT
#include <bsp.h>
#endif
#include <bsp.h>
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_NULL_DRIVER
// #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
// #define CONFIGURE_APPLICATION_NEEDS_NULL_DRIVER
#define CONFIGURE_MAXIMUM_DRIVERS 10
#define CONFIGURE_MAXIMUM_POSIX_TIMERS 40
#define CONFIGURE_MAXIMUM_TIMERS 40
......@@ -53,10 +52,8 @@
#define CONFIGURE_MAXIMUM_TASKS __PO_HI_NB_TASKS + 2
#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 20
int POSIX_Init ();
#define CONFIGURE_MAXIMUM_POSIX_THREADS __PO_HI_NB_TASKS + 10
/* #define CONFIGURE_EXTRA_TASK_STACKS (20 * RTEMS_MINIMUM_STACK_SIZE)
*/
#ifdef __PO_HI_NB_PORTS
#define CONFIGURE_MAXIMUM_POSIX_MUTEXES __PO_HI_NB_TASKS + 10 + __PO_HI_NB_PORTS
#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES __PO_HI_NB_TASKS + 10 + __PO_HI_NB_PORTS
......@@ -64,14 +61,24 @@
#define CONFIGURE_MAXIMUM_POSIX_MUTEXES __PO_HI_NB_TASKS + 10 + __PO_HI_NB_PORTS
#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES __PO_HI_NB_TASKS + 10 + __PO_HI_NB_PORTS
#endif
#define CONFIGURE_POSIX_INIT_THREAD_TABLE
#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
#define CONFIGURE_INIT
#include <rtems/confdefs.h>
void *POSIX_Init (void);
#define CONFIGURE_POSIX_INIT_THREAD_TABLE
#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
#define CONFIGURE_INIT
/* Driver Manager configuration for rtems 4.12*/
#if defined GRLEON3 && defined RTEMS412
/*****************************************************************************/
/* Driver Manager configuration for RTEMS 4.12 and onwards */
/* Important note: some RTEMS CONFIGURE macros above must be completed
* with specific driver configuration, otherwise some features will
* not work, e.g. CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER requires
* CONFIGURE_DRIVER_AMBAPP_GAISLER_GPTIMER
*/
#if defined GRLEON3 && defined RTEMS412
#ifdef __PO_HI_NEED_DRIVER_ETH_LEON
#define CONFIGURE_DRIVER_AMBAPP_GAISLER_GRETH /* GRETH Driver enabled*/
......@@ -80,14 +87,27 @@
#ifdef __PO_HI_NEED_DRIVER_SPACEWIRE_RASTA
#define CONFIGURE_DRIVER_AMBAPP_GAISLER_GRSPW /* GRSPW Driver enabled*/
#endif
#include <drvmgr/drvmgr_confdefs.h>
#include <drvmgr/ambapp_bus.h>
#include <ambapp_ids.h>
#include <drvmgr/drvmgr.h>
/* Configure Driver manager */
#if defined(RTEMS_DRVMGR_STARTUP) && defined(LEON3)
/* if --drvmgr was given to RTEMS configure */
/* Clock driver */
#ifdef CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
#define CONFIGURE_DRIVER_AMBAPP_GAISLER_GPTIMER
#endif
#ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
#define CONFIGURE_DRIVER_AMBAPP_GAISLER_APBUART
#endif
#endif
#endif /*GRLEON3 && RTEMS412*/
#include <rtems/confdefs.h>
#include <drvmgr/drvmgr_confdefs.h>
#endif /* RTEMS_POSIX */
#if defined(__PO_HI_RTEMS_CLASSIC_API)
......@@ -120,10 +140,10 @@
#define CONFIGURE_MAXIMUM_PERIODS __PO_HI_NB_TASKS + 5
/*
* We put __PO_HI_NB_TASKS + 5 because we may have additional tasks
* from the driver. Originally, it was +2 fr th emain thread and a potential
* network thread. Since, other drivers take additional tasks and so, we
* increase it to 5. We would do a better integration by filtering
* the use of each driver.
* from the driver. Originally, it was +2 for the main thread and a
* potential network thread. Since, other drivers take additional
* tasks and so, we increase it to 5. We would do a better
* integration by filtering the use of each driver.
*/
#ifndef RTEMS411
......@@ -143,8 +163,8 @@
#include <rtems/rtems_bsdnet.h>
#include <bsp.h>
/*
/*
int rtems_bsdnet_loopattach(struct rtems_bsdnet_ifconfig*, int);
static struct rtems_bsdnet_ifconfig loopback_config =
......@@ -156,9 +176,9 @@ static struct rtems_bsdnet_ifconfig loopback_config =
struct rtems_bsdnet_ifconfig netdriver_config =
{RTEMS_BSP_NETWORK_DRIVER_NAME,RTEMS_BSP_NETWORK_DRIVER_ATTACH,
&loopback_config,"192.168.0.1","255.255.255.0",
&loopback_config,"192.168.0.1","255.255.255.0",
(char[]){ 0x00, 0x1F, 0xC6, 0xBF, 0x74, 0x06},
0,0,0,0,0,9};
0,0,0,0,0,9};
struct rtems_bsdnet_config rtems_bsdnet_config =
{&netdriver_config,NULL,0,256 * 1024,256 * 1024,};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment