Commit Graph

37591 Commits

Author SHA1 Message Date
Scott Long
5193a34646 Implement bus_dmamem_alloc_size() and bus_dmamem_free_size() as
counterparts to bus_dmamem_alloc() and bus_dmamem_free().  This allows
the caller to specify the size of the allocation instead of it defaulting
to the max_size field of the busdma tag.

This is intended to aid in converting drivers to busdma.  Lots of
hardware cannot understand scatter/gather lists, which forces the
driver to copy the i/o buffers to a single contiguous region
before sending it to the hardware.  Without these new methods, this
would require a new busdma tag for each operation, or a complex
internal allocator/cache for each driver.

Allocations greater than PAGE_SIZE are rounded up to the next
PAGE_SIZE by contigmalloc(), so this is not suitable for multiple
static allocations that would be better served by a single
fixed-length subdivided allocation.

Reviewed by:	jake (sparc64)
2003-01-29 07:25:27 +00:00
Jeff Roberson
0a016a05a4 - Use ksq_load as the authoritive count of kses on the pair of kseqs for
sched_runnable() et all.
 - Remove some dead code in sched_clock().
 - Define two macros KSEQ_SELF() and KSEQ_CPU() for getting the kseq of the
   current cpu or some alternate cpu.
 - Start introducing kseq_() functions, such as kseq_choose() and kseq_setup().
2003-01-29 07:00:51 +00:00
Mike Silbersack
d4d5315c23 Fix a bug with syncookies; previously, the syncache's MSS size was not
initialized until after a syncookie was generated.  As a result,
all connections resulting from a returned cookie would end up using
a MSS of ~512 bytes.  Now larger packets will be used where possible.

MFC after:	5 days
2003-01-29 03:49:49 +00:00
Benno Rice
a42a7e2f13 Set the termios speed based on the tty speed. This allows consoles to work at
speeds other than TTYDEF_SPEED.

Approved by:	jake
2003-01-29 02:43:35 +00:00
Hidetoshi Shimokawa
878db8920f - Fix build on alpha.
- Add a missing newline in printf.
2003-01-29 02:13:31 +00:00
Jeff Roberson
bf857e69a2 - Remove debugging code that didn't work on UP. 2003-01-29 00:26:47 +00:00
Josef Karthauser
96d11470c8 Migrate the PCI bus logic for ohci and uhci from sys/pci to sys/dev/usb. 2003-01-29 00:13:29 +00:00
Poul-Henning Kamp
4ee6e70ef3 Check bounds for index before dereferencing memory past end of array.
Found by:	FlexeLint
2003-01-28 22:44:12 +00:00
Poul-Henning Kamp
a439334437 Use VOP_SPECSTRATEGY() instead of VOP_STRATEGY(). 2003-01-28 21:46:21 +00:00
Jeffrey Hsu
93f798891a Avoid lock order reversal by expanding the scope of the
AF_INET radix tree lock to cover the ARP data structures.
2003-01-28 20:22:19 +00:00
Jake Burkholder
aff81a81d6 Remove BDE_DEBUGGER.
Discussed with:	bde
2003-01-28 19:05:44 +00:00
Poul-Henning Kamp
e263f030c9 NO_GEOM cleanup: remove subr_disklabel.c from powerpc and x86_64. 2003-01-28 16:37:22 +00:00
Poul-Henning Kamp
8d631e986e NO_GEOM cleanup: remove subr_disk{label,mbr,slice}.c from pc98 kernels. 2003-01-28 16:36:39 +00:00
Hidetoshi Shimokawa
c3e9e25542 - Allow multiple packets read/write for IR/IT to reduce system call.
- Remove unused variables.
2003-01-28 15:09:07 +00:00
Poul-Henning Kamp
a025fbfdc6 NO_GEOM cleanup: subr_disklabel.c no longer needed. 2003-01-28 14:51:32 +00:00
Poul-Henning Kamp
20ea2fe837 NO_GEOM cleanup: Remove subr_disklabel.c from alpha kernels. 2003-01-28 13:50:49 +00:00
Poul-Henning Kamp
62d1a66f75 NO_GEOM cleanup: Don't include subr_disklabel.c in sparc64 build 2003-01-28 13:00:49 +00:00
Poul-Henning Kamp
7baee2b7cf Band-XXX-aid an easy to provoke panic.
MFC:	2 weeks
2003-01-28 12:10:11 +00:00
Poul-Henning Kamp
7704eaef00 NO_GEOM cleanup: Don't pull subr_disk{slice,label,mbr}.c into i386
kernels anymore, they are not needed.
2003-01-28 11:09:22 +00:00
Martin Blapp
14f19ee835 Add PCI revision number for 630A and 900B. Enable parity error detection
on 900B and 635(A).

