Changes in kernel/generic/include/align.h [096c0786:174156fd] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/align.h
r096c0786 r174156fd 39 39 #define KERN_ALIGN_H_ 40 40 41 #ifdef __ASSEMBLER__42 #define ALIGN_DOWN(s, a) ((s) & ~((a) - 1))43 #define ALIGN_UP(s, a) (((s) + ((a) - 1)) & ~((a) - 1))44 #else45 46 41 /** Align to the nearest lower address. 47 42 * … … 49 44 * @param a Size of alignment, must be a power of 2. 50 45 */ 51 #define ALIGN_DOWN(s, a) ((s) & ~(( typeof(s))(a) - 1))46 #define ALIGN_DOWN(s, a) ((s) & ~((a) - 1)) 52 47 53 48 /** Align to the nearest higher address. … … 56 51 * @param a Size of alignment, must be a power of 2. 57 52 */ 58 #define ALIGN_UP(s, a) (((s) + ((a) - 1)) & ~((typeof(s))(a) - 1)) 59 60 #endif 53 #define ALIGN_UP(s, a) (((s) + ((a) - 1)) & ~((a) - 1)) 61 54 62 55 /** Check alignment.
Note:
See TracChangeset
for help on using the changeset viewer.