diff options
author | Marvin Borner | 2021-07-05 23:22:24 +0200 |
---|---|---|
committer | Marvin Borner | 2021-07-05 23:27:40 +0200 |
commit | 23aa6f84539ba320a91235fb81681d0754178f62 (patch) | |
tree | 972b0a4abc41900538bda23f4ac2145abf94e369 /src/loader/dev.c | |
parent | d1476974cd612412eefc40c6dc72ba66191136fd (diff) |
ACPI and config parsing
Diffstat (limited to 'src/loader/dev.c')
-rw-r--r-- | src/loader/dev.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/loader/dev.c b/src/loader/dev.c index e529dfa..591d5a2 100644 --- a/src/loader/dev.c +++ b/src/loader/dev.c @@ -25,6 +25,16 @@ struct dev *dev_get(u8 id) return &devices[id]; } +void dev_foreach(enum dev_type type, u8 (*cb)(struct dev *)) +{ + for (u8 i = 0; i < COUNT(devices); i++) { + struct dev *dev = &devices[i]; + if (dev->type == type) + if (cb(dev)) + break; + } +} + u8 dev_register(enum dev_type type, char *name, u32 data, s32 (*read)(void *, u32, u32, struct dev *), s32 (*write)(const void *, u32, u32, struct dev *)) |