int check_range(unsigned long vstart, unsigned long vend, unsigned long kstart, unsigned long kend) { unsigned long vaddr, kaddr; #ifdef DEBUG_CHECK_RANGE srm_printk("check_range: V[0x%lx:0x%lx] K[0x%lx:0x%lx]\n", vstart, vend, kstart, kend); #endif /* do some range checking for detecting an overlap... */ for (vaddr = vstart; vaddr <= vend; vaddr += PAGE_SIZE) { kaddr = (find_pa(vaddr) | PAGE_OFFSET); if (kaddr >= kstart && kaddr <= kend) { #ifdef DEBUG_CHECK_RANGE srm_printk("OVERLAP: vaddr 0x%lx kaddr 0x%lx" " [0x%lx:0x%lx]\n", vaddr, kaddr, kstart, kend); #endif return 1; } } return 0; }
void pal_init(void) { unsigned long i, rev; struct percpu_struct * percpu; struct pcb_struct * pcb_pa; /* Create the dummy PCB. */ pcb_va->ksp = 0; pcb_va->usp = 0; pcb_va->ptbr = L1[1] >> 32; pcb_va->asn = 0; pcb_va->pcc = 0; pcb_va->unique = 0; pcb_va->flags = 1; pcb_va->res1 = 0; pcb_va->res2 = 0; pcb_pa = (struct pcb_struct *)find_pa((unsigned long)pcb_va); /* * a0 = 2 (OSF) * a1 = return address, but we give the asm the vaddr of the PCB * a2 = physical addr of PCB * a3 = new virtual page table pointer * a4 = KSP (but the asm sets it) */ srm_printk("Switching to OSF PAL-code... "); i = switch_to_osf_pal(2, pcb_va, pcb_pa, VPTB); if (i) { srm_printk("failed, code %ld\n", i); __halt(); } percpu = (struct percpu_struct *) (INIT_HWRPB->processor_offset + (unsigned long) INIT_HWRPB); rev = percpu->pal_revision = percpu->palcode_avail[2]; srm_printk("OK (rev %lx)\n", rev); tbia(); /* do it directly in case we are SMP */ }
void pal_init(void) { unsigned long i, rev; struct percpu_struct * percpu; struct pcb_struct * pcb_pa; /* */ pcb_va->ksp = 0; pcb_va->usp = 0; pcb_va->ptbr = L1[1] >> 32; pcb_va->asn = 0; pcb_va->pcc = 0; pcb_va->unique = 0; pcb_va->flags = 1; pcb_va->res1 = 0; pcb_va->res2 = 0; pcb_pa = find_pa(VPTB, pcb_va); /* */ srm_printk("Switching to OSF PAL-code .. "); i = switch_to_osf_pal(2, pcb_va, pcb_pa, VPTB); if (i) { srm_printk("failed, code %ld\n", i); __halt(); } percpu = (struct percpu_struct *) (INIT_HWRPB->processor_offset + (unsigned long) INIT_HWRPB); rev = percpu->pal_revision = percpu->palcode_avail[2]; srm_printk("Ok (rev %lx)\n", rev); tbia(); /* */ }
static inline long load(long dev, unsigned long addr, unsigned long count) { char bootfile[256]; extern char _end; long result, boot_size = &_end - (char *) BOOT_ADDR; result = callback_getenv(ENV_BOOTED_FILE, bootfile, 255); if (result < 0) return result; result &= 255; bootfile[result] = '\0'; if (result) srm_printk("Boot file specification (%s) not implemented\n", bootfile); return callback_read(dev, count, (void *)addr, boot_size/512 + 1); }