summaryrefslogtreecommitdiff
path: root/sys/arch/i386
diff options
context:
space:
mode:
authorJasper Lievisse Adriaanse <jasper@cvs.openbsd.org>2010-12-06 22:51:47 +0000
committerJasper Lievisse Adriaanse <jasper@cvs.openbsd.org>2010-12-06 22:51:47 +0000
commit765af30a9a8bfca917e5df447c894a0853190178 (patch)
tree0b44002a62dbca933d5912dcd1339c2361000eaf /sys/arch/i386
parent4e7753a7c93fd4040819da3289b11454d51ad050 (diff)
- properly remove NENTS now after fixing the fallout.
ok deraadt@
Diffstat (limited to 'sys/arch/i386')
-rw-r--r--sys/arch/i386/stand/boot/conf.c15
-rw-r--r--sys/arch/i386/stand/cdboot/conf.c13
-rw-r--r--sys/arch/i386/stand/libsa/debug.c5
-rw-r--r--sys/arch/i386/stand/libsa/dev_i386.c6
-rw-r--r--sys/arch/i386/stand/libsa/memprobe.c10
-rw-r--r--sys/arch/i386/stand/pxeboot/conf.c19
-rw-r--r--sys/arch/i386/stand/pxeboot/devopen.c6
7 files changed, 39 insertions, 35 deletions
diff --git a/sys/arch/i386/stand/boot/conf.c b/sys/arch/i386/stand/boot/conf.c
index 072a6598ef9..b737e41c236 100644
--- a/sys/arch/i386/stand/boot/conf.c
+++ b/sys/arch/i386/stand/boot/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.43 2010/12/06 22:11:01 jasper Exp $ */
+/* $OpenBSD: conf.c,v 1.44 2010/12/06 22:51:45 jasper Exp $ */
/*
* Copyright (c) 1996 Michael Shalayeff
@@ -26,6 +26,7 @@
* SUCH DAMAGE.
*/
+#include <sys/param.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <libsa.h>
@@ -58,10 +59,10 @@ void (*i386_probe2[])(void) = {
};
struct i386_boot_probes probe_list[] = {
- { "probing", i386_probe1, NENTS(i386_probe1) },
- { "disk", i386_probe2, NENTS(i386_probe2) }
+ { "probing", i386_probe1, nitems(i386_probe1) },
+ { "disk", i386_probe2, nitems(i386_probe2) }
};
-int nibprobes = NENTS(probe_list);
+int nibprobes = nitems(probe_list);
struct fs_ops file_system[] = {
@@ -80,7 +81,7 @@ struct fs_ops file_system[] = {
null_stat, null_readdir }
#endif
};
-int nfsys = NENTS(file_system);
+int nfsys = nitems(file_system);
struct devsw devsw[] = {
#ifdef _TEST
@@ -92,13 +93,13 @@ struct devsw devsw[] = {
{ "TFTP", tftpstrategy, tftpopen, tftpclose, tftpioctl },
#endif
};
-int ndevs = NENTS(devsw);
+int ndevs = nitems(devsw);
#ifdef notdef
struct netif_driver *netif_drivers[] = {
NULL
};
-int n_netif_drivers = NENTS(netif_drivers);
+int n_netif_drivers = nitems(netif_drivers);
#endif
struct consdev constab[] = {
diff --git a/sys/arch/i386/stand/cdboot/conf.c b/sys/arch/i386/stand/cdboot/conf.c
index 68ab147116a..597fb2e4f64 100644
--- a/sys/arch/i386/stand/cdboot/conf.c
+++ b/sys/arch/i386/stand/cdboot/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.15 2010/12/06 22:11:01 jasper Exp $ */
+/* $OpenBSD: conf.c,v 1.16 2010/12/06 22:51:45 jasper Exp $ */
/*
* Copyright (c) 2004 Tom Cosgrove
@@ -27,6 +27,7 @@
* SUCH DAMAGE.
*/
+#include <sys/param.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <libsa.h>
@@ -61,10 +62,10 @@ void (*i386_probe2[])(void) = {
};
struct i386_boot_probes probe_list[] = {
- { "probing", i386_probe1, NENTS(i386_probe1) },
- { "disk", i386_probe2, NENTS(i386_probe2) },
+ { "probing", i386_probe1, nitems(i386_probe1) },
+ { "disk", i386_probe2, nitems(i386_probe2) },
};
-int nibprobes = NENTS(probe_list);
+int nibprobes = nitems(probe_list);
struct fs_ops file_system[] = {
{ ufs_open, ufs_close, ufs_read, ufs_write, ufs_seek,
@@ -84,7 +85,7 @@ struct fs_ops file_system[] = {
null_stat, null_readdir }
#endif
};
-int nfsys = NENTS(file_system);
+int nfsys = nitems(file_system);
struct devsw devsw[] = {
#ifdef _TEST
@@ -93,7 +94,7 @@ struct devsw devsw[] = {
{ "BIOS", biosstrategy, biosopen, biosclose, biosioctl },
#endif
};
-int ndevs = NENTS(devsw);
+int ndevs = nitems(devsw);
struct consdev constab[] = {
#ifdef _TEST
diff --git a/sys/arch/i386/stand/libsa/debug.c b/sys/arch/i386/stand/libsa/debug.c
index 569fef851b5..e5164fbca69 100644
--- a/sys/arch/i386/stand/libsa/debug.c
+++ b/sys/arch/i386/stand/libsa/debug.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: debug.c,v 1.15 2010/12/06 22:11:01 jasper Exp $ */
+/* $OpenBSD: debug.c,v 1.16 2010/12/06 22:51:46 jasper Exp $ */
/*
* Copyright (c) 1997 Michael Shalayeff
@@ -27,6 +27,7 @@
*
*/
+#include <sys/param.h>
#include <lib/libsa/stand.h>
#include <debug.h>
#include <dev/cons.h>
@@ -34,7 +35,7 @@
#define VBASE (0xb8000)
char *const reg_names[] = { REG_NAMES };
-const int nreg = NENTS(reg_names);
+const int nreg = nitems(reg_names);
struct reg reg;
u_int32_t *const reg_values[] = { REG_VALUES(reg) };
char *const trap_names[] = { TRAP_NAMES };
diff --git a/sys/arch/i386/stand/libsa/dev_i386.c b/sys/arch/i386/stand/libsa/dev_i386.c
index f74c584eae7..099055faef1 100644
--- a/sys/arch/i386/stand/libsa/dev_i386.c
+++ b/sys/arch/i386/stand/libsa/dev_i386.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dev_i386.c,v 1.32 2010/12/06 22:11:01 jasper Exp $ */
+/* $OpenBSD: dev_i386.c,v 1.33 2010/12/06 22:51:46 jasper Exp $ */
/*
* Copyright (c) 1996-1999 Michael Shalayeff
@@ -38,13 +38,13 @@ const char bdevs[][4] = {
"wd", "", "fd", "", "sd", "st", "cd", "mcd",
"", "", "", "", "", "", "", "scd", "", "hd", ""
};
-const int nbdevs = NENTS(bdevs);
+const int nbdevs = nitems(bdevs);
const char cdevs[][4] = {
"cn", "", "", "", "", "", "", "",
"com", "", "", "", "pc"
};
-const int ncdevs = NENTS(cdevs);
+const int ncdevs = nitems(cdevs);
/* pass dev_t to the open routines */
int
diff --git a/sys/arch/i386/stand/libsa/memprobe.c b/sys/arch/i386/stand/libsa/memprobe.c
index db7472ac3d8..aece9b001fb 100644
--- a/sys/arch/i386/stand/libsa/memprobe.c
+++ b/sys/arch/i386/stand/libsa/memprobe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: memprobe.c,v 1.49 2010/12/06 22:11:01 jasper Exp $ */
+/* $OpenBSD: memprobe.c,v 1.50 2010/12/06 22:51:46 jasper Exp $ */
/*
* Copyright (c) 1997-1999 Michael Shalayeff
@@ -224,14 +224,14 @@ addrprobe(u_int kloc)
{
__volatile u_int *loc;
register u_int i, ret = 0;
- u_int save[NENTS(addrprobe_pat)];
+ u_int save[nitems(addrprobe_pat)];
/* Get location */
loc = (int *)(kloc * 1024);
save[0] = *loc;
/* Probe address */
- for (i = 0; i < NENTS(addrprobe_pat); i++) {
+ for (i = 0; i < nitems(addrprobe_pat); i++) {
*loc = addrprobe_pat[i];
if (*loc != addrprobe_pat[i])
ret++;
@@ -240,13 +240,13 @@ addrprobe(u_int kloc)
if (!ret) {
/* Write address */
- for (i = 0; i < NENTS(addrprobe_pat); i++) {
+ for (i = 0; i < nitems(addrprobe_pat); i++) {
save[i] = loc[i];
loc[i] = addrprobe_pat[i];
}
/* Read address */
- for (i = 0; i < NENTS(addrprobe_pat); i++) {
+ for (i = 0; i < nitems(addrprobe_pat); i++) {
if (loc[i] != addrprobe_pat[i])
ret++;
loc[i] = save[i];
diff --git a/sys/arch/i386/stand/pxeboot/conf.c b/sys/arch/i386/stand/pxeboot/conf.c
index d136c8c9f4f..204950d0bc1 100644
--- a/sys/arch/i386/stand/pxeboot/conf.c
+++ b/sys/arch/i386/stand/pxeboot/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.20 2010/12/06 22:11:01 jasper Exp $ */
+/* $OpenBSD: conf.c,v 1.21 2010/12/06 22:51:46 jasper Exp $ */
/*
* Copyright (c) 2004 Tom Cosgrove
@@ -27,6 +27,7 @@
* SUCH DAMAGE.
*/
+#include <sys/param.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <libsa.h>
@@ -67,17 +68,17 @@ void (*i386_probe3[])(void) = {
};
struct i386_boot_probes probe_list[] = {
- { "probing", i386_probe1, NENTS(i386_probe1) },
- { "disk", i386_probe2, NENTS(i386_probe2) },
- { "net", i386_probe3, NENTS(i386_probe3) },
+ { "probing", i386_probe1, nitems(i386_probe1) },
+ { "disk", i386_probe2, nitems(i386_probe2) },
+ { "net", i386_probe3, nitems(i386_probe3) },
};
-int nibprobes = NENTS(probe_list);
+int nibprobes = nitems(probe_list);
/* This next list must match file_system[]. */
char *fs_name[] = {
NULL, "tftp", "nfs"
};
-int nfsname = NENTS(fs_name);
+int nfsname = nitems(fs_name);
struct fs_ops file_system[] = {
{ ufs_open, ufs_close, ufs_read, ufs_write, ufs_seek,
@@ -97,7 +98,7 @@ struct fs_ops file_system[] = {
null_stat, null_readdir }
#endif
};
-int nfsys = NENTS(file_system);
+int nfsys = nitems(file_system);
struct devsw devsw[] = {
#ifdef _TEST
@@ -106,7 +107,7 @@ struct devsw devsw[] = {
{ "BIOS", biosstrategy, biosopen, biosclose, biosioctl },
#endif
};
-int ndevs = NENTS(devsw);
+int ndevs = nitems(devsw);
struct devsw netsw[] = {
{ "net", net_strategy, net_open, net_close, net_ioctl },
@@ -114,7 +115,7 @@ struct devsw netsw[] = {
struct netif_driver *netif_drivers[] = {
};
-int n_netif_drivers = NENTS(netif_drivers);
+int n_netif_drivers = nitems(netif_drivers);
struct consdev constab[] = {
#ifdef _TEST
diff --git a/sys/arch/i386/stand/pxeboot/devopen.c b/sys/arch/i386/stand/pxeboot/devopen.c
index 87d7f8a34b1..06cab9b2b75 100644
--- a/sys/arch/i386/stand/pxeboot/devopen.c
+++ b/sys/arch/i386/stand/pxeboot/devopen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: devopen.c,v 1.6 2010/12/06 22:11:01 jasper Exp $ */
+/* $OpenBSD: devopen.c,v 1.7 2010/12/06 22:51:46 jasper Exp $ */
/*
* Copyright (c) 2004 Tom Cosgrove
@@ -45,13 +45,13 @@ const char bdevs[][4] = {
"wd", "", "fd", "", "sd", "st", "cd", "mcd",
"", "", "", "", "", "", "", "scd", "", "hd", ""
};
-const int nbdevs = NENTS(bdevs);
+const int nbdevs = nitems(bdevs);
const char cdevs[][4] = {
"cn", "", "", "", "", "", "", "",
"com", "", "", "", "pc"
};
-const int ncdevs = NENTS(cdevs);
+const int ncdevs = nitems(cdevs);
/* pass dev_t to the open routines */
int