Commit Graph

35838 Commits

Author SHA1 Message Date
Marcel Moolenaar
b019ad1bc0 In cb_dumphdr() we were calling buf_write() with di->priv as the
pointer to a dumperinfo instead of di. A brainfart, surely. This
bug went unnoticed for all this time because the pointer is only
used by buf_write() when it can write a completely filled buffer
to the dump device. This depends on the number of memory chunks
that needs to be dumped. This has apparently been low enough that
it has never happened up until this point.
2002-10-20 23:39:43 +00:00
Thomas Moestl
5775150869 Fix the calculations of the length of the unread message buffer
contents. The code was subtracting two unsigned ints, stored the
result in a log and expected it to be the same as of a signed
subtraction; this does only work on platforms where int and long
have the same size (due to overflows).
Instead, cast to long before the subtraction; the numbers are
guaranteed to be small enough so that there will be no overflows
because of that.
2002-10-20 23:13:05 +00:00
Robert Watson
e585282846 Hook up opt_mac.h to the build dependencies. The way we currently
handle this stuff is dangerous. :-)

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2002-10-20 22:59:17 +00:00
Robert Watson
c530b092cb Add opt_mac.h to dependencies for if_stf.c module.
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2002-10-20 22:57:22 +00:00
Poul-Henning Kamp
53be11f680 Fix two instances of variant struct definitions in sys/netinet:
Remove the never completed _IP_VHL version, it has not caught on
anywhere and it would make us incompatible with other BSD netstacks
to retain this version.

Add a CTASSERT protecting sizeof(struct ip) == 20.

Don't let the size of struct ipq depend on the IPDIVERT option.

This is a functional no-op commit.

Approved by:	re
2002-10-20 22:52:07 +00:00
Robert Watson
e6a5564ee2 Missed a case of _POSIX_MAC_PRESENT -> _PC_MAC_PRESENT rename.
Pointed out by:	phk
2002-10-20 22:50:43 +00:00
Robert Drehmel
47e40520dd Do not try to work around ``poor (un)sign extension code''
creation by GCC-2.6.3.  Casting pointers to unsigned char
to volatile pointers to unsigned char seemed to produce
better results on the ia32 architecture with old versions
of GCC.
The current FreeBSD system compiler GCC-3.2.1 emits
better sign extension code for non-volatile variables:

volatile char c;
int i = c;

is compiled to:
...
movb	-1(%ebp), %al
movbsl	%al, %eax
movl	%eax, -8(%ebp)
...

char c;
int i = c;

is compiled to:
...
movbsl	-1(%ebp), %eax
movl	%eax, -8(%ebp)
...

The same holds for zero-extension of dereferenced pointers
to volatile unsigned char.
When compiled on alpha or sparc64, the code produced for the
two examples above does not differ.
2002-10-20 22:50:13 +00:00
Poul-Henning Kamp
d8be0570d0 Always put the "access" macro argument in (), it might be an expression.
This is a purely stylistic change.
2002-10-20 22:48:08 +00:00
Poul-Henning Kamp
6adb748875 No need to specify CTLTYPE_INT when we use SYSCTL_INT. 2002-10-20 22:46:50 +00:00
Robert Watson
6b459e4956 When packets pass in and out of six-to-four (STF) tunnels, perform
labeling checks and operations as with other network interfaces.
Eventually, if it proves desirable, we might want to offer special
casing of this or other tunnel interfaces where we have an existing
label of interest, rather than treating it as though it's an
entirely fresh mbuf in the incoming/outgoing encapsulation directions.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2002-10-20 22:39:55 +00:00
Poul-Henning Kamp
33f9080f82 We have mem{cpy,cmp,set} functions in the kernel, don't #define them to
b{copy,zero,cmp} functions anymore.

Spotted by:	FlexeLint.
2002-10-20 22:35:20 +00:00
Poul-Henning Kamp
962414a120 We have memset() and memcpy() in the kernel now, so we don't need to
#define them to bzero and bcopy.

