Commit graph

39416 commits

Author SHA1 Message Date
Alan Cox d1dc776d9d Lock some manipulations of the vm object's flags. 2003-04-13 23:43:34 +00:00
Jake Burkholder 50e24eb628 - Move the routine for flushing all user mappings from the tlb from pmap to
the cpu dependent files.  It will need to be done differently for USIII.
- Simplify the logic for detecting context rollovers.  Instead of dealing
  with it when the next context switch would cause the context numbers to
  rollover, deal with it when they actually do rollover.
- Move some things around in cpu_switch so that we only do 1 membar #Sync
  when switching address space, instead of 2.
- Detect kernel threads by comparing the new vm space to vmspace0, instead
  if checking if the tlb context is 0.
- Removed some debug code.
2003-04-13 21:54:58 +00:00
Poul-Henning Kamp 073834e69b Add definitions for location of the magic sequence and the length
of a partition entry.
2003-04-13 21:52:22 +00:00
Jake Burkholder 2373499592 Made vmspace0 non-static. Its useful to be able to identify a vmspace as
the kernel vmspace.
2003-04-13 21:29:11 +00:00
Alan Cox e2479b4fc3 Lock some manipulations of the vm object's flags. 2003-04-13 20:22:02 +00:00
Alan Cox b077a36297 Lock some manipulations of the vm object's flags. 2003-04-13 19:36:18 +00:00
Alan Cox fdff41609d Add new macros for locking and unlocking a vm object. 2003-04-13 18:39:47 +00:00
Poul-Henning Kamp 7c1d57b6e8 Since dynamic allocation of device major numbers so far have not
resulted in any earthquakes, civil wars or early onset hair-loss,
I think we can do without the printf announcing the assigned number.
2003-04-13 15:27:49 +00:00
Poul-Henning Kamp 3924ad705e Time has run from the "run GEOM in userland" harness, and the new regression
test is built to test GEOM as running in the kernel.

This commit is basically "unifdef -D_KERNEL" to remove the mainly #include
related code to support the userland-harness.
2003-04-13 09:02:06 +00:00
Max Khon 7d0de413cb Driver for Granch SBNI16 SHDSL modem
Submitted by:	Denis I. Timofeev <timofeev@granch.ru>
MFC after:	1 week
2003-04-13 06:27:13 +00:00
Jeffrey Hsu 983985c11e No need to unlock if error detected before locking.
Submitted by:	harti
2003-04-13 06:21:02 +00:00
Alan Cox e96c181d16 Use vm_object_pip_wait() rather than reimplementing it. 2003-04-13 05:10:44 +00:00
Yoshihiro Takahashi ba32bfe24e The dpt, ex and idt modules are for i386 only. 2003-04-13 01:32:03 +00:00
Alan Cox f279b88deb Permit vm_object_pip_add() and vm_object_pip_wakeup() on the kmem_object
without Giant held.
2003-04-13 00:43:48 +00:00
Alan Cox f31c239da1 Eliminate unnecessary gotos from kmem_malloc(). 2003-04-13 00:23:42 +00:00
Jeff Roberson a5f099d0c4 - Unbreak priority prop. for timeshare threads. Always place something on
the current queue if its priority is really elevated.  This needs more work
   as there are cases where a next queue kse could be holding up what would
   be a curr queue kse, and thus hurting interactivity.  Also, when a thread
   with an elevated priority has its priority lowered it should be placed
   back on the next queue.
2003-04-12 22:33:24 +00:00
Poul-Henning Kamp 537d9274dc If we hit access ahead of a spoil event, we should have negative
delta access-counts and proceed.
2003-04-12 17:04:34 +00:00
Poul-Henning Kamp 2b454c0ae5 Fix a bug which resulted in orphanization getting confused every now
and then.
2003-04-12 16:36:19 +00:00
Poul-Henning Kamp ad3648813c protoypes for the dos_partition encoding functions. 2003-04-12 10:07:12 +00:00
Dag-Erling Smørgrav ed9adee74c Options that go into homonymous headers shouldn't specify the header name.
Submitted by:	Hiten Pandya <hiten@unixdaemons.com>
2003-04-12 09:40:37 +00:00
Poul-Henning Kamp 5f5a9022b2 Retire the experimental bio_taskqueue(), it was not quite as usable as
hoped.  It can be revived from here, should other drivers be able to
use it.
2003-04-12 09:13:01 +00:00
Poul-Henning Kamp 2b69c2d76a Remove the unused ioctl routine. 2003-04-12 08:44:54 +00:00
Poul-Henning Kamp 0d3e96e39c Retire the "frontstuff" record keeping, it was no match for the
in-band meta-data of BSD labels and a more complex solution will be needed.
2003-04-12 08:41:26 +00:00
Poul-Henning Kamp 6e03422af0 Move the functions for encoding decoding struct dos_partition into
a separate .c file so they can be used from userland as well.
2003-04-12 08:34:40 +00:00
Jeff Roberson 9bca28a703 - Clean up some debug code left over from my earlier megacommit. 2003-04-12 07:28:36 +00:00
Jeff Roberson b5c4c4a7e5 - We only care about the base priority. Ignore the SCHED_FIFO_BIT so that
we dont get confused.

Reported and debugged by:	Steve Kargl <sgk@troutmask.apl.washington.edu>
2003-04-12 07:00:16 +00:00
Hidetoshi Shimokawa 8b8d5d06d1 fix typo in the previous commit. 2003-04-12 06:43:28 +00:00
Mike Silbersack 53dcc544a8 Rename MBUF_FRAG_TEST to MBUF_STRESS_TEST as it will be extended
to include more than just frag tests.
2003-04-12 06:11:46 +00:00
David Xu f9b89f7e3e Style fix. 2003-04-12 02:54:46 +00:00
Kelly Yancey f563420e8d Fix race between a process registering a NOTE_EXIT EVFILT_PROC event and
the target process exiting which causes attempts to register the kevent
to randomly fail depending on whether the target runs to completion before
the parent can call kevent(2).  The bug actually effects EVFILT_PROC
events on any zombie process, but the most common manifestation is with
parents trying to monitor child processes.

MFC after:	2 weeks
Sponsored by:	NTT Multimedia Communications Labs
2003-04-12 01:57:04 +00:00
Jeff Roberson 86711bae9b - Use the sched_nice() api instead of setting the nice value directly.
Tested by:	Steve Kargl <sgk@troutmask.apl.washington.edu>
2003-04-12 01:05:19 +00:00
David Xu 5312b1c7fa Check SIG_HOLD action ealier to avoid missing test it in later code. 2003-04-12 00:38:47 +00:00
Jeff Roberson a22ec9d8f2 - Call sched_exit_{kse,thread} and sched_fork{kse,thread} so that thr works
with ULE.  This was not strictly required by sched_4bsd.
2003-04-11 19:24:37 +00:00
Jeff Roberson 141ad61c78 - Add sched_exit_*
- Call sched_exit_kse() from sched_exit() instead of implementing it here.
2003-04-11 19:24:00 +00:00
Jeff Roberson 58177de2de - Only select kseqs with more than one kse to steal. The running kse
is reflected in the load now and you can't very well migrate that.
2003-04-11 18:40:34 +00:00
Jeff Roberson c36ccfa22b - When migrating a kse from one kseq to the next actually insert it onto
the second kseq's run queue so that it is referenced by the kse when
   it is switched out.
 - Spell ksq_rslices properly.

Reported by:	Ian Freislich <ianf@za.uu.net>
2003-04-11 18:37:34 +00:00
Mitsuru IWASAKI d75de53699 Add new sysctl MIB (hw.acpi.supported_sleep_state) to indicate
the list of supported sleep state.
This should help people understand what following message means.

acpi0: AcpiGetSleepTypeData failed - AE_NOT_FOUND

MFC after:	3 days
2003-04-11 16:53:56 +00:00
Mike Barcroft 4e0ee531f2 Clarify NO_SWAPPING description. 2003-04-11 14:48:13 +00:00
David Xu 2257a44ffd Copy %gs from current CPU not from a stale PCB backup. 2003-04-11 14:47:34 +00:00
David Xu d8c586e73a set_user_ldt_rv() should check same proc not thread,
this commit fixes an user LDT smp rendezvous bug.
2003-04-11 14:45:07 +00:00
Andrew Gallatin 9720c4f309 Style(9) a comment added in previous commit.
Pointed out by: bde
2003-04-11 13:30:32 +00:00
Maxime Henrion 20f0c80f6f - Call ether_ifdetach() before shutting down the hardware.
- Remove a useless device_is_alive() check.
- Disable interrupts if bus_child_present() so that this
  check is more useful.

This fixes the hangs I was seeing when unloading the fxp driver.

Suggestions from:	hsu, njl
2003-04-11 12:52:52 +00:00
Alan Cox a4c9ca4f83 The data in an sf_buf should not be modified by the mbuf system. Mark
the mbuf as read only.

