Replaced B_32_BIT_MEMORY by B_32_BIT_FULL_LOCK and B_32_BIT_CONTIGUOUS, so

the constraint can be expressed more precisely. ATM B_32_BIT_FULL_LOCK is
implemented as B_32_BIT_CONTIGUOUS when B_HAIKU_PHYSICAL_BITS > 32, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37226 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2010-06-23 13:29:25 +00:00
parent 7b1d69ecbb
commit 9fb2d73772
38 changed files with 61 additions and 87 deletions
+2 -1
View File
@@ -69,7 +69,8 @@ typedef struct area_info {
#define B_FULL_LOCK 2
#define B_CONTIGUOUS 3
#define B_LOMEM 4 /* B_CONTIGUOUS, < 16 MB physical address */
#define B_32_BIT_MEMORY 5 /* B_CONTIGUOUS, < 4 GB physical address */
#define B_32_BIT_FULL_LOCK 5 /* B_FULL_LOCK, < 4 GB physical addresses */
#define B_32_BIT_CONTIGUOUS 6 /* B_CONTIGUOUS, < 4 GB physical address */
/* address spec for create_area(), and clone_area() */
#define B_ANY_ADDRESS 0
+3 -3
View File
@@ -53,9 +53,9 @@ enum {
};
enum {
// ToDo: these are here only temporarily - it's a private
// addition to the BeOS create_area() lock flags
B_ALREADY_WIRED = 6,
// TODO: these are here only temporarily - it's a private
// addition to the BeOS create_area() lock flags
B_ALREADY_WIRED = 7,
};
#define MEMORY_TYPE_SHIFT 28
@@ -47,7 +47,7 @@ alloc_mem(void **virt, void **phy, size_t size, uint32 protection,
size = round_to_pagesize(size);
area = create_area(name, &virtadr, B_ANY_KERNEL_ADDRESS, size,
B_32_BIT_MEMORY, protection);
B_32_BIT_CONTIGUOUS, 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) {
@@ -219,7 +219,7 @@ scsi_create_autosense_request(scsi_device_info *device)
// allocate buffer for space sense data and S/G list
device->auto_sense_area = create_area("auto_sense", (void**)&buffer,
B_ANY_KERNEL_ADDRESS, B_PAGE_SIZE, B_32_BIT_MEMORY, 0);
B_ANY_KERNEL_ADDRESS, B_PAGE_SIZE, B_32_BIT_FULL_LOCK, 0);
// TODO: Use B_FULL_LOCK, if addresses >= 4 GB are supported!
if (device->auto_sense_area < 0)
goto err;
@@ -208,15 +208,9 @@ scsi_alloc_dma_buffer(dma_buffer *buffer, dma_params *dma_params, uint32 size)
} else {
// we can live with a fragmented buffer - very nice
buffer->area = create_area("DMA buffer",
(void **)&buffer->address,
B_ANY_KERNEL_ADDRESS, size,
#if B_HAIKU_PHYSICAL_BITS > 32
B_32_BIT_MEMORY,
(void **)&buffer->address, B_ANY_KERNEL_ADDRESS, size,
B_32_BIT_FULL_LOCK, 0);
// TODO: Use B_FULL_LOCK, if possible!
#else
B_FULL_LOCK,
#endif
0);
if (buffer->area < 0) {
SHOW_ERROR(2, "Cannot create DMA buffer of %d bytes",
(int)size);
@@ -234,13 +228,8 @@ scsi_alloc_dma_buffer(dma_buffer *buffer, dma_params *dma_params, uint32 size)
buffer->sg_list_area = create_area("DMA buffer S/G table",
(void **)&buffer->sg_list, B_ANY_KERNEL_ADDRESS, sg_list_size,
#if B_HAIKU_PHYSICAL_BITS > 32
B_32_BIT_MEMORY,
B_32_BIT_FULL_LOCK, 0);
// TODO: Use B_FULL_LOCK, if possible!
#else
B_FULL_LOCK,
#endif
0);
if (buffer->sg_list_area < 0) {
SHOW_ERROR( 2, "Cannot craete DMA buffer S/G list of %d bytes",
(int)sg_list_size );
@@ -74,7 +74,7 @@ scsi_init_emulation_buffer(scsi_device_info *device, size_t buffer_size)
physical_address_restrictions physicalRestrictions = {};
physicalRestrictions.alignment = buffer_size;
device->buffer_area = create_area_etc(B_SYSTEM_TEAM, "ATAPI buffer",
total_size, B_32_BIT_MEMORY, 0, 0, &virtualRestrictions,
total_size, B_32_BIT_CONTIGUOUS, 0, 0, &virtualRestrictions,
&physicalRestrictions, &address);
// TODO: Use B_CONTIGUOUS, if possible!
@@ -75,7 +75,7 @@ PhysicalMemoryAllocator::PhysicalMemoryAllocator(const char *name,
roundedSize = (roundedSize + B_PAGE_SIZE - 1) & ~(B_PAGE_SIZE - 1);
fArea = create_area(fName, &fLogicalBase, B_ANY_KERNEL_ADDRESS,
roundedSize, B_32_BIT_MEMORY, B_READ_AREA | B_WRITE_AREA);
roundedSize, B_32_BIT_CONTIGUOUS, B_READ_AREA | B_WRITE_AREA);
// TODO: Use B_CONTIGUOUS when the TODOs regarding 64 bit physical
// addresses are fixed (if possible).
if (fArea < B_OK) {
@@ -300,7 +300,7 @@ Stack::AllocateArea(void **logicalAddress, void **physicalAddress, size_t size,
void *logAddress;
size = (size + B_PAGE_SIZE - 1) & ~(B_PAGE_SIZE - 1);
area_id area = create_area(name, &logAddress, B_ANY_KERNEL_ADDRESS, size,
B_32_BIT_MEMORY, 0);
B_32_BIT_CONTIGUOUS, 0);
// TODO: Use B_CONTIGUOUS when the TODOs regarding 64 bit physical
// addresses are fixed (if possible).
@@ -453,7 +453,7 @@ channel_init(device_node *node, void **_channelCookie)
// used.
prdtSize = (ATA_ADAPTER_MAX_SG_COUNT * sizeof(prd_entry) + (B_PAGE_SIZE - 1)) & ~(B_PAGE_SIZE - 1);
channel->prd_area = create_area("prd", (void **)&channel->prdt,
B_ANY_KERNEL_ADDRESS, prdtSize, B_32_BIT_MEMORY, 0);
B_ANY_KERNEL_ADDRESS, prdtSize, B_32_BIT_CONTIGUOUS, 0);
if (channel->prd_area < B_OK) {
TRACE("creating prd_area failed\n");
goto err;
@@ -458,7 +458,7 @@ channel_init(device_node *node, void **_channelCookie)
// used.
prdtSize = (IDE_ADAPTER_MAX_SG_COUNT * sizeof(prd_entry) + (B_PAGE_SIZE - 1)) & ~(B_PAGE_SIZE - 1);
channel->prd_area = create_area("prd", (void **)&channel->prdt,
B_ANY_KERNEL_ADDRESS, prdtSize, B_32_BIT_MEMORY, 0);
B_ANY_KERNEL_ADDRESS, prdtSize, B_32_BIT_CONTIGUOUS, 0);
if (channel->prd_area < B_OK) {
TRACE("creating prd_area failed\n");
goto err;
@@ -1107,7 +1107,7 @@ static Symbios *create_cardinfo(int num, pci_info *pi, int flags)
uchar *a;
physical_entry entries[2];
aid = create_area(name, (void **)&a, B_ANY_KERNEL_ADDRESS, 4096*5,
B_32_BIT_MEMORY, B_READ_AREA | B_WRITE_AREA);
B_32_BIT_CONTIGUOUS, B_READ_AREA | B_WRITE_AREA);
if(aid == B_ERROR || aid == B_BAD_VALUE || aid == B_NO_MEMORY){
free(s);
return NULL;
@@ -832,7 +832,7 @@ static BusLogic *create_cardinfo(int num, int iobase, int irq)
#else
bl->box_count = MAX_CCB_COUNT;
aid = create_area("bl_workspace", (void **)&a, B_ANY_KERNEL_ADDRESS, 4096*5,
B_32_BIT_MEMORY, B_READ_AREA | B_WRITE_AREA);
B_32_BIT_CONTIGUOUS, B_READ_AREA | B_WRITE_AREA);
if(aid == B_ERROR || aid == B_BAD_VALUE || aid == B_NO_MEMORY) {
free(bl);
return NULL;
@@ -43,7 +43,7 @@ alloc_mem(void **phy, void **log, size_t size, const char *name)
size = round_to_pagesize(size);
areaid = create_area(name, &logadr, B_ANY_KERNEL_ADDRESS, size,
B_32_BIT_MEMORY, B_READ_AREA | B_WRITE_AREA);
B_32_BIT_CONTIGUOUS, 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) {
@@ -75,7 +75,7 @@ alloc_mem(phys_addr_t *phy, void **log, size_t size, const char *name)
size = round_to_pagesize(size);
area = create_area(name, &logadr, B_ANY_KERNEL_ADDRESS, size,
B_32_BIT_MEMORY, B_READ_AREA | B_WRITE_AREA);
B_32_BIT_CONTIGUOUS, 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) {
@@ -76,7 +76,7 @@ alloc_mem(void **phy, void **log, size_t size, const char *name)
size = round_to_pagesize(size);
areaid = create_area(name, &logadr, B_ANY_KERNEL_ADDRESS, size,
B_32_BIT_MEMORY, B_READ_AREA | B_WRITE_AREA);
B_32_BIT_CONTIGUOUS, 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) {
@@ -76,7 +76,7 @@ alloc_mem(void **phy, void **log, size_t size, const char *name)
size = round_to_pagesize(size);
areaid = create_area(name, &logadr, B_ANY_KERNEL_ADDRESS, size,
B_32_BIT_MEMORY, B_READ_AREA | B_WRITE_AREA);
B_32_BIT_CONTIGUOUS, 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) {
@@ -306,7 +306,7 @@ geode_stream_setup_buffers(geode_stream* stream, const char* desc)
/* Allocate memory for buffers */
stream->buffer_area = create_area("geode buffers", (void**)&buffer,
B_ANY_KERNEL_ADDRESS, alloc, B_32_BIT_MEMORY,
B_ANY_KERNEL_ADDRESS, alloc, B_32_BIT_CONTIGUOUS,
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.
@@ -338,7 +338,7 @@ geode_stream_setup_buffers(geode_stream* stream, const char* desc)
stream->buffer_descriptors_area = create_area("geode buffer descriptors",
(void**)&bufferDescriptors, B_ANY_KERNEL_ADDRESS, alloc,
B_32_BIT_MEMORY, 0);
B_32_BIT_CONTIGUOUS, 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) {
@@ -76,7 +76,7 @@ alloc_mem(void **log, void **phy, size_t size, const char *name)
size = round_to_pagesize(size);
areaid = create_area(name, &logadr, B_ANY_KERNEL_ADDRESS, size,
B_32_BIT_MEMORY, B_READ_AREA | B_WRITE_AREA);
B_32_BIT_CONTIGUOUS, 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) {
@@ -57,7 +57,7 @@ alloc_mem(void **virt, void **phy, size_t size, uint32 protection,
size = round_to_pagesize(size);
areaid = create_area(name, &virtadr, B_ANY_KERNEL_ADDRESS, size,
B_32_BIT_MEMORY, protection);
B_32_BIT_CONTIGUOUS, 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) {
+1 -1
View File
@@ -75,7 +75,7 @@ alloc_mem(phys_addr_t *phy, void **log, size_t size, const char *name)
size = round_to_pagesize(size);
area = create_area(name, &logadr, B_ANY_KERNEL_ADDRESS, size,
B_32_BIT_MEMORY, B_READ_AREA | B_WRITE_AREA);
B_32_BIT_CONTIGUOUS, 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) {
@@ -76,7 +76,7 @@ alloc_mem(void **phy, void **log, size_t size, const char *name)
size = round_to_pagesize(size);
areaid = create_area(name, &logadr, B_ANY_KERNEL_ADDRESS, size,
B_32_BIT_MEMORY, B_READ_AREA | B_WRITE_AREA);
B_32_BIT_CONTIGUOUS, 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) {
@@ -58,7 +58,7 @@ alloc_mem(void **phy, void **log, size_t size, const char *name)
size = round_to_pagesize(size);
areaid = create_area(name, &logadr, B_ANY_KERNEL_ADDRESS, size,
B_32_BIT_MEMORY, B_READ_AREA | B_WRITE_AREA);
B_32_BIT_CONTIGUOUS, 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) {
@@ -81,7 +81,7 @@ alloc_mem(void **virt, void **phy, size_t size, uint32 protection,
size = ROUNDUP(size, B_PAGE_SIZE);
areaid = create_area(name, &virtadr, B_ANY_KERNEL_ADDRESS, size,
B_32_BIT_MEMORY, protection);
B_32_BIT_CONTIGUOUS, 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) {
@@ -906,7 +906,7 @@ open_hook(const char* name, uint32 flags, void** cookie)
(void **)&unaligned_dma_buffer,
B_ANY_KERNEL_ADDRESS,
2 * net_buf_size, /* take twice the net size so we can have MTRR-WC even on old systems */
B_32_BIT_MEMORY, /* GPU always needs access */
B_32_BIT_CONTIGUOUS, /* GPU always needs access */
B_USER_CLONEABLE_AREA | B_READ_AREA | B_WRITE_AREA);
// TODO: Physical aligning can be done without waste using the
// private create_area_etc().
@@ -662,7 +662,7 @@ open_hook(const char* name, uint32 flags, void** cookie)
(void **)&unaligned_dma_buffer,
B_ANY_KERNEL_ADDRESS,
2 * net_buf_size, /* take twice the net size so we can have MTRR-WC even on old systems */
B_32_BIT_MEMORY, /* GPU always needs access */
B_32_BIT_CONTIGUOUS, /* GPU always needs access */
B_USER_CLONEABLE_AREA | B_READ_AREA | B_WRITE_AREA);
// TODO: Physical aligning can be done without waste using the
// private create_area_etc().
@@ -152,7 +152,7 @@ static status_t initGATT( GART_info *gart )
gart->GATT.area = create_area("Radeon GATT", (void **)&gart->GATT.ptr,
B_ANY_KERNEL_ADDRESS,
(num_pages * sizeof( uint32 ) + B_PAGE_SIZE - 1) & ~(B_PAGE_SIZE - 1),
B_32_BIT_MEMORY,
B_32_BIT_CONTIGUOUS,
// TODO: Physical address is cast to 32 bit below! Use B_CONTIGUOUS,
// when that is (/can be) fixed!
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
@@ -187,9 +187,9 @@ static status_t initGATT( GART_info *gart )
// temporary area where we fill in the memory map (deleted below)
map_area = create_area("pci_gart_map_area", (void **)&map, B_ANY_ADDRESS,
map_area_size, B_32_BIT_MEMORY, B_READ_AREA | B_WRITE_AREA);
// TODO: Physical addresses are cast to 32 bit below! Use B_FULL_LOCK,
// when that is (/can be) fixed!
map_area_size, B_FULL_LOCK, B_READ_AREA | B_WRITE_AREA);
// TODO: We actually have a working malloc() in the kernel. Why create
// an area?
dprintf("pci_gart_map_area: %ld\n", map_area);
get_memory_map( gart->buffer.ptr, gart->buffer.size, map, map_count );
@@ -599,9 +599,7 @@ b44_MM_AllocateSharedMemory(PLM_DEVICE_BLOCK pDevice, LM_UINT32 BlockSize,
dev = (struct be_b44_dev *)(pDevice);
area_desc = dev->lockmem_list[dev->lockmem_list_num++] = create_area("broadcom_shared_mem",
&pvirt, B_ANY_KERNEL_ADDRESS, ROUND_UP_TO_PAGE(BlockSize),
B_32_BIT_MEMORY, B_READ_AREA | B_WRITE_AREA);
// TODO: B_32_BIT_MEMORY implies contiguous, although that wouldn't
// be necessary here!
B_32_BIT_FULL_LOCK, B_READ_AREA | B_WRITE_AREA);
if (area_desc < B_OK)
return LM_STATUS_FAILURE;
@@ -31,9 +31,7 @@ area_malloc(size_t size)
size = ROUNDUP(size, B_PAGE_SIZE);
if (create_area("area_malloc", &p, B_ANY_KERNEL_ADDRESS, size,
B_32_BIT_MEMORY, 0) < 0) {
// TODO: B_32_BIT_MEMORY implies contiguous, although that wouldn't
// be necessary here!
B_32_BIT_FULL_LOCK, 0) < 0) {
return 0;
}
return p;
@@ -648,7 +648,7 @@ static status_t init_ring_buffers(dp83815_properties_t *data)
pages = pages_needed(2*MAX_DESC*sizeof(descriptor_t) + NUM_BUFFS*BUFFER_SIZE);
data->mem_area = create_area(kDevName " desc buffer", (void**)&RxDescRing,
B_ANY_KERNEL_ADDRESS, pages * B_PAGE_SIZE, B_32_BIT_MEMORY,
B_ANY_KERNEL_ADDRESS, pages * B_PAGE_SIZE, B_32_BIT_CONTIGUOUS,
B_READ_AREA | B_WRITE_AREA);
if( data->mem_area < 0 )
return -1;
@@ -73,7 +73,7 @@ alloc_mem(void **log, void **phy, size_t size, const char *name)
size = round_to_pagesize(size);
areaid = create_area(name, &logadr, B_ANY_KERNEL_ADDRESS, size,
B_32_BIT_MEMORY, B_READ_AREA | B_WRITE_AREA);
B_32_BIT_CONTIGUOUS, 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) {
@@ -47,7 +47,7 @@ alloc_contiguous(void **virt, void **phy, size_t size, uint32 protection,
size = round_to_pagesize(size);
areaid = create_area(name, &virtadr, B_ANY_KERNEL_ADDRESS, size,
B_32_BIT_MEMORY, protection);
B_32_BIT_CONTIGUOUS, 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) {
@@ -734,9 +734,7 @@ sis900_createRings(struct sis_info *info)
info->txArea = create_area("sis900 tx buffer", (void **)&info->txBuffer[0],
B_ANY_KERNEL_ADDRESS,
ROUND_TO_PAGE_SIZE(BUFFER_SIZE * NUM_Tx_DESCR),
B_32_BIT_MEMORY, B_READ_AREA | B_WRITE_AREA);
// TODO: B_32_BIT_MEMORY implies contiguous, although that wouldn't
// be necessary here!
B_32_BIT_FULL_LOCK, B_READ_AREA | B_WRITE_AREA);
if (info->txArea < B_OK)
return info->txArea;
@@ -759,9 +757,7 @@ sis900_createRings(struct sis_info *info)
info->rxArea = create_area("sis900 rx buffer", (void **)&info->rxBuffer[0],
B_ANY_KERNEL_ADDRESS,
ROUND_TO_PAGE_SIZE(BUFFER_SIZE * NUM_Rx_DESCR),
B_32_BIT_MEMORY, B_READ_AREA | B_WRITE_AREA);
// TODO: B_32_BIT_MEMORY implies contiguous, although that wouldn't
// be necessary here!
B_32_BIT_FULL_LOCK, B_READ_AREA | B_WRITE_AREA);
if (info->rxArea < B_OK) {
delete_area(info->txArea);
return info->rxArea;
@@ -269,10 +269,8 @@ alloc_buffers(dev_info_t *device)
/* create tx descriptor area */
size = RNDUP(sizeof(trns_desc_t) * TX_BUFFERS, B_PAGE_SIZE);
device->tx_desc_area = create_area(DEVICE_NAME " tx descriptors",
(void **)device->tx_desc, B_ANY_KERNEL_ADDRESS, size, B_32_BIT_MEMORY,
B_READ_AREA | B_WRITE_AREA);
// TODO: B_32_BIT_MEMORY implies contiguous, although that wouldn't
// be necessary here!
(void **)device->tx_desc, B_ANY_KERNEL_ADDRESS, size,
B_32_BIT_FULL_LOCK, B_READ_AREA | B_WRITE_AREA);
if (device->tx_desc_area < 0)
return device->tx_desc_area;
@@ -290,9 +288,7 @@ alloc_buffers(dev_info_t *device)
size = RNDUP(BUFFER_SIZE * TX_BUFFERS, B_PAGE_SIZE);
device->tx_buf_area = create_area(DEVICE_NAME " tx buffers",
(void **)device->tx_buf, B_ANY_KERNEL_ADDRESS, size,
B_32_BIT_MEMORY, B_READ_AREA | B_WRITE_AREA);
// TODO: B_32_BIT_MEMORY implies contiguous, although that wouldn't
// be necessary here!
B_32_BIT_FULL_LOCK, B_READ_AREA | B_WRITE_AREA);
if (device->tx_buf_area < 0) {
delete_area(device->tx_desc_area); // sensitive to alloc ordering
return device->tx_buf_area;
@@ -313,9 +309,7 @@ alloc_buffers(dev_info_t *device)
size = RNDUP( sizeof(recv_desc_t) * RX_BUFFERS, B_PAGE_SIZE);
device->rx_desc_area = create_area(DEVICE_NAME " rx descriptors",
(void **)device->rx_desc, B_ANY_KERNEL_ADDRESS, size,
B_32_BIT_MEMORY, B_READ_AREA | B_WRITE_AREA);
// TODO: B_32_BIT_MEMORY implies contiguous, although that wouldn't
// be necessary here!
B_32_BIT_FULL_LOCK, B_READ_AREA | B_WRITE_AREA);
if (device->rx_desc_area < 0) {
delete_area(device->tx_desc_area);
delete_area(device->tx_buf_area); // sensitive to alloc ordering
@@ -336,9 +330,7 @@ alloc_buffers(dev_info_t *device)
size = RNDUP(BUFFER_SIZE * RX_BUFFERS, B_PAGE_SIZE);
device->rx_buf_area = create_area(DEVICE_NAME " rx buffers",
(void **)device->rx_buf, B_ANY_KERNEL_ADDRESS, size,
B_32_BIT_MEMORY, B_READ_AREA | B_WRITE_AREA);
// TODO: B_32_BIT_MEMORY implies contiguous, although that wouldn't
// be necessary here!
B_32_BIT_FULL_LOCK, B_READ_AREA | B_WRITE_AREA);
if (device->rx_buf_area < 0) {
delete_area(device->tx_desc_area);
delete_area(device->tx_buf_area);
@@ -525,9 +525,7 @@ wb_create_rings(struct wb_device *device)
device->rxArea = create_area("wb840 rx buffer", (void **)&device->rxBuffer[0],
B_ANY_KERNEL_ADDRESS, ROUND_TO_PAGE_SIZE(WB_BUFBYTES * WB_RX_LIST_CNT),
B_32_BIT_MEMORY, B_READ_AREA | B_WRITE_AREA);
// TODO: B_32_BIT_MEMORY implies contiguous, although that wouldn't
// be necessary here!
B_32_BIT_FULL_LOCK, B_READ_AREA | B_WRITE_AREA);
if (device->rxArea < B_OK)
return device->rxArea;
@@ -547,9 +545,7 @@ wb_create_rings(struct wb_device *device)
device->txArea = create_area("wb840 tx buffer", (void **)&device->txBuffer[0],
B_ANY_KERNEL_ADDRESS, ROUND_TO_PAGE_SIZE(WB_BUFBYTES * WB_TX_LIST_CNT),
B_32_BIT_MEMORY, B_READ_AREA | B_WRITE_AREA);
// TODO: B_32_BIT_MEMORY implies contiguous, although that wouldn't
// be necessary here!
B_32_BIT_FULL_LOCK, B_READ_AREA | B_WRITE_AREA);
if (device->txArea < B_OK) {
delete_area(device->rxArea);
return device->txArea;
@@ -922,7 +922,7 @@ IPW2100::AllocateContiguous(const char *name, void **logicalAddress,
size = (size + B_PAGE_SIZE - 1) & ~(B_PAGE_SIZE - 1);
void *virtualAddress = NULL;
area_id area = create_area(name, &virtualAddress, B_ANY_KERNEL_ADDRESS,
size, B_32_BIT_MEMORY, B_READ_AREA | B_WRITE_AREA);
size, B_32_BIT_CONTIGUOUS, B_READ_AREA | B_WRITE_AREA);
if (area < B_OK) {
TRACE_ALWAYS(("IPW2100: allocating contiguous area failed\n"));
return area;
@@ -409,7 +409,7 @@ ata_adapter_init_channel(device_node *node,
// used.
prdt_size = (ATA_ADAPTER_MAX_SG_COUNT * sizeof( prd_entry ) + (B_PAGE_SIZE - 1)) & ~(B_PAGE_SIZE - 1);
channel->prd_area = create_area("prd", (void **)&channel->prdt, B_ANY_KERNEL_ADDRESS,
prdt_size, B_32_BIT_MEMORY, 0);
prdt_size, B_32_BIT_CONTIGUOUS, 0);
if (channel->prd_area < B_OK) {
res = channel->prd_area;
goto err2;
@@ -397,7 +397,7 @@ ide_adapter_init_channel(device_node *node,
// used.
prdt_size = (IDE_ADAPTER_MAX_SG_COUNT * sizeof( prd_entry ) + (B_PAGE_SIZE - 1)) & ~(B_PAGE_SIZE - 1);
channel->prd_area = create_area("prd", (void **)&channel->prdt, B_ANY_KERNEL_ADDRESS,
prdt_size, B_32_BIT_MEMORY, 0);
prdt_size, B_32_BIT_CONTIGUOUS, 0);
if (channel->prd_area < B_OK) {
res = channel->prd_area;
goto err2;
+9 -5
View File
@@ -1117,16 +1117,21 @@ vm_create_anonymous_area(team_id team, const char *name, addr_t size,
case B_ALREADY_WIRED:
break;
case B_LOMEM:
{
stackPhysicalRestrictions = *physicalAddressRestrictions;
stackPhysicalRestrictions.high_address = 16 * 1024 * 1024;
physicalAddressRestrictions = &stackPhysicalRestrictions;
wiring = B_CONTIGUOUS;
doReserveMemory = true;
break;
}
case B_32_BIT_MEMORY:
{
case B_32_BIT_FULL_LOCK:
#if B_HAIKU_PHYSICAL_BITS <= 32
wiring = B_FULL_LOCK;
doReserveMemory = true;
break;
#endif
// TODO: We don't really support this mode efficiently. Just fall
// through for now ...
case B_32_BIT_CONTIGUOUS:
#if B_HAIKU_PHYSICAL_BITS > 32
stackPhysicalRestrictions = *physicalAddressRestrictions;
stackPhysicalRestrictions.high_address = 0x100000000LL;
@@ -1135,7 +1140,6 @@ vm_create_anonymous_area(team_id team, const char *name, addr_t size,
wiring = B_CONTIGUOUS;
doReserveMemory = true;
break;
}
default:
return B_BAD_VALUE;
}