Commit 78c4e80a authored by Alessandro Rubini's avatar Alessandro Rubini

general: kill pp_memset

Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 51c7bc86
...@@ -79,9 +79,6 @@ int posix_adj_freq(Integer32 adj) ...@@ -79,9 +79,6 @@ int posix_adj_freq(Integer32 adj)
void pp_puts(const char *s) void pp_puts(const char *s)
__attribute__((alias("posix_puts"))); __attribute__((alias("posix_puts")));
void *pp_memset(void *s, int c, int count)
__attribute__((alias("posix_memset")));
void pp_get_tstamp(TimeInternal *t) void pp_get_tstamp(TimeInternal *t)
__attribute__((alias("posix_get_tstamp"))); __attribute__((alias("posix_get_tstamp")));
......
...@@ -6,9 +6,7 @@ ...@@ -6,9 +6,7 @@
#include <stdint.h> #include <stdint.h>
#include <string.h> #include <string.h>
/* What follow is the old way, being phased out */
extern void pp_puts(const char *s); 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); extern uint32_t __div64_32(uint64_t *n, uint32_t base);
......
...@@ -55,7 +55,3 @@ char *strcpy(char *dest, const char *src) ...@@ -55,7 +55,3 @@ char *strcpy(char *dest, const char *src)
/* nothing */; /* nothing */;
return tmp; 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")));
...@@ -141,7 +141,7 @@ void msg_pack_header(struct pp_instance *ppi, void *buf) ...@@ -141,7 +141,7 @@ void msg_pack_header(struct pp_instance *ppi, void *buf)
if (DSDEF(ppi)->twoStepFlag) if (DSDEF(ppi)->twoStepFlag)
*(UInteger8 *) (buf + 6) = PP_TWO_STEP_FLAG; *(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, memcpy((buf + 20), DSPOR(ppi)->portIdentity.clockIdentity,
PP_CLOCK_IDENTITY_LENGTH); PP_CLOCK_IDENTITY_LENGTH);
*(UInteger16 *) (buf + 28) = *(UInteger16 *) (buf + 28) =
...@@ -175,7 +175,7 @@ void msg_pack_sync(struct pp_instance *ppi, Timestamp *orig_tstamp) ...@@ -175,7 +175,7 @@ void msg_pack_sync(struct pp_instance *ppi, Timestamp *orig_tstamp)
/* Table 23 */ /* Table 23 */
*(Integer8 *) (buf + 33) = DSPOR(ppi)->logSyncInterval; *(Integer8 *) (buf + 33) = DSPOR(ppi)->logSyncInterval;
pp_memset((buf + 8), 0, 8); memset((buf + 8), 0, 8);
/* Sync message */ /* Sync message */
*(UInteger16 *) (buf + 34) = htons(orig_tstamp->secondsField.msb); *(UInteger16 *) (buf + 34) = htons(orig_tstamp->secondsField.msb);
...@@ -216,7 +216,7 @@ int msg_pack_announce(struct pp_instance *ppi) ...@@ -216,7 +216,7 @@ int msg_pack_announce(struct pp_instance *ppi)
*(Integer8 *) (buf + 33) = DSPOR(ppi)->logAnnounceInterval; *(Integer8 *) (buf + 33) = DSPOR(ppi)->logAnnounceInterval;
/* Announce message */ /* Announce message */
pp_memset((buf + 34), 0, 10); memset((buf + 34), 0, 10);
*(Integer16 *) (buf + 44) = htons(DSPRO(ppi)->currentUtcOffset); *(Integer16 *) (buf + 44) = htons(DSPRO(ppi)->currentUtcOffset);
*(UInteger8 *) (buf + 47) = DSPAR(ppi)->grandmasterPriority1; *(UInteger8 *) (buf + 47) = DSPAR(ppi)->grandmasterPriority1;
*(UInteger8 *) (buf + 48) = DSDEF(ppi)->clockQuality.clockClass; *(UInteger8 *) (buf + 48) = DSDEF(ppi)->clockQuality.clockClass;
...@@ -340,14 +340,14 @@ void msg_pack_pdelay_req(struct pp_instance *ppi, Timestamp *orig_tstamp) ...@@ -340,14 +340,14 @@ void msg_pack_pdelay_req(struct pp_instance *ppi, Timestamp *orig_tstamp)
*(Integer8 *) (buf + 33) = 0x7F; *(Integer8 *) (buf + 33) = 0x7F;
/* Table 24 */ /* Table 24 */
pp_memset((buf + 8), 0, 8); memset((buf + 8), 0, 8);
/* Pdelay_req message */ /* Pdelay_req message */
*(UInteger16 *) (buf + 34) = htons(orig_tstamp->secondsField.msb); *(UInteger16 *) (buf + 34) = htons(orig_tstamp->secondsField.msb);
*(UInteger32 *) (buf + 36) = htonl(orig_tstamp->secondsField.lsb); *(UInteger32 *) (buf + 36) = htonl(orig_tstamp->secondsField.lsb);
*(UInteger32 *) (buf + 40) = htonl(orig_tstamp->nanosecondsField); *(UInteger32 *) (buf + 40) = htonl(orig_tstamp->nanosecondsField);
pp_memset((buf + 44), 0, 10); memset((buf + 44), 0, 10);
/* RAZ reserved octets */ /* RAZ reserved octets */
} }
...@@ -372,7 +372,7 @@ void msg_pack_delay_req(struct pp_instance *ppi, Timestamp *orig_tstamp) ...@@ -372,7 +372,7 @@ void msg_pack_delay_req(struct pp_instance *ppi, Timestamp *orig_tstamp)
*(Integer8 *) (buf + 33) = 0x7F; *(Integer8 *) (buf + 33) = 0x7F;
/* Table 24 */ /* Table 24 */
pp_memset((buf + 8), 0, 8); memset((buf + 8), 0, 8);
/* Pdelay_req message */ /* Pdelay_req message */
*(UInteger16 *) (buf + 34) = htons(orig_tstamp->secondsField.msb); *(UInteger16 *) (buf + 34) = htons(orig_tstamp->secondsField.msb);
...@@ -396,7 +396,7 @@ void msg_pack_delay_resp(struct pp_instance *ppi, ...@@ -396,7 +396,7 @@ void msg_pack_delay_resp(struct pp_instance *ppi,
/* Table 19 */ /* Table 19 */
*(UInteger16 *) (buf + 2) = htons(PP_DELAY_RESP_LENGTH); *(UInteger16 *) (buf + 2) = htons(PP_DELAY_RESP_LENGTH);
*(UInteger8 *) (buf + 4) = hdr->domainNumber; *(UInteger8 *) (buf + 4) = hdr->domainNumber;
pp_memset((buf + 8), 0, 8); memset((buf + 8), 0, 8);
/* Copy correctionField of delayReqMessage */ /* Copy correctionField of delayReqMessage */
*(Integer32 *) (buf + 8) = htonl(hdr->correctionfield.msb); *(Integer32 *) (buf + 8) = htonl(hdr->correctionfield.msb);
...@@ -437,7 +437,7 @@ void msg_pack_pdelay_resp(struct pp_instance *ppi, MsgHeader *hdr, ...@@ -437,7 +437,7 @@ void msg_pack_pdelay_resp(struct pp_instance *ppi, MsgHeader *hdr,
/* Table 19 */ /* Table 19 */
*(UInteger16 *) (buf + 2) = htons(PP_PDELAY_RESP_LENGTH); *(UInteger16 *) (buf + 2) = htons(PP_PDELAY_RESP_LENGTH);
*(UInteger8 *) (buf + 4) = hdr->domainNumber; *(UInteger8 *) (buf + 4) = hdr->domainNumber;
pp_memset((buf + 8), 0, 8); memset((buf + 8), 0, 8);
*(UInteger16 *) (buf + 30) = htons(hdr->sequenceId); *(UInteger16 *) (buf + 30) = htons(hdr->sequenceId);
......
...@@ -138,7 +138,7 @@ void msg_pack_header(struct pp_instance *ppi, void *buf) ...@@ -138,7 +138,7 @@ void msg_pack_header(struct pp_instance *ppi, void *buf)
if (DSDEF(ppi)->twoStepFlag) if (DSDEF(ppi)->twoStepFlag)
*(UInteger8 *) (buf + 6) = PP_TWO_STEP_FLAG; *(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, memcpy((buf + 20), DSPOR(ppi)->portIdentity.clockIdentity,
PP_CLOCK_IDENTITY_LENGTH); PP_CLOCK_IDENTITY_LENGTH);
*(UInteger16 *) (buf + 28) = *(UInteger16 *) (buf + 28) =
...@@ -172,7 +172,7 @@ void msg_pack_sync(struct pp_instance *ppi, Timestamp *orig_tstamp) ...@@ -172,7 +172,7 @@ void msg_pack_sync(struct pp_instance *ppi, Timestamp *orig_tstamp)
/* Table 23 */ /* Table 23 */
*(Integer8 *) (buf + 33) = DSPOR(ppi)->logSyncInterval; *(Integer8 *) (buf + 33) = DSPOR(ppi)->logSyncInterval;
pp_memset((buf + 8), 0, 8); memset((buf + 8), 0, 8);
/* Sync message */ /* Sync message */
*(UInteger16 *) (buf + 34) = htons(orig_tstamp->secondsField.msb); *(UInteger16 *) (buf + 34) = htons(orig_tstamp->secondsField.msb);
...@@ -213,7 +213,7 @@ int msg_pack_announce(struct pp_instance *ppi) ...@@ -213,7 +213,7 @@ int msg_pack_announce(struct pp_instance *ppi)
*(Integer8 *) (buf + 33) = DSPOR(ppi)->logAnnounceInterval; *(Integer8 *) (buf + 33) = DSPOR(ppi)->logAnnounceInterval;
/* Announce message */ /* Announce message */
pp_memset((buf + 34), 0, 10); memset((buf + 34), 0, 10);
*(Integer16 *) (buf + 44) = htons(DSPRO(ppi)->currentUtcOffset); *(Integer16 *) (buf + 44) = htons(DSPRO(ppi)->currentUtcOffset);
*(UInteger8 *) (buf + 47) = DSPAR(ppi)->grandmasterPriority1; *(UInteger8 *) (buf + 47) = DSPAR(ppi)->grandmasterPriority1;
*(UInteger8 *) (buf + 48) = DSDEF(ppi)->clockQuality.clockClass; *(UInteger8 *) (buf + 48) = DSDEF(ppi)->clockQuality.clockClass;
...@@ -324,14 +324,14 @@ void msg_pack_pdelay_req(struct pp_instance *ppi, Timestamp *orig_tstamp) ...@@ -324,14 +324,14 @@ void msg_pack_pdelay_req(struct pp_instance *ppi, Timestamp *orig_tstamp)
*(Integer8 *) (buf + 33) = 0x7F; *(Integer8 *) (buf + 33) = 0x7F;
/* Table 24 */ /* Table 24 */
pp_memset((buf + 8), 0, 8); memset((buf + 8), 0, 8);
/* Pdelay_req message */ /* Pdelay_req message */
*(UInteger16 *) (buf + 34) = htons(orig_tstamp->secondsField.msb); *(UInteger16 *) (buf + 34) = htons(orig_tstamp->secondsField.msb);
*(UInteger32 *) (buf + 36) = htonl(orig_tstamp->secondsField.lsb); *(UInteger32 *) (buf + 36) = htonl(orig_tstamp->secondsField.lsb);
*(UInteger32 *) (buf + 40) = htonl(orig_tstamp->nanosecondsField); *(UInteger32 *) (buf + 40) = htonl(orig_tstamp->nanosecondsField);
pp_memset((buf + 44), 0, 10); memset((buf + 44), 0, 10);
/* RAZ reserved octets */ /* RAZ reserved octets */
} }
...@@ -356,7 +356,7 @@ void msg_pack_delay_req(struct pp_instance *ppi, Timestamp *orig_tstamp) ...@@ -356,7 +356,7 @@ void msg_pack_delay_req(struct pp_instance *ppi, Timestamp *orig_tstamp)
*(Integer8 *) (buf + 33) = 0x7F; *(Integer8 *) (buf + 33) = 0x7F;
/* Table 24 */ /* Table 24 */
pp_memset((buf + 8), 0, 8); memset((buf + 8), 0, 8);
/* Pdelay_req message */ /* Pdelay_req message */
*(UInteger16 *) (buf + 34) = htons(orig_tstamp->secondsField.msb); *(UInteger16 *) (buf + 34) = htons(orig_tstamp->secondsField.msb);
...@@ -380,7 +380,7 @@ void msg_pack_delay_resp(struct pp_instance *ppi, ...@@ -380,7 +380,7 @@ void msg_pack_delay_resp(struct pp_instance *ppi,
/* Table 19 */ /* Table 19 */
*(UInteger16 *) (buf + 2) = htons(PP_DELAY_RESP_LENGTH); *(UInteger16 *) (buf + 2) = htons(PP_DELAY_RESP_LENGTH);
*(UInteger8 *) (buf + 4) = hdr->domainNumber; *(UInteger8 *) (buf + 4) = hdr->domainNumber;
pp_memset((buf + 8), 0, 8); memset((buf + 8), 0, 8);
/* Copy correctionField of delayReqMessage */ /* Copy correctionField of delayReqMessage */
*(Integer32 *) (buf + 8) = htonl(hdr->correctionfield.msb); *(Integer32 *) (buf + 8) = htonl(hdr->correctionfield.msb);
...@@ -421,7 +421,7 @@ void msg_pack_pdelay_resp(struct pp_instance *ppi, MsgHeader *hdr, ...@@ -421,7 +421,7 @@ void msg_pack_pdelay_resp(struct pp_instance *ppi, MsgHeader *hdr,
/* Table 19 */ /* Table 19 */
*(UInteger16 *) (buf + 2) = htons(PP_PDELAY_RESP_LENGTH); *(UInteger16 *) (buf + 2) = htons(PP_PDELAY_RESP_LENGTH);
*(UInteger8 *) (buf + 4) = hdr->domainNumber; *(UInteger8 *) (buf + 4) = hdr->domainNumber;
pp_memset((buf + 8), 0, 8); memset((buf + 8), 0, 8);
*(UInteger16 *) (buf + 30) = htons(hdr->sequenceId); *(UInteger16 *) (buf + 30) = htons(hdr->sequenceId);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment