Changeset 7bf29e5 in mainline for kernel/generic/include/align.h
- Timestamp:
- 2025-01-09T11:29:38Z (7 months ago)
- Children:
- a5c2960e
- Parents:
- bc3d695 (diff), 4e1221c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/align.h
rbc3d695 r7bf29e5 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 #else 45 41 46 /** Align to the nearest lower address. 42 47 * … … 44 49 * @param a Size of alignment, must be a power of 2. 45 50 */ 46 #define ALIGN_DOWN(s, a) ((s) & ~(( a) - 1))51 #define ALIGN_DOWN(s, a) ((s) & ~((typeof(s))(a) - 1)) 47 52 48 53 /** Align to the nearest higher address. … … 51 56 * @param a Size of alignment, must be a power of 2. 52 57 */ 53 #define ALIGN_UP(s, a) (((s) + ((a) - 1)) & ~((a) - 1)) 58 #define ALIGN_UP(s, a) (((s) + ((a) - 1)) & ~((typeof(s))(a) - 1)) 59 60 #endif 54 61 55 62 /** Check alignment.
Note:
See TracChangeset
for help on using the changeset viewer.