Skip to content

Commit

Permalink
Explicit header definitions for Open XL warnings
Browse files Browse the repository at this point in the history
Open XL 2.1 on z/OS reports some of the implicit declarations
as errors, and requires these to be explicitly defined. Most of
the underlying changes are to address this concern and some other
fixes pertaining to compilation errors.
  • Loading branch information
Deigue committed Apr 26, 2024
1 parent 33a1542 commit 4f257e0
Show file tree
Hide file tree
Showing 13 changed files with 36 additions and 4 deletions.
4 changes: 4 additions & 0 deletions include_core/unix/thrdsup.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ int linux_pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, c
intptr_t init_thread_library(void);
intptr_t set_pthread_priority(pthread_t handle, omrthread_prio_t j9ThreadPriority);
intptr_t set_pthread_name(pthread_t self, pthread_t thread, const char *name);
intptr_t sem_init_zos(j9sem_t s, int pShared, int initValue);
intptr_t sem_destroy_zos(j9sem_t s);
intptr_t sem_wait_zos(j9sem_t s);
intptr_t sem_post_zos(j9sem_t s);

extern struct J9ThreadLibrary default_library;

Expand Down
2 changes: 1 addition & 1 deletion port/zos390/omrcel4ro31.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ omr_cel4ro31_call(OMR_CEL4RO31_infoBlock *infoBlock);
* @return whether CEL4RO31 runtime support is available.
*/
BOOLEAN
omr_cel4ro31_isSupported(void);
omr_cel4ro31_is_supported(void);

/**
* A helper routine to return an error message associated with the CEL4RO31 return code.
Expand Down
1 change: 1 addition & 0 deletions port/zos390/omrgetjobid.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <stdlib.h>
#include "omrport.h"
#include "omrgetjobid.h"
#include "omrportpriv.h"

#define JOBID_STRING_LENGTH 9

Expand Down
1 change: 1 addition & 0 deletions port/zos390/omrgetjobname.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ void
omrget_jobname(struct OMRPortLibrary *portLibrary, char *jobname, uintptr_t length)
{
char *tmp_jobname = (char *)__malloc31(J9_MAX_JOBNAME);
extern void _JOBNAME(char *); /* defined in omrjobname.s */

