hv: clean up some header files
- move the contents in macros.h and stdarg.h to util.h - remove macros.h and stdarg.h Tracked-On: #861 Signed-off-by: Shiqing Gao <shiqing.gao@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
parent
5a996ce6a9
commit
83e7995d5d
|
@ -9,11 +9,9 @@
|
|||
|
||||
#include <types.h>
|
||||
#include <errno.h>
|
||||
#include <macros.h>
|
||||
#include <rtl.h>
|
||||
#include <spinlock.h>
|
||||
#include <mem_mgt.h>
|
||||
#include <stdarg.h>
|
||||
#include <util.h>
|
||||
#include <list.h>
|
||||
#include <atomic.h>
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
/*
|
||||
* 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 */
|
|
@ -1,15 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2018 Intel Corporation. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#ifndef STDARG_H
|
||||
#define STDARG_H
|
||||
|
||||
#include <types.h>
|
||||
|
||||
#define va_start __builtin_va_start
|
||||
#define va_end __builtin_va_end
|
||||
|
||||
#endif /* STDARG_H */
|
|
@ -8,6 +8,8 @@
|
|||
#define UTIL_H
|
||||
|
||||
#define offsetof(st, m) __builtin_offsetof(st, m)
|
||||
#define va_start __builtin_va_start
|
||||
#define va_end __builtin_va_end
|
||||
|
||||
/** Roundup (x/y) to ( x/y + (x%y) ? 1 : 0) **/
|
||||
#define INT_DIV_ROUNDUP(x, y) ((((x)+(y))-1)/(y))
|
||||
|
@ -16,4 +18,16 @@
|
|||
|
||||
#define max(x, y) ((x) < (y)) ? (y) : (x)
|
||||
|
||||
/** 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 /* UTIL_H */
|
||||
|
|
Loading…
Reference in New Issue