Commit Graph

52126 Commits

Author SHA1 Message Date
Poul-Henning Kamp
b348abd6cd Don't call VOP_DESTROYVOBJECT(), trust that VOP_RECLAIM() did what
was necessary.
2005-02-07 07:48:03 +00:00
Poul-Henning Kamp
5937226d51 Add a missing prefix to a struct field for consistency. 2005-02-07 07:40:39 +00:00
Nate Lawson
8b888c66d7 Remove handling _PSS notifies from acpi_cpu and let acpi_perf handle them. 2005-02-07 04:03:06 +00:00
Ian Dowse
98c926b20f Add a mechanism for associating a mutex with a callout when the
callout is first initialised, using a new function callout_init_mtx().
The callout system will acquire this mutex before calling the callout
function and release it on return.

In addition, the callout system uses the mutex to avoid most of the
complications and race conditions inherent in asynchronous timer
facilities, so mutex-protected callouts have much simpler semantics.
As long as the mutex is held when invoking callout_stop() or
callout_reset(), then these functions will guarantee that the callout
will be stopped, even if softclock() had already begun to process
the callout.

Existing Giant-locked callouts will automatically pick up the new
race-free semantics. This should close a number of race conditions
in the USB code and probably other areas of the kernel too.

There should be no change in behaviour for "MP-safe" callouts; these
still need to use the techniques mentioned in timeout(9) to avoid
race conditions.
2005-02-07 02:47:33 +00:00
Bernd Walter
b542a023e5 Enable interrupt routing as first choice on alpha.
The alpha default handler knows how to trigger a fallback.
2005-02-07 00:43:14 +00:00
Poul-Henning Kamp
a15fbb42c3 Allocate more space for softc. Amazing my machine survived this. 2005-02-06 22:45:12 +00:00
Robert Watson
8760934124 Remove a comment from the raw IPv6 output function regarding
M_TRYWAIT allocations: M_PREPEND() now uses M_DONTWAIT.

MFC after:	3 days
2005-02-06 21:43:55 +00:00
Warner Losh
cbf6a317a5 Move the $NetBSD$ tag to the top of the file, per standard NetBSD
practice (which we seem to mostly follow in the tree).  Move the
$FreeBSD$ tag to its more proper place after all copyright and license
notices.  Add '-' to the copyright notice for Christian E. Hopps so my
copyright script picks it up.
2005-02-06 21:15:19 +00:00
Nate Lawson
aca8665972 Hook acpi_throttle(4) up to the build. It's currently part of acpi_perf.ko
although this may change.
2005-02-06 21:13:41 +00:00
Warner Losh
108663cc87 ccs is a size_t. RAY_CCS_INDEX takes ccs and does math on it,
resulting in a size_t due to C's rules of arithmetic.  Rather than
bogusly cast the result to a uint8_t, fix the printf format specifier
to have a 'z' modifier which tells the compiler that the sizes really
do match.

It turns out that change 1.75 was incorrect to assume that this
'really' was a 8bit quantity.  It isn't.  Although the hardware
appears to limit things to < 256, it would be a bug that should be
caught by debug printf it it were.  Casting it to uint8_t would have
lost this useful information.

Aslo add 'z' to a nearby debug statement that's never compiled in.
2005-02-06 21:12:22 +00:00
Nate Lawson
8c5468e3f5 Remove acpi throttling support from the acpi_cpu(4) driver now that this
is supported by acpi_throttle(4).
2005-02-06 21:10:19 +00:00
Nate Lawson
7150dfc7e5 Break out acpi throttling support into a new relative cpufreq driver,
acpi_throttle(4).
2005-02-06 21:09:51 +00:00
Nate Lawson
88c9b54c47 Add support for relative cpufreq drivers. Such drivers modulate clock
frequency as a percentage of the base rate and do not change the base
rate directly.  The cpufreq framework combines these with absolute drivers
to produce synthesized levels made of one or more settings.
2005-02-06 21:08:35 +00:00
Warner Losh
440b5ade31 Move resource allocation routines from cardbus_cis.c to cardbus.c.
They have nothing at all to do with CIS parsing.

Remove some unused funce parsing: nothing used the results.

Use more of pccard_cis.h's deifnitions for the cardbus specific cis
parsing we do.  More work is needed in this area.

This reduces the size of the cardbus module by 380 bytes or so...
2005-02-06 21:03:13 +00:00
Nate Lawson
3cc2f17689 Notify the OS that we're taking over Px states in acpi_perf(4) instead of
doing it in the cpu driver.  The previous code was incorrect anyway since
this value controls Px states, not throttling as the comment said.  Since
we didn't support Px states before, there was no impact.  Also, note that
we delay the write to SMI_CMD until after booting is complete since it
sometimes triggers a change in the frequency and we want to have all
drivers ready to detect/handle this.
2005-02-06 20:12:28 +00:00
Gleb Smirnoff
2c42caf7f0 Whitespace. 2005-02-06 19:24:59 +00:00
Gleb Smirnoff
50633c3a9f Remove comment which left after removal of ng_rcvdataq_t.
MFC after:	1 week
2005-02-06 19:20:16 +00:00
David Schultz
2a51b9b0aa When running Linux binaries, set up the initial FPU state as Linux
would.

