xref: /openbmc/linux/arch/s390/include/asm/cpcmd.h (revision b2441318)
1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
2c6557e7fSMartin Schwidefsky /*
3c6557e7fSMartin Schwidefsky  *  S390 version
4a53c8fabSHeiko Carstens  *    Copyright IBM Corp. 1999
5c6557e7fSMartin Schwidefsky  *    Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com),
6c6557e7fSMartin Schwidefsky  *               Christian Borntraeger (cborntra@de.ibm.com),
7c6557e7fSMartin Schwidefsky  */
8c6557e7fSMartin Schwidefsky 
9c6557e7fSMartin Schwidefsky #ifndef _ASM_S390_CPCMD_H
10c6557e7fSMartin Schwidefsky #define _ASM_S390_CPCMD_H
11c6557e7fSMartin Schwidefsky 
12c6557e7fSMartin Schwidefsky /*
13c6557e7fSMartin Schwidefsky  * the lowlevel function for cpcmd
14c6557e7fSMartin Schwidefsky  */
15cd4386a9SHeiko Carstens int __cpcmd(const char *cmd, char *response, int rlen, int *response_code);
16c6557e7fSMartin Schwidefsky 
17c6557e7fSMartin Schwidefsky /*
18c6557e7fSMartin Schwidefsky  * cpcmd is the in-kernel interface for issuing CP commands
19c6557e7fSMartin Schwidefsky  *
20c6557e7fSMartin Schwidefsky  * cmd:		null-terminated command string, max 240 characters
21c6557e7fSMartin Schwidefsky  * response:	response buffer for VM's textual response
22c6557e7fSMartin Schwidefsky  * rlen:	size of the response buffer, cpcmd will not exceed this size
23c6557e7fSMartin Schwidefsky  *		but will cap the output, if its too large. Everything that
24c6557e7fSMartin Schwidefsky  *		did not fit into the buffer will be silently dropped
25c6557e7fSMartin Schwidefsky  * response_code: return pointer for VM's error code
26c6557e7fSMartin Schwidefsky  * return value: the size of the response. The caller can check if the buffer
27c6557e7fSMartin Schwidefsky  *		was large enough by comparing the return value and rlen
28cd4386a9SHeiko Carstens  * NOTE: If the response buffer is not in real storage, cpcmd can sleep
29c6557e7fSMartin Schwidefsky  */
30cd4386a9SHeiko Carstens int cpcmd(const char *cmd, char *response, int rlen, int *response_code);
31c6557e7fSMartin Schwidefsky 
32c6557e7fSMartin Schwidefsky #endif /* _ASM_S390_CPCMD_H */
33