diff options
author | julian <julian@FreeBSD.org> | 2001-09-12 08:38:13 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 2001-09-12 08:38:13 +0000 |
commit | 5596676e6c6c1e81e899cd0531f9b1c28a292669 (patch) | |
tree | b1a19fcdf05759281fab0d89efb13f0fdf42102e /sys/dev/random | |
parent | 83e00d4274950d2b531c24692cd123538ffbddb9 (diff) | |
download | FreeBSD-src-5596676e6c6c1e81e899cd0531f9b1c28a292669.zip FreeBSD-src-5596676e6c6c1e81e899cd0531f9b1c28a292669.tar.gz |
KSE Milestone 2
Note ALL MODULES MUST BE RECOMPILED
make the kernel aware that there are smaller units of scheduling than the
process. (but only allow one thread per process at this time).
This is functionally equivalent to teh previousl -current except
that there is a thread associated with each process.
Sorry john! (your next MFC will be a doosie!)
Reviewed by: peter@freebsd.org, dillon@freebsd.org
X-MFC after: ha ha ha ha
Diffstat (limited to 'sys/dev/random')
-rw-r--r-- | sys/dev/random/randomdev.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sys/dev/random/randomdev.c b/sys/dev/random/randomdev.c index a99fe6d..868d72f 100644 --- a/sys/dev/random/randomdev.c +++ b/sys/dev/random/randomdev.c @@ -39,6 +39,7 @@ #include <sys/module.h> #include <sys/mutex.h> #include <sys/poll.h> +#include <sys/proc.h> #include <sys/queue.h> #include <sys/random.h> #include <sys/selinfo.h> @@ -138,18 +139,18 @@ SYSCTL_PROC(_kern_random_sys_harvest, OID_AUTO, interrupt, random_check_boolean, "I", "Harvest IRQ entropy"); static int -random_open(dev_t dev, int flags, int fmt, struct proc *p) +random_open(dev_t dev, int flags, int fmt, struct thread *td) { - if ((flags & FWRITE) && (securelevel > 0 || suser(p))) + if ((flags & FWRITE) && (securelevel > 0 || suser(td->td_proc))) return EPERM; else return 0; } static int -random_close(dev_t dev, int flags, int fmt, struct proc *p) +random_close(dev_t dev, int flags, int fmt, struct thread *td) { - if ((flags & FWRITE) && !(securelevel > 0 || suser(p))) + if ((flags & FWRITE) && !(securelevel > 0 || suser(td->td_proc))) random_reseed(); return 0; } @@ -201,7 +202,7 @@ random_write(dev_t dev, struct uio *uio, int flag) } static int -random_ioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) +random_ioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct thread *td) { switch (cmd) { /* Really handled in upper layer */ @@ -214,7 +215,7 @@ random_ioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) } static int -random_poll(dev_t dev, int events, struct proc *p) +random_poll(dev_t dev, int events, struct thread *td) { int revents; @@ -223,7 +224,7 @@ random_poll(dev_t dev, int events, struct proc *p) if (random_systat.seeded) revents = events & (POLLIN | POLLRDNORM); else - selrecord(p, &random_systat.rsel); + selrecord(curthread, &random_systat.rsel); } return revents; } |