Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 3581 → Rev 3582

/branches/sparc/boot/arch/sparc64/loader/main.c
39,6 → 39,10
#include <string.h>
 
bootinfo_t bootinfo;
 
/** UltraSPARC subarchitecture - 1 for US, 3 for US3 */
uint8_t subarchitecture;
 
component_t components[COMPONENTS];
 
char *release = RELEASE;
63,6 → 67,21
release, revision, timestamp);
}
 
#define FIRST_US3_CPU 0x14
#define LAST_US3_CPU 0x19
static void detect_subarchitecture(void)
{
uint64_t v;
asm volatile ("rdpr %%ver, %0\n" : "=r" (v));
v = (v << 16) >> 48;
if ((v >= FIRST_US3_CPU) && (v <= LAST_US3_CPU)) {
subarchitecture = SUBARCH_US3;
} else if (v < FIRST_US3_CPU) {
subarchitecture = SUBARCH_US;
}
}
 
void bootstrap(void)
{
void *base = (void *) KERNEL_VIRTUAL_ADDRESS;
72,6 → 91,7
 
version_print();
detect_subarchitecture();
init_components(components);
 
if (!ofw_get_physmem_start(&bootinfo.physmem_start)) {