Sun Java Solaris Communities My SDN Account Join SDN
 
White Paper

Notes on 64-bit Drivers and STREAMS

 
CHAPTER 2

Device Drivers


General Conversion Steps

- Use Fixed-width Types for Hardware Registers
- Use Fixed-width Common Access Functions
- Check and Extend Use of Derived Types
- Check Changed Fields In DDI Data Structures
- Check Changed Arguments of DDI Functions
- Modify Routines That Handle Data Sharing

The sections below provide information on converting drivers to run in a 64-bit environment. Driver writers might need to do one or more of the following:

  1. Use fixed-width types for hardware registers.
  2. Use fixed-width common access functions.
  3. Check and extend use of derived types.
  4. Check changed fields within DDI data. structures
  5. Check changed arguments of DDI functions.
  6. Modify the driver entry points that handle user data, where needed.

These steps are explained in detail below.

After each step is complete, fix all compiler warnings, and use lint to look for other problems. The SC4.2 (or later) version of lint can be used with -errchk=longptr64 and -D__sparcv9 (or on Intel, -D__ia64) specified to find 64-bit problems. The SC5.0 (or newer) version of lint should be used with -Xarch=v9 (or on Intel, -Xarch=ia64) and -errchk=longptr64 specified to find 64-bit problems. See the notes on using and interpreting the output of lint in the Solaris 7 64-bit Developer`s Guide.


Caution - Do not ignore compilation warnings during conversion for LP64. Even those that were safe to ignore previously in the ILP32 environment might now indicate a more serious problem.

After all the steps are complete, compile and test the driver as both a 32-bit and 64-bit modules.

<< Previous | Contents | Next >> [TOP]