PR:	28966
2005-02-06 17:29:20 +00:00
Ian Dowse
1c7178ce25 Check that we have at least a 586-class CPU before calling do_cpuid().
This fixes booting on a number of 486 processors.

PR:		i386/75686
Reviewed by:	markm
MFC after:	1 week
2005-02-06 16:55:52 +00:00
Poul-Henning Kamp
df05d0fb93 Further elaborate the GPIB driver. We now support a minimal subset of
the ibfoo() API.
2005-02-06 15:22:23 +00:00
Xin LI
04def62430 Finish the import of nc(1) from OpenBSD. This includes:
- Bring IPsec support from the ports collection [1].
	- Bring -o ("once only") option from the ports
	  collection [2].
	- Adopt the Makefile framework into
	  usr.bin/nc/Makefile.
	- Add a knob to control whether to build nc(1),
	  NO_NETCAT.
	- Bump __FreeBSD_version so ports collection can
	  detect this change.

Original patchset are contributed to the ports collection by:
[1] nectar, [2] joerg.

Note: WARNS?=6 patchset spined off in this commit, in order not
to take too many files off the vendor branch.
2005-02-06 14:44:27 +00:00
Poul-Henning Kamp
0c3c54da63 Since we are quite unlikely to ever face another platform which
uses the i8237 without trying to emulate the PC architecture move
the register definitions for the i8237 chip into the central include
file for the chip, except for the PC98 case which is magic.

Add new isa_dmatc() function which tells us as cheaply as possible
if the terminal count has been reached for a given channel.
2005-02-06 13:46:39 +00:00
Yoshihiro Takahashi
32b8035467 Sort includes and remove duplicate include. 2005-02-06 13:31:22 +00:00
Yoshihiro Takahashi
42d2323edd MFi386: revision 1.606. 2005-02-06 13:23:20 +00:00
David E. O'Brien
61d087cf53 Fix problem with some logitec usb wireless mice.
Submitted by:	Markus <mw@kpnqwest.ch>
Tested by:	Randy Bush <randy@psg.com>
2005-02-06 12:41:00 +00:00
Gleb Smirnoff
1af305441d Jump to common action checks after doing specific once. This fixes adding
of divert rules, which I break in previous commit.

Pointy hat to:	glebius
2005-02-06 11:13:59 +00:00
Maxim Konovalov
212a79b010 o Implement net.inet.tcp.drop sysctl and userland part, tcpdrop(8)
utility:

    The tcpdrop command drops the TCP connection specified by the
    local address laddr, port lport and the foreign address faddr,
    port fport.

Obtained from:	OpenBSD
Reviewed by:	rwatson (locking), ru (man page), -current
MFC after:	1 month
2005-02-06 10:47:12 +00:00
Nate Lawson
3045c8af3f Staticize the legacy cpu devclasses and revert the name for the acpi_cpu
devclass.  As pointed out by dfr@, devclasses don't have to share the same
linkage if multiple drivers have the same name.  Newbus should match the
devclasses based on name and allocate non-conflicting unit numbers.
2005-02-06 07:36:08 +00:00
Nate Lawson
3888a87205 Finish the job of sorting all includes and fix the build by including
malloc.h before proc.h on sparc64.  Noticed by das@

Compiled on:	alpha, amd64, i386, pc98, sparc64
2005-02-06 01:55:08 +00:00
Gleb Smirnoff
4feaf224b8 Increase size of arglen to uint32_t, since uint16_t proved to be
not enough (e.g. listing 911 nodes). Bump NG_VERSION.

Reviewed by:	julian, archie, ru
2005-02-05 23:23:14 +00:00
Nate Lawson
959c26396c Make cpu_est_clockrate() more accurate by disabling interrupts for the
millisecond it is calibrating.  Suggested by jhb@ and bde@.  Don't clobber
the tsc_freq with the new value since it isn't accurate enough for
timecounters and the timecounter system as a whole needs support for
changing rates before we do this.  Subtract 0.5% from our measurement
to account for overhead in DELAY.  Note that this interface is for
estimating the clockrate and needs to work well at runtime so doing a full
calibration including disabling interrupts for a second is not feasible.
2005-02-05 23:16:27 +00:00
Nate Lawson
76ce4cc456 Convert to the new GAS APIs to allow for detach in the future. Also, check
the PERF_CTRL register in our probe method so that we can tell earlier
that another driver should handle this device due to FFixedHW.  This avoids
scaring users when attach failed when we really wanted probe to fail.
2005-02-05 22:30:57 +00:00
Nate Lawson
f4eb041868 Convert to the new GAS API so that we can free registers in the future. 2005-02-05 22:29:03 +00:00
Nate Lawson
e1c4bf3f42 Convert the acpi_bus_alloc_gas() and acpi_PkgGas() APIs to output the memory
type.  This is needed if the resource is to be released later.  The RID is
still also present, though less necessary since rman_get_rid() can be used
to obtain it from the resource.
2005-02-05 22:28:36 +00:00
Alan Cox
ab42aa145d Acquire the source pmap's lock in pmap_copy(). 2005-02-05 22:06:47 +00:00
Nate Lawson
69bc96f231 Build cpufreq and acpi_perf on platforms that are likely to be able to
use them.
2005-02-05 21:01:09 +00:00
Alan Cox
fb1b26da19 Implement proper handling of PG_G mappings in pmap_protect(). (I don't
believe that this omission mattered before the introduction of MemGuard.)

