diff --git a/src/add-ons/kernel/drivers/audio/ice1712/util.cpp b/src/add-ons/kernel/drivers/audio/ice1712/util.cpp
index 01a172e..b091e32 100644
a
|
b
|
|
12 | 12 | #include <OS.h> |
13 | 13 | #include <string.h> |
14 | 14 | |
| 15 | #include <vm/vm.h> |
| 16 | #include <vm/VMAddressSpace.h> |
| 17 | |
15 | 18 | #include "debug.h" |
16 | 19 | #include "util.h" |
17 | 20 | |
18 | 21 | static spinlock slock = B_SPINLOCK_INITIALIZER; |
19 | | static uint32 round_to_pagesize(uint32 size); |
20 | 22 | |
21 | 23 | cpu_status |
22 | 24 | lock(void) |
… |
… |
unlock(cpu_status status)
|
35 | 37 | } |
36 | 38 | |
37 | 39 | |
38 | | uint32 |
39 | | round_to_pagesize(uint32 size) |
40 | | { |
41 | | return (size + B_PAGE_SIZE - 1) & ~(B_PAGE_SIZE - 1); |
42 | | } |
43 | | |
44 | | |
45 | 40 | area_id |
46 | 41 | alloc_mem(physical_entry *phy, addr_t *log, size_t size, const char *name) |
47 | 42 | { |
48 | 43 | void * logadr; |
49 | 44 | area_id areaid; |
50 | 45 | status_t rv; |
| 46 | team_id teamid = VMAddressSpace::KernelID(); |
| 47 | virtual_address_restrictions virtual_add = {}; |
| 48 | physical_address_restrictions phys_add = {}; |
| 49 | phys_add.high_address = 1 << 28; |
| 50 | // ICE1712 chipset can not deal with memory area beyond 256MB |
51 | 51 | |
52 | 52 | ITRACE("Allocating %s: ", name); |
53 | 53 | |
54 | | size = round_to_pagesize(size); |
55 | | areaid = create_area(name, &logadr, B_ANY_KERNEL_ADDRESS, size, |
56 | | B_32_BIT_CONTIGUOUS, B_READ_AREA | B_WRITE_AREA); |
57 | | // TODO: The rest of the code doesn't deal correctly with physical |
58 | | // addresses > 4 GB, so we have to force 32 bit addresses here. |
| 54 | areaid = vm_create_anonymous_area(teamid, name, size, B_CONTIGUOUS, |
| 55 | B_READ_AREA | B_WRITE_AREA, 0, B_PAGE_SIZE, |
| 56 | &virtual_add, &phys_add, true, &logadr); |
| 57 | |
59 | 58 | if (areaid < B_OK) { |
60 | 59 | ITRACE("couldn't allocate\n"); |
61 | 60 | return B_ERROR; |