Changeset b87f418 in mainline for generic/include


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.

Location:
generic/include
Files:
2 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
  • generic/include/mm/frame.h

    r4acac843 rb87f418  
    4646#define FRAME_INDEX(zone, frame)                ((index_t)((frame) - (zone)->frames))
    4747#define FRAME_INDEX_VALID(zone, index)          (((index) >= 0) && ((index) < ((zone)->free_count + (zone)->busy_count)))
    48 #define IS_BUDDY_LEFT_BLOCK(zone, frame)        ((FRAME_INDEX((zone), (frame)) & ~(((__native) -1)<<((frame)->buddy_order + 1))) == 0)
     48#define IS_BUDDY_ORDER_OK(index, order)         ((~(((__native) -1) << (order)) & (index)) == 0)
     49#define IS_BUDDY_LEFT_BLOCK(zone, frame)        (((FRAME_INDEX((zone), (frame)) >> (frame)->buddy_order) & 0x1) == 0)
     50#define IS_BUDDY_RIGHT_BLOCK(zone, frame)       (((FRAME_INDEX((zone), (frame)) >> (frame)->buddy_order) & 0x1) == 1)
    4951
    5052#define ZONE_BLACKLIST_SIZE     3
Note: See TracChangeset for help on using the changeset viewer.