QNX RTOS v4 Knowledge Base
QNX RTOS v4 Knowledge Base
Title |
QNX4: Using qnx_hint_attach() in a C++ interupt handler. |
Ref. No. |
QNX.000000043 |
Category(ies) |
Development |
Issue |
We want to know how to use qnx_hint_attach() in a C++ program. We are using the QNX4 RTOS and Watcom 10.6 compiler.
|
Solution |
Using the function, qnx_hint_attach, in C++ code is a bad idea.
Write the handler in C, and link its .o file to the rest of the C++ code after. Make sure that you compile all the modules with compatible arguments.
There are some rules of thumb for interrupt handlers: 1) only talk to your hardware i.e. to clear the state of the IRQ 2) keep the handler as short as possible, and if there is lots to do use a proxy and do the work outside the handler 3) you cannot use functions that use kernel calls in the handler 4) the handler _MUST_ be a far function 5) the module with the handler must be compiled with -zu "-Wc,-s" to set SS!=DS and disable stack checking.
See Also: Watcom Compiler & Tools |
|