Commit Graph

185512 Commits

Author SHA1 Message Date
christos
55e651517c one more printf like function, and fix the lossage. 2009-11-14 23:40:11 +00:00
christos
1070653ee5 Add a gcc printf attribute to the printf functions and fix the lossage caught. 2009-11-14 23:31:37 +00:00
tnozaki
6114d6b7fd fix format string bug, filename may contain % character, don't use it as format string. 2009-11-14 20:01:20 +00:00
rmind
16347a5be7 kpsignal2: do not make the signal pending twice when tracing the process,
also update a comment and add an assert.  Fixes PR/42309 by Nicolas Joly.
2009-11-14 19:06:54 +00:00
elad
1570e68c40 - Move kauth_init() a little bit higher.
- Add spec_init() to authorize special device actions (and passthru too for
  the time being). Move policy out of secmodel_suser.
2009-11-14 18:36:56 +00:00
uebayasi
3e92dd482c Sprinkle static. 2009-11-14 17:06:12 +00:00
skrll
8e8677821f Update a couple of comments. 2009-11-14 13:31:44 +00:00
dsl
e6a11930a4 Christos was worried about clrbits() being called with a length of zero.
This can't happen, but rework so it doesn't matter.
Remove 'optimisation' for length 1, that doesn't happen often enough.
2009-11-14 13:18:41 +00:00
njoly
f2999773ff Use __packed, not __attribute__((__packed__)). 2009-11-14 10:37:27 +00:00
cegger
1225bb1b7a use __arraycount 2009-11-14 09:54:10 +00:00
cegger
17429828e3 include <sys/device_if.h> for device_t. There is no use of struct device. 2009-11-14 09:42:50 +00:00
tsutsui
c03477f121 Fix a wrong index value for edid_products[] inside #ifdef EDIDVERBOSE in
edid_findproduct(). From Yasushi Oshima via FUKAUMI Naoki in udl(4) patch.
2009-11-14 09:19:41 +00:00
tsutsui
929c691c07 Preserve wscons(4) device numbers for forthcoming udl(4) USB display. 2009-11-14 09:14:22 +00:00
christos
e6f376b325 Fix pppd for ipv6 link-local addresses. Change the prefix length to 72 bits.
Thanks to Nagae Hidetake for providing patches and testing.
2009-11-14 04:47:03 +00:00
nakayama
933215c182 comcons in dev/ic/com.c is now declared as static, so don't peek it
directly but use it via cn_tab.

Tested on my Netra X1.
2009-11-14 03:43:52 +00:00
tnozaki
591608f7a5 1. PR/42209 various problems with EBCDIC support in iconv(3)
part3: added CP114[0-9] support.
2. fix csmapper name separator.
2009-11-14 01:56:21 +00:00
joerg
a5fad62a18 Simplify ifreq_setaddr:
- Drop the INET6 block. The commands are never given to this function
  and truncating the sockaddr is arguably not the desired result anyway.
- Clear the address before copying. This fixes SIOCGIFNETMASK and possible
  other ioctls for users that don't check sa_len. This includes
  COMPAT_43 and Linux emulation.

OK dyoung@
2009-11-13 23:11:08 +00:00
dsl
659c7fee7d tlbstate is 'int', so use 'cmpl' not 'cmpq'.
Fixes gprof on amd64 PR/40960.
2009-11-13 22:49:46 +00:00
joerg
e7123f329a Return the result of copyout. Reminded by Niolas Joly. 2009-11-13 22:39:35 +00:00
joerg
8277e92195 Provide SIOCGIFNAME. 2009-11-13 21:45:03 +00:00
dsl
f3583ee6ce Fix clrbits() so that it doesn't mask no bits out of the byte after the
range (when the last bit to be cleared is the msb of a byte).
Fixes PR/42312 in a slightly better way than proposed.
2009-11-13 19:15:24 +00:00
dsl
be258d919e Change args to clrbits() to be unsigned for efficiency. 2009-11-13 19:00:15 +00:00
gson
dddcd98c78 Removed return statement in parser action that caused a memory leak with
the new yacc, making "sh MAKEDEV -MM init" consume 27 MB of virtual memory
with the result that NetBSD could no longer be installed on a 32 MB system.
2009-11-13 13:49:09 +00:00
mishka
5da27c1396 The ippool(5) manpage mentions ippool.conf (which is also more common
name for config files) - add it to distribution. Per <hubertf> suggestion.
2009-11-13 09:51:13 +00:00
he
d942b02550 Remove reference to now-moved binutils src directory, it's not needed
anymore since strings is commented out and has been for a long time.
... and remove the commented-out strings as well.
2009-11-13 08:20:29 +00:00
he
71b0977302 Point to the new ncdcs directory. 2009-11-13 08:14:53 +00:00
dyoung
0db5f71432 Don't use com_activate(), it's gone away. Thanks to Andreas Wrede
for pointing out that these drivers still used com_activate().

Use device_private().  Join some lines.

Remove superfluous activation hooks.

Add child-detachment hooks (not used, yet).

TBD: device_t/softc split.
2009-11-13 01:14:35 +00:00
dyoung
3ea78c91dc Use TAILQ_FOREACH() instead of open-coding it.
I applied this patch with Coccinelle's semantic patch tool, spatch(1).
I installed Coccinelle from pkgsrc: devel/coccinelle/.  I wrote
tailq.spatch and kdefs.h (see below) and ran this command,

spatch -debug -macro_file_builtins ./kdefs.h -outplace \
    -sp_file sys/kern/tailq.spatch sys/kern/subr_autoconf.c