Reviewed by:	gallatin
2003-04-11 07:02:36 +00:00
Jeff Roberson 15dc847e52 - Add a SYSCTL node for the ule scheduler.
- Allow user adjustable min and max time slices (suggested by hiten).
 - Change the SLP_RUN_MAX to 100ms from 2 seconds so that we learn whether a
   process is interactive or not much more quickly.
 - Place a process on the current run queue if it is interactive or if it is
   running at an interrupt thread priority due to priority prop.
 - Use the 'current' timeshare queue for interrupt threads, realtime threads,
   and idle threads that are running at higher priority due to priority prop.
   This fixes problems where priorities would have been elevated but we would
   not check the timeshare run queue until other lower priority tasks were
   no longer runnable.
 - Keep an array of loads indexed by the priority class as well as a global
   load.
 - Keep an bucket of nice values with a count of the number of kses currently
   runnable with that nice value.
 - Keep track of the minimum nice value of any running thread.
 - Remove the unused short term sleep accounting.  I was attempting to use
   this for load balancing but it didn't work out.
 - Define a kseq_print() for use with debugging.
 - Add KTR debugging at useful places so we can easily debug slice and
   priority assignment.
 - Decouple the runq assignment from the kseq assignment.  kseq_add now keeps
   track of statistics.  This is done so that the nice and load is still
   tracked for the currently running process.  Previously if a niced process
   was added while a non nice process was running the niced process would
   still get a slice since it was not aware of the unnice process.
 - Make adjustments for the sched api changes.
2003-04-11 03:47:14 +00:00
Jeff Roberson f7f9e7f34d - Catch up with sched api changes. 2003-04-11 03:39:48 +00:00
Jeff Roberson f6f230febe - Adjust sched hooks for fork and exec to take processes as arguments instead
of ksegs since they primarily operation on processes.
 - KSEs take ticks so pass the kse through sched_clock().
 - Add a sched_class() routine that adjusts a ksegrp pri class.
 - Define a sched_fork_{kse,thread,ksegrp} and sched_exit_{kse,thread,ksegrp}
   that will be used to tell the scheduler about new instances of these
   structures within the same process.  These will be used by THR and KSE.
 - Change sched_4bsd to reflect this API update.
2003-04-11 03:39:07 +00:00
Maxime Henrion 7a648f56cf I deserve a big pointy hat for having missed all those references
to bus_dmasync_op_t in my last commit.
2003-04-10 23:50:06 +00:00
Maxime Henrion b983c7b3ed - Clean up the fxp_release() and fxp_detach() functions.
- Be sure to teardown the interrupt first so that "kldunload if_fxp"
  doesn't panic the box.  It's now deadlocking rather than crashing,
  which isn't really better, but I'm unsure this is fxp(4)'s fault.
- Change a bus_dmamap_sync() call to also do a BUS_DMASYNC_PREREAD
  now that we can pass several operations.
2003-04-10 23:15:12 +00:00
Dag-Erling Smørgrav 0da46d776b Convert the SMP_TSC kernel option into a loader tunable. Also enable
the TSC timecounter on single-CPU systems even when they are running
an SMP kernel.
2003-04-10 23:07:24 +00:00
Maxime Henrion 141bacb048 Change the operation parameter of bus_dmamap_sync() from an
enum to an int and redefine the BUS_DMASYNC_* constants as
flags.  This allows us to specify several operations in one
call to bus_dmamap_sync() as in NetBSD.
2003-04-10 23:03:33 +00:00
Robert Watson cacd79e2c9 Remove a potential panic condition introduced by reduced TCP wait
state.  Those changed attempted to work around the changed invariant
that inp->in_socket was sometimes now NULL, but the logic wasn't
quite right, meaning that inp->in_socket would be dereferenced by
cr_canseesocket() if security.bsd.see_other_uids, jail, or MAC
were in use.  Attempt to clarify and correct the logic.

Note: the work-around originally introduced with the reduced TCP
wait state handling to use cr_cansee() instead of cr_canseesocket()
in this case isn't really right, although it "Does the right thing"
for most of the cases in the base system.  We'll need to address
this at some point in the future.

Pointed out by:	dcs
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-04-10 20:33:10 +00:00
Andrew Gallatin cbd0150530 Enable loadable modules to be unloaded on alphas with shared isa
interrupts  by only disabling the interrupt in hardware if
the handler being removed is the only handler.
2003-04-10 20:32:29 +00:00
John Baldwin d8fed0f0f2 - Kill the pv_flags member of the alpha mdpage since it stop being used
in rev 1.61 of pmap.c.
- Now that pmap_page_is_free() is empty and since it is just a hack for
  the Alpha pmap, remove it.
2003-04-10 18:42:06 +00:00
Robert Watson 854e7ea788 Check M_TRYWAIT as a flag, not a constant, in MBTOM() mbuf allocator
to malloc flag converter.
2003-04-10 17:52:10 +00:00
Julian Elischer 060563ec50 Move the _oncpu entry from the KSE to the thread.
The entry in the KSE still exists but it's purpose will change a bit
when we add the ability to lock a KSE to a cpu.
2003-04-10 17:35:44 +00:00
Jake Burkholder fff890d0e8 Print real memory/avail memory on startup like other platforms. Hide
printing the model under bootverbose.
2003-04-10 17:18:52 +00:00
Søren Schmidt 4379543ce8 Spell 55 with two '5's 2003-04-10 12:56:33 +00:00
Søren Schmidt 041187d122 Add a few more older SiS ID's. 2003-04-10 12:24:39 +00:00
Matthew N. Dodd 5bff20ef7c Add quirk for LOGITECH WMRPAD.
Submitted by:	Mathew Kanner <mat@cnd.mcgill.ca>
2003-04-10 08:25:09 +00:00
Matthew N. Dodd 17a22e1463 - Add LOGITECH WMRPAD, MOTOROLA SB410, and SANDISK SDDR05.
- Regenerate.
2003-04-10 08:24:33 +00:00
Warner Losh 81f290a510 Fix interrupt race.
From NetBSD
2003-04-10 07:55:55 +00:00
Warner Losh cb339c7cd9 SMC 8041 is the same thing as LINKSYS COMBO_ECARD, so no extra entry
is required.  NetBSD has one because it checks for the mac address
match as well wanting to give its own string in the description.
Since we do neither, we don't need a separate entry.

# I suspect that a few of the COREGA cards might fall into that category
# as well, but since I don't have access to any of them it is hard to know
# for sure.
2003-04-10 07:35:19 +00:00
Warner Losh 843aa7b528 Add Billionton CFLT10N and SMC8041 (although I'm not 100% sure the latter is
needed).  Remove duplicate kingston kne2 entry.

Info obtained from NetBSD
2003-04-10 07:24:18 +00:00
Warner Losh 46d5f4e726 Remove bogus line and entry, restore cnet ne2000 add smc 8041 2003-04-10 07:21:11 +00:00
Wes Peters c2ff1e1682 Add a sysctl that records and reports the CPU clock rate calculated
at boot.  Funny how often this trivial piece of information crops up
in embedded boxen.

Sponsored by:   St. Bernard Software
2003-04-10 07:05:24 +00:00
Warner Losh 227e700639 reorganize the supported card table. We don't need the enet_vendor or
enet_mcast fields, so remove them.  Sort.  Eliminate now duplicate
entries.

This reorg saves about 500 bytes in the binary.  I've tested this only
with a couple of cards, so please let me know if I've broken anything.
2003-04-10 07:04:39 +00:00
Warner Losh 1cf793aaaf Sync to 1.46 2003-04-10 06:59:35 +00:00
Warner Losh 2b358bf2dc MFNetBSD:
1.182; christos
	A cardflash NE2000 from Michael Francini
	1.181; perry
	support Corega PCCL-11 -- from Christopher SEKIYA in PR 20932
	1.180; ichiro
	add product TOSHIBA PA2673U CBIDE2 (IODATA OEM)
	1.179; kanaoka
	Add SMC 8041TX 10/100 Ether PC Card.
2003-04-10 06:58:40 +00:00
Warner Losh 649a9521d5 Don't set the description if NULL. 2003-04-10 06:08:27 +00:00
Warner Losh 5414629575 Don't lock in the attach routine. It isn't required. Register the
interrupt handler last.  This gets rid of the sleep while locked
messages.

Reviewed by: ambrisko
2003-04-10 05:12:45 +00:00
Warner Losh f5746231ff Make sure that pp_name is non-null before setting the device
description.  This allows us to rely entirely on the CIS entries if
necessary...
2003-04-10 04:36:02 +00:00
Warner Losh 2701fed4cf Back out the _ND change. I plan on making all drivers default to that with
a special _DESC version for those cards whose CIS is insufficient for some
reason.  This should save about 3k of kernel strings when complete.
2003-04-10 04:14:35 +00:00
Warner Losh 7de3ac49a9 In [bsd-nomads:16650] shibagaki-san presented an example product id of
0 in a problem that is being discussed.  That means that the test for
product != 0 may cause problems.  Looking at pccarddevs (which i
should have done earlier) we see:

product	BONDWELL B236		0x0000 Game Card Joystick
product CONTEC CNETPC		0x0000 Contec C-NET(PC)C
product IBM MICRODRIVE		0x0000 IBM Microdrive
product RAYTHEON WLAN		0x0000 WLAN Adapter
product SOCKET EA_ETHER		0x0000 Socket Communications EA
product TDK LAK_CD011WL		0x0000 TDK LAK-CD011WL

