Changeset 0941e9ae in mainline
- Timestamp:
- 2012-11-05T20:17:17Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 94795812
- Parents:
- 082b7f1
- Location:
- kernel/generic
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/macros.h
r082b7f1 r0941e9ae 130 130 | ((((uint64_t) (up)) & UINT32_C(0xffffffff)) << 32)) 131 131 132 /* Test for result wrap-around into positive numbers. */ 133 #define overflows_add(a, b) \ 134 (((a) + (b) < (a)) && ((a) + (b))) 135 132 136 /** Pseudorandom generator 133 137 * -
kernel/generic/src/mm/as.c
r082b7f1 r0941e9ae 299 299 ASSERT((addr % PAGE_SIZE) == 0); 300 300 ASSERT(mutex_locked(&as->lock)); 301 ASSERT(!overflows_add(addr, P2SZ(count))); 301 302 302 303 /* … … 513 514 if (size == 0) 514 515 return NULL; 515 516 516 517 size_t pages = SIZE2FRAMES(size); 517 518 … … 531 532 } 532 533 } 534 535 if (overflows_add(*base, size)) 536 return NULL; 533 537 534 538 if (!check_area_conflicts(as, *base, pages, guarded, NULL)) { … … 810 814 /* 811 815 * Growing the area. 816 */ 817 818 if (overflows_add(address, P2SZ(pages))) 819 return EINVAL; 820 821 /* 812 822 * Check for overlaps with other address space areas. 813 823 */
Note:
See TracChangeset
for help on using the changeset viewer.