blob: 7e91c58072e259345610c3b8a17a93b48dc5d297 [file] [log] [blame]
Michael Holzheu0a87c5c2007-08-22 13:51:40 +02001/*
2 * s390 diagnose functions
3 *
4 * Copyright IBM Corp. 2007
5 * Author(s): Michael Holzheu <holzheu@de.ibm.com>
6 */
7
8#ifndef _ASM_S390_DIAG_H
9#define _ASM_S390_DIAG_H
10
11/*
Michael Holzheu83ace2702011-05-10 17:13:41 +020012 * Diagnose 10: Release page range
Michael Holzheu0a87c5c2007-08-22 13:51:40 +020013 */
Michael Holzheu83ace2702011-05-10 17:13:41 +020014static inline void diag10_range(unsigned long start_pfn, unsigned long num_pfn)
15{
16 unsigned long start_addr, end_addr;
17
18 start_addr = start_pfn << PAGE_SHIFT;
19 end_addr = (start_pfn + num_pfn - 1) << PAGE_SHIFT;
20
21 asm volatile(
22 "0: diag %0,%1,0x10\n"
23 "1:\n"
24 EX_TABLE(0b, 1b)
25 EX_TABLE(1b, 1b)
26 : : "a" (start_addr), "a" (end_addr));
27}
Michael Holzheu0a87c5c2007-08-22 13:51:40 +020028
29/*
30 * Diagnose 14: Input spool file manipulation
31 */
32extern int diag14(unsigned long rx, unsigned long ry1, unsigned long subcode);
33
34/*
35 * Diagnose 210: Get information about a virtual device
36 */
37struct diag210 {
38 u16 vrdcdvno; /* device number (input) */
39 u16 vrdclen; /* data block length (input) */
40 u8 vrdcvcla; /* virtual device class (output) */
41 u8 vrdcvtyp; /* virtual device type (output) */
42 u8 vrdcvsta; /* virtual device status (output) */
43 u8 vrdcvfla; /* virtual device flags (output) */
44 u8 vrdcrccl; /* real device class (output) */
45 u8 vrdccrty; /* real device type (output) */
46 u8 vrdccrmd; /* real device model (output) */
47 u8 vrdccrft; /* real device feature (output) */
48} __attribute__((packed, aligned(4)));
49
50extern int diag210(struct diag210 *addr);
51
52#endif /* _ASM_S390_DIAG_H */