1 /* SPDX-License-Identifier: GPL-2.0 */
3 * s390 diagnose functions
5 * Copyright IBM Corp. 2007
6 * Author(s): Michael Holzheu <holzheu@de.ibm.com>
9 #ifndef _ASM_S390_DIAG_H
10 #define _ASM_S390_DIAG_H
12 #include <linux/if_ether.h>
13 #include <linux/percpu.h>
39 void diag_stat_inc(enum diag_stat_enum nr);
40 void diag_stat_inc_norecursion(enum diag_stat_enum nr);
43 * Diagnose 10: Release page range
45 static inline void diag10_range(unsigned long start_pfn, unsigned long num_pfn)
47 unsigned long start_addr, end_addr;
49 start_addr = start_pfn << PAGE_SHIFT;
50 end_addr = (start_pfn + num_pfn - 1) << PAGE_SHIFT;
52 diag_stat_inc(DIAG_STAT_X010);
54 "0: diag %0,%1,0x10\n"
58 : : "a" (start_addr), "a" (end_addr));
62 * Diagnose 14: Input spool file manipulation
64 extern int diag14(unsigned long rx, unsigned long ry1, unsigned long subcode);
67 * Diagnose 210: Get information about a virtual device
70 u16 vrdcdvno; /* device number (input) */
71 u16 vrdclen; /* data block length (input) */
72 u8 vrdcvcla; /* virtual device class (output) */
73 u8 vrdcvtyp; /* virtual device type (output) */
74 u8 vrdcvsta; /* virtual device status (output) */
75 u8 vrdcvfla; /* virtual device flags (output) */
76 u8 vrdcrccl; /* real device class (output) */
77 u8 vrdccrty; /* real device type (output) */
78 u8 vrdccrmd; /* real device model (output) */
79 u8 vrdccrft; /* real device feature (output) */
80 } __attribute__((packed, aligned(4)));
82 extern int diag210(struct diag210 *addr);
84 /* bit is set in flags, when physical cpu info is included in diag 204 data */
85 #define DIAG204_LPAR_PHYS_FLG 0x80
86 #define DIAG204_LPAR_NAME_LEN 8 /* lpar name len in diag 204 data */
87 #define DIAG204_CPU_NAME_LEN 16 /* type name len of cpus in diag224 name table */
89 /* diag 204 subcodes */
91 DIAG204_SUBC_STIB4 = 4,
93 DIAG204_SUBC_STIB6 = 6,
94 DIAG204_SUBC_STIB7 = 7
97 /* The two available diag 204 data formats */
99 DIAG204_INFO_SIMPLE = 0,
100 DIAG204_INFO_EXT = 0x00010000
103 enum diag204_cpu_flags {
104 DIAG204_CPU_ONLINE = 0x20,
105 DIAG204_CPU_CAPPED = 0x40,
108 struct diag204_info_blk_hdr {
117 struct diag204_x_info_blk_hdr {
128 struct diag204_part_hdr {
132 char part_name[DIAG204_LPAR_NAME_LEN];
135 struct diag204_x_part_hdr {
141 char part_name[DIAG204_LPAR_NAME_LEN];
152 char hardware_group_name[8];
156 struct diag204_cpu_info {
166 struct diag204_x_cpu_info {
183 __u32 group_cpu_type_cap;
187 struct diag204_phys_hdr {
194 struct diag204_x_phys_hdr {
202 struct diag204_phys_cpu {
211 struct diag204_x_phys_cpu {
221 struct diag204_x_part_block {
222 struct diag204_x_part_hdr hdr;
223 struct diag204_x_cpu_info cpus[];
226 struct diag204_x_phys_block {
227 struct diag204_x_phys_hdr hdr;
228 struct diag204_x_phys_cpu cpus[];
232 DIAG26C_MAC_SERVICES = 0x00000030
235 enum diag26c_version {
236 DIAG26C_VERSION2 = 0x00000002 /* z/VM 5.4.0 */
239 #define DIAG26C_GET_MAC 0x0000
240 struct diag26c_mac_req {
248 struct diag26c_mac_resp {
254 int diag204(unsigned long subcode, unsigned long size, void *addr);
255 int diag224(void *ptr);
256 int diag26c(void *req, void *resp, enum diag26c_sc subcode);
257 #endif /* _ASM_S390_DIAG_H */