Re-add the enhanced PHY access register method again for older chipsets,
they do not seem to work with all old chips.

Reviewed by:		phk
MFC after:		7 days
2003-01-28 10:55:38 +00:00
Benno Rice
7b4359b47d Put the right fix in. Instead of deleting the declaration of __FBSDID, we
undef it before this definition.
2003-01-28 10:54:31 +00:00
Poul-Henning Kamp
c516a05a66 Mark some args unused so this compiles in userland. 2003-01-28 09:48:09 +00:00
Poul-Henning Kamp
e55d9b0bd1 Use a void * to carry the private data for return-call'ed ioctl requests.
Amongst other things this avoids a complex workaround in the userland
regression bits.
2003-01-28 09:47:50 +00:00
Jeff Roberson
d465fb9589 - Allow idle's pctcpu time to be calculated. 2003-01-28 09:30:17 +00:00
Jeff Roberson
c9f25d8f92 - Fix the ksq_load calculation. It now reflects the number of entries on the
run queue for each cpu.
 - Introduce kse stealing into the sched_choose() code.  This helps balance
   cpus better in cases where process turnover is high.  This implementation
   is fairly trivial and will likely be only a temporary measure until
   something more sophisticated has been written.
2003-01-28 09:28:20 +00:00
Tim J. Robbins
613fcc1359 Do not allow a cached vnode to be shared among multiple mounts of the same
kind of pseudofs-based filesystem. Fixes (at least) one problem where
when procfs is mounted mupltiple times, trying to unmount one will often
cause the wrong one to get unmounted, and other problem where mounting
one procfs on top of another caused the kernel to lock up.

Reviewed by:		des
2003-01-28 09:21:42 +00:00
Poul-Henning Kamp
91898abc5e Bang! Bang! Bang! etc etc
Remove NODEVFS and NO_GEOM from options.

Approved by:	trb@
2003-01-28 09:04:19 +00:00
Poul-Henning Kamp
2abcaf6bfd Bang! Bang! Bang! etc etc.
Remove NODEVFS option.
2003-01-28 07:15:22 +00:00
Mike Silbersack
ac64c8668b A few fixes to rev 1.221
- Honor the previous behavior of maxfragpackets = 0 or -1
- Take a better stab at fragment statistics
- Move / correct a comment

Suggested by:	maxim@
MFC after:	7 days
2003-01-28 03:39:39 +00:00
Alan Cox
d6d92c84c1 Merge pmap_testbit() and pmap_is_modified(). The latter is the only caller
of the former.
2003-01-28 03:01:35 +00:00
Peter Wemm
bf2053cad6 No longer force COMPAT_FREEBSD4 to be on. 2003-01-27 23:01:03 +00:00
Jake Burkholder
a68a96aad7 Add the sabtty children devices as unordered. Use the unit numbr of
the sabtty device to create its description so that they will be
unique for machines with multiple sab chips.

This fixes a panic on machines with an rsc card.

