summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarkm <markm@FreeBSD.org>1995-11-04 16:00:56 +0000
committermarkm <markm@FreeBSD.org>1995-11-04 16:00:56 +0000
commit92ae7d4bbb0743a3701dec67e5ebfd4c26ebf109 (patch)
tree7cf0beb1198a67de5189367981d33a313873db31
parent79aa178bc752dec686d53b2248da682ac404551c (diff)
downloadFreeBSD-src-92ae7d4bbb0743a3701dec67e5ebfd4c26ebf109.zip
FreeBSD-src-92ae7d4bbb0743a3701dec67e5ebfd4c26ebf109.tar.gz
Remove the #ifdev DEVRANDOM's, as promised.
/dev/random is now a part of the kernel! you will need to make the device in /dev: sh MAKEDEV random and take a look at some test code in src/tools/test/random.
-rw-r--r--sys/amd64/amd64/machdep.c4
-rw-r--r--sys/amd64/amd64/mem.c12
-rw-r--r--sys/amd64/isa/vector.S6
-rw-r--r--sys/amd64/isa/vector.s6
-rw-r--r--sys/dev/syscons/syscons.c4
-rw-r--r--sys/i386/i386/machdep.c4
-rw-r--r--sys/i386/i386/mem.c12
-rw-r--r--sys/i386/isa/random.c24
-rw-r--r--sys/i386/isa/syscons.c4
-rw-r--r--sys/i386/isa/vector.s6
-rw-r--r--sys/isa/syscons.c4
11 files changed, 11 insertions, 75 deletions
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c
index 4621100..4d238a0 100644
--- a/sys/amd64/amd64/machdep.c
+++ b/sys/amd64/amd64/machdep.c
@@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
- * $Id: machdep.c,v 1.146 1995/10/31 19:07:53 peter Exp $
+ * $Id: machdep.c,v 1.147 1995/11/02 09:52:40 peter Exp $
*/
#include "npx.h"
@@ -1377,9 +1377,7 @@ init386(first)
#if NISA >0
isa_defaultirq();
#endif
-#ifdef DEVRANDOM
rand_initialize();
-#endif
r_gdt.rd_limit = sizeof(gdt) - 1;
r_gdt.rd_base = (int) gdt;
diff --git a/sys/amd64/amd64/mem.c b/sys/amd64/amd64/mem.c
index 788d83e..54db6cd 100644
--- a/sys/amd64/amd64/mem.c
+++ b/sys/amd64/amd64/mem.c
@@ -38,7 +38,7 @@
*
* from: Utah $Hdr: mem.c 1.13 89/10/08$
* from: @(#)mem.c 7.2 (Berkeley) 5/9/91
- * $Id: mem.c,v 1.17 1995/10/30 22:39:34 markm Exp $
+ * $Id: mem.c,v 1.18 1995/11/04 13:52:30 bde Exp $
*/
/*
@@ -79,10 +79,8 @@ memdev_init(dummy)
x=dev_add("/misc", "mem", mmopen, 0, DV_CHR, 0, 2, 0640);
x=dev_add("/misc", "kmem", mmopen, 1, DV_CHR, 0, 2, 0640);
x=dev_add("/misc", "null", mmopen, 2, DV_CHR, 0, 0, 0666);
-#ifdef DEVRANDOM
x=dev_add("/misc", "random", mmopen, 3, DV_CHR, 0, 0, 0666);
x=dev_add("/misc", "urandom", mmopen, 4, DV_CHR, 0, 0, 0666);
-#endif
x=dev_add("/misc", "zero", mmopen, 12, DV_CHR, 0, 0, 0666);
x=dev_add("/misc", "io", mmopen, 14, DV_CHR, 0, 2, 0640);
}
@@ -138,9 +136,7 @@ mmrw(dev, uio, flags)
{
register int o;
register u_int c, v;
-#ifdef DEVRANDOM
u_int poolsize;
-#endif
register struct iovec *iov;
int error = 0;
caddr_t buf = NULL;
@@ -200,7 +196,6 @@ mmrw(dev, uio, flags)
c = iov->iov_len;
break;
-#ifdef DEVRANDOM
/* minor device 3 (/dev/random) is source of filth on read, rathole on write */
case 3:
if (uio->uio_rw == UIO_WRITE) {
@@ -235,7 +230,6 @@ mmrw(dev, uio, flags)
c = min(c, poolsize);
error = uiomove(buf, (int)c, uio);
continue;
-#endif
/* minor device 12 (/dev/zero) is source of nulls on read, rathole on write */
case 12:
@@ -351,7 +345,6 @@ mmioctl(dev, cmd, cmdarg, flags, p)
int flags;
struct proc *p;
{
-#ifdef DEVRANDOM
int error;
if (minor(dev) != 3 && minor(dev) != 4)
@@ -384,7 +377,4 @@ mmioctl(dev, cmd, cmdarg, flags, p)
return (ENOTTY);
}
return (0);
-#else
- return (ENODEV);
-#endif /* DEVRANDOM */
}
diff --git a/sys/amd64/isa/vector.S b/sys/amd64/isa/vector.S
index c630bee..388c0e2 100644
--- a/sys/amd64/isa/vector.S
+++ b/sys/amd64/isa/vector.S
@@ -1,6 +1,6 @@
/*
* from: vector.s, 386BSD 0.1 unknown origin
- * $Id: vector.s,v 1.12 1995/04/15 21:32:18 bde Exp $
+ * $Id: vector.s,v 1.13 1995/10/28 16:58:05 markm Exp $
*/
#include <i386/isa/icu.h>
@@ -53,15 +53,11 @@
#define MAYBE_PUSHL_ES
#endif
-#ifdef DEVRANDOM
#define ADDENTROPY(irq_num) \
/* Add this interrupt to the pool of entropy */ \
pushl $irq_num ; \
call _add_interrupt_randomness ; \
addl $4,%esp
-#else
-#define ADDENTROPY(irq_num)
-#endif
/*
* Macros for interrupt interrupt entry, call to handler, and exit.
diff --git a/sys/amd64/isa/vector.s b/sys/amd64/isa/vector.s
index c630bee..388c0e2 100644
--- a/sys/amd64/isa/vector.s
+++ b/sys/amd64/isa/vector.s
@@ -1,6 +1,6 @@
/*
* from: vector.s, 386BSD 0.1 unknown origin
- * $Id: vector.s,v 1.12 1995/04/15 21:32:18 bde Exp $
+ * $Id: vector.s,v 1.13 1995/10/28 16:58:05 markm Exp $
*/
#include <i386/isa/icu.h>
@@ -53,15 +53,11 @@
#define MAYBE_PUSHL_ES
#endif
-#ifdef DEVRANDOM
#define ADDENTROPY(irq_num) \
/* Add this interrupt to the pool of entropy */ \
pushl $irq_num ; \
call _add_interrupt_randomness ; \
addl $4,%esp
-#else
-#define ADDENTROPY(irq_num)
-#endif
/*
* Macros for interrupt interrupt entry, call to handler, and exit.
diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c
index 6080597..ef0251d 100644
--- a/sys/dev/syscons/syscons.c
+++ b/sys/dev/syscons/syscons.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: syscons.c,v 1.126 1995/10/14 07:08:09 bde Exp $
+ * $Id: syscons.c,v 1.127 1995/10/28 16:58:04 markm Exp $
*/
#include "sc.h"
@@ -2203,9 +2203,7 @@ next_code:
else
goto next_code;
-#ifdef DEVRANDOM
add_keyboard_randomness(scancode);
-#endif
if (cur_console->status & KBD_RAW_MODE)
return scancode;
diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c
index 4621100..4d238a0 100644
--- a/sys/i386/i386/machdep.c
+++ b/sys/i386/i386/machdep.c
@@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
- * $Id: machdep.c,v 1.146 1995/10/31 19:07:53 peter Exp $
+ * $Id: machdep.c,v 1.147 1995/11/02 09:52:40 peter Exp $
*/
#include "npx.h"
@@ -1377,9 +1377,7 @@ init386(first)
#if NISA >0
isa_defaultirq();
#endif
-#ifdef DEVRANDOM
rand_initialize();
-#endif
r_gdt.rd_limit = sizeof(gdt) - 1;
r_gdt.rd_base = (int) gdt;
diff --git a/sys/i386/i386/mem.c b/sys/i386/i386/mem.c
index 788d83e..54db6cd 100644
--- a/sys/i386/i386/mem.c
+++ b/sys/i386/i386/mem.c
@@ -38,7 +38,7 @@
*
* from: Utah $Hdr: mem.c 1.13 89/10/08$
* from: @(#)mem.c 7.2 (Berkeley) 5/9/91
- * $Id: mem.c,v 1.17 1995/10/30 22:39:34 markm Exp $
+ * $Id: mem.c,v 1.18 1995/11/04 13:52:30 bde Exp $
*/
/*
@@ -79,10 +79,8 @@ memdev_init(dummy)
x=dev_add("/misc", "mem", mmopen, 0, DV_CHR, 0, 2, 0640);
x=dev_add("/misc", "kmem", mmopen, 1, DV_CHR, 0, 2, 0640);
x=dev_add("/misc", "null", mmopen, 2, DV_CHR, 0, 0, 0666);
-#ifdef DEVRANDOM
x=dev_add("/misc", "random", mmopen, 3, DV_CHR, 0, 0, 0666);
x=dev_add("/misc", "urandom", mmopen, 4, DV_CHR, 0, 0, 0666);
-#endif
x=dev_add("/misc", "zero", mmopen, 12, DV_CHR, 0, 0, 0666);
x=dev_add("/misc", "io", mmopen, 14, DV_CHR, 0, 2, 0640);
}
@@ -138,9 +136,7 @@ mmrw(dev, uio, flags)
{
register int o;
register u_int c, v;
-#ifdef DEVRANDOM
u_int poolsize;
-#endif
register struct iovec *iov;
int error = 0;
caddr_t buf = NULL;
@@ -200,7 +196,6 @@ mmrw(dev, uio, flags)
c = iov->iov_len;
break;
-#ifdef DEVRANDOM
/* minor device 3 (/dev/random) is source of filth on read, rathole on write */
case 3:
if (uio->uio_rw == UIO_WRITE) {
@@ -235,7 +230,6 @@ mmrw(dev, uio, flags)
c = min(c, poolsize);
error = uiomove(buf, (int)c, uio);
continue;
-#endif
/* minor device 12 (/dev/zero) is source of nulls on read, rathole on write */
case 12:
@@ -351,7 +345,6 @@ mmioctl(dev, cmd, cmdarg, flags, p)
int flags;
struct proc *p;
{
-#ifdef DEVRANDOM
int error;
if (minor(dev) != 3 && minor(dev) != 4)
@@ -384,7 +377,4 @@ mmioctl(dev, cmd, cmdarg, flags, p)
return (ENOTTY);
}
return (0);
-#else
- return (ENODEV);
-#endif /* DEVRANDOM */
}
diff --git a/sys/i386/isa/random.c b/sys/i386/isa/random.c
index af67c56..3105e7b 100644
--- a/sys/i386/isa/random.c
+++ b/sys/i386/isa/random.c
@@ -1,7 +1,7 @@
/*
* random.c -- A strong random number generator
*
- * $Id$
+ * $Id: random.c,v 1.1 1995/10/28 16:58:02 markm Exp $
*
* Version 0.92, last modified 21-Sep-95
*
@@ -40,8 +40,6 @@
*
*/
-#ifdef DEVRANDOM
-
#include <sys/param.h>
#include <sys/cdefs.h>
#include <sys/kernel.h>
@@ -430,23 +428,3 @@ read_random_unlimited(char * buf, u_int nbytes)
{
return extract_entropy(&random_state, buf, nbytes);
}
-
-#ifdef linux
-int
-read_random(struct inode * inode,struct file * file,char * buf,int nbytes)
-{
- if ((nbytes * 8) > random_state.entropy_count)
- nbytes = random_state.entropy_count / 8;
-
- return extract_entropy(&random_state, buf, nbytes, 1);
-}
-
-int
-read_random_unlimited(struct inode * inode,struct file * file,
- char * buf,int nbytes)
-{
- return extract_entropy(&random_state, buf, nbytes, 1);
-}
-#endif
-
-#endif /* DEVRANDOM */
diff --git a/sys/i386/isa/syscons.c b/sys/i386/isa/syscons.c
index 6080597..ef0251d 100644
--- a/sys/i386/isa/syscons.c
+++ b/sys/i386/isa/syscons.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: syscons.c,v 1.126 1995/10/14 07:08:09 bde Exp $
+ * $Id: syscons.c,v 1.127 1995/10/28 16:58:04 markm Exp $
*/
#include "sc.h"
@@ -2203,9 +2203,7 @@ next_code:
else
goto next_code;
-#ifdef DEVRANDOM
add_keyboard_randomness(scancode);
-#endif
if (cur_console->status & KBD_RAW_MODE)
return scancode;
diff --git a/sys/i386/isa/vector.s b/sys/i386/isa/vector.s
index c630bee..388c0e2 100644
--- a/sys/i386/isa/vector.s
+++ b/sys/i386/isa/vector.s
@@ -1,6 +1,6 @@
/*
* from: vector.s, 386BSD 0.1 unknown origin
- * $Id: vector.s,v 1.12 1995/04/15 21:32:18 bde Exp $
+ * $Id: vector.s,v 1.13 1995/10/28 16:58:05 markm Exp $
*/
#include <i386/isa/icu.h>
@@ -53,15 +53,11 @@
#define MAYBE_PUSHL_ES
#endif
-#ifdef DEVRANDOM
#define ADDENTROPY(irq_num) \
/* Add this interrupt to the pool of entropy */ \
pushl $irq_num ; \
call _add_interrupt_randomness ; \
addl $4,%esp
-#else
-#define ADDENTROPY(irq_num)
-#endif
/*
* Macros for interrupt interrupt entry, call to handler, and exit.
diff --git a/sys/isa/syscons.c b/sys/isa/syscons.c
index 6080597..ef0251d 100644
--- a/sys/isa/syscons.c
+++ b/sys/isa/syscons.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: syscons.c,v 1.126 1995/10/14 07:08:09 bde Exp $
+ * $Id: syscons.c,v 1.127 1995/10/28 16:58:04 markm Exp $
*/
#include "sc.h"
@@ -2203,9 +2203,7 @@ next_code:
else
goto next_code;
-#ifdef DEVRANDOM
add_keyboard_randomness(scancode);
-#endif
if (cur_console->status & KBD_RAW_MODE)
return scancode;
OpenPOWER on IntegriCloud