-
-#ifdef CONFIG_HP300
-/* This is a hack. The HP NetBSD bootloader loads us at an arbitrary
- address (apparently 0xff002000 in practice) which is not good if we need
- to be able to map this to VA 0x1000. We could do it with pagetables but
- a better solution seems to be to relocate the kernel in physical memory
- before we start.
-
- So, we copy the entire kernel image (code+data+bss) down to the 16MB
- boundary that marks the start of RAM. This is slightly tricky because
- we must not overwrite the copying code itself. :-) */
-
-/* 15/5/98. The start address of physical RAM changes depending on how much
- RAM is present. This is actually a blessing in disguise as it provides
- a way for us to work out the RAM size rather than hardwiring it. */
-
- lea %pc@(_start),%a0
- movel %a0,%d6
- and #0xffff0000, %d6
- lea %pc@(hp300_phys_ram_base),%a0
- movel %d6, %a0@
- movel %pc@(L(custom)),%a3
- moveb #0xfe,%d7
- moveb %d7,%a3@(0x1ffff)
- lea %pc@(Lcopystart),%a0
- lea %pc@(Lcopyend),%a1
- movel %d6,%a2 /* Start of physical RAM */
-1: moveb %a0@+,%d0
- moveb %d0,%a2@+
- cmpl %a0,%a1
- jbne 1b
- movel %d6,%a2
- moveb #0xfd,%d7
- moveb %d7,%a3@(0x1ffff)
- lea %pc@(_stext),%a0
- lea %pc@(_end),%a1
- jmp %a2@
-
-Lcopystart:
- moveb #0xf7,%d7
- moveb %d7,%a3@(0x1ffff)
- movel %d6,%a2 /* Start of kernel */
- add #0x1000,%a2
-1: moveb %a0@+,%d0
- moveb %d0,%a2@+
- cmpl %a0,%a1
- jbne 1b
- moveb #0,%d7
- moveb %d7,%a3@(0x1ffff)
- movel %d6,%a0
- addl #Lstart1,%a0
- jmp %a0@
-Lcopyend:
-
-Lstart1:
- moveb #0x3f,%d7
- moveb %d7,%a3@(0x1ffff)
-#endif /* CONFIG_HP300 */
-