Spotted by:	FlexeLint
2002-10-20 22:33:42 +00:00
Robert Watson
4141b621ac When a packet is sent via a FDDI interface, perform appropriate MAC
transmission checks; when it is received, label the packet appropriately.
Although we don't have a local FDDI setup to test this with, the
labeling and checks are identical to other interface classes.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2002-10-20 22:27:59 +00:00
Robert Watson
9476111d3a When a packet is destined for delivery via an ATM medium, perform
appropriate interface transmission checks and delivery labeling.  While
we don't have a local ATM configuration, this code is almost identical
to all other interface classes.

Approved by:	re
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2002-10-20 22:20:48 +00:00
Robert Watson
be36629d5c Rename _POSIX_FOO_PRESENT and friends from POSIX.1e to _PC_FOO_PRESENT
and related friends.  This would have been corrected had POSIX.1e
progressed to a standard.

Pointed out by:	wollman
2002-10-20 22:11:13 +00:00
Robert Watson
6f54838539 Implement _POSIX_ACL_PATH_MAX, which returns the maximum number of ACL
entries for a file system node using pathconf().

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2002-10-20 22:08:26 +00:00
Robert Watson
c740509854 When a packet is multicast encapsulated, give labeled policies the
opportunity to preserve the label.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2002-10-20 21:59:00 +00:00
Maxime Henrion
822b4f22fb Set kernelname in sparc64_init() so that the kern.bootfile
sysctl works.  This stuff should probably be made MI.

Reviewed by:	jake
2002-10-20 21:55:35 +00:00
Poul-Henning Kamp
6999d2ef6d Don't examine an un-initialized variable.
Spotted by:	FlexeLint.
2002-10-20 21:52:05 +00:00
Robert Watson
e0c12d4c23 Teach UFS to respond to pathconf() tests for _POSIX_ACL_EXTENDED and
_POSIX_MAC_PRESENT based on available mount flags, if the services are
available.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2002-10-20 21:49:41 +00:00
Robert Watson
e8e5bc4ef9 Correct mis-spelling in pathconf constant _POSIX_ACL_CAP_PRESENT to
be the more correct _POSIX_CAP_PRESENT.
2002-10-20 21:45:07 +00:00
Ian Dowse
4b932371f4 Split out most of the logic from in_pcbbind() into a new function
called in_pcbbind_setup() that does everything except commit the
changes to the PCB. There should be no functional change here, but
in_pcbbind_setup() will be used by the soon-to-appear IP_SENDSRCADDR
control message implementation to check or allocate the source
address and port.

Discussed on:	-net
Approved by:	re
2002-10-20 21:44:31 +00:00
Poul-Henning Kamp
0c183c5a56 Remove extern declarations of stuff which is static in nfs_node.c
Move related macro to nfs_node.c

Spotted by:	FlexeLint
2002-10-20 21:40:55 +00:00
Alan Cox
f3a01463b9 - Replace two instances of vm_page_sleep_busy() with the page queue
mutex-friendly vm_page_sleep_if_busy().
 - Introduce page queue locking in pmap_page_lookup() and
   pmap_release_free_page().
 - Simplify the invalidation of the pmap's ptphint in
   pmap_release_free_page().  (MFi386 pmap.c revision 1.362.)
2002-10-20 21:40:17 +00:00
Poul-Henning Kamp
ce2fb5776b '&' not used for pointers to functions.
Spotted by:	FlexeLint
2002-10-20 21:31:16 +00:00
Poul-Henning Kamp
659d5e21c7 Remove even more '&' from pointers to functions.
Spotted by:	FlexeLint
2002-10-20 21:30:02 +00:00
Julian Elischer
2f030624b1 Add an actual implementation of kse_wakeup()
Submitted by:	Davidxu
2002-10-20 21:08:47 +00:00
Andrew Gallatin
2ea9877c1b give alpha a bus_space_subregion() so that ahd_pci compiles and moves
LINT one file further on.  Only 999,999 or so more files to go..
2002-10-20 20:55:37 +00:00
Poul-Henning Kamp
083019ba97 Don't us an array[1], it just hides where '&' isn't used right.
Be consistent about functions being static.

Verified by:	md5 hash of generated .o file.
2002-10-20 20:53:42 +00:00
Poul-Henning Kamp
975b628f27 Use ENOSPC error return, not ENOMEM.
Use %jd rather than %lld.
2002-10-20 20:50:31 +00:00
Poul-Henning Kamp
50c026e579 Change the definition of the debugging registers to be an array, so
that we can index into it, rather than do pointer gymnastics on a
structure containing 8 elements.

