summaryrefslogtreecommitdiffstats
path: root/src/libmach/mach.c
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2004-04-19 19:29:25 +0000
committerrsc <devnull@localhost>2004-04-19 19:29:25 +0000
commita84cbb2a17c9d0b88c561d5b7cb50d79a19e7c46 (patch)
tree59a0e921597e5aa53e83d487c16727a7bf01547a /src/libmach/mach.c
parent0e3cc9f456ea49919459bf1164d0c8309a6134fa (diff)
downloadplan9port-a84cbb2a17c9d0b88c561d5b7cb50d79a19e7c46.tar.gz
plan9port-a84cbb2a17c9d0b88c561d5b7cb50d79a19e7c46.zip
libmach
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;
+}
+