HvCallHpt.h 3.5 KB
Newer Older
L
Linus Torvalds 已提交
1 2 3
/*
 * HvCallHpt.h
 * Copyright (C) 2001  Mike Corrigan IBM Corporation
4
 *
L
Linus Torvalds 已提交
5 6 7 8
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
9
 *
L
Linus Torvalds 已提交
10 11 12 13
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
14
 *
L
Linus Torvalds 已提交
15 16 17 18 19 20 21
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 */
#ifndef _HVCALLHPT_H
#define _HVCALLHPT_H

22 23 24 25
/*
 * This file contains the "hypervisor call" interface which is used to
 * drive the hypervisor from the OS.
 */
L
Linus Torvalds 已提交
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43

#include <asm/iSeries/HvCallSc.h>
#include <asm/iSeries/HvTypes.h>
#include <asm/mmu.h>

#define HvCallHptGetHptAddress		HvCallHpt +  0
#define HvCallHptGetHptPages		HvCallHpt +  1
#define HvCallHptSetPp			HvCallHpt +  5
#define HvCallHptSetSwBits		HvCallHpt +  6
#define HvCallHptUpdate			HvCallHpt +  7
#define HvCallHptInvalidateNoSyncICache	HvCallHpt +  8
#define HvCallHptGet			HvCallHpt + 11
#define HvCallHptFindNextValid		HvCallHpt + 12
#define HvCallHptFindValid		HvCallHpt + 13
#define HvCallHptAddValidate		HvCallHpt + 16
#define HvCallHptInvalidateSetSwBitsGet HvCallHpt + 18


44
static inline u64 HvCallHpt_getHptAddress(void)
L
Linus Torvalds 已提交
45 46 47 48 49
{
	u64 retval = HvCall0(HvCallHptGetHptAddress);
	// getPaca()->adjustHmtForNoOfSpinLocksHeld();
	return retval;
}
50 51 52

static inline u64 HvCallHpt_getHptPages(void)
{
L
Linus Torvalds 已提交
53 54 55 56
	u64 retval = HvCall0(HvCallHptGetHptPages);
	// getPaca()->adjustHmtForNoOfSpinLocksHeld();
	return retval;
}
57 58

static inline void HvCallHpt_setPp(u32 hpteIndex, u8 value)
L
Linus Torvalds 已提交
59
{
60
	HvCall2(HvCallHptSetPp, hpteIndex, value);
L
Linus Torvalds 已提交
61 62
	// getPaca()->adjustHmtForNoOfSpinLocksHeld();
}
63 64

static inline void HvCallHpt_setSwBits(u32 hpteIndex, u8 bitson, u8 bitsoff)
L
Linus Torvalds 已提交
65
{
66
	HvCall3(HvCallHptSetSwBits, hpteIndex, bitson, bitsoff);
L
Linus Torvalds 已提交
67 68
	// getPaca()->adjustHmtForNoOfSpinLocksHeld();
}
69 70

static inline void HvCallHpt_invalidateNoSyncICache(u32 hpteIndex)
L
Linus Torvalds 已提交
71
{
72
	HvCall1(HvCallHptInvalidateNoSyncICache, hpteIndex);
L
Linus Torvalds 已提交
73 74
	// getPaca()->adjustHmtForNoOfSpinLocksHeld();
}
75 76 77

static inline u64 HvCallHpt_invalidateSetSwBitsGet(u32 hpteIndex, u8 bitson,
		u8 bitsoff)
L
Linus Torvalds 已提交
78 79
{
	u64 compressedStatus;
80 81 82 83

	compressedStatus = HvCall4(HvCallHptInvalidateSetSwBitsGet,
			hpteIndex, bitson, bitsoff, 1);
	HvCall1(HvCallHptInvalidateNoSyncICache, hpteIndex);
L
Linus Torvalds 已提交
84 85 86
	// getPaca()->adjustHmtForNoOfSpinLocksHeld();
	return compressedStatus;
}
87 88

static inline u64 HvCallHpt_findValid(HPTE *hpte, u64 vpn)
L
Linus Torvalds 已提交
89 90 91 92 93
{
	u64 retIndex = HvCall3Ret16( HvCallHptFindValid, hpte, vpn, 0, 0 );
	// getPaca()->adjustHmtForNoOfSpinLocksHeld();
	return retIndex;
}
94 95 96

static inline u64 HvCallHpt_findNextValid(HPTE *hpte, u32 hpteIndex,
		u8 bitson, u8 bitsoff)
L
Linus Torvalds 已提交
97 98 99 100 101
{
	u64 retIndex = HvCall3Ret16( HvCallHptFindNextValid, hpte, hpteIndex, bitson, bitsoff );
	// getPaca()->adjustHmtForNoOfSpinLocksHeld();
	return retIndex;
}
102 103

static inline void HvCallHpt_get(HPTE *hpte, u32 hpteIndex)
L
Linus Torvalds 已提交
104
{
105
	HvCall2Ret16(HvCallHptGet, hpte, hpteIndex, 0);
L
Linus Torvalds 已提交
106 107
	// getPaca()->adjustHmtForNoOfSpinLocksHeld();
}
108 109

static inline void HvCallHpt_addValidate(u32 hpteIndex, u32 hBit, HPTE *hpte)
L
Linus Torvalds 已提交
110
{
111 112
	HvCall4(HvCallHptAddValidate, hpteIndex, hBit, (*((u64 *)hpte)),
			(*(((u64 *)hpte)+1)));
L
Linus Torvalds 已提交
113 114 115 116
	// getPaca()->adjustHmtForNoOfSpinLocksHeld();
}

#endif /* _HVCALLHPT_H */