Changeset f62355a in mainline
- Timestamp:
- 2005-12-07T23:38:53Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9d5e23c
- Parents:
- b87f418
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
generic/include/align.h
rb87f418 rf62355a 30 30 #define __ALIGN_H__ 31 31 32 /** Align to the nearest lower address. 33 * 34 * @param s Address or size to be aligned. 35 * @param a Size of alignment, must be power of 2. 36 */ 37 #define ALIGN_DOWN(s, a) ((s) & ~((a) - 1)) 38 39 32 40 /** Align to the nearest higher address. 33 41 * 34 42 * @param s Address or size to be aligned. 35 * @param a Size of alignment .43 * @param a Size of alignment, must be power of 2. 36 44 */ 37 #define ALIGN_UP(s, a) ((s) % (a) ? (((s) / (a)) + 1) * (a) : (s)) 38 39 /** Align to the nearest lower address. 40 * 41 * @param s Address or size to be aligned. 42 * @param a Size of alignment. 43 */ 44 #define ALIGN_DOWN(s, a) ((s) & ~((a)-1)) 45 #define ALIGN_UP(s, a) ((s + ((a) - 1)) & ~((a) - 1)) 45 46 46 47 #endif
Note:
See TracChangeset
for help on using the changeset viewer.