tsc_delta = sub64(tsc1, tsc0);
lapic_bus_freq[cpuid] = system_hz * lapic_delta / (PROBE_TICKS - 1);
- BOOT_VERBOSE(printf("APIC bus freq %lu MHz\n",
+ BOOT_VERBOSE(printf("APIC bus freq %u MHz\n",
lapic_bus_freq[cpuid] / 1000000));
cpu_freq = mul64(div64u64(tsc_delta, PROBE_TICKS - 1), make64(system_hz, 0));
cpu_set_freq(cpuid, cpu_freq);
ioa[n].gsi_base = acpi_ioa->global_int_base;
ioa[n].pins = ((ioapic_read(ioa[n].addr,
IOAPIC_VERSION) & 0xff0000) >> 16)+1;
- printf("IO APIC %d addr 0x%x paddr 0x%x pins %d\n",
+ printf("IO APIC %d addr 0x%lx paddr 0x%lx pins %d\n",
acpi_ioa->id, ioa[n].addr, ioa[n].paddr,
ioa[n].pins);
if (machine.acpi_rsdp)
status = acpi_get_ioapics(io_apic, &nioapics, MAX_NR_IOAPICS);
+ else
+ status = 0;
if (!status) {
/* try something different like MPS */
}
vir_bytes bytes; /* # of bytes to be copied */
{
vir_bytes linear;
- u32_t phys = 0;
+ phys_bytes phys = 0;
if(!(linear = umap_local(rp, seg, vir_addr, bytes))) {
printf("SYSTEM:umap_virtual: umap_local failed\n");
phys = 0;
} else {
if(vm_lookup(rp, linear, &phys, NULL) != OK) {
- printf("SYSTEM:umap_virtual: vm_lookup of %s: seg 0x%lx: 0x%lx failed\n", rp->p_name, seg, vir_addr);
+ printf("SYSTEM:umap_virtual: vm_lookup of %s: seg 0x%x: 0x%lx failed\n", rp->p_name, seg, vir_addr);
phys = 0;
} else {
if(phys == 0)
* so that the umap makes sense.
*/
if(bytes > 0 && !vm_contiguous(rp, linear, bytes)) {
- printf("umap_virtual: %s: %d at 0x%lx (vir 0x%lx) not contiguous\n",
+ printf("umap_virtual: %s: %lu at 0x%lx (vir 0x%lx) not contiguous\n",
rp->p_name, bytes, linear, vir_addr);
return 0;
}
* vm_lookup *
*===========================================================================*/
PUBLIC int vm_lookup(const struct proc *proc, const vir_bytes virtual,
- vir_bytes *physical, u32_t *ptent)
+ phys_bytes *physical, u32_t *ptent)
{
u32_t *root, *pt;
int pde, pte;
PUBLIC int vm_contiguous(const struct proc *targetproc, vir_bytes vir_buf, size_t bytes)
{
int first = 1, r;
- u32_t prev_phys = 0; /* Keep lints happy. */
+ phys_bytes prev_phys = 0; /* Keep lints happy. */
u32_t po;
assert(targetproc);
/* Keep going as long as we cross a page boundary. */
while(bytes > 0) {
- u32_t phys;
+ phys_bytes phys;
if((r=vm_lookup(targetproc, vir_buf, &phys, NULL)) != OK) {
printf("vm_contiguous: vm_lookup failed, %d\n", r);
if (copy_msg_to_user(rp, &rp->p_delivermsg,
(message *) rp->p_delivermsg_vir)) {
- printf("WARNING wrong user pointer 0x%08x from "
+ printf("WARNING wrong user pointer 0x%08lx from "
"process %s / %d\n",
rp->p_delivermsg_vir,
rp->p_name,
vir_addr[i]->offset, bytes);
if(phys_addr[i] == 0) {
printf("virtual_copy: map 0x%x failed for %s seg %d, "
- "offset %lx, len %d, i %d\n",
+ "offset %lx, len %lu, i %d\n",
type, p->p_name, seg_index, vir_addr[i]->offset,
bytes, i);
}
/* can't copy to/from process with PT without VM */
#define NOPT(p) (!(p) || !HASPT(p))
if(!NOPT(procs[_SRC_])) {
- printf("ignoring page table src: %s / %d at 0x%lx\n",
+ printf("ignoring page table src: %s / %d at 0x%x\n",
procs[_SRC_]->p_name, procs[_SRC_]->p_endpoint, procs[_SRC_]->p_seg.p_cr3);
}
if(!NOPT(procs[_DST_])) {
- printf("ignoring page table dst: %s / %d at 0x%lx\n",
+ printf("ignoring page table dst: %s / %d at 0x%x\n",
procs[_DST_]->p_name, procs[_DST_]->p_endpoint,
procs[_DST_]->p_seg.p_cr3);
}
_PROTOTYPE( int arch_do_vmctl, (message *m_ptr, struct proc *p));
_PROTOTYPE( int vm_contiguous, (const struct proc *targetproc, vir_bytes vir_buf, size_t count));
_PROTOTYPE( void proc_stacktrace, (struct proc *proc) );
-_PROTOTYPE( int vm_lookup, (const struct proc *proc, vir_bytes virtual, vir_bytes *result, u32_t *ptent));
+_PROTOTYPE( int vm_lookup, (const struct proc *proc, vir_bytes virtual, phys_bytes *result, u32_t *ptent));
_PROTOTYPE( void delivermsg, (struct proc *target));
_PROTOTYPE( void arch_do_syscall, (struct proc *proc) );
_PROTOTYPE( int arch_phys_map, (int index, phys_bytes *addr,