On 17/07/2012 11:35 AM, Charles Mills wrote:
David, thanks, will try again tomorrow.
Does it perhaps want to factor differently? Perhaps something more like
(*extern "OS" entryPoint)(const char *);
or something? Otherwise aren't you saying that the pointer itself is extern?
What you need is a typedef
extern "OS" {
typedef (*entryPoint_t)(const char * arg);
}
entryPoint_t entryPoint = (entryPoint_t)cvt->entryPoint;
Don't let me confuse the issue -- it is not CSRSI that I am calling. Header
for CSRSI is in SYS1.SAMPLIB somewhere but is printed in the callable
services manual. They have something they call csrsi_byaddr that looks
exactly like what I am trying to accomplish but it is bracketed with #ifndef
__cplusplus which is what leads me to think that perhaps this linkage is not
supported for C++.
I understand. If you are using a function pointer to a function that has
not been loaded via fetch() then DLL(CBA) is required.
Every function call in C++ is essentially a DLL call, so they require an
FCB (function control block). There is overhead associated with DLL(CBA)
so try to localize it to the module that calls the function.
No, have not taken the XPLINK leap. One of these days.
Charles
-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On
Behalf Of David Crayford
Sent: Monday, July 16, 2012 7:17 PM
To: [email protected]
Subject: Re: How call from C++ thru function pointer to assembler?
extern "OS" (*entryPoint)(const char *) is the correct declaration for C++.
I have called OS linkage functions from the CVT in C++ without problems.
Where is the header file for CSRSI?
Are you XPLINK?
On 17/07/2012 10:10 AM, Charles Mills wrote:
Another way of saying what I am trying to do is what you do if you are
calling from C++ any MVS callable service or something like that using
the pointer somewhere off of the CVT.
Looking at the header file for CSRSI it looks like perhaps you can't
do it from C++.
Charles
-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]]
On Behalf Of Charles Mills
Sent: Monday, July 16, 2012 5:14 PM
To: [email protected]
Subject: How call from C++ thru function pointer to assembler?
Does anyone know the answer to this?
I have an assembler function whose address I know at run-time in C++.
I define and store it like this
void __cdecl (*entryPoint)(const char *); entryPoint = (void (__cdecl
*)(const char *))(myVoidStar); printf("entryPoint is %p\n",
entryPoint);
Printf prints the correct address (DFFD058, FWIW) so I am good so far.
I then call it with
(entryPoint)(record);
and I end up S0C6ing out in the weeds at 27F5023B.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN