Changeset b0c2075 in mainline for kernel/generic/src/ddi/ddi.c
- Timestamp:
- 2013-09-10T17:48:57Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 85147f3
- Parents:
- 86733f3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/ddi/ddi.c
r86733f3 rb0c2075 322 322 } 323 323 324 NO_TRACE static int dmamem_map_anonymous(size_t size, unsigned int map_flags, 325 unsigned int flags, uintptr_t *phys, uintptr_t *virt, uintptr_t bound) 324 NO_TRACE static int dmamem_map_anonymous(size_t size, uintptr_t constraint, 325 unsigned int map_flags, unsigned int flags, uintptr_t *phys, 326 uintptr_t *virt, uintptr_t bound) 326 327 { 327 328 ASSERT(TASK); 328 329 329 330 size_t frames = SIZE2FRAMES(size); 330 uint8_t order; 331 332 /* We need the 2^order >= frames */ 333 if (frames == 1) 334 order = 0; 335 else 336 order = fnzb(frames - 1) + 1; 337 338 *phys = frame_alloc_noreserve(order, 0, 0); 331 *phys = frame_alloc_noreserve(frames, 0, constraint); 339 332 if (*phys == 0) 340 333 return ENOMEM; … … 390 383 */ 391 384 385 uintptr_t constraint; 386 int rc = copy_from_uspace(&constraint, phys_ptr, 387 sizeof(constraint)); 388 if (rc != EOK) 389 return rc; 390 392 391 uintptr_t phys; 393 392 uintptr_t virt = (uintptr_t) -1; 394 int rc = dmamem_map_anonymous(size, map_flags, flags,393 rc = dmamem_map_anonymous(size, constraint, map_flags, flags, 395 394 &phys, &virt, bound); 396 395 if (rc != EOK)
Note:
See TracChangeset
for help on using the changeset viewer.