so use only the vendor field for the end sentinel.
2003-04-10 04:11:15 +00:00
Warner Losh 67af3913a3 It appears that msdosfs_init() is called multiple times. This happens
on my system where I preload msdosfs and have it in my kernel.
There's likely another bug that's causing msdosfs_init() to be called
multiple times, but this makes that harmless.
2003-04-10 00:13:12 +00:00
Warner Losh 68d25868d0 1.37 was committed prematurely: back out until I can commit all parts at the
same time.
2003-04-09 22:10:28 +00:00
Warner Losh 60feb70860 1.77 was bogus: there is no logic bug. Back it out and compare the
correct fields instead.
2003-04-09 22:07:02 +00:00
John Baldwin 685a76429a Fix a logic bug in previous commit (use || rather than &&). In order to
terminate the loop only when both the name and vendor are zero, we should
keep looping so long as either one is not zero.
2003-04-09 21:24:23 +00:00
Mike Barcroft 9c9265929b Add prototypes for change_root() and change_dir(). 2003-04-09 17:41:46 +00:00
Warner Losh 7e9b53e399 Make sure that both pp_name and pp_vendor are zero to know we're at the
end of the list now that some valid entries don't have pp_name set.  Also,
don't print a warning if pp->name is NULL and it is a total wildcard.
2003-04-09 15:54:00 +00:00
Maxime Henrion acabcf7d83 Correct maxsize/maxsegsz parameters to bus_dma_tag_create(). 2003-04-09 15:05:19 +00:00
Jake Burkholder 87b91b10ef Add ahd. 2003-04-09 14:58:28 +00:00
Jake Burkholder ab89b20ced Compile with PAE. 2003-04-09 14:58:02 +00:00
Poul-Henning Kamp cf83284fe3 Only be verbose if (bootverbose) 2003-04-09 13:52:40 +00:00
Poul-Henning Kamp 551e52efb8 With the magic sequence checks removed this class is downright dangerous
to have in your kernel since it indiscriminately attaches to anything
it is offered with a range of bogus partitions.

Stop this from happening by rejecting any label with negative numbers in
it.
2003-04-09 13:08:36 +00:00
Poul-Henning Kamp 4e8bfe1482 Add a couple of undocumented test options to MD(4) to aid in regression
testting of GEOM.
2003-04-09 11:59:29 +00:00
Poul-Henning Kamp 13ac082b26 Correctly split cyl/sects bytes when we print them. 2003-04-09 09:21:33 +00:00
Poul-Henning Kamp 2692cc08db Style issue: use do {...} while(0); for multi-exit section. 2003-04-09 08:56:26 +00:00
Matthew N. Dodd efddc6c820 At least pretend to handle USB_GET_REPORT_ID. 2003-04-09 08:43:01 +00:00
Mike Barcroft 94d079eb1f Regen. 2003-04-09 02:57:29 +00:00
Mike Barcroft fd7a8150fb o In struct prison, add an allprison linked list of prisons (protected
by allprison_mtx), a unique prison/jail identifier field, two path
  fields (pr_path for reporting and pr_root vnode instance) to store
  the chroot() point of each jail.
o Add jail_attach(2) to allow a process to bind to an existing jail.
o Add change_root() to perform the chroot operation on a specified
  vnode.
o Generalize change_dir() to accept a vnode, and move namei() calls
  to callers of change_dir().
o Add a new sysctl (security.jail.list) which is a group of
  struct xprison instances that represent a snapshot of active jails.

Reviewed by:	rwatson, tjr
2003-04-09 02:55:18 +00:00
Mike Silbersack db5f2ca8df Fix if_vr's handling of vr_encap failures. 3 parts:
- Don't bother setting OACTIVE when the descriptors are all full
  or there's a vr_encap failure, it doesn't help anything.
- Correctly roll back on the descriptor list after a failure
  so as not to corrupt the list.
- Add a missing VR_UNLOCK().

Without these changes, vr_encap failure (which is assured during
a low mbuf situation) would result in the card locking until
the watchdog could fire.

MFC after:	1 week
2003-04-09 02:21:54 +00:00
Matthew N. Dodd cf0e07e504 Sync with NetBSD.
- Bump shared library version on libusbhid.
- Retire libusbhid.h; it is called usbhid.h now.
- hid_start_parse() takes a third argument.
- hid_locate() takes a fifth argument.
- hid_report_size() order of arguments changes.
- Other changes, including formatting and whitespace.

Bump __FreeBSD_version.

This change will break all third party applications that rely on previous
FreeBSD specific behavior.
2003-04-09 01:52:49 +00:00
Maxime Henrion 06283c3ba9 The fxp(4) driver is now working on sparc64 too!
Tested by:	jake
2003-04-08 20:55:30 +00:00
Poul-Henning Kamp d2e0ecd0f0 Almost the finished article.
Boost sample rate to 1.25 MSPS since that allows us to use a 5Mhz
(/4) or 10Mhz (/8) external clock.

Make the interrupt both MPSAFE and FAST, at 610 interrupts a second,
and a max time to service of 5 msec, we brake for nobody.

Use kernel thread to accumulate into the 25 possible wave signals.

Use #ifdef _KERNEL to let .c file double as .h file defining the ioctls.
2003-04-08 19:12:48 +00:00
Maxime Henrion 209b07bc4c - Pass a busdma tag and a busdma map to fxp_dma_wait() so that
it can do the necessary bus_dmamap_sync() calls.
- While I'm here, reorder arguments to match other functions.
2003-04-08 18:56:45 +00:00
Maxime Henrion 14fd107181 Add an XXX comment for the atomic operation in the __alpha__
case so that it doesn't confuse more people.  Use the more
correct atomic_clear_16() instead of atomic_clear_short().
2003-04-08 18:35:51 +00:00
Alan Cox b8831f8d68 Remove some dead code. 2003-04-08 18:24:28 +00:00
Jake Burkholder ac00210525 Remove invalid cast to vm_offset_t to avoid truncating a physical address
when doing pmap_kextract on a 2MB page.

Spotted by:	peter
Sponsored by:	DARPA, Network Associates Laboratories
2003-04-08 18:22:41 +00:00
Søren Schmidt 71ec78e340 Fix breakage on sparc64.
Note to self: always test even the smallest changes on all platforms.
2003-04-08 18:01:30 +00:00
Maxime Henrion bafb64af4f - Endian fixes.
- 6 -> ETHER_ADDR_LEN.
2003-04-08 17:21:15 +00:00
Warner Losh b899d58ee4 Use the new _ND macros to not include the description strings. If any
of the entries have a description, we'll use that to override the
description that the pccard layer generates for us.

This saves about 930 bytes in the module, so I feel it won't hurt the
crowded boot disks....

# other modules to follow
2003-04-08 15:36:43 +00:00
Warner Losh bf1f89d49c Create new _ND versions to allow one to not specify the description be
stored in the table.
2003-04-08 15:28:58 +00:00
Warner Losh c3805dd0ad Don't set the decription, since the pccard layer does that for us now.
Remove the duplicate entries that were there to disambiguate different
cards that were the same, yet people wanted to have different dmesg.
2003-04-08 15:26:02 +00:00
Dag-Erling Smørgrav fe58453891 Introduce an M_ASSERTPKTHDR() macro which performs the very common task
of asserting that an mbuf has a packet header.  Use it instead of hand-
rolled versions wherever applicable.

Submitted by:	Hiten Pandya <hiten@unixdaemons.com>
2003-04-08 14:25:47 +00:00
Maxime Henrion 50d81222d8 Fix the hangs people have been seeing. For some reason, the
atomic operation change caused this, so backout it until I
can figure out what's wrong with it.
2003-04-08 13:05:11 +00:00
Marcel Moolenaar 302d51fcb2 Remove COMPAT_FREEBSD4. It's impossible because FreeBSD 4 does not
run on ia64 at all.
2003-04-08 08:32:00 +00:00
Jake Burkholder a12efae1ea Merged from kern_thread.c 1.113, avoid a panic in cpu_throw when the first
thread of a multithreaded process exits.

This unrelated and possibly wrong change was not mentioned in the commit
message for kern_thread.c 1.113.
2003-04-08 08:13:47 +00:00
Søren Schmidt 08312d8f48 Fix a long standing bug in handling the last part of a stripe
on "odd" size disks.

Add printout of the RAID structure on verbose boot.
2003-04-08 07:48:52 +00:00
David Xu 36f7b36f8a Inherit blocked thread's context for upcall thread. 2003-04-08 07:45:56 +00:00
Warner Losh 6d9fcd03be MFp4: when you can't allocate a resource, print a message, don't panic. 2003-04-08 07:05:16 +00:00
Warner Losh 6586fa7c43 MFP4:
o don't access struct resource members directly.
o Set a default device description based on the CIS name.
2003-04-08 07:02:03 +00:00
Warner Losh 0540e305b6 u_int*_t -> uint*_t
-1 -> 0xffffffff
2003-04-08 06:59:20 +00:00
Warner Losh 307def65f1 Don't need to read this config register if we're just going to
overwrite it in the next line.
2003-04-08 06:54:10 +00:00
Warner Losh 9713a7922e MFp4: Massively unbreak module loading/unloading:
o Only complain about detached children that aren't pccard/cardbus.
o Don't NULL out the pccarddev and cbdev devices.  detach just
  disassociates the device and driver.  It doesn't delete the child.
