Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset e662a5f in mainline


Ignore:
Timestamp:
2009-02-17T22:44:56Z (13 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial
Children:
96e0748d
Parents:
6bf612b
Message:

add min and max macros

Location:
boot/generic
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • boot/generic/align.h

    r6bf612b re662a5f  
    2727 */
    2828
    29 /** @addtogroup generic 
     29/** @addtogroup generic
    3030 * @{
    3131 */
  • boot/generic/macros.h

    r6bf612b re662a5f  
    3636#define BOOT_MACROS_H_
    3737
    38 #define SIZE2KB(size) ((size) >> 10)
    39 #define SIZE2MB(size) ((size) >> 20)
     38#define min(a, b)  ((a) < (b) ? (a) : (b))
     39#define max(a, b)  ((a) > (b) ? (a) : (b))
    4040
    41 #define KB2SIZE(kb) ((kb) << 10)
    42 #define MB2SIZE(mb) ((mb) << 20)
     41#define SIZE2KB(size)  ((size) >> 10)
     42#define SIZE2MB(size)  ((size) >> 20)
    4343
    44 #define STRING(arg) STRING_ARG(arg)
    45 #define STRING_ARG(arg) #arg
     44#define KB2SIZE(kb)  ((kb) << 10)
     45#define MB2SIZE(mb)  ((mb) << 20)
     46
     47#define STRING(arg)      STRING_ARG(arg)
     48#define STRING_ARG(arg)  #arg
    4649
    4750#endif
Note: See TracChangeset for help on using the changeset viewer.