Changeset c621f4aa in mainline for boot/generic/include/align.h


Ignore:
Timestamp:
2010-07-25T10:11:13Z (15 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
377cce8
Parents:
24a2517 (diff), a2da43c (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.
Message:

Merge with mainline.

File:
1 moved

Legend:

Unmodified
Added
Removed
  • boot/generic/include/align.h

    r24a2517 rc621f4aa  
    11/*
    2  * Copyright (c) 2006 Jakub Jermar
     2 * Copyright (c) 2005 Jakub Jermar
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup generic
    30  * @{
    31  */
    32 /** @file
     29/**
     30 * @file
     31 * @brief Macros for making values and addresses aligned.
    3332 */
    3433
     
    3635#define BOOT_ALIGN_H_
    3736
     37/** Align to the nearest lower address.
     38 *
     39 * @param s Address or size to be aligned.
     40 * @param a Size of alignment, must be power of 2.
     41 */
     42#define ALIGN_DOWN(s, a)  ((s) & ~((a) - 1))
     43
    3844/** Align to the nearest higher address.
    3945 *
    40  * @param addr Address or size to be aligned.
    41  * @param align Size of alignment, must be power of 2.
     46 * @param s Address or size to be aligned.
     47 * @param a Size of alignment, must be power of 2.
    4248 */
    43 #define ALIGN_UP(addr, align) (((addr) + ((align) - 1)) & ~((align) - 1))
     49#define ALIGN_UP(s, a)  (((s) + ((a) - 1)) & ~((a) - 1))
    4450
    4551#endif
Note: See TracChangeset for help on using the changeset viewer.