o on driver added, just probe_and_attach the children.  If there's
  any children attached, wakeup the device add/delete thread.
o wakeup the add/delete thread with the correct cv_signal() rather
  than the bogus wakeup(sc).  It used to be that we did a tsleep on
  sc in this thread, but switched to the more reliable cv stuff a while
  ago w/o changing this.
o Remove bogus checks when reallocating memory for the registers.  They
  weren't needed and turned out to be completely bogus.

This lets me load/unload pccard with a pccard in a slot and have the
child correctly detach/attach.  This should help people that have wi
in their kernel, but that kldload cbb and pccard, for example.
2003-04-08 06:52:16 +00:00
Jake Burkholder 58d7ebfa7c Use vm_paddr_t for physical addresses. 2003-04-08 06:35:09 +00:00
Mike Silbersack 2590e88477 Quick fix so that the watchdog timer is not set unless packets are
actually queued for transmission.  Without this, a low memory situation
would trigger false watchdog timeouts.

MFC after:	1 week
2003-04-08 03:32:52 +00:00
Mike Silbersack ee9ad95f0e Fix up callers of xl_encap so that they handle a failure response
properly (likely due to mbuf exhaustion.)  Previously, the driver
got somewhat wedged.

Also, remove the annoying messages printed every time xl_encap
couldn't allocate a mbuf; they served no useful purpose, and just made
an mbuf exhaustion situation more annoying.

MFC after:	1 week
2003-04-08 01:05:54 +00:00
Maxime Henrion d73e2e5593 Correct the maxsize and maxsegsz parameters for the
bus_dma_tag_create() calls.  Without this, fxp(4) + PAE
would consume insane amounts of bounce pages.
2003-04-07 17:02:44 +00:00
Jake Burkholder a3b3689ff3 Add a PAE kernel config. This includes GENERIC through the config include
mechanism, and then excludes device drivers which have not been tested or
are known to not work with more than 4G of ram.

Sponsored by:	DARPA, Network Associates Laboratories
2003-04-07 16:23:14 +00:00
Jake Burkholder fce2287796 Add support for bounce buffers to _bus_dmamap_load_buffer, which is the
backend for bus_dmamap_load_mbuf and bus_dmamap_load_uio.

- Increaes MAX_BPAGES to 512.  Less than this causes fxp to quickly runs out
  of bounce pages.
- Add an argument to reserve_bounce_pages indicating wether this operation
  should fail or be queued for later processing if we run out of memory.
  The EINPROGRESS return value is not handled properly by consumers of
  bus_dmamap_load_mbuf.
- If bounce buffers are required allocate minimum 1 bounce page at map
  creation time.  If maxsize was small previously this could get truncated
  to 0 and the drivers would quickly run out of bounce pages.
- Fix a bug handling the return value of alloc_bounce_pages at map creation
  time.  It returns the number of pages allocated, not 0 on success.
- Use bus_addr_t for physical addresses to avoid truncation.
- Assert that the map is non-null and not the no bounce map in
  add_bounce_pages.

Sponsored by:	DARPA, Network Associates Laboratories
2003-04-07 16:08:32 +00:00
Warner Losh 0b269efc05 resync 2003-04-07 15:36:46 +00:00
Maxime Henrion 2c6c094714 Remove an erroneous htole16(). The byte_count field in the
struct fxp_cb_config is a 6-bit field, not a 16-bit integer
as in struct fxp_cb_tx.
2003-04-07 14:53:30 +00:00
Jake Burkholder 46ea68dd10 Better fix for previous previous which still allows the 4megs of kva at
the top of the address space to be reclaimed.  The problem is that with
the APTD gone the mapable kernel address space runs right to the end of
the 32 bit address space.  As a max this is 0x100000000, which can't be
represented in 32 bits, so we have to use ptd entry n-1 and pte offset
n-1, instead of ptd entry n and pte offset 0.  There's still 1 page we
can't use, but we gain just under 4 megs of kva (8 megs with PAE).

Sponsored by:	DARPA, Network Associates Laboratories
2003-04-07 14:27:19 +00:00
Søren Schmidt b5855cd133 Minor cleanup of the ATA RAID code. 2003-04-07 14:14:29 +00:00
Søren Schmidt 1b39bd2412 Third round of updates to the ATA driver.
More DMA cleanups, including fix for breakage on older Promise controllers.

Add more ways of getting to the ATA registers.
2003-04-07 14:12:12 +00:00
Murray Stokely 65793abdff Add ID for Kawasaki LSI Inc. USB-Ethernet, rev 1.00/2.02 adapter.
PR:		kern/50064
Submitted by:	Scott Renfro <scott@renfro.org>
MFC after:	3 days
2003-04-07 10:26:59 +00:00
Matthew N. Dodd efc5f672bd - Add PCI support (Adaptec AHA-2920/A,Future Domain TMC-18XX/3260).
- Reduce duplicated code.

PR:             50427
Submitted by:   Bob Bishop <rb@gid.co.uk>
2003-04-07 10:13:25 +00:00
Murray Stokely 887938c12f Fix typo.
PR:		kern/50504
Submitted by:	Alex Semenyaka <alexs@snark.ratmir.ru>
MFC after:	3 days
2003-04-07 10:06:48 +00:00
Murray Stokely 13b051bb51 Correct typos.
PR:		kern/50619
Submitted by:	Gavin Atkinson <gavin.atkinson@ury.york.ac.uk>
MFC after:	3 days
2003-04-07 09:42:45 +00:00
Matthew N. Dodd acdf797d1a Retire these files. 2003-04-07 01:25:40 +00:00
Maxime Henrion 5f361cbe0e Move a bus_dmamap_sync() to the correct place. 2003-04-06 23:16:00 +00:00
Maxime Henrion ec6b76b760 Because alpha can't access memory in 16-bit granularity,
we're using an atomic operation to clear the suspend flag
in fxp_start().  Since other architectures may need the
same thing, we want to do it all the time and not only
in the __alpha__ case.  However, we don't want to use
atomic operations on 16-bit integers, because those may
not be available on any architecture.  We're thus faking
a 32-bit atomic operation here.  This patch also deals
with endianness here.
2003-04-06 23:09:57 +00:00
Alan Cox 270086ec64 Sufficient access checks are performed by vmapbuf() that calling useracc()
is pointless.  Remove the calls to useracc().
2003-04-06 22:21:03 +00:00
Maxime Henrion d45d97d1fc Revert the s/u_int/u_int8_t/ changes, we can't really use other
integer types than int with bit-fields in a portable way.

Prodded by:	bde
2003-04-06 21:35:45 +00:00
Marcel Moolenaar ca13bfade5 Remove the 32KB VHPT section from the kernel image. We don't really
use it because we allocate a VHPT based on the size of the physical
memory and even if the allocated VHPT is 32KB, we don't use the in-
image section for it. Since the VHPT must be naturally aligned, we
save 48K on average (due to alignment).
Consequently, we start off with the VHPT disabled (it is assumed
the VHPT is disabled because the EFI loader runs without memory
address translation and thus has no need to setup the VHPT). It's
probably a good idea to explicitly disable the VHPT if we make the
use of the VHPT optional.
2003-04-06 21:31:26 +00:00
Alan Cox 6134838f99 Sufficient access checks are performed by vmapbuf() that calling useracc()
is pointless.  Remove the call to useracc().

Don't reinitialize fields that are already initialized by getpbuf().

Reviewed by:	tegge
2003-04-06 19:26:30 +00:00
Dag-Erling Smørgrav 093395d3d5 Initialize the PIIX timecounter in piix_attach(), which is called only
once, instead of doing it in piix_probe(), which is called every time
the PCI bus is rescanned.
2003-04-06 18:42:22 +00:00
Jake Burkholder b5250c9f8d Remove a largely useless statistic (its kept elsewhere too). 2003-04-06 18:18:17 +00:00
Jake Burkholder c81c0cf196 Make the pmap stats writeable. It can be useful to clear them. 2003-04-06 18:17:31 +00:00
Scott Long e48fff82ef Add support for the CLIE 5.0 series of PDAs 2003-04-06 17:34:50 +00:00
Scott Long 2a33b44247 Regen from usbdevs v.116 2003-04-06 17:34:08 +00:00
Scott Long 4ba81f4602 Regen 2003-04-06 17:32:39 +00:00
Scott Long e220a08537 Add ID's for the CLIE 5.0 series and the Belkin F5U109 usb->serial adapter. 2003-04-06 17:32:12 +00:00
Jake Burkholder 92fed30a07 Use the vis block copy/zero functions for pmap_copy_page and pmap_zero_page.
These are called through function pointers so that different implementations
can be provided for cheetah, where the block load instructions may or may
not be a win, and so they can be disabled with the machdep.use_vis tunable.
In terms of raw bandwidth the integer versions are faster, but not allocating
lines in the L2 cache for useless data gives a measurable improvement in user
time for the benchmarks I tested (mostly buildworld with -j8).

