zoslib
z/OS C/C++ Library
Loading...
Searching...
No Matches
edcwccwi.h
Go to the documentation of this file.
1
2// Licensed Materials - Property of IBM
3// ZOSLIB
4// (C) Copyright IBM Corp. 2020. All Rights Reserved.
5// US Government Users Restricted Rights - Use, duplication
6// or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
8
9 #ifndef __edcwccwi
10 #define __edcwccwi 1
11 #pragma nomargins nosequence
12 #pragma checkout(suspend)
13 /***************************************************************
14 * <edcwccwi.h> header file *
15 * *
16 * LICENSED MATERIALS - PROPERTY OF IBM *
17 * *
18 * 5650-ZOS *
19 * *
20 * COPYRIGHT IBM CORP. 1988, 2015 *
21 * *
22 * US GOVERNMENT USERS RESTRICTED RIGHTS - USE, *
23 * DUPLICATION OR DISCLOSURE RESTRICTED BY GSA ADP *
24 * SCHEDULE CONTRACT WITH IBM CORP. *
25 * *
26 * STATUS = HLE77A0 *
27 ***************************************************************/
28
29 #if defined(__IBM_METAL__)
30
31 #error Language Environment standard C headers \
32cannot be used when METAL option is used. \
33Correct your header search path.
34
35 #endif /* __IBM_METAL__ */
36
37#ifdef __cplusplus
38extern "C" {
39#endif
40
41#if !defined(__features_h) || defined(__inc_features)
42 #include <features.h>
43#endif
44
45#ifndef __EDC_LE
46 #define __EDC_LE 0x10000000
47#endif
48
49#if __TARGET_LIB__ >= __EDC_LE
50#pragma map (__dsa_prev, "\174\174DSAPRV")
51#pragma map (__ep_find, "\174\174EPFIND")
52#pragma map (__fnwsa, "\174\174FNWSA")
53#if !defined(_LP64)
54#pragma map (__stack_info, "\174\174STACK\174")
55#endif
56
57#if defined(__XPLINK__) && !defined(_LP64)
58#pragma map (__bldxfd, "\174\174BLDXFD")
59#endif
60
61#ifdef _LP64
62 #pragma map (__set_laa_for_jit, "\174\174SETJIT")
63 #define __bldxfd(fd) fd
64#endif
65
66#ifndef __types
67 #include <sys/types.h>
68#endif
69
70#if __EDC_TARGET >= 0x41080000
71#pragma map (__static_reinit, "\174\174STATRE")
72#define __STATIC_REINIT_FULL 1
73#endif
74
75
76/*
77 * =============================================================
78 * Function definitions for Language Environment C-Language CWIs
79 * =============================================================
80 */
81
82#ifdef _NO_PROTO
83
84void * __dsa_prev();
85void * __ep_find();
86void * __fnwsa();
87#if defined(__XPLINK__) && !defined(_LP64)
88void * __bldxfd();
89#endif
90
91#else
92
93
94/*
95 * __dsa_prev() -- Do logical or physical DSA backchaining
96 * ============ ------------------------------------------
97 *
98 * note: This routine may ABEND. Caller may need to use CEE3SRP,
99 * CEEMRCE, etc. to handle ABENDs in this routine.
100 * (or use signal catcher, sigsetjmp(), and siglongjmp())
101 */
102
103void * /* pointer to prior DSA */
104__dsa_prev
105(
106 const void * /* pointer to current DSA */
107
108, int /* backchaining request type:
109 1 = physical
110 2 = logical */
111
112, int /* starting DSA format:
113 0 = up
114 1 = down */
115
116, void * /* called function returns a pointer
117 to the fetched data (perhaps
118 moved into this A/S)
119 note: if callback function cannot
120 return the requested data, it must
121 not return -- i.e. it should
122 longjump back to the user program
123 that called __dsa_prev() */
124
125 (*) /* optional ptr to user-provided
126 callback function that fetches
127 data, possibly from other
128 address space -- NULL = fetch
129 data from current A/S */
130 (
131 void * /* 1st input parm for callback fcn --
132 starting address of data to be
133 fetched (perhaps from other A/S) */
134 , size_t /* 2nd input parm or callback fcn --
135 length of data to be fetched
136 (will not exceed 16 bytes) */
137 )
138
139, const void * /* pointer to LE CAA -- required if
140 4th argument is non-NULL.
141 Note: this may be the address of
142 CAA in the other A/S */
143
144, int * /* optional ptr to output field
145 where previous DSA stack format
146 will be returned -- NULL = don't
147 pass back stack format */
148, void ** /* optional pointer to output field
149 where address of physical callee
150 DSA will be placed -- NULL =
151 don't pass back physical callee
152 address */
153, int * /* optional ptr to output field
154 where physical callee stack format
155 will be returned -- NULL = don't
156 pass back stack format */
157);
158
159
160
161
162/*
163 * __ep_find() -- find entry point of owner of passed-in DSA
164 * =========== ------------------------------------------
165 */
166
167void * /* pointer to entry point -- NULL =
168 could not find */
169__ep_find
170(
171 const void * /* pointer to DSA */
172
173, int /* DSA format:
174 0 = up
175 1 = down */
176
177, void * /* called function returns a pointer
178 to the fetched data (perhaps
179 moved into this A/S)
180 note: if callback function cannot
181 return the requested data, it must
182 not return -- i.e. it should
183 longjump back to the user program
184 that called __dsa_prev() */
185
186 (*) /* optional ptr to user-provided
187 callback function that fetches
188 data, possibly from other
189 address space -- NULL = fetch
190 data from current A/S */
191 (
192 void * /* 1st input parm for callback fcn --
193 starting address of data to be
194 fetched (perhaps from other A/S) */
195 , size_t /* 2nd input parm or callback fcn --
196 length of data to be fetched
197 (will not exceed 16 bytes) */
198 )
199
200);
201
202
203
204
205/*
206 * __fnwsa() -- find the WSA associated with an executable module
207 * ========= containing the specified entry point
208 *
209 */
210
211void * /* address of WSA (or NULL if
212 module doesn't have a WSA) --
213 -1 == executable module could
214 not be found from ep */
215__fnwsa
216(
217 const void * /* pointer to entry point */
218
219, void * /* called function returns a pointer
220 to the fetched data (perhaps
221 moved into this A/S)
222 note: if callback function cannot
223 return the requested data, it must
224 not return -- i.e. it should
225 longjump back to the user program
226 that called __fnwsa() */
227
228 (*) /* optional ptr to user-provided
229 callback function that fetches
230 data, possibly from other
231 address space -- NULL = fetch
232 data from current A/S */
233 (
234 void * /* 1st input parm for callback fcn --
235 starting address of data to be
236 fetched (perhaps from other A/S) */
237 , size_t /* 2nd input parm or callback fcn --
238 length of data to be fetched
239 (will not exceed 1K bytes) */
240 )
241
242, const void * /* pointer to LE CAA -- required if
243 2nd argument is non-NULL.
244 Note: this may be the address of
245 CAA in the other A/S */
246
247);
248
249
250#if defined(__XPLINK__) && !defined(_LP64)
251/*
252 * __bldxfd() -- build an XPLINK Compatibility Descriptor out of a
253 * ========= "function pointer" of unknown origin
254 *
255 */
256
257char * /* address of storage contain
258 XPLINK Compatibility Descriptor */
259__bldxfd
260(
261 void * /* pointer to entry point */
262
263);
264#endif /* __XPLINK__ && !LP64 */
265
266
267#if ((!defined(_LP64) && defined(__XPLINK__)) || \
268 (defined(_LP64) && (__EDC_TARGET >= __EDC_LE4109)))
269#if __EDC_TARGET >= __EDC_LE4201
270typedef char __jumpinfo_vector_t[16];
271
272typedef
273struct __jumpinfo_vr_ext
274{
275 short __ji_ve_version;
276 char __ji_ve_u[14];
277 __jumpinfo_vector_t __ji_ve_savearea[32];
278}__jumpinfo_vr_ext_t;
279#endif /* __EDC_TARGET >= __EDC_LE4201 */
280typedef
281struct __jumpinfo
282{
283 /*Note - offsets are for 31-bit expansion*/
284 char __ji_u1[68]; /* +0 Reserved */
285 char __ji_mask_saved; /* +44 when non-zero
286 indicates signal mask
287 saved in __ji_sigmask*/
288 char __ji_u2[3]; /* +45 Reserved */
289 #ifdef __DOT1
290 sigset_t __ji_sigmask; /* +48 signal mask */
291 #else
292 unsigned int __ji_u2a; /* +48 Filler for non-posix*/
293 unsigned int __ji_u2b; /* +4C Filler for non-posix*/
294 #endif
295 char __ji_u3[11]; /* +50 Reserved */
296 unsigned __ji_fl_fp4 :1; /* +5B.0 4 FPRs valid */
297 unsigned __ji_fl_fp16 :1; /* +5B.1 16 FPRs valid */
298 unsigned __ji_fl_fpc :1; /* +5B.2 FPC valid */
299 unsigned __ji_fl_res1a :1; /* +5B.3 reserved */
300#ifndef _LP64
301 unsigned __ji_fl_hr :1; /* +5B.4 Hi regs valid */
302#else
303 unsigned __ji_fl_res3 :1; /* +5B.4 Reserved */
304#endif
305 unsigned __ji_fl_res2 :1; /* +5B.5 Reserved */
306 unsigned __ji_fl_exp :1; /* +5B.6 explicit backchain */
307 unsigned __ji_fl_res2a :1; /* +5B.7 Reserved */
308#if __EDC_TARGET >= __EDC_LE4201
309 char __ji_u4[12]; /* +5C Reserved @D4C*/
310 __jumpinfo_vr_ext_t *__ji_vr_ext; /* +68 Pointer to VRs
311 save area @D4A*/
312#ifndef _LP64 /* @D4A*/
313 char __ji_u7[4]; /* +6C Reserved @D4A*/
314#endif /* @D4A*/
315 char __ji_u8[16]; /* +70 Reserved @D4A*/
316#else /* not __EDC_TARGET >= __EDC_LE4201 */
317 char __ji_u4[36]; /* +5C Reserved */
318#endif /* __EDC_TARGET >= __EDC_LE4201 */
319 long __ji_gr[16]; /* +80 resume registers */
320#ifndef _LP64
321 long __ji_hr[16]; /* +C0 hi regs */
322#endif
323 int __ji_u5[16]; /* +100 Reserved */
324 double __ji_fpr[16]; /* +140 FP registers 0-15 */
325 int __ji_fpc; /* +1C0 Floating pt cntl reg*/
326 char __ji_u6[60]; /* +1C4 Reserved */
327 /* +200 End of Resume area */
328} __jumpinfo_t;
329
330
331/**********************************************************************
332 * __far_jump() -- perform far jump *
333 **********************************************************************
334 */
335void
336__far_jump
337(
338 struct __jumpinfo * /* pointer to jump info buffer */
339);
340
341#endif
342
343
344#if !defined(_LP64)
345#if defined(__XPLINK__)
346
347/*******************************************************************
348 * __set_stack_softlimit() -- Set stack softlimit *
349 *******************************************************************
350 */
351
352unsigned long /* returns the previous value of the
353 softlimit (ULONG_MAX returned if
354 first call) */
355__set_stack_softlimit
356(
357 unsigned long /* soft limit stack size in bytes */
358
359);
360
361#endif /* __XPLINK__ */
362#else
363 #define __set_stack_softlimit(a) \
364 struct __no64bitSupport __set_stack_softlimit
365#endif /* ! _LP64 */
366
367#ifdef _LP64
368
369typedef
370struct __laa_jit_s {
371 void * user_data1;
372 void * user_data2;
373} __laa_jit_t;
374/**********************************************************************
375 * __set_laa_for_jit() -- set 2 reserved fields in the LAA for JAVA *
376 **********************************************************************
377 */
378int __set_laa_for_jit ( __laa_jit_t *laa_jit);
379
380#endif /* _LP64 */
381
382#if defined(__XPLINK__)
383
384typedef
385struct __mcontext
386{
387 /*Note - offsets are for 31-bit expansion*/
388 char __mc__1[68]; /* +0 Reserved */
389 char __mc_mask_saved; /* +44 when non-zero
390 indicates signal mask
391 saved in __mc_sigmask*/
392 char __mc__2[2]; /* +45 Reserved */
393 unsigned __mc__3 :3; /* +47 Reserved */
394 unsigned __mc_psw_flag :1; /* +47.3 __mc_psw PSW valid */
395#if __EDC_TARGET >= __EDC_LE410A
396 unsigned __mc_int_dsa_flag :1; /* +47.4 __mc_int_dsa
397 is valid @D2A*/
398 unsigned __mc_savstack_flag :1; /* +47.5 __mc_int_dsa was
399 saved from (must be
400 restored to)
401 CEECAA_SAVSTACK
402 (31-bit) or
403 CEELCA_SAVSTACK
404 (64-bit) @D2A*/
405 unsigned __mc_savstack_async_flag:1;/*+47.6 __mc_int_dsa was
406 saved from (must be
407 restored to) the
408 field pointed to by
409 CEECAA_SAVSTACK_ASYNC
410 (31-bit) or
411 CEELCA_SAVSTACK_ASYNC
412 (64-bit) @D2A*/
413 unsigned __mc__4 :1; /* +47.7 Reserved @D2A*/
414#else
415 unsigned __mc__4 :4; /* +47 Reserved */
416#endif /* __EDC_TARGET >= __EDC_LE410A */
417 #ifdef __DOT1
418 sigset_t __mc_sigmask; /* +48 signal mask for posix*/
419 #else
420 unsigned int __mc__4a; /* +48 Filler for non-posix*/
421 unsigned int __mc__4b; /* +4C Filler for non-posix*/
422 #endif
423 char __mc__5[11]; /* +50 Reserved */
424 unsigned __mc_fl_fp4 :1; /* +5B.0 4 FPRs valid */
425 unsigned __mc_fl_fp16 :1; /* +5B.1 16 FPRs valid */
426 unsigned __mc_fl_fpc :1; /* +5B.2 FPC valid */
427 unsigned __mc_fl_res1a :1; /* +5B.3 Reserved */
428 unsigned __mc_fl_hr :1; /* +5B.4 Hi regs valid */
429 unsigned __mc_fl_res2 :1; /* +5B.5 Reserved */
430 unsigned __mc_fl_exp :1; /* +5B.6 Explicit backchain */
431 unsigned __mc_fl_res2a :1; /* +5B.7 Reserved */
432#if __EDC_TARGET >= __EDC_LE4201
433 unsigned __mc_fl_res2b :2; /* +5C.0 Reserved */
434 unsigned __mc_fl_vr :1; /* +5C.2 Vector savearea valid*/
435 unsigned __mc_fl_res2c :5; /* +5C.x Reserved */
436 char __mc__6a[11]; /* +5D Reserved */
437 void *__mc_vr_ext; /* +68 ptr to vrs save area */
438 __pad31 (__mc__6b,4) /* +6C 31-bit reserved */
439 char __mc__6c[16]; /* +70 Reserved */
440#else
441 char __mc__6[36]; /* +5C Reserved */
442#endif
443 long __mc_gr[16]; /* +80 resume register */
444#ifndef _LP64
445 long __mc_hr_[16]; /* +C0 hi regs */
446#endif
447 int __mc__7[16]; /* +100 Reserved */
448 double __mc_fpr[16]; /* +140 FP registers 0-15 */
449 int __mc_fpc; /* +1C0 Floating pt cntl reg*/
450 char __mc__8[60]; /* +1C4 Reserved */
451 __pad31 (__mc__9,16) /* reserved 31-bit */
452 __pad64 (__mc__9,8) /* reserved 64-bit */
453 struct __mcontext *__mc_aux_mcontext_ptr;/* +210 ptr __mcontext */
454 __pad31 (__mc__10,12) /* +214 reserved 31-bit */
455 __pad64 (__mc__10,24) /* +218 reserved 64-bit */
456 __pad31 (__mc_psw,8 ) /* 8-byte PSW for 31-bit */
457 __pad64 (__mc_psw,16) /* 16-byte PSW for 64-bit */
458 /* Note- __mc_psw is valid only if __mc_psw_flag is set */
459#if __EDC_TARGET >= __EDC_LE410A
460 void *__mc_int_dsa; /* +228 interrupt DSA @D2A*/
461 /* Note- __mc_int_dsa is only valid if __mc_int_dsa_flag is set */
462 __pad31 (__mc__11,84) /* reserved 31-bit @D2A*/
463 __pad64 (__mc__11,104) /* reserved 64-bit @D2A*/
464#else
465 __pad31 (__mc__11,88) /* reserved 31-bit */
466 __pad64 (__mc__11,112) /* reserved 64-bit */
467#endif /* __EDC_TARGET >= __EDC_LE410A */
468 /* +280 End of Resume area */
469} __mcontext_t_;
470
471#endif /* __XPLINK__ */
472
473__new4108(int,__static_reinit,(int,void *));
474
475#endif /* _NO_PROTO */
476
477
478/*
479 * Constants for __dsa_prev() and __ep_find() and __stack_info()
480 * -------------------------------------------------------------
481 */
482
483#define __EDCWCCWI_PHYSICAL 1 /* do physical backchain */
484#define __EDCWCCWI_LOGICAL 2 /* do logical backchain */
485
486#define __EDCWCCWI_UP 0 /* stack format = UP */
487#define __EDCWCCWI_DOWN 1 /* stack format = DOWN */
488
489/******************************************************************/
490/* define's for VHM events and structure required as input to the */
491/* VHM event calls */
492/******************************************************************/
493#if __EDC_TARGET >= __EDC_LE4103
494
495
496#ifdef __cplusplus
497 #ifndef _LP64
498 #ifdef __XPLINK__
499 extern "OS_UPSTACK" void __cee_heap_manager(int, void *);
500 #else
501 extern "OS" void __cee_heap_manager(int, void *);
502 #endif
503 #endif
504#else
505 void __cee_heap_manager(int ,void *);
506 #ifndef _LP64
507 #ifdef __XPLINK__
508 #pragma linkage(__cee_heap_manager, OS_UPSTACK)
509 #else
510 #pragma linkage(__cee_heap_manager, OS)
511 #endif
512 #endif
513#endif
514
515#define _VHM_INIT 1
516#define _VHM_TERM 2
517#define _VHM_CEEDUMP 3
518#define _VHM_REPORT 4
519
520/****** struct __event1_s ******/
521
522struct __event1_s {
523 void * __ev1_free;
524 void * __ev1_malloc;
525 void * __ev1_realloc;
526 void * __ev1_calloc;
527 void * __ev1_xp_free;
528 void * __ev1_xp_malloc;
529 void * __ev1_xp_realloc;
530 void * __ev1_xp_calloc;
531 unsigned int __ev1_le_xplink : 1,
532 __ev1_le_reserved : 31;
533 unsigned int __ev1_vhm_xplink : 1,
534 __ev1_vhm_reserved : 31;
535};
536
537#if __EDC_TARGET >= __EDC_LE4106
538
539 /*****************************************************************/
540 /* __vhm_event() PROTOTYPE */
541 /*****************************************************************/
542 #pragma map (__vhm_event, "\174\174VHMEVT")
543 /*****************************************************************/
544 /* NOTE !!! At this moment this API is just supporting to drive */
545 /* the _VHM_REPORT as the event argument with VHM_CLEAR as */
546 /* the optional argument in MEMCHECK VHM. It could support */
547 /* more events and more event options in the future. */
548 /*****************************************************************/
549 void __vhm_event(int, ...);
550
551 /*****************************************************************/
552 /* __vhm_event() EVENT OPTIONS. Used in the optional argument. */
553 /*****************************************************************/
554 #define _VHM_REPORT_CLEAR 0x01 /* Used by _VHM_REPORT event to */
555 /* free the resources previously */
556 /* logged by MEMCHECK. */
557
558#endif /* __EDC_TARGET >= __EDC_LE4106 */
559
560#endif /* __EDC_TARGET >= __EDC_LE4103 */
561
562 #if !defined(_LP64)
563 #ifdef _OPEN_THREADS
564 #include <pthread.h>
565
566 typedef struct __segaddrs{
567 void * __startaddr;
568 void * __endaddr;
569 int __segtype;
570 int padding;
571 }SegmentAddresses;
572
573 typedef struct __stackinfo {
574 int __structsize;
575 int __numsegs;
576 void * __stacktop;
577 void * resrv;
578 SegmentAddresses __segaddr[1];
579 }STACKINFO;
580
581 __new4102(int, __stack_info, (STACKINFO *, struct __thdq_ *));
582
583 #endif
584 #else
585 #define __stack_info(a,b) \
586 struct __no64bitSupport __stack_info
587 #endif
588
589
590#if __EDC_TARGET >= __EDC_LE410A
591
592 #ifndef _LP64
593 #define __LE_SAVSTACK_ADDR ((void**)__gtca()+250)
594 #define __LE_SAVSTACK_ASYNC_ADDR ((void**)__gtca()+253)
595 #else
596 #ifndef __LAA_P
597 #define __LAA_P ((void *)*((void * __ptr32 *)0x04B8ul))
598 #endif
599 #define __LE_SAVSTACK_ADDR \
600 (((void**)(*(((void**)(__LAA_P))+11)))+4)
601 #define __LE_SAVSTACK_ASYNC_ADDR \
602 (((void**)(*(((void**)(__LAA_P))+11)))+42)
603 #endif
604
605#endif /* __EDC_TARGET >= __EDC_LE410A */
606
607#endif /* __TARGET_LIB__ >= __EDC_LE */
608
609
610#ifdef __cplusplus
611}
612#endif
613
614 #pragma checkout(resume)
615 #endif /* __edcwccwi */
Definition zos-base.h:62