Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Software for White Rabbit PTP Core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
32
Issues
32
List
Board
Labels
Milestones
Merge Requests
6
Merge Requests
6
CI / CD
CI / CD
Pipelines
Schedules
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
Software for White Rabbit PTP Core
Commits
9ccfd45c
Commit
9ccfd45c
authored
Apr 19, 2020
by
Tomasz Wlostowski
Committed by
Grzegorz Daniluk
Apr 24, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools: include gensdbfs utility in wrpc toolset
parent
2cb90c4e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
641 additions
and
0 deletions
+641
-0
Makefile
tools/Makefile
+6
-0
gensdbfs.c
tools/gensdbfs.c
+593
-0
gensdbfs.h
tools/gensdbfs.h
+42
-0
No files found.
tools/Makefile
View file @
9ccfd45c
...
...
@@ -12,6 +12,7 @@ ALL += wrpc-dump mapper
ALL
+=
wrpc-vuart
ALL
+=
wr-streamers
ALL
+=
wrpc-diags
ALL
+=
gensdbfs
ifneq
($(EB),no)
ALL
+=
eb-w1-write
...
...
@@ -44,6 +45,11 @@ wrpc-w1-write: wrpc-w1-write.c ../dev/w1.c ../dev/w1-eeprom.c ../dev/w1-hw.c
eb-w1-write
:
eb-w1-write.c ../dev/w1.c ../dev/w1-eeprom.c eb-w1.c
$(CC)
$(CFLAGS)
-I
$(EB)
$^
$(LDFLAGS)
-o
$@
-L
$(EB)
/.libs
-letherbone
GENSDBFS_SRCS
=
gensdbfs.c ../sdb-lib/access.c ../sdb-lib/glue.c
gensdbfs
:
${
CC
}
$(CFLAGS)
-o
$@
$(GENSDBFS_SRCS)
sdb-wrpc.bin
:
sdbfs
$(SDBFS)
/gensdbfs
$<
$@
...
...
tools/gensdbfs.c
0 → 100644
View file @
9ccfd45c
This diff is collapsed.
Click to expand it.
tools/gensdbfs.h
0 → 100644
View file @
9ccfd45c
#ifndef __GENSDBFS_H__
#define __GENSDBFS_H__
#include <stdint.h>
#define CFG_NAME "--SDB-CONFIG--"
#define DEFAULT_VENDOR htonll(0x46696c6544617461LL)
/* "FileData" */
/* We need to keep track of each file as both unix and sdb entity*/
struct
sdbf
{
struct
stat
stbuf
;
struct
dirent
de
;
union
{
struct
sdb_device
s_d
;
struct
sdb_interconnect
s_i
;
struct
sdb_bridge
s_b
;
};
char
*
fullname
;
char
*
basename
;
unsigned
long
ustart
,
rstart
;
/* user (mandated), relative */
unsigned
long
base
,
size
;
/* base is absolute, for output */
int
nfiles
,
totsize
;
/* for dirs */
struct
sdbf
*
dot
;
/* for files, pointer to owning dir */
struct
sdbf
*
parent
;
/* for dirs, current dir in ../ */
struct
sdbf
*
subdir
;
/* for files that are dirs */
int
level
;
/* subdir level */
int
userpos
;
/* only allowed at level 0 */
};
static
inline
uint64_t
htonll
(
uint64_t
ll
)
{
uint64_t
res
;
if
(
htonl
(
1
)
==
1
)
return
ll
;
res
=
htonl
(
ll
>>
32
);
res
|=
(
uint64_t
)(
htonl
((
uint32_t
)
ll
))
<<
32
;
return
res
;
}
#define ntohll htonll
#endif
/* __GENSDBFS_H__ */
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