diff options
author | Neelesh Gupta <neelegup@linux.vnet.ibm.com> | 2014-11-28 14:27:26 +0530 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2014-12-02 17:51:11 +1100 |
commit | 5819941efc10da9ddf9ce18f6249385eeebcaa6b (patch) | |
tree | 0bfd9da5f4550bb68fd6f6426e2e238dcb875ff8 /include | |
parent | b64d1426149d54e2926fab145d185f3c6fc8b4ed (diff) | |
download | skiboot-5819941efc10da9ddf9ce18f6249385eeebcaa6b.zip skiboot-5819941efc10da9ddf9ce18f6249385eeebcaa6b.tar.gz skiboot-5819941efc10da9ddf9ce18f6249385eeebcaa6b.tar.bz2 |
tce: Use TCE macros
Use available TCE mask and size macros to make the code readable
and easy to maintain.
Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com>
Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/skiboot.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/skiboot.h b/include/skiboot.h index d2e1be0..0991ca3 100644 --- a/include/skiboot.h +++ b/include/skiboot.h @@ -142,8 +142,9 @@ static inline bool is_pow2(unsigned long val) #define ALIGN_DOWN(_v, _a) ((_v) & ~((_a) - 1)) /* TCE alignment */ -#define TCE_PSIZE 0x1000 -#define TCE_MASK 0xfff +#define TCE_SHIFT 12 +#define TCE_PSIZE (1ul << 12) +#define TCE_MASK (TCE_PSIZE - 1) /* Not the greatest variants but will do for now ... */ #define MIN(a, b) ((a) < (b) ? (a) : (b)) |