Tested by:	obrien (e250)
2003-01-27 18:39:09 +00:00
Poul-Henning Kamp
109751d28c Don't dereference null vnode pointer if controling terminal was revoked.
Submitted by:	"Peter Edwards" <pmedwards@eircom.net>
2003-01-27 16:54:17 +00:00
MIHIRA Sanpei Yoshiro
4bfecf88f4 Add PCI id for fxp(Intel Pro/100 M Mobile Connection).
PR:	i386/41915
Submitted by:	Ross A. Lippert <ripper@eskimo.com>
MFC after:	1 week
2003-01-27 14:31:32 +00:00
Benno Rice
a7c9d6bca5 Back the previous commit out. It didn't actually fix the problem I was
seeing and the memory barrier isn't needed with the bridges we're using.

Fix the function style however.
2003-01-27 12:59:52 +00:00
Josef Karthauser
4de19bd9c8 Put the Perfection 1660 scanner entry in the right place. (Entries
are sorted by product id).
2003-01-27 09:43:24 +00:00
Søren Schmidt
33ede9b3e7 Update the code that deals with disk enclosures:
Properly handle the newer Promise SuperSwap 1000 enclosures.
Print out what kind of enclosure was found in the probe.
Misc cleanups in the enclosure handling code.

Sponsored by: Advanis Inc.
2003-01-27 09:04:29 +00:00
Poul-Henning Kamp
16bcbe8cf7 Implement MDIOCLIST which returns the unit numbers of configured md(4)
devices.

We use the md_pad[] array and if there are more units than its size the
last returned unit number will be -1, but the number of units returned
is correct.
2003-01-27 07:58:18 +00:00
Poul-Henning Kamp
b6532aa9a5 Add an ioctl to return the unit numbers of the configured md devices. 2003-01-27 07:54:59 +00:00
Warner Losh
66e390feb6 MFp4:
u_int*_t -> uint*_t to conform more closely with C99.
2003-01-27 05:47:01 +00:00
Jake Burkholder
52e59d41d8 Enable device zs and device sab by default. 2003-01-27 05:05:52 +00:00
Jake Burkholder
984e265523 Change ofwcons to use the output-device property from the firmware for the
name of the device that it creates.  Update /etc/ttys accordingly.

An alias is created for the old name so that old /etc/ttys will continue to
work, but due to aliases being implemented as symlinks in devfs you cannot
login as root when using the alias device.

Discussed with:	grehan
2003-01-27 04:42:17 +00:00
Benno Rice
b3c02b110a Back out some changes that snuck in with the last commit.
Pointy hat to:	benno
2003-01-27 04:32:10 +00:00
Benno Rice
622cfbd033 Flesh out bus_dmamap_sync. 2003-01-27 04:27:01 +00:00
Benno Rice
8519f3983c Use td->td_sticks, not td->td_kse->ke_sticks.
Forgotten by:	davidxu
2003-01-27 04:26:09 +00:00
Benno Rice
7b180a30e1 Remove a duplicate definition of the __FBSDID macro. 2003-01-27 04:24:57 +00:00
Alan Cox
75741c0497 Simplify vm_object_page_remove(): The object's memq is now ordered. The
two cases that existed before for performance optimization purposes can
be reduced to one.
2003-01-27 01:12:35 +00:00
Julian Elischer
0d7cc0749c Unbreak SMP cases for these architectures.
statclock_process() changed arguments.
note: it may be worth checking if curkse is needed on these architectures..
(and if so, why?)
2003-01-27 00:00:06 +00:00
Jake Burkholder
e3c5d56ff4 Fix standard kse breakage of non-x86 platforms.
Pointy hat to:	davidxu
2003-01-26 23:52:45 +00:00
David Xu
ba07d97e62 Use kg_numupcalls to see if we are closing a thread group,
not kg_kses which is not changed when a group is still working.
2003-01-26 23:39:33 +00:00
Alfred Perlstein
ca315837c7 fix warnings 2003-01-26 23:25:00 +00:00
Giorgos Keramidas
a61617ed46 Fix a typo and reword a bit the description of the new SCHED_xxx stuff.
Reviewed by:	jeff
2003-01-26 22:26:46 +00:00
Poul-Henning Kamp
7253da9c05 Implement DIOCBSDBB ioctl which overwrites first BBSIZE bytes of BSD
labeled disk.

