Skip to content

Commit 77e2278

Browse files
committed
2013-10-10 Sebastian Huber <[email protected]>
* libc/libc/sys/rtems/sys/param.h: Update some parameters to the latest FreeBSD values.
1 parent 50eb944 commit 77e2278

File tree

2 files changed

+38
-23
lines changed

2 files changed

+38
-23
lines changed

newlib/ChangeLog

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2013-10-10 Sebastian Huber <[email protected]>
2+
3+
* libc/libc/sys/rtems/sys/param.h: Update some parameters to
4+
the latest FreeBSD values.
5+
16
2013-10-10 Sebastian Huber <[email protected]>
27

38
* libc/sys/rtems/machine/_types.h (_HAVE_SYSTYPES): Define.

newlib/libc/sys/rtems/sys/param.h

+33-23
Original file line numberDiff line numberDiff line change
@@ -66,19 +66,19 @@
6666
* Redefined constants are from POSIX 1003.1 limits file.
6767
*
6868
* MAXCOMLEN should be >= sizeof(ac_comm) (see <acct.h>)
69-
* MAXLOGNAME should be >= UT_NAMESIZE (see <utmp.h>)
7069
*/
7170
#include <sys/syslimits.h>
7271

73-
#define MAXCOMLEN 16 /* max command name remembered */
74-
#define MAXINTERP 32 /* max interpreter file name length */
75-
#define MAXLOGNAME 12 /* max login name length */
72+
#define MAXCOMLEN 19 /* max command name remembered */
73+
#define MAXINTERP PATH_MAX /* max interpreter file name length */
74+
#define MAXLOGNAME 33 /* max login name length (incl. NUL) */
7675
#define MAXUPRC CHILD_MAX /* max simultaneous processes */
7776
#define NCARGS ARG_MAX /* max bytes for an exec function */
78-
#define NGROUPS NGROUPS_MAX /* max number groups */
77+
#define NGROUPS (NGROUPS_MAX+1) /* max number groups */
7978
#define NOFILE OPEN_MAX /* max open files per process */
8079
#define NOGROUP 65535 /* marker for empty group set member */
8180
#define MAXHOSTNAMELEN 256 /* max hostname size */
81+
#define SPECNAMELEN 63 /* max length of devicename */
8282

8383
/* More types and definitions used throughout the kernel. */
8484
#if defined(KERNEL) || defined(_KERNEL)
@@ -123,21 +123,29 @@
123123
/*
124124
* File system parameters and macros.
125125
*
126-
* The file system is made out of blocks of at most MAXBSIZE units, with
127-
* smaller units (fragments) only in the last direct block. MAXBSIZE
128-
* primarily determines the size of buffers in the buffer pool. It may be
129-
* made larger without any effect on existing file systems; however making
130-
* it smaller make make some file systems unmountable. Also, MAXBSIZE
131-
* must be less than MAXPHYS!!! DFLTBSIZE is the average amount of
132-
* memory allocated by vfs_bio per nbuf. BKVASIZE is the average amount
133-
* of kernel virtual space allocated per nbuf. BKVASIZE should be >=
134-
* DFLTBSIZE. If it is significantly bigger than DFLTBSIZE, then
135-
* kva fragmentation causes fewer performance problems.
126+
* MAXBSIZE - Filesystems are made out of blocks of at most MAXBSIZE bytes
127+
* per block. MAXBSIZE may be made larger without effecting
128+
* any existing filesystems as long as it does not exceed MAXPHYS,
129+
* and may be made smaller at the risk of not being able to use
130+
* filesystems which require a block size exceeding MAXBSIZE.
131+
*
132+
* BKVASIZE - Nominal buffer space per buffer, in bytes. BKVASIZE is the
133+
* minimum KVM memory reservation the kernel is willing to make.
134+
* Filesystems can of course request smaller chunks. Actual
135+
* backing memory uses a chunk size of a page (PAGE_SIZE).
136+
*
137+
* If you make BKVASIZE too small you risk seriously fragmenting
138+
* the buffer KVM map which may slow things down a bit. If you
139+
* make it too big the kernel will not be able to optimally use
140+
* the KVM memory reserved for the buffer cache and will wind
141+
* up with too-few buffers.
142+
*
143+
* The default is 16384, roughly 2x the block size used by a
144+
* normal UFS filesystem.
136145
*/
137-
#define MAXBSIZE 65536
138-
#define BKVASIZE 8192
139-
#define DFLTBSIZE 4096
140-
#define MAXFRAG 8
146+
#define MAXBSIZE 65536 /* must be power of 2 */
147+
#define BKVASIZE 16384 /* must be power of 2 */
148+
#define BKVAMASK (BKVASIZE-1)
141149

142150
/*
143151
* MAXPATHLEN defines the longest permissible path length after expanding
@@ -154,10 +162,12 @@
154162
#define MAXSYMLINKS 32
155163

156164
/* Bit map related macros. */
157-
#define setbit(a,i) ((a)[(i)/NBBY] |= 1<<((i)%NBBY))
158-
#define clrbit(a,i) ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY)))
159-
#define isset(a,i) ((a)[(i)/NBBY] & (1<<((i)%NBBY)))
160-
#define isclr(a,i) (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0)
165+
#define setbit(a,i) (((unsigned char *)(a))[(i)/NBBY] |= 1<<((i)%NBBY))
166+
#define clrbit(a,i) (((unsigned char *)(a))[(i)/NBBY] &= ~(1<<((i)%NBBY)))
167+
#define isset(a,i) \
168+
(((const unsigned char *)(a))[(i)/NBBY] & (1<<((i)%NBBY)))
169+
#define isclr(a,i) \
170+
((((const unsigned char *)(a))[(i)/NBBY] & (1<<((i)%NBBY))) == 0)
161171

162172
/* Macros for counting and rounding. */
163173
#ifndef howmany

0 commit comments

Comments
 (0)