int copytoram(void *rom, void *ram) { u_int count; u_int64_t *rdata, *pdata; /* * Copy ROM to RAM memory. */ pdata = (u_int64_t *)rom; rdata = (u_int64_t *)CACHED_TO_UNCACHED(ram); count = CACHED_TO_PHYS(end) - CACHED_TO_PHYS(ram); while(count > 0) { *rdata++ = *pdata++; count -= sizeof(*rdata); } /* * Verify copy ROM to RAM memory. */ pdata = (u_int64_t *)rom; rdata = (u_int64_t *)CACHED_TO_UNCACHED(ram); count = CACHED_TO_PHYS(end) - CACHED_TO_PHYS(ram); while(count > 0) { if(*rdata++ != *pdata++) { return((int)rdata - sizeof(*rdata)); /* non zero */ } count -= sizeof(*rdata); } clearbss(); return(0); }
void abort() /* go into infinite loop on termination of kernel */ { /* these are called from startup but we can't make an entry for startup */ clearbss(); main(); }