This is complicated by the fact that BBSIZE is greater than the
PAGE_SIZE limit ioctl inflicts on arguments which are automatically
copied in.

As long as we don't need access to userland memory (copyin/out) we
can deal with the ioctl using g_callme() which executes it from the
GEOM event thread.

Once we need copyin/out, we need to return the bio with EDIRIOCTL
in order to make geom_dev call us back in the original process context
where copyin will work.

Unfortunately, that results in us getting called with Giant, so
we have to DROP_GIANT/PICKUP_GIANT around the code where we diddle
GEOMs internals.

Sometimes you just can't win...

... But it does make geom_bsd.c an almost complete example of the
GEOM beastiarium.
2003-01-26 21:54:36 +00:00
Poul-Henning Kamp
afdc2f6786 Add ioctl which overwrites the first BBSIZE bytes of a BSD labeled disk. 2003-01-26 21:49:44 +00:00
Julian Elischer
a18b6f65d0 Fix KSE related patch.
Make it compile for the SMP case..
statclock_process() has changed prototypes.
2003-01-26 21:32:08 +00:00
Alfred Perlstein
9799a92dae regen 2003-01-26 20:10:35 +00:00
Alfred Perlstein
b17c9cfa5e Add const qualifier to data argument for msgsnd.
PR: standards/45274
Submitted by: Craig Rodrigues <rodrigc@attbi.com>
2003-01-26 20:09:34 +00:00
Poul-Henning Kamp
5bdd667ffe Put DIOCWLABEL under #ifdef NO_GEOM 2003-01-26 19:43:18 +00:00
Hidetoshi Shimokawa
53f1eb8620 - Split db.desc.cmd into desc.control and desc.reqcount.
- remove unncessary descriptor updates.
2003-01-26 18:38:06 +00:00
Hidetoshi Shimokawa
5a7ba74dc4 - Improve IT/IR DMA queue management.
- Improve debug message for mbuf handling.
- Wait 1 sec for DMA stop in fwohci_i{t,r}x_disable() before freeing buffers.
2003-01-26 15:39:04 +00:00
Poul-Henning Kamp
5d9aef3d8d Link /boot/boot1 to the name /boot/boot to avoid per-arch naming of the
bootstrap code for disklabel using architectures.
2003-01-26 14:32:53 +00:00
Poul-Henning Kamp
b04b95ab47 Build a file "boot" which consists of boot1 and boot2 concatenated.
There is little if any reason to treat the two components separately
and it will simplify disklabel(8) and libdisk if we didn't.
2003-01-26 13:33:57 +00:00
Poul-Henning Kamp
3370d4b9fe This file is no longer needed.
Spotted by:	tjr
2003-01-26 13:08:49 +00:00
David Xu
0dbb100b9b Move UPCALL related data structure out of kse, introduce a new
data structure called kse_upcall to manage UPCALL. All KSE binding
and loaning code are gone.

A thread owns an upcall can collect all completed syscall contexts in
its ksegrp, turn itself into UPCALL mode, and takes those contexts back
to userland. Any thread without upcall structure has to export their
contexts and exit at user boundary.

Any thread running in user mode owns an upcall structure, when it enters
kernel, if the kse mailbox's current thread pointer is not NULL, then
when the thread is blocked in kernel, a new UPCALL thread is created and
the upcall structure is transfered to the new UPCALL thread. if the kse
mailbox's current thread pointer is NULL, then when a thread is blocked
in kernel, no UPCALL thread will be created.

Each upcall always has an owner thread. Userland can remove an upcall by
calling kse_exit, when all upcalls in ksegrp are removed, the group is
atomatically shutdown. An upcall owner thread also exits when process is
in exiting state. when an owner thread exits, the upcall it owns is also
removed.

