Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 196665
b: refs/heads/master
c: f90ece2
h: refs/heads/master
i:
  196663: ff3b9f1
v: v3
  • Loading branch information
Michael Neuling authored and Benjamin Herrenschmidt committed May 21, 2010
1 parent 5ad31f3 commit dea2e8c
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 095c7965f4dc870ed2b65143b1e2610de653416c
refs/heads/master: f90ece28c1f5b3ec13fe481406857fe92f4bc7d1
1 change: 1 addition & 0 deletions trunk/arch/powerpc/include/asm/hvcall.h
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ long plpar_hcall_raw(unsigned long opcode, unsigned long *retbuf, ...);
*/
#define PLPAR_HCALL9_BUFSIZE 9
long plpar_hcall9(unsigned long opcode, unsigned long *retbuf, ...);
long plpar_hcall9_raw(unsigned long opcode, unsigned long *retbuf, ...);

/* For hcall instrumentation. One structure per-hcall, per-CPU */
struct hcall_stats {
Expand Down
38 changes: 38 additions & 0 deletions trunk/arch/powerpc/platforms/pseries/hvCall.S
Original file line number Diff line number Diff line change
Expand Up @@ -228,3 +228,41 @@ _GLOBAL(plpar_hcall9)
mtcrf 0xff,r0

blr /* return r3 = status */

/* See plpar_hcall_raw to see why this is needed */
_GLOBAL(plpar_hcall9_raw)
HMT_MEDIUM

mfcr r0
stw r0,8(r1)

std r4,STK_PARM(r4)(r1) /* Save ret buffer */

mr r4,r5
mr r5,r6
mr r6,r7
mr r7,r8
mr r8,r9
mr r9,r10
ld r10,STK_PARM(r11)(r1) /* put arg7 in R10 */
ld r11,STK_PARM(r12)(r1) /* put arg8 in R11 */
ld r12,STK_PARM(r13)(r1) /* put arg9 in R12 */

HVSC /* invoke the hypervisor */

mr r0,r12
ld r12,STK_PARM(r4)(r1)
std r4, 0(r12)
std r5, 8(r12)
std r6, 16(r12)
std r7, 24(r12)
std r8, 32(r12)
std r9, 40(r12)
std r10,48(r12)
std r11,56(r12)
std r0, 64(r12)

lwz r0,8(r1)
mtcrf 0xff,r0

blr /* return r3 = status */
18 changes: 18 additions & 0 deletions trunk/arch/powerpc/platforms/pseries/plpar_wrappers.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,24 @@ static inline long plpar_pte_read_raw(unsigned long flags, unsigned long ptex,
return rc;
}

/*
* plpar_pte_read_4_raw can be called in real mode.
* ptes must be 8*sizeof(unsigned long)
*/
static inline long plpar_pte_read_4_raw(unsigned long flags, unsigned long ptex,
unsigned long *ptes)

{
long rc;
unsigned long retbuf[PLPAR_HCALL9_BUFSIZE];

rc = plpar_hcall9_raw(H_READ, retbuf, flags | H_READ_4, ptex);

memcpy(ptes, retbuf, 8*sizeof(unsigned long));

return rc;
}

static inline long plpar_pte_protect(unsigned long flags, unsigned long ptex,
unsigned long avpn)
{
Expand Down

0 comments on commit dea2e8c

Please sign in to comment.