GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: fx_utility_64_unsigned_read.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_64_unsigned_read                        PORTABLE C      */
38
/*                                                           6.1          */
39
/*  AUTHOR                                                                */
40
/*                                                                        */
41
/*    William E. Lamie, Microsoft Corporation                             */
42
/*                                                                        */
43
/*  DESCRIPTION                                                           */
44
/*                                                                        */
45
/*    This function reads (with endian awareness) a 64-bit unsigned data  */
46
/*    from the specified source and returns the value to the caller.      */
47
/*                                                                        */
48
/*  INPUT                                                                 */
49
/*                                                                        */
50
/*    source_ptr                            Source memory pointer         */
51
/*                                                                        */
52
/*  OUTPUT                                                                */
53
/*                                                                        */
54
/*    ULONG64 value                                                       */
55
/*                                                                        */
56
/*  CALLS                                                                 */
57
/*                                                                        */
58
/*    None                                                                */
59
/*                                                                        */
60
/*  CALLED BY                                                             */
61
/*                                                                        */
62
/*    FileX System Functions                                              */
63
/*                                                                        */
64
/*  RELEASE HISTORY                                                       */
65
/*                                                                        */
66
/*    DATE              NAME                      DESCRIPTION             */
67
/*                                                                        */
68
/*  05-19-2020     William E. Lamie         Initial Version 6.0           */
69
/*  09-30-2020     William E. Lamie         Modified comment(s),          */
70
/*                                            resulting in version 6.1    */
71
/*                                                                        */
72
/**************************************************************************/
73
1
ULONG64  _fx_utility_64_unsigned_read(UCHAR *source_ptr)
74
{
75
76
ULONG64 value;
77
ULONG   upper_portion;
78
ULONG   lower_portion;
79
80
81
1
    lower_portion = _fx_utility_32_unsigned_read(source_ptr);
82
1
    upper_portion = _fx_utility_32_unsigned_read(source_ptr + sizeof(ULONG));
83
84
1
    value =  ((ULONG64)upper_portion) << 32;
85
1
    value |= (ULONG64)lower_portion;
86
87
    /* Return 64-bit value to caller.  */
88
1
    return(value);
89
}
90