diff --git a/sys/module.c b/sys/module.c index 1d26988..f69df77 100644 --- a/sys/module.c +++ b/sys/module.c @@ -155,6 +155,36 @@ kernel_close(struct file *f) do_close(rootproc, f); } +static const char *get_machdir(void) +{ + char *mach = NULL; + + /* first check non-cpu defines */ +#if defined(MILAN) + mach = "mil"; +#elif defined(ARANYM) + mach = "ara"; +#elif defined(__mcoldfire__) + mach = "v4e"; +#elif defined(M68000) + mach = "000"; +#elif defined(M68030) + mach = "030"; +#elif defined(M68040) + mach = "040"; +#elif defined(M68060) + mach = "060"; +#endif + + if (mach != NULL) + { + static char temp[32]; + ksprintf (temp, sizeof(temp), "%s%s\\", sysdir, mach); + return temp; + } + + return NULL; +} static long load_xfs (struct basepage *b, const char *name, short *class, short *subclass); static long load_xdd (struct basepage *b, const char *name, short *class, short *subclass); @@ -175,6 +205,23 @@ void load_all_modules(unsigned long mask) { int i; + const char *machdir = get_machdir(); + + if (machdir != NULL) + { + for (i = 0; i < (sizeof(_types) / sizeof(*_types)); i++) + { + /* load machine depend external xdd */ + if (mask & (1L << i)) + { + DEBUG(("load_all_modules (machine): processing \"%s\"", _types [i])); + load_modules(machdir, _types [i], _loads [i]); + DEBUG(("load_all_modules (machine): done with \"%s\"", _types [i])); + + stop_and_ask(); + } + } + } for (i = 0; i < (sizeof(_types) / sizeof(*_types)); i++) { @@ -339,9 +386,12 @@ void _cdecl load_modules_old(const char *ext, long (*loader)(struct basepage *, const char *)) { long (*l)(struct basepage *, const char *, short *, short *); + const char *machdir = get_machdir(); l = (void *)loader; + if (machdir != NULL) + load_modules(machdir, ext, l); load_modules(sysdir, ext, l); }