powerpc/pmac: Use string library in nvram code
[deliverable/linux.git] / arch / powerpc / platforms / iseries / call_hpt.h
CommitLineData
1da177e4 1/*
1da177e4 2 * Copyright (C) 2001 Mike Corrigan IBM Corporation
45dc76aa 3 *
1da177e4
LT
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
45dc76aa 8 *
1da177e4
LT
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
45dc76aa 13 *
1da177e4
LT
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
0e29bb1a
SR
18#ifndef _PLATFORMS_ISERIES_CALL_HPT_H
19#define _PLATFORMS_ISERIES_CALL_HPT_H
1da177e4 20
45dc76aa
SR
21/*
22 * This file contains the "hypervisor call" interface which is used to
23 * drive the hypervisor from the OS.
24 */
1da177e4 25
50592f5d 26#include <asm/iseries/hv_call_sc.h>
1ec65d76 27#include <asm/iseries/hv_types.h>
1da177e4
LT
28#include <asm/mmu.h>
29
1da177e4
LT
30#define HvCallHptGetHptAddress HvCallHpt + 0
31#define HvCallHptGetHptPages HvCallHpt + 1
32#define HvCallHptSetPp HvCallHpt + 5
33#define HvCallHptSetSwBits HvCallHpt + 6
34#define HvCallHptUpdate HvCallHpt + 7
35#define HvCallHptInvalidateNoSyncICache HvCallHpt + 8
36#define HvCallHptGet HvCallHpt + 11
37#define HvCallHptFindNextValid HvCallHpt + 12
38#define HvCallHptFindValid HvCallHpt + 13
39#define HvCallHptAddValidate HvCallHpt + 16
40#define HvCallHptInvalidateSetSwBitsGet HvCallHpt + 18
41
42
45dc76aa 43static inline u64 HvCallHpt_getHptAddress(void)
1da177e4 44{
6b7feecb 45 return HvCall0(HvCallHptGetHptAddress);
1da177e4 46}
45dc76aa
SR
47
48static inline u64 HvCallHpt_getHptPages(void)
49{
6b7feecb 50 return HvCall0(HvCallHptGetHptPages);
1da177e4 51}
45dc76aa
SR
52
53static inline void HvCallHpt_setPp(u32 hpteIndex, u8 value)
1da177e4 54{
45dc76aa 55 HvCall2(HvCallHptSetPp, hpteIndex, value);
1da177e4 56}
45dc76aa
SR
57
58static inline void HvCallHpt_setSwBits(u32 hpteIndex, u8 bitson, u8 bitsoff)
1da177e4 59{
45dc76aa 60 HvCall3(HvCallHptSetSwBits, hpteIndex, bitson, bitsoff);
1da177e4 61}
45dc76aa
SR
62
63static inline void HvCallHpt_invalidateNoSyncICache(u32 hpteIndex)
1da177e4 64{
45dc76aa 65 HvCall1(HvCallHptInvalidateNoSyncICache, hpteIndex);
1da177e4 66}
45dc76aa
SR
67
68static inline u64 HvCallHpt_invalidateSetSwBitsGet(u32 hpteIndex, u8 bitson,
69 u8 bitsoff)
1da177e4
LT
70{
71 u64 compressedStatus;
45dc76aa
SR
72
73 compressedStatus = HvCall4(HvCallHptInvalidateSetSwBitsGet,
74 hpteIndex, bitson, bitsoff, 1);
75 HvCall1(HvCallHptInvalidateNoSyncICache, hpteIndex);
1da177e4
LT
76 return compressedStatus;
77}
45dc76aa 78
8e561e7e 79static inline u64 HvCallHpt_findValid(struct hash_pte *hpte, u64 vpn)
1da177e4 80{
6b7feecb 81 return HvCall3Ret16(HvCallHptFindValid, hpte, vpn, 0, 0);
1da177e4 82}
45dc76aa 83
8e561e7e 84static inline u64 HvCallHpt_findNextValid(struct hash_pte *hpte, u32 hpteIndex,
45dc76aa 85 u8 bitson, u8 bitsoff)
1da177e4 86{
6b7feecb
SR
87 return HvCall3Ret16(HvCallHptFindNextValid, hpte, hpteIndex,
88 bitson, bitsoff);
1da177e4 89}
45dc76aa 90
8e561e7e 91static inline void HvCallHpt_get(struct hash_pte *hpte, u32 hpteIndex)
1da177e4 92{
45dc76aa 93 HvCall2Ret16(HvCallHptGet, hpte, hpteIndex, 0);
1da177e4 94}
45dc76aa 95
8e561e7e
DG
96static inline void HvCallHpt_addValidate(u32 hpteIndex, u32 hBit,
97 struct hash_pte *hpte)
1da177e4 98{
96e28449 99 HvCall4(HvCallHptAddValidate, hpteIndex, hBit, hpte->v, hpte->r);
1da177e4
LT
100}
101
0e29bb1a 102#endif /* _PLATFORMS_ISERIES_CALL_HPT_H */
This page took 0.772244 seconds and 5 git commands to generate.