gtpc2m0s | C/C++ Language Support User's Guide |
This function allows ECB-controlled programs to access protected main
storage by returning a pointer to an interface point or location at execution
time. Additionally, the function provides a convenient way for a
real-time program to request an update of the file copy of 1 or more control
program keypoint records.
Format
#include <c$cinfc.h>
void *cinfc(enum t_cinfc type, int number, ...);
- type
- This parameter must belong to the enumeration type t_cinfc specifying 1 of
3 possible values:
- CINFC_ADDRESS
- Specifies that the function is to return an interface location address and
allow the calling function to write in protected storage.
- CINFC_WRITE
- Specifies that the function is to return an interface address and allow
the calling function to write in protected storage.
- CINFC_READ
- Specifies that the function is to return an interface address and the
current protection key is set to that of application core.
- CINFC_KEYPOINT
- Specifies that the function is to initiate CP keypoint update.
- number
- If the type specified is CINFC_ADDRESS, CINFC_WRITE, or CINFC_READ, this
parameter is the symbolic label of the interface point. If the type
specified is CINFC_KEYPOINT, this parameter is the number of keypoints to
update.
- ...
- One to 5 parameters of keypoints to be updated. Valid entries are
CINFC_KEYB, CINFC_KEYD, CINFC_KEYE, CINFC_KEY1, or CINFC_KEY2.
Normal Return
Pointer to interface address, or location if requested. For
CINFC_KEYPOINT, the return is unknown.
Error Return
Not applicable.
Programming Considerations
- CINFC_KEYPOINT can only be specified from a program executing on the main
I-stream. CINFC_ADDRESS, CINFC_READ, and CINFC_WRITE can be specified
from functions executing on any I-stream.
- For CINFC_KEYPOINT, keypoint updating will occur at the next
opportunity.
- The CINFC_WRITE option changes the protection key. Restore the
protection key, to the key assigned to working storage, by using the
keyrc function when write access to the storage is no longer
needed. The CINFC_WRITE option saves the protection key in effect up to
the cinfc function call. Restore the original (saved)
protection key by using the keyrc_okey function.
- If an incorrect parameter is given, a system error with exit
occurs.
Examples
The following example returns the address of a field in protected storage
and does not allow the function to modify the field.
#include <c$cinfc.h>
·
·
·
char *field_ptr;
·
·
·
field_ptr = cinfc(CINFC_READ, CINFC_CMMINC);
·
·
·
The following example updates the file copy of 2 control program
keypoints.
#include <c$cinfc.h>
·
·
·
cinfc(CINFC_KEYPOINT, 2, CINFC_KEY1, CINFC_KEYE);
·
·
·
Related Information