Changeset b87f418 in mainline for generic/include/align.h


Ignore:
Timestamp:
2005-12-07T23:00:30Z (20 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f62355a
Parents:
4acac843
Message:

Send in some improvements.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • generic/include/align.h

    r4acac843 rb87f418  
    3030#define __ALIGN_H__
    3131
    32 #define ALIGN(s, a)     ((s) % (a) ? (((s) / (a)) + 1) * (a) : (s))
     32/** Align to the nearest higher address.
     33 *
     34 * @param s Address or size to be aligned.
     35 * @param a Size of alignment.
     36 */
     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))
    3345
    3446#endif
Note: See TracChangeset for help on using the changeset viewer.