#include <lib/hash.h>
-#include <klibc/stdio.h>
+#include <klibc/strfmt.h>
static DECLARE_HASHTABLE(dev_registry, 32);
static DECLARE_HASHTABLE(dev_byif, 8);
static DEFINE_LLIST(dev_registry_flat);
-static struct device* adhoc_devcat;
+static struct device_cat* adhoc_devcat;
static inline u32_t
hash_dev(u32_t fngrp, u32_t dev)
return &dev_byif[__hashkey(dev_byif, if_type)];
}
-#define device_load_on_stage(stage) \
+#define __device_load_on_stage(stage) \
({ \
int idx = 0; \
struct device_def* devdef; \
- ldga_foreach(dev_ld_##stage, struct device_def*, idx, devdef) \
+ ldga_foreach(dev_##stage, struct device_def*, idx, devdef) \
{ \
devdef->init(devdef); \
} \
})
+#define device_load_on_stage(stage) __device_load_on_stage(stage)
void
-device_earlystage()
+device_onboot_load()
{
- device_load_on_stage(early);
+ device_load_on_stage(load_onboot);
}
void
-device_timerstage()
+device_postboot_load()
{
- device_load_on_stage(aftertimer);
+ device_load_on_stage(load_postboot);
}
void
-device_poststage()
+device_sysconf_load()
{
- device_load_on_stage(post);
+ device_load_on_stage(load_sysconf);
}
static int
ksnprintf(flags, 64, "if=%x,fn=%x", DEV_IF(meta), DEV_FN(meta));
twimap_printf(mapping,
- "%xh:%d \"%s\" %s\n",
+ "%08xh:%04d \"%s\" %s\n",
def->class.fn_grp,
def->class.device,
def->name,