Reviewed by: tegge@
MFC after: 1 week
2005-02-05 19:21:54 +00:00
Nate Lawson
0a9145a2f2 Use intr_disable/restore() instead of disable_intr() since the latter is
not MI.  This should fix build on non i386 platforms.
2005-02-05 16:31:58 +00:00
Gleb Smirnoff
f2a7ef4e00 Hook up ng_ipfw to kernel build. 2005-02-05 12:15:56 +00:00
Gleb Smirnoff
aa70aaecdb Add ng_ipfw to kernel module build. 2005-02-05 12:09:38 +00:00
Gleb Smirnoff
670742a102 Add a ng_ipfw node, implementing a quick and simple interface between
ipfw(4) and netgraph(4) facilities.

Reviewed by:	andre, brooks, julian
2005-02-05 12:06:33 +00:00
Gleb Smirnoff
d1240630b3 Expire aged flows in normal expiry thread. This fixes the problem, when
a node disconnected from all sources of traffic never purges its cache.
2005-02-05 10:00:04 +00:00
Gleb Smirnoff
020d3f61d8 Break long lines in code and comments. 2005-02-05 09:08:33 +00:00
Ruslan Ermilov
30aabc9afd Create a per-module mutex on MOD_LOAD, and destroy it on MOD_UNLOAD.
(This fixes witness_destroy() panic after module unload.)

OK'ed by:	rwatson, julian
2005-02-05 08:28:36 +00:00
Scott Long
6ab93aca6d Only compile the cpufreq driver on i386 and amd64. 2005-02-05 08:01:10 +00:00
Jeff Roberson
8364446643 - Don't release BKGRDINPROG until after we've bufdone'd the copy.
Sponsored by:	Isilon Systems, Inc.
2005-02-05 01:26:14 +00:00
Pawel Jakub Dawidek
662a4e5878 - Use bioq_insert_tail()/bioq_insert_head() instead of bioq_disksort().
- Improve mediasize checking.

MFC after:	1 week
2005-02-05 00:30:08 +00:00
Gleb Smirnoff
a436589ae2 Do check that version of a message from userland matches ours.
MFC after:	3 days
2005-02-04 21:38:42 +00:00
Gleb Smirnoff
e5d73ca252 Call if_link_state_change() when link status changes.
PR:		kern/76890
Reviewed by:	rwatson, sam
2005-02-04 18:36:04 +00:00
Nate Lawson
26d5f7dfa7 Don't print out a failure message when an attach for FFixedHW fails.
Instead, just fail to attach so another hardware-specific driver can
claim the device.  Also, clean up some small memory leaks in the failure
case.
2005-02-04 18:09:01 +00:00
Nate Lawson
b68b14adaf Return a special status of "not supported" for functional fixed hardware
since this type of register should be handled by another driver.
2005-02-04 18:07:03 +00:00
Warner Losh
c4241acbb3 Don't rely on indirect inclusion of machine/bus.h to use
bus_space_{read,write}_* routines.  This doesn't matter in the current
tree, but will matter soon (the rest of the tree appears to already be
clean).
2005-02-04 17:33:31 +00:00
Jeff Roberson
42a29039de - Add ke_runq == NULL to the conditions which will cause us to abort
adjusting timeshare loads in sched_class().  This is only important if
   the thread has never run, otherwise the state checks should work as
   expected.
