* Replaced the vm_get_physical_page() "flags"
PHYSICAL_PAGE_{NO,CAN}_WAIT into an actual flag
PHYSICAL_PAGE_DONT_WAIT.
* Pass the flags through to the chunk mapper callback.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27979 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -49,8 +49,7 @@
|
|||||||
|
|
||||||
// flags for vm_get_physical_page()
|
// flags for vm_get_physical_page()
|
||||||
enum {
|
enum {
|
||||||
PHYSICAL_PAGE_NO_WAIT = 0,
|
PHYSICAL_PAGE_DONT_WAIT = 0x01
|
||||||
PHYSICAL_PAGE_CAN_WAIT,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// mapping argument for several internal VM functions
|
// mapping argument for several internal VM functions
|
||||||
|
|||||||
@@ -92,8 +92,8 @@ copy_sg_data(scsi_ccb *request, uint offset, uint allocationLength,
|
|||||||
bytes = min(size, requestSize);
|
bytes = min(size, requestSize);
|
||||||
bytes = min(bytes, sgList->size);
|
bytes = min(bytes, sgList->size);
|
||||||
|
|
||||||
if (vm_get_physical_page((addr_t)sgList->address, &virtualAddress,
|
if (vm_get_physical_page((addr_t)sgList->address, &virtualAddress, 0)
|
||||||
PHYSICAL_PAGE_CAN_WAIT) != B_OK)
|
!= B_OK)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
SHOW_FLOW(4, "buffer=%p, virt_addr=%p, bytes=%d, to_buffer=%d",
|
SHOW_FLOW(4, "buffer=%p, virt_addr=%p, bytes=%d, to_buffer=%d",
|
||||||
|
|||||||
@@ -150,8 +150,7 @@ transfer_PIO_physcont(ide_device_info *device, addr_t physicalAddress,
|
|||||||
SHOW_FLOW(4, "Transmitting to/from physical address %lx, %d bytes left",
|
SHOW_FLOW(4, "Transmitting to/from physical address %lx, %d bytes left",
|
||||||
physicalAddress, length);
|
physicalAddress, length);
|
||||||
|
|
||||||
if (vm_get_physical_page(physicalAddress, &virtualAddress,
|
if (vm_get_physical_page(physicalAddress, &virtualAddress, 0) != B_OK) {
|
||||||
PHYSICAL_PAGE_CAN_WAIT) != B_OK) {
|
|
||||||
// ouch: this should never ever happen
|
// ouch: this should never ever happen
|
||||||
set_sense(device, SCSIS_KEY_HARDWARE_ERROR, SCSIS_ASC_INTERNAL_FAILURE);
|
set_sense(device, SCSIS_KEY_HARDWARE_ERROR, SCSIS_ASC_INTERNAL_FAILURE);
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
|
|||||||
@@ -119,8 +119,8 @@ scsi_copy_dma_buffer(scsi_ccb *request, uint32 size, bool to_buffer)
|
|||||||
|
|
||||||
bytes = min( size, sg_list->size );
|
bytes = min( size, sg_list->size );
|
||||||
|
|
||||||
if (vm_get_physical_page((addr_t)sg_list->address, &virtualAddress,
|
if (vm_get_physical_page((addr_t)sg_list->address, &virtualAddress, 0)
|
||||||
PHYSICAL_PAGE_CAN_WAIT) != B_OK)
|
!= B_OK)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (to_buffer)
|
if (to_buffer)
|
||||||
|
|||||||
@@ -464,8 +464,8 @@ copy_sg_data(scsi_ccb *request, uint offset, uint allocation_length,
|
|||||||
bytes = min(size, req_size);
|
bytes = min(size, req_size);
|
||||||
bytes = min(bytes, sg_list->size);
|
bytes = min(bytes, sg_list->size);
|
||||||
|
|
||||||
if (vm_get_physical_page((addr_t)sg_list->address, (void *)&virtualAddress,
|
if (vm_get_physical_page((addr_t)sg_list->address,
|
||||||
PHYSICAL_PAGE_CAN_WAIT) != B_OK)
|
(void*)&virtualAddress, 0) != B_OK)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
SHOW_FLOW(0, "buffer = %p, virt_addr = %#lx, bytes = %lu, to_buffer = %d",
|
SHOW_FLOW(0, "buffer = %p, virt_addr = %#lx, bytes = %lu, to_buffer = %d",
|
||||||
|
|||||||
@@ -93,8 +93,8 @@ sg_memcpy(const physical_entry *sgTable, int sgCount, const void *data,
|
|||||||
size_t size = min_c(dataSize, sgTable[i].size);
|
size_t size = min_c(dataSize, sgTable[i].size);
|
||||||
addr_t address;
|
addr_t address;
|
||||||
|
|
||||||
if (vm_get_physical_page((addr_t)sgTable[i].address, &address,
|
if (vm_get_physical_page((addr_t)sgTable[i].address, &address, 0)
|
||||||
PHYSICAL_PAGE_CAN_WAIT) < B_OK)
|
< B_OK)
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
|
|
||||||
TRACE("sg_memcpy phyAddr %p, addr %p, size %lu\n", sgTable[i].address, (void *)address, size);
|
TRACE("sg_memcpy phyAddr %p, addr %p, size %lu\n", sgTable[i].address, (void *)address, size);
|
||||||
|
|||||||
@@ -90,7 +90,8 @@ restart:
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
sMapIOSpaceChunk(paddr_desc[index].va, index * sIOSpaceChunkSize);
|
sMapIOSpaceChunk(paddr_desc[index].va, index * sIOSpaceChunkSize,
|
||||||
|
flags);
|
||||||
mutex_unlock(&sMutex);
|
mutex_unlock(&sMutex);
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
@@ -99,7 +100,7 @@ restart:
|
|||||||
// replace an earlier mapping
|
// replace an earlier mapping
|
||||||
if (queue_peek(&mapped_paddr_lru) == NULL) {
|
if (queue_peek(&mapped_paddr_lru) == NULL) {
|
||||||
// no free slots available
|
// no free slots available
|
||||||
if (flags == PHYSICAL_PAGE_NO_WAIT) {
|
if ((flags & PHYSICAL_PAGE_DONT_WAIT) != 0) {
|
||||||
// put back to the caller and let them handle this
|
// put back to the caller and let them handle this
|
||||||
mutex_unlock(&sMutex);
|
mutex_unlock(&sMutex);
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
@@ -123,7 +124,7 @@ restart:
|
|||||||
virtual_pmappings[(*va - sIOSpaceBase) / sIOSpaceChunkSize]
|
virtual_pmappings[(*va - sIOSpaceBase) / sIOSpaceChunkSize]
|
||||||
= paddr_desc + index;
|
= paddr_desc + index;
|
||||||
|
|
||||||
sMapIOSpaceChunk(paddr_desc[index].va, index * sIOSpaceChunkSize);
|
sMapIOSpaceChunk(paddr_desc[index].va, index * sIOSpaceChunkSize, flags);
|
||||||
|
|
||||||
mutex_unlock(&sMutex);
|
mutex_unlock(&sMutex);
|
||||||
return B_OK;
|
return B_OK;
|
||||||
|
|||||||
@@ -12,7 +12,8 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef status_t (*generic_map_iospace_chunk_func)(addr_t, addr_t);
|
typedef status_t (*generic_map_iospace_chunk_func)(addr_t virtualAddress,
|
||||||
|
addr_t physicalAddress, uint32 flags);
|
||||||
|
|
||||||
status_t generic_get_physical_page(addr_t pa, addr_t *va, uint32 flags);
|
status_t generic_get_physical_page(addr_t pa, addr_t *va, uint32 flags);
|
||||||
status_t generic_put_physical_page(addr_t va);
|
status_t generic_put_physical_page(addr_t va);
|
||||||
|
|||||||
@@ -571,7 +571,7 @@ map_tmap(vm_translation_map *map, addr_t va, addr_t pa, uint32 attributes)
|
|||||||
// now, fill in the pentry
|
// now, fill in the pentry
|
||||||
do {
|
do {
|
||||||
err = get_physical_page_tmap(PRE_TO_PA(pr[rindex]),
|
err = get_physical_page_tmap(PRE_TO_PA(pr[rindex]),
|
||||||
&pd_pg, PHYSICAL_PAGE_NO_WAIT);
|
&pd_pg, PHYSICAL_PAGE_DONT_WAIT);
|
||||||
} while (err < 0);
|
} while (err < 0);
|
||||||
pd = (page_directory_entry *)pd_pg;
|
pd = (page_directory_entry *)pd_pg;
|
||||||
// we want the table at rindex, not at rindex%(tbl/page)
|
// we want the table at rindex, not at rindex%(tbl/page)
|
||||||
@@ -615,7 +615,7 @@ map_tmap(vm_translation_map *map, addr_t va, addr_t pa, uint32 attributes)
|
|||||||
// now, fill in the pentry
|
// now, fill in the pentry
|
||||||
do {
|
do {
|
||||||
err = get_physical_page_tmap(PDE_TO_PA(pd[dindex]),
|
err = get_physical_page_tmap(PDE_TO_PA(pd[dindex]),
|
||||||
&pt_pg, PHYSICAL_PAGE_NO_WAIT);
|
&pt_pg, PHYSICAL_PAGE_DONT_WAIT);
|
||||||
} while (err < 0);
|
} while (err < 0);
|
||||||
pt = (page_table_entry *)pt_pg;
|
pt = (page_table_entry *)pt_pg;
|
||||||
// we want the table at rindex, not at rindex%(tbl/page)
|
// we want the table at rindex, not at rindex%(tbl/page)
|
||||||
@@ -668,7 +668,7 @@ restart:
|
|||||||
|
|
||||||
do {
|
do {
|
||||||
status = get_physical_page_tmap(PRE_TO_PA(pr[index]),
|
status = get_physical_page_tmap(PRE_TO_PA(pr[index]),
|
||||||
&pd_pg, PHYSICAL_PAGE_NO_WAIT);
|
&pd_pg, PHYSICAL_PAGE_DONT_WAIT);
|
||||||
} while (status < B_OK);
|
} while (status < B_OK);
|
||||||
pd = (page_directory_entry *)pd_pg;
|
pd = (page_directory_entry *)pd_pg;
|
||||||
// we want the table at rindex, not at rindex%(tbl/page)
|
// we want the table at rindex, not at rindex%(tbl/page)
|
||||||
@@ -684,7 +684,7 @@ restart:
|
|||||||
|
|
||||||
do {
|
do {
|
||||||
status = get_physical_page_tmap(PDE_TO_PA(pd[index]),
|
status = get_physical_page_tmap(PDE_TO_PA(pd[index]),
|
||||||
&pt_pg, PHYSICAL_PAGE_NO_WAIT);
|
&pt_pg, PHYSICAL_PAGE_DONT_WAIT);
|
||||||
} while (status < B_OK);
|
} while (status < B_OK);
|
||||||
pt = (page_table_entry *)pt_pg;
|
pt = (page_table_entry *)pt_pg;
|
||||||
// we want the table at rindex, not at rindex%(tbl/page)
|
// we want the table at rindex, not at rindex%(tbl/page)
|
||||||
@@ -795,7 +795,7 @@ query_tmap(vm_translation_map *map, addr_t va, addr_t *_physical, uint32 *_flags
|
|||||||
|
|
||||||
do {
|
do {
|
||||||
status = get_physical_page_tmap(PRE_TO_PA(pr[index]),
|
status = get_physical_page_tmap(PRE_TO_PA(pr[index]),
|
||||||
&pd_pg, PHYSICAL_PAGE_NO_WAIT);
|
&pd_pg, PHYSICAL_PAGE_DONT_WAIT);
|
||||||
} while (status < B_OK);
|
} while (status < B_OK);
|
||||||
pd = (page_directory_entry *)pd_pg;
|
pd = (page_directory_entry *)pd_pg;
|
||||||
// we want the table at rindex, not at rindex%(tbl/page)
|
// we want the table at rindex, not at rindex%(tbl/page)
|
||||||
@@ -811,7 +811,7 @@ query_tmap(vm_translation_map *map, addr_t va, addr_t *_physical, uint32 *_flags
|
|||||||
|
|
||||||
do {
|
do {
|
||||||
status = get_physical_page_tmap(PDE_TO_PA(pd[index]),
|
status = get_physical_page_tmap(PDE_TO_PA(pd[index]),
|
||||||
&pt_pg, PHYSICAL_PAGE_NO_WAIT);
|
&pt_pg, PHYSICAL_PAGE_DONT_WAIT);
|
||||||
} while (status < B_OK);
|
} while (status < B_OK);
|
||||||
pt = (page_table_entry *)pt_pg;
|
pt = (page_table_entry *)pt_pg;
|
||||||
// we want the table at rindex, not at rindex%(tbl/page)
|
// we want the table at rindex, not at rindex%(tbl/page)
|
||||||
@@ -825,7 +825,7 @@ query_tmap(vm_translation_map *map, addr_t va, addr_t *_physical, uint32 *_flags
|
|||||||
pi_pg = pt_pg;
|
pi_pg = pt_pg;
|
||||||
do {
|
do {
|
||||||
status = get_physical_page_tmap(PIE_TO_PA(pi[index]),
|
status = get_physical_page_tmap(PIE_TO_PA(pi[index]),
|
||||||
&pt_pg, PHYSICAL_PAGE_NO_WAIT);
|
&pt_pg, PHYSICAL_PAGE_DONT_WAIT);
|
||||||
} while (status < B_OK);
|
} while (status < B_OK);
|
||||||
pt = (page_table_entry *)pt_pg;
|
pt = (page_table_entry *)pt_pg;
|
||||||
// add offset from start of page
|
// add offset from start of page
|
||||||
@@ -890,7 +890,7 @@ restart:
|
|||||||
|
|
||||||
do {
|
do {
|
||||||
status = get_physical_page_tmap(PRE_TO_PA(pr[index]),
|
status = get_physical_page_tmap(PRE_TO_PA(pr[index]),
|
||||||
&pd_pg, PHYSICAL_PAGE_NO_WAIT);
|
&pd_pg, PHYSICAL_PAGE_DONT_WAIT);
|
||||||
} while (status < B_OK);
|
} while (status < B_OK);
|
||||||
pd = (page_directory_entry *)pd_pg;
|
pd = (page_directory_entry *)pd_pg;
|
||||||
// we want the table at rindex, not at rindex%(tbl/page)
|
// we want the table at rindex, not at rindex%(tbl/page)
|
||||||
@@ -906,7 +906,7 @@ restart:
|
|||||||
|
|
||||||
do {
|
do {
|
||||||
status = get_physical_page_tmap(PDE_TO_PA(pd[index]),
|
status = get_physical_page_tmap(PDE_TO_PA(pd[index]),
|
||||||
&pt_pg, PHYSICAL_PAGE_NO_WAIT);
|
&pt_pg, PHYSICAL_PAGE_DONT_WAIT);
|
||||||
} while (status < B_OK);
|
} while (status < B_OK);
|
||||||
pt = (page_table_entry *)pt_pg;
|
pt = (page_table_entry *)pt_pg;
|
||||||
// we want the table at rindex, not at rindex%(tbl/page)
|
// we want the table at rindex, not at rindex%(tbl/page)
|
||||||
@@ -962,7 +962,7 @@ clear_flags_tmap(vm_translation_map *map, addr_t va, uint32 flags)
|
|||||||
|
|
||||||
do {
|
do {
|
||||||
status = get_physical_page_tmap(PRE_TO_PA(pr[index]),
|
status = get_physical_page_tmap(PRE_TO_PA(pr[index]),
|
||||||
&pd_pg, PHYSICAL_PAGE_NO_WAIT);
|
&pd_pg, PHYSICAL_PAGE_DONT_WAIT);
|
||||||
} while (status < B_OK);
|
} while (status < B_OK);
|
||||||
pd = (page_directory_entry *)pd_pg;
|
pd = (page_directory_entry *)pd_pg;
|
||||||
// we want the table at rindex, not at rindex%(tbl/page)
|
// we want the table at rindex, not at rindex%(tbl/page)
|
||||||
@@ -978,7 +978,7 @@ clear_flags_tmap(vm_translation_map *map, addr_t va, uint32 flags)
|
|||||||
|
|
||||||
do {
|
do {
|
||||||
status = get_physical_page_tmap(PDE_TO_PA(pd[index]),
|
status = get_physical_page_tmap(PDE_TO_PA(pd[index]),
|
||||||
&pt_pg, PHYSICAL_PAGE_NO_WAIT);
|
&pt_pg, PHYSICAL_PAGE_DONT_WAIT);
|
||||||
} while (status < B_OK);
|
} while (status < B_OK);
|
||||||
pt = (page_table_entry *)pt_pg;
|
pt = (page_table_entry *)pt_pg;
|
||||||
// we want the table at rindex, not at rindex%(tbl/page)
|
// we want the table at rindex, not at rindex%(tbl/page)
|
||||||
@@ -992,7 +992,7 @@ clear_flags_tmap(vm_translation_map *map, addr_t va, uint32 flags)
|
|||||||
pi_pg = pt_pg;
|
pi_pg = pt_pg;
|
||||||
do {
|
do {
|
||||||
status = get_physical_page_tmap(PIE_TO_PA(pi[index]),
|
status = get_physical_page_tmap(PIE_TO_PA(pi[index]),
|
||||||
&pt_pg, PHYSICAL_PAGE_NO_WAIT);
|
&pt_pg, PHYSICAL_PAGE_DONT_WAIT);
|
||||||
} while (status < B_OK);
|
} while (status < B_OK);
|
||||||
pt = (page_table_entry *)pt_pg;
|
pt = (page_table_entry *)pt_pg;
|
||||||
// add offset from start of page
|
// add offset from start of page
|
||||||
@@ -1059,7 +1059,7 @@ flush_tmap(vm_translation_map *map)
|
|||||||
|
|
||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
map_iospace_chunk(addr_t va, addr_t pa)
|
map_iospace_chunk(addr_t va, addr_t pa, uint32 flags)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
page_table_entry *pt;
|
page_table_entry *pt;
|
||||||
@@ -1354,13 +1354,13 @@ m68k_vm_translation_map_init_post_area(kernel_args *args)
|
|||||||
physicalPageDir = PRE_TO_PA(sKernelVirtualPageRoot[index]);
|
physicalPageDir = PRE_TO_PA(sKernelVirtualPageRoot[index]);
|
||||||
|
|
||||||
get_physical_page_tmap(physicalPageDir,
|
get_physical_page_tmap(physicalPageDir,
|
||||||
(addr_t *)&pageDirEntry, PHYSICAL_PAGE_NO_WAIT);
|
(addr_t *)&pageDirEntry, PHYSICAL_PAGE_DONT_WAIT);
|
||||||
|
|
||||||
index = VADDR_TO_PDENT((addr_t)&sQueryDesc);
|
index = VADDR_TO_PDENT((addr_t)&sQueryDesc);
|
||||||
physicalPageTable = PDE_TO_PA(pageDirEntry[index]);
|
physicalPageTable = PDE_TO_PA(pageDirEntry[index]);
|
||||||
|
|
||||||
get_physical_page_tmap(physicalPageTable,
|
get_physical_page_tmap(physicalPageTable,
|
||||||
(addr_t *)&pageTableEntry, PHYSICAL_PAGE_NO_WAIT);
|
(addr_t *)&pageTableEntry, PHYSICAL_PAGE_DONT_WAIT);
|
||||||
|
|
||||||
index = VADDR_TO_PTENT((addr_t)&sQueryDesc);
|
index = VADDR_TO_PTENT((addr_t)&sQueryDesc);
|
||||||
|
|
||||||
@@ -1380,13 +1380,13 @@ m68k_vm_translation_map_init_post_area(kernel_args *args)
|
|||||||
physicalPageDir = PRE_TO_PA(sKernelVirtualPageRoot[index]);
|
physicalPageDir = PRE_TO_PA(sKernelVirtualPageRoot[index]);
|
||||||
|
|
||||||
get_physical_page_tmap(physicalPageDir,
|
get_physical_page_tmap(physicalPageDir,
|
||||||
(addr_t *)&pageDirEntry, PHYSICAL_PAGE_NO_WAIT);
|
(addr_t *)&pageDirEntry, PHYSICAL_PAGE_DONT_WAIT);
|
||||||
|
|
||||||
index = VADDR_TO_PDENT(queryPage);
|
index = VADDR_TO_PDENT(queryPage);
|
||||||
physicalPageTable = PDE_TO_PA(pageDirEntry[index]);
|
physicalPageTable = PDE_TO_PA(pageDirEntry[index]);
|
||||||
|
|
||||||
get_physical_page_tmap(physicalPageTable,
|
get_physical_page_tmap(physicalPageTable,
|
||||||
(addr_t *)&pageTableEntry, PHYSICAL_PAGE_NO_WAIT);
|
(addr_t *)&pageTableEntry, PHYSICAL_PAGE_DONT_WAIT);
|
||||||
|
|
||||||
index = VADDR_TO_PTENT(queryPage);
|
index = VADDR_TO_PTENT(queryPage);
|
||||||
|
|
||||||
|
|||||||
@@ -374,7 +374,7 @@ query_tmap(vm_translation_map *map, addr_t va, addr_t *_outPhysical, uint32 *_ou
|
|||||||
|
|
||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
map_iospace_chunk(addr_t va, addr_t pa)
|
map_iospace_chunk(addr_t va, addr_t pa, uint32 flags)
|
||||||
{
|
{
|
||||||
pa &= ~(B_PAGE_SIZE - 1); // make sure it's page aligned
|
pa &= ~(B_PAGE_SIZE - 1); // make sure it's page aligned
|
||||||
va &= ~(B_PAGE_SIZE - 1); // make sure it's page aligned
|
va &= ~(B_PAGE_SIZE - 1); // make sure it's page aligned
|
||||||
|
|||||||
@@ -379,7 +379,7 @@ map_tmap(vm_translation_map *map, addr_t va, addr_t pa, uint32 attributes)
|
|||||||
// now, fill in the pentry
|
// now, fill in the pentry
|
||||||
do {
|
do {
|
||||||
err = get_physical_page_tmap(ADDR_REVERSE_SHIFT(pd[index].addr),
|
err = get_physical_page_tmap(ADDR_REVERSE_SHIFT(pd[index].addr),
|
||||||
(addr_t *)&pt, PHYSICAL_PAGE_NO_WAIT);
|
(addr_t *)&pt, PHYSICAL_PAGE_DONT_WAIT);
|
||||||
} while (err < 0);
|
} while (err < 0);
|
||||||
index = VADDR_TO_PTENT(va);
|
index = VADDR_TO_PTENT(va);
|
||||||
|
|
||||||
@@ -425,7 +425,7 @@ restart:
|
|||||||
|
|
||||||
do {
|
do {
|
||||||
status = get_physical_page_tmap(ADDR_REVERSE_SHIFT(pd[index].addr),
|
status = get_physical_page_tmap(ADDR_REVERSE_SHIFT(pd[index].addr),
|
||||||
(addr_t *)&pt, PHYSICAL_PAGE_NO_WAIT);
|
(addr_t *)&pt, PHYSICAL_PAGE_DONT_WAIT);
|
||||||
} while (status < B_OK);
|
} while (status < B_OK);
|
||||||
|
|
||||||
for (index = VADDR_TO_PTENT(start); (index < 1024) && (start < end);
|
for (index = VADDR_TO_PTENT(start); (index < 1024) && (start < end);
|
||||||
@@ -517,7 +517,7 @@ query_tmap(vm_translation_map *map, addr_t va, addr_t *_physical, uint32 *_flags
|
|||||||
|
|
||||||
do {
|
do {
|
||||||
status = get_physical_page_tmap(ADDR_REVERSE_SHIFT(pd[index].addr),
|
status = get_physical_page_tmap(ADDR_REVERSE_SHIFT(pd[index].addr),
|
||||||
(addr_t *)&pt, PHYSICAL_PAGE_NO_WAIT);
|
(addr_t *)&pt, PHYSICAL_PAGE_DONT_WAIT);
|
||||||
} while (status < B_OK);
|
} while (status < B_OK);
|
||||||
index = VADDR_TO_PTENT(va);
|
index = VADDR_TO_PTENT(va);
|
||||||
|
|
||||||
@@ -573,7 +573,7 @@ restart:
|
|||||||
|
|
||||||
do {
|
do {
|
||||||
status = get_physical_page_tmap(ADDR_REVERSE_SHIFT(pd[index].addr),
|
status = get_physical_page_tmap(ADDR_REVERSE_SHIFT(pd[index].addr),
|
||||||
(addr_t *)&pt, PHYSICAL_PAGE_NO_WAIT);
|
(addr_t *)&pt, PHYSICAL_PAGE_DONT_WAIT);
|
||||||
} while (status < B_OK);
|
} while (status < B_OK);
|
||||||
|
|
||||||
for (index = VADDR_TO_PTENT(start); index < 1024 && start < end; index++, start += B_PAGE_SIZE) {
|
for (index = VADDR_TO_PTENT(start); index < 1024 && start < end; index++, start += B_PAGE_SIZE) {
|
||||||
@@ -619,7 +619,7 @@ clear_flags_tmap(vm_translation_map *map, addr_t va, uint32 flags)
|
|||||||
|
|
||||||
do {
|
do {
|
||||||
status = get_physical_page_tmap(ADDR_REVERSE_SHIFT(pd[index].addr),
|
status = get_physical_page_tmap(ADDR_REVERSE_SHIFT(pd[index].addr),
|
||||||
(addr_t *)&pt, PHYSICAL_PAGE_NO_WAIT);
|
(addr_t *)&pt, PHYSICAL_PAGE_DONT_WAIT);
|
||||||
} while (status < B_OK);
|
} while (status < B_OK);
|
||||||
index = VADDR_TO_PTENT(va);
|
index = VADDR_TO_PTENT(va);
|
||||||
|
|
||||||
@@ -706,7 +706,7 @@ flush_tmap(vm_translation_map *map)
|
|||||||
|
|
||||||
|
|
||||||
static status_t
|
static status_t
|
||||||
map_iospace_chunk(addr_t va, addr_t pa)
|
map_iospace_chunk(addr_t va, addr_t pa, uint32 flags)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
page_table_entry *pt;
|
page_table_entry *pt;
|
||||||
@@ -979,7 +979,7 @@ arch_vm_translation_map_init_post_area(kernel_args *args)
|
|||||||
physicalPageTable = ADDR_REVERSE_SHIFT(sKernelVirtualPageDirectory[index].addr);
|
physicalPageTable = ADDR_REVERSE_SHIFT(sKernelVirtualPageDirectory[index].addr);
|
||||||
|
|
||||||
get_physical_page_tmap(physicalPageTable,
|
get_physical_page_tmap(physicalPageTable,
|
||||||
(addr_t *)&pageTableEntry, PHYSICAL_PAGE_NO_WAIT);
|
(addr_t *)&pageTableEntry, PHYSICAL_PAGE_DONT_WAIT);
|
||||||
|
|
||||||
index = VADDR_TO_PTENT((addr_t)sQueryPageTable);
|
index = VADDR_TO_PTENT((addr_t)sQueryPageTable);
|
||||||
put_page_table_entry_in_pgtable(&pageTableEntry[index], physicalPageTable,
|
put_page_table_entry_in_pgtable(&pageTableEntry[index], physicalPageTable,
|
||||||
|
|||||||
+3
-3
@@ -235,7 +235,7 @@ read_into_cache(file_cache_ref *ref, void *cookie, off_t offset,
|
|||||||
addr_t virtualAddress;
|
addr_t virtualAddress;
|
||||||
if (vm_get_physical_page(
|
if (vm_get_physical_page(
|
||||||
pages[i]->physical_page_number * B_PAGE_SIZE,
|
pages[i]->physical_page_number * B_PAGE_SIZE,
|
||||||
&virtualAddress, PHYSICAL_PAGE_CAN_WAIT) < B_OK) {
|
&virtualAddress, 0) < B_OK) {
|
||||||
panic("could not get physical page");
|
panic("could not get physical page");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -334,7 +334,7 @@ write_to_cache(file_cache_ref *ref, void *cookie, off_t offset,
|
|||||||
|
|
||||||
addr_t virtualAddress;
|
addr_t virtualAddress;
|
||||||
vm_get_physical_page(page->physical_page_number * B_PAGE_SIZE,
|
vm_get_physical_page(page->physical_page_number * B_PAGE_SIZE,
|
||||||
&virtualAddress, PHYSICAL_PAGE_CAN_WAIT);
|
&virtualAddress, 0);
|
||||||
|
|
||||||
add_to_iovec(vecs, vecCount, MAX_IO_VECS, virtualAddress, B_PAGE_SIZE);
|
add_to_iovec(vecs, vecCount, MAX_IO_VECS, virtualAddress, B_PAGE_SIZE);
|
||||||
// ToDo: check if the array is large enough!
|
// ToDo: check if the array is large enough!
|
||||||
@@ -649,7 +649,7 @@ cache_io(void *_cacheRef, void *cookie, off_t offset, addr_t buffer,
|
|||||||
|
|
||||||
addr_t virtualAddress;
|
addr_t virtualAddress;
|
||||||
vm_get_physical_page(page->physical_page_number * B_PAGE_SIZE,
|
vm_get_physical_page(page->physical_page_number * B_PAGE_SIZE,
|
||||||
&virtualAddress, PHYSICAL_PAGE_CAN_WAIT);
|
&virtualAddress, 0);
|
||||||
|
|
||||||
// copy the contents of the page already in memory
|
// copy the contents of the page already in memory
|
||||||
if (doWrite) {
|
if (doWrite) {
|
||||||
|
|||||||
@@ -3107,7 +3107,8 @@ display_mem(int argc, char **argv)
|
|||||||
gKernelStartup = true;
|
gKernelStartup = true;
|
||||||
// vm_get_physical_page() needs to lock...
|
// vm_get_physical_page() needs to lock...
|
||||||
|
|
||||||
if (vm_get_physical_page(address, ©Address, PHYSICAL_PAGE_NO_WAIT) != B_OK) {
|
if (vm_get_physical_page(address, ©Address, PHYSICAL_PAGE_DONT_WAIT)
|
||||||
|
!= B_OK) {
|
||||||
kprintf("getting the hardware page failed.");
|
kprintf("getting the hardware page failed.");
|
||||||
gKernelStartup = false;
|
gKernelStartup = false;
|
||||||
return 0;
|
return 0;
|
||||||
@@ -4624,11 +4625,13 @@ if (cacheOffset == 0x12000)
|
|||||||
|
|
||||||
// try to get a mapping for the src and dest page so we can copy it
|
// try to get a mapping for the src and dest page so we can copy it
|
||||||
for (;;) {
|
for (;;) {
|
||||||
map->ops->get_physical_page(sourcePage->physical_page_number * B_PAGE_SIZE,
|
map->ops->get_physical_page(
|
||||||
(addr_t *)&source, PHYSICAL_PAGE_CAN_WAIT);
|
sourcePage->physical_page_number * B_PAGE_SIZE,
|
||||||
|
(addr_t *)&source, 0);
|
||||||
|
|
||||||
if (map->ops->get_physical_page(page->physical_page_number * B_PAGE_SIZE,
|
if (map->ops->get_physical_page(
|
||||||
(addr_t *)&dest, PHYSICAL_PAGE_NO_WAIT) == B_OK)
|
page->physical_page_number * B_PAGE_SIZE,
|
||||||
|
(addr_t *)&dest, PHYSICAL_PAGE_DONT_WAIT) == B_OK)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// it couldn't map the second one, so sleep and retry
|
// it couldn't map the second one, so sleep and retry
|
||||||
|
|||||||
@@ -817,7 +817,7 @@ clear_page(struct vm_page *page)
|
|||||||
{
|
{
|
||||||
addr_t virtualAddress;
|
addr_t virtualAddress;
|
||||||
vm_get_physical_page(page->physical_page_number << PAGE_SHIFT,
|
vm_get_physical_page(page->physical_page_number << PAGE_SHIFT,
|
||||||
&virtualAddress, PHYSICAL_PAGE_CAN_WAIT);
|
&virtualAddress, 0);
|
||||||
|
|
||||||
memset((void *)virtualAddress, 0, B_PAGE_SIZE);
|
memset((void *)virtualAddress, 0, B_PAGE_SIZE);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user