which wrote the transformed source file to /tmp/subr_autoconf.c.  Then I
used indent(1) to fix the indentation.

::::::::::::::::::::
::: tailq.spatch :::
::::::::::::::::::::

@@
identifier I, N;
expression H;
statement S;
iterator name TAILQ_FOREACH;
@@

- for (I = TAILQ_FIRST(H); I != NULL; I = TAILQ_NEXT(I, N)) S
+ TAILQ_FOREACH(I, H, N) S

:::::::::::::::
::: kdefs.h :::
:::::::::::::::

#define MAXUSERS 64
#define _KERNEL
#define _KERNEL_OPT
#define i386

/*
 * Tail queue definitions.
 */
#define	_TAILQ_HEAD(name, type, qual)					\
struct name {								\
	qual type *tqh_first;		/* first element */		\
	qual type *qual *tqh_last;	/* addr of last next element */	\
}
#define TAILQ_HEAD(name, type)	_TAILQ_HEAD(name, struct type,)

#define	TAILQ_HEAD_INITIALIZER(head)					\
	{ NULL, &(head).tqh_first }

#define	_TAILQ_ENTRY(type, qual)					\
struct {								\
	qual type *tqe_next;		/* next element */		\
	qual type *qual *tqe_prev;	/* address of previous next element */\
}
#define TAILQ_ENTRY(type)	_TAILQ_ENTRY(struct type,)

#define	PMF_FN_PROTO1	pmf_qual_t
#define	PMF_FN_ARGS1	pmf_qual_t qual
#define	PMF_FN_CALL1	qual

#define	PMF_FN_PROTO	, pmf_qual_t
#define	PMF_FN_ARGS	, pmf_qual_t qual
#define	PMF_FN_CALL	, qual

#define __KERNEL_RCSID(a, b)
2009-11-12 23:16:28 +00:00
dyoung
a9d7fca27d Don't use com_activate(), it's gone away. Delete superfluous
activation hook, pcmcom_activate().

Add a child-detachment hook and use it.

Use device_private().

Cosmetic: use __arraycount().  Join a couple of lines.  Delete a
set of superfluous parentheses.
2009-11-12 22:46:47 +00:00
dyoung
021235e4a6 Remove some dead code. 2009-11-12 20:38:35 +00:00
dyoung
05a97b4287 Delete definition of com_activate(), it's been removed. 2009-11-12 20:37:44 +00:00
dyoung
b2f2de753f Move the code in com_activate() to com_detach(), where it always
belonged.  Remove com_activate().

Consolidate information about the console on com(4) in a new struct
comcons_info.

Support detachment & re-attachment of a system console on com(4).
Re-attachment is somehow incomplete.  Ideally, if some other device
could take over as console, it would, but we're not quite there,
yet.
2009-11-12 20:37:09 +00:00
dyoung
90c2b25e8f Don't use com_activate(), it's going away. 2009-11-12 20:30:10 +00:00
dyoung
9ab08beb52 Call com_detach() before doing any bus-specific detachment.
Don't use com_activate(), it's going away.
2009-11-12 20:29:30 +00:00
dyoung
bb858bb7d5 Call the common detach routine, com_detach(), and get out on error,
before starting the bus-specific detachment.

com_activate() is going away, so don't use it any more.
2009-11-12 20:28:32 +00:00
dyoung
8e38167faa Remove definition of spc_activate(), it has gone away. 2009-11-12 20:15:02 +00:00
dyoung
2957bfb586 Remove superfluous activation hook.
Add a child-detachment hook.
2009-11-12 20:14:04 +00:00
dyoung
af7d639aad Re-order operations in usb_detach() so that if a usb(4) instance's
children will not detach, the instance is not left in an inconsistent
state.

If uhub(4) port is disconnected, forcefully detach the children on
that port.

Simplify detachment hooks.  (sc_dying must die!)

Pass along and respect detachment flags, esp. DETACH_FORCE,
throughout.
2009-11-12 20:11:35 +00:00
dyoung
f611b6f9fc Simplify activation hooks. (sc_dying must die!) 2009-11-12 19:58:27 +00:00
dyoung
edcba9e1df Simplify activation hook. (sc_dying must die!)
unifdef -D__NetBSD__ -U__FreeBSD__ -U__OpenBSD__.
2009-11-12 19:53:56 +00:00
dyoung
8f3030b535 Simplify activation hook. (sc_dying must die!) 2009-11-12 19:53:14 +00:00
dyoung
189c253b00 Remove superfluous activation hook. 2009-11-12 19:52:14 +00:00
dyoung
8d5198657e Simplify activation hooks. (sc_dying must die!) 2009-11-12 19:51:44 +00:00
dyoung
43acd4eaa8 Simplify activation hook. (sc_dying must die!)
s/device_ptr_t/device_t/.
2009-11-12 19:50:01 +00:00
dyoung
ed1618c692 Simplify activation hook. (sc_dying must die!)
unifdef -D__NetBSD__ -U__FreeBSD__ -U__OpenBSD__.
2009-11-12 19:49:03 +00:00
dyoung
8488e3e07c Simplify activation hook.
(sc_dying must die!)
2009-11-12 19:46:01 +00:00
dyoung
acb06354f1 Remove superfluous activation hooks. 2009-11-12 19:44:17 +00:00
dyoung
240fa6310f Remove superfluous activation hook. 2009-11-12 19:39:26 +00:00
dyoung
b5d9476c14 Simplify activation hook. 2009-11-12 19:38:35 +00:00
dyoung
04b4cf9e54 Remove superfluous activation hook. 2009-11-12 19:37:17 +00:00