mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-05-03 05:56:57 +00:00
- convert function like macros to inline functions based on MISRA-C requirement - remove some unused and duplicated macros Tracked-On: #861 Signed-off-by: Shiqing Gao <shiqing.gao@intel.com> Reviewed-by: Junjie Mao <junjie.mao@intel.com>
23 lines
576 B
C
23 lines
576 B
C
/*
|
|
* Copyright (C) 2018 Intel Corporation. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
#ifndef MACROS_H
|
|
#define MACROS_H
|
|
|
|
/** Replaces 'x' by the string "x". */
|
|
#define STRINGIFY(x) #x
|
|
|
|
/* Macro used to check if a value is aligned to the required boundary.
|
|
* Returns TRUE if aligned; FALSE if not aligned
|
|
* NOTE: The required alignment must be a power of 2 (2, 4, 8, 16, 32, etc)
|
|
*/
|
|
static inline bool mem_aligned_check(uint64_t value, uint64_t req_align)
|
|
{
|
|
return ((value & (req_align - 1UL)) == 0UL);
|
|
}
|
|
|
|
#endif /* INCLUDE_MACROS_H defined */
|