0689 nwnss: reapply ZOS userspace overrides after OS API macros

This commit is contained in:
Mario Fetka
2026-06-17 07:57:25 +00:00
parent 8ce7c9f386
commit e962065c7b
2 changed files with 30 additions and 13 deletions

View File

@@ -52,6 +52,17 @@
# include <include/pssmpk.h>
#endif
#ifdef MARS_NWE_NWNSS_USERSPACE
/* nssOSAPIs.h may have been included first and defines these as Linux-kernel
* macros. The userspace scheduler port provides real functions instead. */
# undef ZOS_Sleep
# undef ZOS_WakeUp
# undef ZOS_YieldThread
# undef ZOS_ScheduleWorkToDo
# undef ZOS_ScheduleFastWorkToDo
# undef ZOS_CancelWorkToDo
#endif
#ifdef __cplusplus
extern "C" {
#endif

View File

@@ -1,23 +1,31 @@
#ifndef MARS_NWE_NWNSS_ZOS_COMPAT_H
#define MARS_NWE_NWNSS_ZOS_COMPAT_H
/*
* Private userspace overrides for ZOS_* OS/NEB/virtual-IO macros used by
* imported NSS sources.
*
* The original nssOSAPIs.h provides the Linux-kernel macro bodies. libnwnss
* builds those same sources in a userspace process, so only the OS boundary is
* redirected here. Keep NSS source files and public Novell headers otherwise
* original; do not grow NSS business logic in this compatibility header.
* This header is intentionally re-includable: nssOSAPIs.h defines the
* original Linux-kernel ZOS_* macro bodies after normal header inclusion.
* libnwnss includes this file again at the end of nssOSAPIs.h so the
* userspace overrides win without editing imported NSS source files.
*
* Keep NSS source files and public Novell headers otherwise original; do not
* grow NSS business logic in this compatibility header.
*/
#ifdef MARS_NWE_NWNSS_USERSPACE
/*
* Do not override scheduler primitives here. schedule.h declares real
* userspace functions for ZOS_Sleep/ZOS_WakeUp/ZOS_YieldThread and the
* WorkToDo entry points; defining macros before that header is included
* breaks the original prototypes.
* Scheduler primitives are real userspace functions declared by schedule.h.
* If nssOSAPIs.h has already installed the Linux-kernel macro bodies, remove
* those macros after schedule.h is visible so Wait()/Continue()/ScheduleWork()
* call the userspace functions rather than kSleep/kWakeUp/kScheduleWorkToDo.
*/
#ifdef _SCHEDULE_H_
#undef ZOS_Sleep
#undef ZOS_WakeUp
#undef ZOS_YieldThread
#undef ZOS_ScheduleWorkToDo
#undef ZOS_ScheduleFastWorkToDo
#undef ZOS_CancelWorkToDo
#endif
#undef ZOS_ProduceEvent
#define ZOS_ProduceEvent(_status, _event) \
@@ -80,5 +88,3 @@
do { (_status) = zSetEOF((_key), (_offset), (_size), (_flags)); } while (0)
#endif /* MARS_NWE_NWNSS_USERSPACE */
#endif /* MARS_NWE_NWNSS_ZOS_COMPAT_H */