2005-02-04 17:22:46 +00:00
Gleb Smirnoff
7a1725fc46 - Fix build with TRACE_MESSAGES defined
- Remove extra parenthesis
2005-02-04 16:08:20 +00:00
Yoshihiro Takahashi
c94fa11fc4 cosmetic changes. 2005-02-04 15:34:52 +00:00
Yoshihiro Takahashi
328a9c4f3d The bs and wdc drivers are gone. 2005-02-04 15:29:54 +00:00
Hajimu UMEMOTO
6d0a982bdf teach scope of IPv6 address to net.inet6.tcp6.getcred.
MFC after:	1 week
2005-02-04 14:43:05 +00:00
Yoshihiro Takahashi
f787023e5a Fix pc98 support (broken by previous change). 2005-02-04 13:37:21 +00:00
Yoshihiro Takahashi
9f83151765 Merged from sys/dev/sio/sio.c revision 1.457. 2005-02-04 13:35:21 +00:00
Yoshihiro Takahashi
0faf078231 MFi386: revision 1.605. 2005-02-04 13:34:24 +00:00
Yoshihiro Takahashi
2e047e2eb8 MFi386: revision 1.514. 2005-02-04 13:33:46 +00:00
Nate Lawson
7d3a06201d Make the devclass static for now until deciding whether to share them. 2005-02-04 07:25:44 +00:00
Nate Lawson
d639e9636d Bump __FreeBSD_version for cpufreq addition. Requested by marcus@ 2005-02-04 06:59:58 +00:00
Nate Lawson
a287c0ffaf Sort includes a little so that bus.h comes before cpu.h (for device_t). 2005-02-04 06:58:09 +00:00
Marcel Moolenaar
6fb59928a6 Include sys/bus.h before sys/cpu.h. The latter needs device_t. 2005-02-04 06:38:58 +00:00
Suleiman Souhlal
81ae703462 Set the scheduling class of the zeroidle thread to PRI_IDLE.
Reviewed by:	jhb
Approved by:	grehan (mentor)
MFC after:	1 week
2005-02-04 06:18:31 +00:00
Suleiman Souhlal
339a7e7fbb Set the scheduling class of the idle threads to PRI_IDLE.
While there, set their priority with sched_prio() instead of changing it
'by hand'.

Reviewed by:	jhb
Approved by:	grehan (mentor)
2005-02-04 06:16:05 +00:00
Nate Lawson
dbfdf1736b MFi386: Merge updates to the cpu pseudo-driver. Compile, not runtime
tested.
2005-02-04 06:02:37 +00:00
Nate Lawson
335e4ff3cd Hook up the cpufreq framework, acpi_perf(4), and cpufreq(4) drivers. 2005-02-04 05:49:36 +00:00
Nate Lawson
6cb2040baf Add the ACPI Performance states driver. This driver offers two or more
settings as exported via the ACPI _PSS method.  OEMs use this interface
to encapsulate chipset or processor-specific methods (e.g., SpeedStep or
Powernow) and export their settings in a standard way.  On systems that
have valid ACPI Performance states and a hardware-specific driver (e.g.,
ichss), acpi_perf(4) is preferred.
2005-02-04 05:45:07 +00:00
Nate Lawson
6c7b11ccfa Add a cpufreq driver for the SpeedStep capability in the ICH chipset. This
driver offers two settings.  Information for this driver was obtained from
the Intel datasheets and by reviewing the Linux driver.
2005-02-04 05:42:29 +00:00
Nate Lawson
73347b071d Add the cpufreq framework. This code manages multiple drivers and presents
a unified kernel and user interface for controlling cpu frequencies.
2005-02-04 05:39:19 +00:00
Nate Lawson
bfdbeca163 Add an interface for cpufreq. The kernel interface lets other drivers
select the CPU frequency level (say for cooling).  The driver interface
allows hardware drivers to announce themselves as capable of adjusting
an individual frequency setting.
2005-02-04 05:38:30 +00:00
Nate Lawson
98aa9cd052 Update the CPU attachments to return CPU_IVAR_PCPU as well as pass on
appropriate requests to any children.
2005-02-04 05:36:40 +00:00
Nate Lawson
4c4381e288 Add an implementation of cpu_est_clockrate(9). This function estimates the
current clock frequency for the given CPU id in units of Hz.
2005-02-04 05:32:56 +00:00
Nate Lawson
a07c38209c Add a new include to handle generic CPU interfaces. 2005-02-04 05:31:10 +00:00
Warner Losh
0ccd166961 Minor style nits
o remove unneeded {}
o no need to bzero sc
2005-02-04 02:32:43 +00:00
Peter Grehan
79393893e8 - recognize 7447A/7448 CPUs (used in miniMacs)
- enable 745x branch caches. Already enabled by OpenFirmware
on Macs, but reduces NetBSD diffs and usable by embedded folk.

Obtained from:	NetBSD
2005-02-04 01:59:48 +00:00
Peter Grehan
6d2d8acaf4 - add wall_cmos_clock and adjkerntz variables, required by msdosfs
- support adjkerntz sysctl to silence NTP, though it's a null
  implementation at the moment.
2005-02-04 01:41:38 +00:00
Peter Grehan
911e488a03 Convert bus_space_barrier() into a null inline function rather than an
empty macro to avoid many compile warnings in the USB code.
2005-02-04 01:27:21 +00:00
Peter Grehan
4e895c543a - add definitions for MPC7447A/7448 (i.e. miniMac)
- expand MPC745X_P macro to include these

Obtained from:	NetBSD
2005-02-04 01:17:04 +00:00
Peter Grehan
9e8e140099 HID0 updates:
- updated relevant models for High BAT enable bit
 - fixed bug in BHTCLR/XAEN constants
 - added LRSTK and FOLD bits
2005-02-04 01:14:38 +00:00
Warner Losh
e1500f0d18 Sort PANASONIC products numerically 2005-02-03 23:45:20 +00:00
Warner Losh
b73f46cfbb takawata tells me that KXLC0003 also works with this driver, so add it
to the list.  Note it is untested.

