diff options
Diffstat (limited to 'src/loader/impl/all.c')
-rw-r--r-- | src/loader/impl/all.c | 18 |
1 files changed, 12 insertions, 6 deletions
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 <impl/all.h> #include <impl/mb1.h> +#include <impl/mb2.h> #include <pnc.h> -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"); |