Changeset 19e6dfa in rtems


Ignore:
Timestamp:
Sep 30, 2008, 10:02:41 AM (11 years ago)
Author:
Thomas Doerfler <Thomas.Doerfler@…>
Branches:
4.10, 4.11, master
Children:
a12796f3
Parents:
29cc1477
Message:

Renamed various macros.

Location:
c/src/lib/libbsp/shared
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/shared/ChangeLog

    r29cc1477 r19e6dfa  
     12008-09-30      Sebastian Huber <sebastian.huber@embedded-brains.de>
     2
     3        * include/utility.h: Renamed various macros.
     4
    152008-09-30      Ralf Corsepius <ralf.corsepius@rtems.org>
    26
  • c/src/lib/libbsp/shared/include/utility.h

    r29cc1477 r19e6dfa  
    2424#endif /* __cplusplus */
    2525
    26 #define GET_REG_FIELD( reg, mask, shift) \
    27   (((reg) & (mask)) >> (shift))
     26#define GET_FIELD( val, mask, shift) \
     27  (((val) & (mask)) >> (shift))
    2828
    29 #define SET_REG_FIELD( reg, val, mask, shift) \
    30   (((reg) & ~(mask)) | (((val) << (shift)) & (mask)))
     29#define SET_FIELD( val, field, mask, shift) \
     30  (((val) & ~(mask)) | (((field) << (shift)) & (mask)))
    3131
    32 #define REG_FLAG_IS_SET( reg, flag) \
    33   (((reg) & (flag)) != 0)
     32#define CLEAR_FIELD( val, mask) \
     33  ((val) & ~(mask))
    3434
    35 #define REG_FLAG_IS_CLEARED( reg, flag) \
    36   (((reg) & (flag)) == 0)
     35#define IS_FLAG_SET( val, flag) \
     36  (((val) & (flag)) != 0)
    3737
    38 #define SET_REG_FLAG( reg, flag) \
    39   ((reg) | (flag))
     38#define IS_FLAG_CLEARED( val, flag) \
     39  (((val) & (flag)) == 0)
    4040
    41 #define CLEAR_REG_FLAG( reg, flag) \
    42   ((reg) & ~(flag))
     41#define ARE_FLAGS_SET( val, flags) \
     42  (((val) & (flags)) == (flags))
    4343
    44 #define SET_REG_FLAGS( reg, flags, mask) \
    45   (((reg) & ~(mask)) | (flags))
     44#define ARE_FLAGS_CLEARED( val, flags) \
     45  (((val) & (flags)) == 0)
    4646
    47 #define CLEAR_REG_FLAGS( reg, flags) \
    48   ((reg) & ~(flags))
     47#define SET_FLAG( val, flag) \
     48  ((val) | (flag))
     49
     50#define CLEAR_FLAG( val, flag) \
     51  ((val) & ~(flag))
     52
     53#define SET_FLAGS( val, flags) \
     54  ((val) | (flags))
     55
     56#define CLEAR_FLAGS( val, flags) \
     57  ((val) & ~(flags))
    4958
    5059#ifdef __cplusplus
Note: See TracChangeset for help on using the changeset viewer.