Verified by:	MD5 hash on the produced .o files.
2002-10-20 20:48:56 +00:00
Poul-Henning Kamp
858b84f550 '&' is not needed to pointerize functions.
Spotted by:	FlexeLint
2002-10-20 20:42:25 +00:00
Alexander Kabaev
51d123d69b Connect ubsa module to build.
Forgotten by:	kan
2002-10-20 20:35:14 +00:00
Poul-Henning Kamp
3f12caa180 Now that the sectorsize and mediasize are properties of the provider,
don't take the detour over the I/O path to discover them using getattr(),
we can just pick them out directly.

Do note though, that for now they are only valid after the first open
of the underlying disk device due compatibility with the old disk_create()
API.  This will change in the future so they will always be valid.

Sponsored by:   DARPA & NAI Labs.
2002-10-20 20:28:24 +00:00
Poul-Henning Kamp
943305f753 The g_id*() functions are not needed in the userland test-suite so
#ifdef _KERNEL them rather than deal with a copyin simulation.

Sponsored by:	DARPA & NAI Labs
2002-10-20 20:08:44 +00:00
Alan Cox
f3b676f0ad o Reinline vm_page_undirty(), reducing the kernel size. (This reverts
a part of vm_page.h revision 1.87 and vm_page.c revision 1.167.)
2002-10-20 19:57:55 +00:00
Thomas Moestl
10a3514a2e Use microuptime() instead of microtime() to bound the flush wait to
avoid hiccups in case of system time adjustment.
2002-10-20 19:41:21 +00:00
Poul-Henning Kamp
48444d6262 Make the sectorsize a property of providers so we can include it in the XML
output.

Sponsored by:	DARPA & NAI Labs
2002-10-20 19:18:07 +00:00
Poul-Henning Kamp
14ac6812b9 Use %jd instead of %lld now that we have it. 2002-10-20 18:48:12 +00:00
Poul-Henning Kamp
9e2ebaa081 It makes more sense for the fwheads and fwsectors properties to be in
the provider stanza rather than the geom stanza.
2002-10-20 18:46:25 +00:00
Tor Egge
0a676b7eb6 Fix data corruption caused by last byte in oddly sized transfers being read
to wrong location in RxBuf and written from wrong location in TxBuf.
2002-10-20 18:43:11 +00:00
Poul-Henning Kamp
8f9628a126 Include fwsectors and gfwheads in the XML output for the disks we know.
Sponsored by:	DARPA & NAI Labs.
2002-10-20 18:09:01 +00:00
Poul-Henning Kamp
05f6411a98 Remove a boatload of '&' which are surplus to the requirements.
Validated by:	md5 hash is unchanged.
2002-10-20 18:02:46 +00:00
Poul-Henning Kamp
7f30cdf366 Revert last commit, there actually was a -1 waaaaay down in pcireg_cfgread(). 2002-10-20 17:54:17 +00:00
Poul-Henning Kamp
218565dc75 Hide inline assembly if lint is defined. 2002-10-20 17:30:30 +00:00
Poul-Henning Kamp
a67ee49294 "id" is never going to be -1 when it is unsigned.
Spotted by:	FlexeLint
2002-10-20 17:21:43 +00:00
Thomas Moestl
e381d2455b Add kernel dump support, based on the ia64 version (which was committed
as sparc64/sparc64/dump_machdep.c a while back).
Other than ia64 (which uses ELF), sparc64 uses a homegrown format for
the dumps (headers are required because the physical address and size of
the tsb must be noted, and because physical memory may be discontiguous);
ELF would not offer any advantages here.

Reviewed by:	jake
2002-10-20 17:03:15 +00:00
Poul-Henning Kamp
58f07abfc9 Don't declare mb_statpcpu, it is static in subr_mbuf.c
Spotted by:	FlexeLint
2002-10-20 16:55:52 +00:00
Poul-Henning Kamp
4294d700d6 Fix mis-indentation.
Approved by:	scottl
2002-10-20 16:00:43 +00:00
Poul-Henning Kamp
87d4861cc5 Be consistent about functions being static.
Spotted by:	FlexeLint
2002-10-20 14:30:28 +00:00