Also kill some whitespace at the end of the line...
2005-02-03 23:39:29 +00:00
Scott Long
176a8c17c6 Remove the entries for isp and ispfw instead of leaving them in an inconsistent
state.
2005-02-03 23:10:17 +00:00
Matthew N. Dodd
1f005b6723 - Split out PCI support.
- Add previously removed ISA support.

Submitted by:	David S. Madole <david AT madole.net>
2005-02-03 23:01:01 +00:00
Ruslan Ermilov
2154e70d14 Connect ng_device(4) to the build. 2005-02-03 19:54:58 +00:00
John Baldwin
aa96fcdb61 Anytime we write to the RTC's status B register to possibly enable
interrupts, read from the interrupt status register to clear any pending
interrupts.  Otherwise in some rare cases the RTC would never fire any
interrupts as it constantly thinks it has an interrupt pending.

PR:		i386/17800
PR:		kern/76776
Submitted by:	Jose M. Alcaide jose at we dot lc dot ehu dot es
MFC after:	2 weeks
2005-02-03 19:06:03 +00:00
Sam Leffler
cb212bbc75 correct check for unicast key being setup; wpa_supplicant in particular
uses only the global key state so looking in the per-node key slot is wrong

Submitted by:	Tai-hwa Liang
2005-02-03 16:21:07 +00:00
Ruslan Ermilov
27667f5821 MFlibc: Remove extra closing parenthesis. 2005-02-03 15:51:39 +00:00
Pawel Jakub Dawidek
f3830f0482 We do want to print '\n'/'\r'.
Pointed out by:	stefanf
2005-02-03 15:47:30 +00:00
Pawel Jakub Dawidek
6513f57682 'c' cannot be -1.
Submitted by:	stefanf
2005-02-03 15:23:27 +00:00
Pawel Jakub Dawidek
f627315f1e - Move gets() function to libkern (I want to use it outside vfs_mount.c).
- Add buffer size limitations (overflow will not be possible anymore).
- Add 'visible' option, which will allow for passphrase reading in the
  future.
- Remove special treatment of '@' and '#', those two are only confusing.

Discussed with:	rwatson
MFC after:	2 weeks
2005-02-03 15:10:58 +00:00
Ruslan Ermilov
72369c34ac Parse "getifname" using the standard parse string type.
Fixed an off-by-one error when dealing with interface name
(if_xname is NUL-terminated).

Don't waste time making a copy of if_xname in constructor.
2005-02-03 13:03:31 +00:00
Ruslan Ermilov
96f82336ba Fixed an off-by-one error when dealing with interface name
(if_xname is NUL-terminated).

Don't waste time making a copy of if_xname in attach().
2005-02-03 12:54:18 +00:00
Ruslan Ermilov
bbb75d7844 Fixed an off-by-one error when dealing with interface name
(if_xname is IFNAMSIZ-sized and NUL-terminated).
2005-02-03 12:50:10 +00:00
Ruslan Ermilov
c60878f0d2 Added ASCII version of the NGM_EIFACE_GET_IFNAME message, "getifname". 2005-02-03 11:52:42 +00:00
Ruslan Ermilov
c266fbc2aa Removed unused includes. 2005-02-03 11:28:53 +00:00
Robert Watson
faabfac9ff When entering siocnputc() with (kdb_active), don't acquire (or
release) the sio spin mutex, as use of synchronization primitives in
the debugger can result in substantial problems.  With this patch in
place entering the debugger via a serial console is made
substantially more reliable.

MFC after:	1 week
Tested by:	kris
Discussed with:	bde
2005-02-03 10:35:05 +00:00
Ruslan Ermilov
2f533ec052 Fix alignment in the last commit. 2005-02-03 08:07:22 +00:00
Peter Grehan
bd985cab34 - remove NO_MODULES since they've been working for some time
- add -fno-omit-framepointer to CFLAGS if DDB is enabled so
  backtraces will still work when optimization is enabled.
  Stolen from Makefile.amd64.
2005-02-03 06:28:17 +00:00
Peter Grehan
042bbe552f Don't build syscons, uart or vpo on PPC. 2005-02-03 06:12:43 +00:00
Peter Grehan
6109ca7e1a Fix up assignment of negative number to char. Char's are unsigned by
default on PowerPC.

Approved by:	mdodd
2005-02-03 02:35:28 +00:00
Warner Losh
ddf71f18a9 MF dev/wi: merge the pccard lists.
# this hasn't compiled for two weeks and no one noticed!

MFC After: 7 days or so
2005-02-03 00:40:35 +00:00
Peter Grehan
55a5dcc8fe Don't lose the frame pointer for PPC modules: backtrace doesn't work. 2005-02-02 23:44:24 +00:00
Jeff Roberson
9087d86e66 - Use a seperate malloc tag for saved inode contents to help in debugging
memory modified after free errors.

