PERFORCE change 57097 for review
Marcel Moolenaar
marcel at FreeBSD.org
Sun Jul 11 11:13:47 PDT 2004
http://perforce.freebsd.org/chv.cgi?CH=57097
Change 57097 by marcel at marcel_nfs on 2004/07/11 18:12:52
IFC @57096
Affected files ...
.. //depot/projects/gdb/UPDATING#21 integrate
.. //depot/projects/gdb/games/bcd/Makefile#2 integrate
.. //depot/projects/gdb/games/bcd/bcd.c#2 integrate
.. //depot/projects/gdb/lib/libc/regex/regcomp.c#2 integrate
.. //depot/projects/gdb/lib/libc/regex/regex2.h#2 integrate
.. //depot/projects/gdb/share/man/man9/sx.9#5 integrate
.. //depot/projects/gdb/sys/amd64/isa/clock.c#7 integrate
.. //depot/projects/gdb/sys/contrib/ipfilter/netinet/ip_fil.c#5 integrate
.. //depot/projects/gdb/sys/dev/cx/if_cx.c#13 integrate
.. //depot/projects/gdb/sys/dev/cy/cy.c#12 integrate
.. //depot/projects/gdb/sys/dev/digi/digi.c#12 integrate
.. //depot/projects/gdb/sys/dev/digi/digi.h#4 integrate
.. //depot/projects/gdb/sys/dev/fdc/fdc_pccard.c#2 integrate
.. //depot/projects/gdb/sys/dev/rc/rc.c#11 integrate
.. //depot/projects/gdb/sys/dev/rp/rp.c#8 integrate
.. //depot/projects/gdb/sys/dev/rp/rpvar.h#2 integrate
.. //depot/projects/gdb/sys/dev/si/si.c#9 integrate
.. //depot/projects/gdb/sys/dev/si/si.h#3 integrate
.. //depot/projects/gdb/sys/dev/sio/sio.c#20 integrate
.. //depot/projects/gdb/sys/dev/sx/sx.c#8 integrate
.. //depot/projects/gdb/sys/dev/sx/sx.h#3 integrate
.. //depot/projects/gdb/sys/doc/Doxyfile#1 branch
.. //depot/projects/gdb/sys/doc/Makefile#1 branch
.. //depot/projects/gdb/sys/i386/isa/clock.c#13 integrate
.. //depot/projects/gdb/sys/kern/device_if.m#2 integrate
.. //depot/projects/gdb/sys/kern/subr_kdb.c#19 integrate
.. //depot/projects/gdb/sys/kern/tty.c#13 integrate
.. //depot/projects/gdb/sys/pc98/conf/GENERIC#8 integrate
.. //depot/projects/gdb/sys/pc98/pc98/clock.c#6 integrate
.. //depot/projects/gdb/sys/pc98/pc98/sio.c#17 integrate
.. //depot/projects/gdb/sys/sys/param.h#19 integrate
.. //depot/projects/gdb/sys/sys/sx.h#3 integrate
.. //depot/projects/gdb/sys/sys/tty.h#12 integrate
.. //depot/projects/gdb/sys/tools/makeobjops.awk#3 integrate
.. //depot/projects/gdb/usr.bin/split/split.1#2 integrate
.. //depot/projects/gdb/usr.bin/split/split.c#2 integrate
Differences ...
==== //depot/projects/gdb/UPDATING#21 (text+ko) ====
@@ -17,6 +17,36 @@
developers choose to disable these features on build machines
to maximize performance.
+20040710:
+ __FreeBSD_version bumped to 502122.
+
+20040710:
+ The console initialization on Alpha has been reworked and is now
+ identical to other platforms. This means that the hardcoding of
+ the serial console and the debug port has been removed. As such,
+ hints are now required for the sio(4) driver to become a console
+ or debug port. The NO_SIO option has been decommissioned because
+ of this.
+
+20040710:
+ A revamp of the debugging code in the kernel with some visible
+ changes beyond just the debugging experience:
+ o The DDB option is now specific to the DDB debugger backend
+ and should not be used any more for conditional compilation
+ of debugging code for when debugging is enabled. Use the KDB
+ option for this.
+ o The WITNESS_DDB, DDB_TRACE and DDB_UNATTENDED options have
+ been renamed to WITNESS_KDB, KDB_TRACE and KDB_UNATTENDED
+ respectively. This is in line with the first bullet.
+ o The remote GDB support has been untangled from DDB and needs
+ to be enabled seperately now. Use the GDB option for this.
+ o The GDB_REMOTE_CHAT option has been removed. Support for this
+ homegrown feature is discontinued. The GDB remote protocol
+ supports console output and it makes sense to use that.
+ o The DDB_NOKLDSYM option has been removed. The DDB debugger
+ now supports both direct symbol table lookups as well as KLD
+ symbol lookups through the linker.
+
20040708:
Bluetooth code has been marked as non-i386 specific.
__FreeBSD_version has been bumped to 502121 to mark this change.
@@ -24,7 +54,7 @@
20040702:
The native preemption has been added to the kernel scheduler.
There is some report that ULE scheduler was broken in some
- machines and we encourage users using ULE schedluer either
+ machines and we encourage users using ULE scheduler either
stick with an known good kernel, or temporary switch to 4BSD
scheduler as a workaround.
@@ -1684,4 +1714,4 @@
Contact Warner Losh if you have any questions about your use of
this document.
-$FreeBSD: src/UPDATING,v 1.323 2004/07/09 16:57:24 emax Exp $
+$FreeBSD: src/UPDATING,v 1.325 2004/07/11 13:26:44 simon Exp $
==== //depot/projects/gdb/games/bcd/Makefile#2 (text+ko) ====
@@ -1,7 +1,8 @@
# @(#)Makefile 8.1 (Berkeley) 5/31/93
-# $FreeBSD: src/games/bcd/Makefile,v 1.5 2001/03/26 14:20:54 ru Exp $
+# $FreeBSD: src/games/bcd/Makefile,v 1.6 2004/07/11 17:26:18 stefanf Exp $
PROG= bcd
+WARNS?= 6
MAN= bcd.6
MLINKS= bcd.6 ppt.6
==== //depot/projects/gdb/games/bcd/bcd.c#2 (text+ko) ====
@@ -45,7 +45,7 @@
static char sccsid[] = "@(#)bcd.c 8.2 (Berkeley) 3/20/94";
#endif
static const char rcsid[] =
- "$FreeBSD: src/games/bcd/bcd.c,v 1.8 1999/11/30 03:48:41 billf Exp $";
+ "$FreeBSD: src/games/bcd/bcd.c,v 1.9 2004/07/11 17:26:18 stefanf Exp $";
#endif /* not lint */
/*
@@ -80,9 +80,11 @@
#include <sys/types.h>
+#include <ctype.h>
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
-#include <ctype.h>
+#include <unistd.h>
u_short holes[256] = {
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
@@ -119,15 +121,15 @@
0x202, 0x201, 0x082, 0x806, 0x822, 0x600, 0x282, 0x0
};
+void printcard(char *);
+
/*
* i'th bit of w.
*/
#define bit(w,i) ((w)&(1<<(i)))
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char **argv)
{
char cardline[80];
@@ -150,16 +152,15 @@
#define COLUMNS 48
-printcard(str)
- char *str;
+void
+printcard(char *str)
{
static char rowchars[] = " 123456789";
int i, row;
char *p;
- char *index();
/* ruthlessly remove newlines and truncate at 48 characters. */
- if ((p = index(str, '\n')))
+ if ((p = strchr(str, '\n')))
*p = '\0';
if (strlen(str) > COLUMNS)
@@ -183,7 +184,7 @@
p = str;
putchar('/');
for (i = 1; *p; i++, p++)
- if (holes[*p])
+ if (holes[(unsigned char)*p])
putchar(*p);
else
putchar(' ');
@@ -201,7 +202,7 @@
for (row = 0; row <= 11; ++row) {
putchar('|');
for (i = 0, p = str; *p; i++, p++) {
- if (bit(holes[*p], 11 - row))
+ if (bit(holes[(unsigned char)*p], 11 - row))
putchar(']');
else
putchar(rowchars[row]);
==== //depot/projects/gdb/lib/libc/regex/regcomp.c#2 (text+ko) ====
@@ -41,7 +41,7 @@
static char sccsid[] = "@(#)regcomp.c 8.5 (Berkeley) 3/20/94";
#endif /* LIBC_SCCS and not lint */
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/regex/regcomp.c,v 1.30 2003/02/16 17:29:10 nectar Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/regex/regcomp.c,v 1.31 2004/07/11 05:58:31 tjr Exp $");
#include <sys/types.h>
#include <stdio.h>
@@ -106,17 +106,6 @@
static int freezeset(struct parse *p, cset *cs);
static int firstch(struct parse *p, cset *cs);
static int nch(struct parse *p, cset *cs);
-static void mcadd(struct parse *p, cset *cs, char *cp) __unused;
-#if used
-static void mcsub(cset *cs, char *cp);
-static int mcin(cset *cs, char *cp);
-static char *mcfind(cset *cs, char *cp);
-#endif
-static void mcinvert(struct parse *p, cset *cs);
-static void mccase(struct parse *p, cset *cs);
-static int isinsets(struct re_guts *g, int c);
-static int samesets(struct re_guts *g, int c1, int c2);
-static void categorize(struct parse *p, struct re_guts *g);
static sopno dupl(struct parse *p, sopno start, sopno finish);
static void doemit(struct parse *p, sop op, size_t opnd);
static void doinsert(struct parse *p, sop op, size_t opnd, sopno pos);
@@ -124,7 +113,7 @@
static void enlarge(struct parse *p, sopno size);
static void stripsnug(struct parse *p, struct re_guts *g);
static void findmust(struct parse *p, struct re_guts *g);
-static int altoffset(sop *scan, int offset, int mccs);
+static int altoffset(sop *scan, int offset);
static void computejumps(struct parse *p, struct re_guts *g);
static void computematchjumps(struct parse *p, struct re_guts *g);
static sopno pluscount(struct parse *p, struct re_guts *g);
@@ -216,8 +205,7 @@
len = strlen((char *)pattern);
/* do the mallocs early so failure handling is easy */
- g = (struct re_guts *)malloc(sizeof(struct re_guts) +
- (NC-1)*sizeof(cat_t));
+ g = (struct re_guts *)malloc(sizeof(struct re_guts));
if (g == NULL)
return(REG_ESPACE);
p->ssize = len/(size_t)2*(size_t)3 + (size_t)1; /* ugh */
@@ -252,9 +240,6 @@
g->matchjump = NULL;
g->mlen = 0;
g->nsub = 0;
- g->ncategories = 1; /* category 0 is "everything else" */
- g->categories = &g->catspace[-(CHAR_MIN)];
- (void) memset((char *)g->catspace, 0, NC*sizeof(cat_t));
g->backrefs = 0;
/* do it */
@@ -270,7 +255,6 @@
g->laststate = THERE();
/* tidy up loose ends and fill things in */
- categorize(p, g);
stripsnug(p, g);
findmust(p, g);
/* only use Boyer-Moore algorithm if the pattern is bigger
@@ -516,9 +500,7 @@
* Giving end1 as OUT essentially eliminates the end1/end2 check.
*
* This implementation is a bit of a kludge, in that a trailing $ is first
- * taken as an ordinary character and then revised to be an anchor. The
- * only undesirable side effect is that '$' gets included as a character
- * category in such cases. This is fairly harmless; not worth fixing.
+ * taken as an ordinary character and then revised to be an anchor.
* The amount of lookahead needed to avoid this kludge is excessive.
*/
static void
@@ -739,8 +721,6 @@
if (ci != i)
CHadd(cs, ci);
}
- if (cs->multis != NULL)
- mccase(p, cs);
}
if (invert) {
int i;
@@ -752,12 +732,8 @@
CHadd(cs, i);
if (p->g->cflags®_NEWLINE)
CHsub(cs, '\n');
- if (cs->multis != NULL)
- mcinvert(p, cs);
}
- assert(cs->multis == NULL); /* xxx */
-
if (nch(p, cs) == 1) { /* optimize singleton sets */
ordinary(p, firstch(p, cs));
freeset(p, cs);
@@ -812,7 +788,6 @@
(void)REQUIRE(EATTWO('=', ']'), REG_ECOLLATE);
break;
default: /* symbol, ordinary character, or range */
-/* xxx revision needed for multichar stuff */
start = p_b_symbol(p);
if (SEE('-') && MORE2() && PEEK2() != ']') {
/* range */
@@ -932,10 +907,6 @@
CHadd(cs, c);
break;
}
-#if 0
- for (u = cp->multis; *u != '\0'; u += strlen(u) + 1)
- MCadd(p, cs, u);
-#endif
}
/*
@@ -1059,15 +1030,11 @@
struct parse *p;
int ch;
{
- cat_t *cap = p->g->categories;
if ((p->g->cflags®_ICASE) && isalpha((uch)ch) && othercase(ch) != ch)
bothcases(p, ch);
- else {
+ else
EMIT(OCHAR, (uch)ch);
- if (cap[ch] == 0)
- cap[ch] = p->g->ncategories++;
- }
}
/*
@@ -1233,8 +1200,6 @@
cs->ptr = p->g->setbits + css*((no)/CHAR_BIT);
cs->mask = 1 << ((no) % CHAR_BIT);
cs->hash = 0;
- cs->smultis = 0;
- cs->multis = NULL;
return(cs);
}
@@ -1337,193 +1302,6 @@
}
/*
- - mcadd - add a collating element to a cset
- == static void mcadd(struct parse *p, cset *cs, \
- == char *cp);
- */
-static void
-mcadd(p, cs, cp)
-struct parse *p;
-cset *cs;
-char *cp;
-{
- size_t oldend = cs->smultis;
-
- cs->smultis += strlen(cp) + 1;
- if (cs->multis == NULL)
- cs->multis = malloc(cs->smultis);
- else
- cs->multis = reallocf(cs->multis, cs->smultis);
- if (cs->multis == NULL) {
- SETERROR(REG_ESPACE);
- return;
- }
-
- (void) strcpy(cs->multis + oldend - 1, cp);
- cs->multis[cs->smultis - 1] = '\0';
-}
-
-#if used
-/*
- - mcsub - subtract a collating element from a cset
- == static void mcsub(cset *cs, char *cp);
- */
-static void
-mcsub(cs, cp)
-cset *cs;
-char *cp;
-{
- char *fp = mcfind(cs, cp);
- size_t len = strlen(fp);
-
- assert(fp != NULL);
- (void) memmove(fp, fp + len + 1,
- cs->smultis - (fp + len + 1 - cs->multis));
- cs->smultis -= len;
-
- if (cs->smultis == 0) {
- free(cs->multis);
- cs->multis = NULL;
- return;
- }
-
- cs->multis = reallocf(cs->multis, cs->smultis);
- assert(cs->multis != NULL);
-}
-
-/*
- - mcin - is a collating element in a cset?
- == static int mcin(cset *cs, char *cp);
- */
-static int
-mcin(cs, cp)
-cset *cs;
-char *cp;
-{
- return(mcfind(cs, cp) != NULL);
-}
-
-/*
- - mcfind - find a collating element in a cset
- == static char *mcfind(cset *cs, char *cp);
- */
-static char *
-mcfind(cs, cp)
-cset *cs;
-char *cp;
-{
- char *p;
-
- if (cs->multis == NULL)
- return(NULL);
- for (p = cs->multis; *p != '\0'; p += strlen(p) + 1)
- if (strcmp(cp, p) == 0)
- return(p);
- return(NULL);
-}
-#endif
-
-/*
- - mcinvert - invert the list of collating elements in a cset
- == static void mcinvert(struct parse *p, cset *cs);
- *
- * This would have to know the set of possibilities. Implementation
- * is deferred.
- */
-static void
-mcinvert(p, cs)
-struct parse *p;
-cset *cs;
-{
- assert(cs->multis == NULL); /* xxx */
-}
-
-/*
- - mccase - add case counterparts of the list of collating elements in a cset
- == static void mccase(struct parse *p, cset *cs);
- *
- * This would have to know the set of possibilities. Implementation
- * is deferred.
- */
-static void
-mccase(p, cs)
-struct parse *p;
-cset *cs;
-{
- assert(cs->multis == NULL); /* xxx */
-}
-
-/*
- - isinsets - is this character in any sets?
- == static int isinsets(struct re_guts *g, int c);
- */
-static int /* predicate */
-isinsets(g, c)
-struct re_guts *g;
-int c;
-{
- uch *col;
- int i;
- int ncols = (g->ncsets+(CHAR_BIT-1)) / CHAR_BIT;
- unsigned uc = (uch)c;
-
- for (i = 0, col = g->setbits; i < ncols; i++, col += g->csetsize)
- if (col[uc] != 0)
- return(1);
- return(0);
-}
-
-/*
- - samesets - are these two characters in exactly the same sets?
- == static int samesets(struct re_guts *g, int c1, int c2);
- */
-static int /* predicate */
-samesets(g, c1, c2)
-struct re_guts *g;
-int c1;
-int c2;
-{
- uch *col;
- int i;
- int ncols = (g->ncsets+(CHAR_BIT-1)) / CHAR_BIT;
- unsigned uc1 = (uch)c1;
- unsigned uc2 = (uch)c2;
-
- for (i = 0, col = g->setbits; i < ncols; i++, col += g->csetsize)
- if (col[uc1] != col[uc2])
- return(0);
- return(1);
-}
-
-/*
- - categorize - sort out character categories
- == static void categorize(struct parse *p, struct re_guts *g);
- */
-static void
-categorize(p, g)
-struct parse *p;
-struct re_guts *g;
-{
- cat_t *cats = g->categories;
- int c;
- int c2;
- cat_t cat;
-
- /* avoid making error situations worse */
- if (p->error != 0)
- return;
-
- for (c = CHAR_MIN; c <= CHAR_MAX; c++)
- if (cats[c] == 0 && isinsets(g, c)) {
- cat = g->ncategories++;
- cats[c] = cat;
- for (c2 = c+1; c2 <= CHAR_MAX; c2++)
- if (cats[c2] == 0 && samesets(g, c, c2))
- cats[c2] = cat;
- }
-}
-
-/*
- dupl - emit a duplicate of a bunch of sops
== static sopno dupl(struct parse *p, sopno start, sopno finish);
*/
@@ -1698,18 +1476,11 @@
char *cp;
sopno i;
int offset;
- int cs, mccs;
/* avoid making error situations worse */
if (p->error != 0)
return;
- /* Find out if we can handle OANYOF or not */
- mccs = 0;
- for (cs = 0; cs < g->ncsets; cs++)
- if (g->sets[cs].multis != NULL)
- mccs = 1;
-
/* find the longest OCHAR sequence in strip */
newlen = 0;
offset = 0;
@@ -1729,7 +1500,7 @@
break;
case OQUEST_: /* things that must be skipped */
case OCH_:
- offset = altoffset(scan, offset, mccs);
+ offset = altoffset(scan, offset);
scan--;
do {
scan += OPND(s);
@@ -1797,11 +1568,6 @@
if (offset > -1)
offset++;
newlen = 0;
- /* And, now, if we found out we can't deal with
- * it, make offset = -1.
- */
- if (mccs)
- offset = -1;
break;
default:
/* Anything here makes it impossible or too hard
@@ -1849,16 +1615,15 @@
/*
- altoffset - choose biggest offset among multiple choices
- == static int altoffset(sop *scan, int offset, int mccs);
+ == static int altoffset(sop *scan, int offset);
*
* Compute, recursively if necessary, the largest offset among multiple
* re paths.
*/
static int
-altoffset(scan, offset, mccs)
+altoffset(scan, offset)
sop *scan;
int offset;
-int mccs;
{
int largest;
int try;
@@ -1880,7 +1645,7 @@
break;
case OQUEST_:
case OCH_:
- try = altoffset(scan, try, mccs);
+ try = altoffset(scan, try);
if (try == -1)
return -1;
scan--;
@@ -1897,8 +1662,6 @@
scan++;
break;
case OANYOF:
- if (mccs)
- return -1;
case OCHAR:
case OANY:
try++;
==== //depot/projects/gdb/lib/libc/regex/regex2.h#2 (text+ko) ====
@@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* @(#)regex2.h 8.4 (Berkeley) 3/20/94
- * $FreeBSD: src/lib/libc/regex/regex2.h,v 1.6 2002/03/22 23:41:56 obrien Exp $
+ * $FreeBSD: src/lib/libc/regex/regex2.h,v 1.7 2004/07/11 05:58:31 tjr Exp $
*/
/*
@@ -113,29 +113,16 @@
* The individual set therefore has both a pointer to the byte vector
* and a mask to pick out the relevant bit of each byte. A hash code
* simplifies testing whether two sets could be identical.
- *
- * This will get trickier for multicharacter collating elements. As
- * preliminary hooks for dealing with such things, we also carry along
- * a string of multi-character elements, and decide the size of the
- * vectors at run time.
*/
typedef struct {
uch *ptr; /* -> uch [csetsize] */
uch mask; /* bit within array */
short hash; /* hash code */
- size_t smultis;
- char *multis; /* -> char[smulti] ab\0cd\0ef\0\0 */
} cset;
/* note that CHadd and CHsub are unsafe, and CHIN doesn't yield 0/1 */
#define CHadd(cs, c) ((cs)->ptr[(uch)(c)] |= (cs)->mask, (cs)->hash += (uch)(c))
#define CHsub(cs, c) ((cs)->ptr[(uch)(c)] &= ~(cs)->mask, (cs)->hash -= (uch)(c))
#define CHIN(cs, c) ((cs)->ptr[(uch)(c)] & (cs)->mask)
-#define MCadd(p, cs, cp) mcadd(p, cs, cp) /* regcomp() internal fns */
-#define MCsub(p, cs, cp) mcsub(p, cs, cp)
-#define MCin(p, cs, cp) mcin(p, cs, cp)
-
-/* stuff for character categories */
-typedef unsigned char cat_t;
/*
* main compiled-expression structure
@@ -158,8 +145,6 @@
# define BAD 04 /* something wrong */
int nbol; /* number of ^ used */
int neol; /* number of $ used */
- int ncategories; /* how many character categories */
- cat_t *categories; /* ->catspace[-CHAR_MIN] */
char *must; /* match must contain this string */
int moffset; /* latest point at which must may be located */
int *charjump; /* Boyer-Moore char jump table */
@@ -168,8 +153,6 @@
size_t nsub; /* copy of re_nsub */
int backrefs; /* does it use back references? */
sopno nplus; /* how deep does it nest +s? */
- /* catspace must be last */
- cat_t catspace[1]; /* actually [NC] */
};
/* misc utilities */
==== //depot/projects/gdb/share/man/man9/sx.9#5 (text+ko) ====
@@ -24,7 +24,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
.\" DAMAGE.
.\"
-.\" $FreeBSD: src/share/man/man9/sx.9,v 1.28 2004/06/16 08:33:57 ru Exp $
+.\" $FreeBSD: src/share/man/man9/sx.9,v 1.29 2004/07/11 16:08:25 darrenr Exp $
.\"
.Dd August 14, 2001
.Dt SX 9
@@ -42,6 +42,7 @@
.Nm sx_try_upgrade ,
.Nm sx_downgrade ,
.Nm sx_assert ,
+.Nm sx_unlock ,
.Nm SX_SYSINIT
.Nd kernel shared/exclusive lock
.Sh SYNOPSIS
@@ -68,13 +69,16 @@
.Fn sx_try_upgrade "struct sx *sx"
.Ft void
.Fn sx_downgrade "struct sx *sx"
-.Pp
-.Cd "options INVARIANTS"
-.Cd "options INVARIANT_SUPPORT"
.Ft void
.Fn sx_assert "struct sx *sx" "int what"
-.In sys/kernel.h
+.\"
+.Ss sx utility macros
+.Fn sx_unlock "struct sx *sx"
.Fn SX_SYSINIT "name" "struct sx *sx" "const char *description"
+.\"
+.Ss Kernel options
+.Cd "options INVARIANTS"
+.Cd "options INVARIANT_SUPPORT"
.Sh DESCRIPTION
Shared/exclusive locks are used to protect data that are read far more often
than they are written.
@@ -98,13 +102,17 @@
or
.Fn sx_try_slock
and
-.Fn sx_sunlock .
+.Fn sx_sunlock
+or
+.Fn sx_unlock .
Threads acquire and release an exclusive lock by calling
.Fn sx_xlock
or
.Fn sx_try_xlock
and
-.Fn sx_xunlock .
+.Fn sx_xunlock
+or
+.Fn sx_unlock .
A thread can attempt to upgrade a currently held shared lock to an exclusive
lock by calling
.Fn sx_try_upgrade .
@@ -158,6 +166,15 @@
by the first argument.
.El
.Pp
+For ease of programming,
+.Fn sx_unlock
+is provided as a macro frontend to the respective functions,
+.Fn sx_sunlock
+and
+.Fn sx_xunlock .
+Algorithms that are aware of what state the lock is in should use either
+of the two specific functions for a minor performance benefit.
+.Pp
The
.Fn SX_SYSINIT
macro is used to generate a call to the
==== //depot/projects/gdb/sys/amd64/isa/clock.c#7 (text+ko) ====
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/isa/clock.c,v 1.212 2004/07/10 22:42:22 marcel Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/isa/clock.c,v 1.213 2004/07/11 18:07:55 marcel Exp $");
/*
* Routines to handle clock hardware.
@@ -53,8 +53,8 @@
#include <sys/systm.h>
#include <sys/bus.h>
#include <sys/lock.h>
+#include <sys/kdb.h>
#include <sys/mutex.h>
-#include <sys/kdb.h>
#include <sys/proc.h>
#include <sys/time.h>
#include <sys/timetc.h>
@@ -293,8 +293,18 @@
* takes about 1.5 usec for each of the i/o's in getit(). The loop
* takes about 6 usec on a 486/33 and 13 usec on a 386/20. The
* multiplications and divisions to scale the count take a while).
+ *
+ * However, if ddb is active then use a fake counter since reading
+ * the i8254 counter involves acquiring a lock. ddb must not go
+ * locking for many reasons, but it calls here for at least atkbd
+ * input.
*/
- prev_tick = getit();
+#ifdef KDB
+ if (kdb_active)
+ prev_tick = 1;
+ else
+#endif
+ prev_tick = getit();
n -= 0; /* XXX actually guess no initial overhead */
/*
* Calculate (n * (timer_freq / 1e6)) without using floating point
@@ -321,7 +331,15 @@
/ 1000000;
while (ticks_left > 0) {
- tick = getit();
+#ifdef KDB
+ if (kdb_active) {
+ inb(0x84);
+ tick = prev_tick - 1;
+ if (tick <= 0)
+ tick = timer0_max_count;
+ } else
+#endif
+ tick = getit();
#ifdef DELAYDEBUG
++getit_calls;
#endif
@@ -366,17 +384,10 @@
splx(x);
return (-1); /* XXX Should be EBUSY, but nobody cares anyway. */
}
-#ifdef KDB
- if (!kdb_active)
-#endif
- mtx_lock_spin(&clock_lock);
+ mtx_lock_spin(&clock_lock);
outb(TIMER_CNTR2, pitch);
outb(TIMER_CNTR2, (pitch>>8));
-#ifdef KDB
- if (!kdb_active)
-#endif
- mtx_unlock_spin(&clock_lock);
-
+ mtx_unlock_spin(&clock_lock);
if (!beeping) {
/* enable counter2 output to speaker */
outb(IO_PPI, inb(IO_PPI) | 3);
==== //depot/projects/gdb/sys/contrib/ipfilter/netinet/ip_fil.c#5 (text+ko) ====
@@ -131,7 +131,7 @@
#if !defined(lint)
static const char sccsid[] = "@(#)ip_fil.c 2.41 6/5/96 (C) 1993-2000 Darren Reed";
/* static const char rcsid[] = "@(#)$Id: ip_fil.c,v 2.42.2.34 2001/07/23 13:49:57 darrenr Exp $"; */
-static const char rcsid[] = "@(#)$FreeBSD: src/sys/contrib/ipfilter/netinet/ip_fil.c,v 1.46 2004/06/22 02:44:06 darrenr Exp $";
+static const char rcsid[] = "@(#)$FreeBSD: src/sys/contrib/ipfilter/netinet/ip_fil.c,v 1.47 2004/07/11 10:13:05 darrenr Exp $";
#endif
extern struct protosw inetsw[];
@@ -168,7 +168,7 @@
# endif
# ifdef __sgi
extern int tcp_mtudisc;
-extern kmutex_t ipf_rw;
+extern kmutex_t ipf_rw;
extern KRWLOCK_T ipf_mutex;
# endif
#else
@@ -206,8 +206,6 @@
defined(_KERNEL)
# include <sys/conf.h>
const struct cdevsw ipl_cdevsw = {
- .d_version = D_VERSION,
- .d_flags = D_NEEDGIANT,
iplopen, iplclose, iplread, nowrite, iplioctl,
nostop, notty, nopoll, nommap,
};
@@ -229,8 +227,9 @@
};
#endif /* _BSDI_VERSION >= 199510 && _KERNEL */
-#if defined(__NetBSD__) || defined(__OpenBSD__) || \
- (_BSDI_VERSION >= 199701) || (__FreeBSD_version >= 500011)
+#if defined(__NetBSD__) || defined(__OpenBSD__) || \
+ (_BSDI_VERSION >= 199701) || \
+ ((__FreeBSD_version >= 500011) && defined(_KERNEL))
# include <sys/conf.h>
# if defined(NETBSD_PF)
# include <net/pfil.h>
@@ -328,7 +327,7 @@
fr_check_wrapper6(void *arg, struct mbuf **mp, struct ifnet *ifp, int dir)
{
return (fr_check(mtod(*mp, struct ip *), sizeof(struct ip6_hdr),
- ifp, (dir == PFIL_OUT), mp));
+ ifp, (dir == PFIL_OUT), mp));
}
# endif
#endif /* __FreeBSD_version >= 501108 */
@@ -535,7 +534,7 @@
((__NetBSD_Version__ >= 104200000) || (__FreeBSD_version >= 500011))
int error = 0;
# if (__NetBSD_Version__ >= 105150000) || (__FreeBSD_version >= 501108)
- struct pfil_head *ph_inet = pfil_head_get(PFIL_TYPE_AF, AF_INET);
+ struct pfil_head *ph_inet = pfil_head_get(PFIL_TYPE_AF, AF_INET);
# ifdef USE_INET6
struct pfil_head *ph_inet6 = pfil_head_get(PFIL_TYPE_AF, AF_INET6);
# endif
@@ -2232,8 +2231,8 @@
int fd;
# if (defined(NetBSD) && (NetBSD <= 1991011) && (NetBSD >= 199606)) || \
- (defined(OpenBSD) && (OpenBSD >= 199603)) || \
- (defined(__FreeBSD__) && (__FreeBSD_version >= 501113))
+ (defined(OpenBSD) && (OpenBSD >= 199603)) || \
+ (defined(__FreeBSD__) && (__FreeBSD_version >= 501113))
for (ifa = ifneta; ifa && (ifp = *ifa); ifa++) {
ifp->if_output = write_output;
sprintf(fname, "/tmp/%s", ifp->if_xname);
==== //depot/projects/gdb/sys/dev/cx/if_cx.c#13 (text+ko) ====
@@ -23,7 +23,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/cx/if_cx.c,v 1.25 2004/06/28 16:17:10 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/cx/if_cx.c,v 1.26 2004/07/11 15:18:37 phk Exp $");
#include <sys/param.h>
@@ -160,14 +160,11 @@
cx_dma_mem_t dmamem;
struct tty *tty;
struct callout_handle dcd_timeout_handle;
- unsigned dtrwait;
- unsigned dtroff;
unsigned callout;
unsigned lock;
int open_dev;
int cd;
int running;
- struct callout_handle dtr_timeout_handle;
#ifdef NETGRAPH
char nodename [NG_NODELEN+1];
hook_p hook;
@@ -217,7 +214,6 @@
static void cx_oproc (struct tty *tp);
static int cx_param (struct tty *tp, struct termios *t);
static void cx_stop (struct tty *tp, int flag);
-static void cx_dtrwakeup (void *a);
static void cx_receive (cx_chan_t *c, char *data, int len);
static void cx_transmit (cx_chan_t *c, void *attachment, int len);
static void cx_error (cx_chan_t *c, int data);
@@ -817,7 +813,6 @@
sprintf (d->name, "cx%d.%d", b->num, c->num);
d->board = b;
d->chan = c;
- d->dtrwait = 3 * hz; /* Default DTR off timeout is 3 seconds. */
d->open_dev = 0;
c->sys = d;
@@ -940,8 +935,6 @@
if (!d || d->chan->type == T_NONE)
continue;
- if (d->dtr_timeout_handle.callout)
- untimeout (cx_dtrwakeup, d, d->dtr_timeout_handle);
if (d->dcd_timeout_handle.callout)
untimeout (cx_carrier, c, d->dcd_timeout_handle);
}
@@ -1518,12 +1511,9 @@
dev->si_tty = d->tty;
d->tty->t_dev = dev;
again:
- if (d->dtroff) {
- error = tsleep (&d->dtrwait, TTIPRI | PCATCH, "cxdtr", 0);
- if (error)
- return error;
- goto again;
- }
+ error = ttydtrwaitsleep(d->tty);
+ if (error)
+ return error;
if ((d->tty->t_state & TS_ISOPEN) && (d->tty->t_state & TS_XCLUDE) &&
#if __FreeBSD_version >= 500000
@@ -1608,11 +1598,7 @@
splhigh ();
cx_set_dtr (d->chan, 0);
cx_set_rts (d->chan, 0);
- if (d->dtrwait) {
- d->dtr_timeout_handle =
- timeout (cx_dtrwakeup, d, d->dtrwait);
- d->dtroff = 1;
- }
+ ttydtrwaitstart(d->tty);
spl0 ();
}
return error;
@@ -1652,11 +1638,7 @@
if ((d->tty->t_cflag & HUPCL) || ! (d->tty->t_state & TS_ISOPEN)) {
cx_set_dtr (d->chan, 0);
cx_set_rts (d->chan, 0);
- if (d->dtrwait) {
- d->dtr_timeout_handle =
- timeout (cx_dtrwakeup, d, d->dtrwait);
- d->dtroff = 1;
- }
+ ttydtrwaitstart(d->tty);
}
ttyclose (d->tty);
splx (s);
@@ -2139,48 +2121,11 @@
*(int*)data = cx_modem_status (d);
return 0;
-#ifdef TIOCMSDTRWAIT
- case TIOCMSDTRWAIT:
- CX_DEBUG2 (d, ("ioctl: tiocmsdtrwait\n"));
- /* Only for superuser! */
-#if __FreeBSD_version < 500000
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list