5.2.2 Address Space Checking
The following functions check whether access is allowed to the specified memory space, based on the current access privilege information. If access cannot be made (no privilege or the memory does not exist), they return error code E_MACV.
— R Check for read access privilege.
— RW Check for read and write access privilege.
— RE Check for read and execute access privilege.
- ER ChkSpaceR( VP addr, INT len )
- ER ChkSpaceRW( VP addr, INT len )
- ER ChkSpaceRE( VP addr, INT len )
Checks access privilege to the memory space of len bytes from location addr.
- INT ChkSpaceBstrR( UB *str, INT max )
- INT ChkSpaceBstrRW( UB *str, INT max )
Checks access privilege to the memory space from str up to the string termination (’\0’) or up to the number of characters (bytes) specified in max, whichever comes .rst. If max = 0 is set, max is ignored and privilege is checked up to the string termination.
If access is allowed, the length of the string (in bytes) is returned. If the string termination occurred up to the string length indicated in max, the length to the character before ’\0’ is returned; if max characters occurred before the string termination, max is returned.
- INT ChkSpaceTstrR( TC *str, INT max )
- INT ChkSpaceTstrRW( TC *str, INT max )
Typedef UH TC; /* TRON character code */
#define TNULL((TC)0) /* TRON code string termination */
Checks access privilege to the memory space from str up to the TRON Code string termination (TNULL) or up to the number of characters (TC count) specified in max, whichever comes .rst. If max = 0 is set, max is ignored and privilege is checked up to the string termination.
If access is allowed, the length of the string (TC count) is returned. If the string termination occurred up to the string length indicated in max, the length to the character before TNULL is returned; if max characters occurred before the string termination, max is returned.
str must be an even-numbered address.

Comments