svn commit: r201065 - in user/luigi/ipfw3-head: bin/sh contrib/top
release/picobsd/build release/picobsd/floppy.tree/etc
release/picobsd/floppy.tree/sbin release/picobsd/qemu
sys/conf sys/sparc64/p...
Luigi Rizzo
luigi at FreeBSD.org
Sun Dec 27 22:34:32 UTC 2009
Author: luigi
Date: Sun Dec 27 22:34:31 2009
New Revision: 201065
URL: http://svn.freebsd.org/changeset/base/201065
Log:
Merging r201049 through r201063 from HEAD
Added:
user/luigi/ipfw3-head/release/picobsd/floppy.tree/sbin/
user/luigi/ipfw3-head/release/picobsd/qemu/
- copied from r201063, head/release/picobsd/qemu/
user/luigi/ipfw3-head/sys/sparc64/pci/fire.c
- copied unchanged from r201063, head/sys/sparc64/pci/fire.c
user/luigi/ipfw3-head/sys/sparc64/pci/firereg.h
- copied unchanged from r201063, head/sys/sparc64/pci/firereg.h
user/luigi/ipfw3-head/sys/sparc64/pci/firevar.h
- copied unchanged from r201063, head/sys/sparc64/pci/firevar.h
Modified:
user/luigi/ipfw3-head/bin/sh/arith.y
user/luigi/ipfw3-head/bin/sh/cd.c
user/luigi/ipfw3-head/bin/sh/eval.c
user/luigi/ipfw3-head/bin/sh/eval.h
user/luigi/ipfw3-head/bin/sh/exec.c
user/luigi/ipfw3-head/bin/sh/expand.c
user/luigi/ipfw3-head/bin/sh/histedit.c
user/luigi/ipfw3-head/bin/sh/input.c
user/luigi/ipfw3-head/bin/sh/jobs.c
user/luigi/ipfw3-head/bin/sh/main.c
user/luigi/ipfw3-head/bin/sh/miscbltin.c
user/luigi/ipfw3-head/bin/sh/mkbuiltins
user/luigi/ipfw3-head/bin/sh/mkinit.c
user/luigi/ipfw3-head/bin/sh/mksyntax.c
user/luigi/ipfw3-head/bin/sh/mystring.c
user/luigi/ipfw3-head/bin/sh/options.c
user/luigi/ipfw3-head/bin/sh/options.h
user/luigi/ipfw3-head/bin/sh/parser.c
user/luigi/ipfw3-head/bin/sh/parser.h
user/luigi/ipfw3-head/bin/sh/var.c
user/luigi/ipfw3-head/bin/sh/var.h
user/luigi/ipfw3-head/release/picobsd/build/mfs.mtree
user/luigi/ipfw3-head/release/picobsd/build/picobsd
user/luigi/ipfw3-head/release/picobsd/floppy.tree/etc/master.passwd
user/luigi/ipfw3-head/sys/conf/options.sparc64
user/luigi/ipfw3-head/usr.sbin/rwhod/Makefile
user/luigi/ipfw3-head/usr.sbin/rwhod/rwhod.c
user/luigi/ipfw3-head/usr.sbin/ypserv/ypinit.sh
Directory Properties:
user/luigi/ipfw3-head/ (props changed)
user/luigi/ipfw3-head/cddl/contrib/opensolaris/ (props changed)
user/luigi/ipfw3-head/contrib/bind9/ (props changed)
user/luigi/ipfw3-head/contrib/cpio/ (props changed)
user/luigi/ipfw3-head/contrib/csup/ (props changed)
user/luigi/ipfw3-head/contrib/ee/ (props changed)
user/luigi/ipfw3-head/contrib/expat/ (props changed)
user/luigi/ipfw3-head/contrib/file/ (props changed)
user/luigi/ipfw3-head/contrib/gdb/ (props changed)
user/luigi/ipfw3-head/contrib/gdtoa/ (props changed)
user/luigi/ipfw3-head/contrib/less/ (props changed)
user/luigi/ipfw3-head/contrib/libpcap/ (props changed)
user/luigi/ipfw3-head/contrib/ncurses/ (props changed)
user/luigi/ipfw3-head/contrib/netcat/ (props changed)
user/luigi/ipfw3-head/contrib/ntp/ (props changed)
user/luigi/ipfw3-head/contrib/openbsm/ (props changed)
user/luigi/ipfw3-head/contrib/openpam/ (props changed)
user/luigi/ipfw3-head/contrib/pf/ (props changed)
user/luigi/ipfw3-head/contrib/sendmail/ (props changed)
user/luigi/ipfw3-head/contrib/tcpdump/ (props changed)
user/luigi/ipfw3-head/contrib/tcsh/ (props changed)
user/luigi/ipfw3-head/contrib/top/ (props changed)
user/luigi/ipfw3-head/contrib/top/install-sh (props changed)
user/luigi/ipfw3-head/contrib/wpa/ (props changed)
user/luigi/ipfw3-head/crypto/openssh/ (props changed)
user/luigi/ipfw3-head/crypto/openssl/ (props changed)
user/luigi/ipfw3-head/lib/libc/ (props changed)
user/luigi/ipfw3-head/lib/libc/stdtime/ (props changed)
user/luigi/ipfw3-head/lib/libutil/ (props changed)
user/luigi/ipfw3-head/sbin/ (props changed)
user/luigi/ipfw3-head/sbin/ipfw/ (props changed)
user/luigi/ipfw3-head/share/zoneinfo/ (props changed)
user/luigi/ipfw3-head/sys/ (props changed)
user/luigi/ipfw3-head/sys/amd64/include/xen/ (props changed)
user/luigi/ipfw3-head/sys/cddl/contrib/opensolaris/ (props changed)
user/luigi/ipfw3-head/sys/contrib/dev/acpica/ (props changed)
user/luigi/ipfw3-head/sys/contrib/pf/ (props changed)
user/luigi/ipfw3-head/sys/dev/xen/xenpci/ (props changed)
user/luigi/ipfw3-head/usr.bin/csup/ (props changed)
user/luigi/ipfw3-head/usr.bin/procstat/ (props changed)
user/luigi/ipfw3-head/usr.sbin/zic/ (props changed)
Modified: user/luigi/ipfw3-head/bin/sh/arith.y
==============================================================================
--- user/luigi/ipfw3-head/bin/sh/arith.y Sun Dec 27 22:26:29 2009 (r201064)
+++ user/luigi/ipfw3-head/bin/sh/arith.y Sun Dec 27 22:34:31 2009 (r201065)
@@ -314,7 +314,7 @@ yyerror(const char *s)
int
expcmd(int argc, char **argv)
{
- char *p;
+ const char *p;
char *concat;
char **ap;
arith_t i;
Modified: user/luigi/ipfw3-head/bin/sh/cd.c
==============================================================================
--- user/luigi/ipfw3-head/bin/sh/cd.c Sun Dec 27 22:26:29 2009 (r201064)
+++ user/luigi/ipfw3-head/bin/sh/cd.c Sun Dec 27 22:34:31 2009 (r201065)
@@ -79,7 +79,7 @@ STATIC char *cdcomppath;
int
cdcmd(int argc, char **argv)
{
- char *dest;
+ const char *dest;
const char *path;
char *p;
struct stat statb;
Modified: user/luigi/ipfw3-head/bin/sh/eval.c
==============================================================================
--- user/luigi/ipfw3-head/bin/sh/eval.c Sun Dec 27 22:26:29 2009 (r201064)
+++ user/luigi/ipfw3-head/bin/sh/eval.c Sun Dec 27 22:34:31 2009 (r201065)
@@ -74,7 +74,7 @@ __FBSDID("$FreeBSD$");
#endif
-MKINIT int evalskip; /* set if we are skipping commands */
+int evalskip; /* set if we are skipping commands */
STATIC int skipcount; /* number of levels to skip */
MKINIT int loopnest; /* current loop nesting level */
int funcnest; /* depth of function calls */
@@ -407,8 +407,7 @@ evalsubshell(union node *n, int flags)
flags &=~ EV_TESTED;
redirect(n->nredir.redirect, 0);
evaltree(n->nredir.n, flags | EV_EXIT); /* never returns */
- }
- if (! backgnd) {
+ } else if (! backgnd) {
INTOFF;
exitstatus = waitforjob(jp, (int *)NULL);
INTON;
@@ -849,7 +848,7 @@ evalcommand(union node *cmd, int flags,
listsetvar(cmdenviron);
commandname = argv[0];
argptr = argv + 1;
- optptr = NULL; /* initialize nextopt */
+ nextopt_optptr = NULL; /* initialize nextopt */
builtin_flags = flags;
exitstatus = (*builtinfunc[cmdentry.u.index])(argc, argv);
flushall();
Modified: user/luigi/ipfw3-head/bin/sh/eval.h
==============================================================================
--- user/luigi/ipfw3-head/bin/sh/eval.h Sun Dec 27 22:26:29 2009 (r201064)
+++ user/luigi/ipfw3-head/bin/sh/eval.h Sun Dec 27 22:34:31 2009 (r201065)
@@ -35,6 +35,7 @@
extern char *commandname; /* currently executing command */
extern int exitstatus; /* exit status of last command */
+extern int oexitstatus; /* saved exit status */
extern struct strlist *cmdenviron; /* environment for builtin command */
Modified: user/luigi/ipfw3-head/bin/sh/exec.c
==============================================================================
--- user/luigi/ipfw3-head/bin/sh/exec.c Sun Dec 27 22:26:29 2009 (r201064)
+++ user/luigi/ipfw3-head/bin/sh/exec.c Sun Dec 27 22:34:31 2009 (r201065)
@@ -109,7 +109,7 @@ STATIC void delete_cmd_entry(void);
*/
void
-shellexec(char **argv, char **envp, const char *path, int index)
+shellexec(char **argv, char **envp, const char *path, int idx)
{
char *cmdname;
int e;
@@ -120,7 +120,7 @@ shellexec(char **argv, char **envp, cons
} else {
e = ENOENT;
while ((cmdname = padvance(&path, argv[0])) != NULL) {
- if (--index < 0 && pathopt == NULL) {
+ if (--idx < 0 && pathopt == NULL) {
tryexec(cmdname, argv, envp);
if (errno != ENOENT && errno != ENOTDIR)
e = errno;
@@ -268,17 +268,17 @@ hashcmd(int argc __unused, char **argv _
STATIC void
printentry(struct tblentry *cmdp, int verbose)
{
- int index;
+ int idx;
const char *path;
char *name;
if (cmdp->cmdtype == CMDNORMAL) {
- index = cmdp->param.index;
+ idx = cmdp->param.index;
path = pathval();
do {
name = padvance(&path, cmdp->cmdname);
stunalloc(name);
- } while (--index >= 0);
+ } while (--idx >= 0);
out1str(name);
} else if (cmdp->cmdtype == CMDBUILTIN) {
out1fmt("builtin %s", cmdp->cmdname);
@@ -314,7 +314,7 @@ find_command(const char *name, struct cm
const char *path)
{
struct tblentry *cmdp;
- int index;
+ int idx;
int prev;
char *fullname;
struct stat statb;
@@ -354,11 +354,11 @@ find_command(const char *name, struct cm
}
e = ENOENT;
- index = -1;
+ idx = -1;
loop:
while ((fullname = padvance(&path, name)) != NULL) {
stunalloc(fullname);
- index++;
+ idx++;
if (pathopt) {
if (prefix("builtin", pathopt)) {
if ((i = find_builtin(name, &spec)) < 0)
@@ -377,8 +377,8 @@ loop:
}
}
/* if rehash, don't redo absolute path names */
- if (fullname[0] == '/' && index <= prev) {
- if (index < prev)
+ if (fullname[0] == '/' && idx <= prev) {
+ if (idx < prev)
goto loop;
TRACE(("searchexec \"%s\": no change\n", name));
goto success;
@@ -415,7 +415,7 @@ loop:
INTOFF;
cmdp = cmdlookup(name, 1);
cmdp->cmdtype = CMDNORMAL;
- cmdp->param.index = index;
+ cmdp->param.index = idx;
INTON;
goto success;
}
@@ -494,18 +494,18 @@ void
changepath(const char *newval)
{
const char *old, *new;
- int index;
+ int idx;
int firstchange;
int bltin;
old = pathval();
new = newval;
firstchange = 9999; /* assume no change */
- index = 0;
+ idx = 0;
bltin = -1;
for (;;) {
if (*old != *new) {
- firstchange = index;
+ firstchange = idx;
if ((*old == '\0' && *new == ':')
|| (*old == ':' && *new == '\0'))
firstchange++;
@@ -514,9 +514,9 @@ changepath(const char *newval)
if (*new == '\0')
break;
if (*new == '%' && bltin < 0 && prefix("builtin", new + 1))
- bltin = index;
+ bltin = idx;
if (*new == ':') {
- index++;
+ idx++;
}
new++, old++;
}
@@ -724,15 +724,14 @@ typecmd_impl(int argc, char **argv, int
{
struct cmdentry entry;
struct tblentry *cmdp;
- char **pp;
+ const char *const *pp;
struct alias *ap;
int i;
- int error = 0;
- extern char *const parsekwd[];
+ int error1 = 0;
for (i = 1; i < argc; i++) {
/* First look at the keywords */
- for (pp = (char **)parsekwd; *pp; pp++)
+ for (pp = parsekwd; *pp; pp++)
if (**pp == *argv[i] && equal(*pp, argv[i]))
break;
@@ -793,7 +792,7 @@ typecmd_impl(int argc, char **argv, int
if (cmd != TYPECMD_SMALLV)
outfmt(out2, "%s: %s\n",
argv[i], strerror(errno));
- error |= 127;
+ error1 |= 127;
}
}
break;
@@ -818,11 +817,11 @@ typecmd_impl(int argc, char **argv, int
default:
if (cmd != TYPECMD_SMALLV)
outfmt(out2, "%s: not found\n", argv[i]);
- error |= 127;
+ error1 |= 127;
break;
}
}
- return error;
+ return error1;
}
/*
Modified: user/luigi/ipfw3-head/bin/sh/expand.c
==============================================================================
--- user/luigi/ipfw3-head/bin/sh/expand.c Sun Dec 27 22:26:29 2009 (r201064)
+++ user/luigi/ipfw3-head/bin/sh/expand.c Sun Dec 27 22:34:31 2009 (r201065)
@@ -855,7 +855,6 @@ varvalue(char *name, int quoted, int sub
int num;
char *p;
int i;
- extern int oexitstatus;
char sep;
char **ap;
char const *syntax;
@@ -979,7 +978,7 @@ ifsbreakup(char *string, struct arglist
char *start;
char *p;
char *q;
- char *ifs;
+ const char *ifs;
const char *ifsspc;
int had_param_ch = 0;
Modified: user/luigi/ipfw3-head/bin/sh/histedit.c
==============================================================================
--- user/luigi/ipfw3-head/bin/sh/histedit.c Sun Dec 27 22:26:29 2009 (r201064)
+++ user/luigi/ipfw3-head/bin/sh/histedit.c Sun Dec 27 22:34:31 2009 (r201065)
@@ -164,19 +164,19 @@ int
histcmd(int argc, char **argv)
{
int ch;
- char *editor = NULL;
+ const char *editor = NULL;
HistEvent he;
int lflg = 0, nflg = 0, rflg = 0, sflg = 0;
int i, retval;
- char *firststr, *laststr;
+ const char *firststr, *laststr;
int first, last, direction;
- char *pat = NULL, *repl;
+ char *pat = NULL, *repl = NULL;
static int active = 0;
struct jmploc jmploc;
struct jmploc *savehandler;
char editfilestr[PATH_MAX];
char *volatile editfile;
- FILE *efp;
+ FILE *efp = NULL;
int oldhistnum;
if (hist == NULL)
Modified: user/luigi/ipfw3-head/bin/sh/input.c
==============================================================================
--- user/luigi/ipfw3-head/bin/sh/input.c Sun Dec 27 22:26:29 2009 (r201064)
+++ user/luigi/ipfw3-head/bin/sh/input.c Sun Dec 27 22:34:31 2009 (r201065)
@@ -93,7 +93,7 @@ struct parsefile {
int plinno = 1; /* input line number */
-MKINIT int parsenleft; /* copy of parsefile->nleft */
+int parsenleft; /* copy of parsefile->nleft */
MKINIT int parselleft; /* copy of parsefile->lleft */
char *parsenextc; /* copy of parsefile->nextc */
MKINIT struct parsefile basepf; /* top level input file */
@@ -111,9 +111,9 @@ static int preadfd(void);
INCLUDE "input.h"
INCLUDE "error.h"
-INIT {
- extern char basebuf[];
+MKINIT char basebuf[];
+INIT {
basepf.nextc = basepf.buf = basebuf;
}
Modified: user/luigi/ipfw3-head/bin/sh/jobs.c
==============================================================================
--- user/luigi/ipfw3-head/bin/sh/jobs.c Sun Dec 27 22:26:29 2009 (r201064)
+++ user/luigi/ipfw3-head/bin/sh/jobs.c Sun Dec 27 22:34:31 2009 (r201065)
@@ -92,7 +92,7 @@ STATIC struct job *getjob(char *);
STATIC pid_t dowait(int, struct job *);
STATIC pid_t waitproc(int, int *);
STATIC void cmdtxt(union node *);
-STATIC void cmdputs(char *);
+STATIC void cmdputs(const char *);
#if JOBS
STATIC void setcurjob(struct job *);
STATIC void deljob(struct job *);
@@ -1083,7 +1083,7 @@ cmdtxt(union node *n)
{
union node *np;
struct nodelist *lp;
- char *p;
+ const char *p;
int i;
char s[2];
@@ -1212,9 +1212,10 @@ redir:
STATIC void
-cmdputs(char *s)
+cmdputs(const char *s)
{
- char *p, *q;
+ const char *p;
+ char *q;
char c;
int subtype = 0;
Modified: user/luigi/ipfw3-head/bin/sh/main.c
==============================================================================
--- user/luigi/ipfw3-head/bin/sh/main.c Sun Dec 27 22:26:29 2009 (r201064)
+++ user/luigi/ipfw3-head/bin/sh/main.c Sun Dec 27 22:34:31 2009 (r201065)
@@ -77,7 +77,7 @@ int rootpid;
int rootshell;
struct jmploc main_handler;
-STATIC void read_profile(char *);
+STATIC void read_profile(const char *);
STATIC char *find_dot_file(char *);
/*
@@ -248,7 +248,7 @@ cmdloop(int top)
*/
STATIC void
-read_profile(char *name)
+read_profile(const char *name)
{
int fd;
@@ -334,8 +334,6 @@ dotcmd(int argc, char **argv)
int
exitcmd(int argc, char **argv)
{
- extern int oexitstatus;
-
if (stoppedjobs())
return 0;
if (argc > 1)
Modified: user/luigi/ipfw3-head/bin/sh/miscbltin.c
==============================================================================
--- user/luigi/ipfw3-head/bin/sh/miscbltin.c Sun Dec 27 22:26:29 2009 (r201064)
+++ user/luigi/ipfw3-head/bin/sh/miscbltin.c Sun Dec 27 22:34:31 2009 (r201065)
@@ -93,7 +93,7 @@ readcmd(int argc __unused, char **argv _
char c;
int rflag;
char *prompt;
- char *ifs;
+ const char *ifs;
char *p;
int startword;
int status;
@@ -254,7 +254,7 @@ readcmd(int argc __unused, char **argv _
int
-umaskcmd(int argc __unused, char **argv)
+umaskcmd(int argc __unused, char **argv __unused)
{
char *ap;
int mask;
Modified: user/luigi/ipfw3-head/bin/sh/mkbuiltins
==============================================================================
--- user/luigi/ipfw3-head/bin/sh/mkbuiltins Sun Dec 27 22:26:29 2009 (r201064)
+++ user/luigi/ipfw3-head/bin/sh/mkbuiltins Sun Dec 27 22:34:31 2009 (r201065)
@@ -88,7 +88,7 @@ tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJ
awk '{ printf "#define %s %d\n", $1, NR-1}'
echo '
struct builtincmd {
- char *name;
+ const char *name;
int code;
int special;
};
Modified: user/luigi/ipfw3-head/bin/sh/mkinit.c
==============================================================================
--- user/luigi/ipfw3-head/bin/sh/mkinit.c Sun Dec 27 22:26:29 2009 (r201064)
+++ user/luigi/ipfw3-head/bin/sh/mkinit.c Sun Dec 27 22:34:31 2009 (r201065)
@@ -102,9 +102,9 @@ struct block {
*/
struct event {
- char *name; /* name of event (e.g. INIT) */
- char *routine; /* name of routine called on event */
- char *comment; /* comment describing routine */
+ const char *name; /* name of event (e.g. INIT) */
+ const char *routine; /* name of routine called on event */
+ const char *comment; /* comment describing routine */
struct text code; /* code for handling event */
};
@@ -140,7 +140,7 @@ struct event event[] = {
};
-char *curfile; /* current file */
+const char *curfile; /* current file */
int linno; /* current line */
char *header_files[200]; /* list of header files */
struct text defines; /* #define statements */
@@ -148,20 +148,20 @@ struct text decls; /* declarations */
int amiddecls; /* for formatting */
-void readfile(char *);
-int match(char *, char *);
-int gooddefine(char *);
-void doevent(struct event *, FILE *, char *);
+void readfile(const char *);
+int match(const char *, const char *);
+int gooddefine(const char *);
+void doevent(struct event *, FILE *, const char *);
void doinclude(char *);
void dodecl(char *, FILE *);
void output(void);
-void addstr(char *, struct text *);
+void addstr(const char *, struct text *);
void addchar(int, struct text *);
void writetext(struct text *, FILE *);
-FILE *ckfopen(char *, char *);
+FILE *ckfopen(const char *, const char *);
void *ckmalloc(size_t);
-char *savestr(char *);
-void error(char *);
+char *savestr(const char *);
+void error(const char *);
#define equal(s1, s2) (strcmp(s1, s2) == 0)
@@ -170,9 +170,9 @@ main(int argc __unused, char *argv[])
{
char **ap;
- header_files[0] = "\"shell.h\"";
- header_files[1] = "\"mystring.h\"";
- header_files[2] = "\"init.h\"";
+ header_files[0] = savestr("\"shell.h\"");
+ header_files[1] = savestr("\"mystring.h\"");
+ header_files[2] = savestr("\"init.h\"");
for (ap = argv + 1 ; *ap ; ap++)
readfile(*ap);
output();
@@ -186,7 +186,7 @@ main(int argc __unused, char *argv[])
*/
void
-readfile(char *fname)
+readfile(const char *fname)
{
FILE *fp;
char line[1024];
@@ -230,9 +230,9 @@ readfile(char *fname)
int
-match(char *name, char *line)
+match(const char *name, const char *line)
{
- char *p, *q;
+ const char *p, *q;
p = name, q = line;
while (*p) {
@@ -246,9 +246,9 @@ match(char *name, char *line)
int
-gooddefine(char *line)
+gooddefine(const char *line)
{
- char *p;
+ const char *p;
if (! match("#define", line))
return 0; /* not a define */
@@ -269,11 +269,11 @@ gooddefine(char *line)
void
-doevent(struct event *ep, FILE *fp, char *fname)
+doevent(struct event *ep, FILE *fp, const char *fname)
{
char line[1024];
int indent;
- char *p;
+ const char *p;
sprintf(line, "\n /* from %s: */\n", fname);
addstr(line, &ep->code);
@@ -407,7 +407,7 @@ output(void)
*/
void
-addstr(char *s, struct text *text)
+addstr(const char *s, struct text *text)
{
while (*s) {
if (--text->nleft < 0)
@@ -452,7 +452,7 @@ writetext(struct text *text, FILE *fp)
}
FILE *
-ckfopen(char *file, char *mode)
+ckfopen(const char *file, const char *mode)
{
FILE *fp;
@@ -474,7 +474,7 @@ ckmalloc(size_t nbytes)
}
char *
-savestr(char *s)
+savestr(const char *s)
{
char *p;
@@ -484,7 +484,7 @@ savestr(char *s)
}
void
-error(char *msg)
+error(const char *msg)
{
if (curfile != NULL)
fprintf(stderr, "%s:%d: ", curfile, linno);
Modified: user/luigi/ipfw3-head/bin/sh/mksyntax.c
==============================================================================
--- user/luigi/ipfw3-head/bin/sh/mksyntax.c Sun Dec 27 22:26:29 2009 (r201064)
+++ user/luigi/ipfw3-head/bin/sh/mksyntax.c Sun Dec 27 22:34:31 2009 (r201065)
@@ -55,8 +55,8 @@ __FBSDID("$FreeBSD$");
struct synclass {
- char *name;
- char *comment;
+ const char *name;
+ const char *comment;
};
/* Syntax classes */
@@ -101,16 +101,16 @@ static char writer[] = "\
static FILE *cfile;
static FILE *hfile;
-static char *syntax[513];
+static const char *syntax[513];
static int base;
static int size; /* number of values which a char variable can have */
static int nbits; /* number of bits in a character */
static int digit_contig;/* true if digits are contiguous */
-static void filltable(char *);
+static void filltable(const char *);
static void init(void);
-static void add(char *, char *);
-static void print(char *);
+static void add(const char *, const char *);
+static void print(const char *);
static void output_type_macros(void);
static void digit_convert(void);
@@ -259,7 +259,7 @@ main(int argc __unused, char **argv __un
*/
static void
-filltable(char *dftval)
+filltable(const char *dftval)
{
int i;
@@ -293,7 +293,7 @@ init(void)
*/
static void
-add(char *p, char *type)
+add(const char *p, const char *type)
{
while (*p)
syntax[*p++ + base] = type;
@@ -306,7 +306,7 @@ add(char *p, char *type)
*/
static void
-print(char *name)
+print(const char *name)
{
int i;
int col;
@@ -338,7 +338,7 @@ print(char *name)
* contiguous, we can test for them quickly.
*/
-static char *macro[] = {
+static const char *macro[] = {
"#define is_digit(c)\t((is_type+SYNBASE)[c] & ISDIGIT)",
"#define is_eof(c)\t((c) == PEOF)",
"#define is_alpha(c)\t(((c) < CTLESC || (c) > CTLQUOTEMARK) && isalpha((unsigned char) (c)))",
@@ -351,7 +351,7 @@ static char *macro[] = {
static void
output_type_macros(void)
{
- char **pp;
+ const char **pp;
if (digit_contig)
macro[0] = "#define is_digit(c)\t((unsigned int)((c) - '0') <= 9)";
Modified: user/luigi/ipfw3-head/bin/sh/mystring.c
==============================================================================
--- user/luigi/ipfw3-head/bin/sh/mystring.c Sun Dec 27 22:26:29 2009 (r201064)
+++ user/luigi/ipfw3-head/bin/sh/mystring.c Sun Dec 27 22:34:31 2009 (r201065)
@@ -108,7 +108,7 @@ int
number(const char *s)
{
if (! is_number(s))
- error("Illegal number: %s", (char *)s);
+ error("Illegal number: %s", s);
return atoi(s);
}
Modified: user/luigi/ipfw3-head/bin/sh/options.c
==============================================================================
--- user/luigi/ipfw3-head/bin/sh/options.c Sun Dec 27 22:26:29 2009 (r201064)
+++ user/luigi/ipfw3-head/bin/sh/options.c Sun Dec 27 22:34:31 2009 (r201065)
@@ -64,7 +64,7 @@ char *arg0; /* value of $0 */
struct shparam shellparam; /* current positional parameters */
char **argptr; /* argument list for builtin commands */
char *shoptarg; /* set by nextopt (like getopt) */
-char *optptr; /* used by nextopt */
+char *nextopt_optptr; /* used by nextopt */
char *minusc; /* argument to -c option */
@@ -560,7 +560,7 @@ nextopt(const char *optstring)
const char *q;
char c;
- if ((p = optptr) == NULL || *p == '\0') {
+ if ((p = nextopt_optptr) == NULL || *p == '\0') {
p = *argptr;
if (p == NULL || *p != '-' || *++p == '\0')
return '\0';
@@ -581,6 +581,6 @@ nextopt(const char *optstring)
shoptarg = p;
p = NULL;
}
- optptr = p;
+ nextopt_optptr = p;
return c;
}
Modified: user/luigi/ipfw3-head/bin/sh/options.h
==============================================================================
--- user/luigi/ipfw3-head/bin/sh/options.h Sun Dec 27 22:26:29 2009 (r201064)
+++ user/luigi/ipfw3-head/bin/sh/options.h Sun Dec 27 22:34:31 2009 (r201065)
@@ -102,7 +102,7 @@ extern char *arg0; /* $0 */
extern struct shparam shellparam; /* $@ */
extern char **argptr; /* argument list for builtin commands */
extern char *shoptarg; /* set by nextopt */
-extern char *optptr; /* used by nextopt */
+extern char *nextopt_optptr; /* used by nextopt */
void procargs(int, char **);
void optschanged(void);
Modified: user/luigi/ipfw3-head/bin/sh/parser.c
==============================================================================
--- user/luigi/ipfw3-head/bin/sh/parser.c Sun Dec 27 22:26:29 2009 (r201064)
+++ user/luigi/ipfw3-head/bin/sh/parser.c Sun Dec 27 22:34:31 2009 (r201065)
@@ -113,7 +113,7 @@ STATIC int xxreadtoken(void);
STATIC int readtoken1(int, char const *, char *, int);
STATIC int noexpand(char *);
STATIC void synexpect(int);
-STATIC void synerror(char *);
+STATIC void synerror(const char *);
STATIC void setprompt(int);
@@ -1547,7 +1547,7 @@ synexpect(int token)
STATIC void
-synerror(char *msg)
+synerror(const char *msg)
{
if (commandname)
outfmt(&errout, "%s: %d: ", commandname, startlinno);
@@ -1579,13 +1579,14 @@ getprompt(void *unused __unused)
static char ps[PROMPTLEN];
char *fmt;
int i, j, trim;
+ static char internal_error[] = "<internal prompt error>";
/*
* Select prompt format.
*/
switch (whichprompt) {
case 0:
- fmt = "";
+ fmt = nullstr;
break;
case 1:
fmt = ps1val();
@@ -1594,7 +1595,7 @@ getprompt(void *unused __unused)
fmt = ps2val();
break;
default:
- return "<internal prompt error>";
+ return internal_error;
}
/*
Modified: user/luigi/ipfw3-head/bin/sh/parser.h
==============================================================================
--- user/luigi/ipfw3-head/bin/sh/parser.h Sun Dec 27 22:26:29 2009 (r201064)
+++ user/luigi/ipfw3-head/bin/sh/parser.h Sun Dec 27 22:34:31 2009 (r201065)
@@ -73,6 +73,7 @@
extern int tokpushback;
#define NEOF ((union node *)&tokpushback)
extern int whichprompt; /* 1 == PS1, 2 == PS2 */
+extern const char *const parsekwd[];
union node *parsecmd(int);
Modified: user/luigi/ipfw3-head/bin/sh/var.c
==============================================================================
--- user/luigi/ipfw3-head/bin/sh/var.c Sun Dec 27 22:26:29 2009 (r201064)
+++ user/luigi/ipfw3-head/bin/sh/var.c Sun Dec 27 22:34:31 2009 (r201065)
@@ -73,7 +73,7 @@ __FBSDID("$FreeBSD$");
struct varinit {
struct var *var;
int flags;
- char *text;
+ const char *text;
void (*func)(const char *);
};
@@ -94,27 +94,27 @@ STATIC struct var voptind;
STATIC const struct varinit varinit[] = {
#ifndef NO_HISTORY
- { &vhistsize, VSTRFIXED|VTEXTFIXED|VUNSET, "HISTSIZE=",
+ { &vhistsize, VUNSET, "HISTSIZE=",
sethistsize },
#endif
- { &vifs, VSTRFIXED|VTEXTFIXED, "IFS= \t\n",
+ { &vifs, 0, "IFS= \t\n",
NULL },
- { &vmail, VSTRFIXED|VTEXTFIXED|VUNSET, "MAIL=",
+ { &vmail, VUNSET, "MAIL=",
NULL },
- { &vmpath, VSTRFIXED|VTEXTFIXED|VUNSET, "MAILPATH=",
+ { &vmpath, VUNSET, "MAILPATH=",
NULL },
- { &vpath, VSTRFIXED|VTEXTFIXED, "PATH=" _PATH_DEFPATH,
+ { &vpath, 0, "PATH=" _PATH_DEFPATH,
changepath },
- { &vppid, VSTRFIXED|VTEXTFIXED|VUNSET, "PPID=",
+ { &vppid, VUNSET, "PPID=",
NULL },
/*
* vps1 depends on uid
*/
- { &vps2, VSTRFIXED|VTEXTFIXED, "PS2=> ",
+ { &vps2, 0, "PS2=> ",
NULL },
- { &vps4, VSTRFIXED|VTEXTFIXED, "PS4=+ ",
+ { &vps4, 0, "PS4=+ ",
NULL },
- { &voptind, VSTRFIXED|VTEXTFIXED, "OPTIND=1",
+ { &voptind, 0, "OPTIND=1",
getoptsreset },
{ NULL, 0, NULL,
NULL }
@@ -132,9 +132,9 @@ STATIC int localevar(const char *);
#ifdef mkinit
INCLUDE "var.h"
+MKINIT char **environ;
INIT {
char **envp;
- extern char **environ;
initvar();
for (envp = environ ; *envp ; envp++) {
@@ -164,8 +164,8 @@ initvar(void)
vpp = hashvar(ip->text);
vp->next = *vpp;
*vpp = vp;
- vp->text = ip->text;
- vp->flags = ip->flags;
+ vp->text = __DECONST(char *, ip->text);
+ vp->flags = ip->flags | VSTRFIXED | VTEXTFIXED;
vp->func = ip->func;
}
}
@@ -176,7 +176,7 @@ initvar(void)
vpp = hashvar("PS1=");
vps1.next = *vpp;
*vpp = &vps1;
- vps1.text = geteuid() ? "PS1=$ " : "PS1=# ";
+ vps1.text = __DECONST(char *, geteuid() ? "PS1=$ " : "PS1=# ");
vps1.flags = VSTRFIXED|VTEXTFIXED;
}
if ((vppid.flags & VEXPORT) == 0) {
@@ -258,11 +258,11 @@ setvar(const char *name, const char *val
STATIC int
localevar(const char *s)
{
- static char *lnames[7] = {
+ static const char *lnames[7] = {
"ALL", "COLLATE", "CTYPE", "MONETARY",
"NUMERIC", "TIME", NULL
};
- char **ss;
+ const char **ss;
if (*s != 'L')
return 0;
@@ -469,9 +469,9 @@ environment(void)
* VSTACK set since these are currently allocated on the stack.
*/
-#ifdef mkinit
MKINIT void shprocvar(void);
+#ifdef mkinit
SHELLPROC {
shprocvar();
}
Modified: user/luigi/ipfw3-head/bin/sh/var.h
==============================================================================
--- user/luigi/ipfw3-head/bin/sh/var.h Sun Dec 27 22:26:29 2009 (r201064)
+++ user/luigi/ipfw3-head/bin/sh/var.h Sun Dec 27 22:34:31 2009 (r201065)
@@ -108,7 +108,6 @@ void listsetvar(struct strlist *);
char *lookupvar(const char *);
char *bltinlookup(const char *, int);
char **environment(void);
-void shprocvar(void);
int showvarscmd(int, char **);
int exportcmd(int, char **);
int localcmd(int, char **);
Modified: user/luigi/ipfw3-head/release/picobsd/build/mfs.mtree
==============================================================================
--- user/luigi/ipfw3-head/release/picobsd/build/mfs.mtree Sun Dec 27 22:26:29 2009 (r201064)
+++ user/luigi/ipfw3-head/release/picobsd/build/mfs.mtree Sun Dec 27 22:34:31 2009 (r201065)
@@ -58,6 +58,8 @@
var
db
..
+ empty
+ ..
run
..
spool
Modified: user/luigi/ipfw3-head/release/picobsd/build/picobsd
==============================================================================
--- user/luigi/ipfw3-head/release/picobsd/build/picobsd Sun Dec 27 22:26:29 2009 (r201064)
+++ user/luigi/ipfw3-head/release/picobsd/build/picobsd Sun Dec 27 22:34:31 2009 (r201065)
@@ -167,7 +167,7 @@ create_includes_and_libraries2() { # opt
local no
log "create_includes_and_libraries2() for ${SRC}"
if [ ${OSVERSION} -ge 600000 ] ; then
- no="-DNO_CLEAN -DNO_PROFILE -DNO_GAMES -DNO_LIBC_R" # WITOUT_CDDL=1"
+ no="-DNO_CLEAN -DNO_PROFILE -DNO_GAMES -DNO_LIBC_R" # WITHOUT_CDDL=1"
else
no="-DNOCLEAN -DNOPROFILE -DNOGAMES -DNOLIBC_R"
fi
Modified: user/luigi/ipfw3-head/release/picobsd/floppy.tree/etc/master.passwd
==============================================================================
--- user/luigi/ipfw3-head/release/picobsd/floppy.tree/etc/master.passwd Sun Dec 27 22:26:29 2009 (r201064)
+++ user/luigi/ipfw3-head/release/picobsd/floppy.tree/etc/master.passwd Sun Dec 27 22:34:31 2009 (r201065)
@@ -1,3 +1,4 @@
+# $FreeBSD$
root:$1$xOOaGnKU$U9QdsCI40XXcCUMBN.7Az.:0:0::0:0:Charlie &:/root:/bin/sh
toor:*:0:0::0:0:Bourne-again Superuser:/root:
daemon:*:1:1::0:0:Owner of many system processes:/root:/nonexistent
@@ -5,4 +6,5 @@ operator:*:2:20::0:0:System &:/usr/guest
bin:*:3:7::0:0:Binaries Commands and Source,,,:/:/nonexistent
tty:*:4:65533::0:0:Tty Sandbox:/:/nonexistent
nobody:*:65534:65534::0:0:Unprivileged user:/nonexistent:/nonexistent
+_dhcp:*:65:65::0:0:dhcp programs:/var/empty:/usr/sbin/nologin
user:*:1002:1002:Sample User:0:0:user:/home/user:/bin/sh
Modified: user/luigi/ipfw3-head/sys/conf/options.sparc64
==============================================================================
--- user/luigi/ipfw3-head/sys/conf/options.sparc64 Sun Dec 27 22:26:29 2009 (r201064)
+++ user/luigi/ipfw3-head/sys/conf/options.sparc64 Sun Dec 27 22:34:31 2009 (r201065)
@@ -8,6 +8,8 @@ SUN4U opt_global.h
ATKBD_DFLT_KEYMAP opt_atkbd.h
+FIRE_DEBUG opt_fire.h
+
# Debug IOMMU inserts/removes using diagnostic accesses. This is very loud.
IOMMU_DIAG opt_iommu.h
Copied: user/luigi/ipfw3-head/sys/sparc64/pci/fire.c (from r201063, head/sys/sparc64/pci/fire.c)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ user/luigi/ipfw3-head/sys/sparc64/pci/fire.c Sun Dec 27 22:34:31 2009 (r201065, copy of r201063, head/sys/sparc64/pci/fire.c)
@@ -0,0 +1,2122 @@
+/*-
+ * Copyright (c) 1999, 2000 Matthew R. Green
+ * Copyright (c) 2001 - 2003 by Thomas Moestl <tmm at FreeBSD.org>
+ * Copyright (c) 2009 by Marius Strobl <marius at FreeBSD.org>
+ * 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. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * from: NetBSD: psycho.c,v 1.39 2001/10/07 20:30:41 eeh Exp
+ * from: FreeBSD: psycho.c 183152 2008-09-18 19:45:22Z marius
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+/*
+ * Driver for `Fire' JBus to PCI Express and `Oberon' Uranus to PCI Express
+ * bridges
+ */
+
+#include "opt_fire.h"
+#include "opt_ofw_pci.h"
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/interrupt.h>
+#include <sys/kernel.h>
+#include <sys/lock.h>
+#include <sys/malloc.h>
+#include <sys/module.h>
+#include <sys/mutex.h>
+#include <sys/pciio.h>
+#include <sys/pcpu.h>
+#include <sys/rman.h>
+#include <sys/smp.h>
+#include <sys/sysctl.h>
+#include <sys/timetc.h>
+
+#include <dev/ofw/ofw_bus.h>
+#include <dev/ofw/ofw_pci.h>
+#include <dev/ofw/openfirm.h>
+
+#include <vm/vm.h>
+#include <vm/pmap.h>
+
+#include <machine/bus.h>
+#include <machine/bus_common.h>
+#include <machine/bus_private.h>
+#include <machine/fsr.h>
+#include <machine/iommureg.h>
+#include <machine/iommuvar.h>
+#include <machine/pmap.h>
+#include <machine/resource.h>
+
+#include <dev/pci/pcireg.h>
+#include <dev/pci/pcivar.h>
+
+#include <sparc64/pci/ofw_pci.h>
+#include <sparc64/pci/firereg.h>
+#include <sparc64/pci/firevar.h>
+
+#include "pcib_if.h"
+
+static bus_space_tag_t fire_alloc_bus_tag(struct fire_softc *sc, int type);
+static const struct fire_desc *fire_get_desc(device_t dev);
+static void fire_dmamap_sync(bus_dma_tag_t dt __unused, bus_dmamap_t map,
+ bus_dmasync_op_t op);
+static int fire_get_intrmap(struct fire_softc *sc, u_int ino,
+ bus_addr_t *intrmapptr, bus_addr_t *intrclrptr);
+static void fire_intr_assign(void *arg);
+static void fire_intr_clear(void *arg);
+static void fire_intr_disable(void *arg);
+static void fire_intr_enable(void *arg);
+static int fire_intr_register(struct fire_softc *sc, u_int ino);
+static void fire_msiq_handler(void *cookie);
+static void fire_set_intr(struct fire_softc *sc, u_int index, u_int ino,
+ driver_filter_t handler, void *arg);
+static timecounter_get_t fire_get_timecount;
+
+/* Interrupt handlers */
+static driver_filter_t fire_dmc_pec;
+static driver_filter_t fire_pcie;
+static driver_filter_t fire_xcb;
+
+/*
+ * Methods
+ */
+static bus_activate_resource_t fire_activate_resource;
+static pcib_alloc_msi_t fire_alloc_msi;
+static pcib_alloc_msix_t fire_alloc_msix;
+static bus_alloc_resource_t fire_alloc_resource;
+static device_attach_t fire_attach;
+static bus_deactivate_resource_t fire_deactivate_resource;
+static bus_get_dma_tag_t fire_get_dma_tag;
+static ofw_bus_get_node_t fire_get_node;
+static pcib_map_msi_t fire_map_msi;
+static pcib_maxslots_t fire_maxslots;
+static device_probe_t fire_probe;
+static pcib_read_config_t fire_read_config;
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
More information about the svn-src-user
mailing list