mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-05-02 05:34:04 +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>
20 lines
401 B
C
20 lines
401 B
C
/*
|
|
* Copyright (C) 2018 Intel Corporation. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
#ifndef UTIL_H
|
|
#define UTIL_H
|
|
|
|
#define offsetof(st, m) __builtin_offsetof(st, m)
|
|
|
|
/** Roundup (x/y) to ( x/y + (x%y) ? 1 : 0) **/
|
|
#define INT_DIV_ROUNDUP(x, y) ((((x)+(y))-1)/(y))
|
|
|
|
#define min(x, y) ((x) < (y)) ? (x) : (y)
|
|
|
|
#define max(x, y) ((x) < (y)) ? (y) : (x)
|
|
|
|
#endif /* UTIL_H */
|