cdev_decl(ccd);
#include "joy.h"
cdev_decl(joy);
+#include "rnd.h"
+cdev_decl(rnd);
cdev_decl(ipl);
#ifdef IPFILTER
#else
cdev_notdef(), /* 43 */
#endif
- cdev_gen_ipf(NIPF,ipl), /* 44 */
+ cdev_gen_ipf(NIPF,ipl), /* 44 ip filtering */
+ cdev_rnd_init(NRND,rnd), /* 45 random data source */
};
int nchrdev = sizeof(cdevsw) / sizeof(cdevsw[0]);
+/* $OpenBSD: pccons.c,v 1.6 1996/03/29 12:05:39 mickey Exp $ */
/* $NetBSD: pccons.c,v 1.91 1995/12/24 02:30:25 mycroft Exp $ */
/*-
#include <i386/isa/isa_machdep.h>
#include <i386/isa/kbdreg.h>
+#include "rnd.h"
+#if NRND
+#include <dev/rndvar.h>
+#endif
+
#define XFREE86_BUG_COMPAT
#ifndef BEEP_FREQ
goto loop;
}
+#if NRND
+ add_keyboard_randomness(dt);
+#endif
+
if (pc_xmode > 0) {
#if defined(DDB) && defined(XSERVER_DDB)
/* F12 enters the debugger while in X mode */
#define EXTERN /* allocate mem */
#include "pcvt_hdr.h" /* global include */
+#include "rnd.h"
+#if NRND
+#include <dev/rndvar.h>
+#endif
#ifdef NOTDEF
unsigned __debug = 0; /*0xffe */;
dt = inb(CONTROLLER_DATA); /* get it 8042 data */
+#if NRND
+ add_keyboard_randomness(dt);
+#endif
if (pcvt_kbd_count >= PCVT_KBD_FIFO_SZ) /* fifo overflow ? */
{
log (LOG_WARNING, "pcvt: keyboard buffer overflow\n");
#if NVT > 0
#include "pcvt_hdr.h" /* global include */
+#include "rnd.h"
+#if NRND
+#include <dev/rndvar.h>
+#endif
static void fkey1(void), fkey2(void), fkey3(void), fkey4(void);
static void fkey5(void), fkey6(void), fkey7(void), fkey8(void);
PCVT_KBD_DELAY(); /* 7 us delay */
dt = inb(CONTROLLER_DATA); /* yes, get data */
+#if NRND
+ add_keyboard_randomness(dt)
+#endif
#endif /* !PCVT_KBD_FIFO */
/*
pseudo-device ppp: ifnet
pseudo-device tun: ifnet
pseudo-device bpfilter: ifnet
+pseudo-device rnd
# XXX machine-independent SCSI files should live somewhere here, maybe
file dev/ic/pdq.c pdq
file dev/ic/pdq_ifsubr.c pdq
file dev/mulaw.c mulaw
+file dev/rnd.c rnd needs-flag
file dev/vnd.c vnd needs-flag
file isofs/cd9660/cd9660_bmap.c cd9660
file isofs/cd9660/cd9660_lookup.c cd9660
#include <sys/conf.h>
#include <sys/cpu.h>
+#include "rnd.h"
+#if NRND > 0
+#include <dev/rndvar.h>
+#endif
+
/* Macros to clear/set/test flags. */
#define SET(t, f) (t) |= (f)
#define CLR(t, f) (t) &= ~(f)
panic("biodone already");
SET(bp->b_flags, B_DONE); /* note that it's done */
+#if NRND > 0
+ add_blkdev_randomness(bp->b_dev);
+#endif
+
if (!ISSET(bp->b_flags, B_READ)) /* wake up reader */
vwakeup(bp);
#define NETISR_ARP 18 /* same as AF_LINK */
#define NETISR_PPP 26 /* for PPP processing */
-#define schednetisr(anisr) { netisr |= 1<<(anisr); setsoftnet(); }
-
#ifndef _LOCORE
#ifdef _KERNEL
int netisr; /* scheduling bits for network */
+
+#include "rnd.h"
+#if NRND > 0
+#include <dev/rndvar.h>
+#define schednetisr(anisr) \
+ { netisr |= 1<<(anisr); add_net_randomness(anisr); setsoftnet(); }
+#else /* no rnd */
+#define schednetisr(anisr) { netisr |= 1<<(anisr); setsoftnet(); }
+#endif
#endif
#endif
-/* $OpenBSD: conf.h,v 1.3 1996/03/03 12:11:27 niklas Exp $ */
+/* $OpenBSD: conf.h,v 1.4 1996/03/29 12:05:56 mickey Exp $ */
/* $NetBSD: conf.h,v 1.30 1996/02/13 21:08:50 christos Exp $ */
/*-
(dev_type_stop((*))) enodev, 0, (dev_type_select((*))) enodev, \
(dev_type_mmap((*))) enodev }
+/* open, close, read, write, ioctl, select */
+#define cdev_rnd_init(c,n) { \
+ dev_init(c,n,open), dev_init(c,n,close), dev_init(c,n,read), \
+ dev_init(c,n,write), dev_init(c,n,ioctl), (dev_type_stop((*))) enodev, \
+ 0, dev_init(c,n,select), (dev_type_mmap((*))) enodev }
+
/* symbolic sleep message strings */
extern char devopn[], devio[], devwait[], devin[], devout[];
extern char devioc[], devcls[];