Martian divided in two parts. Those are kernel module martian_dev, and user-space program martian_modem.

Being a pci driver martian_dev serves 164x like devices. Each found device is imported to user space as file node. Currently proc entries are used. This module responsibility is to serve device irqs. There are two possibilities:

1) Module's ISR only checks the destination and clears device bits to stop irqs. When actual irq is detected then client on device file is released. The mechanism supports read/poll blocking.
 
2) ISR fully processes device events in module.
  
To process irqs correctly driver need to know some core runtime data. This makes program/module to have common block mmaped in.

martian_modem opens device, reads configuration and then mmaps the common block. 
After mapping it has to relocate shared variables to the common block. 
Then core is initialized, interrupt serving thread springs off and main
thread dives in duplex data fetching loop.   

Further interrupt processing is done by a separate thread.
To reduce latency thread scheduling policy is FIFO and given highest priority.

To relocate shared variables some core relocation info should be left in executable. This is -Wl,-q switch for. Binary can be further processed. Either to strip all unneeded info or to extract needed relocs to a separate file and drop all symbolic info.

