Changeset View
Changeset View
Standalone View
Standalone View
head/stand/powerpc/ofw/main.c
Show First 20 Lines • Show All 83 Lines • ▼ Show 20 Lines | for (i = 0; i < sz; i += (acells + scells)) { | ||||
if (scells > 1) | if (scells > 1) | ||||
memsz += (uint64_t)reg[i + acells] << 32; | memsz += (uint64_t)reg[i + acells] << 32; | ||||
memsz += reg[i + acells + scells - 1]; | memsz += reg[i + acells + scells - 1]; | ||||
} | } | ||||
return (memsz); | return (memsz); | ||||
} | } | ||||
#ifdef CAS | |||||
extern int ppc64_cas(void); | |||||
static int | |||||
ppc64_autoload(void) | |||||
{ | |||||
const char *cas; | |||||
if ((cas = getenv("cas")) && cas[0] == '1') | |||||
if (ppc64_cas() != 0) | |||||
return (-1); | |||||
return (ofw_autoload()); | |||||
} | |||||
#endif | |||||
int | int | ||||
main(int (*openfirm)(void *)) | main(int (*openfirm)(void *)) | ||||
{ | { | ||||
phandle_t root; | phandle_t root; | ||||
int i; | int i; | ||||
char bootpath[64]; | char bootpath[64]; | ||||
char *ch; | char *ch; | ||||
int bargc; | int bargc; | ||||
▲ Show 20 Lines • Show All 64 Lines • ▼ Show 20 Lines | main(int (*openfirm)(void *)) | ||||
*/ | */ | ||||
if (!(mfmsr() & PSL_DR)) | if (!(mfmsr() & PSL_DR)) | ||||
setenv("usefdt", "1", 1); | setenv("usefdt", "1", 1); | ||||
archsw.arch_getdev = ofw_getdev; | archsw.arch_getdev = ofw_getdev; | ||||
archsw.arch_copyin = ofw_copyin; | archsw.arch_copyin = ofw_copyin; | ||||
archsw.arch_copyout = ofw_copyout; | archsw.arch_copyout = ofw_copyout; | ||||
archsw.arch_readin = ofw_readin; | archsw.arch_readin = ofw_readin; | ||||
#ifdef CAS | |||||
setenv("cas", "1", 0); | |||||
archsw.arch_autoload = ppc64_autoload; | |||||
#else | |||||
archsw.arch_autoload = ofw_autoload; | archsw.arch_autoload = ofw_autoload; | ||||
#endif | |||||
interact(); /* doesn't return */ | interact(); /* doesn't return */ | ||||
OF_exit(); | OF_exit(); | ||||
return 0; | return 0; | ||||
} | } | ||||
Show All 19 Lines |