if (NULL != tmp_jobname) {
char *ascname = NULL;
Expand Down
1 change: 1 addition & 0 deletions port/zos390/omrgetsysname.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
*******************************************************************************/

#include <stdlib.h>
#include <string.h>
#include <sys/utsname.h>
#include "omrgetsysname.h"

Expand Down
2 changes: 2 additions & 0 deletions port/zos390/omrgetuserid.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

#define J9_MAX_USERID 16


/**
* Get the userid for a z/OS job.
*
Expand All @@ -54,6 +55,7 @@ omrget_userid(char *userid, uintptr_t length)
uintptr_t result = 0;

userid[0] = '\0';
extern void _USERID(char *); /* defined in omruserid.s */

if (NULL != tmp_userid) {
char *ascname = NULL;
Expand Down
17 changes: 14 additions & 3 deletions port/zos390/omrintrospect.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,26 @@
#include "omrintrospect_common.h"
#include "omrutil.h"

#pragma linkage(getthent, OS_UPSTACK)
#if defined(OMR_ENV_DATA64)
#pragma linkage(getthent, OS)
#pragma map(getthent, "BPX4GTH")
#else
#pragma linkage(getthent, OS_UPSTACK)
#pragma map(getthent, "BPX1GTH")
#endif

#pragma linkage(pthread_quiesce, OS_UPSTACK)
#if defined(OMR_ENV_DATA64)
#pragma map(pthread_quiesce, "BPX4PTQ")
#else
#pragma linkage(pthread_quiesce, OS_UPSTACK)
#pragma map(pthread_quiesce, "BPX1PTQ")
#endif

#if defined(OMR_ENV_DATA64)
#else
#pragma linkage(pthread_quiesce_and_get_np_X, OS_UPSTACK)
#pragma map(pthread_quiesce_and_get_np_X, "BPX1PQG")
#endif

#ifdef MAX_NAME
#undef MAX_NAME
Expand All @@ -60,8 +64,11 @@

typedef __mcontext_t_ thread_context;


#if defined(__clang__)
#pragma pack(push, 1)
#else
#pragma pack(packed)
#endif

/* Program routine entry area (XPLINK) */
typedef struct XPLINK_Routine_entry {
Expand Down Expand Up @@ -633,6 +640,10 @@ struct tcb {
#define QUIESCE_SRB 9 /* Quiesce threads type = SRBs @DGA */
/* Skip 10 and 11 due to collision with BPXZCONS Freeze/Unfreeze Fast */

#if defined(__clang__)
#pragma pack(pop)
#else
#pragma pack(reset)
#endif

#endif
1 change: 1 addition & 0 deletions port/zos390/omrosbacktrace_impl.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
*/

#include "omrport.h"
#include "omrportpriv.h"
#include "omrsignal_context.h"
#include <stdio.h>
#include <signal.h>
Expand Down
6 changes: 6 additions & 0 deletions port/zos390/omrosdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
* @brief Dump formatting
*/

#define _EXT

#include <errno.h>
#include <stdio.h>
Expand All @@ -37,12 +38,15 @@
#include <time.h>
#include <pwd.h>
#include <ctest.h>
#include "omrgetjobname.h"
#include "omrport.h"
#include "omrportpriv.h"
#if defined(J9ZOS390) && !defined(OMR_EBCDIC)
#include "atoe.h"
#endif
#include "portnls.h"


static void convertToUpper(struct OMRPortLibrary *portLibrary, char *toConvert, uintptr_t len);
static void appendCoreName(struct OMRPortLibrary *portLibrary, char *corepath, intptr_t pathBufferLimit, intptr_t pid);
static uintptr_t tdump_wrapper(struct OMRPortLibrary *portLibrary, char *filename, char *dsnName);
Expand Down Expand Up @@ -333,6 +337,8 @@ tdump(struct OMRPortLibrary *portLibrary, char *asciiLabel, char *ebcdicLabel, u
char dsn[256];
} *dsnPattern31;

extern void _TDUMP(struct ioparms_t *ioparms, struct dsn_pattern_t *dsn_pattern); /* defined in omrgenerate_ieat_dump.s */

/* _TDUMP subroutine expects 31 bit addresses */
ioParms31 = __malloc31(sizeof(*ioParms31));
if (ioParms31 == NULL) {
Expand Down
1 change: 1 addition & 0 deletions port/zos390/omrsignal_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

#include "omrport.h"
#include "omrportpriv.h"
#include <strings.h>
#include <unistd.h>
#include "omrsignal_context.h"
#include "omrceeocb.h"
Expand Down
1 change: 1 addition & 0 deletions port/zos390/omrsignal_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ uint32_t infoForVR(struct OMRPortLibrary *portLibrary, OMRUnixSignalInfo *info,
uint32_t infoForModule(struct OMRPortLibrary *portLibrary, struct OMRUnixSignalInfo *info, int32_t index, const char **name, void **value);
uint32_t infoForControl(struct OMRPortLibrary *portLibrary, struct OMRUnixSignalInfo *info, int32_t index, const char **name, void **value);
uint32_t infoForSignal(struct OMRPortLibrary *portLibrary, struct OMRUnixSignalInfo *info, int32_t index, const char **name, void **value);
void fillInJumpInfo(struct OMRPortLibrary *portLibrary, void *contextInfo, void *jumpInfo);
void fillInUnixSignalInfo(struct OMRPortLibrary *portLibrary, void *contextInfo, struct OMRUnixSignalInfo *signalInfo);
BOOLEAN checkIfResumableTrapsSupported(struct OMRPortLibrary *portLibrary);

2 changes: 2 additions & 0 deletions thread/unix/thrdsup.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ intptr_t sem_destroy_zos(j9sem_t s);
intptr_t sem_wait_zos(j9sem_t s);
intptr_t sem_trywait_zos(j9sem_t s);
intptr_t sem_post_zos(j9sem_t s);
int setenv (const char *, const char *, int) __THROW;
char * getenv (const char *) __THROW;

#if defined (OMRZTPF)
void ztpf_init_proc(void);
Expand Down
1 change: 1 addition & 0 deletions util/omrutil/unix/zos/getstoragekey.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
uintptr_t
getStorageKey(void)
{
extern uintptr_t _GETPSW(); /* defined in getpsw.s */
/* The storage key is returned in bits 8-11 of the PSW */
return ((_GETPSW() >> 20) & 0xF);
}

0 comments on commit 4f257e0

Please sign in to comment.