2 * s390 diagnose functions
4 * Copyright IBM Corp. 2007
5 * Author(s): Michael Holzheu <holzheu@de.ibm.com>
8 #ifndef _ASM_S390_DIAG_H
9 #define _ASM_S390_DIAG_H
11 #include <linux/percpu.h>
36 void diag_stat_inc(enum diag_stat_enum nr
);
37 void diag_stat_inc_norecursion(enum diag_stat_enum nr
);
40 * Diagnose 10: Release page range
42 static inline void diag10_range(unsigned long start_pfn
, unsigned long num_pfn
)
44 unsigned long start_addr
, end_addr
;
46 start_addr
= start_pfn
<< PAGE_SHIFT
;
47 end_addr
= (start_pfn
+ num_pfn
- 1) << PAGE_SHIFT
;
49 diag_stat_inc(DIAG_STAT_X010
);
51 "0: diag %0,%1,0x10\n"
55 : : "a" (start_addr
), "a" (end_addr
));
59 * Diagnose 14: Input spool file manipulation
61 extern int diag14(unsigned long rx
, unsigned long ry1
, unsigned long subcode
);
64 * Diagnose 210: Get information about a virtual device
67 u16 vrdcdvno
; /* device number (input) */
68 u16 vrdclen
; /* data block length (input) */
69 u8 vrdcvcla
; /* virtual device class (output) */
70 u8 vrdcvtyp
; /* virtual device type (output) */
71 u8 vrdcvsta
; /* virtual device status (output) */
72 u8 vrdcvfla
; /* virtual device flags (output) */
73 u8 vrdcrccl
; /* real device class (output) */
74 u8 vrdccrty
; /* real device type (output) */
75 u8 vrdccrmd
; /* real device model (output) */
76 u8 vrdccrft
; /* real device feature (output) */
77 } __attribute__((packed
, aligned(4)));
79 extern int diag210(struct diag210
*addr
);
81 /* bit is set in flags, when physical cpu info is included in diag 204 data */
82 #define DIAG204_LPAR_PHYS_FLG 0x80
83 #define DIAG204_LPAR_NAME_LEN 8 /* lpar name len in diag 204 data */
84 #define DIAG204_CPU_NAME_LEN 16 /* type name len of cpus in diag224 name table */
86 /* diag 204 subcodes */
88 DIAG204_SUBC_STIB4
= 4,
90 DIAG204_SUBC_STIB6
= 6,
91 DIAG204_SUBC_STIB7
= 7
94 /* The two available diag 204 data formats */
96 DIAG204_INFO_SIMPLE
= 0,
97 DIAG204_INFO_EXT
= 0x00010000
100 enum diag204_cpu_flags
{
101 DIAG204_CPU_ONLINE
= 0x20,
102 DIAG204_CPU_CAPPED
= 0x40,
105 struct diag204_info_blk_hdr
{
114 struct diag204_x_info_blk_hdr
{
125 struct diag204_part_hdr
{
129 char part_name
[DIAG204_LPAR_NAME_LEN
];
132 struct diag204_x_part_hdr
{
138 char part_name
[DIAG204_LPAR_NAME_LEN
];
149 char hardware_group_name
[8];
153 struct diag204_cpu_info
{
163 struct diag204_x_cpu_info
{
180 __u32 group_cpu_type_cap
;
184 struct diag204_phys_hdr
{
191 struct diag204_x_phys_hdr
{
199 struct diag204_phys_cpu
{
208 struct diag204_x_phys_cpu
{
218 struct diag204_x_part_block
{
219 struct diag204_x_part_hdr hdr
;
220 struct diag204_x_cpu_info cpus
[];
223 struct diag204_x_phys_block
{
224 struct diag204_x_phys_hdr hdr
;
225 struct diag204_x_phys_cpu cpus
[];
228 int diag204(unsigned long subcode
, unsigned long size
, void *addr
);
229 int diag224(void *ptr
);
230 #endif /* _ASM_S390_DIAG_H */