+#include <usr/lunaix/device.h>
+
+/**
+ * @brief Export a device definition
+ *
+ */
+#define EXPORT_DEVICE(id, devdef, load_order) \
+ export_ldga_el(devdefs, id, ptr_t, devdef); \
+ export_ldga_el_sfx(devdefs, id##_ldorder, ptr_t, devdef, load_order);
+
+#define load_on_demand ld_ondemand
+#define load_pci_probe ld_ondemand
+
+/**
+ * @brief Mark the device definition should be loaded automatically as earlier
+ * as possible in the kernel bootstrapping stage (before initialization of file
+ * systems). Load here if your driver is standalone and require no other than
+ * basic memory allocation services
+ *
+ */
+#define load_earlystage ld_early
+
+/**
+ * @brief Mark the device definition should be loaded automatically after timer
+ * is ready. Load here if your driver require a basic timing service
+ *
+ */
+#define load_timerstage ld_aftertimer
+
+/**
+ * @brief Mark the device definition should be loaded automatically in
+ * the post boostrapping stage (i.e., the start up of proc0). Load here if your
+ * driver involves async mechanism
+ *
+ */
+#define load_poststage ld_post
+
+/**
+ * @brief Declare a device class
+ *
+ */
+#define DEVCLASS(devif, devfn, dev) \
+ (struct devclass) \
+ { \
+ .fn_grp = DEV_FNGRP(devif, devfn), .device = (dev), .variant = 0 \
+ }
+
+#define DEVCLASSV(devif, devfn, dev, devvar) \
+ (struct devclass) \
+ { \
+ .fn_grp = DEV_FNGRP(devif, devfn), .device = (dev), \
+ .variant = (devvar) \
+ }
+