Browse Prior Art Database

PLX structure reflects both Amode 31 & 64 C-header files .

IP.com Disclosure Number: IPCOM000013337D
Original Publication Date: 2000-Apr-01
Included in the Prior Art Database: 2003-Jun-18
Document File: 4 page(s) / 55K

Publishing Venue

IBM

Abstract

PLX structure reflects both Amode 31 64 C-header files . C-headers can be transformed from Amode 31 to Amode 64 simply by increasing the length of the pointers. This approach is the most convent for C programmers; however, this changes the offsets and alignments of many fields. UU Unix system services must process both Amode structures. Existing methods of solving this problem include: copying Amode 31 and Amode 64 structures to a common area, re-baseing each section where offsets change, use a UNION for all fields after first offset change and have different names for the same fields and/or place all 64-bit pointers at the end of the structure leaving reserved space at their former location.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 72% of the total text.

Page 1 of 4

PLX structure reflects both Amode 31 & 64 C-header files .

C-headers can be transformed from Amode 31 to Amode 64 simply by increasing the length of the pointers. This approach is the most convent for C programmers; however, this changes the offsets and alignments of many fields. UU Unix system services must process both Amode structures. Existing methods of solving this problem include: copying Amode 31 and Amode 64 structures to a common area, re-baseing each section where offsets change, use a UNION for all fields after first offset change and have different names for the same fields and/or place all 64-bit pointers at the end of the structure leaving reserved space at their former location.

This invention allows these relocated fields to be accesses in either mode's structure, based on the caller's PSW-Amode-64-bit, with just a recompile.

The PLX structure accommodates both Amode 31 and Amode 64 callers with a minimum of Amode unique code. In the example, field "SpbAmode64" maps to bit 31 of a copy of the callers PSW and has the value 1 when the caller is in Amode 64.

The gist of this example is best seen in these few lines of code. The Amode 31 structure has InheCwdPtr on an odd word boundary. The equivalent Amode 64 C-header has a reserved word at this offset followed by the 64-bit pointer on a double word boundary. The array Inhe002B adds 8 bytes in the structure for Amode 64 callers.

3 InheCwdPtr Ptr(31),

3 InheCwdPtr64 Ptr(64),

Inhe002B (0:1) Fixed(15) Static Local

Init(Length(Inhe)-8, Length(Inhe)),

1 Inhe002 Based(Addr(INHE) + Inhe002B(SpbAmode64)),

If the 31-bit pointer was already on a double word boundary, it would become a subfield of the 64-bit pointer and array Inhe002B would add 4 bytes in the structure for Amode 64 callers.

3 InheCwdPtr64 Ptr(64),

5 InheCwdPtr Ptr(31),

Inhe002B (0:1) Fixed(15) Static Local

Init(Length(Inhe)-4, Length(Inhe)),

1

Page 2 of 4

1 Inhe002 Based(Addr(INHE) + Inhe002B(SpbAmode64)),

Each level 1 declare is not based on the end of the previously based area, but rather on the beginning of the structure. This way, if the only referenced was to a field in the third area, the base for the second area would not be calculated.

Declare

1 Inhe INHEBASE Bdy(DWord),

3 InheEye Char(4), /* Eye catcher - 'INHE' */

3 InheLength Fixed(16), /* Length of structure */

3 InheVersion Fixed(16), /* Version number */

3 InheFlags Fixed(32), /* Flags indicating contents of structure */

3 InhePgroup Fixed(32), /* Process Group for child */

3 InheSigMask Bit(64), /* Signal Mask for child */

3 InheSigDef Bit(64), /* Set of default signals for child*/ 3 InheCtlTtyFd Fixed(32), /* Cntl TTY FD for tcsetpgrp() in child */

3 InheVer1Len Char(0), /* End of Version 1 */

3 InheCwdPtr Ptr(31),

3 InheCwdPtr64 Ptr(64),

Inhe002B (0:1) Fixed(15) Static Local

Init(Length(Inhe)-8, Length(Inhe)),

1 Inhe002 Based(Addr(INHE) + Inhe002B(SpbAmode64...