Path: blob/master/arch/s390/include/asm/appldata.h
10818 views
/*1* include/asm-s390/appldata.h2*3* Copyright (C) IBM Corp. 20064*5* Author(s): Melissa Howland <[email protected]>6*/78#ifndef _ASM_S390_APPLDATA_H9#define _ASM_S390_APPLDATA_H1011#include <asm/io.h>1213#ifndef CONFIG_64BIT1415#define APPLDATA_START_INTERVAL_REC 0x00 /* Function codes for */16#define APPLDATA_STOP_REC 0x01 /* DIAG 0xDC */17#define APPLDATA_GEN_EVENT_REC 0x0218#define APPLDATA_START_CONFIG_REC 0x031920/*21* Parameter list for DIAGNOSE X'DC'22*/23struct appldata_parameter_list {24u16 diag; /* The DIAGNOSE code X'00DC' */25u8 function; /* The function code for the DIAGNOSE */26u8 parlist_length; /* Length of the parameter list */27u32 product_id_addr; /* Address of the 16-byte product ID */28u16 reserved;29u16 buffer_length; /* Length of the application data buffer */30u32 buffer_addr; /* Address of the application data buffer */31} __attribute__ ((packed));3233#else /* CONFIG_64BIT */3435#define APPLDATA_START_INTERVAL_REC 0x8036#define APPLDATA_STOP_REC 0x8137#define APPLDATA_GEN_EVENT_REC 0x8238#define APPLDATA_START_CONFIG_REC 0x833940/*41* Parameter list for DIAGNOSE X'DC'42*/43struct appldata_parameter_list {44u16 diag;45u8 function;46u8 parlist_length;47u32 unused01;48u16 reserved;49u16 buffer_length;50u32 unused02;51u64 product_id_addr;52u64 buffer_addr;53} __attribute__ ((packed));5455#endif /* CONFIG_64BIT */5657struct appldata_product_id {58char prod_nr[7]; /* product number */59u16 prod_fn; /* product function */60u8 record_nr; /* record number */61u16 version_nr; /* version */62u16 release_nr; /* release */63u16 mod_lvl; /* modification level */64} __attribute__ ((packed));6566static inline int appldata_asm(struct appldata_product_id *id,67unsigned short fn, void *buffer,68unsigned short length)69{70struct appldata_parameter_list parm_list;71int ry;7273if (!MACHINE_IS_VM)74return -ENOSYS;75parm_list.diag = 0xdc;76parm_list.function = fn;77parm_list.parlist_length = sizeof(parm_list);78parm_list.buffer_length = length;79parm_list.product_id_addr = (unsigned long) id;80parm_list.buffer_addr = virt_to_phys(buffer);81asm volatile(82" diag %1,%0,0xdc"83: "=d" (ry)84: "d" (&parm_list), "m" (parm_list), "m" (*id)85: "cc");86return ry;87}8889#endif /* _ASM_S390_APPLDATA_H */909192