OpenCores
URL https://opencores.org/ocsvn/c0or1k/c0or1k/trunk

Subversion Repositories c0or1k

[/] [c0or1k/] [trunk/] [include/] [l4/] [arch/] [arm/] [v6/] [cpu.h] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 drasko
/*
2
 * Cpu specific features
3
 * defined upon the base architecture.
4
 *
5
 * Copyright (C) 2010 B Labs Ltd.
6
 * Written by Bahadir Balban
7
 */
8
 
9
#ifndef __V6_CPU_H__
10
#define __V6_CPU_H__
11
 
12
#include INC_SUBARCH(mmu_ops.h)
13
 
14
#define MPIDR_CPUID_MASK                0x7
15
 
16
/* Read multi-processor affinity register */
17
static inline unsigned int __attribute__((always_inline))
18
cp15_read_mpidr(void)
19
{
20
        unsigned int val;
21
 
22
        __asm__ __volatile__ (
23
                "mrc  p15, 0, %0, c0, c0, 5\n"
24
                : "=r" (val)
25
                :
26
        );
27
 
28
        return val;
29
}
30
 
31
static inline int smp_get_cpuid()
32
{
33
        volatile u32 mpidr = cp15_read_mpidr();
34
 
35
        return mpidr & MPIDR_CPUID_MASK;
36
}
37
 
38
static inline void cpu_startup(void)
39
{
40
 
41
}
42
 
43
#endif /* __V6_CPU_H__ */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.