Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/macros.h

    r052f535 r8f4bc1f  
    3838#ifndef __ASM__
    3939
    40 #include <typedefs.h>
    41 #include <trace.h>
     40#include <arch/types.h>
    4241
    4342/** Return true if the intervals overlap.
     
    4746 * @param s2  Start address of the second interval.
    4847 * @param sz2 Size of the second interval.
    49  *
    5048 */
    51 NO_TRACE static inline int overlaps(uint64_t s1, uint64_t sz1, uint64_t s2,
    52     uint64_t sz2)
     49static inline int overlaps(uintptr_t s1, size_t sz1, uintptr_t s2, size_t sz2)
    5350{
    54         uint64_t e1 = s1 + sz1;
    55         uint64_t e2 = s2 + sz2;
     51        uintptr_t e1 = s1 + sz1;
     52        uintptr_t e2 = s2 + sz2;
    5653       
    5754        return ((s1 < e2) && (s2 < e1));
    58 }
    59 
    60 /** Return true if the second interval is within the first interval.
    61  *
    62  * @param s1  Start address of the first interval.
    63  * @param sz1 Size of the first interval.
    64  * @param s2  Start address of the second interval.
    65  * @param sz2 Size of the second interval.
    66  *
    67  */
    68 NO_TRACE static inline int iswithin(uint64_t s1, uint64_t sz1, uint64_t s2,
    69     uint64_t sz2)
    70 {
    71         uint64_t e1 = s1 + sz1;
    72         uint64_t e2 = s2 + sz2;
    73        
    74         return ((s1 <= s2) && (e1 >= e2));
    7555}
    7656
     
    9272
    9373/* Compute overlapping of physical addresses */
    94 #define PA_OVERLAPS(x, szx, y, szy) \
     74#define PA_overlaps(x, szx, y, szy) \
    9575        overlaps(KA2PA((x)), (szx), KA2PA((y)), (szy))
    9676
     
    10484#define STRING_ARG(arg)  #arg
    10585
    106 #define LOWER32(arg)  (((uint64_t) (arg)) & UINT32_C(0xffffffff))
    107 #define UPPER32(arg)  (((((uint64_t) arg)) >> 32) & UINT32_C(0xffffffff))
     86#define LOWER32(arg)  ((arg) & 0xffffffff)
     87#define UPPER32(arg)  (((arg) >> 32) & 0xffffffff)
    10888
    10989#define MERGE_LOUP32(lo, up) \
    110         ((((uint64_t) (lo)) & UINT32_C(0xffffffff)) \
    111             | ((((uint64_t) (up)) & UINT32_C(0xffffffff)) << 32))
     90        ((((uint64_t) (lo)) & 0xffffffff) \
     91            | ((((uint64_t) (up)) & 0xffffffff) << 32))
    11292
    11393/** Pseudorandom generator
Note: See TracChangeset for help on using the changeset viewer.