Subversion Repositories HelenOS-historic

Rev

Rev 473 | Rev 501 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 473 Rev 476
Line 25... Line 25...
25
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
 */
27
 */
28
 
28
 
29
#include <cpu.h>
29
#include <cpu.h>
-
 
30
#include <arch.h>
-
 
31
#include <arch/register.h>
-
 
32
#include <print.h>
30
 
33
 
31
void cpu_arch_init(void)
34
void cpu_arch_init(void)
32
{
35
{
33
}
36
}
34
 
37
 
-
 
38
void cpu_identify(void)
-
 
39
{
-
 
40
    CPU->arch.cpuid0 = cpuid_read(0);
-
 
41
    CPU->arch.cpuid1 = cpuid_read(1);
-
 
42
    CPU->arch.cpuid3.value = cpuid_read(3);
-
 
43
}
35
 
44
 
-
 
45
void cpu_print_report(cpu_t *m)
-
 
46
{
-
 
47
    char *family_str;
-
 
48
    char vendor[2*sizeof(__u64)+1];
-
 
49
   
-
 
50
    *((__u64 *) &vendor[0*sizeof(__u64)]) = CPU->arch.cpuid0;
-
 
51
    *((__u64 *) &vendor[1*sizeof(__u64)]) = CPU->arch.cpuid1;
-
 
52
    vendor[sizeof(vendor)-1] = '\0';
-
 
53
   
-
 
54
    switch(m->arch.cpuid3.family) {
-
 
55
        case FAMILY_ITANIUM:
-
 
56
            family_str = "Itanium";
-
 
57
        break;
-
 
58
        case FAMILY_ITANIUM2:
-
 
59
            family_str = "Itanium 2";
-
 
60
        break;
-
 
61
        default:
-
 
62
            family_str = "Unknown";
-
 
63
        break;
-
 
64
    }
-
 
65
   
-
 
66
    printf("cpu%d: %s (%s), archrev=%d, model=%d, revision=%d\n", CPU->id, family_str, vendor, CPU->arch.cpuid3.archrev, CPU->arch.cpuid3.model, CPU->arch.cpuid3.revision);
-
 
67
}