Subversion Repositories HelenOS

Rev

Rev 2927 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2927 Rev 4345
Line 34... Line 34...
34
 */
34
 */
35
 
35
 
36
#include <arch/cpu.h>
36
#include <arch/cpu.h>
37
#include <cpu.h>
37
#include <cpu.h>
38
#include <arch.h>
38
#include <arch.h>
39
#include <print.h>  
39
#include <print.h>
40
 
40
 
41
/** Number of indexes left out in the #imp_data array */
41
/** Number of indexes left out in the #imp_data array */
42
#define IMP_DATA_START_OFFSET 0x40
42
#define IMP_DATA_START_OFFSET 0x40
43
 
43
 
44
/** Implementators (vendor) names */
44
/** Implementators (vendor) names */
Line 80... Line 80...
80
 */
80
 */
81
static void arch_cpu_identify(cpu_arch_t *cpu)
81
static void arch_cpu_identify(cpu_arch_t *cpu)
82
{
82
{
83
    uint32_t ident;
83
    uint32_t ident;
84
    asm volatile (
84
    asm volatile (
85
        "mrc p15, 0, %0, c0, c0, 0\n"
85
        "mrc p15, 0, %[ident], c0, c0, 0\n"
86
        : "=r" (ident)
86
        : [ident] "=r" (ident)
87
    );
87
    );
88
 
88
   
89
    cpu->imp_num = ident >> 24;
89
    cpu->imp_num = ident >> 24;
90
    cpu->variant_num = (ident << 8) >> 28;
90
    cpu->variant_num = (ident << 8) >> 28;
91
    cpu->arch_num = (ident << 12) >> 28;
91
    cpu->arch_num = (ident << 12) >> 28;
92
    cpu->prim_part_num = (ident << 16) >> 20;
92
    cpu->prim_part_num = (ident << 16) >> 20;
93
    cpu->rev_num = (ident << 28) >> 28;
93
    cpu->rev_num = (ident << 28) >> 28;