]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man2/s390_sthyi.2
s390_sthyi.2: Place error list in alphabetical order
[thirdparty/man-pages.git] / man2 / s390_sthyi.2
1 .\" Copyright IBM Corp. 2017
2 .\" Author: QingFeng Hao <haoqf@linux.vnet.ibm.com>
3 .\"
4 .\" %%%LICENSE_START(GPLv2+_DOC_FULL)
5 .\" This is free documentation; you can redistribute it and/or
6 .\" modify it under the terms of the GNU General Public License as
7 .\" published by the Free Software Foundation; either version 2 of
8 .\" the License, or (at your option) any later version.
9 .\"
10 .\" The GNU General Public License's references to "object code"
11 .\" and "executables" are to be interpreted as the output of any
12 .\" document formatting or typesetting system, including
13 .\" intermediate and printed output.
14 .\"
15 .\" This manual is distributed in the hope that it will be useful,
16 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
17 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 .\" GNU General Public License for more details.
19 .\"
20 .\" You should have received a copy of the GNU General Public
21 .\" License along with this manual; if not, see
22 .\" <http://www.gnu.org/licenses/>.
23 .\" %%%LICENSE_END
24 .\"
25 .TH S390_STHYI 2 2017-09-21 "Linux Programmer's Manual"
26 .SH NAME
27 s390_sthyi \- emulate STHYI instruction
28 .SH SYNOPSIS
29 .nf
30 .B #include <asm/unistd.h>
31 .PP
32 .BI "int s390_sthyi(unsigned long " function_code ", void *" buffer ",
33 .BI " uint64_t *" return_code ", unsigned long " flags ");
34 .fi
35 .SH DESCRIPTION
36 The
37 .BR s390_sthyi ()
38 system call emulates the STHYI (Store Hypervisor Information) instruction.
39 It provides hardware resource information for the machine and its
40 virtualization levels.
41 This includes CPU type and capacity, as well as the machine model and
42 other metrics.
43 .PP
44 The
45 .I function_code
46 argument indicates which function to perform.
47 The following code(s) are supported:
48 .TP
49 0
50 Return CP (Central Processor) and IFL (Integrated Facility for Linux)
51 capacity information.
52 .PP
53 The
54 .I buffer
55 argument specifies the address of a response buffer.
56 If the system call returns 0,
57 the response buffer will be filled with CPU capacity information.
58 Otherwise, the response buffer's content is unchanged.
59 .PP
60 The
61 .I return_code
62 argument stores the return code of the STHYI instruction,
63 using one of the following values:
64 .TP 8
65 0
66 Success.
67 .TP
68 4
69 Unsupported function code.
70 .PP
71 For further details about
72 .IR return_code ,
73 .IR function_code ,
74 and
75 .IR buffer ,
76 please see section
77 CONFORMING TO
78 below.
79 .PP
80 The
81 .I flags
82 argument is provided to allow for future extensions and currently
83 must be set to 0.
84 .SH RETURN VALUE
85 On success (that is: emulation succeeded), the return value of
86 .BR s390_sthyi ()
87 matches the condition code of the STHYI instructions, which is a value
88 in the range [0..3].
89 A return value of 0 indicates that CPU capacity information is stored in
90 .IR *buffer .
91 A return value of 3 indicates "unsupported function code" and the content of
92 .IR *buffer
93 is unchanged.
94 The return values 1 and 2 are reserved.
95 .PP
96 On error, \-1 is returned, and
97 .IR errno
98 is set appropriately.
99 .SH ERRORS
100 .TP
101 .B EFAULT
102 The value specified in
103 .I buffer
104 or
105 .I return_code
106 is not a valid address.
107 .TP
108 .B EINVAL
109 The value specified in
110 .I flags
111 is nonzero.
112 .TP
113 .B ENOMEM
114 Allocating memory for handling the CPU capacity information failed.
115 .TP
116 .B EOPNOTSUPP
117 The value specified in
118 .I function_code
119 is not valid.
120 .SH VERSIONS
121 This system call is available since Linux 4.15.
122 .SH CONFORMING TO
123 This Linux-specific system call is available only on the s390 architecture.
124 For details of the STHYI instruction, see
125 .UR https://www.ibm.com\:/support\:/knowledgecenter\:/SSB27U_6.3.0\:/com.ibm.zvm.v630.hcpb4\:/hcpb4sth.htm
126 .UE .
127 .SH NOTES
128 Glibc does not provide a wrapper for this system call, use
129 .BR syscall (2)
130 to call it.
131 .SH SEE ALSO
132 .BR syscall (2)