GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: fx_utility_32_unsigned_write.c Lines: 6 6 100.0 %
Date: 2024-01-10 21:53:23 Branches: 0 0 - %

Line Branch Exec Source
1
/**************************************************************************/
2
/*                                                                        */
3
/*       Copyright (c) Microsoft Corporation. All rights reserved.        */
4
/*                                                                        */
5
/*       This software is licensed under the Microsoft Software License   */
6
/*       Terms for Microsoft Azure RTOS. Full text of the license can be  */
7
/*       found in the LICENSE file at https://aka.ms/AzureRTOS_EULA       */
8
/*       and in the root directory of this software.                      */
9
/*                                                                        */
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
32
33
/**************************************************************************/
34
/*                                                                        */
35
/*  FUNCTION                                               RELEASE        */
36
/*                                                                        */
37
/*    _fx_utility_32_unsigned_write                       PORTABLE C      */
38
/*                                                           6.1          */
39
/*  AUTHOR                                                                */
40
/*                                                                        */
41
/*    William E. Lamie, Microsoft Corporation                             */
42
/*                                                                        */
43
/*  DESCRIPTION                                                           */
44
/*                                                                        */
45
/*    This function writes (with endian awareness) a 32-bit unsigned data */
46
/*    type to the specified destination.                                  */
47
/*                                                                        */
48
/*  INPUT                                                                 */
49
/*                                                                        */
50
/*    dest_ptr                              Destination memory pointer    */
51
/*    value                                 Value to write to memory      */
52
/*                                                                        */
53
/*  OUTPUT                                                                */
54
/*                                                                        */
55
/*    None                                                                */
56
/*                                                                        */
57
/*  CALLS                                                                 */
58
/*                                                                        */
59
/*    None                                                                */
60
/*                                                                        */
61
/*  CALLED BY                                                             */
62
/*                                                                        */
63
/*    FileX System Functions                                              */
64
/*                                                                        */
65
/*  RELEASE HISTORY                                                       */
66
/*                                                                        */
67
/*    DATE              NAME                      DESCRIPTION             */
68
/*                                                                        */
69
/*  05-19-2020     William E. Lamie         Initial Version 6.0           */
70
/*  09-30-2020     William E. Lamie         Modified comment(s),          */
71
/*                                            resulting in version 6.1    */
72
/*                                                                        */
73
/**************************************************************************/
74
1253670
VOID  _fx_utility_32_unsigned_write(UCHAR *dest_ptr, ULONG value)
75
{
76
77
    /* Store the UINT into the destination with endian-awareness.  */
78
1253670
    *(dest_ptr) =       (UCHAR)(value & 0xFF);
79
1253670
    *(dest_ptr + 1) =   (UCHAR)((value >> 8) & 0xFF);
80
1253670
    *(dest_ptr + 2) =   (UCHAR)((value >> 16) & 0xFF);
81
1253670
    *(dest_ptr + 3) =   (UCHAR)((value >> 24) & 0xFF);
82
1253670
}
83