Commit graph

100233 commits

Author SHA1 Message Date
Tim J. Robbins 2df1baf643 Call __sgetc() directly in getchar() instead of taking an expensive
detour through getc().
2004-03-10 10:24:15 +00:00
Poul-Henning Kamp 5c5c7982be Use the external clock input for our PLL.
This may not be a generally valid configuration, but neither is relying
on the PCI clock to be stable.

The only currently known and supported hardware is the VPN14x1 from
Soekris, and since it has external clock, we fail safe(r) by using
it.

Unfortunately there is no way to probe this reliably.
2004-03-10 10:10:46 +00:00
Tim J. Robbins 87a6c90a99 Set the stream orientation explicitly in fgetln() instead of relying on
__srefill() to do it.
2004-03-10 09:28:38 +00:00
Poul-Henning Kamp b033c30b23 Remove the /* 1.2 */ comment which was orphaned by previous commit. 2004-03-10 09:23:27 +00:00
Tim J. Robbins d17235e59f Set stream orientation in puts(). 2004-03-10 09:15:38 +00:00
Poul-Henning Kamp b36dfb024f Put libypclnt behind NO_YP_LIBC 2004-03-10 08:58:06 +00:00
Poul-Henning Kamp 3d1d5bc3c3 Rearrange some of the GEOM debugging tools to be more structured.
Retire g_sanity() and corresponding debugflag (0x8)

  Retire g_{stall,release}_events().

  Under #ifdef DIAGNOSTIC:

    Make g_valid_obj() an official function and have it return an an
    non-zero integer which indicates the kind of object when found.

    Implement G_VALID_{CLASS,GEOM,CONSUMER,PROVIDER}() macros based
    on g_valid_obj().

    Sprinkle calls to these macros liberally over the infrastructure.

    Always check that we do not free a live object.
2004-03-10 08:49:08 +00:00
Bruce Evans c88f8102e3 Fixed a misspelling of 0 as NULL. 2004-03-10 08:46:39 +00:00
Poul-Henning Kamp 4f81134a23 Fix handling of tap/vmnet flag in relation to cloning and properly enforce
largest supported unit number for this device driver.

Reported by:	Kaho Toshikazu <kaho@easy.es.tuat.ac.jp>
2004-03-10 08:02:29 +00:00
Bill Paul a24cc63af9 Fix several issues related to the KeInitializeTimer() etc... API stuff
that I added recently:

- When a periodic timer fires, it's automatically re-armed. We must
  make sure to re-arm the timer _before_ invoking any caller-supplied
  defered procedure call: the DPC may choose to call KeCancelTimer(),
  and re-arming the timer after the DPC un-does the effect of the
  cancel.

- Fix similar issue with periodic timers in subr_ndis.c.

- When calling KeSetTimer() or KeSetTimerEx(), if the timer is
  already pending, untimeout() it first before timeout()ing
  it again.

- The old Atheros driver for the 5211 seems to use KeSetTimerEx()
  incorrectly, or at the very least in a very strange way that
  doesn't quite follow the Microsoft documentation. In one case,
  it calls KeSetTimerEx() with a duetime of 0 and a period of 5000.
  The Microsoft documentation says that negative duetime values
  are relative to the current time and positive values are absolute.
  But it doesn't say what's supposed to happen with positive values
  that less than the current time, i.e. absolute values that are
  in the past.

  Lacking any further information, I have decided that timers with
  positive duetimes that are in the past should fire right away (or
  in our case, after only 1 tick). This also takes care of the other
  strange usage in the Atheros driver, where the duetime is
  specified as 500000 and the period is 50. I think someone may
  have meant to use -500000 and misinterpreted the documentation.

- Also modified KeWaitForSingleObject() and KeWaitForMultipleObjects()
  to make the same duetime adjustment, since they have the same rules
  regarding timeout values.

- Cosmetic: change name of 'timeout' variable in KeWaitForSingleObject()
  and KeWaitForMultipleObjects() to 'duetime' to avoid senseless
  (though harmless) overlap with timeout() function name.

