summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--whoson.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/whoson.c b/whoson.c
index 9aead3c..e7659cb 100644
--- a/whoson.c
+++ b/whoson.c
@@ -94,26 +94,26 @@ static constexpr size_t ps_path_buf = 1027;
/* CVTASVT. The ASVT's own head, then ASVTENTY, the array of ASCB addresses;
* a set high bit marks an ASID that is free or non-reusable. */
/** @brief CVT field holding the ASVT address (CVTASVT). */
-#define CVT_ASVT_OFF 0x22Cu
+static constexpr uint32_t cvt_asvt_off = 0x22CU;
/** @brief ASVT field: the eye-catcher "ASVT". */
-#define ASVT_ACRONYM_OFF 0x200u
+static constexpr uint32_t asvt_acronym_off = 0x200U;
/** @brief ASVT field: highest ASID in use (ASVTMXU). */
-#define ASVT_MAXU_OFF 0x204u
+static constexpr uint32_t asvt_maxu_off = 0x204U;
/** @brief ASVT field: first entry of ASVTENTY, four bytes each. */
-#define ASVT_ENTY_OFF 0x210u
+static constexpr uint32_t asvt_enty_off = 0x210U;
/* An eye-catcher is a four-byte word that spells its block name in EBCDIC,
* and these blocks are filled in while the system runs in EBCDIC, even when
* whoson is built in ASCII mode. The value therefore cannot be a character
* literal: 'ASCB' would be the ASCII bytes B0 09 34 7E. */
/** @brief "ASVT" as it appears in the ASVT. */
-#define ASVT_ACRONYM 0xC1E2E5E3u
+static constexpr uint32_t asvt_acronym = 0xC1E2E5E3U;
/** @brief "ASCB" as it appears in the ASCB. */
-#define ASCB_ACRONYM 0xC1E2C3C2u
+static constexpr uint32_t ascb_acronym = 0xC1E2C3C2U;
/** @brief "CSCB" as it appears in the CSCB. */
-#define CSCB_ACRONYM 0xC3E2C3C2u
+static constexpr uint32_t cscb_acronym = 0xC3E2C3C2U;
/** @brief "ASSB" as it appears in the ASSB. */
-#define ASSB_ACRONYM 0xC1E2E2C2u
+static constexpr uint32_t assb_acronym = 0xC1E2E2C2U;
/** @brief CSCB CHTRKID value that marks a TSO/E session. */
enum { CSCB_TRKID_TSO = 0x01 };
@@ -568,7 +568,7 @@ static int scan_one(unsigned idx, uint32_t entry, uint32_t entries,
fault_armed = 0;
return -1;
}
- if (read_u32(ascb_addr) != ASCB_ACRONYM)
+ if (read_u32(ascb_addr) != ascb_acronym)
goto fail;
asid = read_u16(ascb_addr + (uint32_t)offsetof(ascb, ascbasid));
if (asid != idx + 1)
@@ -581,7 +581,7 @@ static int scan_one(unsigned idx, uint32_t entry, uint32_t entries,
uint32_t assb_addr =
read_u32(ascb_addr + (uint32_t)offsetof(ascb, ascbassb));
- if (assb_addr != 0 && read_u32(assb_addr) == ASSB_ACRONYM)
+ if (assb_addr != 0 && read_u32(assb_addr) == assb_acronym)
tod += read_u64(assb_addr + (uint32_t)offsetof(assb, assbasst));
}
/* A CSCB that has already been released can still be reachable through a
@@ -589,7 +589,7 @@ static int scan_one(unsigned idx, uint32_t entry, uint32_t entries,
* still belongs to this address space. */
if (cscb_addr != 0 &&
read_u32(cscb_addr + (uint32_t)offsetof(cscb, chcscbid)) ==
- CSCB_ACRONYM &&
+ cscb_acronym &&
read_u16(cscb_addr + (uint32_t)offsetof(cscb, chasid)) == asid) {
read_name(cscb_addr + (uint32_t)offsetof(cscb, chkey), key,
sizeof(key));
@@ -645,15 +645,15 @@ static int read_asvt(unsigned *maxu, uint32_t *entries) {
cvt = read_u32(16);
if (cvt == 0)
goto fail;
- asvt = read_u32(cvt + CVT_ASVT_OFF);
+ asvt = read_u32(cvt + cvt_asvt_off);
if (asvt == 0)
goto fail;
- if (read_u32(asvt + ASVT_ACRONYM_OFF) != ASVT_ACRONYM)
+ if (read_u32(asvt + asvt_acronym_off) != asvt_acronym)
goto fail;
- *maxu = read_u32(asvt + ASVT_MAXU_OFF) & 0xFFFFu;
+ *maxu = read_u32(asvt + asvt_maxu_off) & 0xFFFFu;
if (*maxu == 0)
goto fail;
- *entries = asvt + ASVT_ENTY_OFF;
+ *entries = asvt + asvt_enty_off;
fault_armed = 0;
return 0;
fail: