* include/utility.h: New file.
This commit is contained in:
Joel Sherrill
2008-09-23 14:07:05 +00:00
parent 13995d18a6
commit d126b32055
2 changed files with 58 additions and 0 deletions

View File

@@ -1,3 +1,7 @@
2008-09-23 Sebastian Huber <sebastian.huber@embedded-brains.de>
* include/utility.h: New file.
2008-09-22 Joel Sherrill <joel.sherrill@oarcorp.com>
* bspclean.c, include/bootcard.h: Use standardized bsp_cleanup() which

View File

@@ -0,0 +1,54 @@
/**
* @file
*
* @brief Utility definitions and functions.
*/
/*
* Copyright (c) 2008
* Embedded Brains GmbH
* Obere Lagerstr. 30
* D-82178 Puchheim
* Germany
* rtems@embedded-brains.de
*
* The license and distribution terms for this file may be found in the file
* LICENSE in this distribution or at http://www.rtems.com/license/LICENSE.
*/
#ifndef LIBCPU_SHARED_UTILITY_H
#define LIBCPU_SHARED_UTILITY_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define GET_REG_FIELD( reg, mask, shift) \
(((reg) & (mask)) >> (shift))
#define SET_REG_FIELD( reg, val, mask, shift) \
(((reg) & ~(mask)) | (((val) << (shift)) & (mask)))
#define REG_FLAG_IS_SET( reg, flag) \
(((reg) & (flag)) != 0)
#define REG_FLAG_IS_CLEARED( reg, flag) \
(((reg) & (flag)) == 0)
#define SET_REG_FLAG( reg, flag) \
((reg) | (flag))
#define CLEAR_REG_FLAG( reg, flag) \
((reg) & ~(flag))
#define SET_REG_FLAGS( reg, flags, mask) \
(((reg) & ~(mask)) | (flags))
#define CLEAR_REG_FLAGS( reg, flags) \
((reg) & ~(flags))
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* LIBCPU_SHARED_UTILITY_H */