With these fixes, I can get the 5211 card to associate properly with
my adhoc net using driver AR5211.SYS version 2.4.1.6.
2004-03-10 07:43:11 +00:00
Robert Watson 0029e98f37 Move the AH algorithm list from a static local function variable to
a static const global variable in ah_core.c.  This makes it more clear
that this array does not require synchronization, as well as
synchronizing the layout to the ESP algorithm list.  This is the
version of my patch that Itojun committed to the KAME tree.

Obtained from:	me, via KAME
2004-03-10 04:56:54 +00:00
Alan Cox 5d328ed44b - Make the acquisition of Giant in vm_fault_unwire() conditional on the
pmap.  For the kernel pmap, Giant is not required.  In general, for
   other pmaps, Giant is required by i386's pmap_pte() implementation.
   Specifically, the use of PMAP2/PADDR2 is synchronized by Giant.
   Note: In principle, updates to the kernel pmap's wired count could be
   lost without Giant.  However, in practice, we never use the kernel
   pmap's wired count.  This will be resolved when pmap locking appears.
 - With the above change, cpu_thread_clean() and uma_large_free() need
   not acquire Giant.  (The first case is simply the revival of
   i386/i386/vm_machdep.c's revision 1.226 by peter.)
2004-03-10 04:44:43 +00:00
Robert Watson fe5a02c927 Lock down IP-layer encapsulation library:
- Add encapmtx to protect ip_encap.c global variables (encapsulation
   list).
 - Unifdef #ifdef 0 pieces of encap_init() which was (and now really
   is) basically a no-op.
 - Lock encapmtx when walking encaptab, modifying it, comparing
   entries, etc.
 - Remove spl's.

Note that currently there's no facilite to make sure outstanding
use of encapsulation methods on a table entry have drained bfore
we allow a table entry to be removed.  As such, it's currently the
caller's responsibility to make sure that draining takes place.

Reviewed by:	mlaier
2004-03-10 02:48:50 +00:00
Robert Watson 846840ba95 Scrub unused variable zeroin_addr. 2004-03-10 01:01:04 +00:00
John-Mark Gurney 0235bf0261 make sure we had the filedesc lock when calling fdinit when RFCFDG is set
on call to rfork.

Submitted by:	Brian Buchanan
Semi-Reviewed by: rwatson
2004-03-10 00:27:36 +00:00
Peter Edwards c2026e4db2 Another April Fool signs up. 2004-03-10 00:06:01 +00:00
Robert Watson e589108ddf Const-poison ethernet and FDDI broadcast address constants, as they
are accessed read-only.
2004-03-09 23:55:59 +00:00
Poul-Henning Kamp 4238829d77 Make this file more generally usable:
Trigger not only on diskless booting sysctls being set, but also
on the existence of the file "/etc/diskless".  But do not try to
extract IP# related keywords in that case.

Add a general "remount" facility to allow non-NFS remounting.
2004-03-09 23:06:50 +00:00
John Baldwin ccac9da43b Make libgeom usable by C++ programs:
- Add DECL wrappers to libgeom.h.
- Rename structure members in libgeom.h to use a lg_ prefix for member
  names.  This is required because a few structures had members named
  'class' which made g++ very unhappy.
- Catch gstat(8) and gconcat(8) up to these API changes.

Reviewed by:	phk
2004-03-09 21:14:18 +00:00
John Birrell 0b3ffb77f1 Remove duplicate code.
Requested by: bde
2004-03-09 20:53:01 +00:00
Bill Paul e86c401f10 Trim unneeded includes from if_ndis_pccard.c and if_ndis_pci.c. Also removed
unused variables from if_ndis_pccard.c
2004-03-09 20:29:21 +00:00
Robert Watson 15db03a075 Introduce stf_mtx to protect global softc list in if_stf. Add
stf_destroy() to handle the common softc destruction path for the
two destruction sources: interface cloning destroy, and module
unload.

NOTE: sc_ro, the cached route for stf conversion, is not synchronized
against concurrent access in this change, that will follow in a future
change.

