git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
feat: owloysius - dynamic init function invocator
[lunaix-os.git]
/
lunaix-os
/
kernel
/
device
/
devdb.c
diff --git
a/lunaix-os/kernel/device/devdb.c
b/lunaix-os/kernel/device/devdb.c
index 41238620b64caab78863470672d8e8b6c7fb8d73..eb9e612320494db1107d9a31a06de0fa57e4eaa1 100644
(file)
--- a/
lunaix-os/kernel/device/devdb.c
+++ b/
lunaix-os/kernel/device/devdb.c
@@
-10,7
+10,7
@@
static DECLARE_HASHTABLE(dev_registry, 32);
static DECLARE_HASHTABLE(dev_byif, 8);
static DEFINE_LLIST(dev_registry_flat);
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)
static inline u32_t
hash_dev(u32_t fngrp, u32_t dev)
@@
-85,32
+85,33
@@
device_definitions_byif(int if_type)
return &dev_byif[__hashkey(dev_byif, if_type)];
}
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; \
({ \
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); \
} \
})
{ \
devdef->init(devdef); \
} \
})
+#define device_load_on_stage(stage) __device_load_on_stage(stage)
void
void
-device_
earlystage
()
+device_
onboot_load
()
{
{
- device_load_on_stage(
early
);
+ device_load_on_stage(
load_onboot
);
}
void
}
void
-device_
timerstage
()
+device_
postboot_load
()
{
{
- device_load_on_stage(
aftertimer
);
+ device_load_on_stage(
load_postboot
);
}
void
}
void
-device_
poststage
()
+device_
sysconf_load
()
{
{
- device_load_on_stage(
post
);
+ device_load_on_stage(
load_sysconf
);
}
static int
}
static int
@@
-135,7
+136,7
@@
__devdb_twifs_lsdb(struct twimap* mapping)
ksnprintf(flags, 64, "if=%x,fn=%x", DEV_IF(meta), DEV_FN(meta));
twimap_printf(mapping,
ksnprintf(flags, 64, "if=%x,fn=%x", DEV_IF(meta), DEV_FN(meta));
twimap_printf(mapping,
- "%
xh:%
d \"%s\" %s\n",
+ "%
08xh:%04
d \"%s\" %s\n",
def->class.fn_grp,
def->class.device,
def->name,
def->class.fn_grp,
def->class.device,
def->name,