version 1.2, 2025/03/09 15:20:18
|
version 1.5, 2025/05/08 16:29:18
|
Line 1
|
Line 1
|
/* |
/* |
* * |
* $Id$ |
* * * |
|
* * * |
|
* *************** |
|
* * * * * |
|
* * MUMPS * |
|
* * * * * |
|
* *************** |
|
* * * |
|
* * * |
|
* * |
|
* |
|
* shmmgr.h |
|
* shared memory manager data structures |
* shared memory manager data structures |
* |
* |
* |
* |
* Author: Serena Willis <snw@coherent-logic.com> |
* Author: Serena Willis <snw@coherent-logic.com> |
* Copyright (C) 1998 MUG Deutschland |
* Copyright (C) 1998 MUG Deutschland |
* Copyright (C) 2021 Coherent Logic Development LLC |
* Copyright (C) 2021, 2025 Coherent Logic Development LLC |
* |
* |
* |
* |
* This file is part of FreeM. |
* This file is part of FreeM. |
Line 35
|
Line 23
|
* You should have received a copy of the GNU Affero Public License |
* You should have received a copy of the GNU Affero Public License |
* along with FreeM. If not, see <https://www.gnu.org/licenses/>. |
* along with FreeM. If not, see <https://www.gnu.org/licenses/>. |
* |
* |
|
* $Log$ |
|
* Revision 1.5 2025/05/08 16:29:18 snw |
|
* Add SOM/SOA/SBM/SBA macros from RSM and modify for FreeM |
|
* |
|
* Revision 1.4 2025/03/26 15:17:12 snw |
|
* Fall back to global-backed SSVNs when memory-backed globals fail in attempt to fix Tru64 |
|
* |
|
* Revision 1.3 2025/03/09 19:50:47 snw |
|
* Second phase of REUSE compliance and header reformat |
|
* |
|
* |
|
* SPDX-FileCopyrightText: (C) 2025 Coherent Logic Development LLC |
|
* SPDX-License-Identifier: AGPL-3.0-or-later |
**/ |
**/ |
|
|
#if !defined(__shmmgr_h) |
#if !defined(__shmmgr_h) |
Line 71
|
Line 72
|
|
|
#define SHMALIGN(a) (void *) (((unsigned long) a + sysconf (_SC_PAGESIZE)) & ~(sysconf (_SC_PAGESIZE) - 1)) |
#define SHMALIGN(a) (void *) (((unsigned long) a + sysconf (_SC_PAGESIZE)) & ~(sysconf (_SC_PAGESIZE) - 1)) |
|
|
|
/* The following macros were borrowed from Reference Standard M |
|
* SOM/SOA: reading and writing data stored in shared memory |
|
* SBM/SBA: for modifying pointers in shared memory |
|
*/ |
|
#define SOM(ptr) ((__typeof__(ptr)) ((char *) (ptr) + ((char *) shm_config->dta - (char *) shm_config->hdr->shmad))) |
|
#define SOA(ptr) ((ptr == NULL) ? NULL : SOM(ptr)) |
|
#define SBM(ptr) ((__typeof__(ptr)) ((char *) (ptr) - ((char *) shm_config->dta - (char *) shm_config->hdr->shmad))) |
|
#define SBA(ptr) ((ptr == NULL) ? NULL : SBM(ptr)) |
|
|
/* data structures */ |
/* data structures */ |
|
|
/* alloc map entry */ |
/* alloc map entry */ |
Line 123 typedef struct shm_hdr_t {
|
Line 133 typedef struct shm_hdr_t {
|
char *argptr; |
char *argptr; |
long PSIZE; |
long PSIZE; |
long symlen; |
long symlen; |
|
short use_mb_globals; |
|
|
/* pid of process currently in transaction */ |
/* pid of process currently in transaction */ |
/* zero if nobody owns these exclusive rights */ |
/* zero if nobody owns these exclusive rights */ |