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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Figure 7. Effective Segment IDs in 32-Bit and 64-Bit Mode<br />

For each process, the kernel maintains an array of sixteen entries, each holding a<br />

segment register value that defines the mapping of user effective addresses to<br />

system virtual addresses at the point of a system call. When a 32-bit application<br />

issues a system call and passes pointers to data in user space, the entries in this<br />

array are loaded into segment registers by the copyin() and copyout() routines to<br />

access user-space data. The kernel never accesses user-space data directly, but<br />

only through copyin() and copyout().<br />

The 32-bit <strong>AIX</strong> kernel does not generally understand 64-bit address spaces. To<br />

perform kernel services for 64-bit address spaces, the 16-element mapping array<br />

previously mentioned must be set up so that the relevant user-space data for a<br />

system call can all be accessed through 32-bit addresses.<br />

The VMM provides services to remap 64-bit pointers passed through system calls<br />

into a 32-bit address space. The 64-bit library code fills out a data structure<br />

describing the 64-bit pointers to be remapped using one of the __remap*()<br />

services. This structure is passed to one of the remap*_64() kernel services by<br />

the 64-bit kernel extension to remap the specified segments in the user address<br />

space into a 32-bit address space for use by the normal kernel system call<br />

routines.<br />

The general form of the remapping structure is an array of effective segment<br />

identifiers and an integer indicating the number of such ESIDs to be remapped. A<br />

pointer to this remapping structure is passed to the remap*_64() routine. An ESID<br />

is 36 bits long and is represented as two integers; the high-order 32-bits of the<br />

ESID in the first word, and the remaining four bits of the ESID in the high-order<br />

four bits of the second word. To optimize the remapping of a single ESID, the two<br />

words describing the ESID are passed in registers rather than passing a pointer<br />

to a remapping structure. Additional bits are defined in the unused bits of the<br />

second word to indicate which form is being used – pointer or in-line registers.<br />

Remapped addresses are only valid in the kernel for the duration of the system<br />

call. Subsequent system calls may not rely on 32-bit remapped addresses from<br />

previous system calls. Extensions with such requirements should save the<br />

segment register value and use the long-form virtual address instead or call<br />

as_unremap64() to obtain the 64-bit unremapped address to store.<br />

3.2.2.3 Remap Library Data Structures<br />

All the remap data structures are defined in the header file ,<br />

except the kernel MST-extension remap region that was discussed earlier. This<br />

header file is shipped with <strong>AIX</strong> because all of these structures may be required by<br />

the user.<br />

64-Bit Enablement 41

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

Saved successfully!

Ooh no, something went wrong!