Changes in kernel/generic/include/macros.h [4738d84:d99c1d2] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/macros.h
r4738d84 rd99c1d2 39 39 40 40 #include <typedefs.h> 41 #include <trace.h>42 41 43 42 /** Return true if the intervals overlap. … … 47 46 * @param s2 Start address of the second interval. 48 47 * @param sz2 Size of the second interval. 49 *50 48 */ 51 NO_TRACE static inline int overlaps(uint64_t s1, uint64_t sz1, uint64_t s2, 52 uint64_t sz2) 49 static inline int overlaps(uintptr_t s1, size_t sz1, uintptr_t s2, size_t sz2) 53 50 { 54 uint 64_t e1 = s1 + sz1;55 uint 64_t e2 = s2 + sz2;51 uintptr_t e1 = s1 + sz1; 52 uintptr_t e2 = s2 + sz2; 56 53 57 54 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));75 55 } 76 56 … … 92 72 93 73 /* Compute overlapping of physical addresses */ 94 #define PA_ OVERLAPS(x, szx, y, szy) \74 #define PA_overlaps(x, szx, y, szy) \ 95 75 overlaps(KA2PA((x)), (szx), KA2PA((y)), (szy)) 96 76
Note:
See TracChangeset
for help on using the changeset viewer.