Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
E
EtherBone Core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
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
EtherBone Core
Commits
e098ecc8
Commit
e098ecc8
authored
Apr 18, 2016
by
Wesley W. Terpstra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
build: eliminate warnings from -pedantic
parent
a7b93d44
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
51 additions
and
21 deletions
+51
-21
etherbone.h
api/etherbone.h
+2
-2
slave.c
api/format/slave.c
+1
-1
device.c
api/glue/device.c
+3
-1
handler.c
api/glue/handler.c
+1
-1
readwrite.c
api/glue/readwrite.c
+19
-8
sdb.c
api/glue/sdb.c
+2
-2
dynamic.c
api/memory/dynamic.c
+4
-0
malloc.c
api/memory/malloc.c
+4
-0
static.c
api/memory/static.c
+4
-0
eb-get.c
api/tools/eb-get.c
+2
-1
eb-put.c
api/tools/eb-put.c
+2
-1
eb-read.c
api/tools/eb-read.c
+2
-1
eb-write.c
api/tools/eb-write.c
+2
-1
dev.c
api/transport/dev.c
+1
-1
dev.h
api/transport/dev.h
+1
-0
tunnel.c
api/transport/tunnel.c
+1
-1
No files found.
api/etherbone.h
View file @
e098ecc8
...
...
@@ -156,7 +156,7 @@ enum sdb_record_type {
sdb_record_device
=
0x01
,
sdb_record_bridge
=
0x02
,
sdb_record_integration
=
0x80
,
sdb_record_empty
=
0xFF
,
sdb_record_empty
=
0xFF
};
/* The type of bus (specifies bus-specific fields) */
...
...
@@ -764,7 +764,7 @@ class Cycle {
public
:
Cycle
();
/
/ Start a cycle on the target device.
/
* Start a cycle on the target device. */
template
<
typename
T
>
EB_STATUS_OR_VOID_T
open
(
Device
device
,
T
*
user
,
eb_callback_t
);
EB_STATUS_OR_VOID_T
open
(
Device
device
);
...
...
api/format/slave.c
View file @
e098ecc8
...
...
@@ -154,6 +154,7 @@ int eb_device_slave(eb_socket_t socketp, eb_transport_t transportp, eb_device_t
/* Is this a probe response? */
if
((
buffer
[
2
]
&
EB_HEADER_PR
)
!=
0
)
{
/* probe response */
eb_device_t
devp
;
eb_address_t
tag
;
struct
eb_device
*
dev
;
if
(
len
!=
8
)
goto
kill
;
/* > 8: haven't sent requests, passive should not send data */
...
...
@@ -161,7 +162,6 @@ int eb_device_slave(eb_socket_t socketp, eb_transport_t transportp, eb_device_t
if
(
passive
)
goto
kill
;
/* passive link not responded! */
/* Find device by probe id */
eb_address_t
tag
;
tag
=
be32toh
(
*
(
uint32_t
*
)
&
buffer
[
4
]);
for
(
devp
=
socket
->
first_device
;
devp
!=
EB_NULL
;
devp
=
dev
->
next
)
{
...
...
api/glue/device.c
View file @
e098ecc8
...
...
@@ -121,9 +121,11 @@ eb_status_t eb_device_open(eb_socket_t socketp, const char* address, eb_width_t
/* Try to determine port width */
device
->
widths
=
0
;
do
{
uint8_t
buf
[
8
]
=
{
0x4E
,
0x6F
,
0x11
,
proposed_widths
,
0x0
,
0x0
,
0x0
,
0x0
};
uint8_t
buf
[
8
]
=
{
0x4E
,
0x6F
,
0x11
,
0
,
0x0
,
0x0
,
0x0
,
0x0
};
int
timeout
,
got
;
buf
[
3
]
=
proposed_widths
;
link
=
EB_LINK
(
device
->
link
);
transport
=
EB_TRANSPORT
(
device
->
transport
);
...
...
api/glue/handler.c
View file @
e098ecc8
...
...
@@ -137,7 +137,7 @@ eb_status_t eb_socket_attach(eb_socket_t socketp, const struct eb_handler* handl
break
;
}
else
{
scan_last
=
address
->
device
->
sdb_component
.
addr_last
+
1
;
scan_last
=
(
scan_last
+
7
)
&
~
(
eb_address_t
)
7
;
/
/ align upwards to 8-bytes
scan_last
=
(
scan_last
+
7
)
&
~
(
eb_address_t
)
7
;
/
* align upwards to 8-bytes */
}
}
...
...
api/glue/readwrite.c
View file @
e098ecc8
...
...
@@ -176,20 +176,31 @@ eb_data_t eb_socket_read_config(eb_socket_t socketp, eb_width_t widths, eb_addre
struct
eb_socket
*
socket
;
struct
eb_socket_aux
*
aux
;
eb_address_t
sdb
;
eb_data_t
out
;
int
len
;
uint8_t
buf
[
16
];
socket
=
EB_SOCKET
(
socketp
);
aux
=
EB_SOCKET_AUX
(
socket
->
aux
);
sdb
=
aux
->
sdb_offset
;
/* We only support reading from the error shift register and SDB so far */
eb_data_t
out
;
int
len
;
uint8_t
buf
[
16
]
=
{
error
>>
56
,
error
>>
48
,
error
>>
40
,
error
>>
32
,
error
>>
24
,
error
>>
16
,
error
>>
8
,
error
>>
0
,
sdb
>>
56
,
sdb
>>
48
,
sdb
>>
40
,
sdb
>>
32
,
sdb
>>
24
,
sdb
>>
16
,
sdb
>>
8
,
sdb
>>
0
,
};
buf
[
0x0
]
=
error
>>
56
;
buf
[
0x1
]
=
error
>>
48
;
buf
[
0x2
]
=
error
>>
40
;
buf
[
0x3
]
=
error
>>
32
;
buf
[
0x4
]
=
error
>>
24
;
buf
[
0x5
]
=
error
>>
16
;
buf
[
0x6
]
=
error
>>
8
;
buf
[
0x7
]
=
error
>>
0
;
buf
[
0x8
]
=
sdb
>>
56
;
buf
[
0x9
]
=
sdb
>>
48
;
buf
[
0xa
]
=
sdb
>>
40
;
buf
[
0xb
]
=
sdb
>>
32
;
buf
[
0xc
]
=
sdb
>>
24
;
buf
[
0xd
]
=
sdb
>>
16
;
buf
[
0xe
]
=
sdb
>>
8
;
buf
[
0xf
]
=
sdb
>>
0
;
len
=
(
widths
&
EB_DATAX
);
...
...
api/glue/sdb.c
View file @
e098ecc8
...
...
@@ -236,7 +236,7 @@ static void eb_sdb_decode(struct eb_sdb_scan* scan, eb_device_t device, uint8_t*
}
/* We allocate buffer on the stack to hack around missing alloca */
#define EB_SDB_DECODE(x) \
#define EB_SDB_DECODE(x)
\
static void eb_sdb_decode##x(struct eb_sdb_scan* scan, eb_device_t device, eb_operation_t ops) { \
union { \
struct { \
...
...
@@ -245,7 +245,7 @@ static void eb_sdb_decode##x(struct eb_sdb_scan* scan, eb_device_t device, eb_op
} s; \
uint8_t bytes[1]; \
} sdb; \
return eb_sdb_decode(scan, device, &sdb.bytes[0], sizeof(sdb), ops);
\
eb_sdb_decode(scan, device, &sdb.bytes[0], sizeof(sdb), ops);
\
}
EB_SDB_DECODE
(
4
)
...
...
api/memory/dynamic.c
View file @
e098ecc8
...
...
@@ -69,4 +69,8 @@ int eb_expand_array(void) {
return
0
;
}
#else
typedef
int
make_iso_compilers_happy
;
/* so the file is not empty */
#endif
api/memory/malloc.c
View file @
e098ecc8
...
...
@@ -59,4 +59,8 @@ void eb_free_link (eb_link_t x) { free(x); }
void
eb_free_sdb_scan
(
eb_sdb_scan_t
x
)
{
free
(
x
);
}
void
eb_free_sdb_record
(
eb_sdb_record_t
x
)
{
free
(
x
);
}
#else
typedef
int
make_iso_compilers_happy
;
/* so the file is not empty */
#endif
api/memory/static.c
View file @
e098ecc8
...
...
@@ -56,4 +56,8 @@ int eb_expand_array(void) {
}
}
#else
typedef
int
make_iso_compilers_happy
;
/* so the file is not empty */
#endif
api/tools/eb-get.c
View file @
e098ecc8
...
...
@@ -315,10 +315,11 @@ int main(int argc, char** argv) {
eb_width_address
(
line_width
),
eb_width_data
(
line_width
));
if
(
probe
)
{
struct
sdb_device
info
;
if
(
verbose
)
fprintf
(
stdout
,
"Scanning remote bus for Wishbone devices...
\n
"
);
struct
sdb_device
info
;
if
((
status
=
eb_sdb_find_by_address
(
device
,
address
,
&
info
))
!=
EB_OK
)
{
fprintf
(
stderr
,
"%s: failed to find SDB record: %s
\n
"
,
program
,
eb_status
(
status
));
return
1
;
...
...
api/tools/eb-put.c
View file @
e098ecc8
...
...
@@ -301,10 +301,11 @@ int main(int argc, char** argv) {
eb_width_address
(
line_width
),
eb_width_data
(
line_width
));
if
(
probe
)
{
struct
sdb_device
info
;
if
(
verbose
)
fprintf
(
stdout
,
"Scanning remote bus for Wishbone devices...
\n
"
);
struct
sdb_device
info
;
if
((
status
=
eb_sdb_find_by_address
(
device
,
address
,
&
info
))
!=
EB_OK
)
{
fprintf
(
stderr
,
"%s: failed to find SDB record: %s
\n
"
,
program
,
eb_status
(
status
));
return
1
;
...
...
api/tools/eb-read.c
View file @
e098ecc8
...
...
@@ -244,10 +244,11 @@ int main(int argc, char** argv) {
eb_width_address
(
line_width
),
eb_width_data
(
line_width
));
if
(
probe
)
{
struct
sdb_device
info
;
if
(
verbose
)
fprintf
(
stdout
,
"Scanning remote bus for Wishbone devices...
\n
"
);
struct
sdb_device
info
;
if
((
status
=
eb_sdb_find_by_address
(
device
,
address
,
&
info
))
!=
EB_OK
)
{
fprintf
(
stderr
,
"%s: failed to find SDB record: %s
\n
"
,
program
,
eb_status
(
status
));
return
1
;
...
...
api/tools/eb-write.c
View file @
e098ecc8
...
...
@@ -252,10 +252,11 @@ int main(int argc, char** argv) {
eb_width_address
(
line_width
),
eb_width_data
(
line_width
));
if
(
probe
)
{
struct
sdb_device
info
;
if
(
verbose
)
fprintf
(
stdout
,
"Scanning remote bus for Wishbone devices...
\n
"
);
struct
sdb_device
info
;
if
((
status
=
eb_sdb_find_by_address
(
device
,
address
,
&
info
))
!=
EB_OK
)
{
fprintf
(
stderr
,
"%s: failed to find SDB record: %s
\n
"
,
program
,
eb_status
(
status
));
return
1
;
...
...
api/transport/dev.c
View file @
e098ecc8
...
...
@@ -94,7 +94,7 @@ eb_status_t eb_dev_connect(struct eb_transport* transportp, struct eb_link* link
link
->
fdes
=
fdes
;
link
->
flags
=
fcntl
(
fdes
,
F_GETFL
,
0
);
/
/ If this is a serial device, enter raw mode
/
* If this is a serial device, enter raw mode */
if
(
tcgetattr
(
fdes
,
&
ios
)
==
0
)
{
cfmakeraw
(
&
ios
);
cfsetispeed
(
&
ios
,
B115200
);
...
...
api/transport/dev.h
View file @
e098ecc8
...
...
@@ -46,6 +46,7 @@ EB_PRIVATE void eb_dev_send_buffer(struct eb_transport* transportp, struct eb_li
struct
eb_dev_transport
{
/* Contents must fit in 9 bytes */
char
reserved
[
9
];
};
struct
eb_dev_link
{
...
...
api/transport/tunnel.c
View file @
e098ecc8
...
...
@@ -84,7 +84,7 @@ void eb_tunnel_disconnect(struct eb_transport* transportp, struct eb_link* linkp
void
eb_tunnel_fdes
(
struct
eb_transport
*
transportp
,
struct
eb_link
*
linkp
,
eb_user_data_t
data
,
eb_descriptor_callback_t
cb
)
{
if
(
linkp
==
0
)
return
;
return
eb_posix_tcp_fdes
(
0
,
linkp
,
data
,
cb
);
eb_posix_tcp_fdes
(
0
,
linkp
,
data
,
cb
);
}
int
eb_tunnel_accept
(
struct
eb_transport
*
transportp
,
struct
eb_link
*
result_linkp
,
eb_user_data_t
data
,
eb_descriptor_callback_t
ready
)
{
...
...
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