KSE is a pure scheduler entity. it represents a virtual cpu. when a thread
is running, it always has a KSE associated with it. scheduler is free to
assign a KSE to thread according thread priority, if thread priority is changed,
KSE can be moved from one thread to another.

When a ksegrp is created, there is always N KSEs created in the group. the
N is the number of physical cpu in the current system. This makes it is
possible that even an userland UTS is single CPU safe, threads in kernel still
can execute on different cpu in parallel. Userland calls kse_create to add more
upcall structures into ksegrp to increase concurrent in userland itself, kernel
is not restricted by number of upcalls userland provides.

The code hasn't been tested under SMP by author due to lack of hardware.

Reviewed by: julian
2003-01-26 11:41:35 +00:00
Poul-Henning Kamp
e70e846243 Put use of DIOCWLABEL under #ifdef NO_GEOM 2003-01-26 11:28:56 +00:00
Jeff Roberson
4183d949e0 - Remove a redundant scheduler option.
Pointy hat to:	jeff
Spotted by:	dillon
2003-01-26 06:37:43 +00:00
Jeff Roberson
f5d05ac369 - Add entries for scheduler selection 2003-01-26 05:35:54 +00:00
Jeff Roberson
c3384118a1 - Introduce the SCHED_ULE and SCHED_4BSD options for compile time selection
of the scheduler.
 - Add SCHED_4BSD as the scheduler for all kernel config files in cvs.
2003-01-26 05:29:12 +00:00
Jeff Roberson
35e6168fcd - Add the ule scheduler. This is intended to be a general purpose process
scheduler with many SMP benefits.  It is still very experimental and should
   be used only in test environments.
2003-01-26 05:23:15 +00:00
Orion Hodson
cb4458e030 Disable DRA to fix problems with recording. 2003-01-26 04:23:23 +00:00
Jeff Roberson
4e997f4b87 - Call sched_sleep() instead of rolling our own in cv_waitq_add(). 2003-01-26 04:00:39 +00:00
Jake Burkholder
21ecbe78a2 Merge some code paths back together so that we only instantiate 1 copy of
the user tlb fault handlers.
2003-01-26 03:38:30 +00:00
Jake Burkholder
6c5b0e25a0 Allow defaulting the console to ttya when it sets to screen and keyboard
in the prom but no keyboard is plugged in.
2003-01-26 01:56:20 +00:00
Mike Silbersack
402062e80c Merge the best parts of maxfragpackets and maxnipq together. (Both
functions implemented approximately the same limits on fragment memory
usage, but in different fashions.)

End user visible changes:
- Fragment reassembly queues are freed in a FIFO manner when maxfragpackets
  has been reached, rather than all reassembly stopping.

MFC after: 	5 days
2003-01-26 01:44:05 +00:00
Warner Losh
7f7ff631be Add INTEL EEPRO100
Submitted by: joerg
2003-01-25 23:18:01 +00:00
Mike Silbersack
641fe90c31 Remove some unnecessary casts. 2003-01-25 22:41:22 +00:00
Alfred Perlstein
71e8fa87ab regen 2003-01-25 21:34:07 +00:00
Alfred Perlstein
e1d7d0bb60 Bring shm functions closer the the opengroup standards.
PR: 47469
Submitted by: Craig Rodrigues <rodrigc@attbi.com>
2003-01-25 21:33:05 +00:00
Alfred Perlstein
004a10f278 regen. 2003-01-25 21:30:08 +00:00
Alfred Perlstein
3beb32709d Bring semop() closer the the opengroup standards.
PR: 47471
Submitted by: Craig Rodrigues <rodrigc@attbi.com>
2003-01-25 21:27:37 +00:00
Alan Cox
d923c5986e Add MTX_DUPOK to the initialization of system map locks. 2003-01-25 18:45:55 +00:00
Orion Hodson
f9eb140935 Add ac97_patch.[ch] that provide space for ac97 codec specific patches. 2003-01-25 16:54:05 +00:00
Hidetoshi Shimokawa
c547b896f5 Change API of FW_GDEVLST ioctl.
- include information about itself.
- define struct fw_devinfo and use it in struct fw_devlstreq.
- unify EUI64 representation using struct fw_eui64.
2003-01-25 14:47:33 +00:00
Poul-Henning Kamp
4394f4767d Add sysctl kern.timecounter.nsetclock which indicates the number of
potential discontinuities in our UTC timescale.

