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
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
hdl-core-lib
mock-turtle
Commits
32333315
Commit
32333315
authored
Aug 01, 2018
by
Tristan Gingold
Committed by
Dimitris Lampridis
Aug 02, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sw/fw: constify
parent
13dd5dcc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
12 deletions
+12
-12
mockturtle-rt-common.c
software/firmware/lib/mockturtle-rt-common.c
+10
-10
mockturtle-rt.h
software/firmware/lib/mockturtle-rt.h
+2
-2
No files found.
software/firmware/lib/mockturtle-rt-common.c
View file @
32333315
...
...
@@ -73,13 +73,13 @@ void pr_message(struct trtl_fw_msg *msg)
}
static
inline
uint32_t
ep_eth_build_mac_hi
(
struct
trtl_ep_eth_address
*
addr
)
static
inline
uint32_t
ep_eth_build_mac_hi
(
const
struct
trtl_ep_eth_address
*
addr
)
{
return
((
uint32_t
)
addr
->
dst_mac
[
0
]
<<
8
)
|
((
uint32_t
)
addr
->
dst_mac
[
1
]
<<
0
);
}
static
inline
uint32_t
ep_eth_build_mac_lo
(
struct
trtl_ep_eth_address
*
addr
)
static
inline
uint32_t
ep_eth_build_mac_lo
(
const
struct
trtl_ep_eth_address
*
addr
)
{
return
((
uint32_t
)
addr
->
dst_mac
[
2
]
<<
24
)
|
((
uint32_t
)
addr
->
dst_mac
[
3
]
<<
16
)
|
...
...
@@ -99,9 +99,9 @@ static inline void rmq_ep_in_writel(int slot, uint32_t data, uint32_t addr)
mq_writel
(
TRTL_RMQ
,
data
,
addr
);
}
static
int
rmq_ep_eth_bind_in
(
unsigned
int
slot
,
void
*
arg
)
static
int
rmq_ep_eth_bind_in
(
unsigned
int
slot
,
const
void
*
arg
)
{
struct
trtl_ep_eth_address
*
addr
=
arg
;
const
struct
trtl_ep_eth_address
*
addr
=
arg
;
uint32_t
cfg
=
0
,
tmp
;
switch
(
addr
->
type
)
...
...
@@ -128,9 +128,9 @@ static int rmq_ep_eth_bind_in(unsigned int slot, void *arg)
return
0
;
}
static
int
rmq_ep_eth_bind_out
(
unsigned
int
slot
,
void
*
arg
)
static
int
rmq_ep_eth_bind_out
(
unsigned
int
slot
,
const
void
*
arg
)
{
struct
trtl_ep_eth_address
*
addr
=
arg
;
const
struct
trtl_ep_eth_address
*
addr
=
arg
;
uint32_t
tmp
;
tmp
=
addr
->
type
==
TRTL_EP_FRAME_UDP
?
1
:
0
;
...
...
@@ -150,7 +150,7 @@ static int rmq_ep_eth_bind_out(unsigned int slot, void *arg)
}
typedef
int
(
trtl_fw_rmq_bind_t
)
(
unsigned
int
slot
,
void
*
arg
);
typedef
int
(
trtl_fw_rmq_bind_t
)
(
unsigned
int
slot
,
const
void
*
arg
);
/*
* It's true that this is slower to execute, but on the other hand
...
...
@@ -161,7 +161,7 @@ typedef int (trtl_fw_rmq_bind_t) (unsigned int slot, void *arg);
*/
#define __TRTL_EP_IN 0
#define __TRTL_EP_OUT 1
static
trtl_fw_rmq_bind_t
*
rmq_ep_bind
[
__TRTL_EP_MAX
][
2
]
=
{
static
trtl_fw_rmq_bind_t
*
const
rmq_ep_bind
[
__TRTL_EP_MAX
][
2
]
=
{
[
TRTL_EP_ETH
]
=
{
[
__TRTL_EP_IN
]
=
rmq_ep_eth_bind_in
,
[
__TRTL_EP_OUT
]
=
rmq_ep_eth_bind_out
,
...
...
@@ -169,7 +169,7 @@ static trtl_fw_rmq_bind_t *rmq_ep_bind[__TRTL_EP_MAX][2] = {
};
int
rmq_bind_in
(
unsigned
int
slot
,
enum
trtl_ep_type
type
,
void
*
addr
)
int
rmq_bind_in
(
unsigned
int
slot
,
enum
trtl_ep_type
type
,
const
void
*
addr
)
{
if
(
type
>=
__TRTL_EP_MAX
)
return
-
EINVAL
;
...
...
@@ -177,7 +177,7 @@ int rmq_bind_in(unsigned int slot, enum trtl_ep_type type, void *addr)
return
rmq_ep_bind
[
type
][
__TRTL_EP_IN
](
slot
,
addr
);
}
int
rmq_bind_out
(
unsigned
int
slot
,
enum
trtl_ep_type
type
,
void
*
addr
)
int
rmq_bind_out
(
unsigned
int
slot
,
enum
trtl_ep_type
type
,
const
void
*
addr
)
{
if
(
type
>=
__TRTL_EP_MAX
)
return
-
EINVAL
;
...
...
software/firmware/lib/mockturtle-rt.h
View file @
32333315
...
...
@@ -495,7 +495,7 @@ static inline void mq_send(enum trtl_mq_type type, int slot)
* @param[in] type EP type to use
* @param[in] addr bind address
*/
extern
int
rmq_bind_in
(
unsigned
int
slot
,
enum
trtl_ep_type
type
,
void
*
addr
);
extern
int
rmq_bind_in
(
unsigned
int
slot
,
enum
trtl_ep_type
type
,
const
void
*
addr
);
/**
* Binds an RMQ slot (output) to a particular IP configuration. Used when
...
...
@@ -504,7 +504,7 @@ extern int rmq_bind_in(unsigned int slot, enum trtl_ep_type type, void *addr);
* @param[in] type EP type to use
* @param[in] addr bind address
*/
extern
int
rmq_bind_out
(
unsigned
int
slot
,
enum
trtl_ep_type
type
,
void
*
addr
);
extern
int
rmq_bind_out
(
unsigned
int
slot
,
enum
trtl_ep_type
type
,
const
void
*
addr
);
/**
...
...
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