Eliminate references to k_memset() and k_memcpy()

Since the kernel now provides a minimal string library, there is
no longer any reason not to use the standard memset() and memcpy()
APIs.

Change-Id: Iad587ace6f41fd94c9c961d13d9322495a7da1be
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
This commit is contained in:
Allan Stephens 2015-05-25 13:18:47 -04:00 committed by Anas Nashif
commit 140d314336
10 changed files with 22 additions and 18 deletions

View file

@ -399,7 +399,7 @@ void pci_header_get(uint32_t controller,
/* clear out the header */
k_memset((char *)pci_dev_header, sizeof(union pci_dev), 0);
memset((char *)pci_dev_header, sizeof(union pci_dev), 0);
/* fill in the PCI header from the device */

View file

@ -33,6 +33,7 @@
#include "minik.h"
#include "nanokernel.h"
#include "nanok.h"
#include <string.h>
#include <toolchain.h>
#include <sections.h>
@ -76,7 +77,7 @@ void kernel_init(void)
init_node();
#ifdef CONFIG_INIT_STACKS
k_memset((char *)_k_server_command_stack_storage, 0xaa,
memset((char *)_k_server_command_stack_storage, 0xaa,
sizeof(_k_server_command_stack_storage));
#endif
nano_stack_init(&_k_command_stack, _k_server_command_stack_storage);

View file

@ -67,7 +67,7 @@ static void copy_packet(struct k_args **out, struct k_args *in)
* a backpointer to the original packet.
*/
k_memcpy(*out, in, sizeof(struct k_args));
memcpy(*out, in, sizeof(struct k_args));
(*out)->Ctxt.args = in;
}
@ -245,7 +245,7 @@ void _k_mbox_send_ack(struct k_args *pCopyWriter)
struct k_args A;
#ifndef NO_KARG_CLEAR
k_memset(&A, 0xfd, sizeof(struct k_args));
memset(&A, 0xfd, sizeof(struct k_args));
#endif
A.Comm = SIGNALS;
A.Args.s1.sema = pCopyWriter->Args.m1.mess.extra.sema;
@ -785,7 +785,7 @@ void _k_mbox_receive_data(struct k_args *Starter)
set_state_bit(_k_current_task, TF_RECVDATA);
GETARGS(CopyStarter);
k_memcpy(CopyStarter, Starter, sizeof(struct k_args));
memcpy(CopyStarter, Starter, sizeof(struct k_args));
CopyStarter->Ctxt.args = Starter;
MoveD = CopyStarter->Args.m1.mess.extra.transfer;
@ -962,7 +962,7 @@ void _k_mbox_send_data(struct k_args *Starter)
set_state_bit(_k_current_task, TF_SENDDATA);
GETARGS(CopyStarter);
k_memcpy(CopyStarter, Starter, sizeof(struct k_args));
memcpy(CopyStarter, Starter, sizeof(struct k_args));
CopyStarter->Ctxt.args = Starter;
MoveD = CopyStarter->Args.m1.mess.extra.transfer;

View file

@ -203,7 +203,7 @@ static void MarkersClear(struct marker_list *pMarkerList)
int i;
for (i = 0; i < MAXNBR_MARKERS; i++, pM++) {
k_memset(pM, 0, sizeof(struct marker));
memset(pM, 0, sizeof(struct marker));
pM->Next = -1;
pM->Prev = -1;
}

View file

@ -60,7 +60,7 @@ void myfreetimer(struct k_timer * *ppTimer)
void mycopypacket(struct k_args **out, struct k_args *in)
{
GETARGS(*out);
k_memcpy(*out, in, sizeof(struct k_args));
memcpy(*out, in, sizeof(struct k_args));
(*out)->Ctxt.args = in;
}

View file

@ -84,7 +84,7 @@ void _k_fifo_enque_request(struct k_args *A)
if (W) {
Q->Waiters = W->Forw;
p = W->Args.q1.data;
k_memcpy(p, q, w);
memcpy(p, q, w);
#ifdef CONFIG_SYS_CLOCK_EXISTS
if (W->Time.timer) {
@ -100,7 +100,7 @@ void _k_fifo_enque_request(struct k_args *A)
#endif
else {
p = Q->Enqp;
k_memcpy(p, q, w);
memcpy(p, q, w);
p = (char *)((int)p + w);
if (p == Q->Endp)
Q->Enqp = Q->Base;
@ -208,7 +208,7 @@ void _k_fifo_deque_request(struct k_args *A)
n = Q->Nused;
if (n) {
q = Q->Deqp;
k_memcpy(p, q, w);
memcpy(p, q, w);
q = (char *)((int)q + w);
if (q == Q->Endp)
Q->Deqp = Q->Base;
@ -222,7 +222,7 @@ void _k_fifo_deque_request(struct k_args *A)
p = Q->Enqp;
q = W->Args.q1.data;
w = OCTET_TO_SIZEOFUNIT(Q->Esize);
k_memcpy(p, q, w);
memcpy(p, q, w);
p = (char *)((int)p + w);
if (p == Q->Endp)
Q->Enqp = Q->Base;

View file

@ -34,6 +34,7 @@
#include <microkernel.h>
#include <nanokernel.h>
#include <arch/cpu.h>
#include <string.h>
#include <toolchain.h>
#include <sections.h>
@ -209,7 +210,7 @@ void start_task(struct k_proc *X, /* ptr to task control block */
/* Note: the field X->worksize now represents the task size in bytes */
#ifdef CONFIG_INIT_STACKS
k_memset(X->workspace, 0xaa, X->worksize);
memset(X->workspace, 0xaa, X->worksize);
#endif
contextOptions = 0;

View file

@ -65,7 +65,7 @@ static void mvdreq_docont(struct k_args *Cont)
static void mvdreq_copy(struct moved_req *ReqArgs)
{
k_memcpy(ReqArgs->destination, ReqArgs->source,
memcpy(ReqArgs->destination, ReqArgs->source,
OCTET_TO_SIZEOFUNIT(ReqArgs->iTotalSize));
if (ReqArgs->Action & MVDACT_SNDACK)

View file

@ -37,6 +37,7 @@ either in the form of an actual function or an alias to a function.
*/
#include <nanok.h>
#include <string.h>
#include <toolchain.h>
#include <sections.h>
@ -79,7 +80,7 @@ void _fiber_start(char *pStack,
unsigned int imask;
#ifdef CONFIG_INIT_STACKS
k_memset((char *)pStack, 0xaa, stackSize);
memset((char *)pStack, 0xaa, stackSize);
#endif
ccs = _NewContext((char *)pStack,

View file

@ -91,6 +91,7 @@ x87 FPU registers are being saved/restored.
#include <tc_util.h>
#include "float_context.h"
#include <stddef.h>
#include <string.h>
#ifndef MAX_TESTS
/* test duration, unless overridden by project builder (0 => run forever) */
@ -220,7 +221,7 @@ void load_store_low(void)
* floating point values that have been saved.
*/
k_memset(&floatRegSetStore, 0, SIZEOF_FP_REG_SET);
memset(&floatRegSetStore, 0, SIZEOF_FP_REG_SET);
/*
* Utilize an architecture specific function to load all the floating