GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: core/src/ux_utility_memory_copy.c Lines: 6 6 100.0 %
Date: 2026-03-06 18:57:10 Branches: 2 2 100.0 %

Line Branch Exec Source
1
/***************************************************************************
2
 * Copyright (c) 2024 Microsoft Corporation
3
 * Copyright (c) 2026-present Eclipse ThreadX contributors
4
 *
5
 * This program and the accompanying materials are made available under the
6
 * terms of the MIT License which is available at
7
 * https://opensource.org/licenses/MIT.
8
 *
9
 * SPDX-License-Identifier: MIT
10
 **************************************************************************/
11
12
13
/**************************************************************************/
14
/**************************************************************************/
15
/**                                                                       */
16
/** USBX Component                                                        */
17
/**                                                                       */
18
/**   Utility                                                             */
19
/**                                                                       */
20
/**************************************************************************/
21
/**************************************************************************/
22
23
24
/* Include necessary system files.  */
25
26
#define UX_SOURCE_CODE
27
28
#include "ux_api.h"
29
30
31
/**************************************************************************/
32
/*                                                                        */
33
/*  FUNCTION                                               RELEASE        */
34
/*                                                                        */
35
/*    _ux_utility_memory_copy                             PORTABLE C      */
36
/*                                                           6.1          */
37
/*  AUTHOR                                                                */
38
/*                                                                        */
39
/*    Chaoqiong Xiao, Microsoft Corporation                               */
40
/*                                                                        */
41
/*  DESCRIPTION                                                           */
42
/*                                                                        */
43
/*    This function copies a block of memory from a source to a           */
44
/*    destination.                                                        */
45
/*                                                                        */
46
/*  INPUT                                                                 */
47
/*                                                                        */
48
/*    memory_destination                    Pointer to destination        */
49
/*    memory_source                         Pointer to source             */
50
/*    length                                Number of bytes to copy       */
51
/*                                                                        */
52
/*  OUTPUT                                                                */
53
/*                                                                        */
54
/*    None                                                                */
55
/*                                                                        */
56
/*  CALLS                                                                 */
57
/*                                                                        */
58
/*    None                                                                */
59
/*                                                                        */
60
/*  CALLED BY                                                             */
61
/*                                                                        */
62
/*    USBX Components                                                     */
63
/*                                                                        */
64
/**************************************************************************/
65
50080
VOID  _ux_utility_memory_copy(VOID *memory_destination, VOID *memory_source, ULONG length)
66
{
67
68
UCHAR *   source;
69
UCHAR *   destination;
70
71
    /* Setup byte oriented source and destination pointers.  */
72
50080
    source =  (UCHAR *) memory_source;
73
50080
    destination =  (UCHAR *) memory_destination;
74
75
    /* Loop to perform the copy.  */
76
2383774
    while(length--)
77
    {
78
79
        /* Copy one byte.  */
80
2333694
        *destination++ =  *source++;
81
    }
82
83
    /* Return to caller.  */
84
50080
    return;
85
}
86