Support This Project Get i5/OS Programmer's Toolkit at SourceForge.net. Fast, secure and Free Open Source software downloads

Tech-notes: Memos about Design of MI Portal

Contents

Attentions should be paid to MI instructions expecting properly aligned operands

Many MI instructions expect properly aligned instruction operands (typically aligned to 16-byte boundary). For example, the search arguemnt operand (operand 4) of FNDINXEN, the creation template operand (operand 2) of CRTHS, and the search argument operand (operand 3) of FNDRINVN. But when client passing operand values to MI Portal as programs parameters, the passed operand values may not properly aligned and cause the hex 0602 (Boundary Alignment) exception being signaled. To avoid this problem, make sure those operand values are first copied into properly aligned local storage which will finally be passed to target MI instruction.

Operands Validation

MI Portal does not check the content of instruction operands passed to it, it validates only the number of operands for each MI instruction or support function passed by caller. If the number of operands passed by caller does not match what is expected for an MI instruction or support function, MI Portal sends an *ESCAPE message to the caller. For example, the CRTMTX (Create Pointer-based Mutex) instruction expects three operands, when invoking CRTMTX via MI Portal with zero operand you would get an *ESCAPE message with the following message text (CRTMTX's instruction index is hex 002A):
Number of operands passed to MI Portal not valid. Instruction index is hex 002A. Number of operands passed is 3, which is expected to be 0.

Support This Project
Generated on Thu Sep 22 19:02:56 2011 for i5/OS Programmer's Toolkit: Tech-notes by  doxygen 1.5.9