1 /************************************************************************
5 * (c) Copyright 2001-2003 Analog Devices, Inc. All rights reserved.
7 ************************************************************************/
9 /* Defines various assembly macros. */
14 #define LO(con32) ((con32) & 0xFFFF)
15 #define lo(con32) ((con32) & 0xFFFF)
16 #define HI(con32) (((con32) >> 16) & 0xFFFF)
17 #define hi(con32) (((con32) >> 16) & 0xFFFF)
20 * Set the corresponding bits in a System Register (SR);
21 * All bits set in "mask" will be set in the system register
22 * specified by "sys_reg" bitset_SR(sys_reg, mask), where
23 * sys_reg is the system register and mask are the bits to be set.
25 #define bitset_SR(sys_reg, mask)\
28 r6.l = (mask) & 0xffff;\
36 * Clear the corresponding bits in a System Register (SR);
37 * All bits set in "mask" will be cleared in the SR
38 * specified by "sys_reg" bitclr_SR(sys_reg, mask), where
39 * sys_reg is the SR and mask are the bits to be cleared.
41 #define bitclr_SR(sys_reg, mask)\
45 r6.l = (mask) & 0xffff;\
54 * Set the corresponding bits in a Memory Mapped Register (MMR);
55 * All bits set in "mask" will be set in the MMR specified by "mmr_reg"
56 * bitset_MMR(mmr_reg, mask), where mmr_reg is the MMR and mask are
59 #define bitset_MMR(mmr_reg, mask)\
62 p5.l = mmr_reg & 0xffff;\
63 p5.h = mmr_reg >> 16;\
65 r6.l = (mask) & 0xffff;\
74 * Clear the corresponding bits in a Memory Mapped Register (MMR);
75 * All bits set in "mask" will be cleared in the MMR specified by "mmr_reg"
76 * bitclr_MMRreg(mmr_reg, mask), where sys_reg is the MMR and mask are
77 * the bits to be cleared.
79 #define bitclr_MMR(mmr_reg, mask)\
82 p5.l = mmr_reg & 0xffff;\
83 p5.h = mmr_reg >> 16;\
86 r6.l = (mask) & 0xffff;\
95 #endif /* _MACROS_H */