Appendix C. Sample User-Level Interrupt Programs

The following applications demonstrate some of the user-level interrupt (ULI) interface:

The applications are installed with the ULI RPM and are located in:

/usr/share/react/uli/examples/

uli_sample Sample Program

The uli_sample program registers for notification on CPU 0 for occurrences of a specified interrupt number. To use uli_sample, do the following:

  1. Load the ULI feature kernel module:

    [root@linux root]# modprobe uli

  2. Change to the directory containing uli_sample:

    [root@linux root]# cd /usr/share/react/uli/examples/

  3. Run uli_sample, where interrupt# is the interrupt number:

    [root@linux root]# ./uli_sample interrupt#

    For example, to register for notification on CPU 0 for occurrences of the interrupt number 34, enter the following:

    [root@linux root]# ./uli_sample 34 

uli_ei Sample Program

The uli_ei program requires the external interrupt to run and prints a message every time the external interrupt line is toggled. To use uli_ei, do the following:

  1. Load the ULI feature kernel module, if not already done:

    [root@linux root]# modprobe uli

  2. Load the external interrupt kernel module:

    [root@linux root]# modprobe pcie_rt

  3. Set the external interrupt mode to toggle:

    [root@linux root]# echo toggle > /sys/class/extint/extint0/mode

  4. Change to the directory containing uli_ei:

    [root@linux root]# cd /usr/share/react/uli/examples/

  5. Run uli_ei:

    [root@linux root]#  ./uli_ei