16 #ifndef _CRYPTO_ARCH_S390_CRYPT_S390_H
17 #define _CRYPTO_ARCH_S390_CRYPT_S390_H
19 #include <asm/errno.h>
22 #define CRYPT_S390_OP_MASK 0xFF00
23 #define CRYPT_S390_FUNC_MASK 0x00FF
25 #define CRYPT_S390_PRIORITY 300
26 #define CRYPT_S390_COMPOSITE_PRIORITY 400
28 #define CRYPT_S390_MSA 0x1
29 #define CRYPT_S390_MSA3 0x2
30 #define CRYPT_S390_MSA4 0x4
154 static inline int crypt_s390_km(
long func,
void *
param,
158 register void *__param
asm(
"1") = param;
159 register const u8 *__src
asm(
"2") = src;
160 register long __src_len
asm(
"3") = src_len;
161 register u8 *__dest
asm(
"4") = dest;
165 "0: .insn rre,0xb92e0000,%3,%1 \n"
170 :
"=d" (
ret),
"+a" (__src),
"+d" (__src_len),
"+a" (__dest)
171 :
"d" (__func),
"a" (__param),
"0" (-1) :
"cc",
"memory");
190 static inline int crypt_s390_kmc(
long func,
void *
param,
194 register void *__param
asm(
"1") = param;
195 register const u8 *__src
asm(
"2") = src;
196 register long __src_len
asm(
"3") = src_len;
197 register u8 *__dest
asm(
"4") = dest;
201 "0: .insn rre,0xb92f0000,%3,%1 \n"
206 : "=
d" (ret), "+
a" (__src), "+
d" (__src_len), "+
a" (__dest)
207 : "
d" (__func), "
a" (__param), "0" (-1) : "
cc", "
memory");
226 static
inline int crypt_s390_kimd(
long func,
void *param,
230 register void *__param
asm(
"1") = param;
231 register const u8 *__src
asm(
"2") = src;
232 register long __src_len
asm(
"3") = src_len;
236 "0: .insn rre,0xb93e0000,%1,%1 \n"
241 : "=
d" (ret), "+
a" (__src), "+
d" (__src_len)
242 : "
d" (__func), "
a" (__param), "0" (-1) : "cc", "memory");
260 static
inline int crypt_s390_klmd(
long func,
void *param,
264 register void *__param
asm(
"1") = param;
265 register const u8 *__src
asm(
"2") = src;
266 register long __src_len
asm(
"3") = src_len;
270 "0: .insn rre,0xb93f0000,%1,%1 \n"
275 : "=
d" (ret), "+
a" (__src), "+
d" (__src_len)
276 : "
d" (__func), "
a" (__param), "0" (-1) : "cc", "memory");
295 static
inline int crypt_s390_kmac(
long func,
void *param,
299 register void *__param
asm(
"1") = param;
300 register const u8 *__src
asm(
"2") = src;
301 register long __src_len
asm(
"3") = src_len;
305 "0: .insn rre,0xb91e0000,%1,%1 \n"
310 : "=
d" (ret), "+
a" (__src), "+
d" (__src_len)
311 : "
d" (__func), "
a" (__param), "0" (-1) : "cc", "memory");
331 static
inline int crypt_s390_kmctr(
long func,
void *param,
u8 *dest,
335 register void *__param
asm(
"1") = param;
336 register const u8 *__src
asm(
"2") = src;
337 register long __src_len
asm(
"3") = src_len;
338 register u8 *__dest
asm(
"4") = dest;
339 register u8 *__ctr
asm(
"6") = counter;
343 "0: .insn rrf,0xb92d0000,%3,%1,%4,0 \n"
348 : "+
d" (ret), "+
a" (__src), "+
d" (__src_len), "+
a" (__dest),
350 : "
d" (__func), "
a" (__param) : "cc", "memory");
364 static
inline int crypt_s390_func_available(
int func,
365 unsigned int facility_mask)
374 (!test_facility(2) || !test_facility(76)))
377 (!test_facility(2) || !test_facility(77)))
407 return (status[func >> 3] & (0x80 >> (func & 7))) != 0;
419 static inline int crypt_s390_pcc(
long func,
void *param)
421 register long __func
asm(
"0") = func & 0x7f;
422 register void *__param
asm(
"1") = param;
426 "0: .insn rre,0xb92c0000,0,0 \n"
432 : "
d" (__func), "
a" (__param) : "cc", "memory");