GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: fx_utility_memory_set.c Lines: 4 4 100.0 %
Date: 2026-03-06 18:49:02 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
/** FileX Component                                                       */
17
/**                                                                       */
18
/**   Utility                                                             */
19
/**                                                                       */
20
/**************************************************************************/
21
/**************************************************************************/
22
23
#define FX_SOURCE_CODE
24
25
26
/* Include necessary system files.  */
27
28
#include "fx_api.h"
29
#include "fx_system.h"
30
#include "fx_utility.h"
31
#include "string.h"
32
33
34
/* Remove any previous remapping for memory copy when compiling this
35
   module.  */
36
37
#undef _fx_utility_memory_set
38
39
40
/**************************************************************************/
41
/*                                                                        */
42
/*  FUNCTION                                               RELEASE        */
43
/*                                                                        */
44
/*    _fx_utility_memory_set                              PORTABLE C      */
45
/*                                                           6.1          */
46
/*  AUTHOR                                                                */
47
/*                                                                        */
48
/*    William E. Lamie, Microsoft Corporation                             */
49
/*                                                                        */
50
/*  DESCRIPTION                                                           */
51
/*                                                                        */
52
/*    This function copies the specified number of bytes from the source  */
53
/*    to the destination.                                                 */
54
/*                                                                        */
55
/*  INPUT                                                                 */
56
/*                                                                        */
57
/*    dest_ptr                              Destination memory pointer    */
58
/*    value                                 Value to fill                 */
59
/*    size                                  Number of bytes to set        */
60
/*                                                                        */
61
/*  OUTPUT                                                                */
62
/*                                                                        */
63
/*    None                                                                */
64
/*                                                                        */
65
/*  CALLS                                                                 */
66
/*                                                                        */
67
/*    None                                                                */
68
/*                                                                        */
69
/*  CALLED BY                                                             */
70
/*                                                                        */
71
/*    FileX System Functions                                              */
72
/*                                                                        */
73
/**************************************************************************/
74
4
VOID  _fx_utility_memory_set(UCHAR *dest_ptr, UCHAR value, ULONG size)
75
{
76
77
    /* Loop to set memory.  */
78
52
    while (size--)
79
    {
80
81
        /* Set byte.  */
82
48
        *dest_ptr++ =  value;
83
    }
84
4
}
85