Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
PPSi
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
50
Issues
50
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
PPSi
Commits
78c4e80a
Commit
78c4e80a
authored
Feb 24, 2013
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
general: kill pp_memset
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
51c7bc86
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
25 deletions
+16
-25
posix-io.c
arch-gnu-linux/posix-io.c
+0
-3
lib.h
include/ppsi/lib.h
+0
-2
libc-functions.c
lib/libc-functions.c
+0
-4
msg.c
proto-ext-whiterabbit/msg.c
+8
-8
msg.c
proto-standard/msg.c
+8
-8
No files found.
arch-gnu-linux/posix-io.c
View file @
78c4e80a
...
...
@@ -79,9 +79,6 @@ int posix_adj_freq(Integer32 adj)
void
pp_puts
(
const
char
*
s
)
__attribute__
((
alias
(
"posix_puts"
)));
void
*
pp_memset
(
void
*
s
,
int
c
,
int
count
)
__attribute__
((
alias
(
"posix_memset"
)));
void
pp_get_tstamp
(
TimeInternal
*
t
)
__attribute__
((
alias
(
"posix_get_tstamp"
)));
...
...
include/ppsi/lib.h
View file @
78c4e80a
...
...
@@ -6,9 +6,7 @@
#include <stdint.h>
#include <string.h>
/* What follow is the old way, being phased out */
extern
void
pp_puts
(
const
char
*
s
);
extern
void
*
pp_memset
(
void
*
s
,
int
c
,
int
count
);
extern
uint32_t
__div64_32
(
uint64_t
*
n
,
uint32_t
base
);
...
...
lib/libc-functions.c
View file @
78c4e80a
...
...
@@ -55,7 +55,3 @@ char *strcpy(char *dest, const char *src)
/* nothing */
;
return
tmp
;
}
/* As a first step in removing pp_memset etc, provide aliases */
extern
void
*
pp_memset
(
void
*
s
,
int
c
,
int
count
)
__attribute__
((
alias
(
"memset"
)));
proto-ext-whiterabbit/msg.c
View file @
78c4e80a
...
...
@@ -141,7 +141,7 @@ void msg_pack_header(struct pp_instance *ppi, void *buf)
if
(
DSDEF
(
ppi
)
->
twoStepFlag
)
*
(
UInteger8
*
)
(
buf
+
6
)
=
PP_TWO_STEP_FLAG
;
pp_
memset
((
buf
+
8
),
0
,
8
);
memset
((
buf
+
8
),
0
,
8
);
memcpy
((
buf
+
20
),
DSPOR
(
ppi
)
->
portIdentity
.
clockIdentity
,
PP_CLOCK_IDENTITY_LENGTH
);
*
(
UInteger16
*
)
(
buf
+
28
)
=
...
...
@@ -175,7 +175,7 @@ void msg_pack_sync(struct pp_instance *ppi, Timestamp *orig_tstamp)
/* Table 23 */
*
(
Integer8
*
)
(
buf
+
33
)
=
DSPOR
(
ppi
)
->
logSyncInterval
;
pp_
memset
((
buf
+
8
),
0
,
8
);
memset
((
buf
+
8
),
0
,
8
);
/* Sync message */
*
(
UInteger16
*
)
(
buf
+
34
)
=
htons
(
orig_tstamp
->
secondsField
.
msb
);
...
...
@@ -216,7 +216,7 @@ int msg_pack_announce(struct pp_instance *ppi)
*
(
Integer8
*
)
(
buf
+
33
)
=
DSPOR
(
ppi
)
->
logAnnounceInterval
;
/* Announce message */
pp_
memset
((
buf
+
34
),
0
,
10
);
memset
((
buf
+
34
),
0
,
10
);
*
(
Integer16
*
)
(
buf
+
44
)
=
htons
(
DSPRO
(
ppi
)
->
currentUtcOffset
);
*
(
UInteger8
*
)
(
buf
+
47
)
=
DSPAR
(
ppi
)
->
grandmasterPriority1
;
*
(
UInteger8
*
)
(
buf
+
48
)
=
DSDEF
(
ppi
)
->
clockQuality
.
clockClass
;
...
...
@@ -340,14 +340,14 @@ void msg_pack_pdelay_req(struct pp_instance *ppi, Timestamp *orig_tstamp)
*
(
Integer8
*
)
(
buf
+
33
)
=
0x7F
;
/* Table 24 */
pp_
memset
((
buf
+
8
),
0
,
8
);
memset
((
buf
+
8
),
0
,
8
);
/* Pdelay_req message */
*
(
UInteger16
*
)
(
buf
+
34
)
=
htons
(
orig_tstamp
->
secondsField
.
msb
);
*
(
UInteger32
*
)
(
buf
+
36
)
=
htonl
(
orig_tstamp
->
secondsField
.
lsb
);
*
(
UInteger32
*
)
(
buf
+
40
)
=
htonl
(
orig_tstamp
->
nanosecondsField
);
pp_
memset
((
buf
+
44
),
0
,
10
);
memset
((
buf
+
44
),
0
,
10
);
/* RAZ reserved octets */
}
...
...
@@ -372,7 +372,7 @@ void msg_pack_delay_req(struct pp_instance *ppi, Timestamp *orig_tstamp)
*
(
Integer8
*
)
(
buf
+
33
)
=
0x7F
;
/* Table 24 */
pp_
memset
((
buf
+
8
),
0
,
8
);
memset
((
buf
+
8
),
0
,
8
);
/* Pdelay_req message */
*
(
UInteger16
*
)
(
buf
+
34
)
=
htons
(
orig_tstamp
->
secondsField
.
msb
);
...
...
@@ -396,7 +396,7 @@ void msg_pack_delay_resp(struct pp_instance *ppi,
/* Table 19 */
*
(
UInteger16
*
)
(
buf
+
2
)
=
htons
(
PP_DELAY_RESP_LENGTH
);
*
(
UInteger8
*
)
(
buf
+
4
)
=
hdr
->
domainNumber
;
pp_
memset
((
buf
+
8
),
0
,
8
);
memset
((
buf
+
8
),
0
,
8
);
/* Copy correctionField of delayReqMessage */
*
(
Integer32
*
)
(
buf
+
8
)
=
htonl
(
hdr
->
correctionfield
.
msb
);
...
...
@@ -437,7 +437,7 @@ void msg_pack_pdelay_resp(struct pp_instance *ppi, MsgHeader *hdr,
/* Table 19 */
*
(
UInteger16
*
)
(
buf
+
2
)
=
htons
(
PP_PDELAY_RESP_LENGTH
);
*
(
UInteger8
*
)
(
buf
+
4
)
=
hdr
->
domainNumber
;
pp_
memset
((
buf
+
8
),
0
,
8
);
memset
((
buf
+
8
),
0
,
8
);
*
(
UInteger16
*
)
(
buf
+
30
)
=
htons
(
hdr
->
sequenceId
);
...
...
proto-standard/msg.c
View file @
78c4e80a
...
...
@@ -138,7 +138,7 @@ void msg_pack_header(struct pp_instance *ppi, void *buf)
if
(
DSDEF
(
ppi
)
->
twoStepFlag
)
*
(
UInteger8
*
)
(
buf
+
6
)
=
PP_TWO_STEP_FLAG
;
pp_
memset
((
buf
+
8
),
0
,
8
);
memset
((
buf
+
8
),
0
,
8
);
memcpy
((
buf
+
20
),
DSPOR
(
ppi
)
->
portIdentity
.
clockIdentity
,
PP_CLOCK_IDENTITY_LENGTH
);
*
(
UInteger16
*
)
(
buf
+
28
)
=
...
...
@@ -172,7 +172,7 @@ void msg_pack_sync(struct pp_instance *ppi, Timestamp *orig_tstamp)
/* Table 23 */
*
(
Integer8
*
)
(
buf
+
33
)
=
DSPOR
(
ppi
)
->
logSyncInterval
;
pp_
memset
((
buf
+
8
),
0
,
8
);
memset
((
buf
+
8
),
0
,
8
);
/* Sync message */
*
(
UInteger16
*
)
(
buf
+
34
)
=
htons
(
orig_tstamp
->
secondsField
.
msb
);
...
...
@@ -213,7 +213,7 @@ int msg_pack_announce(struct pp_instance *ppi)
*
(
Integer8
*
)
(
buf
+
33
)
=
DSPOR
(
ppi
)
->
logAnnounceInterval
;
/* Announce message */
pp_
memset
((
buf
+
34
),
0
,
10
);
memset
((
buf
+
34
),
0
,
10
);
*
(
Integer16
*
)
(
buf
+
44
)
=
htons
(
DSPRO
(
ppi
)
->
currentUtcOffset
);
*
(
UInteger8
*
)
(
buf
+
47
)
=
DSPAR
(
ppi
)
->
grandmasterPriority1
;
*
(
UInteger8
*
)
(
buf
+
48
)
=
DSDEF
(
ppi
)
->
clockQuality
.
clockClass
;
...
...
@@ -324,14 +324,14 @@ void msg_pack_pdelay_req(struct pp_instance *ppi, Timestamp *orig_tstamp)
*
(
Integer8
*
)
(
buf
+
33
)
=
0x7F
;
/* Table 24 */
pp_
memset
((
buf
+
8
),
0
,
8
);
memset
((
buf
+
8
),
0
,
8
);
/* Pdelay_req message */
*
(
UInteger16
*
)
(
buf
+
34
)
=
htons
(
orig_tstamp
->
secondsField
.
msb
);
*
(
UInteger32
*
)
(
buf
+
36
)
=
htonl
(
orig_tstamp
->
secondsField
.
lsb
);
*
(
UInteger32
*
)
(
buf
+
40
)
=
htonl
(
orig_tstamp
->
nanosecondsField
);
pp_
memset
((
buf
+
44
),
0
,
10
);
memset
((
buf
+
44
),
0
,
10
);
/* RAZ reserved octets */
}
...
...
@@ -356,7 +356,7 @@ void msg_pack_delay_req(struct pp_instance *ppi, Timestamp *orig_tstamp)
*
(
Integer8
*
)
(
buf
+
33
)
=
0x7F
;
/* Table 24 */
pp_
memset
((
buf
+
8
),
0
,
8
);
memset
((
buf
+
8
),
0
,
8
);
/* Pdelay_req message */
*
(
UInteger16
*
)
(
buf
+
34
)
=
htons
(
orig_tstamp
->
secondsField
.
msb
);
...
...
@@ -380,7 +380,7 @@ void msg_pack_delay_resp(struct pp_instance *ppi,
/* Table 19 */
*
(
UInteger16
*
)
(
buf
+
2
)
=
htons
(
PP_DELAY_RESP_LENGTH
);
*
(
UInteger8
*
)
(
buf
+
4
)
=
hdr
->
domainNumber
;
pp_
memset
((
buf
+
8
),
0
,
8
);
memset
((
buf
+
8
),
0
,
8
);
/* Copy correctionField of delayReqMessage */
*
(
Integer32
*
)
(
buf
+
8
)
=
htonl
(
hdr
->
correctionfield
.
msb
);
...
...
@@ -421,7 +421,7 @@ void msg_pack_pdelay_resp(struct pp_instance *ppi, MsgHeader *hdr,
/* Table 19 */
*
(
UInteger16
*
)
(
buf
+
2
)
=
htons
(
PP_PDELAY_RESP_LENGTH
);
*
(
UInteger8
*
)
(
buf
+
4
)
=
hdr
->
domainNumber
;
pp_
memset
((
buf
+
8
),
0
,
8
);
memset
((
buf
+
8
),
0
,
8
);
*
(
UInteger16
*
)
(
buf
+
30
)
=
htons
(
hdr
->
sequenceId
);
...
...
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