Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151044162
D50880.id157111.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D50880.id157111.diff
View Options
diff --git a/sys/sys/_param.h b/sys/sys/_param.h
new file mode 100644
--- /dev/null
+++ b/sys/sys/_param.h
@@ -0,0 +1,19 @@
+/*-
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
+ * Copyright (c) 1982, 1986, 1989, 1993
+ * The Regents of the University of California. All rights reserved.
+ * (c) UNIX System Laboratories, Inc.
+ */
+
+#ifndef _SYS__PARAM_H_
+#define _SYS__PARAM_H_
+
+#define NBBY 8 /* number of bits in a byte */
+#define NBPW sizeof(int) /* number of bytes per word (integer) */
+
+#ifndef howmany
+#define howmany(x, y) (((x)+((y)-1))/(y))
+#endif
+
+#endif /* _SYS__PARAM_H_ */
diff --git a/sys/sys/param.h b/sys/sys/param.h
--- a/sys/sys/param.h
+++ b/sys/sys/param.h
@@ -38,6 +38,7 @@
#define _SYS_PARAM_H_
#include <sys/_null.h>
+#include <sys/_param.h>
#define BSD 199506 /* System version (year & month). */
#define BSD4_3 1
@@ -253,9 +254,6 @@
#define NZERO 0 /* default "nice" */
-#define NBBY 8 /* number of bits in a byte */
-#define NBPW sizeof(int) /* number of bytes per word (integer) */
-
#define CMASK 022 /* default file mask: S_IWGRP|S_IWOTH */
#define NODEV (dev_t)(-1) /* non-existent device */
@@ -319,10 +317,11 @@
#define isclr(a,i) \
((((const unsigned char *)(a))[(i)/NBBY] & (1<<((i)%NBBY))) == 0)
-/* Macros for counting and rounding. */
-#ifndef howmany
-#define howmany(x, y) (((x)+((y)-1))/(y))
-#endif
+/*
+ * Macros for counting and rounding.
+ *
+ * howmany() has been moved to <sys/_param.h>.
+ */
#define nitems(x) (sizeof((x)) / sizeof((x)[0]))
#define rounddown(x, y) (((x)/(y))*(y))
#define rounddown2(x, y) __align_down(x, y) /* if y is power of two */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Apr 6, 3:18 PM (14 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30980080
Default Alt Text
D50880.id157111.diff (1 KB)
Attached To
Mode
D50880: sys/param.h: Split some macros into new <sys/_param.h>
Attached
Detach File
Event Timeline
Log In to Comment