Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #include "eus.h"
00009 #include <asm/io.h>
00010
00011
00012 pointer IOPERM(context *ctx, int n, pointer argv[])
00013 { int val, stat;
00014 val= intval(argv[0]);
00015 stat= ioperm(0, 0x3ff, val);
00016 if (stat<0) {
00017 error("IOPERM failed because of insufficient priviledge");}
00018 return(T); }
00019
00020 pointer OUTB(context *ctx, int n, pointer argv[])
00021 { int port, val;
00022 port=intval(argv[0]);
00023 val=intval(argv[1]);
00024 outb(val, port);
00025 return(argv[1]);
00026 }
00027
00028 pointer INB(context *ctx, int n, pointer argv[])
00029 { int port, val;
00030 port=intval(argv[0]);
00031 val=inb(port);
00032 return(makeint(val));
00033 }
00034
00035 pointer linux_lowio(context *ctx, int n, pointer argv[], pointer env)
00036 { pointer p=Spevalof(PACKAGE);
00037 pointer mod;
00038
00039 mod = argv[0];
00040
00041
00042
00043 printf("ioperm, outb, inb\n");
00044
00045 defun(ctx,"IOPERM", mod, IOPERM,NULL);
00046 defun(ctx,"OUTB", mod, OUTB,NULL);
00047 defun(ctx,"INB", mod, INB,NULL);
00048
00049 printf("linux low level IO functions defined.\n");
00050
00051 return(NIL);
00052 }
00053
00054
00055