Path: blob/master/arch/powerpc/platforms/iseries/call_hpt.h
10820 views
/*1* Copyright (C) 2001 Mike Corrigan IBM Corporation2*3* This program is free software; you can redistribute it and/or modify4* it under the terms of the GNU General Public License as published by5* the Free Software Foundation; either version 2 of the License, or6* (at your option) any later version.7*8* This program is distributed in the hope that it will be useful,9* but WITHOUT ANY WARRANTY; without even the implied warranty of10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the11* GNU General Public License for more details.12*13* You should have received a copy of the GNU General Public License14* along with this program; if not, write to the Free Software15* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA16*/17#ifndef _PLATFORMS_ISERIES_CALL_HPT_H18#define _PLATFORMS_ISERIES_CALL_HPT_H1920/*21* This file contains the "hypervisor call" interface which is used to22* drive the hypervisor from the OS.23*/2425#include <asm/iseries/hv_call_sc.h>26#include <asm/iseries/hv_types.h>27#include <asm/mmu.h>2829#define HvCallHptGetHptAddress HvCallHpt + 030#define HvCallHptGetHptPages HvCallHpt + 131#define HvCallHptSetPp HvCallHpt + 532#define HvCallHptSetSwBits HvCallHpt + 633#define HvCallHptUpdate HvCallHpt + 734#define HvCallHptInvalidateNoSyncICache HvCallHpt + 835#define HvCallHptGet HvCallHpt + 1136#define HvCallHptFindNextValid HvCallHpt + 1237#define HvCallHptFindValid HvCallHpt + 1338#define HvCallHptAddValidate HvCallHpt + 1639#define HvCallHptInvalidateSetSwBitsGet HvCallHpt + 18404142static inline u64 HvCallHpt_getHptAddress(void)43{44return HvCall0(HvCallHptGetHptAddress);45}4647static inline u64 HvCallHpt_getHptPages(void)48{49return HvCall0(HvCallHptGetHptPages);50}5152static inline void HvCallHpt_setPp(u32 hpteIndex, u8 value)53{54HvCall2(HvCallHptSetPp, hpteIndex, value);55}5657static inline void HvCallHpt_setSwBits(u32 hpteIndex, u8 bitson, u8 bitsoff)58{59HvCall3(HvCallHptSetSwBits, hpteIndex, bitson, bitsoff);60}6162static inline void HvCallHpt_invalidateNoSyncICache(u32 hpteIndex)63{64HvCall1(HvCallHptInvalidateNoSyncICache, hpteIndex);65}6667static inline u64 HvCallHpt_invalidateSetSwBitsGet(u32 hpteIndex, u8 bitson,68u8 bitsoff)69{70u64 compressedStatus;7172compressedStatus = HvCall4(HvCallHptInvalidateSetSwBitsGet,73hpteIndex, bitson, bitsoff, 1);74HvCall1(HvCallHptInvalidateNoSyncICache, hpteIndex);75return compressedStatus;76}7778static inline u64 HvCallHpt_findValid(struct hash_pte *hpte, u64 vpn)79{80return HvCall3Ret16(HvCallHptFindValid, hpte, vpn, 0, 0);81}8283static inline u64 HvCallHpt_findNextValid(struct hash_pte *hpte, u32 hpteIndex,84u8 bitson, u8 bitsoff)85{86return HvCall3Ret16(HvCallHptFindNextValid, hpte, hpteIndex,87bitson, bitsoff);88}8990static inline void HvCallHpt_get(struct hash_pte *hpte, u32 hpteIndex)91{92HvCall2Ret16(HvCallHptGet, hpte, hpteIndex, 0);93}9495static inline void HvCallHpt_addValidate(u32 hpteIndex, u32 hBit,96struct hash_pte *hpte)97{98HvCall4(HvCallHptAddValidate, hpteIndex, hBit, hpte->v, hpte->r);99}100101#endif /* _PLATFORMS_ISERIES_CALL_HPT_H */102103104