From 9a2d5cbdc7972d1d5bfb1ea93f82f66d113faa17 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Wed, 7 Jul 2021 19:13:11 +0200 Subject: Strange implementations --- src/loader/impl/all.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/loader/impl/all.c') diff --git a/src/loader/impl/all.c b/src/loader/impl/all.c index a5c93b1..941986d 100644 --- a/src/loader/impl/all.c +++ b/src/loader/impl/all.c @@ -2,25 +2,31 @@ #include #include +#include #include -u8 impl_detect(struct dev *dev, const char *path) +u8 impl_detect(struct cfg_entry *cfg) { - if (mb1_detect(dev, path)) + if (mb1_detect(cfg)) + return 1; + + if (mb2_detect(cfg)) return 1; return 0; } -void impl_exec(struct dev *dev, const char *path) +void impl_exec(struct cfg_entry *cfg) { - assert(dev->type == DEV_DISK); + assert(cfg->dev->type == DEV_DISK); - switch (dev->p.disk.impl.type) { + switch (cfg->impl.type) { case IMPL_MB1: - mb1_exec(dev, path); + mb1_exec(cfg); break; case IMPL_MB2: + mb2_exec(cfg); + break; case IMPL_NONE: default: panic("Invalid implementation\n"); -- cgit v1.2.3