1
2
3
4
5#include <asm/ppc-opcode.h>
6#include <asm/reg.h>
7
8
9
10
11
12
13
14
15
16
17
18
19static inline int vas_copy(void *crb, int offset)
20{
21 asm volatile(PPC_COPY(%0, %1)";"
22 :
23 : "b" (offset), "b" (crb)
24 : "memory");
25
26 return 0;
27}
28
29static inline int vas_paste(void *paste_address, int offset)
30{
31 u32 cr;
32
33 cr = 0;
34 asm volatile(PPC_PASTE(%1, %2)";"
35 "mfocrf %0, 0x80;"
36 : "=r" (cr)
37 : "b" (offset), "b" (paste_address)
38 : "memory", "cr0");
39
40
41 return (cr >> CR0_SHIFT) & 0xE;
42}
43