diff options
author | Marvin Borner | 2021-07-07 19:13:11 +0200 |
---|---|---|
committer | Marvin Borner | 2021-07-07 19:13:11 +0200 |
commit | 9a2d5cbdc7972d1d5bfb1ea93f82f66d113faa17 (patch) | |
tree | 08ceb8427b64a08c89a5526dfbf8b66c78f9d12c /src/loader/impl/all.c | |
parent | 6355c3e08c9f4d3db122252abce5837c364d5b81 (diff) |
Strange implementations
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"); |