sobomax [Mon, 7 Feb 2005 11:35:24 +0000 (11:35 +0000)]
Fix the problem with incorrect throttling level reported immediately after
reboot. Safter the reboot the TCC is usually in the Automatic mode, in which
reading current performance level is likely to produce bogus results make sure
to switch it to the On-Demand mode and set to some known performance level.
Unfortunately there is no reliable way to check that TCC is in the Automatic
mode. Reading bit 4 of ACPI Thermal Monitor Control Register produces 0
regardless of the current mode.
harti [Mon, 7 Feb 2005 07:54:23 +0000 (07:54 +0000)]
Invent a Buf_AppendRange function that appends a non-NUL-terminated string
given by a pointer to the start of the string and a pointer one behind
the end.
delphij [Mon, 7 Feb 2005 05:45:38 +0000 (05:45 +0000)]
Revamp several Makefile nits:
- .PATH: is spelled ``.PATH: ''
- Don't forget to use DPADD so ``make checkdpadd'' is
not broken.
- LDADD should not come with + as it's empty in the
first place
iedowse [Mon, 7 Feb 2005 02:47:33 +0000 (02:47 +0000)]
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.
imp [Sun, 6 Feb 2005 21:15:19 +0000 (21:15 +0000)]
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.
njl [Sun, 6 Feb 2005 21:12:25 +0000 (21:12 +0000)]
Add support for cpufreq to power_profile(8). Values for on/offline cpu
frequencies are specified with performance_cpu_freq and economy_cpu_freq.
Of course, special values LOW and HIGH are also supported. Also, remove
old throttling support.
imp [Sun, 6 Feb 2005 21:12:22 +0000 (21:12 +0000)]
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.
njl [Sun, 6 Feb 2005 21:08:35 +0000 (21:08 +0000)]
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.
njl [Sun, 6 Feb 2005 20:12:28 +0000 (20:12 +0000)]
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.
csjp [Sun, 6 Feb 2005 16:34:49 +0000 (16:34 +0000)]
Since it is not un-common for a process's resident set size (rss)
to exceed 10 megabytes in size (especially in X), bump the max
column width from 4 bytes to 5. This will make the ps auxw output
uniform again when a process's rss exceeds 10 megs.
It should be noted that when 5 digits becomes to small, other
solutions should be explored such as displaying them in megabytes
or having ps automatically re-size column widths.
delphij [Sun, 6 Feb 2005 14:44:27 +0000 (14:44 +0000)]
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.
phk [Sun, 6 Feb 2005 13:46:39 +0000 (13:46 +0000)]
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.
njl [Sun, 6 Feb 2005 07:36:08 +0000 (07:36 +0000)]
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.
njl [Sat, 5 Feb 2005 23:16:27 +0000 (23:16 +0000)]
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.
njl [Sat, 5 Feb 2005 22:30:57 +0000 (22:30 +0000)]
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.
njl [Sat, 5 Feb 2005 22:28:36 +0000 (22:28 +0000)]
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.