zoslib
z/OS C/C++ Library
Loading...
Searching...
No Matches
zos-sys-info.h
Go to the documentation of this file.
1
2// Licensed Materials - Property of IBM
3// ZOSLIB
4// (C) Copyright IBM Corp. 2020. All Rights Reserved.
5// US Government Users Restricted Rights - Use, duplication
6// or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
8
9// APIs that obtain various z/OS system info.
10
11#ifndef ZOS_SYS_INFO_H_
12#define ZOS_SYS_INFO_H_
13
14#include "zos-macros.h"
15
16#include <stdint.h>
17#include <stdlib.h>
18
19/* CPU model number length */
20#define ZOSCPU_MODEL_LENGTH 4
21
32
33// CPU Management Control Table (CCT).
34typedef struct ZOSCCT {
35 uint8_t filler[110];
36 uint16_t cpuCount; // Number of online CPUs.
38
39// System Resources Manager Control Table (RMCT).
40typedef struct ZOSRMCT {
41 uint8_t name[4];
42 struct ZOSCCT *__ptr32 cct;
44
45// RSM Control and Enumeration Area (RCE).
46typedef struct ZOSRCE {
47 uint8_t id[4];
48 uint32_t pool; // Number of frames currently available to system.
50
51// Communications Vector Table (CVT).
52typedef struct ZOSCVT {
53 uint8_t filler1[604];
54 struct ZOSRMCT *__ptr32 rmct;
55 uint8_t filler2[156];
56 struct ZOSPCCAVT *__ptr32 pccavt;
57 uint8_t filler3[400];
58 struct ZOSRCE *__ptr32 rce;
59 uint8_t filler4[92];
60 uint8_t cvtoslvl[16];
62
63// Prefixed Save Area (PSA).
64// Maps storage starting at location 0.
65typedef struct ZOSPSA {
66 uint8_t filler[16]; // Ignore 16 bytes before CVT pointer.
67 struct ZOSCVT *__ptr32 cvt;
69
70// Physical Configuration Communication Area (PCCA).
71// https://www.ibm.com/docs/en/zos/2.4.0?topic=information-pcca-mapping
72typedef struct ZOSPCCA {
73 char pcca[4];
74 // Offset 4 is PCCACPID which is 12 bytes that gets broken down into:
75 // https://www.ibm.com/docs/en/tdmffz/5.7?topic=reference-determine-cpu-serial-number
76 char cpu_version[2];
77 char cpu_lpid[2];
78 char cpu_serial[4];
79 char cpu_model[4];
80 char filler1[372];
82
83// Physical CCA Vector Table (PCCAVT).
84// https://www.ibm.com/docs/en/zos/2.4.0?topic=information-pccavt-mapping
85typedef struct ZOSPCCAVT {
86 struct ZOSPCCA *__ptr32 cpu0;
87 char filler1[252];
89
90#ifdef __cplusplus
91extern "C" {
92#endif
93
99
105
111
118
124
131
138
147__Z_EXPORT char *__get_cpu_model(char *buffer, size_t size);
148
149#ifdef __cplusplus
150}
151#endif
152#endif // ZOS_SYS_INFO_H_
Definition zos-sys-info.h:34
uint8_t filler[110]
Definition zos-sys-info.h:35
uint16_t cpuCount
Definition zos-sys-info.h:36
Definition zos-sys-info.h:52
struct ZOSPCCAVT *__ptr32 pccavt
Definition zos-sys-info.h:56
uint8_t cvtoslvl[16]
Definition zos-sys-info.h:60
uint8_t filler2[156]
Definition zos-sys-info.h:55
uint8_t filler1[604]
Definition zos-sys-info.h:53
uint8_t filler4[92]
Definition zos-sys-info.h:59
struct ZOSRCE *__ptr32 rce
Definition zos-sys-info.h:58
struct ZOSRMCT *__ptr32 rmct
Definition zos-sys-info.h:54
uint8_t filler3[400]
Definition zos-sys-info.h:57
Definition zos-sys-info.h:72
char cpu_model[4]
Definition zos-sys-info.h:79
char cpu_version[2]
Definition zos-sys-info.h:76
char filler1[372]
Definition zos-sys-info.h:80
char cpu_serial[4]
Definition zos-sys-info.h:78
char pcca[4]
Definition zos-sys-info.h:73
char cpu_lpid[2]
Definition zos-sys-info.h:77
Definition zos-sys-info.h:85
char filler1[252]
Definition zos-sys-info.h:87
struct ZOSPCCA *__ptr32 cpu0
Definition zos-sys-info.h:86
Definition zos-sys-info.h:65
struct ZOSCVT *__ptr32 cvt
Definition zos-sys-info.h:67
uint8_t filler[16]
Definition zos-sys-info.h:66
Definition zos-sys-info.h:46
uint32_t pool
Definition zos-sys-info.h:48
Definition zos-sys-info.h:40
uint8_t name[4]
Definition zos-sys-info.h:41
struct ZOSCCT *__ptr32 cct
Definition zos-sys-info.h:42
#define __Z_EXPORT
Definition zos-macros.h:13
__Z_EXPORT bool __is_os_level_at_or_above(oslvl_t level)
Definition zos-sys-info.cc:73
__Z_EXPORT oslvl_t __get_os_level(void)
Definition zos-sys-info.cc:43
__Z_EXPORT bool __is_stfle_available()
Definition zos-sys-info.cc:77
struct ZOSRMCT ZOSRMCT_t
struct ZOSPSA ZOSPSA_t
__Z_EXPORT bool __is_vef1_available()
Definition zos-sys-info.cc:94
struct ZOSRCE ZOSRCE_t
__Z_EXPORT bool __is_vxf_available()
Definition zos-sys-info.cc:86
__Z_EXPORT int __get_num_online_cpus(void)
Definition zos-sys-info.cc:30
struct ZOSCVT ZOSCVT_t
struct ZOSCCT ZOSCCT_t
__Z_EXPORT char * __get_cpu_model(char *buffer, size_t size)
Definition zos-sys-info.cc:109
oslvl_t
Definition zos-sys-info.h:22
@ ZOSLVL_V2R1
Definition zos-sys-info.h:24
@ ZOSLVL_V1R13
Definition zos-sys-info.h:23
@ ZOSLVL_UNKNOWN
Definition zos-sys-info.h:30
@ ZOSLVL_V2R3
Definition zos-sys-info.h:26
@ ZOSLVL_V2R2
Definition zos-sys-info.h:25
@ ZOSLVL_V3R1
Definition zos-sys-info.h:29
@ ZOSLVL_V2R5
Definition zos-sys-info.h:28
@ ZOSLVL_V2R4
Definition zos-sys-info.h:27
__Z_EXPORT int __get_num_frames(void)
Definition zos-sys-info.cc:37