Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
M
Mock Turtle
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Mock Turtle
Commits
2d145ffe
Commit
2d145ffe
authored
Apr 27, 2018
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sw:rt: group together low-level API functions
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
b4eabe73
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
32 deletions
+37
-32
mockturtle-rt-mqueue.h
software/rt/lib/mockturtle-rt-mqueue.h
+37
-32
No files found.
software/rt/lib/mockturtle-rt-mqueue.h
View file @
2d145ffe
...
...
@@ -56,97 +56,102 @@ static inline void mq_writel(enum trtl_mq_type type, uint32_t val, uint32_t reg)
/**
*
@copydoc TRTL_MQ_CMD_CLAIM
*
It gets the output slot data field pointer
* @param[in] type MQ type to use
* @param[in] slot slot number
* @return pointer to the input buffer
*/
static
inline
void
mq_claim
(
enum
trtl_mq_type
type
,
int
slot
)
static
inline
void
*
mq_map_out_buffer
(
enum
trtl_mq_type
type
,
int
slot
)
{
mq_writel
(
type
,
TRTL_MQ_CMD_CLAIM
,
TRTL_MQ_SLOT_OUT
(
slot
)
+
TRTL_MQ_SLOT_COMMAND
);
return
(
void
*
)
(
trtl_mq_base_address
(
type
)
+
TRTL_MQ_SLOT_OUT
(
slot
)
+
TRTL_MQ_SLOT_DATA_START
);
}
/**
*
@copydoc TRTL_MQ_CMD_PURGE
*
It gets the input slot data field pointer
* @param[in] type MQ type to use
* @param[in] slot slot number
* @return pointer to the input buffer
*/
static
inline
void
mq_purge
(
enum
trtl_mq_type
type
,
int
slot
)
static
inline
void
*
mq_map_in_buffer
(
enum
trtl_mq_type
type
,
int
slot
)
{
mq_writel
(
type
,
TRTL_MQ_CMD_PURGE
,
TRTL_MQ_SLOT_OUT
(
slot
)
+
TRTL_MQ_SLOT_COMMAND
);
mq_writel
(
type
,
TRTL_MQ_CMD_PURGE
,
TRTL_MQ_SLOT_IN
(
slot
)
+
TRTL_MQ_SLOT_COMMAND
);
return
(
void
*
)
(
trtl_mq_base_address
(
type
)
+
TRTL_MQ_SLOT_IN
(
slot
)
+
TRTL_MQ_SLOT_DATA_START
);
}
/**
*
@copydoc TRTL_MQ_CMD_READY
*
It gets the output slot header field pointer
* @param[in] type MQ type to use
* @param[in] slot slot number
* @return pointer to the output header
*/
static
inline
void
mq_send
(
enum
trtl_mq_type
type
,
int
slot
)
static
inline
void
*
mq_map_out_header
(
enum
trtl_mq_type
type
,
int
slot
)
{
mq_writel
(
type
,
TRTL_MQ_CMD_READY
,
TRTL_MQ_SLOT_OUT
(
slot
)
+
TRTL_MQ_SLOT_COMMAND
);
return
(
void
*
)
(
trtl_mq_base_address
(
type
)
+
TRTL_MQ_SLOT_OUT
(
slot
)
+
TRTL_MQ_SLOT_HEADER_START
);
}
/**
*
@copydoc TRTL_MQ_CMD_DISCARD
*
It gets the input slot header field pointer
* @param[in] type MQ type to use
* @param[in] slot slot number
* @return pointer to the input header
*/
static
inline
void
mq_discard
(
enum
trtl_mq_type
type
,
int
slot
)
static
inline
void
*
mq_map_in_header
(
enum
trtl_mq_type
type
,
int
slot
)
{
mq_writel
(
type
,
TRTL_MQ_CMD_DISCARD
,
TRTL_MQ_SLOT_IN
(
slot
));
return
(
void
*
)
(
trtl_mq_base_address
(
type
)
+
TRTL_MQ_SLOT_IN
(
slot
)
+
TRTL_MQ_SLOT_HEADER_START
);
}
/**
*
It gets the output slot data field pointer
*
@copydoc TRTL_MQ_CMD_CLAIM
* @param[in] type MQ type to use
* @param[in] slot slot number
*/
static
inline
void
*
mq_map_out_buffer
(
enum
trtl_mq_type
type
,
int
slot
)
static
inline
void
mq_claim
(
enum
trtl_mq_type
type
,
int
slot
)
{
return
(
void
*
)
(
trtl_mq_base_address
(
type
)
+
TRTL_MQ_SLOT_OUT
(
slot
)
+
TRTL_MQ_SLOT_DATA_START
);
mq_writel
(
type
,
TRTL_MQ_CMD_CLAIM
,
TRTL_MQ_SLOT_OUT
(
slot
)
+
TRTL_MQ_SLOT_COMMAND
);
}
/**
*
It gets the input slot data field pointer
*
@copydoc TRTL_MQ_CMD_PURGE
* @param[in] type MQ type to use
* @param[in] slot slot number
*/
static
inline
void
*
mq_map_in_buffer
(
enum
trtl_mq_type
type
,
int
slot
)
static
inline
void
mq_purge
(
enum
trtl_mq_type
type
,
int
slot
)
{
return
(
void
*
)
(
trtl_mq_base_address
(
type
)
+
TRTL_MQ_SLOT_IN
(
slot
)
+
TRTL_MQ_SLOT_DATA_START
);
mq_writel
(
type
,
TRTL_MQ_CMD_PURGE
,
TRTL_MQ_SLOT_OUT
(
slot
)
+
TRTL_MQ_SLOT_COMMAND
);
mq_writel
(
type
,
TRTL_MQ_CMD_PURGE
,
TRTL_MQ_SLOT_IN
(
slot
)
+
TRTL_MQ_SLOT_COMMAND
);
}
/**
*
It gets the output slot header field pointer
*
@copydoc TRTL_MQ_CMD_READY
* @param[in] type MQ type to use
* @param[in] slot slot number
*/
static
inline
void
*
mq_map_out_header
(
enum
trtl_mq_type
type
,
int
slot
)
static
inline
void
mq_send
(
enum
trtl_mq_type
type
,
int
slot
)
{
return
(
void
*
)
(
trtl_mq_base_address
(
type
)
+
TRTL_MQ_SLOT_OUT
(
slot
)
+
TRTL_MQ_SLOT_HEADER_START
);
mq_writel
(
type
,
TRTL_MQ_CMD_READY
,
TRTL_MQ_SLOT_OUT
(
slot
)
+
TRTL_MQ_SLOT_COMMAND
);
}
/**
*
It gets the input slot header field pointer
*
@copydoc TRTL_MQ_CMD_DISCARD
* @param[in] type MQ type to use
* @param[in] slot slot number
*/
static
inline
void
*
mq_map_in_header
(
enum
trtl_mq_type
type
,
int
slot
)
static
inline
void
mq_discard
(
enum
trtl_mq_type
type
,
int
slot
)
{
return
(
void
*
)
(
trtl_mq_base_address
(
type
)
+
TRTL_MQ_SLOT_IN
(
slot
)
+
TRTL_MQ_SLOT_HEADER_START
);
mq_writel
(
type
,
TRTL_MQ_CMD_DISCARD
,
TRTL_MQ_SLOT_IN
(
slot
));
}
/**
* It maps a given MQ for outcoming messages
* @param[in] type MQ type to use
...
...
@@ -161,6 +166,7 @@ static inline void mq_map_out_message(enum trtl_mq_type type,
msg
->
payload
=
mq_map_out_buffer
(
type
,
idx_mq
);
}
/**
* It maps a given MQ for incoming messages
* @param[in] type MQ type to use
...
...
@@ -175,7 +181,6 @@ static inline void mq_map_in_message(enum trtl_mq_type type,
msg
->
payload
=
mq_map_in_buffer
(
type
,
idx_mq
);
}
/**
* It gets the current MQ input status
* @return message queues input status bitmask
...
...
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