As far as I can tell the instructions used are implemented on everything
back to UltraSPARC I, so there should not be a problem with different cpu
types.
2003-04-06 17:05:26 +00:00
Jake Burkholder 3e9a6ab3a1 Ignore attempts to pmap_kremove or pmap_qremove pages which do not have
a valid mapping.  This is bug for bug compatible with other platforms.
2003-04-06 15:14:24 +00:00
Peter Wemm 30f445e056 Zap some a.out leftovers 2003-04-06 06:28:08 +00:00
Marcel Moolenaar 9fac9065b5 Also set the access bit in the PTE when we get a data dirty bit fault.
This avoids an immediate access bit fault when we serviced the dirty
bit fault in case the access bit is unset. This typically happens for
newly allocated memory that's being zeroed and thus very common.
2003-04-06 05:55:36 +00:00
Peter Wemm 67db8b23c3 Search for "elf32 kernel" (and elf64) and "elf32 module" (and elf64)
as well as "elf kernel" and "elf module".  This is a precursor to
x86-64 support in the i386 loader so it can load an elf64 x86-64 kernel.
2003-04-06 05:20:00 +00:00
Maxime Henrion 01c516b02a Use __FBSDID. 2003-04-06 01:27:12 +00:00
Maxime Henrion 6835a8accc Correct the definition of the link_addr and rbd_addr fields
in struct fxp_rfa.  This should have been committed with my
last endianness fixes.
2003-04-06 01:11:38 +00:00
Maxime Henrion 83e6547df1 - Instead of rolling our own alignment-safe function, use le32enc()
which deals with both endianness and alignment issues.
- Collect low-hanging fruits for endianness safety.
- Use 0xffffffff instead of -1 where appropriate.
2003-04-06 01:04:17 +00:00
Alan Cox 0b556837a9 Remove an unnecessary trunc_page() from vmapbuf().
Reviewed by:	tegge
2003-04-06 00:40:54 +00:00
Maxime Henrion 467295e056 - Use __FXP_BITFIELDX macros to make the configuration bitfield
endian safe.
- Change some u_int to u_int8_t which make more sense here since
  we're really defining bytes.  That produces the same code due to
  how bitfields work.
- Add the definition of the vlan_drop_en bit (not used yet).
- Add some useful comments.

Obtained from:	NetBSD
2003-04-05 23:46:58 +00:00
Maxime Henrion cc9beb7b77 Use bus_dmamap_load_mbuf() instead of bus_dmamap_load() for the
RX part of this driver too.  It's better since the code wasn't
dealing with bus_dmamap_load() returning EINPROGRESS, and this
can't happen with bus_dmamap_load_mbuf().

Submitted by:	jake
2003-04-05 23:24:23 +00:00
Alan Cox ef38cda165 Don't reinitialize fields that are already initialized by getpbuf(). 2003-04-05 23:02:58 +00:00
Peter Wemm c81e825f6c Unbreak the !LAZY_SWITCH case. I #ifdef'ed too much when I added
the ifdefs prior to commit and killed the same-address-space test.

Submitted by:	bde
2003-04-05 22:18:14 +00:00
Alan Cox cdb06eda66 Sufficient access checks are performed by vmapbuf() that calling
useracc() is pointless.  Remove the call to useracc() from physio().

Reviewed by:	tegge
2003-04-05 21:19:58 +00:00
Marcel Moolenaar 2206cb596f Include <geom/geom_disk.h> and stop including <sys/disk.h>. The
former gives us 'struct disk'.
2003-04-05 21:14:05 +00:00
Alan Cox 2ac8b16089 Remove GIANT_REQUIRED from getpbuf(). Reviewed by: tegge
Reduce pbuf_mtx's scope in relpbuf().  Submitted by: tegge
2003-04-05 21:01:16 +00:00
Olivier Houchard 0a65bc0775 Fix ed compilation with PAE by using %jx instead of %x. 2003-04-05 18:12:36 +00:00
Olivier Houchard 18a6505b16 Use vm_paddr_t instead of vm_offset_t for the paddr parameter of vesa_mmap. 2003-04-05 18:08:22 +00:00
Maxime Henrion 4cec16537d - Change a FXP_NRFABUFS which would have been a FXP_NTXCB.
- Correct some bus_dmamap_sync() calls.

Submitted by:	jake
2003-04-05 12:43:21 +00:00
Maxime Henrion 201afb0e56 Setup our interrupt only at the end of fxp_attach(), when all
other allocations/initializations have been successful.  I kinda
doubt it will fix the recent breakage that some people are seeing,
but this could have caused problems for sure.
2003-04-05 01:27:17 +00:00
Tor Egge fd6d48b8e8 Add SMP_TSC option, which can be used on SMP systems where the TSCs
are synchronized to reduce context switch cost.
2003-04-04 23:54:46 +00:00
Poul-Henning Kamp fb89eb1ed7 Add a rudimentary but working driver for the Adlink "NuDaq PCI-9812".
This is a 4 channel 20 msps 12 bit ADC card.

Anyone wanting to play with GNUradio or similar can start here.
2003-04-04 18:53:04 +00:00
Dag-Erling Smørgrav 9f45b2da8f Define ovbcopy() as a macro which expands to the equivalent bcopy() call,
to take care of the KAME IPv6 code which needs ovbcopy() because NetBSD's
bcopy() doesn't handle overlap like ours.

Remove all implementations of ovbcopy().

Previously, bzero was a function pointer on i386, to save a jmp to
bzero_vector.  Get rid of this microoptimization as it only confuses
things, adds machine-dependent code to an MD header, and doesn't really
save all that much.

This commit does not add my pagezero() / pagecopy() code.
2003-04-04 17:29:55 +00:00
Poul-Henning Kamp f54a02fb2b Retire <sys/diskslice.h> 2003-04-04 16:57:51 +00:00
Poul-Henning Kamp 197e5e73ef Libdisk does not need to include <sys/diskslice.h> any more.
Move the remaining bits of <sys/diskslice.h> to <i386/include/bootinfo.h>

Move i386/pc98 specific bits from <sys/reboot.h> to
<i386/include/bootinfo.h> as well.

Adjust includes in sys/boot accordingly.
2003-04-04 16:35:16 +00:00
MIHIRA Sanpei Yoshiro e0926f607f Add NE2000DVF_AX88190 flag to Corega FEther PCC-TXD
(see also /etc/defaults/pccard.conf rev.1.172)
2003-04-04 14:46:50 +00:00
MIHIRA Sanpei Yoshiro e21115ab06 fix typo 2003-04-04 14:40:01 +00:00
Dag-Erling Smørgrav e1fec84a4a ovbcopy -> bcopy 2003-04-04 12:56:20 +00:00
Dag-Erling Smørgrav 2aebee88f3 Replace ovbcopy() with bcopy(). 2003-04-04 12:15:20 +00:00
Dag-Erling Smørgrav 212059bd83 Replace memcpy() and ovbcopy() with bcopy(); ditch some caddr_t usage. 2003-04-04 12:14:00 +00:00
Dag-Erling Smørgrav f7854568f5 Don't use ovbcopy(). 2003-04-04 12:12:34 +00:00
Dag-Erling Smørgrav 7283c97574 Don't use ovbcopy(); use void * instead of char *. 2003-04-04 12:11:46 +00:00
Dag-Erling Smørgrav 8543efae60 The kernel bcopy() is safe for overlapping regions (and always has), so
there is no use for a separate ovbcopy().
2003-04-04 12:10:04 +00:00
Dag-Erling Smørgrav e8c7f48855 Rename a static variable to avoid future conflicts. 2003-04-04 12:08:42 +00:00
Jake Burkholder d1d03c2b72 Bandaid fix for previous commit while I figure out why it broke. This
caused crashes early in boot on i386 UP machines.

Reported by:	phk
Pointy hat to:	jake
2003-04-04 10:09:44 +00:00
Orion Hodson ba548c643a Additional codec ids. 2003-04-04 07:37:25 +00:00
Orion Hodson 538b04e4ad Fix mismatch between bus address stored for buffer descriptors and
actual address of buffer descriptor.  This should fix the reported
calibration failures and subsequent speed problems with ich chipsets.

Minor calibration comment updates.
2003-04-04 07:15:19 +00:00
Alan Cox 06363906bc o Remove useracc() calls from aio_qphysio(); they are redundant
given the checks performed by vmapbuf().

Reviewed by:	tegge
2003-04-04 06:26:28 +00:00
Alan Cox 08468b6ad7 o Check the b_bufsize passed to vmapbuf() returning an error
if it is invalid.
 o Remove a debugging printf() from vmapbuf().

