PageRenderTime 21ms CodeModel.GetById 12ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/arch/ppc64/kernel/hvCall.S

https://bitbucket.org/evzijst/gittest
Assembly | 98 lines | 75 code | 23 blank | 0 comment | 0 complexity | aabb5b9cfd93c5aed59046d8efdbcc91 MD5 | raw file
 1/*
 2 * arch/ppc64/kernel/hvCall.S
 3 *
 4 *
 5 * This file contains the code to perform calls to the
 6 * iSeries LPAR hypervisor
 7 *
 8 * This program is free software; you can redistribute it and/or
 9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version
11 * 2 of the License, or (at your option) any later version.
12 */
13
14#include <asm/ppc_asm.h>
15#include <asm/processor.h>
16
17	.text
18
19/* 
20 * Hypervisor call
21 * 
22 * Invoke the iSeries hypervisor via the System Call instruction
23 * Parameters are passed to this routine in registers r3 - r10
24 * 
25 * r3 contains the HV function to be called
26 * r4-r10 contain the operands to the hypervisor function
27 *
28 */
29
30_GLOBAL(HvCall)
31_GLOBAL(HvCall0)
32_GLOBAL(HvCall1)
33_GLOBAL(HvCall2)
34_GLOBAL(HvCall3)
35_GLOBAL(HvCall4)
36_GLOBAL(HvCall5)
37_GLOBAL(HvCall6)
38_GLOBAL(HvCall7)
39
40
41	mfcr	r0
42	std	r0,-8(r1)
43	stdu	r1,-(STACK_FRAME_OVERHEAD+16)(r1)
44	
45	/* r0 = 0xffffffffffffffff indicates a hypervisor call */
46	
47	li	r0,-1
48	
49	/* Invoke the hypervisor */
50
51	sc
52
53	ld	r1,0(r1)
54	ld	r0,-8(r1)
55	mtcrf	0xff,r0
56
57	/*  return to caller, return value in r3 */
58	
59	blr
60
61_GLOBAL(HvCall0Ret16)
62_GLOBAL(HvCall1Ret16)
63_GLOBAL(HvCall2Ret16)
64_GLOBAL(HvCall3Ret16)
65_GLOBAL(HvCall4Ret16)
66_GLOBAL(HvCall5Ret16)
67_GLOBAL(HvCall6Ret16)
68_GLOBAL(HvCall7Ret16)
69
70	mfcr	r0
71	std	r0,-8(r1)
72	std	r31,-16(r1)
73	stdu	r1,-(STACK_FRAME_OVERHEAD+32)(r1)
74
75	mr	r31,r4
76	li	r0,-1
77	mr	r4,r5
78	mr	r5,r6
79	mr	r6,r7
80	mr	r7,r8
81	mr	r8,r9
82	mr	r9,r10
83
84	sc
85
86	std	r3,0(r31)
87	std	r4,8(r31)
88
89	mr	r3,r5
90
91	ld	r1,0(r1)
92	ld	r0,-8(r1)
93	mtcrf	0xff,r0
94	ld	r31,-16(r1)
95	
96	blr
97
98