aboutsummaryrefslogtreecommitdiff
path: root/src/libmach/mach.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libmach/mach.c')
-rw-r--r--src/libmach/mach.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/libmach/mach.c b/src/libmach/mach.c
new file mode 100644
index 00000000..89a88f16
--- /dev/null
+++ b/src/libmach/mach.c
@@ -0,0 +1,30 @@
+#include <u.h>
+#include <libc.h>
+#include <bio.h>
+#include <mach.h>
+
+Mach *mach;
+
+extern Mach mach386;
+extern Mach machpower;
+
+static Mach *machs[] =
+{
+ &mach386,
+ &machpower,
+};
+
+Mach*
+machbyname(char *name)
+{
+ int i;
+
+ for(i=0; i<nelem(machs); i++)
+ if(strcmp(machs[i]->name, name) == 0){
+ mach = machs[i];
+ return machs[i];
+ }
+ werrstr("machine '%s' not found", name);
+ return nil;
+}
+