00001 00007 /* Embedded XINU, Copyright (C) 2007. All rights reserved. */ 00008 00009 #include <vararg.h> 00010 #include <kernel.h> 00011 #include <device.h> 00012 00018 devcall open(ushort descrp, ...) 00019 { 00020 device *devptr; 00021 va_list ap; 00022 devcall result; 00023 00024 if ( isbaddev(descrp) ) { return SYSERR; } 00025 devptr = &devtab[descrp]; 00026 va_start(ap, descrp); 00027 result = ( (*devptr->open)(devptr, ap) ); 00028 va_end(ap); 00029 return result; 00030 }