From 02373194fe0be1ef82db419bedbf9d6ffd31dc93 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 23 May 2017 13:18:31 +0200 Subject: Update due to Newlib 2017-06-07 changes The following files are now provided by Newlib: * arpa/inet.h * net/if.h * netinet/in.h * netinet/tcp.h * sys/socket.h * sys/uio.h * sys/un.h The and are now compatible enough to be used directly. Update #2833. --- rtemsbsd/include/rtems/bsd/sys/cpuset.h | 150 -------------- rtemsbsd/include/rtems/bsd/sys/errno.h | 198 ------------------ rtemsbsd/include/rtems/bsd/sys/param.h | 357 -------------------------------- 3 files changed, 705 deletions(-) delete mode 100644 rtemsbsd/include/rtems/bsd/sys/cpuset.h delete mode 100644 rtemsbsd/include/rtems/bsd/sys/errno.h delete mode 100644 rtemsbsd/include/rtems/bsd/sys/param.h (limited to 'rtemsbsd/include/rtems/bsd/sys') diff --git a/rtemsbsd/include/rtems/bsd/sys/cpuset.h b/rtemsbsd/include/rtems/bsd/sys/cpuset.h deleted file mode 100644 index f5940682..00000000 --- a/rtemsbsd/include/rtems/bsd/sys/cpuset.h +++ /dev/null @@ -1,150 +0,0 @@ -/*- - * Copyright (c) 2008, Jeffrey Roberson - * All rights reserved. - * - * Copyright (c) 2008 Nokia Corporation - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice unmodified, this list of conditions, and the following - * disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#ifndef _RTEMS_BSD_SYS_CPUSET_H_ -#define _RTEMS_BSD_SYS_CPUSET_H_ - -#include -#include -#include - -#define CPUSETBUFSIZ ((2 + sizeof(long) * 2) * _NCPUWORDS) - -#define CPU_CLR(n, p) BIT_CLR(CPU_SETSIZE, n, p) -#define CPU_COPY(f, t) BIT_COPY(CPU_SETSIZE, f, t) -#define CPU_ISSET(n, p) BIT_ISSET(CPU_SETSIZE, n, p) -#define CPU_SET(n, p) BIT_SET(CPU_SETSIZE, n, p) -#define CPU_ZERO(p) BIT_ZERO(CPU_SETSIZE, p) -#define CPU_FILL(p) BIT_FILL(CPU_SETSIZE, p) -#define CPU_SETOF(n, p) BIT_SETOF(CPU_SETSIZE, n, p) -#define CPU_EMPTY(p) BIT_EMPTY(CPU_SETSIZE, p) -#define CPU_ISFULLSET(p) BIT_ISFULLSET(CPU_SETSIZE, p) -#define CPU_SUBSET(p, c) BIT_SUBSET(CPU_SETSIZE, p, c) -#define CPU_OVERLAP(p, c) BIT_OVERLAP(CPU_SETSIZE, p, c) -#define CPU_CMP(p, c) BIT_CMP(CPU_SETSIZE, p, c) -#define CPU_OR(d, s) BIT_OR(CPU_SETSIZE, d, s) -#define CPU_AND(d, s) BIT_AND(CPU_SETSIZE, d, s) -#define CPU_NAND(d, s) BIT_NAND(CPU_SETSIZE, d, s) -#define CPU_CLR_ATOMIC(n, p) BIT_CLR_ATOMIC(CPU_SETSIZE, n, p) -#define CPU_SET_ATOMIC(n, p) BIT_SET_ATOMIC(CPU_SETSIZE, n, p) -#define CPU_SET_ATOMIC_ACQ(n, p) BIT_SET_ATOMIC_ACQ(CPU_SETSIZE, n, p) -#define CPU_AND_ATOMIC(n, p) BIT_AND_ATOMIC(CPU_SETSIZE, n, p) -#define CPU_OR_ATOMIC(d, s) BIT_OR_ATOMIC(CPU_SETSIZE, d, s) -#define CPU_COPY_STORE_REL(f, t) BIT_COPY_STORE_REL(CPU_SETSIZE, f, t) -#define CPU_FFS(p) BIT_FFS(CPU_SETSIZE, p) -#define CPU_COUNT(p) BIT_COUNT(CPU_SETSIZE, p) -#define CPUSET_FSET BITSET_FSET(_NCPUWORDS) -#define CPUSET_T_INITIALIZER BITSET_T_INITIALIZER - -/* - * Valid cpulevel_t values. - */ -#define CPU_LEVEL_ROOT 1 /* All system cpus. */ -#define CPU_LEVEL_CPUSET 2 /* Available cpus for which. */ -#define CPU_LEVEL_WHICH 3 /* Actual mask/id for which. */ - -/* - * Valid cpuwhich_t values. - */ -#define CPU_WHICH_TID 1 /* Specifies a thread id. */ -#define CPU_WHICH_PID 2 /* Specifies a process id. */ -#define CPU_WHICH_CPUSET 3 /* Specifies a set id. */ -#define CPU_WHICH_IRQ 4 /* Specifies an irq #. */ -#define CPU_WHICH_JAIL 5 /* Specifies a jail id. */ -#define CPU_WHICH_DOMAIN 6 /* Specifies a NUMA domain id. */ - -/* - * Reserved cpuset identifiers. - */ -#define CPUSET_INVALID -1 -#define CPUSET_DEFAULT 0 - -#ifdef _KERNEL -#include - -LIST_HEAD(setlist, cpuset); - -/* - * cpusets encapsulate cpu binding information for one or more threads. - * - * a - Accessed with atomics. - * s - Set at creation, never modified. Only a ref required to read. - * c - Locked internally by a cpuset lock. - * - * The bitmask is only modified while holding the cpuset lock. It may be - * read while only a reference is held but the consumer must be prepared - * to deal with inconsistent results. - */ -struct cpuset { - cpuset_t cs_mask; /* bitmask of valid cpus. */ - volatile u_int cs_ref; /* (a) Reference count. */ - int cs_flags; /* (s) Flags from below. */ - cpusetid_t cs_id; /* (s) Id or INVALID. */ - struct cpuset *cs_parent; /* (s) Pointer to our parent. */ - LIST_ENTRY(cpuset) cs_link; /* (c) All identified sets. */ - LIST_ENTRY(cpuset) cs_siblings; /* (c) Sibling set link. */ - struct setlist cs_children; /* (c) List of children. */ -}; - -#define CPU_SET_ROOT 0x0001 /* Set is a root set. */ -#define CPU_SET_RDONLY 0x0002 /* No modification allowed. */ - -extern cpuset_t *cpuset_root; -struct prison; -struct proc; -struct thread; - -struct cpuset *cpuset_thread0(void); -struct cpuset *cpuset_ref(struct cpuset *); -void cpuset_rel(struct cpuset *); -int cpuset_setthread(lwpid_t id, cpuset_t *); -int cpuset_setithread(lwpid_t id, int cpu); -int cpuset_create_root(struct prison *, struct cpuset **); -int cpuset_setproc_update_set(struct proc *, struct cpuset *); -int cpuset_which(cpuwhich_t, id_t, struct proc **, - struct thread **, struct cpuset **); - -char *cpusetobj_strprint(char *, const cpuset_t *); -int cpusetobj_strscan(cpuset_t *, const char *); -#ifdef DDB -void ddb_display_cpuset(const cpuset_t *); -#endif - -#else -__BEGIN_DECLS -int cpuset(cpusetid_t *); -int cpuset_setid(cpuwhich_t, id_t, cpusetid_t); -int cpuset_getid(cpulevel_t, cpuwhich_t, id_t, cpusetid_t *); -int cpuset_getaffinity(cpulevel_t, cpuwhich_t, id_t, size_t, cpuset_t *); -int cpuset_setaffinity(cpulevel_t, cpuwhich_t, id_t, size_t, const cpuset_t *); -__END_DECLS -#endif -#endif /* !_RTEMS_BSD_SYS_CPUSET_H_ */ diff --git a/rtemsbsd/include/rtems/bsd/sys/errno.h b/rtemsbsd/include/rtems/bsd/sys/errno.h deleted file mode 100644 index 7fad3cf0..00000000 --- a/rtemsbsd/include/rtems/bsd/sys/errno.h +++ /dev/null @@ -1,198 +0,0 @@ -/*- - * Copyright (c) 1982, 1986, 1989, 1993 - * The Regents of the University of California. All rights reserved. - * (c) UNIX System Laboratories, Inc. - * All or some portions of this file are derived from material licensed - * to the University of California by American Telephone and Telegraph - * Co. or Unix System Laboratories, Inc. and are reproduced herein with - * the permission of UNIX System Laboratories, Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)errno.h 8.5 (Berkeley) 1/21/94 - * $FreeBSD$ - */ - -#ifndef _RTEMS_BSD_SYS_ERRNO_H_ -#define _RTEMS_BSD_SYS_ERRNO_H_ - -#ifndef _KERNEL -#include -#ifndef __rtems__ -__BEGIN_DECLS -int * __error(void); -__END_DECLS -#define errno (* __error()) -#endif /* __rtems__ */ -#endif - -#ifndef __rtems__ -#define EPERM 1 /* Operation not permitted */ -#define ENOENT 2 /* No such file or directory */ -#define ESRCH 3 /* No such process */ -#define EINTR 4 /* Interrupted system call */ -#define EIO 5 /* Input/output error */ -#define ENXIO 6 /* Device not configured */ -#define E2BIG 7 /* Argument list too long */ -#define ENOEXEC 8 /* Exec format error */ -#define EBADF 9 /* Bad file descriptor */ -#define ECHILD 10 /* No child processes */ -#define EDEADLK 11 /* Resource deadlock avoided */ - /* 11 was EAGAIN */ -#define ENOMEM 12 /* Cannot allocate memory */ -#define EACCES 13 /* Permission denied */ -#define EFAULT 14 /* Bad address */ -#ifndef _POSIX_SOURCE -#define ENOTBLK 15 /* Block device required */ -#endif -#define EBUSY 16 /* Device busy */ -#define EEXIST 17 /* File exists */ -#define EXDEV 18 /* Cross-device link */ -#define ENODEV 19 /* Operation not supported by device */ -#define ENOTDIR 20 /* Not a directory */ -#define EISDIR 21 /* Is a directory */ -#define EINVAL 22 /* Invalid argument */ -#define ENFILE 23 /* Too many open files in system */ -#define EMFILE 24 /* Too many open files */ -#define ENOTTY 25 /* Inappropriate ioctl for device */ -#ifndef _POSIX_SOURCE -#define ETXTBSY 26 /* Text file busy */ -#endif -#define EFBIG 27 /* File too large */ -#define ENOSPC 28 /* No space left on device */ -#define ESPIPE 29 /* Illegal seek */ -#define EROFS 30 /* Read-only filesystem */ -#define EMLINK 31 /* Too many links */ -#define EPIPE 32 /* Broken pipe */ - -/* math software */ -#define EDOM 33 /* Numerical argument out of domain */ -#define ERANGE 34 /* Result too large */ - -/* non-blocking and interrupt i/o */ -#define EAGAIN 35 /* Resource temporarily unavailable */ -#ifndef _POSIX_SOURCE -#define EWOULDBLOCK EAGAIN /* Operation would block */ -#define EINPROGRESS 36 /* Operation now in progress */ -#define EALREADY 37 /* Operation already in progress */ - -/* ipc/network software -- argument errors */ -#define ENOTSOCK 38 /* Socket operation on non-socket */ -#define EDESTADDRREQ 39 /* Destination address required */ -#define EMSGSIZE 40 /* Message too long */ -#define EPROTOTYPE 41 /* Protocol wrong type for socket */ -#define ENOPROTOOPT 42 /* Protocol not available */ -#define EPROTONOSUPPORT 43 /* Protocol not supported */ -#define ESOCKTNOSUPPORT 44 /* Socket type not supported */ -#define EOPNOTSUPP 45 /* Operation not supported */ -#define ENOTSUP EOPNOTSUPP /* Operation not supported */ -#define EPFNOSUPPORT 46 /* Protocol family not supported */ -#define EAFNOSUPPORT 47 /* Address family not supported by protocol family */ -#define EADDRINUSE 48 /* Address already in use */ -#define EADDRNOTAVAIL 49 /* Can't assign requested address */ - -/* ipc/network software -- operational errors */ -#define ENETDOWN 50 /* Network is down */ -#define ENETUNREACH 51 /* Network is unreachable */ -#define ENETRESET 52 /* Network dropped connection on reset */ -#define ECONNABORTED 53 /* Software caused connection abort */ -#define ECONNRESET 54 /* Connection reset by peer */ -#define ENOBUFS 55 /* No buffer space available */ -#define EISCONN 56 /* Socket is already connected */ -#define ENOTCONN 57 /* Socket is not connected */ -#define ESHUTDOWN 58 /* Can't send after socket shutdown */ -#define ETOOMANYREFS 59 /* Too many references: can't splice */ -#define ETIMEDOUT 60 /* Operation timed out */ -#define ECONNREFUSED 61 /* Connection refused */ - -#define ELOOP 62 /* Too many levels of symbolic links */ -#endif /* _POSIX_SOURCE */ -#define ENAMETOOLONG 63 /* File name too long */ - -/* should be rearranged */ -#ifndef _POSIX_SOURCE -#define EHOSTDOWN 64 /* Host is down */ -#define EHOSTUNREACH 65 /* No route to host */ -#endif /* _POSIX_SOURCE */ -#define ENOTEMPTY 66 /* Directory not empty */ - -/* quotas & mush */ -#ifndef _POSIX_SOURCE -#define EPROCLIM 67 /* Too many processes */ -#define EUSERS 68 /* Too many users */ -#define EDQUOT 69 /* Disc quota exceeded */ - -/* Network File System */ -#define ESTALE 70 /* Stale NFS file handle */ -#define EREMOTE 71 /* Too many levels of remote in path */ -#define EBADRPC 72 /* RPC struct is bad */ -#define ERPCMISMATCH 73 /* RPC version wrong */ -#define EPROGUNAVAIL 74 /* RPC prog. not avail */ -#define EPROGMISMATCH 75 /* Program version wrong */ -#define EPROCUNAVAIL 76 /* Bad procedure for program */ -#endif /* _POSIX_SOURCE */ - -#define ENOLCK 77 /* No locks available */ -#define ENOSYS 78 /* Function not implemented */ - -#ifndef _POSIX_SOURCE -#define EFTYPE 79 /* Inappropriate file type or format */ -#define EAUTH 80 /* Authentication error */ -#define ENEEDAUTH 81 /* Need authenticator */ -#define EIDRM 82 /* Identifier removed */ -#define ENOMSG 83 /* No message of desired type */ -#define EOVERFLOW 84 /* Value too large to be stored in data type */ -#define ECANCELED 85 /* Operation canceled */ -#define EILSEQ 86 /* Illegal byte sequence */ -#define ENOATTR 87 /* Attribute not found */ - -#define EDOOFUS 88 /* Programming error */ -#endif /* _POSIX_SOURCE */ - -#define EBADMSG 89 /* Bad message */ -#define EMULTIHOP 90 /* Multihop attempted */ -#define ENOLINK 91 /* Link has been severed */ -#define EPROTO 92 /* Protocol error */ - -#ifndef _POSIX_SOURCE -#define ENOTCAPABLE 93 /* Capabilities insufficient */ -#endif /* _POSIX_SOURCE */ - -#ifndef _POSIX_SOURCE -#define ELAST 93 /* Must be equal largest errno */ -#endif /* _POSIX_SOURCE */ -#else /* __rtems__ */ -#include -#endif /* __rtems__ */ - -#ifdef _KERNEL -/* pseudo-errors returned inside kernel to modify return to process */ -#define ERESTART (-1) /* restart syscall */ -#define EJUSTRETURN (-2) /* don't modify regs, just return */ -#define ENOIOCTL (-3) /* ioctl not handled by this layer */ -#define EDIRIOCTL (-4) /* do direct ioctl in GEOM */ -#endif - -#endif diff --git a/rtemsbsd/include/rtems/bsd/sys/param.h b/rtemsbsd/include/rtems/bsd/sys/param.h deleted file mode 100644 index 8042746c..00000000 --- a/rtemsbsd/include/rtems/bsd/sys/param.h +++ /dev/null @@ -1,357 +0,0 @@ -/*- - * Copyright (c) 1982, 1986, 1989, 1993 - * The Regents of the University of California. All rights reserved. - * (c) UNIX System Laboratories, Inc. - * All or some portions of this file are derived from material licensed - * to the University of California by American Telephone and Telegraph - * Co. or Unix System Laboratories, Inc. and are reproduced herein with - * the permission of UNIX System Laboratories, Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)param.h 8.3 (Berkeley) 4/4/95 - * $FreeBSD$ - */ - -#ifndef _RTEMS_BSD_SYS_PARAM_H_ -#define _RTEMS_BSD_SYS_PARAM_H_ - -#ifdef __rtems__ -#include -#include -#endif /* __rtems__ */ -#include - -#define BSD 199506 /* System version (year & month). */ -#define BSD4_3 1 -#define BSD4_4 1 - -/* - * __FreeBSD_version numbers are documented in the Porter's Handbook. - * If you bump the version for any reason, you should update the documentation - * there. - * Currently this lives here: - * - * doc/en_US.ISO8859-1/books/porters-handbook/book.sgml - * - * scheme is: Rxx - * 'R' is in the range 0 to 4 if this is a release branch or - * x.0-CURRENT before RELENG_*_0 is created, otherwise 'R' is - * in the range 5 to 9. - */ -#undef __FreeBSD_version -#define __FreeBSD_version 1200018 /* Master, propagated to newvers */ - -#ifdef _KERNEL -#define P_OSREL_SIGWAIT 700000 -#define P_OSREL_SIGSEGV 700004 -#define P_OSREL_MAP_ANON 800104 -#define P_OSREL_MAP_FSTRICT 1100036 -#define P_OSREL_SHUTDOWN_ENOTCONN 1100077 - -#define P_OSREL_MAJOR(x) ((x) / 100000) -#endif - -#ifndef LOCORE -#include -#endif - -/* - * Machine-independent constants (some used in following include files). - * Redefined constants are from POSIX 1003.1 limits file. - * - * MAXCOMLEN should be >= sizeof(ac_comm) (see ) - * MAXLOGNAME should be == UT_NAMESIZE+1 (see ) - */ -#include - -#define MAXCOMLEN 19 /* max command name remembered */ -#define MAXINTERP PATH_MAX /* max interpreter file name length */ -#define MAXLOGNAME 33 /* max login name length (incl. NUL) */ -#define MAXUPRC CHILD_MAX /* max simultaneous processes */ -#define NCARGS ARG_MAX /* max bytes for an exec function */ -#define NGROUPS (NGROUPS_MAX+1) /* max number groups */ -#define NOFILE OPEN_MAX /* max open files per process */ -#define NOGROUP 65535 /* marker for empty group set member */ -#define MAXHOSTNAMELEN 256 /* max hostname size */ -#define SPECNAMELEN 63 /* max length of devicename */ - -/* More types and definitions used throughout the kernel. */ -#ifdef _KERNEL -#include -#include -#ifndef LOCORE -#include -#include -#endif - -#ifndef FALSE -#define FALSE 0 -#endif -#ifndef TRUE -#define TRUE 1 -#endif -#endif - -#ifndef _KERNEL -/* Signals. */ -#include -#endif - -/* Machine type dependent parameters. */ -#include -#ifndef _KERNEL -#include -#endif - -#ifndef _NO_NAMESPACE_POLLUTION - -#ifndef DEV_BSHIFT -#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */ -#endif -#define DEV_BSIZE (1<>PAGE_SHIFT) -#endif - -/* - * btodb() is messy and perhaps slow because `bytes' may be an off_t. We - * want to shift an unsigned type to avoid sign extension and we don't - * want to widen `bytes' unnecessarily. Assume that the result fits in - * a daddr_t. - */ -#ifndef btodb -#define btodb(bytes) /* calculates (bytes / DEV_BSIZE) */ \ - (sizeof (bytes) > sizeof(long) \ - ? (daddr_t)((unsigned long long)(bytes) >> DEV_BSHIFT) \ - : (daddr_t)((unsigned long)(bytes) >> DEV_BSHIFT)) -#endif - -#ifndef dbtob -#define dbtob(db) /* calculates (db * DEV_BSIZE) */ \ - ((off_t)(db) << DEV_BSHIFT) -#endif - -#endif /* _NO_NAMESPACE_POLLUTION */ - -#define PRIMASK 0x0ff -#define PCATCH 0x100 /* OR'd with pri for tsleep to check signals */ -#define PDROP 0x200 /* OR'd with pri to stop re-entry of interlock mutex */ -#define PBDRY 0x400 /* for PCATCH stop is done on the user boundary */ - -#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 */ - -/* - * File system parameters and macros. - * - * MAXBSIZE - Filesystems are made out of blocks of at most MAXBSIZE bytes - * per block. MAXBSIZE may be made larger without effecting - * any existing filesystems as long as it does not exceed MAXPHYS, - * and may be made smaller at the risk of not being able to use - * filesystems which require a block size exceeding MAXBSIZE. - * - * BKVASIZE - Nominal buffer space per buffer, in bytes. BKVASIZE is the - * minimum KVM memory reservation the kernel is willing to make. - * Filesystems can of course request smaller chunks. Actual - * backing memory uses a chunk size of a page (PAGE_SIZE). - * - * If you make BKVASIZE too small you risk seriously fragmenting - * the buffer KVM map which may slow things down a bit. If you - * make it too big the kernel will not be able to optimally use - * the KVM memory reserved for the buffer cache and will wind - * up with too-few buffers. - * - * The default is 16384, roughly 2x the block size used by a - * normal UFS filesystem. - */ -#define MAXBSIZE 65536 /* must be power of 2 */ -#define BKVASIZE 16384 /* must be power of 2 */ -#define BKVAMASK (BKVASIZE-1) - -/* - * MAXPATHLEN defines the longest permissible path length after expanding - * symbolic links. It is used to allocate a temporary buffer from the buffer - * pool in which to do the name expansion, hence should be a power of two, - * and must be less than or equal to MAXBSIZE. MAXSYMLINKS defines the - * maximum number of symbolic links that may be expanded in a path name. - * It should be set high enough to allow all legitimate uses, but halt - * infinite loops reasonably quickly. - */ -#define MAXPATHLEN PATH_MAX -#define MAXSYMLINKS 32 - -/* Bit map related macros. */ -#define setbit(a,i) (((unsigned char *)(a))[(i)/NBBY] |= 1<<((i)%NBBY)) -#define clrbit(a,i) (((unsigned char *)(a))[(i)/NBBY] &= ~(1<<((i)%NBBY))) -#define isset(a,i) \ - (((const unsigned char *)(a))[(i)/NBBY] & (1<<((i)%NBBY))) -#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 -#define nitems(x) (sizeof((x)) / sizeof((x)[0])) -#define rounddown(x, y) (((x)/(y))*(y)) -#define rounddown2(x, y) ((x)&(~((y)-1))) /* if y is power of two */ -#define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) /* to any y */ -#define roundup2(x, y) (((x)+((y)-1))&(~((y)-1))) /* if y is powers of two */ -#define powerof2(x) ((((x)-1)&(x))==0) - -/* Macros for min/max. */ -#define MIN(a,b) (((a)<(b))?(a):(b)) -#define MAX(a,b) (((a)>(b))?(a):(b)) - -#ifdef _KERNEL -/* - * Basic byte order function prototypes for non-inline functions. - */ -#ifndef LOCORE -#ifndef _BYTEORDER_PROTOTYPED -#define _BYTEORDER_PROTOTYPED -__BEGIN_DECLS -__uint32_t htonl(__uint32_t); -__uint16_t htons(__uint16_t); -__uint32_t ntohl(__uint32_t); -__uint16_t ntohs(__uint16_t); -__END_DECLS -#endif -#endif - -#ifndef lint -#ifndef _BYTEORDER_FUNC_DEFINED -#define _BYTEORDER_FUNC_DEFINED -#define htonl(x) __htonl(x) -#define htons(x) __htons(x) -#define ntohl(x) __ntohl(x) -#define ntohs(x) __ntohs(x) -#endif /* !_BYTEORDER_FUNC_DEFINED */ -#endif /* lint */ -#endif /* _KERNEL */ - -/* - * Scale factor for scaled integers used to count %cpu time and load avgs. - * - * The number of CPU `tick's that map to a unique `%age' can be expressed - * by the formula (1 / (2 ^ (FSHIFT - 11))). The maximum load average that - * can be calculated (assuming 32 bits) can be closely approximated using - * the formula (2 ^ (2 * (16 - FSHIFT))) for (FSHIFT < 15). - * - * For the scheduler to maintain a 1:1 mapping of CPU `tick' to `%age', - * FSHIFT must be at least 11; this gives us a maximum load avg of ~1024. - */ -#define FSHIFT 11 /* bits to right of fixed binary point */ -#define FSCALE (1<> (PAGE_SHIFT - DEV_BSHIFT)) - -#define ctodb(db) /* calculates pages to devblks */ \ - ((db) << (PAGE_SHIFT - DEV_BSHIFT)) - -/* - * Given the pointer x to the member m of the struct s, return - * a pointer to the containing structure. - */ -#define member2struct(s, m, x) \ - ((struct s *)(void *)((char *)(x) - offsetof(struct s, m))) - -/* - * Access a variable length array that has been declared as a fixed - * length array. - */ -#define __PAST_END(array, offset) (((__typeof__(*(array)) *)(array))[offset]) - -#endif /* _RTEMS_BSD_SYS_PARAM_H_ */ -- cgit v1.2.3