* Introduced structures {virtual,physical}_address_restrictions, which specify
restrictions for virtual/physical addresses.
* vm_page_allocate_page_run():
- Fixed conversion of base/limit to array indexes. sPhysicalPageOffset was not
taken into account.
- Takes a physical_address_restrictions instead of base/limit and also
supports alignment and boundary restrictions, now.
* map_backing_store(), VM[User,Kernel]AddressSpace::InsertArea()/
ReserveAddressRange() take a virtual_address_restrictions parameter, now. They
also support an alignment independent from the range size.
* create_area_etc(), vm_create_anonymous_area(): Take
{virtual,physical}_address_restrictions parameters, now.
* Removed no longer needed B_PHYSICAL_BASE_ADDRESS.
* DMAResources:
- Fixed potential overflows of uint32 when initializing from device node
attributes.
- Fixed bounce buffer creation TODOs: By using create_area_etc() with the
new restrictions parameters we can directly support physical high address,
boundary, and alignment.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37131 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -369,10 +369,14 @@ TracingMetaData::Create(TracingMetaData*& _metaData)
|
||||
if (error != B_OK)
|
||||
return error;
|
||||
|
||||
virtual_address_restrictions virtualRestrictions = {};
|
||||
virtualRestrictions.address_specification = B_ANY_KERNEL_ADDRESS;
|
||||
physical_address_restrictions physicalRestrictions = {};
|
||||
area = create_area_etc(B_SYSTEM_TEAM, "tracing log",
|
||||
(void**)&metaData->fTraceOutputBuffer, B_ANY_KERNEL_ADDRESS,
|
||||
kTraceOutputBufferSize + MAX_TRACE_SIZE, B_CONTIGUOUS,
|
||||
B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA, 0, CREATE_AREA_DONT_WAIT);
|
||||
B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA, CREATE_AREA_DONT_WAIT,
|
||||
&virtualRestrictions, &physicalRestrictions,
|
||||
(void**)&metaData->fTraceOutputBuffer);
|
||||
if (area < 0)
|
||||
return area;
|
||||
|
||||
@@ -411,13 +415,18 @@ TracingMetaData::_CreateMetaDataArea(bool findPrevious, area_id& _area,
|
||||
{
|
||||
// search meta data in memory (from previous session)
|
||||
TracingMetaData* metaData;
|
||||
addr_t metaDataAddress = kMetaDataBaseAddress;
|
||||
phys_addr_t metaDataAddress = kMetaDataBaseAddress;
|
||||
for (; metaDataAddress <= kMetaDataBaseEndAddress;
|
||||
metaDataAddress += kMetaDataAddressIncrement) {
|
||||
area_id area = create_area_etc(B_SYSTEM_TEAM, "tracing metadata",
|
||||
(void**)&metaData, B_ANY_KERNEL_ADDRESS, B_PAGE_SIZE,
|
||||
virtual_address_restrictions virtualRestrictions = {};
|
||||
virtualRestrictions.address_specification = B_ANY_KERNEL_ADDRESS;
|
||||
physical_address_restrictions physicalRestrictions = {};
|
||||
physicalRestrictions.low_address = metaDataAddress;
|
||||
physicalRestrictions.high_address = metaDataAddress + B_PAGE_SIZE;
|
||||
area_id create_area_etc(B_SYSTEM_TEAM, "tracing metadata", B_PAGE_SIZE,
|
||||
B_FULL_LOCK, B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA,
|
||||
metaDataAddress, CREATE_AREA_DONT_CLEAR);
|
||||
CREATE_AREA_DONT_CLEAR, &virtualRestrictions, &physicalRestrictions,
|
||||
(void**)&metaData);
|
||||
if (area < 0)
|
||||
continue;
|
||||
|
||||
@@ -463,11 +472,17 @@ TracingMetaData::_InitPreviousTracingData()
|
||||
}
|
||||
|
||||
// re-map the previous tracing buffer
|
||||
void* buffer = fTraceOutputBuffer;
|
||||
virtual_address_restrictions virtualRestrictions = {};
|
||||
virtualRestrictions.address = fTraceOutputBuffer;
|
||||
virtualRestrictions.address_specification = B_EXACT_ADDRESS;
|
||||
physical_address_restrictions physicalRestrictions = {};
|
||||
physicalRestrictions.low_address = fPhysicalAddress;
|
||||
physicalRestrictions.high_address = fPhysicalAddress
|
||||
+ ROUNDUP(kTraceOutputBufferSize + MAX_TRACE_SIZE);
|
||||
area_id area = create_area_etc(B_SYSTEM_TEAM, "tracing log",
|
||||
&buffer, B_EXACT_ADDRESS, kTraceOutputBufferSize + MAX_TRACE_SIZE,
|
||||
B_CONTIGUOUS, B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA,
|
||||
fPhysicalAddress, CREATE_AREA_DONT_CLEAR);
|
||||
kTraceOutputBufferSize + MAX_TRACE_SIZE, B_CONTIGUOUS,
|
||||
B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA, CREATE_AREA_DONT_CLEAR,
|
||||
&virtualRestrictions, &physicalRestrictions, NULL);
|
||||
if (area < 0) {
|
||||
dprintf("Failed to init tracing meta data: Mapping tracing log "
|
||||
"buffer failed: %s\n", strerror(area));
|
||||
@@ -475,7 +490,7 @@ TracingMetaData::_InitPreviousTracingData()
|
||||
}
|
||||
|
||||
dprintf("ktrace: Remapped tracing buffer at %p, size: %" B_PRIuSIZE "\n",
|
||||
buffer, kTraceOutputBufferSize + MAX_TRACE_SIZE);
|
||||
fTraceOutputBuffer, kTraceOutputBufferSize + MAX_TRACE_SIZE);
|
||||
|
||||
// verify/repair the tracing entry list
|
||||
uint32 errorCount = 0;
|
||||
|
||||
Reference in New Issue
Block a user