Reviewed by:	pjd
2004-03-09 20:29:19 +00:00
Tim Kientzle df3c1316b0 Many fixes.
Portability: Thanks to Juergen Lock, libarchive now compiles cleanly
on Linux.  Along the way, I cleaned up a lot of error return codes and
reorganized some code to simplify conditional compilation of certain
sections.

Bug fixes:
  * pax format now actually stores filenames that are 101-154
    characters long.
  * pax format now allows newline characters in extended attributes
    (this fixes a long-standing bug in ACL handling)
  * mtime/atime are now restored for directories
  * directory list is now sorted prior to fix-up to permit
    correct restore of non-writable dir heirarchies
2004-03-09 19:50:41 +00:00
Robert Watson f5529ff4ce Introduce faith_mtx to protect the if_faith global softc list.
Push if_faith softc destruction logic into faith_destroy() so that
it can be called after softc list removal in both the clone destroy
and module unload paths.
2004-03-09 19:23:06 +00:00
Bill Paul 3e7791af10 If the resource listing obtained from BUS_GET_RESOURCE_LIST() in
ndis_probe_pci() doesn't contain an entry for an IRQ resource, try to
force one to be routed to us anyway by adding an extra call to
bus_alloc_resource(). If this fails, then we have to abort the attach.

Patch provided by jhb, tweaked by me.
2004-03-09 18:39:40 +00:00
Ruslan Ermilov 577cf233eb Make it possible to ``.undef ${VAR}'' (expanding VAR to get
the variable name to undef).

Submitted by:	Cyrille Lefevre
2004-03-09 17:36:55 +00:00
Robert Watson f25ee08633 Introduce lo_mtx to protect the global loopback softc list. I'm not
really sure why we have a softc list for if_loop, given that it
can't be unloaded, but that's an issue to revisit in the future as
corrupting the softc list would still cause panics.

Reviewed by:	benno
2004-03-09 17:27:48 +00:00
Robert Watson d6e2616ac3 Introduce disc_mtx to protect the global softc list in if_disc.
Since there are two destroy paths for if_disc interfaces --
module unload and cloan interface destroy, create a new utility
function disc_destroy(), which is callded on a softc after it
has been removed from the global softc list; the cloaner and
module unload entry paths will both remove it before calling
disc_destroy().

Reviewed by:	pjd
2004-03-09 16:31:19 +00:00
Lukas Ertl 6c8740f899 Fix an integer overflow when dealing with very large volumes. This bug
prevented newfs to work on volumes that are larger than 1TB.

PR:             63577
Submitted by:   Masaki Takakashi <mtakahashi@se.gtd.cosmo.co.jp>
Approved by:    grog (mentor), bde
2004-03-09 12:45:43 +00:00
David Malone 33dc549136 Fix the easy warnings:
1) Avoid shadowing index.
2) Constness.
3) Missing prototype for ifcmd.
4) Missing include of string.h.
5) Avoid shadowing error function.
6) ANSI definition for main.
2004-03-09 11:57:28 +00:00
David Malone a77c5ad8b7 Misc fixes brought to light by WARNS=6:
1) Constness, unusedness and size_tness.
2) Don't clobber the value returned by hid_report_size in the daemon case.
3) Don't misspell "sizeof buf" as 100.
4) Don't run off the end of a buffer if the pid is about a google.
5) Avoid shadowing the usage function.
2004-03-09 11:35:43 +00:00
Pawel Jakub Dawidek 48fbd94b4e - Don't take sectorsize from first disk. Calculate it by finding
least common multiple of all disks sector sizes.
  This will allow to safely concatenate disks with different sector sizes.
- Mark unused function arguments.
- Other minor cleanups.
2004-03-09 11:18:53 +00:00
Pawel Jakub Dawidek 810914da53 Print a space character between string given as a macro argument and
bio description.
2004-03-09 11:00:24 +00:00
Lukas Ertl ae21f5ad2c And a bandaid so that the output of "available space" is correct when
using -m and -g switches and "available space" is negative (i.e. when
the file system is already using the root-reserved minimum free space).