Sponsored by:	Isilon Systems, Inc.
2005-02-02 20:30:47 +00:00
Jeff Roberson
ff05fd5d77 - Correct a typo in kern_rename. tvfslocked should be initialized from
tond and not fromnd.  This could lead us to leak Giant, or unlock it
   twice, depending on the filesystems involved.  renames within a single
   filesystem would not have caused any problems.

Sponsored by:	Isilon Systems, Inc.
2005-02-02 17:17:15 +00:00
Robert Watson
f2ccd228d1 Define SI_SUB_AUDIT, the system boot event to initialize the audit
subsystem.

Obtained from:	TrustedBSD Project
Submitted by:	Wayne Salamon <wsalamon at computer dot org>
2005-02-02 14:41:03 +00:00
Robert Watson
9b9f45231e Add a stub audit_kevents.h, which defines exactly one audit event:
AUE_NULL.  This is a place-holder to allow other audit infrastructure
to be introduced, such as an updated syscalls.master file format,
while the license on the real audit_kevents.h is fixed.
2005-02-02 14:27:36 +00:00
Ken Smith
87c29bf93e Back out previous commit, bde@ provided an example of something this
breaks.
2005-02-02 14:21:01 +00:00
Ruslan Ermilov
fcee8ae2e5 Fix the comment. 2005-02-02 14:02:40 +00:00
Ruslan Ermilov
48039d2d1d Whitespace and "const" changes to reduce diffs to RELENG_4.
(Gives the same object when compiled without NETGRAPH_DEBUG.)
2005-02-02 13:27:03 +00:00
Robert Watson
79888acfcb Add a place-holder f_label void * for a future struct label pointer
required for the port of SELinux FLASK/TE to FreeBSD using the MAC
Framework.
2005-02-02 10:55:32 +00:00
Pyun YongHyeon
fee4d88e0f Fix "Duplicate mbuf free panic".
The cause of "Duplicate mbuf free panic" is in the programming
error of hme_load_txmbuf(). The code path of the panic is the
following.

1. Due to unknown reason DMA engine was freezed. So TX descritors
   of HME become full and the last failed attempt to transmit a
   packet had set its associated mbuf address to hme_txdesc
   structure. Also the failed packet is requeued into interface
   queue structure in order to retrasmit it when there are more
   available TX descritors.

2. Since DMA engine was freezed, if_timer starts to decrement its
   counter. When if_timer expires it tries to reset HME. During
   the reset phase, hme_meminit() is called and it frees all
   associated mbuf with descriptors. The last failed mbuf is also
   freed here.

3. After HME reset completed, HME starts to retransmit packets
   by dequeing the first packet in interface queue.(Note! the
   packet was already freed in hme_meminit()!)

4. When a TX completion interrupt is posted by the HME, driver
   tries to free the successfylly transmitted mbuf. Since the
   mbuf was freed in step2, now we get "Duplicate mbuf free panic".

However, the real cause is in DMA engine freeze. Since no fatal
errors reported via interrupts, there might be other cause of
the freeze. I tried hard to understand the cause of DMA engine
freeze but couldn't find any clues. It seems that the freeze
happens under very high network loads(e.g. 7.5-8.0 MB/s TX speed).

Though this fix is not enough to eliminate DMA engine freeze it's
better than panic.

Reported by:	jhb via sparc64 ML
2005-02-02 08:35:11 +00:00
Ken Smith
0fac1537a2 It was noticed that we do not change a file's access time when it gets
executed.  This appears to violate most of the UNIX-ish standards.
One example quote from:

  http://www.opengroup.org/onlinepubs/009695399/functions/exec.html

    Upon successful completion, the exec functions shall mark for update
    the st_atime field of the file. If an exec function failed but was
    able to locate the process image file, whether the st_atime field is
    marked for update is unspecified. Should the exec function succeed,
    the process image file shall be considered to have been opened with
    open().

This appears to take care of it for ufs filesystems, doing the necessary
sanity checks (read-only filesystem, etc) without violating any other
standards (setting atime for any open appears to be allowed in any standards
I could find).

Noticed by:	cperciva
Reviewed by:	kan, rwatson
2005-02-02 00:21:38 +00:00
Jeff Roberson
37c15216fc - Or MPSAFE with the correct set of flags in stat(). This affected only
the LOOKUP_SHARED case.

Spotted by:	jhb
2005-02-01 23:43:46 +00:00
Poul-Henning Kamp
deb27882e8 Forgot to mark the IRQ as MPSAFE. 2005-02-01 20:34:47 +00:00
Warner Losh
8d2ad0b460 The two PLANEX cards listed in pccarddevs, identified only by their
CIS, weren't actually used anywhere (other than the generic PC Card
code when certain variables are defined).  They aren't used in NetBSD
either.  Make things simpler by removing them.  Change PLANEX_2 to
PLANEX and tweak wi and owi to use that instead.  The PLANEX id seems
to actually be pci ID assigned to planex, not its pcmcia id.  Ooops.
I don't know if this is a reporting error from where this entry came
from, or if it is a mistake on PLANEX's part.  I suspect the latter,
as ACTIONTEC and NEWMEDIA made the same mistake (although new media
may be because it uses an advansys chip inside).  Make a note of this
in the file.  The 0xc entires may be JEITA assigned, so note that as
well.

