Writing SMP safe OS/2 device drivers is actually very simple with Warp Server SMP. OS/2 guarantees that most (if not all) device drivers execute only on the first processor. There are a couple of gotchas, though. For one thing, do not rely on the following code:
PUSHF CLI ... POPFThis will NOT restore the interrupt enable flag at least on OS/2 2.11SMP. Instead, use the following code:
PUSHF CLI ... POP AX TEST AX, 200h JZ @F STI @@:Also, for OS/2 2.11 SMP it is much faster to use spinlock calls instead of CLI/STI. OS/2 2.11 SMP will trap all CLI/STI calls and block all processors. Warp Server SMP is just the opposite. Warp Server SMP does not trap CLI/STI calls and spinlock calls are much slower.
One thing not documented is that spinlocks can be nested on the same processor. This means that you can replace all of your pushf/cli/etc. code with spinlocks without having to worry about nesting.