SLIH conversion required changes
The following required changes must be applied to all SLIHs being ported to 64-bit kernel.
- Performing Read Operations to a Device
All instances of pdiag_dd_read will have to be duplicated with pdiag_dd_read_64 for 64-bit. Every place where pdiag_dd_read is used for a 32-bit SLIH, a pdiag_dd_read_64 will be used for a 64-bit SLIH. This will be accomplished by using conditional preprocessor compiler statements (#ifdef).
Here is an example of what a common source 32-bit and 64-bit read call might look like:#ifdef __64BIT_KERNEL rc = pdiag_dd_read_64(pdiagex_handle, IOSHORT16, io_addr, &datas, &flags); #else rc = pdiag_dd_read(pdiagex_handle, IOSHORT16, io_addr, &datas, &flags); #endifNote:- The __64BIT_KERNEL compiler directive is defined for 64-bit kernel compilers, therefore the user will not need to define it.
- Special case for IOLONG32 reads, the data has to be shifted 32-bits right after the function call, such as, (data = data >> 32;).
- The pdiag_dd_read_64 function is used in kernel environment only, therefore the intrlev flag must always be set to INTRKMEM.
- Performing Write Operations to a Device
All instances of pdiag_dd_write have to be duplicated with pdiag_dd_write_64 for 64-bit. Every place where pdiag_dd_write is used for a 32-bit SLIH, a pdiag_dd_write_64 will be used for a 64-bit SLIH. This will be accomplished by using conditional preprocessor compiler statements (#ifdef).
Here is an example of what a common source 32-bit and 64-bit write call might look like:#ifdef __64BIT_KERNEL rc = pdiag_dd_write_64(pdiagex_handle, IOLONG32, io_addr, &datal, &flags); #else rc = pdiag_dd_write(pdiagex_handle, IOLONG32, io_addr, &datal, &flags); #endifNote:- The __64BIT_KERNEL compiler directive is defined for 64-bit kernel compilers, therefore the user will not need to define it.
- The pdiag_dd_read_64 function is used in kernel environment only, therefore the intrlev flag must always be set to INTRKMEM.
- SLIH function prototype
The SLIH function prototype requires change in the type declaration for *sleep_word and sleep_flag as follows:
int your_interrupt(pdiag_info_handle_t pdiagex_handle, char *data_area, int *interrupt_flag, #ifdef __64BIT_KERNEL long sleep_flag, long *sleep_word) #else int sleep_flag, int *sleep_word) #endif