repo.or.cz
/
hvf.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
loader: remove shouting from ORB's variable name
[hvf.git]
/
cp
/
include
/
cpu.h
blob
bb7a311031224c7217515591bb56aafb3711bf8f
1
/*
2
* (C) Copyright 2007-2010 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
3
*
4
* This file is released under the GPLv2. See the COPYING file for more
5
* details.
6
*/
7
8
#ifndef __CPU_H
9
#define __CPU_H
10
11
static
inline
u64
getcpuid
()
12
{
13
u64 cpuid
= ~
0
;
14
15
asm
(
"stidp 0(%1)
\n
"
16
:
/* output */
17
"=m"
(
cpuid
)
18
:
/* input */
19
"a"
(&
cpuid
)
20
);
21
22
return
cpuid
;
23
}
24
25
static
inline
u16
getcpuaddr
()
26
{
27
u16 cpuaddr
= ~
0
;
28
29
asm
(
"stap 0(%1)
\n
"
30
:
/* output */
31
"=m"
(
cpuaddr
)
32
:
/* input */
33
"a"
(&
cpuaddr
)
34
);
35
36
return
cpuaddr
;
37
}
38
39
#endif