Path: blob/master/arch/powerpc/include/uapi/asm/papr-sysparm.h
26516 views
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */1#ifndef _UAPI_PAPR_SYSPARM_H_2#define _UAPI_PAPR_SYSPARM_H_34#include <linux/types.h>5#include <asm/ioctl.h>6#include <asm/papr-miscdev.h>78enum {9PAPR_SYSPARM_MAX_INPUT = 1024,10PAPR_SYSPARM_MAX_OUTPUT = 4000,11};1213struct papr_sysparm_io_block {14__u32 parameter;15__u16 length;16__u8 data[PAPR_SYSPARM_MAX_OUTPUT];17};1819/**20* PAPR_SYSPARM_IOC_GET - Retrieve the value of a PAPR system parameter.21*22* Uses _IOWR because of one corner case: Retrieving the value of the23* "OS Service Entitlement Status" parameter (60) requires the caller24* to supply input data (a date string) in the buffer passed to25* firmware. So the @length and @data of the incoming26* papr_sysparm_io_block are always used to initialize the work area27* supplied to ibm,get-system-parameter. No other parameters are known28* to parameterize the result this way, and callers are encouraged29* (but not required) to zero-initialize @length and @data in the30* common case.31*32* On error the contents of the ioblock are indeterminate.33*34* Return:35* 0: Success; @length is the length of valid data in @data, not to exceed @PAPR_SYSPARM_MAX_OUTPUT.36* -EIO: Platform error. (-1)37* -EINVAL: Incorrect data length or format. (-9999)38* -EPERM: The calling partition is not allowed to access this parameter. (-9002)39* -EOPNOTSUPP: Parameter not supported on this platform (-3)40*/41#define PAPR_SYSPARM_IOC_GET _IOWR(PAPR_MISCDEV_IOC_ID, 1, struct papr_sysparm_io_block)4243/**44* PAPR_SYSPARM_IOC_SET - Update the value of a PAPR system parameter.45*46* The contents of the ioblock are unchanged regardless of success.47*48* Return:49* 0: Success; the parameter has been updated.50* -EIO: Platform error. (-1)51* -EINVAL: Incorrect data length or format. (-9999)52* -EPERM: The calling partition is not allowed to access this parameter. (-9002)53* -EOPNOTSUPP: Parameter not supported on this platform (-3)54*/55#define PAPR_SYSPARM_IOC_SET _IOW(PAPR_MISCDEV_IOC_ID, 2, struct papr_sysparm_io_block)5657#endif /* _UAPI_PAPR_SYSPARM_H_ */585960