Applications can monitor this variable if they want to be informed
about steps in the timescale.  Slews (ntp and adjtime(2)) and
frequency adjustments (ntp) will not increment this counter, only
operations which set the clock.  No attempt is made to classify
size or direction of the step.
2003-01-25 07:51:09 +00:00
Jake Burkholder
4a3381caae Moved some (gas) macros up so they can be used in more places. 2003-01-24 23:47:46 +00:00
Jeffrey Hsu
afb0573a12 Remove extraneous FILEDESC_LOCKs around atomic reads.
Reviewed by:	jhb
2003-01-24 22:49:52 +00:00
Hidetoshi Shimokawa
9190691bd0 Remove FW_SSTDV ioctl. It is not used anymore. 2003-01-24 13:03:19 +00:00
Hidetoshi Shimokawa
e715bfae6c Merge little and big endian case. 2003-01-24 12:45:19 +00:00
Doug Rabson
388dc84194 Fix pmap_extract so that it doesn't panic if the user types
'cat /proc/pid/map'

Submitted by: Arun Sharma <arun.sharma@intel.com>
2003-01-24 09:58:32 +00:00
Maxime Henrion
ff301db64c Remove the now unused sys/malloc.h header. 2003-01-24 02:42:22 +00:00
Max Khon
6cdcc15976 - add support for IPX (tested with mount -t nwfs and mars_nwe),
IP fast forwarding, SIOCGIFADDR, setting hardware address (not currently
enabled in cm driver), multicasts (experimental)
- add ARC_MAX_DATA, use IF_HANDOFF, remove arc_sprintf() and some unused
variables
- if_simloop logic is made more similar to ethernet
- drop not ours packets early (if we are not in promiscous mode)

Submitted by:	mark tinguely (partially)
2003-01-24 01:32:20 +00:00
Matthew N. Dodd
3648042ae9 - The 'aux' field isn't around any longer.
- Add missing splnet()/splx()
2003-01-24 00:37:10 +00:00
Max Khon
4abe79362a add forgotten IFA_LOCK_INIT 2003-01-23 23:36:45 +00:00
Nate Lawson
a40f20c791 More useful announce message containing current speed of CPU 2003-01-23 22:18:14 +00:00
Nate Lawson
537a265865 Remove redundant printf from targbhasync() since all places that return an
error do their own, more useful printf.
2003-01-23 21:55:12 +00:00
Hidetoshi Shimokawa
16e0f48443 - Add sysctl knob for bus manager. (hw.firewire.try_bmr)
- Check invalid SID length.
- Add some debug messages.
2003-01-23 13:34:40 +00:00
Peter Wemm
99ebb0bfba Clean up some junk defines, and GC the TPR options. 2003-01-23 01:04:27 +00:00
Peter Wemm
904639d710 Nuke CHEAP_TPR stuff, including LOPRIO_LEVEL (bogus) and ALLHWI_LEVEL
(which we never used).  There is no need to tweak the TPR anymore and
only causes problems.
2003-01-23 01:03:34 +00:00
Scott Long
128aa5a022 Hack around a bug in the 2200 and 2120 controllers that connot DMA
commands from below the first 8K of physical memory.  A better fix
is to modify the busdma api to allow either inclusion ranges or
multiple exclusion ranges, but that debate is for another day.

MFC After:	2 days
2003-01-23 01:01:44 +00:00
Peter Wemm
2fbe601a5d Now that TPR isn't bogusly raised at boot, there is no need to clear
it at context switch.
2003-01-23 01:01:35 +00:00