diff --git a/include_core/unix/thrdsup.h b/include_core/unix/thrdsup.h index 7ec1bb57463..3f68ea04755 100644 --- a/include_core/unix/thrdsup.h +++ b/include_core/unix/thrdsup.h @@ -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; diff --git a/port/zos390/omrcel4ro31.h b/port/zos390/omrcel4ro31.h index 516f4153ffd..fe04f978387 100644 --- a/port/zos390/omrcel4ro31.h +++ b/port/zos390/omrcel4ro31.h @@ -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. diff --git a/port/zos390/omrgetjobid.c b/port/zos390/omrgetjobid.c index c2a88925724..a2e08b498c8 100644 --- a/port/zos390/omrgetjobid.c +++ b/port/zos390/omrgetjobid.c @@ -23,6 +23,7 @@ #include #include "omrport.h" #include "omrgetjobid.h" +#include "omrportpriv.h" #define JOBID_STRING_LENGTH 9 diff --git a/port/zos390/omrgetjobname.c b/port/zos390/omrgetjobname.c index 5131f41df35..ce1f3b0b26c 100644 --- a/port/zos390/omrgetjobname.c +++ b/port/zos390/omrgetjobname.c @@ -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; diff --git a/port/zos390/omrgetsysname.c b/port/zos390/omrgetsysname.c index 8040d329177..a19ba427570 100644 --- a/port/zos390/omrgetsysname.c +++ b/port/zos390/omrgetsysname.c @@ -21,6 +21,7 @@ *******************************************************************************/ #include +#include #include #include "omrgetsysname.h" diff --git a/port/zos390/omrgetuserid.c b/port/zos390/omrgetuserid.c index e17bde4caf6..0768a4b687c 100644 --- a/port/zos390/omrgetuserid.c +++ b/port/zos390/omrgetuserid.c @@ -34,6 +34,7 @@ #define J9_MAX_USERID 16 + /** * Get the userid for a z/OS job. * @@ -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; diff --git a/port/zos390/omrintrospect.h b/port/zos390/omrintrospect.h index 6915cb916f7..3a643037cfe 100644 --- a/port/zos390/omrintrospect.h +++ b/port/zos390/omrintrospect.h @@ -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 @@ -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 { @@ -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 diff --git a/port/zos390/omrosbacktrace_impl.c b/port/zos390/omrosbacktrace_impl.c index 82c89acd7c7..859d80e135b 100644 --- a/port/zos390/omrosbacktrace_impl.c +++ b/port/zos390/omrosbacktrace_impl.c @@ -27,6 +27,7 @@ */ #include "omrport.h" +#include "omrportpriv.h" #include "omrsignal_context.h" #include #include diff --git a/port/zos390/omrosdump.c b/port/zos390/omrosdump.c index 4f98a4fdf89..548b1daf595 100644 --- a/port/zos390/omrosdump.c +++ b/port/zos390/omrosdump.c @@ -26,6 +26,7 @@ * @brief Dump formatting */ +#define _EXT #include #include @@ -37,12 +38,15 @@ #include #include #include +#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); @@ -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) { diff --git a/port/zos390/omrsignal_context.c b/port/zos390/omrsignal_context.c index e38c3a0af4b..3f2d4eb42a9 100644 --- a/port/zos390/omrsignal_context.c +++ b/port/zos390/omrsignal_context.c @@ -22,6 +22,7 @@ #include "omrport.h" #include "omrportpriv.h" +#include #include #include "omrsignal_context.h" #include "omrceeocb.h" diff --git a/port/zos390/omrsignal_context.h b/port/zos390/omrsignal_context.h index f0a3545e010..8c51698a4e2 100644 --- a/port/zos390/omrsignal_context.h +++ b/port/zos390/omrsignal_context.h @@ -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); diff --git a/thread/unix/thrdsup.c b/thread/unix/thrdsup.c index c3c3ebecbbb..ddfd0853999 100644 --- a/thread/unix/thrdsup.c +++ b/thread/unix/thrdsup.c @@ -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); diff --git a/util/omrutil/unix/zos/getstoragekey.c b/util/omrutil/unix/zos/getstoragekey.c index d330657ee38..5502b785ece 100644 --- a/util/omrutil/unix/zos/getstoragekey.c +++ b/util/omrutil/unix/zos/getstoragekey.c @@ -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); }