Browse Prior Art Database

Technique for Sharing Pointers between a 64-bit Process and a 32-Bit Operating System

IP.com Disclosure Number: IPCOM000123615D
Original Publication Date: 1999-Feb-01
Included in the Prior Art Database: 2005-Apr-05
Document File: 2 page(s) / 69K

Publishing Venue

IBM

Related People

Peckham, SB: AUTHOR

Abstract

Disclosed is a method for sharing data structures between a 64-bit process and a 32-bit operating system. This method is especially important when the data structures contain pointers, since pointers do not have the same size in a 64-bit program as they do in a 32-bit operating system. This disclosure also describes a related technique for declaring structure fields in C-source code, so that the same source code can be shared when writing code for both the operating system and a 64-bit program.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 52% of the total text.

Technique for Sharing Pointers between a 64-bit Process and a 32-Bit
Operating System

   Disclosed is a method for sharing data structures between
a 64-bit process and a 32-bit operating system.  This method is
especially important when the data structures contain pointers,
since pointers do not have the same size in a 64-bit program as they
do in a 32-bit operating system.  This disclosure also describes a
related technique for declaring structure fields in C-source code, so
that the same source code can be shared when writing code for both
the operating system and a 64-bit program.

   The method described in this disclosure can be used on
the AIX* 4.3 operating system, running on a RS6000* machine
containing a 64-bit processor.  The method relies on the fact that
one can convert a 32-bit address into a 64-bit address by adding 32
high-order 0 bits.  Therefore, any pointer used by a 32-bit operating
system can be used by a 64-bit process by 0-extending the pointer.

   This disclosure involves a 3-part approach.

   First, the 32-bit operating system is designed so that all
shared data structures are addressed with the same effective
addresses in both the operating system (running in 32-bit mode) and
64-bit processes (running in 64-bit mode).  That is, all shared data
structures are located at effective addresses less than 0x100000000.
(Of course, all 32-bit addresses are less than this value.)  Thus,
32-bit pointers found in the data structures can be converted to
64-bit pointers by adding 32 high-order 0 bits.

   Second, source code macros are written so that the same
header files can be used when compiling the kernel in 32-bit mode
and compiling 64-bit programs in 64-bit mode.  The resulting data
structures...