# This leaves just 3 entries that are totally unknown: airvast, archos
# and edimax although the arivast number is the same assigned to
# avertec in usb...
2005-02-01 18:28:09 +00:00
Poul-Henning Kamp
83820457eb Add a IEEE488 driver for PCIIA compatible cards.
This driver implements "unaddressed listen only mode", which is what
printers and plotters commonly do on GP-IB busses.

This means that you can capture print/plot like output from your
instruments by configuring them as necessary (good luck!) and

	cat -u /dev/gpib0l > /tmp/somefile

Since there is no way to know when no more output is comming you
will have to ctrl-C the cat process when it is done (that is why
the -u is important).
2005-02-01 16:59:23 +00:00
Gleb Smirnoff
6aa1da2917 In case of various tunneling protocols, mbuf may pass several interfaces
before entering ng_netflow. In this case it will have not NULL m_pkthdr.rcvif.
However, it will enter ng_iface soon with another index. So let in_ifIndex
value configured by user override m_pkthdr.rcvif.

Reported by:	Damir Bikmuhametov
MFC after:	1 week
2005-02-01 14:07:05 +00:00
Peter Grehan
70134d768c - change all u_int_XX to uint_XX
- cast param for atomic_subtract_long, since Netgraph uses it.
2005-02-01 11:17:24 +00:00
Warner Losh
7c61c21042 BUS_SPACE_UNRESTRICTED shouldn't be used with the bus_alloc_resource
interface.  Instead, move to the convenience _any interface.
2005-02-01 07:43:34 +00:00
Nate Lawson
3d7d8f614b Sort functions. 2005-02-01 06:36:27 +00:00
Bosko Milekic
737cd9525b Update copyright, remove "all rights reserved" (since they are not
all reserved, as the lisence makes clear), and strike the third clause
(now this is a 2-clause liberal BSDL as are the rest of files I hold
copyright over).
2005-02-01 03:17:52 +00:00
Bernd Walter
1e0b0c0f97 add cpu_idle support for 21066A based lca systems 2005-01-31 23:07:42 +00:00
Shunsuke Akiyama
4b6cd0347a Use a taskqueue to handle port status changes.
Calling ucom layer directly from interrupt context make a panic.

