Changeset View
Changeset View
Standalone View
Standalone View
sys/powerpc/ofw/ofw_real.c
Context not available. | |||||
* we have a 32-bit virtual address to give OF. | * we have a 32-bit virtual address to give OF. | ||||
*/ | */ | ||||
if (!ofw_real_mode && !hw_direct_map) | if (!ofw_real_mode && (!hw_direct_map || DMAP_BASE_ADDRESS != 0)) | ||||
pmap_kenter(of_bounce_phys, of_bounce_phys); | pmap_kenter(of_bounce_phys, of_bounce_phys); | ||||
mtx_unlock(&of_bounce_mtx); | mtx_unlock(&of_bounce_mtx); | ||||
Context not available. | |||||
* can use right now is memory mapped by firmware. | * can use right now is memory mapped by firmware. | ||||
*/ | */ | ||||
if (!pmap_bootstrapped) | if (!pmap_bootstrapped) | ||||
return (cell_t)(uintptr_t)buf; | return (cell_t)((uintptr_t)buf & ~DMAP_BASE_ADDRESS); | ||||
/* | /* | ||||
* XXX: It is possible for us to get called before the VM has | * XXX: It is possible for us to get called before the VM has | ||||
Context not available. | |||||
* Copy into the emergency buffer, and reset at the end. | * Copy into the emergency buffer, and reset at the end. | ||||
*/ | */ | ||||
of_bounce_virt = emergency_buffer; | of_bounce_virt = emergency_buffer; | ||||
of_bounce_phys = (vm_offset_t)of_bounce_virt; | of_bounce_phys = (vm_offset_t)of_bounce_virt & | ||||
~DMAP_BASE_ADDRESS; | |||||
of_bounce_size = sizeof(emergency_buffer); | of_bounce_size = sizeof(emergency_buffer); | ||||
} | } | ||||
Context not available. | |||||
* Make sure the bounce page offset satisfies any reasonable | * Make sure the bounce page offset satisfies any reasonable | ||||
* alignment constraint. | * alignment constraint. | ||||
*/ | */ | ||||
of_bounce_offset += sizeof(register_t) - (of_bounce_offset % sizeof(register_t)); | of_bounce_offset += sizeof(register_t) - | ||||
(of_bounce_offset % sizeof(register_t)); | |||||
if (of_bounce_offset + len > of_bounce_size) { | if (of_bounce_offset + len > of_bounce_size) { | ||||
panic("Oversize Open Firmware call!"); | panic("Oversize Open Firmware call!"); | ||||
Context not available. |