Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
PolyORB-HI-C
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
6
Issues
6
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
TASTE
PolyORB-HI-C
Commits
52e539f6
Commit
52e539f6
authored
Mar 09, 2020
by
Maxime Perrotin
Browse files
Options
Browse Files
Download
Plain Diff
Merge
https://github.com/openaadl/polyorb-hi-c
parents
296b10d4
ac3b8492
Changes
22
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
246 additions
and
166 deletions
+246
-166
include/drivers/configuration/1553.h
include/drivers/configuration/1553.h
+8
-8
include/drivers/configuration/asn1crt.h
include/drivers/configuration/asn1crt.h
+126
-31
include/drivers/configuration/ip.h
include/drivers/configuration/ip.h
+3
-3
include/drivers/configuration/serial.h
include/drivers/configuration/serial.h
+6
-6
include/drivers/configuration/spacewire.h
include/drivers/configuration/spacewire.h
+8
-8
include/po_hi_common.h
include/po_hi_common.h
+1
-1
share/make/Makefile.air
share/make/Makefile.air
+24
-25
src/drivers/config.c
src/drivers/config.c
+10
-0
src/drivers/config_leon3_drvmgr.c
src/drivers/config_leon3_drvmgr.c
+10
-0
src/drivers/config_leon4_n2x.c
src/drivers/config_leon4_n2x.c
+10
-0
src/drivers/configuration/1553.c
src/drivers/configuration/1553.c
+4
-8
src/drivers/configuration/Makefile.am
src/drivers/configuration/Makefile.am
+15
-13
src/drivers/configuration/asn1crt.c
src/drivers/configuration/asn1crt.c
+8
-43
src/drivers/configuration/ip.c
src/drivers/configuration/ip.c
+2
-4
src/drivers/configuration/serial.c
src/drivers/configuration/serial.c
+2
-4
src/drivers/configuration/spacewire.c
src/drivers/configuration/spacewire.c
+3
-6
src/drivers/grspw_api.c
src/drivers/grspw_api.c
+1
-1
src/drivers/po_hi_driver_leon_eth.c
src/drivers/po_hi_driver_leon_eth.c
+1
-1
src/drivers/po_hi_driver_rasta_common.c
src/drivers/po_hi_driver_rasta_common.c
+1
-1
src/drivers/po_hi_driver_rasta_spacewire.c
src/drivers/po_hi_driver_rasta_spacewire.c
+1
-1
src/drivers/po_hi_driver_rtems_drvmgr_ethernet.c
src/drivers/po_hi_driver_rtems_drvmgr_ethernet.c
+1
-1
src/drivers/po_hi_driver_rtems_drvmgr_serial.c
src/drivers/po_hi_driver_rtems_drvmgr_serial.c
+1
-1
No files found.
include/drivers/configuration/1553.h
View file @
52e539f6
...
...
@@ -84,15 +84,15 @@ typedef struct {
void
__po_hi_c_mil_1553_conf_t_devname_Initialize
(
__po_hi_c_mil_1553_conf_t_devname
val
);
void
__po_hi_c_mil_1553_conf_t_Initialize
(
__po_hi_c_mil_1553_conf_t
*
pVal
);
#define ERR_MIL_1553_CONF_T 10
1
/**/
#define ERR_MIL_1553_CONF_T 10
5
/**/
#define ERR_MIL_1553_CONF_T_DEVNAME 29
/**/
#define ERR_MIL_1553_CONF_T_STANDARD
36
/**/
#define ERR_MIL_1553_CONF_T_MODE
47
/**/
#define ERR_MIL_1553_CONF_T_BUS
58
/**/
#define ERR_MIL_1553_CONF_T_TERMADDR
6
9
/**/
#define ERR_MIL_1553_CONF_T_BROADCAST 8
0
/**/
#define ERR_MIL_1553_CONF_T_RXBLOCK
87
/**/
#define ERR_MIL_1553_CONF_T_TXBLOCK 9
4
/**/
#define ERR_MIL_1553_CONF_T_STANDARD
_2 43
/**/
#define ERR_MIL_1553_CONF_T_MODE
_2 55
/**/
#define ERR_MIL_1553_CONF_T_BUS
_2 67
/**/
#define ERR_MIL_1553_CONF_T_TERMADDR
_2 7
9
/**/
#define ERR_MIL_1553_CONF_T_BROADCAST 8
4
/**/
#define ERR_MIL_1553_CONF_T_RXBLOCK
91
/**/
#define ERR_MIL_1553_CONF_T_TXBLOCK 9
8
/**/
flag
__po_hi_c_mil_1553_conf_t_IsConstraintValid
(
const
__po_hi_c_mil_1553_conf_t
*
pVal
,
int
*
pErrCode
);
...
...
include/drivers/configuration/asn1crt.h
View file @
52e539f6
...
...
@@ -3,19 +3,32 @@
#include <stddef.h>
#if (!defined(_MSC_VER) || _MSC_VER >= 1800)
# ifndef SWIG
# include <stdbool.h>
# endif
#else
typedef
unsigned
char
bool
;
#define true 1
#define false 0
#endif
#ifdef __cplusplus
extern
"C"
{
#endif
# include <cstdint>
# include <cinttypes>
/* C99 check */
#elif (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || _MSC_VER >= 1900
# include <stdbool.h>
# include <stdint.h>
# include <inttypes.h>
#else
/* No C++ nor C99 */
# ifndef _MSC_VER
typedef
unsigned
char
bool
;
# define true 1u
# define false 0u
# endif
/* _MSC_VER */
typedef
unsigned
char
uint8_t
;
typedef
int
int32_t
;
typedef
unsigned
int
uint32_t
;
typedef
long
long
int64_t
;
typedef
unsigned
long
long
uint64_t
;
#endif
/* C++/C99 */
#ifndef NULL
#define NULL 0
...
...
@@ -37,29 +50,51 @@ extern "C" {
#define FP_WORD_SIZE 8
#endif
#ifndef PRId32
#define PRId32 "d"
#endif
#ifndef PRId64
#define PRId64 "lld"
#endif
#ifndef PRIu32
#define PRIu32 "u"
#endif
#ifndef PRIu64
#define PRIu64 "llu"
#endif
#define OBJECT_IDENTIFIER_MAX_LENGTH 20
typedef
float
asn1Real32
;
typedef
double
asn1Real64
;
typedef
uint8_t
byte
;
typedef
int32_t
asn1SccSint32
;
typedef
uint32_t
asn1SccUint32
;
typedef
unsigned
char
byte
;
typedef
int
asn1SccSint32
;
typedef
unsigned
int
asn1SccUint32
;
typedef
long
long
asn1SccSint64
;
typedef
unsigned
long
long
asn1SccUint64
;
typedef
int64_t
asn1SccSint64
;
typedef
uint64_t
asn1SccUint64
;
#if WORD_SIZE==8
typedef
asn1SccUint64
asn1SccUint
;
typedef
asn1SccSint64
asn1SccSint
;
#define ASN1SCC_PRId PRId64
#define ASN1SCC_PRIu PRIu64
#else
typedef
asn1SccUint32
asn1SccUint
;
typedef
asn1SccSint32
asn1SccSint
;
#define ASN1SCC_PRId PRId32
#define ASN1SCC_PRIu PRIu32
#endif
asn1SccUint
int2uint
(
asn1SccSint
v
);
asn1SccSint
uint2int
(
asn1SccUint
v
,
int
uintSizeInBytes
);
#if FP_WORD_SIZE==8
typedef
asn1Real64
asn1Real
;
#else
...
...
@@ -80,14 +115,29 @@ typedef bool flag;
typedef
char
NullType
;
typedef
struct
{
struct
BitStream_t
;
//typedef void(*PushDataFnc)(struct BitStream_t* pThis, void* pushDataPrm);
//typedef void(*FetchDataFnc)(struct BitStream_t* pThis, void* fetchDataPrm);
typedef
struct
BitStream_t
{
byte
*
buf
;
long
count
;
long
currentByte
;
/* Next available bit for writting. Possible vallues 0..7, 0 is most significant bit of current byte*/
/* Next available bit for writting.
Possible vallues 0..7, 0 is most significant
bit of current byte*/
int
currentBit
;
//PushDataFnc pushData;
void
*
pushDataPrm
;
//FetchDataFnc fetchData;
void
*
fetchDataPrm
;
}
BitStream
;
typedef
struct
{
byte
*
buf
;
long
count
;
...
...
@@ -123,30 +173,78 @@ typedef struct {
#define ERR_INVALID_BER_FILE 201
#define ERR_BER_LENGTH_MISMATCH 202
int
GetCharIndex
(
char
ch
,
byte
allowedCharSet
[],
int
setLen
);
flag
OctetString_equal
(
int
len1
,
int
len2
,
const
byte
arr1
[],
const
byte
arr2
[]);
flag
BitString_equal
(
int
nBitsLength1
,
int
nBitsLength2
,
const
byte
arr1
[],
const
byte
arr2
[]);
void
ObjectIdentifier_Init
(
Asn1ObjectIdentifier
*
pVal
);
flag
ObjectIdentifier_equal
(
const
Asn1ObjectIdentifier
*
pVal1
,
const
Asn1ObjectIdentifier
*
pVal2
);
flag
ObjectIdentifier_isValid
(
const
Asn1ObjectIdentifier
*
pVal
);
flag
RelativeOID_isValid
(
const
Asn1ObjectIdentifier
*
pVal
);
/* Time Classes
Asn1LocalTime, // TIME-OF-DAY ::= TIME(SETTINGS "Basic=Time Time=HMS Local-or-UTC=L")
Asn1UtcTime, // TIME(SETTINGS "Basic=Time Time=HMS Local-or-UTC=Z")
Asn1LocalTimeWithTimeZone, // TIME(SETTINGS "Basic=Time Time=HMS Local-or-UTC=LD")
Asn1Date, // DATE ::= TIME(SETTINGS "Basic=Date Date=YMD Year=Basic")
Asn1Date_LocalTime, // DATE-TIME ::= TIME(SETTINGS "Basic=Date-Time Date=YMD Year=Basic Time=HMS Local-or-UTC=L")
Asn1Date_UtcTime, // TIME(SETTINGS "Basic=Date-Time Date=YMD Year=Basic Time=HMS Local-or-UTC=Z")
Asn1Date_LocalTimeWithTimeZone // TIME(SETTINGS "Basic=Date-Time Date=YMD Year=Basic Time=HMS Local-or-UTC=LD")
*/
typedef
struct
{
int
sign
;
//-1 or +1
int
hours
;
int
mins
;
}
Asn1TimeZone
;
int
GetCharIndex
(
char
ch
,
byte
allowedCharSet
[],
int
setLen
);
typedef
struct
{
int
hours
;
int
mins
;
int
secs
;
int
fraction
;
Asn1TimeZone
tz
;
}
Asn1TimeWithTimeZone
;
typedef
struct
{
int
hours
;
int
mins
;
int
secs
;
int
fraction
;
}
Asn1UtcTime
;
typedef
struct
{
int
hours
;
int
mins
;
int
secs
;
int
fraction
;
}
Asn1LocalTime
;
typedef
asn1SccUint
BerTag
;
typedef
struct
{
int
years
;
int
months
;
int
days
;
}
Asn1Date
;
typedef
struct
{
Asn1Date
date
;
Asn1LocalTime
time
;
}
Asn1DateLocalTime
;
typedef
struct
{
Asn1Date
date
;
Asn1UtcTime
time
;
}
Asn1DateUtcTime
;
typedef
struct
{
Asn1Date
date
;
Asn1TimeWithTimeZone
time
;
}
Asn1DateTimeWithTimeZone
;
typedef
enum
{
Asn1TC_LocalTimeStamp
,
Asn1TC_UtcTimeStamp
,
Asn1TC_LocalTimeTZStamp
}
Asn1TimeZoneClass
;
typedef
asn1SccUint
BerTag
;
#if WORD_SIZE==8
extern
const
asn1SccUint64
ber_aux
[];
...
...
@@ -154,9 +252,6 @@ extern const asn1SccUint64 ber_aux[];
extern
const
asn1SccUint32
ber_aux
[];
#endif
#define CHECK_BIT_STREAM(pBitStrm) assert((pBitStrm)->currentByte*8+(pBitStrm)->currentBit<=(pBitStrm)->count*8)
#ifdef _MSC_VER
...
...
include/drivers/configuration/ip.h
View file @
52e539f6
...
...
@@ -65,15 +65,15 @@ void __po_hi_c_ip_conf_t_gateway_Initialize(__po_hi_c_ip_conf_t_gateway val);
void
__po_hi_c_ip_conf_t_dns_Initialize
(
__po_hi_c_ip_conf_t_dns
val
);
void
__po_hi_c_ip_conf_t_Initialize
(
__po_hi_c_ip_conf_t
*
pVal
);
#define ERR_IP_CONF_T
79
/**/
#define ERR_IP_CONF_T
81
/**/
#define ERR_IP_CONF_T_DEVNAME 15
/**/
#define ERR_IP_CONF_T_ADDRESS 22
/**/
#define ERR_IP_CONF_T_BROADCAST 29
/**/
#define ERR_IP_CONF_T_NETMASK 36
/**/
#define ERR_IP_CONF_T_GATEWAY 43
/**/
#define ERR_IP_CONF_T_DNS 50
/**/
#define ERR_IP_CONF_T_VERSION
57
/**/
#define ERR_IP_CONF_T_PORT
68
/**/
#define ERR_IP_CONF_T_VERSION
_2 64
/**/
#define ERR_IP_CONF_T_PORT
_2 76
/**/
flag
__po_hi_c_ip_conf_t_IsConstraintValid
(
const
__po_hi_c_ip_conf_t
*
pVal
,
int
*
pErrCode
);
extern
const
__po_hi_c_ip_conf_t
localhost1
;
...
...
include/drivers/configuration/serial.h
View file @
52e539f6
...
...
@@ -73,13 +73,13 @@ void __po_hi_c_serial_conf_t_bits_Initialize(__po_hi_c_serial_conf_t_bits* pVal)
void
__po_hi_c_serial_conf_t_sending_wait_Initialize
(
__po_hi_c_serial_conf_t_sending_wait
*
pVal
);
void
__po_hi_c_serial_conf_t_Initialize
(
__po_hi_c_serial_conf_t
*
pVal
);
#define ERR_SERIAL_CONF_T 6
5
/**/
#define ERR_SERIAL_CONF_T 6
7
/**/
#define ERR_SERIAL_CONF_T_DEVNAME 15
/**/
#define ERR_SERIAL_CONF_T_SPEED
22
/**/
#define ERR_SERIAL_CONF_T_PARITY
33
/**/
#define ERR_SERIAL_CONF_T_BITS 4
4
/**/
#define ERR_SERIAL_CONF_T_SENDING_WAIT 5
1
/**/
#define ERR_SERIAL_CONF_T_USE_PARITYBIT
58
/**/
#define ERR_SERIAL_CONF_T_SPEED
_2 29
/**/
#define ERR_SERIAL_CONF_T_PARITY
_2 41
/**/
#define ERR_SERIAL_CONF_T_BITS 4
6
/**/
#define ERR_SERIAL_CONF_T_SENDING_WAIT 5
3
/**/
#define ERR_SERIAL_CONF_T_USE_PARITYBIT
60
/**/
flag
__po_hi_c_serial_conf_t_IsConstraintValid
(
const
__po_hi_c_serial_conf_t
*
pVal
,
int
*
pErrCode
);
extern
const
__po_hi_c_serial_conf_t
linux_ttyS0
;
...
...
include/drivers/configuration/spacewire.h
View file @
52e539f6
...
...
@@ -57,15 +57,15 @@ typedef struct {
void
__po_hi_c_spacewire_conf_t_devname_Initialize
(
__po_hi_c_spacewire_conf_t_devname
val
);
void
__po_hi_c_spacewire_conf_t_Initialize
(
__po_hi_c_spacewire_conf_t
*
pVal
);
#define ERR_SPACEWIRE_CONF_T 9
0
/**/
#define ERR_SPACEWIRE_CONF_T 9
3
/**/
#define ERR_SPACEWIRE_CONF_T_DEVNAME 22
/**/
#define ERR_SPACEWIRE_CONF_T_NODEADDR
29
/**/
#define ERR_SPACEWIRE_CONF_T_COREFREQ
40
/**/
#define ERR_SPACEWIRE_CONF_T_CLOCKDIV
51
/**/
#define ERR_SPACEWIRE_CONF_T_USE_ROUTER 6
2
/**/
#define ERR_SPACEWIRE_CONF_T_REMOVE_PROT_ID
69
/**/
#define ERR_SPACEWIRE_CONF_T_RXBLOCK 7
6
/**/
#define ERR_SPACEWIRE_CONF_T_TXBLOCK 8
3
/**/
#define ERR_SPACEWIRE_CONF_T_NODEADDR
_2 36
/**/
#define ERR_SPACEWIRE_CONF_T_COREFREQ
_2 48
/**/
#define ERR_SPACEWIRE_CONF_T_CLOCKDIV
_2 60
/**/
#define ERR_SPACEWIRE_CONF_T_USE_ROUTER 6
5
/**/
#define ERR_SPACEWIRE_CONF_T_REMOVE_PROT_ID
72
/**/
#define ERR_SPACEWIRE_CONF_T_RXBLOCK 7
9
/**/
#define ERR_SPACEWIRE_CONF_T_TXBLOCK 8
6
/**/
flag
__po_hi_c_spacewire_conf_t_IsConstraintValid
(
const
__po_hi_c_spacewire_conf_t
*
pVal
,
int
*
pErrCode
);
extern
const
__po_hi_c_spacewire_conf_t
leon_rasta_spw_sender
;
...
...
include/po_hi_common.h
View file @
52e539f6
...
...
@@ -5,7 +5,7 @@
*
* For more informations, please visit http://taste.tuxfamily.org/wiki
*
* Copyright (C) 2007-2009 Telecom ParisTech, 2010-20
18
ESA & ISAE.
* Copyright (C) 2007-2009 Telecom ParisTech, 2010-20
20
ESA & ISAE.
*/
#ifndef __PO_HI_COMMON_H__
...
...
share/make/Makefile.air
View file @
52e539f6
...
...
@@ -6,19 +6,16 @@
## This file has been built for a generic RTEMS integration
MANAGERS
=
sem rtmon msg timer io
LIBS
=
#-lrtemsall -lc
RTEMS_USES_NEWLIB
=
no
MANAGERS
=
all
LIBS
=
-lrtemsall
-lc
# PolyOR
B
-HI/C specific flags
POHI_CFLAGS
=
-DRTEMS_POSIX
-DLEON_RTEMS
$(GCC_GENERIC_FLAGS)
# PolyOR
b
-HI/C specific flags
POHI_CFLAGS
=
-DRTEMS_POSIX
-DLEON_RTEMS
$(GCC_GENERIC_FLAGS)
-Wl
,--wrap
=
printf
-Wl
,--wrap
=
puts
-Wl
,--wrap
=
putchar
# RTEMS/AIR specific flags
POHI_CFLAGS
+=
-DAIR_HYPERVISOR
-I
$(AIR_ROOT)
/pmk/core/include
\
-I
$(AIR_ROOT)
/pmk/arch/sparc/include
\
-I
$(AIR_ROOT)
/install/libs/imaspex/include/
-I
./
-B
./
-I
../common/
\
-B
../common/
-DRTEMS5
-B
$(AIR_LIBS)
/imaspex/
-B
$(AIR_LIBS)
/libprintf/
\
-B
$(AIR_LIBS)
/libair/
POHI_CFLAGS
+=
-DAIR_HYPERVISOR
-I
$(AIR_ROOT)
/pmk/core/include
\
-I
$(AIR_ROOT)
/pmk/arch/sparc/include
\
-I
$(AIR_ROOT)
/install/libs/imaspex/include/
LD_LIBS
=
$(AIR_LIBS)
/libprintf/libprintf.a
\
$(AIR_LIBS)
/libair/libair.a
$(AIR_LIBS)
/imaspex/imaspex.a
...
...
@@ -26,19 +23,12 @@ $(AIR_LIBS)/libair/libair.a $(AIR_LIBS)/imaspex/imaspex.a
LINK_LIBS
+=
$(AIR_LIBS)
/libprintf/libprintf.a
\
$(AIR_LIBS)
/libair/libair.a
$(AIR_LIBS)
/imaspex/imaspex.a
# The RTEMS_MAKEFILE_PATH is defined by the user for the specific CPU and BSP
RTEMS_MAKEFILE_PATH
=
$(AIR_POS)
/rtems5/rtems5-install/sparc-rtems5/leon3
include
$(RTEMS_MAKEFILE_PATH)/Makefile.inc
include
$(RTEMS_CUSTOM)
include
$(PROJECT_ROOT)/make/leaf.cfg
-include
$(RTEMS_MAKEFILE_PATH)/Makefile.inc
-include
$(RTEMS_CUSTOM)
-include
$(PROJECT_ROOT)/make/leaf.cfg
CPPFLAGS
+=
-DAIR_HYPERVISOR
./
-I
./
-B
./
-I
../common/
-B
../common/
\
-DRTEMS5
-B
$(AIR_LIBS)
/imaspex/
-B
$(AIR_LIBS)
/libprintf/
\
-B
$(AIR_LIBS)
/libair/
TARGET_LDFLAGS
+=
-Wl
,--gc-sections
-Wl
,--wrap
=
printf
-Wl
,--wrap
=
puts
\
-Wl
,--wrap
=
putchar
CPPFLAGS
+=
-DAIR_HYPERVISOR
./
-I
./
-B
./
-I
../common/
-B
../common/
-B
$(AIR_LIBS)
/libprintf/
-B
$(AIR_LIBS)
/libair/
##############################################################################
# RTEMS_API is defined as part of RTEMS BSP Makefile. It reports the
...
...
@@ -71,8 +61,8 @@ ifeq ($(RTEMS_API),4.12)
endif
ifeq
($(RTEMS_API),5)
POHI_CFLAGS
+=
-DRTEMS
5
TARGET_LDFLAGS
+=
-lm
POHI_CFLAGS
+=
-DRTEMS
412
TARGET_LDFLAGS
+=
-L
$(RUNTIME_PATH)
/libs/leon-rtems4.12/
-lm
endif
##############################################################################
...
...
@@ -101,8 +91,17 @@ ifeq ($(RTEMS_BSP),leon2)
POHI_CFLAGS
+=
-DGRLEON2
endif
ifdef
USE_GPROF
TARGET_LDFLAGS
+=
-Wl
,--wrap,Clock_isr
-pg
EXTERNAL_OBJECTS
+=
po_hi_gprof_rtems_leon.o
TARGET_INCLUDE
+=
-I
$(RTEMS_MAKEFILE_PATH)
/lib/include/
target-objects
:
$(CC)
$(INCLUDE)
$(TARGET_INCLUDE)
-D__PO_HI_USE_GPROF
-Wall
-c
-o
po_hi_gprof_rtems_leon.o
$(RUNTIME_PATH)/src/po_hi_gprof_rtems_leon.c
else
target-objects
:
endif
LINK_LIBS
+=
-lm
target-clean
:
target-objects
:
src/drivers/config.c
View file @
52e539f6
/*
* This is a part of PolyORB-HI-C distribution, a minimal
* middleware written for generated code from AADL models.
* You should use it with the Ocarina toolsuite.
*
* For more informations, please visit http://taste.tuxfamily.org/wiki
*
* Copyright (C) 2020 ESA & ISAE.
*/
/* Note, this file is from RCC1.3rc4 sample directory.
*
* Any modification there should be carefully weighted.
...
...
src/drivers/config_leon3_drvmgr.c
View file @
52e539f6
/*
* This is a part of PolyORB-HI-C distribution, a minimal
* middleware written for generated code from AADL models.
* You should use it with the Ocarina toolsuite.
*
* For more informations, please visit http://taste.tuxfamily.org/wiki
*
* Copyright (C) 2020 ESA & ISAE.
*/
/* Note, this file is from RCC1.3rc4 sample directory.
*
* Any modification there should be carefully weighted.
...
...
src/drivers/config_leon4_n2x.c
View file @
52e539f6
/*
* This is a part of PolyORB-HI-C distribution, a minimal
* middleware written for generated code from AADL models.
* You should use it with the Ocarina toolsuite.
*
* For more informations, please visit http://taste.tuxfamily.org/wiki
*
* Copyright (C) 2020 ESA & ISAE.
*/
#include <bsp/gr_leon4_n2x.h>
// Things are always moving around in RTEMS - adapt.
...
...
src/drivers/configuration/1553.c
View file @
52e539f6
...
...
@@ -137,17 +137,13 @@ flag __po_hi_c_mil_1553_conf_t_IsConstraintValid(const __po_hi_c_mil_1553_conf_t
ret
=
((
1
<=
strlen
(
pVal
->
devname
))
&&
(
strlen
(
pVal
->
devname
)
<=
20
));
*
pErrCode
=
ret
?
0
:
ERR_MIL_1553_CONF_T_DEVNAME
;
if
(
ret
)
{
ret
=
(((
pVal
->
standard
==
__po_hi_c_mil1553a
))
||
((
pVal
->
standard
==
__po_hi_c_mil1553b
)));
*
pErrCode
=
ret
?
0
:
ERR_MIL_1553_CONF_T_STANDARD
;
ret
=
__po_hi_c_Standard_T_IsConstraintValid
((
&
(
pVal
->
standard
)),
pErrCode
);
if
(
ret
)
{
ret
=
(((((
pVal
->
mode
==
__po_hi_c_controller
))
||
((
pVal
->
mode
==
__po_hi_c_terminal
))))
||
((
pVal
->
mode
==
__po_hi_c_monitor
)));
*
pErrCode
=
ret
?
0
:
ERR_MIL_1553_CONF_T_MODE
;
ret
=
__po_hi_c_Mode_T_IsConstraintValid
((
&
(
pVal
->
mode
)),
pErrCode
);
if
(
ret
)
{
ret
=
(((((((
pVal
->
bus
==
__po_hi_c_none
))
||
((
pVal
->
bus
==
__po_hi_c_bus_a
))))
||
((
pVal
->
bus
==
__po_hi_c_bus_b
))))
||
((
pVal
->
bus
==
__po_hi_c_both
)));
*
pErrCode
=
ret
?
0
:
ERR_MIL_1553_CONF_T_BUS
;
ret
=
__po_hi_c_Bus_T_IsConstraintValid
((
&
(
pVal
->
bus
)),
pErrCode
);
if
(
ret
)
{
ret
=
(
pVal
->
termaddr
<=
31UL
);
*
pErrCode
=
ret
?
0
:
ERR_MIL_1553_CONF_T_TERMADDR
;
ret
=
__po_hi_c_Node_Addr_T_IsConstraintValid
((
&
(
pVal
->
termaddr
)),
pErrCode
);
}
}
}
...
...
src/drivers/configuration/Makefile.am
View file @
52e539f6
AUTOMAKE_OPTIONS
=
no-dependencies
C_FILES
=
$(srcdir)
/1553.c
\
$(srcdir)
/ip.c
\
$(srcdir)
/serial.c
\
$(srcdir)
/spacewire.c
ASN_FILES
=
$(srcdir)
/1553.asn
\
$(srcdir)
/ip.asn
\
$(srcdir)
/serial.asn
\
$(srcdir)
/spacewire.asn
C_FILES
=
$(srcdir)
/1553.c
$(srcdir)
/ip.c
$(srcdir)
/serial.c
\
$(srcdir)
/spacewire.c
$(srcdir)
/bluetooth.c
ASN_FILES
=
$(srcdir)
/1553.asn
$(srcdir)
/ip.asn
$(srcdir)
/serial.asn
\
$(srcdir)
/spacewire.asn
$(srcdir)
/bluetooth.asn
csrc
=
${
shell
$(CYGPATH_U)
'
$(OCARINA_RUNTIME)
/polyorb-hi-c/src/drivers/configuration'
}
t
:
echo
$(
shell
shell which asn1.exe
)
echo
`
shell which asn1.exe
`
$(srcdir)/1553.c
:
mono
$(
shell
which asn1.exe
)
-c
-typePrefix
__po_hi_c_ 1553.asn
sed
-e
's/Mil\_1553\_Conf\_T/mil\_1553\_conf\_t/g'
1553.h
>
1553new.h
...
...
@@ -61,6 +52,17 @@ $(srcdir)/serial.c:
mv
serial.h ../../../include/drivers/configuration/
mv
asn1crt.h ../../../include/drivers/configuration/
$(srcdir)/bluetooth.c
:
mono
$$
(
which asn1.exe
)
-c
-typePrefix
__po_hi_c_ bluetooth.asn
sed
-e
's/Bluetooth\_Conf\_T/bluetooth\_conf\_t/g'
bluetooth.h
>
bluetoothnew.h
mv
bluetoothnew.h bluetooth.h
echo
"#if (defined (__PO_HI_NEED_DRIVER_BLUETOOTH))
\n
"
>
bluetoothnew.c
sed
-e
's/Bluetooth\_Conf\_T/bluetooth\_conf\_t/g'
bluetooth.c
>>
bluetoothnew.c
echo
"
\n
#endif"
>>
bluetoothnew.c
mv
bluetoothnew.c bluetooth.c
mv
bluetooth.h ../../../include/drivers/configuration/
mv
asn1crt.h ../../../include/drivers/configuration/
regenerate
:
rm
-f
$(C_FILES)
for
v
in
$(C_FILES)
;
do
$(MAKE)
$$
v
;
done
...
...
src/drivers/configuration/asn1crt.c
View file @
52e539f6
...
...
@@ -5,42 +5,6 @@
#include "asn1crt.h"
int
GetCharIndex
(
char
ch
,
byte
Set
[],
int
setLen
)
{
int
i
=
0
;
for
(
i
=
0
;
i
<
setLen
;
i
++
)
if
(
ch
==
Set
[
i
])
return
i
;
return
0
;
}
void
ByteStream_Init
(
ByteStream
*
pStrm
,
byte
*
buf
,
long
count
)
{
pStrm
->
count
=
count
;
pStrm
->
buf
=
buf
;
memset
(
pStrm
->
buf
,
0x0
,(
size_t
)
count
);
pStrm
->
currentByte
=
0
;
pStrm
->
EncodeWhiteSpace
=
FALSE
;
}
void
ByteStream_AttachBuffer
(
ByteStream
*
pStrm
,
unsigned
char
*
buf
,
long
count
)
{
pStrm
->
count
=
count
;
pStrm
->
buf
=
buf
;
pStrm
->
currentByte
=
0
;
}
asn1SccSint
ByteStream_GetLength
(
ByteStream
*
pStrm
)
{
return
pStrm
->
currentByte
;
}
#if WORD_SIZE==8
const
asn1SccUint64
ber_aux
[]
=
{
0xFF
,
...
...
@@ -59,8 +23,6 @@ const asn1SccUint32 ber_aux[] = {
0xFF000000
};
#endif
asn1SccUint
int2uint
(
asn1SccSint
v
)
{
asn1SccUint
ret
=
0
;
if
(
v
<
0
)
{
...
...
@@ -84,7 +46,14 @@ asn1SccSint uint2int(asn1SccUint v, int uintSizeInBytes) {
return
-
(
asn1SccSint
)(
~
v
)
-
1
;
}
int
GetCharIndex
(
char
ch
,
byte
Set
[],
int
setLen
)
{
int
i
=
0
;
for
(
i
=
0
;
i
<
setLen
;
i
++
)
if
(
ch
==
Set
[
i
])
return
i
;
return
0
;
}
/*
...
...
@@ -130,7 +99,3 @@ flag ObjectIdentifier_equal(const Asn1ObjectIdentifier *pVal1, const Asn1ObjectI
return
FALSE
;
}
}
src/drivers/configuration/ip.c
View file @
52e539f6
...
...
@@ -188,12 +188,10 @@ flag __po_hi_c_ip_conf_t_IsConstraintValid(const __po_hi_c_ip_conf_t* pVal, int*
}
if
(
ret
)
{
if
(
pVal
->
exist
.
version
)
{
ret
=
(((
pVal
->
version
==
__po_hi_c_ipv4
))
||
((
pVal
->
version
==
__po_hi_c_ipv6
)));
*
pErrCode
=
ret
?
0
:
ERR_IP_CONF_T_VERSION
;
ret
=
__po_hi_c_Version_T_IsConstraintValid
((
&
(
pVal
->
version
)),
pErrCode
);
}
if
(
ret
)
{
ret
=
(
pVal
->
port
<=
16535UL
);
*
pErrCode
=
ret
?
0
:
ERR_IP_CONF_T_PORT
;
ret
=
__po_hi_c_Port_T_IsConstraintValid
((
&
(
pVal
->
port
)),
pErrCode
);
}
}
}
...
...
src/drivers/configuration/serial.c
View file @
52e539f6
...
...
@@ -175,13 +175,11 @@ flag __po_hi_c_serial_conf_t_IsConstraintValid(const __po_hi_c_serial_conf_t* pV
*
pErrCode
=
ret
?
0
:
ERR_SERIAL_CONF_T_DEVNAME
;
if
(
ret
)
{
if
(
pVal
->
exist
.
speed
)
{
ret
=
(((((((((((
pVal
->
speed
==
__po_hi_c_b9600
))
||
((
pVal
->
speed
==
__po_hi_c_b19200
))))
||
((
pVal
->
speed
==
__po_hi_c_b38400
))))
||
((
pVal
->
speed
==
__po_hi_c_b57600
))))
||
((
pVal
->
speed
==
__po_hi_c_b115200
))))
||
((
pVal
->
speed
==
__po_hi_c_b230400
)));
*
pErrCode
=
ret
?
0
:
ERR_SERIAL_CONF_T_SPEED
;
ret
=
__po_hi_c_Baudrate_T_IsConstraintValid
((
&
(
pVal
->
speed
)),
pErrCode
);
}
if
(
ret
)
{
if
(
pVal
->
exist
.
parity
)
{
ret
=
(((
pVal
->
parity
==
__po_hi_c_even
))
||
((
pVal
->
parity
==
__po_hi_c_odd
)));
*
pErrCode
=
ret
?
0
:
ERR_SERIAL_CONF_T_PARITY
;
ret
=
__po_hi_c_Parity_T_IsConstraintValid
((
&
(
pVal
->
parity
)),
pErrCode
);
}
if
(
ret
)
{
if
(
pVal
->
exist
.
bits
)
{
...
...
src/drivers/configuration/spacewire.c
View file @
52e539f6
...
...
@@ -146,17 +146,14 @@ flag __po_hi_c_spacewire_conf_t_IsConstraintValid(const __po_hi_c_spacewire_conf
ret
=
((
1
<=
strlen
(
pVal
->
devname
))
&&
(
strlen
(
pVal
->
devname
)
<=
20
));
*
pErrCode
=
ret
?
0
:
ERR_SPACEWIRE_CONF_T_DEVNAME
;
if
(
ret
)
{
ret
=
(
pVal
->
nodeaddr
<=
255UL
);
*
pErrCode
=
ret
?
0
:
ERR_SPACEWIRE_CONF_T_NODEADDR
;
ret
=
__po_hi_c_Node_Addr_T_IsConstraintValid
((
&
(
pVal
->
nodeaddr
)),
pErrCode
);
if
(
ret
)
{
if
(
pVal
->
exist
.
corefreq
)
{
ret
=
(
pVal
->
corefreq
<=
4294967295UL
);
*
pErrCode
=
ret
?
0
:
ERR_SPACEWIRE_CONF_T_COREFREQ
;
ret
=
__po_hi_c_Core_Frequence_T_IsConstraintValid
((
&
(
pVal
->
corefreq
)),
pErrCode
);
}