Obtained from:   Stefan Farfeleder <stefan@fafoe.narf.at>
PR:              bin/62536
Submitted by:    Peter van Dijk <peter@dataloss.nl>
Approved by:     grog (mentor), bde
2004-03-09 10:02:44 +00:00
Lukas Ertl 664e22ad1e Since vinum doesn't fake disklabels anymore, remove get_volume_label().
Also, remove stale write_volume_label() declaration; the write_volume_label()
function was deleted 8 months ago.

Approved by:    grog (mentor)
2004-03-09 09:50:15 +00:00
Ruslan Ermilov d56ed147ae Fixed line numbering inside the .for loops.
Submitted by:	Cyrille Lefevre
2004-03-09 08:09:33 +00:00
Nate Lawson dba55fa26d Simplify some logic in converting a buffer to an integer. 2004-03-09 05:44:47 +00:00
Nate Lawson cc58e4ee5e Use an unsigned int instead of an int for the Get/Set Integer interface.
Pointed out by:	le
2004-03-09 05:41:28 +00:00
John Birrell 44fce14365 Backout the previous revision due to objections. 2004-03-09 04:51:58 +00:00
Marcel Moolenaar 618c18c7c3 Reset the text attributes when initializing the console. The EFI
loader typically doesn't do this so that we end up booting the
with whatever the EFI loader has set it to last.
2004-03-09 04:00:33 +00:00
Nate Lawson 29f5b9a8c1 Hook CPUs up to newbus. CPUs will ultimately be a bus driver so that
multiple CPU-specific drivers can attach.  This is a work in progress
so children aren't supported yet.

Help from:	jhb
2004-03-09 03:37:21 +00:00
John Birrell 9ee4b048ae Add #ifdef CPU_SOEKRIS in the missing places around the led_* code
that is specific to those boards.

This allows this file to compile again with CPU_ELAN enabled, but not
CPU_SOEKRIS, for a Compulab board.
2004-03-09 02:51:21 +00:00
John Birrell 15afc798fd AMD's ELAN documentation says that you write to the SYS_RST register
in the Memory Mapped Configuration Region (MMCR) to reset the CPU.
If CPU_ELAN is set, try this first to reset the CPU before the
traditional way.

Without this change, my Compulab board powers down on 'reset' instead
of rebooting.
2004-03-09 02:49:24 +00:00
John Birrell 59fac1825f On 4.X it was possible for an application to initialise a local FILE
structure and call stdio functions. In 5.X this was broken when FILE
locking was introduced into libc.

This change makes most (relevant) stdio functions work again when the
_extra file in FILE isn't initialised (and can't be without a libc
function to do it since the __sFILEX structure is private to libc).
2004-03-09 02:44:59 +00:00
Mike Heffner 43acc706ac These aren't all binary options. 2004-03-09 01:20:24 +00:00
Alex Dupre c99b727a37 Fix typos.
Approved by:	blackend (mentor/implicitly)
2004-03-08 23:18:50 +00:00
Max Laier fc28f1ff5f Bump __FreeBSD_version for the pf install and write comments to UPDATING.
Approved by:	bms(mentor)
2004-03-08 22:26:46 +00:00
Max Laier 8d69c48be5 Link pf to the build and install:
This adds the former ports registered groups: proxy and authpf as well as
the proxy user. Make sure to run mergemaster -p in oder to complete make
installworld without errors.

This also provides the passive OS fingerprints from OpenBSD (pf.os) and an
example pf.conf.

For those who want to go without pf; it provides a NO_PF knob to make.conf.

__FreeBSD_version will be bumped soon to reflect this and to be able to
change ports accordingly.

Approved by:	bms(mentor)
2004-03-08 22:03:29 +00:00
Robert Watson ce89352952 Mark loadaverage callout as CALLOUT_MPSAFE.
Reviewed by:	jhb
2004-03-08 22:01:19 +00:00
Pawel Jakub Dawidek dd604e2647 Add two new sysctls:
- security.bsd.hardlink_check_uid, when set, means, that unprivileged
		users are not permitted to create hard links to files not
		owned by them,
	- security.bsd.hardlink_check_gid, when set, means, that unprivileged
		users are not permitted to create hard links to files owned
		by group they don't belong to.

OK'ed by:	rwatson
2004-03-08 20:37:25 +00:00