Suggested by:   tegge
2003-04-04 06:14:54 +00:00
Marcel Moolenaar 117f919160 Remove `#ifndef lint' left behind after previous change. 2003-04-04 02:12:56 +00:00
Jake Burkholder 163529c2b3 - Removed APTD and associated macros, it is no longer used.
BANG BANG BANG etc.

Sponsored by:	DARPA, Network Associates Laboratories
2003-04-03 23:44:35 +00:00
David E. O'Brien 8368cf8f75 Use __FBSDID rather than rcsid[]. 2003-04-03 21:36:33 +00:00
Maxime Henrion 5353c9b6ba Remove useless initialization. 2003-04-03 20:39:43 +00:00
Paul Saab 9e7313bba7 Add support for the HP Smart Array 6400 EM
Change the interrupt mask for the Smart Array 6xxx controllers after
discussions w/ HP.
2003-04-03 20:09:27 +00:00
Poul-Henning Kamp 63f253709f Retire the DIOCGMBR ioctl before anybody starts to use it. 2003-04-03 19:37:40 +00:00
Poul-Henning Kamp b0fc6220b8 Remove BIO_SETATTR from non-GEOM part of kernel as well. 2003-04-03 19:22:32 +00:00
Poul-Henning Kamp 4eba52a2d2 Remove all references to BIO_SETATTR. We will not be using it. 2003-04-03 19:19:36 +00:00
Poul-Henning Kamp ab0ff32ea1 Update the initializer for GEOM_MBREXT, I overlooked it previously. 2003-04-03 19:05:03 +00:00
Poul-Henning Kamp 4c763c77dc Add #define for DOSPTYP_PMBR, and use it. 2003-04-03 18:55:16 +00:00
Jake Burkholder 6412c65cf0 Add optimized block copy and zero functions using vis instructions, which
can do 64 bytes at a time and don't allocate lines in the L2 cache.  These
assume that everything is 64 byte aligned, and that there's more than 128
bytes of data (best for whole pages).  The block load and store instructions
don't follow normal memory ordering rules and require either a memory barrier
or move between registers before the data can actually be used.  This
implementation correctly shuffles around 3 out of the 4 sets of registers
in order to avoid memory barriers expect for the last 2 blocks.
2003-04-03 18:43:40 +00:00
Maxime Henrion c2a2b443e2 Fix fxp(4), this changed shouldn't have crept in.
Pointy hat to:	mux
Reported by:	Pawel Worach <pawel.worach@nordea.com>
2003-04-03 18:39:48 +00:00
Jake Burkholder 937e05327e Add support for saving and restoring kernel floating point state. The state
will be saved if we context switch as a result of an interrupt which occured
while using the floating point registers in the kernel (which actually can't
happen right now).  This allows fp disabled traps in the kernel, which
normally shouldn't happen, so make sure the trapping code is what we expect
it is.
2003-04-03 18:34:05 +00:00
Jake Burkholder 7dafcb6914 - Add space for kernel floating point registers to the pcb. These will be
used to support block copy and zero operations in the kernel which use the
  floating point registers.
- While I'm changing the size, improve the layout of struct pcb, sort by size,
  then alphabetical etc.
- Add some assertions to validate assumptions made about how the pcb is
  allocated.
2003-04-03 18:28:03 +00:00
Jake Burkholder 8e4f1e2b8a - Generally improve register usage in cpu_switch. Use the 'in' registers
for temporaries relating to the state of the new process instead of the
  outs, so that functions can be called without fear of clobbering them.
- Use savefpctx instead of rolling our own.
2003-04-03 16:36:01 +00:00
Dag-Erling Smørgrav 91b928c950 <sys/disk.h> -> <geom/geom_disk.h> 2003-04-03 16:28:57 +00:00
Jake Burkholder 02798ad7e0 Don't assume the fp state is at offset 0 in the pcb. 2003-04-03 16:04:18 +00:00
Jake Burkholder 1db34e9d43 Fix typos (don't use * when taking the size of an array). 2003-04-03 15:50:17 +00:00
Maxime Henrion e609b4d7db Remove all the bogus volatile qualifiers from the structs definitions
and associated evil casts to discard them.
2003-04-03 14:08:35 +00:00
Yoshihiro Takahashi 335ac29ccd MFi386: revision 1.188 2003-04-03 12:39:51 +00:00
Yoshihiro Takahashi 514301992a MFi386: revision 1.561 2003-04-03 12:39:18 +00:00
Poul-Henning Kamp 76c4109ebb #include <sys/endian.h> as needed. 2003-04-03 11:56:10 +00:00
Poul-Henning Kamp 4d3651f456 Remove geom_enc.c, a superset of these functions are now available in
<sys/endian.h>
2003-04-03 11:40:06 +00:00
Poul-Henning Kamp d8cb8a5137 Use <sys/endian.h> instead of geom_enc.c for endianess-agnostification. 2003-04-03 11:36:53 +00:00
Poul-Henning Kamp 82db45a5af Use sys/endian.h instead of geom_enc.c for endian-agnostfication. 2003-04-03 11:33:51 +00:00
Poul-Henning Kamp 4a36c1fdf3 Pointy hat commit:
Don't Cut&Paste from big endian to little endian function without subsequent
adjustments.
2003-04-03 11:32:01 +00:00
Poul-Henning Kamp 68f156409e Make sure we don't ignore error codes. 2003-04-03 11:19:24 +00:00
Poul-Henning Kamp 43e7e03ae6 Use "unsigned char" instead of "u_char" to avoid trouble. 2003-04-03 10:21:58 +00:00
Poul-Henning Kamp 8f24aac6b9 Add support for Moxa Technologies Co., Ltd. PCI I/O Card 4S RS232
Submitted by:	sst@cybercity.dk
2003-04-03 09:47:15 +00:00
Poul-Henning Kamp 21ee4ab688 Add inline functions {be,le}{16,32,64}{enc,dec}() for encoding decoding
into byte strings of unknown alignment.
2003-04-03 08:58:04 +00:00
Poul-Henning Kamp 9f88fdfb88 NO_GEOM cleanup: Remove dkmakeminor(). 2003-04-03 08:51:22 +00:00
Poul-Henning Kamp 3ad3653c7a Don't use dkmakeminor(), create our own minor encoding instead. 2003-04-03 08:50:35 +00:00
Poul-Henning Kamp 70f7e53da1 Don't use dkmakeminor(), it has nothing to do with CDroms. 2003-04-03 08:49:49 +00:00
Jeff Roberson a8949de20e - Keep seperate statistics and run queues for different scheduling classes.
- Treat each class specially in kseq_{choose,add,rem}.  Let the rest of the
   code be less aware of scheduling classes.
 - Skip the interactivity calculation for non TIMESHARE ksegrps.
 - Move slice and runq selection into kseq_add().  Uninline it now that it's
   big.
2003-04-03 00:29:28 +00:00
Peter Wemm cc66ebe2a9 Commit a partial lazy thread switch mechanism for i386. it isn't as lazy
as it could be and can do with some more cleanup.  Currently its under
options LAZY_SWITCH.  What this does is avoid %cr3 reloads for short
context switches that do not involve another user process.  ie: we can
take an interrupt, switch to a kthread and return to the user without
explicitly flushing the tlb.  However, this isn't as exciting as it could
be, the interrupt overhead is still high and too much blocks on Giant
still.  There are some debug sysctls, for stats and for an on/off switch.

The main problem with doing this has been "what if the process that you're
running on exits while we're borrowing its address space?" - in this case
we use an IPI to give it a kick when we're about to reclaim the pmap.

Its not compiled in unless you add the LAZY_SWITCH option.  I want to fix a
few more things and get some more feedback before turning it on by default.

This is NOT a replacement for Bosko's lazy interrupt stuff.  This was more
meant for the kthread case, while his was for interrupts.  Mine helps a
little for interrupts, but his helps a lot more.

The stats are enabled with options SWTCH_OPTIM_STATS - this has been a
pseudo-option for years, I just added a bunch of stuff to it.

One non-trivial change was to select a new thread before calling
cpu_switch() in the first place.  This allows us to catch the silly
case of doing a cpu_switch() to the current process.  This happens
uncomfortably often.  This simplifies a bit of the asm code in cpu_switch
(no longer have to call choosethread() in the middle).  This has been
implemented on i386 and (thanks to jake) sparc64.  The others will come
soon.  This is actually seperate to the lazy switch stuff.

Glanced at by:  jake, jhb
2003-04-02 23:53:30 +00:00
John Baldwin 6751370f6f Lock the process before sending it a SIGIO. Not doing so is a panic(2)
implementation with INVARIANTS.
2003-04-02 21:54:51 +00:00
Poul-Henning Kamp 316aed030e Add handling for cancelled events in the g_call_me() methods. 2003-04-02 21:10:04 +00:00
Poul-Henning Kamp afcbcfaed0 Change events to have an array of "void *" references, and give the
event posting functions varargs to fill these.

Attribute g_call_me() to appropriate g_geom's where necessary.

Add a flag argument to g_call_me() methods which will be used to signal
cancellation of events in the future.

This commit should be a no-op.
2003-04-02 20:41:18 +00:00
Matthew N. Dodd 2c56e246fa Back out support for RFC3514.
RFC3514 poses an unacceptale risk to compliant systems.
2003-04-02 20:14:44 +00:00
Matthew N. Dodd 4f6425f7ae - Use the correct constant define.
- Add a missing break.
2003-04-02 18:02:58 +00:00
Maxime Henrion b2badf0214 Convert the fxp(4) driver to the busdma API.
This patch is rather big because I had to significantly redesign
the driver to make the busdma conversion possible.  Most notably,
hardware and software structures were carefully splitted to get
rid of all the structs overlapping evilness.

Special thanks to phk and Richard Puga <puga@mauibuilt.com> for
providing me with fxp(4) hardware to do this work.

Thanks to marcel for testing this on ia64, and to Fred Clift
<fclift@verio.net> for testing this on alpha.

Tested on:	i386, ia64, alpha
2003-04-02 16:47:16 +00:00
Jeffrey Hsu c31548c820 Need to hold the same SMP lock for (knote) list traversal as for
list manipulation.  This lock also protects read-modify-write operations
on the pipe_state field.
2003-04-02 15:24:50 +00:00
Poul-Henning Kamp 8f6da0e4ac Only orphan things if the open/close actually succeeded. 2003-04-02 13:10:40 +00:00
Poul-Henning Kamp c7e1925c7c Properly handle races between open/close and orphan.
KASSERT the race between close and strategy, it is an error in the upper
echelons if this happens,

Add XXX: comment explaining why the ioctl/orphan race is not closed.
2003-04-02 13:09:50 +00:00
Søren Schmidt b539f9d523 Instead of not grapping a request binfinish(ENOMEM) it if malloc fails. 2003-04-02 11:36:43 +00:00
Yoshihiro Takahashi cffa957106 MFi386: revisions 1.556 and 1.557.
Backout revision 1.312.
2003-04-02 10:51:06 +00:00
Yoshihiro Takahashi ca30868b63 Merged from sys/dev/syscons/syscons.c revision 1.400. 2003-04-02 10:49:48 +00:00
Matthew N. Dodd 8faf6df9b3 Sync constant define with NetBSD.
Requested by:	 Tom Spindler <dogcow@babymeat.com>
2003-04-02 10:28:47 +00:00
Jeff Roberson 5053d272c2 - Make the interactivity calculator decay faster.
- Make the pcpu estimator update faster.
2003-04-02 08:22:33 +00:00
Jeff Roberson 98c9b132d1 - I meant divide by two and not shift by two in SCHED_PRI_NHALF. 2003-04-02 08:21:24 +00:00
Jake Burkholder c2b117e7db Implement cpu_thread_setup. Fix cpu_set_upcall. 2003-04-02 08:03:42 +00:00
Jake Burkholder cef57e7624 - Make casuptr return the old value of the location we're trying to update,
and change the umtx code to expect this.

Reviewed by:	jeff
2003-04-02 08:02:27 +00:00
Jeff Roberson 245f3abfd5 - Add in support for KSEs with 0 slice values on the run queue. If we try
to select a KSE with a slice of 0 we will update its slice and insert it
   onto the next queue.
 - Pass the KSE instead of the ksegrp into sched_slice().  This more
   accurately reflects the behavior of the code.  Slices are granted to kses.
 - Add a function kseq_nice_min() which finds the smallest nice value
   assigned to the kseg of any KSE on the queue.
 - Rewrite the logic in sched_slice().  Add a large comment describing the
   new slice selection scheme.  To summarize, slices are assigned based on
   the nice value.  Priorities are still calculated based on the nice and
   interactivity of a process.  Slice sizes of 0 may be granted for KSEs
   whos nice is 20 or futher away from the lowest nice on the run queue.
   Other nice values are scaled across the range [min, min+20].  This fixes
   ULEs bad behavior with positively niced processes.
2003-04-02 06:46:43 +00:00
Jake Burkholder fc2fca74d8 - Fix UC_COPY_SIZE. Adding up the size of structure fields doesn't take
alignment into account.
- Return EJUSTRETURN from set_context on success to avoid clobbering the
  first 2 out registers with td_retval on sparc64.
2003-04-01 23:25:18 +00:00
Jake Burkholder 6e1e13b5e0 - Set the version number in the mcontext in get_mcontext and check it in
set_mcontext.
- Don't make assumptions about the alignment of the mcontext inside of the
  ucontext; we have to save the floating point registers to the pcb and then
  copy to the mcontext.
2003-04-01 23:18:13 +00:00
Jeffrey Hsu 48d2549c3e Observe conservation of packets when entering Fast Recovery while
doing Limited Transmit.  Only artificially inflate the congestion
window by 1 segment instead of the usual 3 to take into account
the 2 already sent by Limited Transmit.

Approved in principle by:	Mark Allman <mallman@grc.nasa.gov>,
Hari Balakrishnan <hari@nms.lcs.mit.edu>, Sally Floyd <floyd@icir.org>
2003-04-01 21:16:46 +00:00
Poul-Henning Kamp 817509273e #include <geom/geom_disk.h> 2003-04-01 19:00:38 +00:00
Poul-Henning Kamp 4752f7570a Include <geom/geom_disk.h> not <sys/disk.h> 2003-04-01 18:57:14 +00:00
Poul-Henning Kamp 332a2bf07b Remove the #define for bioqdisksort(), it's no longer needed. 2003-04-01 18:55:46 +00:00
Poul-Henning Kamp 812de2ed5c I think the divorce successed, so stop #including <geom/geom_disk.h> 2003-04-01 18:55:04 +00:00
Andrew Gallatin 9ef024f7b7 Add a crutch so that direct-mapped DMA works on alpha. This is a step
toward preventing this driver from crashing an alpha at boot.

Tested by: Oliver Lehmann <lehmann@ans-netz.de>
2003-04-01 16:31:12 +00:00
Poul-Henning Kamp 891619a66d Use bioq_flush() to drain a bio queue with a specific error code.
Retain the mistake of not updating the devstat API for now.

Spell bioq_disksort() consistently with the remaining bioq_*().

#include <geom/geom_disk.h> where this is more appropriate.
2003-04-01 15:06:26 +00:00
Poul-Henning Kamp 51a5b7f1ba Don't include <sys/disk.h>. 2003-04-01 13:33:28 +00:00
Poul-Henning Kamp 7c79beb3ce Start to split the GEOM/diskdriver specific bits into geom/geom_disk.h 2003-04-01 13:19:14 +00:00
Poul-Henning Kamp af6ca7f4a9 Introduce bioq_flush() function. 2003-04-01 12:49:40 +00:00
Poul-Henning Kamp a4d7a3c069 Include <sys/conf.h> rather than trusting <sys/disk.h> to do so. 2003-04-01 12:35:17 +00:00
Poul-Henning Kamp 95082542bb Add #include <sys/conf.h> so we don't rely on <sys/disk.h> doing it. 2003-04-01 12:34:47 +00:00
Jeff Roberson 120d1b9e32 - smb_td_intr takes a thread as an argument not a proc. 2003-04-01 09:24:12 +00:00
Jeff Roberson 6f39c1a1fe - smb_proc_intr is now spelled smb_td_intr.
Noticed by:	phk
Pointy hat to:	jeffr
2003-04-01 09:23:24 +00:00
Jeff Roberson c9dfa2e08b - p will be unused in cursig() if INVARIANTS is not defined. Access it
through td->td_proc to avoid the unused variable.

Spotted by:	Maxim Konovalov <maxim@macomnet.ru>
2003-04-01 09:07:36 +00:00
Poul-Henning Kamp 09bf42f50f Don't include <sys/buf.h> needlessly. 2003-04-01 09:02:58 +00:00
Poul-Henning Kamp 6f46bf604d Fix KASSERT syntax error. 2003-04-01 08:57:28 +00:00
Matthew N. Dodd 09139a4537 Implement support for RFC 3514 (The Security Flag in the IPv4 Header).
(See: ftp://ftp.rfc-editor.org/in-notes/rfc3514.txt)

This fulfills the host requirements for userland support by
way of the setsockopt() IP_EVIL_INTENT message.

There are three sysctl tunables provided to govern system behavior.

	net.inet.ip.rfc3514:

		Enables support for rfc3514.  As this is an
		Informational RFC and support is not yet widespread
		this option is disabled by default.

	net.inet.ip.hear_no_evil

		 If set the host will discard all received evil packets.

	net.inet.ip.speak_no_evil

		If set the host will discard all transmitted evil packets.

The IP statistics counter 'ips_evil' (available via 'netstat') provides
information on the number of 'evil' packets recieved.

For reference, the '-E' option to 'ping' has been provided to demonstrate
and test the implementation.
2003-04-01 08:21:44 +00:00
Poul-Henning Kamp c8d01707ba Fix KASSERT syntax errors.
Please compile LINT before commiting.
2003-04-01 08:10:21 +00:00
Poul-Henning Kamp 4a1e273c48 Remove the old config interface, the new OAM is sufficiently functional
now.
2003-04-01 07:33:56 +00:00
Poul-Henning Kamp dfb99a70d8 Remove the old config interface now that the new OAM is functional. 2003-04-01 07:33:17 +00:00
Jake Burkholder 73adf5691f - Add a flags field to struct pcb. Use this to keep track of wether or
not the pcb has floating point registers saved in it.
- Implement get_mcontext and set_mcontext.
2003-04-01 04:58:50 +00:00
Jake Burkholder 404221fe55 - Don't allow tf_wstate to be set in set_regs.
- Clear FPRS_FEF in set_fpregs so the new registers will be reloaded.
2003-04-01 04:29:03 +00:00
Jake Burkholder 8fe20fdafa Implement cpu_set_upcall. 2003-04-01 04:19:29 +00:00
Jake Burkholder f217a77ce4 - Rename pcb_fpstate to pcb_ufp (user floating point), and change it to
a simple array of 64 ints.
- Use a critical section when saving floating point state in cpu_fork
  instead of sched_lock.
2003-04-01 04:02:45 +00:00
Jake Burkholder e50173aeaa Rename pcb_fp to pcb_sp, so as to not be confused with floating point
state.
2003-04-01 03:05:46 +00:00
Tim J. Robbins a968deece9 Specify the M_WAITOK flag explicitly in the MALLOC call to silence a
runtime warning ("Bad malloc flags: 0").
2003-04-01 02:47:09 +00:00
Tim J. Robbins 788fc48e32 Give the M_WAITOK flag explicitly to the MALLOC call to silence a runtime
warning ("Bad malloc flags: 0").
2003-04-01 02:42:02 +00:00
Jake Burkholder a31794d553 Implement casuptr. 2003-04-01 02:37:04 +00:00
Jeff Roberson 4518589564 - Regen. 2003-04-01 02:34:21 +00:00
Jeff Roberson 8446303e01 - thr_exit() should no longer be called with Giant held. 2003-04-01 02:32:53 +00:00
Jeff Roberson f27bf63b8a - Mark the various thr syscalls as MP safe. Previously there was a bug if
this was not done since thr_exit() unwinds giant.
2003-04-01 02:32:07 +00:00
Jeff Roberson 2c10d16a4b - Borrow the KSE single threading code for exec and exit. We use the check
if (p->p_numthreads > 1) and not a flag because action is only necessary
   if there are other threads.  The rest of the system has no need to
   identify thr threaded processes.
 - In kern_thread.c use thr_exit1() instead of thread_exit() if P_THREADED
   is not set.
2003-04-01 01:26:20 +00:00
Jeff Roberson 8af830c374 - Regen for umtx. 2003-04-01 01:22:18 +00:00
Jeff Roberson a0704f9de9 - Add thr and umtx system calls. 2003-04-01 01:15:56 +00:00
Jeff Roberson 404c3ad471 - Add the kern_umtx.c file to the build. 2003-04-01 01:13:29 +00:00
Jeff Roberson 6eeb9653aa - Include umtx.h in files generated by makesyscalls.sh
- Add system calls for umtx.
2003-04-01 01:12:24 +00:00
Jeff Roberson 7f49f8e05b - Add an entry and a head for the queue of threads blocked on a umtx.
- Add a prototype for thr_exit1().
2003-04-01 01:11:22 +00:00
Jeff Roberson 69404b5090 - Add an api for doing smp safe locks in userland.
- umtx_lock() is defined as an inline in umtx.h.  It tries to do an
   uncontested acquire of a lock which falls back to the _umtx_lock()
   system-call if that fails.
 - umtx_unlock() is also an inline which falls back to _umtx_unlock() if the
   uncontested unlock fails.
 - Locks are keyed off of the thr_id_t of the currently running thread which
   is currently just the pointer to the 'struct thread' in kernel.
 - _umtx_lock() uses the proc pointer to synchronize access to blocked thread
   queues which are stored in the first blocked thread.
2003-04-01 01:10:42 +00:00
Jeff Roberson 90e38817b7 - We now have to include umtx.h and ucontext.h in the system call related
headers.
2003-04-01 00:35:12 +00:00
Jeff Roberson d4a63cb9c8 - Regen for thr related system calls. 2003-04-01 00:34:29 +00:00
Jeff Roberson 8d5377e538 - Add the four thr related system calls. 2003-04-01 00:31:37 +00:00
Jeff Roberson f00fea89ca - Add kern_thr.c 2003-04-01 00:30:54 +00:00
Jeff Roberson 89bb1cef1d - Add two files to support the thr threading interface.
- sys/thr.h contains the user space visible api that is intended only for
   use in threading library packages.
 - kern/kern_thr.c contains thr system calls and other thr specific code.
2003-04-01 00:30:30 +00:00
Jeff Roberson b8db34d280 - Define a new md function 'casuptr'. This atomically compares and sets
a pointer that is in user space.  It will be used as the basic primitive
   for a kernel supported user space lock implementation.
 - Implement this function in x86's support.s
 - Provide stubs that return -1 in all other architectures.  Implementations
   will follow along shortly.

Reviewed by:	jake
2003-04-01 00:18:55 +00:00
Jeff Roberson fb8aaa76c7 - In npxgetregs() use the td argument to save the fpu state from and not
curthread.  Nothing currently depends on this behavior.
 - Clean up an extra newline.

Obtained from:	bde
2003-04-01 00:16:32 +00:00
Jeff Roberson a9b34138dc - Add a placeholder for sigwait 2003-03-31 23:36:40 +00:00
Jeff Roberson 722547925e - Regen for the sig*wait* system calls. 2003-03-31 23:33:45 +00:00
Jeff Roberson 55d9ba3eac - According to mike@FreeBSD.org SIGTHR should be hiden by
#ifdef __BSD_VISIBLE
2003-03-31 23:31:50 +00:00
Jeff Roberson a447cd8b28 - Define sigwait, sigtimedwait, and sigwaitinfo in terms of
kern_sigtimedwait() which is capable of supporting all of their semantics.
 - These should be POSIX compliant but more careful review is needed before
   we announce this.
2003-03-31 23:30:41 +00:00
Thomas Quinot da4898b1d7 Revert change 1.201 (removing mapping of VAPPEND to VWRITE).
Instead, use the generic vaccess() operation to determine whether
an operation is permitted. This avoids embedding knowledge on
vnode permission bits such as VAPPEND in the NFS client.

PR:		kern/46515
vaccess() patch submitted by:	"Peter Edwards" <pmedwards@eircom.net>
Approved by:	tjr, roberto (mentor)
2003-03-31 23:26:10 +00:00
Jeff Roberson c5c34c0a76 - Move the NEEDSIGCHK and OLDMASK flags from proc to thread.
- Move the signal mask to the thread.
 - Adjust a few comments.
2003-03-31 22:51:19 +00:00
Jeff Roberson 4093529dee - Move p->p_sigmask to td->td_sigmask. Signal masks will be per thread with
a follow on commit to kern_sig.c
 - signotify() now operates on a thread since unmasked pending signals are
   stored in the thread.
 - PS_NEEDSIGCHK moves to TDF_NEEDSIGCHK.
2003-03-31 22:49:17 +00:00
Julian Elischer 0d49bb4b30 Do NOT return from an non-interruptable cv_wait, falsely
claiming to have timed out. I don't know what I was thinking..
2003-03-31 22:41:47 +00:00
Jeff Roberson a35394bd84 - Fix two calls to trapsignal() that were still passing in 'struct proc'.
These were missed in my last commit.
2003-03-31 22:41:32 +00:00
Jeff Roberson 90176341c3 - Add a signal for thread synchronization. Add an XXX so that maybe
someone more knowledgeable on standards defined namespaces may ifdef
   this out.
2003-03-31 22:30:08 +00:00
Jeff Roberson da33176f39 - Mark signals which may be delivered to any thread in the process with
SA_PROC.  Signals without this flag should be directed to a particular
   thread if this is possible.
2003-03-31 22:12:09 +00:00
Jeff Roberson 1bf4700bff - Change trapsignal() to accept a thread and not a proc.
- Change all consumers to pass in a thread.

Right now this does not cause any functional changes but it will be important
later when signals can be delivered to specific threads.
2003-03-31 22:02:38 +00:00
Jeff Roberson 772e5d8d88 - Use sigexit() instead of twiddling the signal mask, catch, ignore, and
action bits to allow SIGILL to work as expected.  This brings this file in
   line with other architectures.
2003-03-31 21:40:47 +00:00
Wes Peters f4cf2141f6 Add a facility allowing processes to inform the VM subsystem they are
critical and should not be killed when pageout is looking for more
memory pages in all the wrong places.

Reviewed by:	arch@
Sponsored by:	St. Bernard Software
2003-03-31 21:09:57 +00:00
John Baldwin 59f47d29b7 Add missing ()'s so that these drivers all compile again.
Noticed by:	jake
Tested on:	i386 (compile)
2003-03-31 20:22:00 +00:00
Jake Burkholder c82feacd9b - Allow the physical memory size that will be actually used by the kernel to
be overridden by setting hw.physmem.
- Fix a vm_map_find arg, we don't want to find space.
- Add tracing and statistics for off colored pages.
- Detect "stupid" pmap_kenters (same virtual and physical as existing
  mapping), and do nothing in that case.
2003-03-31 19:56:55 +00:00
John Baldwin 726f07979c If we fail to find our PCI ID in attach (this should never happen), then
just return ENXIO directly instead of calling tl_detach() since that would
panic since the softc mutex isn't initialized until after this check.
2003-03-31 19:24:37 +00:00