-#define IRQ_UNLOCK(flags) flags=0
-#define IRQ_LOCK(flags) flags=0
-#define GLOBAL_IRQ_ARE_MASKED() (1)
+#define IRQ_UNLOCK(flags) do { flags=0; /* hostsim_lock(); */ } while(0)
+#define IRQ_LOCK(flags) do { flags=0; /* hostsim_unlock(); */ } while(0)
+#define GLOBAL_IRQ_ARE_MASKED() hostsim_islocked()
+#else
+#define IRQ_UNLOCK(flags) do { flags=0; } while(0)
+#define IRQ_LOCK(flags) do { flags=0; } while(0)
+#define GLOBAL_IRQ_ARE_MASKED() (0)
+#endif /* CONFIG_MODULE_HOSTSIM */