#include <sys/param.h>
#include <sys/device.h>
#include <sys/reboot.h>
#include <sys/hibernate.h>
#include <sys/systm.h>
#include <uvm/uvm_extern.h>
#if defined(NFSCLIENT)
#include <net/if.h>
#include <net/if_types.h>
#include <netinet/in.h>
#include <netinet/if_ether.h>
#endif
extern void dumpconf(void);
void
unmap_startup(void)
{
extern void *_start, *endboot;
vaddr_t p = (vaddr_t)&_start;
do {
pmap_kremove(p, PAGE_SIZE);
p += PAGE_SIZE;
} while (p < (vaddr_t)&endboot);
}
void
cpu_configure(void)
{
splhigh();
softintr_init();
config_rootfound("mainbus", NULL);
unmap_startup();
cold = 0;
spl0();
}
void
diskconf(void)
{
#if defined(NFSCLIENT)
extern uint8_t *bootmac;
dev_t tmpdev = NODEV;
#endif
struct device *bootdv = NULL;
int part = 0;
#if defined(NFSCLIENT)
if (bootmac) {
struct ifnet *ifp;
TAILQ_FOREACH(ifp, &ifnetlist, if_list) {
if (ifp->if_type == IFT_ETHER &&
memcmp(bootmac, ((struct arpcom *)ifp)->ac_enaddr,
ETHER_ADDR_LEN) == 0)
break;
}
if (ifp)
bootdv = parsedisk(ifp->if_xname, strlen(ifp->if_xname),
0, &tmpdev);
}
#endif
setroot(bootdv, part, RB_USERREQ);
dumpconf();
#ifdef HIBERNATE
hibernate_resume();
#endif
}
void
device_register(struct device *dev, void *aux)
{
}
const struct nam2blk nam2blk[] = {
{ "wd", 0 },
{ "sd", 4 },
{ "cd", 6 },
{ "rd", 8 },
{ "vnd", 14 },
{ NULL, -1 }
};