Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 1903 → Rev 1899

/trunk/boot/arch/sparc64/loader/ofwarch.c
35,7 → 35,6
#include <ofw.h>
#include <printf.h>
#include <string.h>
#include <register.h>
#include "main.h"
 
void write(const char *str, const int len)
54,6 → 53,11
return flag != -1;
}
 
 
#define ASI_UPA_CONFIG 0x4a
#define UPA_CONFIG_MID_SHIFT 17
#define UPA_CONFIG_MID_MASK 0x1f
 
int ofw_cpu(void)
{
char type_name[BUF_SIZE];
70,10 → 74,8
__asm__ volatile ("ldxa [%1] %2, %0\n" : "=r" (current_mid) : "r" (0), "i" (ASI_UPA_CONFIG));
current_mid >>= UPA_CONFIG_MID_SHIFT;
current_mid &= UPA_CONFIG_MID_MASK;
 
int cpus;
for (cpus = 0; node != 0 && node != -1; node = ofw_get_peer_node(node), cpus++) {
for (; node != 0 && node != -1; node = ofw_get_peer_node(node)) {
if (ofw_get_property(node, "device_type", type_name, sizeof(type_name)) > 0) {
if (strcmp(type_name, "cpu") == 0) {
uint32_t mid;
91,5 → 93,5
}
}
 
return cpus;
return 1;
}
/trunk/boot/arch/sparc64/loader/register.h
32,8 → 32,4
#define PSTATE_IE_BIT 2
#define PSTATE_AM_BIT 8
 
#define ASI_UPA_CONFIG 0x4a
#define UPA_CONFIG_MID_SHIFT 17
#define UPA_CONFIG_MID_MASK 0x1f
 
#endif