.ORDER: quickkernel installkernel
.ORDER: quickkernel reinstallkernel
-PATH= /sbin:/bin:/usr/sbin:/usr/bin
+PATH= /sbin:/bin:/usr/sbin:/usr/bin:/usr/pkg/bin
MAKE= PATH=${PATH} make -m ${.CURDIR}/share/mk -f Makefile.inc1
#
# The strict temporary command path contains all binaries required
# by the buildworld system after the cross-tools stage.
#
-STRICTTMPPATH= ${CTOOLSDEST}/usr/sbin:${CTOOLSDEST}/usr/bin:${CTOOLSDEST}/bin:${CTOOLSDEST}/usr/games:${BTOOLSDEST}/usr/sbin:${BTOOLSDEST}/usr/bin:${BTOOLSDEST}/bin:${BTOOLSDEST}/usr/games
+STRICTTMPPATH= ${CTOOLSDEST}/usr/sbin:${CTOOLSDEST}/usr/bin:${CTOOLSDEST}/bin:${CTOOLSDEST}/usr/games:${BTOOLSDEST}/usr/sbin:${BTOOLSDEST}/usr/bin:${BTOOLSDEST}/bin:${BTOOLSDEST}/usr/games:/usr/pkg/bin
TMPDIR?= /tmp
TMPPID!= echo $$$$
hltdelete(hln);
hln = NULL;
if (tryrelink) {
- logerr("%-20s hardlink: will attempt to copy normally\n");
+ logerr("%-20s hardlink: will attempt to copy normally\n",
+ (dpath ? dpath : spath));
goto relink;
}
++r;
#include "compat_sun.h"
#endif
-void logstd(const char *ctl, ...);
-void logerr(const char *ctl, ...);
-char *mprintf(const char *ctl, ...);
-void fatal(const char *ctl, ...);
+void logstd(const char *ctl, ...) __printflike(1, 2);
+void logerr(const char *ctl, ...) __printflike(1, 2);
+char *mprintf(const char *ctl, ...) __printflike(1, 2);
+void fatal(const char *ctl, ...) __printf0like(1, 2);
char *fextract(FILE *fi, int n, int *pc, int skip);
int16_t hc_bswap16(int16_t var);
static int getmygroups(gid_t **gidlist);
+static int silentwarning(int *, const char *, ...) __printflike(2, 3);
+
struct HCDesc HCDispatchTable[] = {
{ HC_HELLO, rc_hello },
{ HC_STAT, rc_stat },
#define main testcmd
#include "bltin/bltin.h"
#else
-static void error(const char *, ...) __attribute__((__noreturn__));
+static void error(const char *, ...) __dead2 __printflike(1, 2);
static void
error(const char *msg, ...)
#!/bin/sh
# PROVIDE: cryptdisks
-# REQUIRE:
# BEFORE: mountcritlocal localswap dumpon
$_rc_subr_loaded . /etc/rc.subr
fi
if [ -x /sbin/dmsetup ]; then
- /sbin/dmsetup version >/dev/null
+ /sbin/dmsetup version >/dev/null 2>&1
if [ $? -ne 0 ]; then
- warn "Device-mapper not present in kernel"
+ warn "/etc/crypttab found but dm is not loaded or present in kernel"
return 1;
fi
fi
- if [ ! -x /sbin/cryptdisks ]; then
- warn "cryptdisks is not executable"
- return 1;
- fi
-
echo "Configuring crypto disks."
/sbin/cryptdisks -1
}
cryptdisks_stop()
{
- if [ ! -f $CRYPTTAB ]; then
- return 0;
- fi
+ if [ ! -f $CRYPTTAB ]; then
+ return 0;
+ fi
- if [ -x /sbin/dmsetup ]; then
- /sbin/dmsetup version >/dev/null
- if [ $? -ne 0 ]; then
- warn "Device-mapper not present in kernel"
- return 1;
- fi
- fi
+ if [ -x /sbin/dmsetup ]; then
+ /sbin/dmsetup version >/dev/null 2>&1
+ if [ $? -ne 0 ]; then
+ warn "/etc/crypttab found but dm is not loaded or present in kernel"
+ return 1;
+ fi
+ fi
- if [ ! -x /sbin/cryptdisks ]; then
- warn "cryptdisks is not executable"
- return 1;
- fi
-
- echo "Unconfiguring crypto disks."
- /sbin/cryptdisks -0
+ echo "Unconfiguring crypto disks."
+ /sbin/cryptdisks -0
}
#define PR addstr
+static void prompt(int, const char *, ...) __printflike(2, 3);
static bool checkplace (int, ship_t *, int);
static int getcoord (int);
int playagain (void);
extern char explstr[]; /* string for explanation */
-void addmsg(const char *, ...);
+void addmsg(const char *, ...) __printflike(1, 2);
int adjust(CARD []);
bool anymove(CARD [], int, int);
void bye(void);
bool isone(CARD, CARD [], int);
void makedeck(CARD []);
void makeknown(CARD [], int);
-void msg(const char *, ...);
+void msg(const char *, ...) __printflike(1, 2);
bool msgcard(CARD, bool);
int number(int, int, const char *);
int pegscore(CARD, CARD [], int, int);
void *ptr;
if ((ptr = malloc(lth)) == NULL)
- panic("Cannot get %d bytes", lth);
+ panic("Cannot get %zd bytes", lth);
return (ptr);
}
/* hack.main.c */
void glo(int);
void askname(void);
-void impossible(const char *, ...);
+void impossible(const char *, ...) __printflike(1, 2);
void stop_occupation(void);
/* hack.makemon.c */
/* hack.pri.c */
void swallowed(void);
-void panic(const char *, ...);
+void panic(const char *, ...) __printflike(1, 2);
void atl(int, int, char);
void on_scr(int, int);
void tmp_at(schar, schar);
void more(void);
void cmore(const char *);
void clrlin(void);
-void pline(const char *, ...);
-void vpline(const char *, va_list);
+void pline(const char *, ...) __printflike(1, 2);
+void vpline(const char *, va_list) __printflike(1, 0);
void putsym(char);
void putstr(const char *);
void gettty(void);
void settty(const char *);
void setftty(void);
-void error(const char *, ...);
+void error(const char *, ...) __printflike(1, 2);
void getlin(char *);
void getret(void);
void cgetret(const char *);
printf("I don't know what is wrong.");
}
getret();
- error("");
+ error("%s", "");
/* NOTREACHED */
}
void
error(const char *whichfile)
{
- int (*funcp)(const char *, ...);
+ int (*funcp)(const char *, ...) __printflike(1, 2);
if (Windows) {
funcp = (void *)printw;
char *appdstr (char *, char *, size_t);
void downcase (char *);
-void err (const char *, ...);
+void err (const char *, ...) __printflike(1, 2);
void get_cats (char *, char *);
void get_file (const char *);
char *next_cat (char *);
av++;
}
if (ac > 2)
- syserr(0, "arg count");
+ syserr("arg count");
#if 0
if (ac > 1)
f_log = fopen(av[0], opencode);
void torped(int);
char *bmove(const void *, void *, size_t);
bool sequal(const char *, const char *);
-void syserr(const char *, ...);
+void syserr(const char *, ...) __printflike(1, 2);
void visual(int);
void warp(int, int, double);
void dowarp(int);
LIB= objc
SHLIB_MAJOR= 2
+CSTD?= gnu89
OBJC_THREAD_FILE=thr-objc
SRCS= \
LIB= devmapper
SHLIB_MAJOR?= 0
+CSTD?= gnu89
+
CFLAGS+= -D_XOPEN_SOURCE=600
CFLAGS+= -I${LIBDM_DISTDIR} -I${LIBDM_DISTDIR}/misc -I${LIBDM_DISTDIR}/mm \
-I${LIBDM_DISTDIR}/datastruct -I${LIBDM_DISTDIR}/ioctl \
filter_dragonfly.c snapshot.c mirrored.c dev_manager.c fs.c \
lvm-globals.c dev.c
+CSTD?= gnu89
WARNS?= 1
.PATH: ${LVM2_DISTDIR}/lib/
PROG= cryptsetup
+CSTD?= gnu89
+
# Add a backend...
SRCS+= backends.c libdevmapper.c setup.c utils.c \
utils_debug.c
MAN= dmsetup.8
+CSTD?= gnu89
+
CFLAGS+= -D_XOPEN_SOURCE=600
CFLAGS+= -I${LIBDM_DISTDIR}/ -I${LIBDM_DISTDIR}/misc \
-I. -I${LIBDM_DISTDIR}/ioctl -I${LVM2_DISTDIR}/include
PROG= lvm
+CSTD?= gnu89
+
SRCS= dumpconfig.c formats.c lvchange.c lvconvert.c lvcreate.c \
lvdisplay.c lvextend.c lvmchange.c lvmcmdline.c \
lvmdiskscan.c lvreduce.c lvremove.c lvrename.c lvresize.c \
+CSTD?= gnu89
+
BASEDIR= ${.CURDIR}/${RELATIVE}../../../../contrib/gdb-7
GDBLIBS+= ${.OBJDIR}/../libopcodes/libopcodes.a
BINDIR?= /usr/bin
SHELL= /bin/sh
+WARNS?= 1
+
# Define `page' to be letter if your PostScript printer uses 8.5x11
# paper (USA) and define it to be A4, if it uses A4 paper (rest of the
# world).
.if RCS_EMIT_COMMITID
CFLAGS+= -DRCS_EMIT_COMMITID
.endif
+
+WARNS?= 2
num=delta->num;
for (trail = &Locks; (next = *trail); trail = &next->nextlock)
- if (next->delta == delta)
+ if (next->delta == delta) {
if (strcmp(getcaller(), next->login) == 0) {
/* We found a lock on delta by caller; delete it. */
*trail = next->nextlock;
rcserror("revision %s locked by %s", num, next->login);
return -1;
}
+ }
if (!StrictLocks && myself(RCSstat.st_uid))
return 0;
rcserror("no lock set by %s for revision %s", getcaller(), num);
break;
}
- if (0 <= quiet)
+ if (0 <= quiet) {
if (!a)
VOID scanfile(stdin, (char*)0, quiet);
else
)
break;
} while ((a = *++argv));
+ }
if (ferror(stdout) || fclose(stdout)!=0) {
reportError("standard output");
#define has_setreuid 0 /* Does setreuid() work? See ../INSTALL.RCS. */
#define has_setuid 1 /* Does setuid() exist? */
#define has_sigaction 1 /* Does struct sigaction work? */
-#define has_sa_sigaction 0 /* Does struct sigaction have sa_sigaction? */
+#define has_sa_sigaction 1 /* Does struct sigaction have sa_sigaction? */
#define has_signal 1 /* Does signal() work? */
#define signal_type void /* type returned by signal handlers */
#define sig_zaps_handler 0 /* Must a signal handler reinvoke signal()? */
* editline is incremented by the number of lines copied.
* Assumption: next character read is first string character.
*/
-{ register c;
+{ register int c;
declarecache;
register FILE *frew, *fcop;
register int amidline;
* 2 if a complete line is copied; adds 1 to yield if expansion occurred.
*/
{
- register c;
+ register int c;
declarecache;
register FILE *out, *frew;
register char * tp;
RCSv==VERSION(3) && delta->lockedby ? "Locked"
: delta->state
);
- if (delta->lockedby)
+ if (delta->lockedby) {
if (VERSION(5) <= RCSv) {
if (locker_expansion || exp==KEYVALLOCK_EXPAND)
aprintf(out, " %s", delta->lockedby);
} else if (RCSv == VERSION(4))
aprintf(out, " Locker: %s", delta->lockedby);
+ }
break;
case Locker:
if (delta->lockedby)
cp = leader.string;
for (cw = 0; cw < cs; cw++) {
leader.string[cw] = c;
- if (c == SDELIM && delimstuffed)
+ if (c == SDELIM && delimstuffed) {
cacheget_(c)
+ }
cacheget_(c)
}
register struct rcslock *next;
for (next = Locks; next; next = next->nextlock)
- if (cmpnum(delta->num, next->delta->num) == 0)
+ if (cmpnum(delta->num, next->delta->num) == 0) {
if (strcmp(getcaller(), next->login) == 0)
return 0;
else {
);
return -1;
}
+ }
next = ftalloc(struct rcslock);
delta->lockedby = next->login = getcaller();
next->delta = delta;
register struct assoc *next;
for (next = Symbols; next; next = next->nextassoc)
- if (strcmp(name, next->symbol) == 0)
+ if (strcmp(name, next->symbol) == 0) {
if (strcmp(next->num,num) == 0)
return 0;
else if (rebind) {
);
return -1;
}
+ }
next = ftalloc(struct assoc);
next->symbol = name;
next->num = num;
{
int r = 0, e;
- if (lockflag)
+ if (lockflag) {
if (changed) {
if (changed < 0)
return -1;
}
# endif
}
+ }
return r;
}
c = getcstdin(), !feof(stdin);
bufrealloc(buf, i+1), p = buf->string, p[i++] = c
)
- if (c == '\n')
+ if (c == '\n') {
if (i && p[i-1]=='.' && (i==1 || p[i-2]=='\n')) {
/* Remove trailing '.'. */
--i;
aputs(">> ", stderr);
eflush();
}
+ }
return cleanlogmsg(p, i);
}
default:
continue;
}
- if (!c)
+ if (!c) {
Igeteof_(fp, c, c=0;)
+ }
if (c != KDELIM) {
workerror("closing %c missing on keyword", KDELIM);
return false;
struct buf *b;
/* Get previous identifier from C+FP into B. */
{
- if (!c)
+ if (!c) {
Igeteof_(fp, c, return false;)
+ }
if (!get0val(c, fp, b, false))
return false;
checksid(b->string);
{
static char local_id[keylength+1];
char *copy, *next, *key;
- int j;
copy = strdup(string);
next = copy;
Keyword[LocalId] = local_id;
/* options? */
- while (key = strtok(NULL, ",")) {
+ while ((key = strtok(NULL, ","))) {
if (!strcmp(key, Keyword[Id]))
LocalIdMode=Id;
else if (!strcmp(key, Keyword[Header]))
* For ID's and NUM's, NextString is set to the character string.
* Assumption: nextc contains the next character.
*/
-{ register c;
+{ register int c;
declarecache;
register FILE *frew;
register char * sp;
/* skip over characters until terminating single SDELIM */
/* If foutptr is set, copy every character read to foutptr. */
/* Does not advance nextlex at the end. */
-{ register c;
+{ register int c;
declarecache;
register FILE *frew;
register RILE *fin;
* Does not advance nextlex at the end.
*/
{
- register c;
+ register int c;
declarecache;
register FILE *fout;
register RILE *fin;
* Yield a copy of *TARGET, except with exact length.
*/
{
- register c;
+ register int c;
declarecache;
register FILE *frew;
register char *tp;
for (bp = tp; *bp=='0' && isdigit(bp[1]); bp++)
continue;
- if (!*bp)
+ if (!*bp) {
if (s || *sp!='.')
break;
else {
bp = tp = target->string;
tlim = tp + target->size;
}
+ }
}
while ((*tp++ = *bp++))
# if has_sa_sigaction
act.sa_sigaction = catchsigaction;
# else
- act.sa_handler = catchsigaction;
+ act.sa_handler = catchsig;
# endif
act.sa_flags |= SA_SIGINFO;
}
{
- register c;
+ register int c;
register char *sp;
sp = opt;
{
char const *temp;
struct Status *pt;
- register c;
+ register int c;
while ((c = *++sp) ==' ' || c == '\t' || c == '\n')
continue;
for (lockpt = rmvlocklst; lockpt; lockpt = lockpt->nextrev)
if (expandsym(lockpt->revno, &numrev)) {
target = genrevs(numrev.string, (char *)0, (char *)0, (char *)0, &gendeltas);
- if ( target )
+ if ( target ) {
if (!(countnumflds(numrev.string)&1) && cmpnum(target->num,numrev.string))
rcserror("can't unlock nonexisting revision %s",
lockpt->revno
else
changed |= breaklock(target);
/* breaklock does its own diagnose */
+ }
}
/* add new locks which stored in newlocklst */
for (lockpt = newlocklst; lockpt; lockpt = lockpt->nextrev)
changed |= setlock(lockpt->revno);
- if (lockhead) /* lock default branch or head */
+ if (lockhead) { /* lock default branch or head */
if (Dbranch)
changed |= setlock(Dbranch);
else if (Head)
changed |= setlock(Head->num);
else
rcswarn("can't lock an empty tree");
+ }
return changed;
}
if (expandsym(rev, &numrev)) {
target = genrevs(numrev.string, (char*)0, (char*)0,
(char*)0, &gendeltas);
- if ( target )
+ if ( target ) {
if (!(countnumflds(numrev.string)&1) && cmpnum(target->num,numrev.string))
rcserror("can't lock nonexisting revision %s",
numrev.string
return r;
}
}
+ }
}
return 0;
}
if (expandsym(rev, &numrev)) {
target = genrevs(numrev.string, (char*)0, (char*)0,
(char*)0, &gendeltas);
- if ( target )
+ if ( target ) {
if (!(countnumflds(numrev.string)&1) && cmpnum(target->num,numrev.string))
rcserror("can't set state of nonexisting revision %s",
numrev.string
target->state = status;
return true;
}
+ }
}
return false;
}
struct hshentry * target;
char *a, *dcp, **newargv;
int no_diff_means_no_output;
- register c;
+ register int c;
exitstatus = DIFF_SUCCESS;
lexpandarg = "-kkvl";
Izclose(&workptr);
#if DIFF_L
- if (diff_label2)
+ if (diff_label2) {
if (revnums == 2)
*diff_label2 = setup_label(&labelbuf[1], target->num, target->date);
else {
time2date(workstat.st_mtime, date2);
*diff_label2 = setup_label(&labelbuf[1], (char*)0, date2);
}
+ }
#endif
diagnose("retrieving revision %s\n", xrev1);
node->author, node->state
);
- if ( editscript )
+ if ( editscript ) {
if(trunk)
aprintf(out, insDelFormat,
editscript->deletelns, editscript->insertlns);
else
aprintf(out, insDelFormat,
editscript->insertlns, editscript->deletelns);
+ }
if ( node->commitid )
aprintf(out, "%s commitid: %s", (editscript) ? ";" : "",
/* and store in authorlist */
{
- register c;
+ register int c;
struct authors * newauthor;
argv--;
PROG= sort
SRCS= sort.c error.c version.c long-options.c getopt.c getopt1.c xstrtod.c
+WARNS?= 2
CFLAGS+=-I${.CURDIR} -DHAVE_CONFIG_H
optarg = nameend + 1;
else
{
- if (opterr)
+ if (opterr) {
if (argv[optind - 1][1] == '-')
/* --option */
fprintf (stderr,
fprintf (stderr,
_("%s: option `%c%s' doesn't allow an argument\n"),
argv[0], argv[optind - 1][0], pfound->name);
-
+ }
nextchar += strlen (nextchar);
return '?';
}
static int
fraccompare (register const char *a, register const char *b)
{
- register tmpa = UCHAR (*a), tmpb = UCHAR (*b);
+ register int tmpa = UCHAR (*a), tmpb = UCHAR (*b);
#ifdef __DragonFly__
if (tmpa == decimal_point && tmpb == decimal_point)
}
/* Check if we need to read more lines into core. */
- if (++cur[ord[0]] == lines[ord[0]].used)
+ if (++cur[ord[0]] == lines[ord[0]].used) {
if (fillbuf (&buffer[ord[0]], fps[ord[0]]))
{
findlines (&buffer[ord[0]], &lines[ord[0]]);
ord[i] = ord[i + 1];
continue;
}
-
+ }
/* The new line just read in may be larger than other lines
already in core; push it back in the queue until we encounter
a line larger than it. */
int pthread_barrier_wait(pthread_barrier_t *);
int pthread_barrierattr_destroy(pthread_barrierattr_t *);
int pthread_barrierattr_init(pthread_barrierattr_t *);
-#if defined(_POSIX_THREAD_PROCESS_SHARED)
int pthread_barrierattr_getpshared(const pthread_barrierattr_t *,
int *);
int pthread_barrierattr_setpshared(pthread_barrierattr_t *, int);
-#endif
void pthread_cleanup_pop(int);
void pthread_cleanup_push(void (*) (void *), void *);
int pthread_condattr_destroy(pthread_condattr_t *);
int pthread_condattr_init(pthread_condattr_t *);
-#if defined(_POSIX_THREAD_PROCESS_SHARED)
-int pthread_condattr_getpshared(pthread_condattr_t *, int *);
+int pthread_condattr_getpshared(const pthread_condattr_t *, int *);
int pthread_condattr_setpshared(pthread_condattr_t *, int);
-#endif
int pthread_condattr_getclock(const pthread_condattr_t *, clockid_t *);
int pthread_condattr_setclock(pthread_condattr_t *, clockid_t);
int pthread_setprio(pthread_t, int);
void pthread_yield(void);
-#if defined(_POSIX_THREAD_PROCESS_SHARED)
-int pthread_mutexattr_getpshared(pthread_mutexattr_t *, int *);
+int pthread_mutexattr_getpshared(const pthread_mutexattr_t *, int *);
int pthread_mutexattr_setpshared(pthread_mutexattr_t *, int);
-#endif
int pthread_mutexattr_getprioceiling(pthread_mutexattr_t *, int *);
int pthread_mutexattr_setprioceiling(pthread_mutexattr_t *, int);
__weak_reference(_err, err);
+void _err(int, const char *, ...) __printflike(2, 3);
+
void
_err(int eval, const char *fmt, ...)
{
__weak_reference(_warn, warn);
+void _warn(const char *, ...) __printflike(1, 2);
+
void
_warn(const char *fmt, ...)
{
* 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.
- *
- * $DragonFly: src/lib/libc/gen/sigwait.c,v 1.1 2005/02/20 01:52:25 davidxu Exp $
*/
#include "namespace.h"
#include <errno.h>
#include "un-namespace.h"
+extern int __sys_sigwaitinfo(const sigset_t *, siginfo_t *);
+
__weak_reference(_sigwait, sigwait);
int
* 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.
- *
- * $DragonFly: src/lib/libc/gen/ucontext.c,v 1.1 2007/01/16 07:16:23 dillon Exp $
*/
+#include "namespace.h"
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/signal.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
+#include "un-namespace.h"
/* Prototypes */
__weak_reference(_swapcontext, swapcontext);
* SUCH DAMAGE.
*
* $FreeBSD: src/lib/libc/gen/wordexp.c,v 1.6 2004/06/30 13:55:08 tjr Exp $
- * $DragonFly: src/lib/libc/gen/wordexp.c,v 1.1 2008/10/06 21:01:37 swildner Exp $
*/
+#include "namespace.h"
#include <sys/types.h>
#include <sys/wait.h>
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
#include <wordexp.h>
+#include "un-namespace.h"
static int we_askshell(const char *, wordexp_t *, int);
static int we_check(const char *, int);
* SUCH DAMAGE.
*
* $FreeBSD: src/lib/libc/include/libc_private.h,v 1.3 1999/08/27 23:59:47 peter Exp $
- * $DragonFly: src/lib/libc/include/libc_private.h,v 1.8 2008/06/01 19:27:32 dillon Exp $
*
* Private definitions for libc, libc_r and libpthread.
*
struct statvfs;
/*
+ * yplib internal interfaces
+ */
+#ifdef YP
+int _yp_check(char **);
+#endif
+
+/*
* This is a pointer in the C run-time startup code. It is used
* by getprogname() and setprogname().
*/
* SUCH DAMAGE.
*
* $FreeBSD: /repoman/r/ncvs/src/lib/libc/include/namespace.h,v 1.1 2001/01/24 13:00:08 deischen Exp $
- * $DragonFly: src/lib/libc/include/namespace.h,v 1.3 2006/04/06 13:02:12 davidxu Exp $
- *
*/
#ifndef _NAMESPACE_H_
#define _NAMESPACE_H_
/*
+ * Adjust names so that headers declare "hidden" names.
+ *
+ * README: When modifying this file don't forget to make the appropriate
+ * changes in un-namespace.h!!!
+ */
+
+/*
* ISO C (C90) section. Most names in libc aren't in ISO C, so they
* should be here. Most aren't here...
*/
+#define err _err
+#define warn _warn
#define nsdispatch _nsdispatch
/*
#define sigsuspend _sigsuspend
#define socket _socket
#define socketpair _socketpair
+#define usleep _usleep
#define wait4 _wait4
+#define waitpid _waitpid
#define write _write
#define writev _writev
#define system _system
#define tcdrain _tcdrain
#define wait _wait
-#define waitpid _waitpid
#endif
#endif /* _NAMESPACE_H_ */
* SUCH DAMAGE.
*
* $FreeBSD: /repoman/r/ncvs/src/lib/libc/include/un-namespace.h,v 1.1 2001/01/24 13:00:09 deischen Exp $
- * $DragonFly: src/lib/libc/include/un-namespace.h,v 1.2 2006/04/06 13:02:12 davidxu Exp $
*/
#ifndef _UN_NAMESPACE_H_
#undef sigsuspend
#undef socket
#undef socketpair
+#undef usleep
#undef wait4
+#undef waitpid
#undef write
#undef writev
#undef system
#undef tcdrain
#undef wait
-#undef waitpid
#endif /* 0 */
#ifdef _SIGNAL_H_
int _flock(int, int);
#endif
+#undef err
+#undef warn
#undef nsdispatch
#endif /* _UN_NAMESPACE_H_ */
*
* @(#)auth_des.c 2.2 88/07/29 4.0 RPCSRC; from 1.9 88/02/08 SMI
* $FreeBSD: src/lib/libc/rpc/auth_des.c,v 1.10 2006/02/27 22:10:58 deischen Exp $
- * $DragonFly: src/lib/libc/rpc/auth_des.c,v 1.5 2005/11/13 12:27:04 swildner Exp $
*/
/*
* Copyright (c) 1988 by Sun Microsystems, Inc.
extern bool_t xdr_authdes_cred(XDR *, struct authdes_cred *);
extern bool_t xdr_authdes_verf(XDR *, struct authdes_verf *);
+extern int key_encryptsession_pk(char *, netobj *, des_block *);
extern bool_t __rpc_get_time_offset(struct timeval *, nis_server *, char *,
char **, char **);
static void mtmagazine_destructor(void *);
static slzone_t zone_alloc(int flags);
static void zone_free(void *z);
-static void _mpanic(const char *ctl, ...);
+static void _mpanic(const char *ctl, ...) __printflike(1, 2);
static void malloc_init(void) __constructor(0);
#if defined(INVARIANTS)
static void chunk_mark_allocated(slzone_t z, void *chunk);
int
posix_openpt(int oflag)
{
- return open("/dev/ptmx", oflag);
+ return _open("/dev/ptmx", oflag);
}
int
return -1;
}
}
- nread = read(fid, u.buf, sizeof u.buf);
- if (close(fid) < 0 || nread <= 0)
+ nread = _read(fid, u.buf, sizeof u.buf);
+ if (_close(fid) < 0 || nread <= 0)
return -1;
for (stored = 4; stored <= 8; stored *= 2) {
int ttisstdcnt;
* POSSIBILITY OF SUCH DAMAGE.
*
* $OpenBSD: stack_protector.c,v 1.3 2002/12/10 08:53:42 etoh Exp $
- * $DragonFly: src/lib/libc/sys/stack_protector.c,v 1.4 2008/04/15 23:41:28 hasso Exp $
*/
#include "namespace.h"
#include <sys/sysctl.h>
#include <fcntl.h>
#include <signal.h>
+#include <stdio.h>
#include <string.h>
#include <syslog.h>
#include <unistd.h>
#include "un-namespace.h"
+extern int __sys_sigaction(int, const struct sigaction *, struct sigaction *);
+
static void __guard_setup(void) __attribute__ ((constructor));
static void __fail(const char *);
void __stack_chk_fail(void);
/* Immediately block all signal handlers from running code */
sigfillset(&mask);
sigdelset(&mask, SIGABRT);
- sigprocmask(SIG_BLOCK, &mask, NULL);
+ _sigprocmask(SIG_BLOCK, &mask, NULL);
/* This may fail on a chroot jail... */
syslog(LOG_CRIT, msg);
.Pp
The
.Fa timeout
-is not specific limitation other then what fits in the signed integer.
+is not specific limitation other than what fits in the signed integer.
A negative timeout will return
.Er EINVAL .
.Pp
* SUCH DAMAGE.
*
* $FreeBSD: src/lib/libc/yp/yplib.c,v 1.51 2007/07/24 13:06:08 simon Exp $
- * $DragonFly: src/lib/libc/yp/yplib.c,v 1.9 2006/08/03 16:40:46 swildner Exp $
*/
#include "namespace.h"
#include "libc_private.h"
bool_t xdr_ypresp_all_seq(XDR *, u_long *);
-int _yp_check(char **);
int (*ypresp_allfn)(unsigned long, char *, int, char *, int, void *);
# stubs, remove just -DSYSLIBC_RCS from CFLAGS.
LIB=c_r
SHLIB_MAJOR= 5
+CSTD?=gnu89
CFLAGS+=-DLIBC_RCS -DSYSLIBC_RCS -I${.CURDIR}/../libc/include
CFLAGS+=-DPTHREAD_KERNEL -D_THREAD_SAFE -I${.CURDIR}/uthread
CFLAGS+=-I${.CURDIR}/../../include
return &evtr->cpus[c];
}
-static
-int
-parse_format_data(evtr_event_t ev, const char *fmt, ...) __attribute__((format (scanf, 2, 3)));
+static int parse_format_data(evtr_event_t ev, const char *fmt, ...)
+ __printflike(2, 3) __scanflike(2, 3);
+
static
int
parse_format_data(evtr_event_t ev, const char *fmt, ...)
void __ktrfmt_error (struct ktrfmt_parse_ctx *, const char *);
+static void do_parse_err(struct ktrfmt_parse_ctx *, const char *, ...)
+ __printflike(2, 3);
+
static
void
do_parse_err(struct ktrfmt_parse_ctx *ctx, const char *fmt, ...)
void __ktrfmt_error (struct ktrfmt_parse_ctx *, const char *);
+static void do_parse_err(struct ktrfmt_parse_ctx *, const char *, ...)
+ __printflike(2, 3);
+
static
void
do_parse_err(struct ktrfmt_parse_ctx *ctx, const char *fmt, ...)
void fetch_seterr(struct fetcherr *, int);
void fetch_syserr(void);
-void fetch_info(const char *, ...);
+void fetch_info(const char *, ...) __printflike(1, 2);
int fetch_default_port(const char *);
int fetch_default_proxy_port(const char *);
int fetch_bind(int, int, const char *);
#define FTP_SYNTAX_ERROR 500
#define FTP_PROTOCOL_ERROR 999
+static int ftp_cmd(conn_t *, const char *, ...) __printflike(2, 3);
static struct url cached_host;
static conn_t *cached_connection;
++beg, ++i;
for (++i; file + i < end && file[i] != '/'; ++i)
/* nothing */ ;
- e = ftp_cmd(conn, "CWD %.*s", file + i - beg, beg);
+ e = ftp_cmd(conn, "CWD %.*s", (int)(file + i - beg), beg);
if (e != FTP_FILE_ACTION_OK) {
ftp_seterr(e);
return (-1);
#endif
};
+static int http_cmd(conn_t *, const char *, ...) __printflike(2, 3);
+
/*
* Get next chunk header
*/
if (url->offset > 0)
http_cmd(conn, "Range: bytes=%lld-", (long long)url->offset);
http_cmd(conn, "Connection: close");
- http_cmd(conn, "");
+ http_cmd(conn, "%s", "");
/*
* Force the queued request to be dispatched. Normally, one
#include <ctype.h>
#include <errno.h>
#include <ftpio.h>
+#include <inttypes.h>
#include <netdb.h>
#include <signal.h>
#include <stdarg.h>
static char *get_a_line(FTP_t ftp);
static int get_a_number(FTP_t ftp, char **q);
static int botch(const char *func, const char *botch_state);
-static int cmd(FTP_t ftp, const char *fmt, ...);
+static int cmd(FTP_t ftp, const char *fmt, ...) __printflike(2, 3);
static int ftp_login_session(FTP_t ftp, const char *host, int af,
const char *user, const char *passwd,
int port, int verbose);
}
if (seekto && *seekto) {
- i = cmd(ftp, "REST %d", *seekto);
+ i = cmd(ftp, "REST %" PRId64, *seekto);
if (i < 0 || FTP_TIMEOUT(i)) {
close(s);
ftp->error = i;
if (sin.sin4.sin_family == AF_INET) {
u_long a;
a = ntohl(sin.sin4.sin_addr.s_addr);
- i = cmd(ftp, "PORT %d,%d,%d,%d,%d,%d",
+ i = cmd(ftp, "PORT %ld,%ld,%ld,%ld,%d,%d",
(a >> 24) & 0xff,
(a >> 16) & 0xff,
(a >> 8) & 0xff,
}
}
if (seekto && *seekto) {
- i = cmd(ftp, "REST %d", *seekto);
+ i = cmd(ftp, "REST %" PRId64, *seekto);
if (i < 0 || FTP_TIMEOUT(i)) {
close(s);
ftp->error = i;
void *p;
if ((p = calloc(n, sizeof(char))) == NULL)
- _kvm_err(kd, kd->program, "can't allocate %u bytes: %s",
+ _kvm_err(kd, kd->program, "can't allocate %zd bytes: %s",
n, strerror(errno));
return (p);
}
/*
* Functions used internally by kvm, but across kvm modules.
*/
-void _kvm_err (kvm_t *kd, const char *program, const char *fmt, ...);
+void _kvm_err (kvm_t *kd, const char *program, const char *fmt, ...)
+ __printflike(3, 4);
void _kvm_freeprocs (kvm_t *kd);
void _kvm_freevtop (kvm_t *);
int _kvm_initvtop (kvm_t *);
int _kvm_kvatop (kvm_t *, u_long, off_t *);
void *_kvm_malloc (kvm_t *kd, size_t);
void *_kvm_realloc (kvm_t *kd, void *, size_t);
-void _kvm_syserr
- (kvm_t *kd, const char *program, const char *fmt, ...);
+void _kvm_syserr (kvm_t *kd, const char *program, const char *fmt, ...)
+ __printflike(3, 4);
int _kvm_uvatop (kvm_t *, const struct proc *, u_long, u_long *);
void _kvm_minidump_freevtop(kvm_t *);
int _kvm_minidump_initvtop(kvm_t *);
for (; p != NULL; p = proc.p_list.le_next) {
if (KREAD(kd, (u_long)p, &proc)) {
- _kvm_err(kd, kd->program, "can't read proc at %x", p);
+ _kvm_err(kd, kd->program, "can't read proc at %p", p);
return (-1);
}
if (KREAD(kd, (u_long)proc.p_ucred, &ucred)) {
}
if (KREAD(kd, (u_long)proc.p_pgrp, &pgrp)) {
- _kvm_err(kd, kd->program, "can't read pgrp at %x",
+ _kvm_err(kd, kd->program, "can't read pgrp at %p",
proc.p_pgrp);
return (-1);
}
proc.p_pgrp = &pgrp;
if (proc.p_pptr) {
if (KREAD(kd, (u_long)proc.p_pptr, &pproc)) {
- _kvm_err(kd, kd->program, "can't read pproc at %x",
+ _kvm_err(kd, kd->program, "can't read pproc at %p",
proc.p_pptr);
return (-1);
}
}
if (KREAD(kd, (u_long)pgrp.pg_session, &sess)) {
- _kvm_err(kd, kd->program, "can't read session at %x",
+ _kvm_err(kd, kd->program, "can't read session at %p",
pgrp.pg_session);
return (-1);
}
if ((proc.p_flag & P_CONTROLT) && sess.s_ttyp != NULL) {
if (KREAD(kd, (u_long)sess.s_ttyp, &tty)) {
_kvm_err(kd, kd->program,
- "can't read tty at %x", sess.s_ttyp);
+ "can't read tty at %p", sess.s_ttyp);
return (-1);
}
sess.s_ttyp = &tty;
if (tty.t_pgrp != NULL) {
if (KREAD(kd, (u_long)tty.t_pgrp, &tpgrp)) {
_kvm_err(kd, kd->program,
- "can't read tpgrp at %x",
+ "can't read tpgrp at %p",
tty.t_pgrp);
return (-1);
}
}
lwp.lwp_proc = &proc;
if (KREAD(kd, (u_long)lwp.lwp_thread, &thread)) {
- _kvm_err(kd, kd->program, "can't read thread at %x",
+ _kvm_err(kd, kd->program, "can't read thread at %p",
lwp.lwp_thread);
return (-1);
}
}
if (size % sizeof(struct kinfo_proc) != 0) {
_kvm_err(kd, kd->program,
- "proc size mismatch (%d total, %d chunks)",
+ "proc size mismatch (%zd total, %zd chunks)",
size, sizeof(struct kinfo_proc));
return (0);
}
while (len > 0) {
errno = 0;
if (lseek(fd, (off_t)uva, 0) == -1 && errno != 0) {
- _kvm_err(kd, kd->program, "invalid address (%x) in %s",
+ _kvm_err(kd, kd->program, "invalid address (%lx) in %s",
uva, procfile);
break;
}
sparc.c
WARNS?= 3
-CSTD= gnu99
+
CFLAGS+= -DHAVE_CONFIG_H -DTUKLIB_SYMBOL_PREFIX=lzma_ \
-I${.CURDIR} \
-I${LZMADIR}/api \
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/time.h>
+#include <netinet/in.h>
#include <netipx/ipx.h>
#include <errno.h>
#include <unistd.h>
int _gNgDebugLevel = 0;
/* Debug printing functions */
-void (*_NgLog) (const char *fmt,...) = warn;
-void (*_NgLogx) (const char *fmt,...) = warnx;
+void (*_NgLog) (const char *fmt,...) __printflike(1, 2) = warn;
+void (*_NgLogx) (const char *fmt,...) __printflike(1, 2) = warnx;
/* Internal functions */
static const char *NgCookie(int cookie);
NGLOGX("NG_MESG :");
NGLOGX(" vers %d", msg->header.version);
NGLOGX(" arglen %d", msg->header.arglen);
- NGLOGX(" flags %ld", msg->header.flags);
- NGLOGX(" token %lu", (u_long)msg->header.token);
+ NGLOGX(" flags %u", msg->header.flags);
+ NGLOGX(" token %u", msg->header.token);
NGLOGX(" cookie %s (%d)",
NgCookie(msg->header.typecookie), msg->header.typecookie);
int NgSendData(int, const char *, const u_char *, size_t);
int NgRecvData(int, u_char *, size_t, char *);
int NgSetDebug(int);
-void NgSetErrLog(void (*)(const char *fmt, ...),
- void (*)(const char *fmt, ...));
+void NgSetErrLog(void (*)(const char *fmt, ...) __printflike(1, 2),
+ void (*)(const char *fmt, ...) __printflike(1, 2));
__END_DECLS
#endif
.PATH: ${DIST_DIR} ${OPIE_DIST}/libmissing
LIB= opie
+CSTD?= gnu89
SRCS= atob8.c btoa8.c btoh.c challenge.c getsequence.c hash.c hashlen.c \
keycrunch.c lock.c lookup.c newseed.c parsechallenge.c passcheck.c \
passwd.c randomchallenge.c readpass.c unlock.c verify.c version.c \
__BEGIN_DECLS
void _pam_verbose_error(pam_handle_t *, int, const char *,
- const char *, const char *, ...);
+ const char *, const char *, ...) __printflike(5, 6);
__END_DECLS
#define PAM_LOG(...) \
LIB= smb
+CSTD?= gnu89
+
SHLIB_MAJOR= 2
NOMAN=
# $FreeBSD: src/lib/libstand/Makefile,v 1.14.2.10 2002/07/22 14:21:50 ru Exp $
-# $DragonFly: src/lib/libstand/Makefile,v 1.12 2008/10/28 16:54:09 swildner Exp $
#
# Originally from $NetBSD: Makefile,v 1.21 1997/10/26 22:08:38 lukem Exp $
#
NOPIC= YES
INCS= stand.h
MAN= libstand.3
+CSTD?= c99
WARNS?= 2
# Mostly OK, some of the libc imports are a bit noisy
-CFLAGS+= -ffreestanding -std=c99
+CFLAGS+= -ffreestanding
.if ${MACHINE_ARCH} == "x86_64"
CFLAGS+= -m32 -mpreferred-stack-boundary=2
LIBDIR= /usr/lib/thread
NOPROFILE= yes
+WARNS?= 5
+
.include "${.CURDIR}/arch/${MACHINE_ARCH}/Makefile.inc"
.include "${.CURDIR}/thread/Makefile.inc"
/* Set the thread name for debug. */
void
-_pthread_set_name_np(pthread_t thread, const char *name)
+_pthread_set_name_np(pthread_t thread __unused, const char *name __unused)
{
#if 0
struct pthread *curthread = _get_curthread();
#include "thr_private.h"
+int _pthread_timedjoin_np(pthread_t pthread, void **thread_return,
+ const struct timespec *abstime);
+
static int join_common(pthread_t, void **, const struct timespec *);
static void backout_join(void *arg)
* falls into implementation defined behavior or not.
*/
int
-_thr_set_sched_other_prio(struct pthread *pth, int prio)
+_thr_set_sched_other_prio(struct pthread *pth __unused, int prio)
{
static int max, min, init_status;
#include <sys/time.h>
#include <sys/cdefs.h>
#include <sys/queue.h>
+#include <sys/rtprio.h>
#include <machine/atomic.h>
#include <errno.h>
#include <limits.h>
int _thr_getscheduler(lwpid_t, int *, struct sched_param *);
int _thr_setscheduler(lwpid_t, int, const struct sched_param *);
int _thr_set_sched_other_prio(struct pthread *, int);
+int _rtp_to_schedparam(const struct rtprio *rtp, int *policy,
+ struct sched_param *param);
+int _schedparam_to_rtp(int policy, const struct sched_param *param,
+ struct rtprio *rtp);
int _umtx_sleep_err(volatile const int *, int, int);
int _umtx_wakeup_err(volatile const int *, int);
#ifdef _SYS_FCNTL_H_
int __sys_fcntl(int, int, ...);
int __sys_open(const char *, int, ...);
+int __sys_openat(int, const char *, int, ...);
#endif
/* #include <sys/ioctl.h> */
int _aio_suspend(const struct aiocb * const iocbs[], int,
const struct timespec *);
int _pause(void);
-int _pselect(int, fd_set *, fd_set *, fd_set *,
+int __pselect(int, fd_set *, fd_set *, fd_set *,
const struct timespec *, const sigset_t *);
int _raise(int);
unsigned _sleep(unsigned);
INCS= tcpd.h
MAN= hosts_access.3
MAN+= hosts_access.5 hosts_options.5
+CSTD?= gnu89
.PATH: ${.CURDIR}/../../contrib/tcp_wrappers
* SUCH DAMAGE.
*
* @(#)main.c 8.1 (Berkeley) 6/4/93
- * $DragonFly: src/lib/liby/main.c,v 1.3 2007/11/25 01:28:23 swildner Exp $
*/
#include <stdlib.h>
+int yyparse(void);
+
int
main(void)
{
size_t);
#endif
+static void logit(int, const char *, ...) __printflike(2, 3);
+
static void
logit(int level, const char *fmt, ...)
{
if (login_access(user, tty) != 0)
return (PAM_SUCCESS);
PAM_VERBOSE_ERROR("%s is not allowed to log in on %s",
- user, tty);
+ (const char *)user, (const char *)tty);
} else {
PAM_LOG("Checking login.access for user %s from host %s",
(const char *)user, (const char *)rhost);
if (login_access(user, rhost) != 0)
return (PAM_SUCCESS);
PAM_VERBOSE_ERROR("%s is not allowed to log in from %s",
- user, rhost);
+ (const char *)user, (const char *)rhost);
}
return (PAM_AUTH_ERR);
static const char * const atrun = "atrun"; /* service name for syslog etc. */
static int debug = 0;
-void perr(const char *fmt, ...);
-void perrx(const char *fmt, ...);
+void perr(const char *fmt, ...) __printflike(1, 2);
+void perrx(const char *fmt, ...) __printflike(1, 2);
static void usage(void);
/* Local functions */
mailname = mailbuf;
if (nuid != uid)
- perrx("Job %s - userid %ld does not match file uid %lu",
- filename, nuid, (unsigned long)uid);
+ perrx("Job %s - userid %u does not match file uid %u",
+ filename, nuid, uid);
if (ngid != gid)
- perrx("Job %s - groupid %ld does not match file gid %lu",
- filename, ngid, (unsigned long)gid);
+ perrx("Job %s - groupid %u does not match file gid %u",
+ filename, ngid, gid);
fclose(stream);
/* net.c */
char *ssl_errstr(void);
int read_remote(int, int, char *);
-ssize_t send_remote_command(int, const char*, ...);
+ssize_t send_remote_command(int, const char*, ...) __printflike(2, 3);
int deliver_remote(struct qitem *, const char **);
/* base64.c */
/* util.c */
const char *hostname(void);
-void setlogident(const char *, ...);
-void errlog(int, const char *, ...);
-void errlogx(int, const char *, ...);
+void setlogident(const char *, ...) __printf0like(1, 2);
+void errlog(int, const char *, ...) __printf0like(2, 3);
+void errlogx(int, const char *, ...) __printf0like(2, 3);
void set_username(void);
void deltmp(void);
int open_locked(const char *, int, ...);
#define HISMACADDR "HISMACADDR"
#define SESSION_ID "SESSION_ID"
+static void nglog(const char *, ...) __printflike(1, 2);
static void nglogx(const char *, ...) __printflike(1, 2);
static int ReceivedSignal;
#define su_port su_si.si_port
void doit(union sockunion *);
-void error(const char *, ...);
+void error(const char *, ...) __printflike(1, 2);
void getstr(char *, int, const char *);
int local_domain(char *);
char *topdomain(char *);
static void morecore();
static int findbucket();
+static void xprintf(const char *, ...) __printflike(1, 2);
/*
* Pre-allocate mmap'ed pages
PROG= tcpd
MAN= tcpd.8
+CSTD?= gnu89
WARNS?= 1
CFLAGS+=-DREAL_DAEMON_DIR=\"/usr/libexec\" \
#define CRYPTDISKS_START 1
#define CRYPTDISKS_STOP 2
+static void syntax_error(const char *, ...) __printflike(1, 2);
+
static int line_no = 1;
static int yesDialog(char *msg __unused)
SRCS= devd.cc token.l parse.y y.tab.h
MAN= devd.8 devd.conf.5
-WARNS?= 0
+WARNS?= 5
NO_SHARED?=YES
static const char attach = '+';
static const char detach = '-';
-static struct pidfh *pfh;
-
int Dflag;
int dflag;
int nflag;
int rule_apply(void);
void dump_config(void);
int read_config(const char *, int);
-int syntax_error(const char *fmt, ...);
+int syntax_error(const char *fmt, ...) __printflike(1, 2);
void rule_tab(void);
void delete_rules(void);
#endif
struct inostat *inoinfo(ufs1_ino_t);
int linkup(ufs1_ino_t, ufs1_ino_t, char *);
int makeentry(ufs1_ino_t, ufs1_ino_t, char *);
-void panic(const char *, ...);
+void panic(const char *, ...) __printflike(1, 2);
void pass1(void);
void pass1b(void);
int pass1check(struct inodesc *);
void pass4(void);
int pass4check(struct inodesc *);
void pass5(void);
-void pfatal(const char *, ...);
+void pfatal(const char *, ...) __printflike(1, 2);
void pinode(ufs1_ino_t);
void propagate(void);
-void pwarn(const char *, ...);
+void pwarn(const char *, ...) __printflike(1, 2);
int reply(char *);
void setinodebuf(ufs1_ino_t);
int setup(char *);
extern char *__progname;
-static void vmsg(int, const char *, va_list);
+static void vmsg(int, const char *, va_list) __printflike(2, 0);
void
setcdevname(const char *cd, int pr)
* 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.
- *
- * $DragonFly: src/sbin/fsck/memzone.c,v 1.2 2007/11/25 01:28:23 swildner Exp $
*/
#include <sys/types.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include "fsutil.h"
#include "memzone.h"
/*
static int cleanup_dedup(const char *path, const char *snapshots_path,
int arg1, int arg2);
-static void runcmd(int *resp, const char *ctl, ...);
+static void runcmd(int *resp, const char *ctl, ...) __printflike(2, 3);
/*
* WARNING: Do not make the SNAPSHOTS_BASE "/var/snapshots" because
void hammer_cache_used(struct cache_info *cache);
void hammer_cache_flush(void);
-void panic(const char *ctl, ...);
+void panic(const char *ctl, ...) __printflike(1, 2);
static void LINE_INIT(char c);
static void LINE_BREAK(void);
-static void LINE_CHECK(const char *fmt, ...);
+static void LINE_CHECK(const char *fmt, ...) __printflike(1, 2);
static const char *modename[IEEE80211_MODE_MAX] = {
[IEEE80211_MODE_AUTO] = "auto",
static void handle(sig_t, ...);
static void delset(sigset_t *, ...);
-static void stall(const char *, ...);
-static void warning(const char *, ...);
-static void emergency(const char *, ...);
+static void stall(const char *, ...) __printflike(1, 2);
+static void warning(const char *, ...) __printflike(1, 2);
+static void emergency(const char *, ...) __printflike(1, 2);
static void disaster(int);
static void badsys(int);
static int runshutdown(void);
static char ntop_buf[INET6_ADDRSTRLEN];
-static void show_usage(const char *fmt, ...);
+static void show_usage(const char *fmt, ...) __printf0like(1, 2);
static int
mask_bits(u_char *m_ad, int m_len)
int authenticateLogin(isess_t *sess);
int fsm(isc_opt_t *op);
int sendPDU(isess_t *sess, pdu_t *pp, handler_t *hdlr);
-int addText(pdu_t *pp, char *fmt, ...);
+int addText(pdu_t *pp, char *fmt, ...) __printflike(2, 3);
void freePDU(pdu_t *pp);
int xmitpdu(isess_t *sess, pdu_t *pp);
int recvpdu(isess_t *sess, pdu_t *pp);
void jwrite(struct jfile *jf, struct jdata *jd);
struct jdata *jref(struct jdata *jd);
void jfree(struct jfile *jf, struct jdata *jd);
-void jf_warn(struct jfile *jf, const char *ctl, ...);
+void jf_warn(struct jfile *jf, const char *ctl, ...) __printflike(2, 3);
struct jstream *jaddrecord(struct jsession *ss, struct jdata *jd);
void jscan_dispose(struct jstream *js);
#include <ctype.h>
#include <err.h>
#include <errno.h>
+#include <inttypes.h>
#include <paths.h>
#include <stdio.h>
#include <stdlib.h>
MOPT_NULL,
};
-void fatal(const char *fmt, ...);
+void fatal(const char *fmt, ...) __printflike(1, 2);
#define COMPAT /* allow non-labeled disks */
if (fssize == 0)
fssize = geom.d_media_blocks;
if ((u_long)fssize > geom.d_media_blocks && !mfs) {
- fatal("%s: maximum file system size is %lld blocks",
+ fatal("%s: maximum file system size is %" PRIu64 " blocks",
argv[0], geom.d_media_blocks);
}
if (rpm == 0) {
const char *parse_str(char **scanp, int flags);
int udp_transact(struct sockaddr_in *sain, struct sockaddr_in *rsin, int *pfd,
- char **bufp, int *lenp, const char *ctl, ...);
+ char **bufp, int *lenp, const char *ctl, ...) __printflike(6, 7);
int tcp_transact(struct sockaddr_in *sain, FILE **pfi, FILE **pfo, char **bufp,
- int *lenp, const char *ctl, ...);
+ int *lenp, const char *ctl, ...) __printf0like(6, 7);
ufs1_ino_t lowerbnd(ufs1_ino_t);
void mktempname(struct entry *);
void moveentry(struct entry *, char *);
-void msg(const char *, ...);
+void msg(const char *, ...) __printflike(1, 2);
char *myname(struct entry *);
void newnode(struct entry *);
void newtapebuf(long);
long nodeupdates(char *, ufs1_ino_t, int);
void onintr(int);
-void panic(const char *, ...);
+void panic(const char *, ...) __printflike(1, 2);
void pathcheck(char *);
struct direct *pathsearch(const char *);
void printdumpinfo(void);
tun.4 \
twa.4 \
twe.4 \
+ tws.4 \
txp.4 \
uark.4 \
ubsa.4 \
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD: src/share/man/man4/aac.4,v 1.31.2.1.2.1 2006/12/14 23:56:26 brueffer Exp $
-.\" $DragonFly: src/share/man/man4/aac.4,v 1.8 2008/09/02 11:50:46 matthias Exp $
-.Dd May 8, 2009
+.\" $FreeBSD: src/share/man/man4/aac.4,v 1.41 2009/07/11 08:10:18 jkim Exp $
+.Dd January 7, 2011
.Dt AAC 4
.Os
.Sh NAME
.Cd device aacp
.Pp
To compile in debugging code:
-.Cd options AAC_DEBUG=N
+.Cd options AAC_DEBUG
.Ed
.Pp
Alternatively, to load the driver as a
.Pa /dev/afa?
and
.Pa /dev/hpn?
-exist for compatibilty with the Dell and HP versions of management tools,
+exist for compatibility with the Dell and HP versions of management tools,
respectively.
If the kernel is compiled with the
.Dv COMPAT_LINUX
.Xr ioctl 2
interface for the management device will be enabled and will allow
Linux-based management applications to control the card.
-.Ss Tuning
-The read-only sysctl
-.Va hw.aac.iosize_max
-defaults to 65536 and may be set at boot time to another value via
-.Xr loader 8 .
-This value determines the maximum data transfer size allowed
-to/from an array.
-Setting it higher will result in better performance,
-especially for large sequential access patterns.
-.Em Beware :
-internal limitations
-of the card limit this value to 64K for arrays with many members.
-While it may be safe to raise this value, this is done
-.Em at the operator's own risk .
-Note also that
-performance peaks at a value of 96K,
-and drops off dramatically at 128K,
-due to other limitations of the card.
.Sh HARDWARE
Controllers supported by the
.Nm
.It
Adaptec AAC-364
.It
+Adaptec RAID 2045
+.It
+Adaptec RAID 2405
+.It
+Adaptec RAID 2445
+.It
+Adaptec RAID 2805
+.It
+Adaptec RAID 3085
+.It
+Adaptec RAID 31205
+.It
+Adaptec RAID 31605
+.It
+Adaptec RAID 5085
+.It
+Adaptec RAID 51205
+.It
+Adaptec RAID 51245
+.It
+Adaptec RAID 51605
+.It
+Adaptec RAID 51645
+.It
+Adaptec RAID 52445
+.It
+Adaptec RAID 5405
+.It
+Adaptec RAID 5445
+.It
+Adaptec RAID 5805
+.It
+Adaptec SAS RAID 3405
+.It
+Adaptec SAS RAID 3805
+.It
Adaptec SAS RAID 4000SAS
.It
Adaptec SAS RAID 4005SAS
.It
IBM ServeRAID 8k
.It
+IBM ServeRAID 8s
+.It
+ICP RAID ICP5045BL
+.It
+ICP RAID ICP5085BL
+.It
+ICP RAID ICP5085SL
+.It
+ICP RAID ICP5125BR
+.It
+ICP RAID ICP5125SL
+.It
+ICP RAID ICP5165BR
+.It
+ICP RAID ICP5165SL
+.It
+ICP RAID ICP5445SL
+.It
+ICP RAID ICP5805BL
+.It
+ICP RAID ICP5805SL
+.It
ICP ICP5085BR SAS RAID
.It
ICP ICP9085LI SAS RAID
.It
ICP ICP9047MA SATA RAID
.It
+ICP ICP9067MA SATA RAID
+.It
ICP ICP9087MA SATA RAID
.It
ICP ICP9014RO SCSI RAID
Legend S220
.It
Legend S230
+.It
+Sun STK RAID REM
+.It
+Sun STK RAID EM
+.It
+SG-XPCIESAS-R-IN
+.It
+SG-XPCIESAS-R-EX
+.It
+AOC-USAS-S4i
+.It
+AOC-USAS-S8i
+.It
+AOC-USAS-S4iR
+.It
+AOC-USAS-S8iR
+.It
+AOC-USAS-S8i-LP
+.It
+AOC-USAS-S8iR-LP
.El
.Sh FILES
-.Bl -tag -width ".Pa /dev/aacd?" -compact
+.Bl -tag -width /boot/kernel/aac.ko -compact
.It Pa /dev/aac?
aac management interface
.It Pa /dev/aacd?
.Sh DIAGNOSTICS
Compiling with
.Dv AAC_DEBUG
-set to a number between 0 and 2
-will enable increasingly verbose debug messages.
+will enable debug messages.
.Pp
The adapter can send status and alert messages asynchronously
to the driver.
.Xr kld 4 ,
.Xr linux 4 ,
.Xr scsi 4 ,
-.Xr kldload 8 ,
-.Xr loader 8 ,
-.Xr sysctl 8
+.Xr kldload 8
.Sh HISTORY
The
.Nm
The firmware version is the same as the kernel version printed in the BIOS
POST and driver attach messages.
.Pp
-.\"This driver will not work on systems with more than 4GB of memory.
-.\".Pp
The controller is not actually paused on suspend/resume.
.\" SUCH DAMAGE.
.\"
.\" $FreeBSD: src/share/man/man4/ieee80211.4,v 1.1.2.3 2001/07/13 09:56:16 ru Exp $
-.\" $DragonFly: src/share/man/man4/ieee80211.4,v 1.6 2008/02/01 21:40:53 swildner Exp $
.\"
.Dd February 23, 2001
.Dt IEEE80211 4
.Va i_data
and
.Va i_len .
-The length should be no longer then 32 characters.
+The length should be no longer than 32 characters.
.It Dv IEEE80211_IOC_WEP
Set the current WEP mode to the value given in
.Va i_val .
.\" from: com.4,v 1.1 1993/08/06 11:19:07 cgd Exp
.\" from: sio.4,v 1.15 1994/12/06 20:14:30 bde Exp
.\" $FreeBSD: src/share/man/man4/man4.i386/dgb.4,v 1.13.2.6 2001/08/17 13:08:45 ru Exp $
-.\" $DragonFly: src/share/man/man4/man4.i386/dgb.4,v 1.6 2008/07/27 18:37:30 thomas Exp $
.\"
.Dd August 6, 2009
.Dt DGB 4 i386
first
.Dv NDGBPORTS
ports.
-If it is greater then all ports will be usable
+If it is greater than all ports will be usable
but some memory will be wasted.
.Pp
Meaning of
.\" from: com.4,v 1.1 1993/08/06 11:19:07 cgd Exp
.\" from: sio.4,v 1.15 1994/12/06 20:14:30 bde Exp
.\" $FreeBSD: src/share/man/man4/man4.i386/dgb.4,v 1.13.2.6 2001/08/17 13:08:45 ru Exp $
-.\" $DragonFly: src/share/man/man4/man4.i386/digi.4,v 1.1 2008/07/27 18:37:30 thomas Exp $
.\"
.Dd August 6, 2009
.Dt DIGI 4 i386
first
.Dv NDGBPORTS
ports.
-If it is greater then all ports will be usable
+If it is greater than all ports will be usable
but some memory will be wasted.
.Pp
Meaning of
messages, the quantity of which varies depending on the value assigned to
.Dv TWA_DEBUG
(0 to 10).
+.Sh SEE ALSO
+.Xr da 4 ,
+.Xr twe 4 ,
+.Xr tws 4
.Sh AUTHORS
The
.Nm
The controller was successfully reset,
and outstanding commands were restarted.
.El
+.Sh SEE ALSO
+.Xr twa 4 ,
+.Xr tws 4
.Sh AUTHORS
.An -nosplit
The
--- /dev/null
+.\"
+.\" Copyright (c) 2011
+.\" The DragonFly Project. 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, 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.
+.\" 3. Neither the name of The DragonFly Project 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 COPYRIGHT HOLDERS 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
+.\" COPYRIGHT HOLDERS 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.
+.\"
+.Dd January 9, 2011
+.Dt TWS 4
+.Os
+.Sh NAME
+.Nm tws
+.Nd 3ware 9750 series SATA/SAS RAID controllers driver
+.Sh SYNOPSIS
+To compile this driver into the kernel,
+place the following lines in your
+kernel configuration file:
+.Bd -ragged -offset indent
+.Cd "device scbus"
+.Cd "device tws"
+.Ed
+.Pp
+Alternatively, to load the driver as a
+module at boot time, place the following line in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+tws_load="YES"
+.Ed
+.Sh DESCRIPTION
+The
+.Nm
+driver provides support for LSI's 3ware 9750 series
+SATA/SAS controllers.
+.Pp
+These controllers are available in 4, 8, 16 or 24-port configurations,
+and support the following RAID levels: 0, 1, 10, 5, 50, 6.
+The device nodes for the controllers are of the form
+.Pa /dev/tws Ns Ar X ,
+where
+.Ar X
+is the controller number.
+The driver is implemented as a SCSI SIM
+under CAM, and, as such, the logical units that it controls are accessible
+via the device nodes,
+.Pa /dev/da Ns Ar Y ,
+where
+.Ar Y
+is the logical unit number.
+.Sh HARDWARE
+The
+.Nm
+driver supports the following SATA RAID controllers:
+.Pp
+.Bl -bullet -compact
+.It
+LSI's 3ware SAS 9750-4i
+.It
+LSI's 3ware SAS 9750-4i4e
+.It
+LSI's 3ware SAS 9750-8i
+.It
+LSI's 3ware SAS 9750-8e
+.It
+LSI's 3ware SAS 9750-16i4e
+.It
+LSI's 3ware SAS 9750-24i4e
+.El
+.Sh SEE ALSO
+.Xr da 4 ,
+.Xr twa 4 ,
+.Xr twe 4
+.Sh COPYRIGHT
+.Bd -literal
+Copyright (c) 2010, LSI Corp.
+All rights reserved.
+Author : Manjunath Ranganathaiah
+Support: freebsdraid@lsi.com
+
+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.
+3. Neither the name of the <ORGANIZATION> 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 COPYRIGHT HOLDERS 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
+COPYRIGHT HOLDER 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.
+.Ed
.Pp
The full
.Ar name
-may contain a ampersand
+may contain an ampersand
.Pq Ql &
which will be replaced by
the capitalized login
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.\" $FreeBSD: src/share/man/man8/diskless.8,v 1.6.2.9 2003/01/25 18:56:44 dillon Exp $
-.\" $DragonFly: src/share/man/man8/diskless.8,v 1.12 2008/08/30 19:02:49 swildner Exp $
.\"
.Dd February 19, 2008
.Dt DISKLESS 8
and
.Pa md_size
features work in any of these directories.
-The configuration feature works on directories other then
+The configuration feature works on directories other than
.Pa /etc ,
you simply create the directory you wish to replace or override in
.Pa /conf/{base,default,<BROADCAST-IP>,<MACHINE-IP>}/*
.\" $FreeBSD: /repoman/r/ncvs/src/share/man/man9/bus_dma.9,v 1.7 2003/07/27 14:05:29 mux Exp $
.\" $NetBSD: bus_dma.9,v 1.25 2002/10/14 13:43:16 wiz Exp $
.\"
-.Dd March 17, 2004
+.Dd January 11, 2010
.Dt BUS_DMA 9
.Os
.Sh NAME
.Fa dmat .
.It Fa flags
Are as follows:
-.Bl -tag -width ".Dv BUS_DMA_ALLOCNOW" -compact
+.Bl -tag -width ".Dv BUS_DMA_PRIVBZONE" -compact
.It Dv BUS_DMA_ALLOCNOW
Allocate the minimum resources necessary to guarantee that all map load
operations associated with this tag may not block.
constraint.
If unaligned memory was loaded into the DMA maps associated with this DMA tag,
system will panic.
+.It Dv BUS_DMA_PRIVBZONE
+Uses a private bounce zone instead of a shared one.
+A private bounce zone will vanish if the DMA tag is destroyed.
+.It Dv BUS_DMA_ALLOCALL
+Allocate all required resources (mainly the bounce buffer).
+If any allocation fails,
+.Fn bus_dma_tag_create
+fails.
+.It Dv BUS_DMA_PROTECTED
+All of the functions called with the DMA tag are already protected by the
+caller, so the
+.Nm
+code need not protect the internal data structures.
.El
.It Fa dmat
Pointer to a bus_dma_tag_t where the resulting DMA tag will
.Fn htobe32 ,
and
.Fn htobe64
-functions return a integer in the system's native
+functions return an integer in the system's native
byte order converted to big endian byte order.
The return value will be the same as the argument on big endian systems.
.Pp
.Fn htole32 ,
and
.Fn htole64
-functions return a integer in the system's native
+functions return an integer in the system's native
byte order converted to little endian byte order.
The return value will be the same as the argument on little endian systems.
.Pp
.Sh SYNOPSIS
.In cpu/lwbuf.h
.Ft "struct lwbuf *"
-.Fn lwbuf_alloc "vm_page_t m"
+.Fn lwbuf_alloc "vm_page_t m" "struct lwbuf *"
.Ft void
.Fn lwbuf_free "struct lwbuf *lwb"
.Ft vm_page_t
.Fn lwbuf_alloc
returns a pointer to a lightweight buffer representing
.Fa m .
+The
+.Fa lwb
+argument is an lwbuf structure, used to avoid allocation of an lwbuf
+on the x86_64 architecture. The
+.Fa lwb
+argument is unused on the i386 architecture.
.Pp
.Fn lwbuf_free
frees all resources associated with the lightweight buffer
.Sh SYNOPSIS
.In sys/thread.h
.Ft void
-.Fn lwkt_token_init "struct lwkt_token *tok" "int mpsafe"
+.Fn lwkt_token_init "struct lwkt_token *tok" "char *desc"
.Ft void
.Fn lwkt_token_uninit "struct lwkt_token *tok"
.Ft void
.Pp
The
.Fn lwkt_token_init
-function is called to initialize a token.
-If
-.Fa mpsafe
-is 0 the MP lock is taken before acquiring the token and released after
-releasing the token.
+function is called to initialize a token. The
+.Fa desc
+argument specifies the wait string displayed when waiting for the token.
The
.Fn lwkt_token_uninit
function is called to de-initialize one.
void
init(void)
{
- lwkt_token_init(&pdata.tok ,1);
+ lwkt_token_init(&pdata.tok, "example");
pdata.data = 0;
}
| FreeBSD 4.5 | | | | | |
| | \ | | | | BSD/OS 4.3
| FreeBSD 4.6 \ | | | OpenBSD 3.1 |
- | | \ | | NetBSD 1.5.3 | |
+ | | \ | | NetBSD 1.5.3 | |
| FreeBSD 4.6.2 Mac OS X | | |
| | 10.2 | | |
| FreeBSD 4.7 | | | |
| FreeBSD 7.1 | | | |
| | | | | DragonFly 2.2.0
| FreeBSD 7.2 | NetBSD 5.0 OpenBSD 4.5 |
- | \ | | | |
- | | | | | DragonFly 2.4.0
- | | | | OpenBSD 4.6 |
- | | | | | |
- *--FreeBSD | | | | |
- | 8.0 | | | | |
- | | FreeBSD | | | |
- | | 7.3 | | | DragonFly 2.6.0
- | | | | OpenBSD 4.7 |
- | FreeBSD | | | |
- | 8.1 | | | |
- | | | | | |
- | V | | | |
+ | \ | | | | |
+ | | | | | | DragonFly 2.4.0
+ | | | | | OpenBSD 4.6 |
+ | | | | | | |
+ *--FreeBSD | | | | | |
+ | 8.0 | | | | | |
+ | | FreeBSD | | | | |
+ | | 7.3 | | | | DragonFly 2.6.0
+ | | | | | OpenBSD 4.7 |
+ | FreeBSD | | | | |
+ | 8.1 | | | | |
+ | | | | | | DragonFly 2.8.2
+ | | | | | OpenBSD 4.8 |
+ | V | | NetBSD 5.1 | |
| | | | |
FreeBSD 9 -current | NetBSD -current OpenBSD -current |
| | | | |
DragonFly 2.6.0 2010-03-28 [DFB]
OpenBSD 4.7 2010-05-19 [OBD]
FreeBSD 8.1 2010-07-24 [FBD]
+DragonFly 2.8.2 2010-10-30 [DFB]
+OpenBSD 4.8 2010-11-01 [OBD]
+NetBSD 5.1 2010-11-19 [NBD]
Bibliography
------------------------
Copyright (c) 1997-2007 Wolfram Schneider <wosch@FreeBSD.ORG>
URL: http://cvsweb.freebsd.org/src/share/misc/bsd-family-tree
-$FreeBSD: src/share/misc/bsd-family-tree,v 1.139 2010/08/05 18:05:37 maxim Exp $
+$FreeBSD: src/share/misc/bsd-family-tree,v 1.142 2011/01/19 10:30:49 maxim Exp $
# This file contains common settings used for building DragonFly
# sources.
-# Enable various levels of compiler warning checks. These may be
-# overridden (e.g. if using a non-gcc compiler) by defining NO_WARNS.
+CSTD?= gnu99
-.if !defined(NO_WARNS)
-. if defined(CSTD)
-. if ${CSTD} == "k&r"
+.if ${CSTD} == "k&r"
CFLAGS += -traditional
-. elif ${CSTD} == "c89" || ${CSTD} == "c90"
+.elif ${CSTD} == "c89" || ${CSTD} == "c90"
CFLAGS += -std=iso9899:1990
-. elif ${CSTD} == "c94" || ${CSTD} == "c95"
+.elif ${CSTD} == "c94" || ${CSTD} == "c95"
CFLAGS += -std=iso9899:199409
-. elif ${CSTD} == "c99"
+.elif ${CSTD} == "c99"
CFLAGS += -std=iso9899:1999
-. else
+.else
CFLAGS += -std=${CSTD}
-. endif
-. endif
+.endif
+
+# Enable various levels of compiler warning checks. These may be
+# overridden (e.g. if using a non-gcc compiler) by defining NO_WARNS.
+
+.if !defined(NO_WARNS)
. if defined(WARNS)
. if ${WARNS} >= 1
CWARNFLAGS += -Wsystem-headers
# The system cc frontend is not subject to the path, e.g. when buildworld
# is doing cross compiles it may still need the native compiler for things.
#
-NXENV ?= CCVER=${HOST_CCVER} BINUTILSVER=${HOST_BINUTILSVER} OBJFORMAT_PATH=/ PATH=/usr/bin:/bin:/usr/sbin:/sbin
+NXENV ?= CCVER=${HOST_CCVER} BINUTILSVER=${HOST_BINUTILSVER} OBJFORMAT_PATH=/ PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/pkg/bin
NXCC ?= ${NXENV} ${CC}
NXCC_LINK ?= ${NXENV} ${CC_LINK}
CFLAGS ?= -O -pipe
CXX_LINK ?= ${CXX}
NXCXX ?= ${NXENV} ${CXX}
NXCXX_LINK ?= ${NXENV} ${CXX_LINK}
-CXXFLAGS ?= ${CXXINCLUDES} ${CFLAGS}
+CXXFLAGS ?= ${CXXINCLUDES} ${CFLAGS:N-std=*:N-Wnested-externs:N-W*-prototypes:N-Wno-pointer-sign:N-Wold-style-definition}
CPP ?= cpp
-@(#)Theory 8.5
+@(#)Theory 8.6
This file is in the public domain, so clarified as of
2009-05-17 by Arthur David Olson.
----- Outline -----
Time and date functions
- Names of time zone regions
+ Scope of the tz database
+ Names of time zone rule files
Time zone abbreviations
Calendrical issues
Time and time zones on Mars
better.
+----- Scope of the tz database -----
+
+The tz database attempts to record the history and predicted future of
+all computer-based clocks that track civil time. To represent this
+data, the world is partitioned into regions whose clocks all agree
+about time stamps that occur after the somewhat-arbitrary cutoff point
+of the POSIX Epoch (1970-01-01 00:00:00 UTC). For each such region,
+the database records all known clock transitions, and labels the region
+with a notable location.
+
+Clock transitions before 1970 are recorded for each such location,
+because most POSIX-compatible systems support negative time stamps and
+could misbehave if data were omitted for pre-1970 transitions.
+However, the database is not designed for and does not suffice for
+applications requiring accurate handling of all past times everywhere,
+as it would take far too much effort and guesswork to record all
+details of pre-1970 civil timekeeping.
+
+As noted in the README file, the tz database is not authoritative
+(particularly not for pre-1970 time stamps), and it surely has errors.
+Corrections are welcome and encouraged. Users requiring authoritative
+data should consult national standards bodies and the references cited
+in the database's comments.
+
+
----- Names of time zone rule files -----
The time zone rule file naming conventions attempt to strike a balance
# <pre>
-# @(#)australasia 8.20
+# @(#)australasia 8.22
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
Rule AS 1987 2007 - Oct lastSun 2:00s 1:00 -
Rule AS 1972 only - Feb 27 2:00s 0 -
Rule AS 1973 1985 - Mar Sun>=1 2:00s 0 -
-Rule AS 1986 1989 - Mar Sun>=15 2:00s 0 -
-Rule AS 1990 only - Mar Sun>=18 2:00s 0 -
-Rule AS 1991 only - Mar Sun>=1 2:00s 0 -
-Rule AS 1992 only - Mar Sun>=18 2:00s 0 -
-Rule AS 1993 only - Mar Sun>=1 2:00s 0 -
-Rule AS 1994 only - Mar Sun>=18 2:00s 0 -
+Rule AS 1986 1990 - Mar Sun>=15 2:00s 0 -
+Rule AS 1991 only - Mar 3 2:00s 0 -
+Rule AS 1992 only - Mar 22 2:00s 0 -
+Rule AS 1993 only - Mar 7 2:00s 0 -
+Rule AS 1994 only - Mar 20 2:00s 0 -
Rule AS 1995 2005 - Mar lastSun 2:00s 0 -
-Rule AS 2006 only - Apr Sun>=1 2:00s 0 -
+Rule AS 2006 only - Apr 2 2:00s 0 -
Rule AS 2007 only - Mar lastSun 2:00s 0 -
Rule AS 2008 max - Apr Sun>=1 2:00s 0 -
Rule AS 2008 max - Oct Sun>=1 2:00s 1:00 -
# <pre>
-# @(#)northamerica 8.34
+# %W%
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
# three votes for and one against."
# Hawaii
-#
-# From Arthur David Olson:
-# And then there's Hawaii.
-# DST was observed for one day in 1933;
-# standard time was changed by half an hour in 1947;
-# it's always standard as of 1986.
-#
-# From Paul Eggert:
-# Shanks says the 1933 experiment lasted for three weeks. Go with Shanks.
-#
-Zone Pacific/Honolulu -10:31:26 - LMT 1900 Jan 1 12:00
- -10:30 - HST 1933 Apr 30 2:00
- -10:30 1:00 HDT 1933 May 21 2:00
- -10:30 US H%sT 1947 Jun 8 2:00
+
+# From Arthur David Olson (2010-12-09):
+# "Hawaiian Time" by Robert C. Schmitt and Doak C. Cox appears on pages 207-225
+# of volume 26 of The Hawaiian Journal of History (1992). As of 2010-12-09,
+# the article is available at
+# <a href="http://evols.library.manoa.hawaii.edu/bitstream/10524/239/2/JL26215.pdf">
+# http://evols.library.manoa.hawaii.edu/bitstream/10524/239/2/JL26215.pdf
+# </a>
+# and indicates that standard time was adopted effective noon, January
+# 13, 1896 (page 218), that in "1933, the Legislature decreed daylight
+# saving for the period between the last Sunday of each April and the
+# last Sunday of each September, but less than a month later repealed the
+# act," (page 220), that year-round daylight saving time was in effect
+# from 1942-02-09 to 1945-09-30 (page 221, with no time of day given for
+# when clocks changed) and that clocks were changed by 30 minutes
+# effective the second Sunday of June, 1947 (page 219, with no time of
+# day given for when clocks changed). A footnote for the 1933 changes
+# cites Session Laws of Hawaii 1933, "Act. 90 (approved 26 Apr. 1933)
+# and Act 163 (approved 21 May 1933)."
+
+# From Arthur David Olson (2011-01-19):
+# The following is from "Laws of the Territory of Hawaii Passed by the
+# Seventeenth Legislature: Regular Session 1933," available (as of
+# 2011-01-19) at American University's Pence Law Library. Page 85: "Act
+# 90...At 2 o'clock ante meridian of the last Sunday in April of each
+# year, the standard time of this Territory shall be advanced one
+# hour...This Act shall take effect upon its approval. Approved this 26th
+# day of April, A. D. 1933. LAWRENCE M JUDD, Governor of the Territory of
+# Hawaii." Page 172: "Act 163...Act 90 of the Session Laws of 1933 is
+# hereby repealed...This Act shall take effect upon its approval, upon
+# which date the standard time of this Territory shall be restored to
+# that existing immediately prior to the taking effect of said Act 90.
+# Approved this 21st day of May, A. D. 1933. LAWRENCE M. JUDD, Governor
+# of the Territory of Hawaii."
+#
+# Note that 1933-05-21 was a Sunday.
+# We're left to guess the time of day when Act 163 was approved; guess noon.
+
+Zone Pacific/Honolulu -10:31:26 - LMT 1896 Jan 13 12:00 #Schmitt&Cox
+ -10:30 - HST 1933 Apr 30 2:00 #Laws 1933
+ -10:30 1:00 HDT 1933 May 21 12:00 #Laws 1933+12
+ -10:30 - HST 1942 Feb 09 2:00 #Schmitt&Cox+2
+ -10:30 1:00 HDT 1945 Sep 30 2:00 #Schmitt&Fox+2
+ -10:30 US H%sT 1947 Jun 8 2:00 #Schmitt&Fox+2
-10:00 - HST
# Now we turn to US areas that have diverged from the consensus since 1970.
* SUCH DAMAGE.
*
* $FreeBSD: src/sys/boot/common/commands.c,v 1.19 2003/08/25 23:30:41 obrien Exp $
- * $DragonFly: src/sys/boot/common/commands.c,v 1.4 2008/09/02 17:21:12 dillon Exp $
*/
#include <stand.h>
dvar_t dvar_get(const char *name);
void dvar_set(const char *name, char **data, int count);
void dvar_unset(const char *name);
+int dvar_istrue(dvar_t var);
dvar_t dvar_first(void);
dvar_t dvar_next(dvar_t var);
dvar_t dvar_copy(dvar_t var);
# $FreeBSD: src/sys/boot/i386/boot2/Makefile,v 1.47 2003/06/26 03:51:57 peter Exp $
-# $DragonFly: src/sys/boot/pc32/boot2/Makefile,v 1.18 2008/09/13 11:45:45 corecode Exp $
BINDIR?= /boot
BINMODE= 444
CLEANFILES= boot \
sio.o
+CSTD?= c99
+
NM?= nm
NXCFLAGS=
NXLDFLAGS=
# -mno-align-long-strings
CFLAGS= -elf -ffreestanding -Os -fno-builtin \
-fomit-frame-pointer \
- -std=c99 \
-DBOOT2 \
-I${.CURDIR}/../../common \
-I${.CURDIR}/../../../../lib/libstand \
#include <stdlib.h>
#include <stdio.h>
+#include <camlib.h>
#define kbsearch bsearch
table[0] = ((struct scsi_op_quirk_entry *)match)->op_table;
num_ops[0] = ((struct scsi_op_quirk_entry *)match)->num_ops;
table[1] = scsi_op_codes;
- num_ops[1] = sizeof(scsi_op_codes)/sizeof(scsi_op_codes[0]);
+ num_ops[1] = NELEM(scsi_op_codes);
num_tables = 2;
} else {
/*
return("Vendor Specific Command");
table[0] = scsi_op_codes;
- num_ops[0] = sizeof(scsi_op_codes)/sizeof(scsi_op_codes[0]);
+ num_ops[0] = NELEM(scsi_op_codes);
num_tables = 1;
}
{ SSD_KEY_RESERVED, SS_FATAL|EIO, "RESERVED" }
};
-const int sense_key_table_size =
- sizeof(sense_key_table)/sizeof(sense_key_table[0]);
+const int sense_key_table_size = NELEM(sense_key_table);
static struct asc_table_entry quantum_fireball_entries[] = {
{ SST(0x04, 0x0b, SS_START | SSQ_DECREMENT_COUNT | ENXIO,
}
};
-const int sense_quirk_table_size =
- sizeof(sense_quirk_table)/sizeof(sense_quirk_table[0]);
+const int sense_quirk_table_size = NELEM(sense_quirk_table);
static struct asc_table_entry asc_table[] = {
/*
"Security conflict in translated device") }
};
-const int asc_table_size = sizeof(asc_table)/sizeof(asc_table[0]);
+const int asc_table_size = NELEM(asc_table);
struct asc_key
{
return (3300);
}
- num_syncrates = sizeof(scsi_syncrates) / sizeof(scsi_syncrates[0]);
+ num_syncrates = NELEM(scsi_syncrates);
/* See if the period is in the "exception" table */
for (i = 0; i < num_syncrates; i++) {
/* Adjust for exception table being in 100ths. */
period *= 10;
- num_syncrates = sizeof(scsi_syncrates) / sizeof(scsi_syncrates[0]);
+ num_syncrates = NELEM(scsi_syncrates);
/* See if the period is in the "exception" table */
for (i = 0; i < num_syncrates; i++) {
* SUCH DAMAGE.
*
* $FreeBSD: src/sys/i386/isa/isa_compat.h,v 1.27.2.11 2002/10/05 18:31:48 scottl Exp $
- * $DragonFly: src/sys/bus/isa/i386/isa_compat.h,v 1.13 2008/07/28 01:21:39 swildner Exp $
*/
#include "use_el.h"
};
-#define old_drivers_count (sizeof(old_drivers) / sizeof(old_drivers[0]))
+#define old_drivers_count NELEM(old_drivers)
};
-#define old_drivers_count (sizeof(old_drivers) / sizeof(old_drivers[0]))
-
+#define old_drivers_count NELEM(old_drivers)
/* $NetBSD: pcmcia_cis_quirks.c,v 1.6 2000/04/12 21:07:55 scw Exp $ */
/* $FreeBSD: src/sys/dev/pccard/pccard_cis_quirks.c,v 1.15 2005/03/26 21:30:49 sam Exp $ */
-/* $DragonFly: src/sys/bus/pccard/pccard_cis_quirks.c,v 1.7 2007/07/05 12:08:53 sephe Exp $ */
#define PCCARDDEBUG
&pccard_ndc_nd5100_func0, &pccard_ndc_nd5100_func0_cfe0 },
};
-static int n_pccard_cis_quirks =
- sizeof(pccard_cis_quirks)/sizeof(pccard_cis_quirks[0]);
+static int n_pccard_cis_quirks = NELEM(pccard_cis_quirks);
static int
pccard_cis_quirk_match(struct pccard_softc *sc, struct pccard_cis_quirk *q)
static int
mptable_hostb_probe(device_t dev)
{
+ if (!apic_io_enable)
+ return (ENXIO);
if (pci_cfgregopen() == 0)
return (ENXIO);
{
int bus;
+ if (!apic_io_enable)
+ return (ENXIO);
+
if ((pci_get_class(dev) != PCIC_BRIDGE) ||
(pci_get_subclass(dev) != PCIS_BRIDGE_PCI))
return (ENXIO);
/*
* $NetBSD: usb_mem.c,v 1.26 2003/02/01 06:23:40 thorpej Exp $
* $FreeBSD: src/sys/dev/usb/usb_mem.c,v 1.5 2003/10/04 22:13:21 joe Exp $
- * $DragonFly: src/sys/bus/usb/usb_mem.c,v 1.12 2007/06/28 13:55:12 hasso Exp $
*/
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
if (bus_dma_tag_create(tag, align, 0,
BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL,
- size, sizeof(p->segs) / sizeof(p->segs[0]), size,
- BUS_DMA_ALLOCNOW, &p->tag) == ENOMEM)
- {
+ size, NELEM(p->segs), size, BUS_DMA_ALLOCNOW, &p->tag) == ENOMEM) {
goto free;
}
/* $NetBSD: usb_subr.c,v 1.99 2002/07/11 21:14:34 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.76.2.3 2006/03/01 01:59:05 iedowse Exp $ */
-/* $DragonFly: src/sys/bus/usb/usb_subr.c,v 1.28 2008/05/25 16:38:36 mneumann Exp $ */
/* Also already have from NetBSD:
* $NetBSD: usb_subr.c,v 1.102 2003/01/01 16:21:50 augustss Exp $
if (dev->hub) {
for (i = 0;
- i < sizeof(di->udi_ports) / sizeof(di->udi_ports[0]) &&
+ i < NELEM(di->udi_ports) &&
i < dev->hub->hubdesc.bNbrPorts;
i++) {
p = &dev->hub->ports[i];
ddb/db_variables.c optional ddb
ddb/db_watch.c optional ddb
ddb/db_write_cmd.c optional ddb
-dev/raid/aac/aac.c optional nowerror aac
+dev/raid/aac/aac.c optional aac
+dev/raid/aac/aac_cam.c optional aacp aac
dev/raid/aac/aac_debug.c optional aac
dev/raid/aac/aac_disk.c optional aac
-dev/raid/aac/aac_pci.c optional aac pci
dev/raid/aac/aac_linux.c optional aac compat_linux
-dev/raid/aac/aac_cam.c optional aacp aac
+dev/raid/aac/aac_pci.c optional aac pci
dev/raid/arcmsr/arcmsr.c optional arcmsr pci
dev/raid/twa/tw_osl_freebsd.c optional twa
dev/raid/twe/twe.c optional twe
dev/raid/twe/twe_freebsd.c optional twe
+dev/raid/tws/tws.c optional tws
+dev/raid/tws/tws_cam.c optional tws
+dev/raid/tws/tws_hdm.c optional tws
+dev/raid/tws/tws_services.c optional tws
+dev/raid/tws/tws_user.c optional tws
dev/netif/tx/if_tx.c optional tx
dev/netif/txp/if_txp.c optional txp
dev/raid/vinum/vinum.c optional vinum
# opt_<name-of-option-in-lower-case>.h
# Adaptec Array Controller driver options
-AAC_DEBUG opt_aac.h # Debugging levels:
- # 0 - quiet, only emit warnings
- # 1 - noisy, emit major function
- # points and things done
- # 2 - noisier, emit trace items
- # in loops, etc.
- # 3 - even more noisy, more function
- # points
- # 4 - noisiest
+AAC_DEBUG opt_aac.h
# Adaptec aic7xxx SCSI controller options
AHC_ALLOW_MEMIO opt_aic7xxx.h # Allow PCI devices to use memory
DEBUG_CRIT_SECTIONS opt_global.h
DIAGNOSTIC opt_global.h
INVARIANTS opt_global.h
-SIMPLELOCK_DEBUG opt_global.h
VFS_BIO_DEBUG opt_global.h
DEBUG_INTERRUPTS opt_global.h
SOCKBUF_DEBUG opt_global.h
device iir # Intel Integrated RAID
device mly # Mylex AcceleRAID/eXtremeRAID
device twa # 3ware 9000 series PATA/SATA RAID
+device tws # 3ware 9750 series SATA/SAS RAID
# RAID controllers
device aac # Adaptec FSA RAID, Dell PERC2/PERC3
-#device aacp # SCSI passthrough for aac (requires CAM)
+device aacp # SCSI passthrough for aac (requires CAM)
device amr # AMI MegaRAID
device amrp # SCSI Passthrough interface (optional, CAM req.)
device ida # Compaq Smart RAID
device iir # Intel Integrated RAID
device mly # Mylex AcceleRAID/eXtremeRAID
device twa # 3ware 9000 series PATA/SATA RAID
+device tws # 3ware 9750 series SATA/SAS RAID
# RAID controllers
device aac # Adaptec FSA RAID, Dell PERC2/PERC3
-#device aacp # SCSI passthrough for aac (requires CAM)
+device aacp # SCSI passthrough for aac (requires CAM)
device amr # AMI MegaRAID
device amrp # SCSI Passthrough interface (optional, CAM req.)
device ida # Compaq Smart RAID
# the Dell PERC 2/QC and the HP NetRAID-4M
#
device aac
-options AAC_DEBUG=4
+options AAC_DEBUG
device aacp # SCSI Passthrough interface (optional, CAM required)
#
device twe # 3ware ATA RAID
device twa # 3ware 9000 series PATA/SATA RAID
options TWA_DEBUG=10 # enable debug messages
+device tws # 3ware 9750 series SATA/SAS RAID
#
# Promise Supertrack SX6000
options SCSI_NCR_MAX_WIDE=1
options SCSI_NCR_MYADDR=7
options SHOW_BUSYBUFS # List buffers that prevent root unmount
-options SIMPLELOCK_DEBUG
options SI_DEBUG
options SLIP_IFF_OPTS
options SOCKBUF_DEBUG
device iir # Intel Integrated RAID
device mly # Mylex AcceleRAID/eXtremeRAID
device twa # 3ware 9000 series PATA/SATA RAID
+device tws # 3ware 9750 series SATA/SAS RAID
# RAID controllers
device aac # Adaptec FSA RAID, Dell PERC2/PERC3
-#device aacp # SCSI passthrough for aac (requires CAM)
+device aacp # SCSI passthrough for aac (requires CAM)
device amr # AMI MegaRAID
device amrp # SCSI Passthrough interface (optional, CAM req.)
device ida # Compaq Smart RAID
device iir # Intel Integrated RAID
device mly # Mylex AcceleRAID/eXtremeRAID
device twa # 3ware 9000 series PATA/SATA RAID
+device tws # 3ware 9750 series SATA/SAS RAID
# RAID controllers
device aac # Adaptec FSA RAID, Dell PERC2/PERC3
-#device aacp # SCSI passthrough for aac (requires CAM)
+device aacp # SCSI passthrough for aac (requires CAM)
device amr # AMI MegaRAID
device amrp # SCSI Passthrough interface (optional, CAM req.)
device ida # Compaq Smart RAID
* Access to a per-cpu data element
*/
#define PCPU(x) %fs:gd_ ## x
+#define PCPU_E4(x, idx) %fs:gd_ ## x(,idx,4)
#define MYCPU %fs:0
#endif
#if defined(_KERNEL)
-struct lwbuf *lwbuf_alloc(vm_page_t);
+struct lwbuf *lwbuf_alloc(vm_page_t, struct lwbuf *);
void lwbuf_free(struct lwbuf *);
vm_offset_t lwbuf_kva(struct lwbuf *lwb);
void lwbuf_set_global(struct lwbuf *);
* rights to redistribute these changes.
*
* $FreeBSD: src/sys/i386/i386/db_disasm.c,v 1.23.2.1 2001/07/29 22:48:37 kris Exp $
- * $DragonFly: src/sys/cpu/i386/misc/db_disasm.c,v 1.6 2007/01/06 08:24:41 dillon Exp $
*/
/*
/*ff*/ { "", TRUE, NONE, 0, db_Grp5 },
};
-static const struct inst db_bad_inst =
- { "???", FALSE, NONE, 0, 0 }
-;
+static const struct inst db_bad_inst = { "???", FALSE, NONE, 0, 0 };
#define f_mod(byte) ((byte)>>6)
#define f_reg(byte) (((byte)>>3)&0x7)
}
struct lwbuf *
-lwbuf_alloc(vm_page_t m)
+lwbuf_alloc(vm_page_t m, struct lwbuf *lwb_dummy __unused)
{
struct mdglobaldata *gd = mdcpu;
struct lwbuf *lwb;
/*
* Access per-CPU data.
*/
-#define PCPU(member) %gs:gd_ ## member
+#define PCPU(member) %gs:gd_ ## member
+#define PCPU_E8(member,idx) %gs:gd_ ## member(,idx,8)
#define PCPU_ADDR(member, reg) \
movq %gs:PC_PRVSPACE, reg ; \
addq $PC_ ## member, reg
#ifndef _MACHINE_ATOMIC_H_
#include <machine/atomic.h>
#endif
+#ifndef _MACHINE_VMPARAM_H_
+#include <machine/vmparam.h>
+#endif
#if !defined(_KERNEL) && !defined(_KERNEL_STRUCTURES)
#error "This file should not be included by userland programs."
#endif
struct lwbuf {
- vm_page_t m; /* currently mapped page */
- vm_offset_t kva; /* va of mapping */
+ vm_page_t m; /* currently mapped page */
+ vm_offset_t kva; /* va of mapping */
};
static __inline vm_page_t
-lwbuf_page(struct lwbuf *lwb) {
- return (lwb->m);
+lwbuf_page(struct lwbuf *lwb)
+{
+ return (lwb->m);
}
static __inline vm_offset_t
-lwbuf_kva(struct lwbuf *lwb) {
- return (lwb->kva);
+lwbuf_kva(struct lwbuf *lwb)
+{
+ return (lwb->kva);
+}
+
+static __inline struct lwbuf *
+lwbuf_alloc(vm_page_t m, struct lwbuf *lwb_cache)
+{
+ struct lwbuf *lwb = lwb_cache;
+
+ lwb->m = m;
+ lwb->kva = PHYS_TO_DMAP(VM_PAGE_TO_PHYS(lwb->m));
+
+ return (lwb);
+}
+
+static __inline void
+lwbuf_free(struct lwbuf *lwb)
+{
+ lwb->m = NULL; /* safety */
}
#define lwbuf_set_global(lwb)
#if defined(_KERNEL)
-struct lwbuf *lwbuf_alloc(vm_page_t);
-void lwbuf_free(struct lwbuf *);
-
#endif
#endif /* !_CPU_LWBUF_H_ */
/*ff*/ { "", TRUE, NONE, 0, db_Grp5 },
};
-static const struct inst db_bad_inst =
- { "???", FALSE, NONE, 0, 0 }
-;
+static const struct inst db_bad_inst = { "???", FALSE, NONE, 0, 0 };
#define f_mod(rex, byte) ((byte)>>6)
#define f_reg(rex, byte) ((((byte)>>3)&0x7) | (rex & REX_R ? 0x8 : 0x0))
#include <cpu/lwbuf.h>
#include <machine/param.h>
+#if 0
+/*
+ * NO LONGER USED - See inlines
+ */
+
static void lwbuf_init(void *);
SYSINIT(sock_lwb, SI_BOOT2_MACHDEP, SI_ORDER_ANY, lwbuf_init, NULL);
&lwbuf_malloc_args);
}
+#endif
+
+#if 0
+/*
+ * NO LONGER USED - See inlines
+ */
+
struct lwbuf *
-lwbuf_alloc(vm_page_t m)
+lwbuf_alloc(vm_page_t m, struct lwbuf *lwb_cache)
{
- struct lwbuf *lwb;
-
- if ((lwb = objcache_get(lwbuf_cache, M_WAITOK)) == NULL)
- return (NULL);
+ struct lwbuf *lwb = lwb_cache;
lwb->m = m;
lwb->kva = PHYS_TO_DMAP(VM_PAGE_TO_PHYS(lwb->m));
void
lwbuf_free(struct lwbuf *lwb)
{
- lwb->m = NULL;
-
- objcache_put(lwbuf_cache, lwb);
+ lwb->m = NULL; /* safety */
}
+
+#endif
* rights to redistribute these changes.
*
* $FreeBSD: src/sys/ddb/db_variables.c,v 1.18 1999/08/28 00:41:11 peter Exp $
- * $DragonFly: src/sys/ddb/db_variables.c,v 1.4 2005/12/23 21:35:44 swildner Exp $
*/
/*
{ "maxwidth", &db_max_width, NULL },
{ "tabstops", &db_tab_stop_width, NULL },
};
-static struct db_variable *db_evars =
- db_vars + sizeof(db_vars)/sizeof(db_vars[0]);
+static struct db_variable *db_evars = db_vars + NELEM(db_vars);
static int
db_find_variable(struct db_variable **varp)
{2048, 1920},
{4096, 3932}
};
-#define agp_max_size (sizeof(agp_max) / sizeof(agp_max[0]))
+#define agp_max_size NELEM(agp_max)
/**
* Sets the PCI resource which represents the AGP aperture.
* SUCH DAMAGE.
*
* $FreeBSD: src/sys/dev/agp/agp_ali.c,v 1.20 2007/11/12 21:51:36 jhb Exp $
- * $DragonFly: src/sys/dev/agp/agp_ali.c,v 1.8 2008/01/07 01:34:58 corecode Exp $
*/
#include "opt_bus.h"
128*M, /* 9 - invalid */
256*M, /* 10 - invalid */
};
-#define agp_ali_table_size (sizeof(agp_ali_table) / sizeof(agp_ali_table[0]))
+#define agp_ali_table_size NELEM(agp_ali_table)
static u_int32_t
agp_ali_get_aperture(device_t dev)
* SUCH DAMAGE.
*
* $FreeBSD: src/sys/dev/agp/agp_amd64.c,v 1.16 2007/11/12 21:51:36 jhb Exp $
- * $DragonFly: src/sys/dev/agp/agp_amd64.c,v 1.3 2008/01/07 01:34:58 corecode Exp $
*/
#include "opt_bus.h"
0x80000000, /* 2048 MB */
};
-#define AGP_AMD64_TABLE_SIZE \
- (sizeof(agp_amd64_table) / sizeof(agp_amd64_table[0]))
+#define AGP_AMD64_TABLE_SIZE NELEM(agp_amd64_table)
static uint32_t
agp_amd64_get_aperture(device_t dev)
* 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.
- *
- * $DragonFly: src/sys/dev/bridge/ecc/ecc.c,v 1.2 2008/08/02 01:14:42 dillon Exp $
*/
#include <sys/param.h>
#include "pcib_if.h"
-#define arysize(ary) (sizeof(ary)/sizeof((ary)[0]))
-
static int setup_none(device_t dev);
static int setup_amd64(device_t dev);
static void poll_amd64(void *dev_arg);
vid = pci_get_vendor(dev);
did = pci_get_device(dev);
- for (i = 0; i < arysize(mem_controllers); ++i) {
+ for (i = 0; i < NELEM(mem_controllers); ++i) {
if (mem_controllers[i].vid == vid &&
mem_controllers[i].did == did
) {
/* $FreeBSD: src/sys/dev/hifn/hifn7751.c,v 1.5.2.5 2003/06/04 17:56:59 sam Exp $ */
-/* $DragonFly: src/sys/dev/crypto/hifn/hifn7751.c,v 1.14 2007/12/04 09:11:12 hasso Exp $ */
/* $OpenBSD: hifn7751.c,v 1.120 2002/05/17 00:33:34 deraadt Exp $ */
/*
u_int32_t dmacfg, ramcfg, encl, addr, i;
char *offtbl = NULL;
- for (i = 0; i < sizeof(pci2id)/sizeof(pci2id[0]); i++) {
+ for (i = 0; i < NELEM(pci2id); i++) {
if (pci2id[i].pci_vendor == pci_get_vendor(sc->sc_dev) &&
pci2id[i].pci_prod == pci_get_device(sc->sc_dev)) {
offtbl = pci2id[i].card_id;
/* $FreeBSD: src/sys/dev/rndtest/rndtest.c,v 1.1.4.1 2003/06/04 17:10:30 sam Exp $ */
-/* $DragonFly: src/sys/dev/crypto/rndtest/rndtest.c,v 1.9 2006/12/18 20:41:01 dillon Exp $ */
/* $OpenBSD$ */
/*
{ rndtest_longruns },
};
-#define RNDTEST_NTESTS (sizeof(rndtest_funcs)/sizeof(rndtest_funcs[0]))
+#define RNDTEST_NTESTS NELEM(rndtest_funcs)
SYSCTL_NODE(_kern, OID_AUTO, rndtest, CTLFLAG_RD, 0, "RNG test parameters");
* SUCH DAMAGE.
*
* $FreeBSD: src/sys/dev/advansys/adwlib.c,v 1.6.2.1 2000/04/14 13:32:50 nyan Exp $
- * $DragonFly: src/sys/dev/disk/advansys/adwlib.c,v 1.6 2006/12/22 23:26:15 swildner Exp $
*/
/*
* Ported from:
{ ADW_MC_SDTR_ASYNC, 0, "async" }
};
-const int adw_num_syncrates = sizeof(adw_syncrates) / sizeof(adw_syncrates[0]);
+const int adw_num_syncrates = NELEM(adw_syncrates);
static u_int16_t adw_eeprom_read_16(struct adw_softc *adw, int addr);
static void adw_eeprom_write_16(struct adw_softc *adw, int addr,
int state;
state = ahci_port_link_pwr_state(ap);
- if (state < 0 || state >= sizeof(state_names) / sizeof(state_names[0]))
+ if (state < 0 || state >= NELEM(state_names))
state = 0;
ksnprintf(buf, sizeof(buf), "%s", state_names[state]);
* SUCH DAMAGE.
*
* $FreeBSD: src/sys/dev/aic/aic.c,v 1.8 2000/01/14 23:42:35 imp Exp $
- * $DragonFly: src/sys/dev/disk/aic/aic.c,v 1.14 2008/05/18 20:30:21 pavalos Exp $
*/
#include <sys/param.h>
aic->chip_type = AIC6260;
aic_insb(aic, ID, chip_id, sizeof(chip_id) - 1);
chip_id[sizeof(chip_id) - 1] = '\0';
- for (i = 0; i < sizeof(aic_chip_ids) / sizeof(aic_chip_ids[0]); i++) {
+ for (i = 0; i < NELEM(aic_chip_ids); i++) {
if (!strcmp(chip_id, aic_chip_ids[i].idstring)) {
aic->chip_type = aic_chip_ids[i].type;
break;
* SUCH DAMAGE.
*
* $FreeBSD: src/sys/dev/aic/aic_isa.c,v 1.3 2000/01/14 23:42:35 imp Exp $
- * $DragonFly: src/sys/dev/disk/aic/aic_isa.c,v 1.8 2008/01/05 07:27:09 pavalos Exp $
*/
#include <sys/param.h>
static int aic_isa_attach (device_t);
static u_int aic_isa_ports[] = { 0x340, 0x140 };
-#define AIC_ISA_NUMPORTS (sizeof(aic_isa_ports) / sizeof(aic_isa_ports[0]))
+#define AIC_ISA_NUMPORTS NELEM(aic_isa_ports)
#define AIC_ISA_PORTSIZE 0x20
static struct isa_pnp_id aic_ids[] = {
/**************************************************************************
**
** $FreeBSD: src/sys/pci/ncr.c,v 1.155.2.3 2001/03/05 13:09:10 obrien Exp $
-** $DragonFly: src/sys/dev/disk/ncr/ncr.c,v 1.22 2008/05/18 20:30:22 pavalos Exp $
**
** Device driver for the NCR 53C8XX PCI-SCSI-Controller Family.
**
int i, found;
found = -1;
- for (i = 0; i < sizeof(ncr_chip_table)/sizeof(ncr_chip_table[0]); i++) {
+ for (i = 0; i < NELEM(ncr_chip_table); i++) {
if (device_id == ncr_chip_table[i].device_id &&
ncr_chip_table[i].minrevid <= revision_id) {
if (found < 0 ||
bus_write_4(slot->mem_res, off, val);
}
+static int slot_printf(struct sdhci_slot *, const char *, ...)
+ __printflike(2, 3);
+
/* bus entry points */
static int sdhci_probe(device_t dev);
static int sdhci_attach(device_t dev);
FE_RAM|FE_IO256|FE_LEDC}
};
-#define sym_pci_num_devs \
- (sizeof(sym_pci_dev_table) / sizeof(sym_pci_dev_table[0]))
+#define sym_pci_num_devs NELEM(sym_pci_dev_table)
/*
* Look up the chip table.
#define DRM_MAX_CTXBITMAP (PAGE_SIZE * 8)
/* Internal types and structures */
-#define DRM_ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
+#define DRM_ARRAY_SIZE(x) NELEM(x)
#define DRM_MIN(a,b) ((a)<(b)?(a):(b))
#define DRM_MAX(a,b) ((a)>(b)?(a):(b))