Michel,
Don't use
Internal as the bus-type. I know that it sounds right, and theoretically should work, however, I think that the only valid bus-type for our BSP is
ISA. Mainly because I wrote the CEDDK back before Microsoft added the
Internal bus-type. We may have fixed it during release 1.0, I can't remember right off the top of my head. Either way,
Isa will work the exact same way and I know it is implemented correctly.
Also, you should call
TransBusAddrToStatic() from the driver's main DLL. Then, pass in the appropriately mapped addresses to the IISR via a call to
KernelIoctl(). The way you have your code set up right now has you calling that function during every interrupt event which would incur quite a bit of unnecessary overhead. Plus, I'm not sure if you will be able to call that function from a kernel-linked library.
Try something like:
During the driver's loading process.
void
install_ISR(......)
{
LoadIntChainHandler(.....);
TransBusAddrToStatic(.....);
/* Fill in some sort of information structure. */
/* Pass the information structure to the IISR. */
KernelLibIoControl(&info, IOCTL_GIISR_INFO, ...);
}
Inside the Installable ISR's code.
BOOL
IOControl(......)
{
switch ( ioctl_code )
{
case IOCTL_GIISR_INFO:
/* This input/output control is used when the
* IST is passing us a filled-in GIISR_INFO
* structure. This structure includes the value
* of the SysIntr that we should return, the
* address of of our hardware port, etc. */
if ( (sizeof(GIISR_INFO) != len_in) || (!buf_in) )
{
/* Invalid size of input buffer or bad input
* buffer pointer. */
return (FALSE);
}
/* The compiler may generate a memcpy call for
* a structure assignment. Since we are not
* linking with the CRT, we use our own copy
* routine. */
my_mem_copy(......);
break;
.......
}
static void
my_mem_copy(GIISR_INFO *dst, const GIISR_INFO *src)
{
size_t count = sizeof(GIISR_INFO);
while ( count-- )
*((BYTE *)dst)++ = *((BYTE *)src)++;
return;
} /* end my_mem_copy() */
Regards,
--mikee