Changeset 20235a3 in mainline for kernel/generic/include/macros.h
- Timestamp:
- 2010-09-02T20:55:28Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0c39b96
- Parents:
- 0c61955 (diff), 3249673 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/macros.h
r0c61955 r20235a3 47 47 * @param s2 Start address of the second interval. 48 48 * @param sz2 Size of the second interval. 49 * 49 50 */ 50 NO_TRACE static inline int overlaps(uint ptr_t s1, size_t sz1, uintptr_t s2,51 size_t sz2)51 NO_TRACE static inline int overlaps(uint64_t s1, uint64_t sz1, uint64_t s2, 52 uint64_t sz2) 52 53 { 53 uint ptr_t e1 = s1 + sz1;54 uint ptr_t e2 = s2 + sz2;54 uint64_t e1 = s1 + sz1; 55 uint64_t e2 = s2 + sz2; 55 56 56 57 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)); 57 75 } 58 76 … … 74 92 75 93 /* Compute overlapping of physical addresses */ 76 #define PA_ overlaps(x, szx, y, szy) \94 #define PA_OVERLAPS(x, szx, y, szy) \ 77 95 overlaps(KA2PA((x)), (szx), KA2PA((y)), (szy)) 78 96
Note:
See TracChangeset
for help on using the changeset viewer.