loader: remove shouting from ORB's variable name
[hvf.git] / cp / include / cpu.h
blobbb7a311031224c7217515591bb56aafb3711bf8f
1 /*
2 * (C) Copyright 2007-2010 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
4 * This file is released under the GPLv2. See the COPYING file for more
5 * details.
6 */
8 #ifndef __CPU_H
9 #define __CPU_H
11 static inline u64 getcpuid()
13 u64 cpuid = ~0;
15 asm("stidp 0(%1)\n"
16 : /* output */
17 "=m" (cpuid)
18 : /* input */
19 "a" (&cpuid)
22 return cpuid;
25 static inline u16 getcpuaddr()
27 u16 cpuaddr = ~0;
29 asm("stap 0(%1)\n"
30 : /* output */
31 "=m" (cpuaddr)
32 : /* input */
33 "a" (&cpuaddr)
36 return cpuaddr;
39 #endif