Browse Prior Art Database

A Programming Method For Supporting 64-bit Addresses Within 32-bit Compiled Software Codes

IP.com Disclosure Number: IPCOM000014319D
Original Publication Date: 2000-Jul-01
Included in the Prior Art Database: 2003-Jun-19
Document File: 2 page(s) / 45K

Publishing Venue

IBM

Abstract

A Programming Method For Supporting 64-bit Addresses Within 32-bit Compiled Software Codes Disclosed is a programming method for 32-bit compiled C-program to access I/O devices mapped into the system address space above the 4G(iga) limit imposed by the 32-bit C compiler. When the host processor running a 32-bit program wants to talk to an I/O device, the program will perform PIO accesses to the I/O device's register space. Since 32-bit C-pointer can not get to a 64-bit address, direct assign statements with C-pointer referencing must not be used. Instead, these accesses are now written as PIO-routine calls.

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

Page 1 of 2

A Programming Method For Supporting 64-bit Addresses Within 32-bit Compiled

Software Codes

Disclosed is a programming method for 32-bit compiled C-program to access I/O devices mapped into the system address space above the 4G(iga) limit imposed by the 32-bit C compiler.

When the host processor running a 32-bit program wants to talk to an I/O device, the program will perform PIO accesses to the I/O device's register space. Since 32-bit C-pointer can not get to a 64-bit address, direct assign statements with C-pointer referencing must not be used. Instead, these accesses are now written as PIO-routine calls.

The 64-bit memory-mapped I/O address is broken into two parts: base_address and offset_address. Base_address and offset_address are 32-bit quantities.

The decision on how to split the 64-bit address into two parts is arbitrary, but the mechanism has to be known to the lower level codes which perform the reconstruction of the 64-bit address in order to carry out the PIO accesses.

The two basic PIO_read and PIO_write routines will be written as assembly language codes so that the routines can combine the two parts of the address without C-compiler interference.

The prototypes are shown belows:

typedef struct {

unsigned int h;

unsigned int l; } UI_64;

UI_64 * PIO_read( unsigned int pio_base, unsigned int pio_offset, UI_64 *data, unsigned int access_size ); void PIO_write( unsigned int pio_base, unsigned int pio_offset, UI_64 *data, unsigned int access_size );

The...