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
47796aa2
Commit
47796aa2
authored
Jul 03, 2017
by
yoogx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Change base type to index messages in queue to support
larger queue size For issue openaadl/ocarina#97
parent
6d24ad6a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
68 additions
and
66 deletions
+68
-66
examples/aadlv2/producer-consumer/Makefile.am
examples/aadlv2/producer-consumer/Makefile.am
+1
-1
include/po_hi_gqueue.h
include/po_hi_gqueue.h
+14
-14
include/po_hi_types.h
include/po_hi_types.h
+3
-1
src/po_hi_gqueue.c
src/po_hi_gqueue.c
+47
-47
src/po_hi_storage.c
src/po_hi_storage.c
+3
-3
No files found.
examples/aadlv2/producer-consumer/Makefile.am
View file @
47796aa2
...
...
@@ -9,4 +9,4 @@ include $(srcdir)/../../Makefile.common
EXTRA_DIST
=
$(AADL_FILES)
$(SCENARIO_FILES)
$(C_FILES)
CLEANDIRS
=
pc_simple_impl
CLEANDIRS
=
pc_simple_impl
pc_simple_local pc_simple_rtems
include/po_hi_gqueue.h
View file @
47796aa2
...
...
@@ -5,7 +5,7 @@
*
* For more informations, please visit http://taste.tuxfamily.org/wiki
*
* Copyright (C) 2007-2009 Telecom ParisTech, 2010-201
4
ESA & ISAE.
* Copyright (C) 2007-2009 Telecom ParisTech, 2010-201
7
ESA & ISAE.
*/
#ifndef __PO_HI_GQUEUE_H__
...
...
@@ -24,19 +24,19 @@
#include <po_hi_types.h>
void
__po_hi_gqueue_init
(
__po_hi_task_id
id
,
__po_hi_
uint8_t
nb_ports
,
__po_hi_
port_id_t
nb_ports
,
__po_hi_port_t
queue
[],
__po_hi_
int8_t
sizes
[],
__po_hi_
uint8_t
first
[],
__po_hi_
uint8_t
offsets
[],
__po_hi_
uint8_t
woffsets
[],
__po_hi_
uint8_t
n_dest
[],
__po_hi_
port_id_t
sizes
[],
__po_hi_
port_id_t
first
[],
__po_hi_
port_id_t
offsets
[],
__po_hi_
port_id_t
woffsets
[],
__po_hi_
port_id_t
n_dest
[],
__po_hi_port_t
*
destinations
[],
__po_hi_
uint8_t
used_size
[],
__po_hi_
port_id_t
used_size
[],
__po_hi_local_port_t
history
[],
__po_hi_request_t
recent
[],
__po_hi_
uint8_t
empties
[],
__po_hi_uint
16
_t
total_fifo_size
);
__po_hi_
port_id_t
empties
[],
__po_hi_uint
32
_t
total_fifo_size
);
/*
* Initialize a global queue. In a distributed system, each task has
* its own global queue. This function is invoked by each thead to
...
...
@@ -116,7 +116,7 @@ void __po_hi_gqueue_wait_for_incoming_event(__po_hi_task_id id,
* the event.
*/
__po_hi_
uint8
_t
__po_hi_gqueue_store_in
(
__po_hi_task_id
id
,
__po_hi_
port_id
_t
__po_hi_gqueue_store_in
(
__po_hi_task_id
id
,
__po_hi_local_port_t
port
,
__po_hi_request_t
*
request
);
/*
...
...
@@ -144,7 +144,7 @@ uint8_t __po_hi_gqueue_get_destinations_number (const __po_hi_task_id task_id,
* identifier for the local thread.
*/
__po_hi_
int8
_t
__po_hi_gqueue_get_port_size
(
const
__po_hi_task_id
id
,
__po_hi_
port_id
_t
__po_hi_gqueue_get_port_size
(
const
__po_hi_task_id
id
,
const
__po_hi_local_port_t
port
);
/*
...
...
@@ -153,9 +153,9 @@ __po_hi_int8_t __po_hi_gqueue_get_port_size(const __po_hi_task_id id,
* identifier for the local thread.
*/
__po_hi_
int8
_t
__po_hi_gqueue_used_size
(
__po_hi_task_id
id
,
__po_hi_local_port_t
port
);
__po_hi_
port_id
_t
__po_hi_gqueue_used_size
(
__po_hi_task_id
id
,
__po_hi_local_port_t
port
);
__po_hi_
int8
_t
po_hi_gqueues_queue_is_empty
(
__po_hi_task_id
id
);
__po_hi_
port_id
_t
po_hi_gqueues_queue_is_empty
(
__po_hi_task_id
id
);
__po_hi_request_t
*
__po_hi_gqueues_get_request
(
__po_hi_task_id
id
,
__po_hi_local_port_t
port
);
...
...
include/po_hi_types.h
View file @
47796aa2
...
...
@@ -5,7 +5,7 @@
*
* For more informations, please visit http://taste.tuxfamily.org/wiki
*
* Copyright (C) 2007-2009 Telecom ParisTech, 2010-201
4
ESA & ISAE.
* Copyright (C) 2007-2009 Telecom ParisTech, 2010-201
7
ESA & ISAE.
*/
#ifndef __PO_HI_TYPES_H_
...
...
@@ -85,6 +85,8 @@ typedef double __po_hi_float64_t;
typedef
unsigned
char
__po_hi_byte_t
;
typedef
__po_hi_int32_t
__po_hi_port_id_t
;
typedef
enum
{
__PO_HI_IN_DATA_INTER_PROCESS
=
0
,
...
...
src/po_hi_gqueue.c
View file @
47796aa2
...
...
@@ -47,59 +47,59 @@
/* give a default value to the out port */
__po_hi_port_t
*
__po_hi_gqueues
[
__PO_HI_NB_TASKS
];
__po_hi_
int8_t
__po_hi_gqueues_nb_ports
[
__PO_HI_NB_TASKS
];
__po_hi_
int8_t
*
__po_hi_gqueues_sizes
[
__PO_HI_NB_TASKS
];
__po_hi_
uint8_t
*
__po_hi_gqueues_used_size
[
__PO_HI_NB_TASKS
];
__po_hi_
uint8_t
*
__po_hi_gqueues_offsets
[
__PO_HI_NB_TASKS
];
__po_hi_
uint8_t
*
__po_hi_gqueues_woffsets
[
__PO_HI_NB_TASKS
];
__po_hi_
uint8_t
*
__po_hi_gqueues_n_destinations
[
__PO_HI_NB_TASKS
];
__po_hi_
port_id_t
__po_hi_gqueues_nb_ports
[
__PO_HI_NB_TASKS
];
__po_hi_
port_id_t
*
__po_hi_gqueues_sizes
[
__PO_HI_NB_TASKS
];
__po_hi_
port_id_t
*
__po_hi_gqueues_used_size
[
__PO_HI_NB_TASKS
];
__po_hi_
port_id_t
*
__po_hi_gqueues_offsets
[
__PO_HI_NB_TASKS
];
__po_hi_
port_id_t
*
__po_hi_gqueues_woffsets
[
__PO_HI_NB_TASKS
];
__po_hi_
port_id_t
*
__po_hi_gqueues_n_destinations
[
__PO_HI_NB_TASKS
];
__po_hi_port_t
**
__po_hi_gqueues_destinations
[
__PO_HI_NB_TASKS
];
__po_hi_uint
16
_t
__po_hi_gqueues_total_fifo_size
[
__PO_HI_NB_TASKS
];
__po_hi_uint
32
_t
__po_hi_gqueues_total_fifo_size
[
__PO_HI_NB_TASKS
];
__po_hi_request_t
*
__po_hi_gqueues_most_recent_values
[
__PO_HI_NB_TASKS
];
__po_hi_
uint8_t
*
__po_hi_gqueues_first
[
__PO_HI_NB_TASKS
];
__po_hi_
port_id_t
*
__po_hi_gqueues_first
[
__PO_HI_NB_TASKS
];
__po_hi_
uint8_t
__po_hi_gqueues_global_size
[
__PO_HI_NB_TASKS
];
__po_hi_local_port_t
*
__po_hi_gqueues_global_history
[
__PO_HI_NB_TASKS
];
__po_hi_uint
16_t
__po_hi_gqueues_global_history_offset
[
__PO_HI_NB_TASKS
];
__po_hi_uint
16_t
__po_hi_gqueues_global_history_woffset
[
__PO_HI_NB_TASKS
];
__po_hi_
port_id_t
__po_hi_gqueues_global_size
[
__PO_HI_NB_TASKS
];
__po_hi_local_port_t
*
__po_hi_gqueues_global_history
[
__PO_HI_NB_TASKS
];
__po_hi_uint
32_t
__po_hi_gqueues_global_history_offset
[
__PO_HI_NB_TASKS
];
__po_hi_uint
32_t
__po_hi_gqueues_global_history_woffset
[
__PO_HI_NB_TASKS
];
__po_hi_
uint8
_t
*
__po_hi_gqueues_port_is_empty
[
__PO_HI_NB_TASKS
];
__po_hi_
uint8
_t
__po_hi_gqueues_queue_is_empty
[
__PO_HI_NB_TASKS
];
__po_hi_
uint8
_t
__po_hi_gqueues_n_empty
[
__PO_HI_NB_TASKS
];
__po_hi_
port_id
_t
*
__po_hi_gqueues_port_is_empty
[
__PO_HI_NB_TASKS
];
__po_hi_
port_id
_t
__po_hi_gqueues_queue_is_empty
[
__PO_HI_NB_TASKS
];
__po_hi_
port_id
_t
__po_hi_gqueues_n_empty
[
__PO_HI_NB_TASKS
];
#if defined (RTEMS_POSIX) || defined (POSIX) || defined (XENO_POSIX)
pthread_mutex_t
__po_hi_gqueues_mutexes
[
__PO_HI_NB_TASKS
];
pthread_cond_t
__po_hi_gqueues_conds
[
__PO_HI_NB_TASKS
];
pthread_mutexattr_t
__po_hi_gqueues_mutexes_attr
[
__PO_HI_NB_TASKS
];
pthread_condattr_t
__po_hi_gqueues_conds_attr
[
__PO_HI_NB_TASKS
];
pthread_mutex_t
__po_hi_gqueues_mutexes
[
__PO_HI_NB_TASKS
];
pthread_cond_t
__po_hi_gqueues_conds
[
__PO_HI_NB_TASKS
];
pthread_mutexattr_t
__po_hi_gqueues_mutexes_attr
[
__PO_HI_NB_TASKS
];
pthread_condattr_t
__po_hi_gqueues_conds_attr
[
__PO_HI_NB_TASKS
];
#elif defined (RTEMS_PURE)
rtems_id
__po_hi_gqueues_semaphores
[
__PO_HI_NB_TASKS
];
rtems_id
__po_hi_gqueues_barriers
[
__PO_HI_NB_TASKS
];
rtems_id
__po_hi_gqueues_semaphores
[
__PO_HI_NB_TASKS
];
rtems_id
__po_hi_gqueues_barriers
[
__PO_HI_NB_TASKS
];
#elif defined (XENO_NATIVE)
RT_MUTEX
__po_hi_gqueues_mutexes
[
__PO_HI_NB_TASKS
];
RT_COND
__po_hi_gqueues_conds
[
__PO_HI_NB_TASKS
];
RT_MUTEX
__po_hi_gqueues_mutexes
[
__PO_HI_NB_TASKS
];
RT_COND
__po_hi_gqueues_conds
[
__PO_HI_NB_TASKS
];
#elif defined (_WIN32)
HANDLE
__po_hi_gqueues_events
[
__PO_HI_NB_TASKS
];
CRITICAL_SECTION
__po_hi_gqueues_cs
[
__PO_HI_NB_TASKS
];
HANDLE
__po_hi_gqueues_events
[
__PO_HI_NB_TASKS
];
CRITICAL_SECTION
__po_hi_gqueues_cs
[
__PO_HI_NB_TASKS
];
#endif
void
__po_hi_gqueue_init
(
__po_hi_task_id
id
,
__po_hi_
uint8_t
nb_ports
,
__po_hi_
port_id_t
nb_ports
,
__po_hi_port_t
queue
[],
__po_hi_
int8_t
sizes
[],
__po_hi_
uint8_t
first
[],
__po_hi_
uint8_t
offsets
[],
__po_hi_
uint8_t
woffsets
[],
__po_hi_
uint8_t
n_dest
[],
__po_hi_
port_id_t
sizes
[],
__po_hi_
port_id_t
first
[],
__po_hi_
port_id_t
offsets
[],
__po_hi_
port_id_t
woffsets
[],
__po_hi_
port_id_t
n_dest
[],
__po_hi_port_t
*
destinations
[],
__po_hi_
uint8_t
used_size
[],
__po_hi_
port_id_t
used_size
[],
__po_hi_local_port_t
history
[],
__po_hi_request_t
recent
[],
__po_hi_
uint8_t
empties
[],
__po_hi_uint
16
_t
total_fifo_size
)
__po_hi_
port_id_t
empties
[],
__po_hi_uint
32
_t
total_fifo_size
)
{
__po_hi_
uint8
_t
tmp
;
__po_hi_uint
16_t
off
;
__po_hi_
port_id
_t
tmp
;
__po_hi_uint
32_t
off
;
/* XXX May overflow for large value .. */
int
err
;
#if defined (RTEMS_PURE)
...
...
@@ -153,7 +153,7 @@ void __po_hi_gqueue_init (__po_hi_task_id id,
err
=
pthread_cond_init
(
&
__po_hi_gqueues_conds
[
id
],
&
__po_hi_gqueues_conds_attr
[
id
]);
__DEBUGMSG
(
"COND_INIT %d %d
\n
"
,
id
,
err
);
assert
(
err
==
0
);
#endif
#ifdef RTEMS_PURE
...
...
@@ -201,7 +201,7 @@ void __po_hi_gqueue_init (__po_hi_task_id id,
#endif
off
=
0
;
for
(
tmp
=
0
;
tmp
<
nb_ports
;
tmp
++
)
{
__po_hi_gqueues_used_size
[
id
][
tmp
]
=
0
;
...
...
@@ -215,7 +215,7 @@ void __po_hi_gqueue_init (__po_hi_task_id id,
__po_hi_gqueues_woffsets
[
id
][
tmp
]
=
0
;
__po_hi_gqueues_port_is_empty
[
id
][
tmp
]
=
1
;
}
/* Set invalid all recent values */
__po_hi_request_t
*
request
=
(
__po_hi_request_t
*
)
&
__po_hi_gqueues_most_recent_values
[
id
][
tmp
];
request
->
port
=
__PO_HI_GQUEUE_INVALID_PORT
;
...
...
@@ -246,13 +246,13 @@ void __po_hi_gqueue_store_out (__po_hi_task_id id,
__PO_HI_DEBUG_DEBUG
(
"__po_hi_gqueue_store_out() from task %d on port %d
\n
"
,
id
,
port
);
}
__po_hi_
uint8
_t
__po_hi_gqueue_store_in
(
__po_hi_task_id
id
,
__po_hi_
port_id
_t
__po_hi_gqueue_store_in
(
__po_hi_task_id
id
,
__po_hi_local_port_t
port
,
__po_hi_request_t
*
request
)
{
__po_hi_request_t
*
ptr
;
__po_hi_request_t
*
tmp
;
#ifdef RTEMS_PURE
rtems_status_code
ret
;
#endif
...
...
@@ -310,7 +310,7 @@ __po_hi_uint8_t __po_hi_gqueue_store_in (__po_hi_task_id id,
__DEBUGMSG
(
"[GQUEUE] Semaphore released (id=%d)
\n
"
,
id
);
return
__PO_HI_ERROR_QUEUE_FULL
;
}
__po_hi_uint32_t
size
;
tmp
=
(
__po_hi_request_t
*
)
&
__po_hi_gqueues
[
id
][
port
];
size
=
__po_hi_gqueues_woffsets
[
id
][
port
]
+
__po_hi_gqueues_first
[
id
][
port
];
...
...
@@ -338,7 +338,7 @@ __po_hi_uint8_t __po_hi_gqueue_store_in (__po_hi_task_id id,
#if defined (POSIX) || defined (RTEMS_POSIX) || defined (XENO_POSIX)
pthread_mutex_unlock
(
&
__po_hi_gqueues_mutexes
[
id
]);
int
err
=
pthread_cond_signal
(
&
__po_hi_gqueues_conds
[
id
]);
assert
(
err
==
0
);
assert
(
err
==
0
);
__DEBUGMSG
(
"*** Releasing (%d) %d
\n
"
,
id
,
err
);
#elif defined (XENO_NATIVE)
rt_mutex_release
(
&
__po_hi_gqueues_mutexes
[
id
]);
...
...
@@ -645,24 +645,24 @@ __po_hi_port_t __po_hi_gqueue_get_destination (const __po_hi_task_id task_id, co
return
(
__po_hi_gqueues_destinations
[
task_id
][
local_port
][
destination_number
]);
}
__po_hi_
int8
_t
__po_hi_gqueue_get_port_size
(
__po_hi_task_id
id
,
__po_hi_local_port_t
port
)
__po_hi_
port_id
_t
__po_hi_gqueue_get_port_size
(
__po_hi_task_id
id
,
__po_hi_local_port_t
port
)
{
return
__po_hi_gqueues_sizes
[
id
][
port
];
}
__po_hi_
int8
_t
__po_hi_gqueue_used_size
(
__po_hi_task_id
id
,
__po_hi_local_port_t
port
)
__po_hi_
port_id
_t
__po_hi_gqueue_used_size
(
__po_hi_task_id
id
,
__po_hi_local_port_t
port
)
{
return
__po_hi_gqueues_used_size
[
id
][
port
];
}
__po_hi_
int8
_t
po_hi_gqueues_queue_is_empty
(
__po_hi_task_id
id
)
__po_hi_
port_id
_t
po_hi_gqueues_queue_is_empty
(
__po_hi_task_id
id
)
{
return
__po_hi_gqueues_queue_is_empty
[
id
];
}
__po_hi_request_t
*
__po_hi_request_t
*
__po_hi_gqueues_get_request
(
__po_hi_task_id
id
,
__po_hi_local_port_t
port
)
{
...
...
src/po_hi_storage.c
View file @
47796aa2
...
...
@@ -311,7 +311,7 @@ int __po_hi_storage_file_append (const __po_hi_storage_file_t* file, char* buf,
ret
=
write
(
file
->
fd
,
buf
,
bufsize
);
if
(
ret
!=
bufsize
)
{
{
__DEBUGMSG
(
"[STORAGE] __po_hi_storage_file_append: cannot write %d bytes
\n
"
,
bufsize
);
return
__PO_HI_ERROR_UNKNOWN
;
}
...
...
@@ -332,7 +332,7 @@ int __po_hi_storage_file_replace (const __po_hi_storage_file_t* oldfile, const _
#pragma GCC diagnostic ignored "-Wunused-parameter"
int
__po_hi_storage_file_lock
(
const
__po_hi_storage_file_t
*
file
)
{
return
__PO_HI_NOTIMPLEMENTED
;
}
#pragma GCC diagnostic pop
...
...
@@ -525,7 +525,7 @@ int __po_hi_storage_directory_list (__po_hi_storage_dir_t* dir)
__DEBUGMSG
(
"[STORAGE] __po_hi_storage_directory_list: fail to call closedir on %s
\n
"
,
dir
->
dirname
);
return
__PO_HI_ERROR_UNKNOWN
;
}
return
__PO_HI_SUCCESS
;
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment