projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
BSD 4_3_Reno release
[unix-history]
/
usr
/
src
/
sys
/
vaxuba
/
ad.c
diff --git
a/usr/src/sys/vaxuba/ad.c
b/usr/src/sys/vaxuba/ad.c
index
27e2c7f
..
00319ef
100644
(file)
--- a/
usr/src/sys/vaxuba/ad.c
+++ b/
usr/src/sys/vaxuba/ad.c
@@
-1,22
+1,28
@@
-/* ad.c 6.1 83/07/29 */
+/*
+ * Copyright (c) 1982, 1986 Regents of the University of California.
+ * All rights reserved. The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ *
+ * @(#)ad.c 7.7 (Berkeley) 4/3/90
+ */
#include "ad.h"
#if NAD > 0
/*
* Data translation AD converter interface -- Bill Reeves
*/
#include "ad.h"
#if NAD > 0
/*
* Data translation AD converter interface -- Bill Reeves
*/
-#include "
../
machine/pte.h"
+#include "machine/pte.h"
-#include "
../h/
param.h"
-#include "
../h/dir
.h"
-#include "
../h/
user.h"
-#include "
../h/
buf.h"
-#include "
../h/
systm.h"
-#include "
../h/
map.h"
+#include "param.h"
+#include "
ioctl
.h"
+#include "user.h"
+#include "buf.h"
+#include "systm.h"
+#include "map.h"
-#include "
../vaxuba/
ubareg.h"
-#include "
../vaxuba/
ubavar.h"
-#include "
../vaxuba/
adreg.h"
+#include "ubareg.h"
+#include "ubavar.h"
+#include "adreg.h"
#define ADBUSY 01
#define ADWAITPRI (PZERO+1)
#define ADBUSY 01
#define ADWAITPRI (PZERO+1)
@@
-81,6
+87,7
@@
adclose(dev)
ad[ADUNIT(dev)].ad_open = 0;
ad[ADUNIT(dev)].ad_state = 0;
ad[ADUNIT(dev)].ad_open = 0;
ad[ADUNIT(dev)].ad_state = 0;
+ return (0);
}
/*ARGSUSED*/
}
/*ARGSUSED*/
@@
-99,7
+106,7
@@
adioctl(dev, cmd, addr, flag)
case ADIOSCHAN:
adp = &ad[ADUNIT(dev)];
case ADIOSCHAN:
adp = &ad[ADUNIT(dev)];
- adp->ad_chan = (*(int *)
data
)<<8;
+ adp->ad_chan = (*(int *)
addr
)<<8;
break;
case ADIOGETW:
break;
case ADIOGETW:
@@
-113,10
+120,15
@@
adioctl(dev, cmd, addr, flag)
}
adp->ad_state |= ADBUSY;
adaddr->ad_csr |= AD_IENABLE|AD_START;
}
adp->ad_state |= ADBUSY;
adaddr->ad_csr |= AD_IENABLE|AD_START;
+ i = 0;
while (adp->ad_state&ADBUSY)
while (adp->ad_state&ADBUSY)
- sleep((caddr_t)adp, ADWAITPRI);
+ if (i = tsleep((caddr_t)adp, ADWAITPRI | PCATCH,
+ devio, 0)
+ break;
spl0();
spl0();
- *(int *)data = adp->ad_softdata;
+ if (i)
+ return (i);
+ *(int *)addr = adp->ad_softdata;
break;
default:
break;
default: