Force memory allocations to 32 bit physical addresses. The code using them
has implicit limitations (probably because the devices/controllers/... do). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37213 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -46,8 +46,10 @@ alloc_mem(void **virt, void **phy, size_t size, uint32 protection,
|
|||||||
TRACE("allocating %ld bytes for %s\n", size, name);
|
TRACE("allocating %ld bytes for %s\n", size, name);
|
||||||
|
|
||||||
size = round_to_pagesize(size);
|
size = round_to_pagesize(size);
|
||||||
area = create_area(name, &virtadr, B_ANY_KERNEL_ADDRESS, size, B_CONTIGUOUS,
|
area = create_area(name, &virtadr, B_ANY_KERNEL_ADDRESS, size,
|
||||||
protection);
|
B_32_BIT_MEMORY, protection);
|
||||||
|
// TODO: The rest of the code doesn't deal correctly with physical
|
||||||
|
// addresses > 4 GB, so we have to force 32 bit addresses here.
|
||||||
if (area < B_OK) {
|
if (area < B_OK) {
|
||||||
ERROR("couldn't allocate area %s\n", name);
|
ERROR("couldn't allocate area %s\n", name);
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
|
|||||||
@@ -43,7 +43,9 @@ alloc_mem(void **phy, void **log, size_t size, const char *name)
|
|||||||
|
|
||||||
size = round_to_pagesize(size);
|
size = round_to_pagesize(size);
|
||||||
areaid = create_area(name, &logadr, B_ANY_KERNEL_ADDRESS, size,
|
areaid = create_area(name, &logadr, B_ANY_KERNEL_ADDRESS, size,
|
||||||
B_CONTIGUOUS, B_READ_AREA | B_WRITE_AREA);
|
B_32_BIT_MEMORY, B_READ_AREA | B_WRITE_AREA);
|
||||||
|
// TODO: The rest of the code doesn't deal correctly with physical
|
||||||
|
// addresses > 4 GB, so we have to force 32 bit addresses here.
|
||||||
if (areaid < B_OK) {
|
if (areaid < B_OK) {
|
||||||
TRACE("alloc_mem: couldn't allocate area %s\n", name);
|
TRACE("alloc_mem: couldn't allocate area %s\n", name);
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
|
|||||||
@@ -74,8 +74,10 @@ alloc_mem(phys_addr_t *phy, void **log, size_t size, const char *name)
|
|||||||
LOG(("allocating %d bytes for %s\n",size,name));
|
LOG(("allocating %d bytes for %s\n",size,name));
|
||||||
|
|
||||||
size = round_to_pagesize(size);
|
size = round_to_pagesize(size);
|
||||||
area = create_area(name, &logadr, B_ANY_KERNEL_ADDRESS, size, B_CONTIGUOUS,
|
area = create_area(name, &logadr, B_ANY_KERNEL_ADDRESS, size,
|
||||||
B_READ_AREA | B_WRITE_AREA);
|
B_32_BIT_MEMORY, B_READ_AREA | B_WRITE_AREA);
|
||||||
|
// TODO: The rest of the code doesn't deal correctly with physical
|
||||||
|
// addresses > 4 GB, so we have to force 32 bit addresses here.
|
||||||
if (area < B_OK) {
|
if (area < B_OK) {
|
||||||
PRINT(("couldn't allocate area %s\n", name));
|
PRINT(("couldn't allocate area %s\n", name));
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
|
|||||||
@@ -76,7 +76,9 @@ alloc_mem(void **phy, void **log, size_t size, const char *name)
|
|||||||
|
|
||||||
size = round_to_pagesize(size);
|
size = round_to_pagesize(size);
|
||||||
areaid = create_area(name, &logadr, B_ANY_KERNEL_ADDRESS, size,
|
areaid = create_area(name, &logadr, B_ANY_KERNEL_ADDRESS, size,
|
||||||
B_CONTIGUOUS, B_READ_AREA | B_WRITE_AREA);
|
B_32_BIT_MEMORY, B_READ_AREA | B_WRITE_AREA);
|
||||||
|
// TODO: The rest of the code doesn't deal correctly with physical
|
||||||
|
// addresses > 4 GB, so we have to force 32 bit addresses here.
|
||||||
if (areaid < B_OK) {
|
if (areaid < B_OK) {
|
||||||
PRINT(("couldn't allocate area %s\n",name));
|
PRINT(("couldn't allocate area %s\n",name));
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
|
|||||||
@@ -76,7 +76,9 @@ alloc_mem(void **phy, void **log, size_t size, const char *name)
|
|||||||
|
|
||||||
size = round_to_pagesize(size);
|
size = round_to_pagesize(size);
|
||||||
areaid = create_area(name, &logadr, B_ANY_KERNEL_ADDRESS, size,
|
areaid = create_area(name, &logadr, B_ANY_KERNEL_ADDRESS, size,
|
||||||
B_CONTIGUOUS, B_READ_AREA | B_WRITE_AREA);
|
B_32_BIT_MEMORY, B_READ_AREA | B_WRITE_AREA);
|
||||||
|
// TODO: The rest of the code doesn't deal correctly with physical
|
||||||
|
// addresses > 4 GB, so we have to force 32 bit addresses here.
|
||||||
if (areaid < B_OK) {
|
if (areaid < B_OK) {
|
||||||
PRINT(("couldn't allocate area %s\n",name));
|
PRINT(("couldn't allocate area %s\n",name));
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
|
|||||||
@@ -306,7 +306,10 @@ geode_stream_setup_buffers(geode_stream* stream, const char* desc)
|
|||||||
|
|
||||||
/* Allocate memory for buffers */
|
/* Allocate memory for buffers */
|
||||||
stream->buffer_area = create_area("geode buffers", (void**)&buffer,
|
stream->buffer_area = create_area("geode buffers", (void**)&buffer,
|
||||||
B_ANY_KERNEL_ADDRESS, alloc, B_CONTIGUOUS, B_READ_AREA | B_WRITE_AREA);
|
B_ANY_KERNEL_ADDRESS, alloc, B_32_BIT_MEMORY,
|
||||||
|
B_READ_AREA | B_WRITE_AREA);
|
||||||
|
// TODO: The rest of the code doesn't deal correctly with physical
|
||||||
|
// addresses > 4 GB, so we have to force 32 bit addresses here.
|
||||||
if (stream->buffer_area < B_OK)
|
if (stream->buffer_area < B_OK)
|
||||||
return stream->buffer_area;
|
return stream->buffer_area;
|
||||||
|
|
||||||
@@ -335,7 +338,9 @@ geode_stream_setup_buffers(geode_stream* stream, const char* desc)
|
|||||||
|
|
||||||
stream->buffer_descriptors_area = create_area("geode buffer descriptors",
|
stream->buffer_descriptors_area = create_area("geode buffer descriptors",
|
||||||
(void**)&bufferDescriptors, B_ANY_KERNEL_ADDRESS, alloc,
|
(void**)&bufferDescriptors, B_ANY_KERNEL_ADDRESS, alloc,
|
||||||
B_CONTIGUOUS, 0);
|
B_32_BIT_MEMORY, 0);
|
||||||
|
// TODO: The rest of the code doesn't deal correctly with physical
|
||||||
|
// addresses > 4 GB, so we have to force 32 bit addresses here.
|
||||||
if (stream->buffer_descriptors_area < B_OK) {
|
if (stream->buffer_descriptors_area < B_OK) {
|
||||||
delete_area(stream->buffer_area);
|
delete_area(stream->buffer_area);
|
||||||
return stream->buffer_descriptors_area;
|
return stream->buffer_descriptors_area;
|
||||||
|
|||||||
@@ -76,7 +76,9 @@ alloc_mem(void **log, void **phy, size_t size, const char *name)
|
|||||||
|
|
||||||
size = round_to_pagesize(size);
|
size = round_to_pagesize(size);
|
||||||
areaid = create_area(name, &logadr, B_ANY_KERNEL_ADDRESS, size,
|
areaid = create_area(name, &logadr, B_ANY_KERNEL_ADDRESS, size,
|
||||||
B_CONTIGUOUS, B_READ_AREA | B_WRITE_AREA);
|
B_32_BIT_MEMORY, B_READ_AREA | B_WRITE_AREA);
|
||||||
|
// TODO: The rest of the code doesn't deal correctly with physical
|
||||||
|
// addresses > 4 GB, so we have to force 32 bit addresses here.
|
||||||
if (areaid < B_OK) {
|
if (areaid < B_OK) {
|
||||||
PRINT(("couldn't allocate area %s\n",name));
|
PRINT(("couldn't allocate area %s\n",name));
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
|
|||||||
@@ -57,7 +57,9 @@ alloc_mem(void **virt, void **phy, size_t size, uint32 protection,
|
|||||||
|
|
||||||
size = round_to_pagesize(size);
|
size = round_to_pagesize(size);
|
||||||
areaid = create_area(name, &virtadr, B_ANY_KERNEL_ADDRESS, size,
|
areaid = create_area(name, &virtadr, B_ANY_KERNEL_ADDRESS, size,
|
||||||
B_CONTIGUOUS, protection);
|
B_32_BIT_MEMORY, protection);
|
||||||
|
// TODO: The rest of the code doesn't deal correctly with physical
|
||||||
|
// addresses > 4 GB, so we have to force 32 bit addresses here.
|
||||||
if (areaid < B_OK) {
|
if (areaid < B_OK) {
|
||||||
PRINT(("couldn't allocate area %s\n",name));
|
PRINT(("couldn't allocate area %s\n",name));
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
|
|||||||
@@ -74,8 +74,10 @@ alloc_mem(phys_addr_t *phy, void **log, size_t size, const char *name)
|
|||||||
LOG(("allocating %d bytes for %s\n",size,name));
|
LOG(("allocating %d bytes for %s\n",size,name));
|
||||||
|
|
||||||
size = round_to_pagesize(size);
|
size = round_to_pagesize(size);
|
||||||
area = create_area(name, &logadr, B_ANY_KERNEL_ADDRESS, size, B_CONTIGUOUS,
|
area = create_area(name, &logadr, B_ANY_KERNEL_ADDRESS, size,
|
||||||
B_READ_AREA | B_WRITE_AREA);
|
B_32_BIT_MEMORY, B_READ_AREA | B_WRITE_AREA);
|
||||||
|
// TODO: The rest of the code doesn't deal correctly with physical
|
||||||
|
// addresses > 4 GB, so we have to force 32 bit addresses here.
|
||||||
if (area < B_OK) {
|
if (area < B_OK) {
|
||||||
PRINT(("couldn't allocate area %s\n",name));
|
PRINT(("couldn't allocate area %s\n",name));
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
|
|||||||
@@ -76,7 +76,9 @@ alloc_mem(void **phy, void **log, size_t size, const char *name)
|
|||||||
|
|
||||||
size = round_to_pagesize(size);
|
size = round_to_pagesize(size);
|
||||||
areaid = create_area(name, &logadr, B_ANY_KERNEL_ADDRESS, size,
|
areaid = create_area(name, &logadr, B_ANY_KERNEL_ADDRESS, size,
|
||||||
B_CONTIGUOUS, B_READ_AREA | B_WRITE_AREA);
|
B_32_BIT_MEMORY, B_READ_AREA | B_WRITE_AREA);
|
||||||
|
// TODO: The rest of the code doesn't deal correctly with physical
|
||||||
|
// addresses > 4 GB, so we have to force 32 bit addresses here.
|
||||||
if (areaid < B_OK) {
|
if (areaid < B_OK) {
|
||||||
PRINT(("couldn't allocate area %s\n",name));
|
PRINT(("couldn't allocate area %s\n",name));
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
|
|||||||
@@ -58,7 +58,9 @@ alloc_mem(void **phy, void **log, size_t size, const char *name)
|
|||||||
|
|
||||||
size = round_to_pagesize(size);
|
size = round_to_pagesize(size);
|
||||||
areaid = create_area(name, &logadr, B_ANY_KERNEL_ADDRESS, size,
|
areaid = create_area(name, &logadr, B_ANY_KERNEL_ADDRESS, size,
|
||||||
B_CONTIGUOUS, B_READ_AREA | B_WRITE_AREA);
|
B_32_BIT_MEMORY, B_READ_AREA | B_WRITE_AREA);
|
||||||
|
// TODO: The rest of the code doesn't deal correctly with physical
|
||||||
|
// addresses > 4 GB, so we have to force 32 bit addresses here.
|
||||||
if (areaid < B_OK) {
|
if (areaid < B_OK) {
|
||||||
TRACE("couldn't allocate area %s\n",name);
|
TRACE("couldn't allocate area %s\n",name);
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
|
|||||||
@@ -81,7 +81,9 @@ alloc_mem(void **virt, void **phy, size_t size, uint32 protection,
|
|||||||
|
|
||||||
size = ROUNDUP(size, B_PAGE_SIZE);
|
size = ROUNDUP(size, B_PAGE_SIZE);
|
||||||
areaid = create_area(name, &virtadr, B_ANY_KERNEL_ADDRESS, size,
|
areaid = create_area(name, &virtadr, B_ANY_KERNEL_ADDRESS, size,
|
||||||
B_CONTIGUOUS, protection);
|
B_32_BIT_MEMORY, protection);
|
||||||
|
// TODO: The rest of the code doesn't deal correctly with physical
|
||||||
|
// addresses > 4 GB, so we have to force 32 bit addresses here.
|
||||||
if (areaid < B_OK) {
|
if (areaid < B_OK) {
|
||||||
TRACE("couldn't allocate area %s\n", name);
|
TRACE("couldn't allocate area %s\n", name);
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
|
|||||||
Reference in New Issue
Block a user