MFC after:	1 week
2005-01-31 13:58:10 +00:00
Warner Losh
1f0ce611b3 nit in /*- 2005-01-31 08:16:45 +00:00
Scott Long
bad60c0db6 Yikes! Fix a typo in a function name that managed to occur twice.
Submitted by: yongari
2005-01-31 07:28:04 +00:00
Marcel Moolenaar
a2e25ee10d Add the keyboard system device before we probe for the keyboard.
The presence or absence of a keyboard does not change whether an
UART is designed as a keyboard port or not and thus whether we
can use the port as a TTY or not.
We now call sunkbd_attach() even when we didn't previously find
a keyboard. Emit a useful message stating that no keyboard was
found, but don't do anything else.

MFC after: 5 days
2005-01-31 04:31:22 +00:00
Marcel Moolenaar
2554d6b9b4 Revert rev. 1.5.
It should be safe to attach to all Z8530 controllers again. In fact,
the keyboard works on Ultra 2 machines.

MFC after: 5 days
2005-01-31 04:25:48 +00:00
Robert Watson
06456da2c6 Update an additional reference to the rate of ISN tick callouts that was
missed in tcp_subr.c:1.216: projected_offset must also reflect how often
the tcp_isn_tick() callout will fire.

MFC after:	2 weeks
Submitted by:	silby
2005-01-31 01:35:01 +00:00
Scott Long
9e521c8906 Remove a dead vtophys() reference. 2005-01-31 01:26:22 +00:00
Christian S.J. Peron
0ba04c87b3 Change the state allocator from using regular malloc to using
a UMA zone instead. This should eliminate a bit of the locking
overhead associated with with malloc and reduce the memory
consumption associated with each new state.

Reviewed by:	rwatson, andre
Silence on:	ipfw@
MFC after:	1 week
2005-01-31 00:48:39 +00:00
Robert Watson
54082796aa Have tcp_isn_tick() fire 100 times a second, rather than HZ times a
second; since the default hz has changed to 1000 times a second,
this resulted in unecessary work being performed.

MFC after:		2 weeks
Discussed with:		phk, cperciva
General head nod:	silby
2005-01-30 23:30:28 +00:00
Marcel Moolenaar
e6fff3fa54 Fix a logic bug that caused DSR to never be deasserted.
MFC after: 5 days
2005-01-30 22:14:30 +00:00
Alan Cox
8e99783b25 Update the text of an assertion to reflect changes made in revision 1.148.
Submitted by: tegge

Eliminate an unnecessary, temporary increment of the backing object's
reference count in vm_object_qcollapse().  Reviewed by: tegge
2005-01-30 21:29:47 +00:00
Ruslan Ermilov
40c378386c Build "digi" on i386, pc98, and amd64 only. 2005-01-30 19:41:12 +00:00
Robert Watson
024105493d Prefer (NULL) spelling of (0) for pointers.
MFC after:	3 days
2005-01-30 19:29:47 +00:00
Robert Watson
77c16eed7c Remove clause three from tcp_syncache.c license per permission of
McAfee.  Update copyright to McAfee from NETA.
2005-01-30 19:28:27 +00:00
Scott Long
7765040ebc Add crashdump support to the ips driver. It only works for the more modern
ServeRAID 4 - 7 models right now.  Support for older cards is possible, but
I don't have any hardware to experiment with.

Thanks to Jack Hammer at Adaptec for providing debugging hints.

Sponsored by: ImproWare AG, Switzerland
2005-01-30 17:45:45 +00:00
Maxim Konovalov
7449260bfd o Fix a typo.
Submitted by:	Niclas Zeising
2005-01-30 16:42:23 +00:00
Robert Watson
98d13cb3ff Insert an explicit McAfee license, as we use a stock two-clause BSD
license rather than the slightly custom licence in ufsread.c.
2005-01-30 14:58:00 +00:00
Gleb Smirnoff
41ee6cfca0 Move sb_state to the beginning of structure, above sb_startzero member.
sb_state shouldn't be erased, when socket buffer is flushed by sorflush().

When sb_state was bzero'ed, a recently set SBS_CANTRCVMORE flag was cleared.
If a socket was shutdown(SHUT_RD), a subsequent read() would block on it.

Reported by:	Ed Maste, Gerrit Nagelhout
Reviewed by:	rwatson
2005-01-30 13:11:44 +00:00
Gleb Smirnoff
8b02df2485 Log changes of link state.
Reviewed by:	rwatson
2005-01-30 12:57:47 +00:00
Robert Watson
69f832b45c Update copyright for NETA->McAfee. 2005-01-30 12:38:47 +00:00
Marcel Moolenaar
d3477e8f82 o Enable puc(4) and uart(4).
o  Disable ofw_console(4), sab(4) and zs(4).

sab(4) and zs(4) are disabled because the hardware controlled by
them is handled by uart(4)+puc(4) and the latter combination is
functionally complete and up to date.

ofw_console(4) is disabled because it doesn't claim the device it
controls (through OFW) and thus interferes with puc(4)+uart(4),
which has sufficient knowledge to extract the necessary information
from OFW to setup the console. Put differently, ofw_console(4) is
not a proper device driver and can only do harm. Its functionality
is completely handled by uart(4).

This commit makes uart(4) the default driver for serial ports.

MFC after: 2 weeks
2005-01-30 09:27:49 +00:00
Marcel Moolenaar
c3c16fcb7b o Fix the various interrupt related problems caused by reverse
engineering the pending interrupt sources from the current
   state of the controller. For channel A we can always read the
   interrupt pending register (RR3). For channel B we can read
   the interrupt vector register (RR2) because it contains the
   modified vector and thus includes the interrupt source.
   Since we currently need puc(4) for the Z8530, we know that
   the interrupt handler for both channels will be called and
   thus that RR3 will always be read at least once, even if ch A
   has no pending interrupt.
   NOTE: The modified interrupt vector has no value that represent
   a lack of pending interrupt for channel B. That is, the
   value read when no interrupts are pending is the same as the
   value for the special receive condition. Fortunately, we don't
   actually have to depend on that interrupt source. This does
   mean that we need to properly handle the overflow condition,
   when we read received character from the chip.
o  The DSR signal is represented by the SYNC bit in the external
   status register (RR0). We now properly track DSR.
o  It's save to enable the external/status interrupt source. We
   now get interrupts when line signals (DSR, DCD or CTS) change.

Problems fixes:
o  interrupt storms.
o  blocked open(2).
o  lack of (hardware) flow control.
o  unable to report DSR.

MFC after: 5 days
2005-01-30 09:00:50 +00:00
Maxim Sobolev
4379219537 Boot away another stackgap (one of the lest ones in linuxlator/i386) by
providing special version of CDIOCREADSUBCHANNEL ioctl(), which assumes that
result has to be placed into kernel space not user space. In the long run
more generic solution has to be designed WRT emulating various ioctl()s
that operate on userspace buffers, but right now there is only one such
ioctl() is emulated, so that it makes little sense.

MFC after:	2 weeks
2005-01-30 08:12:37 +00:00
Maxim Sobolev
a6886ef173 Extend kern_sendit() to take another enum uio_seg argument, which specifies
where the buffer to send lies and use it to eliminate yet another stackgap
in linuxlator.

MFC after:	2 weeks
2005-01-30 07:20:36 +00:00
Maxim Sobolev
ec217396c4 Fix build on AMD64 (and probably other arches where size_t != int).
Submitted by:	Tinderbox
MFC after:	2 weeks
2005-01-30 06:43:17 +00:00