24.05.2014 Views

AIX Version 4.3 Differences Guide

AIX Version 4.3 Differences Guide

AIX Version 4.3 Differences Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

that can be larger than 2 32 for large files. In this case, the system call is<br />

directed to the 32-bit llseek() interface that is prepared to handle long integers.<br />

• float, double - Passed without change.<br />

• pointer - Converted from 64-bit effective address to 32-bit effective address as<br />

described in Section 3.2.2.2, “64-Bit to 32-Bit Address Remapping” on page<br />

40.<br />

Many system calls involve passing the address of one or more structures in<br />

storage. If the structures involve any data types whose sizes differ between 32-bit<br />

and 64-bit mode (int, long, pointer), the library routine must pass a (32-bit) pointer<br />

to a local 32-bit copy of the data constructed on its own stack.<br />

Some system calls are 64-bit-enabled, meaning they understand 64-bit pointers<br />

or longs. In such cases, the library code typically passes these by value in<br />

adjacent registers. The kernel code understands to parse the input as such. The<br />

shmat() call is an example of a service that understands a 64-bit address in<br />

adjacent registers.<br />

If the kernel is going to look at the data being passed, the library routine allocates<br />

32-bit versions of the same structure(s) and copies the data, field by field,<br />

through assignment statements. This results in automatic truncation of the int and<br />

long fields, some of which may need testing for magnitude before the conversion<br />

is done. Pointers are converted as described in Section 3.2.2.2, “64-Bit to 32-Bit<br />

Address Remapping” on page 40.<br />

If the kernel fills in data as the result of a system call, the data must be widened<br />

by the library routine on return from the kernel extension. Space for the 32-bit<br />

version of the structures to be filled-in must be allocated by the library routine<br />

before calling the kernel extension. Assignment, field by field, will do the proper<br />

widening (zero extension or sign extension, as appropriate).<br />

Returned pointers, such as from sbrk() or shmat(), require special handling<br />

between the library routine and kernel extension routine to ensure that the proper<br />

64-bit values are returned to the library routine.<br />

Note that some system calls involve data passing in both directions, into and out<br />

of the kernel, and thus require action on the part of the library routine before, and<br />

after, the system call.<br />

3.2.2.2 64-Bit to 32-Bit Address Remapping<br />

As shown in Figure 7, the PowerPC architecture divides the Effective Address<br />

(EA) into three fields:<br />

• The Effective Segment ID (ESID)<br />

• A 16-bit page number within the segment<br />

• A 12-bit byte offset within the page<br />

The width of the ESID varies with execution mode:<br />

• In 32-bit mode, the ESID is 4 bits and is often referred to as the Segment<br />

Register number.<br />

• In 64-bit mode, the ESID is 36 bits.<br />

40 <strong>AIX</strong> <strong>Version</strong> <strong>4.3</strong> <strong>Differences</strong> <strong>Guide</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!