Commit Graph

9215 Commits

Author SHA1 Message Date
Jake Burkholder
ffad008fcd Remove harmless invalid cast.
Sponsored by:	DARPA, Network Associates Laboratories
2003-04-25 15:07:58 +00:00
Daniel Eischen
1328e1c4be Add an argument to get_mcontext() which specified whether the
syscall return values should be cleared.  The system calls
getcontext() and swapcontext() want to return 0 on success
but these contexts can be switched to at a later time so
the return values need to be cleared in the saved register
sets.  Other callers of get_mcontext() would normally want
the context without clearing the return values.

Remove the i386-specific context saving from the KSE code.
get_mcontext() is not i386-specific any more.

Fix a bad pointer in the alpha get_mcontext() code.  The
context was being bcopy()'d from &td->tf_frame, but tf_frame
is itself a pointer, so the thread was being copied instead.
Spotted by jake.

Glanced at by:  jake
Reviewed by:    bde (months ago)
2003-04-25 01:50:30 +00:00
Eric Anholt
42da33c444 Update the DRM to the latest from DRI CVS. Includes some bugfixes and removal
of the infrastructure for the gamma driver which was removed a while back.
The DRM_LINUX option is removed because the handler is now provided by the
linux compat code itself.
2003-04-25 01:18:47 +00:00
David Xu
e63c419732 Don't print anything for fault at cpu_switch_load_gs, just like other
code to recover fault in doreti because of invalid segment registers,
silently push error to userland.
2003-04-24 01:48:59 +00:00
Alexander Kabaev
6fd839f9c7 Add a new sys/limits.h file which in turn depends on machine/_limits.h
to get actual constant values. This is in preparation for machine/limits.h
retirement.

Discussed on:	standards@
Submitted by:	Craig Rodrigues <rodrigc@attbi.com>  (*)
Modified by:	kan
2003-04-23 21:41:59 +00:00
John Baldwin
eeec6bab2e Prefer the proc lock to sched_lock when testing PS_INMEM now that it is
safe to do so.
2003-04-22 20:01:56 +00:00
John Baldwin
fe8cdcae87 - Replace inline implementations of sigprocmask() with calls to
kern_sigprocmask() in the various binary compatibility emulators.
- Replace calls to sigsuspend(), sigaltstack(), sigaction(), and
  sigprocmask() that used the stackgap with calls to the corresponding
  kern_sig*() functions instead without using the stackgap.
2003-04-22 18:23:49 +00:00
David Xu
97637bcfb2 Move down intr level testing code a bit, cpu_switch_load_gs fault can be at
interrupt nested time.
2003-04-22 08:12:03 +00:00
David Xu
5515888875 Fix some problems for cpu_switch_load_gs. when fault address is at
cpu_switch_load_gs, cpu is in context switch, so don't enable interrupt.
because it is in context switch, it is expected sched_lock was held,
so don't PROC_LOCK(p) and psignal, it is LOR, probably we can
set a P_XSIGBUS like flag in p_sflags, and set TDF_ASTPENDING in
td_flags, in ast(), post a SIGBUS to process if P_XSIGBUS was set.
2003-04-22 07:45:47 +00:00
David Xu
5b70587b8a Remove single threading detecting code, these code really should be
replaced by thread_user_enter(), but current we don't want to enable
this in trap.
2003-04-22 03:17:41 +00:00
Hidetoshi Shimokawa
092cd06fcd Add FireWire drivers to GENERIC. 2003-04-21 16:44:05 +00:00
David E. O'Brien
40373d8796 Assembly files put thru the C preprocessor need to have C style comments. 2003-04-21 16:30:12 +00:00
David Xu
6625036082 Reset pcb_gs and %gs before possibly invalidating it. 2003-04-21 15:05:05 +00:00
Bill Paul
87b4a25958 Add device driver support for the ASIX Electronics AX88172 USB 2.0
ethernet controller. The driver has been tested with the LinkSys
USB200M adapter. I know for a fact that there are other devices out
there with this chip but don't have all the USB vendor/device IDs.

Note: I'm not sure if this will force the driver to end up in the
install kernel image or not. Special magic needs to be done to exclude
it to keep the boot floppies from bloating again, someone please
advise.
2003-04-20 19:05:33 +00:00
David Xu
d1fc2022c3 Backout my last commit.
Requested by: bde
2003-04-20 01:35:21 +00:00
David Xu
2bdf11638e Don't return garbage in high 16 bits. 2003-04-19 02:40:39 +00:00
John Baldwin
9eb78fcfd9 Synchronize the two linux_clone() implementations which includes a few
minor cleanups in both.
2003-04-18 20:54:41 +00:00
John Baldwin
889a6b5845 Use the proc lock to protect p_singlethread and a P_WEXIT test. This
fixes a couple of potential KSE panics on non-i386 arch's that weren't
holding the proc lock when calling thread_exit().
2003-04-18 20:20:00 +00:00
John Baldwin
ee6c1d2ed2 Hold the proc lock for curproc around sigonstack(). 2003-04-18 20:09:04 +00:00
John Baldwin
aff1d36ceb Add some missing proc mutex unlocks. 2003-04-17 22:19:47 +00:00
John Baldwin
e5567180fb Don't drop the proc lock just to reacquire it after a few simple assignment
statements.  Just hold the lock the entire time.
2003-04-17 22:18:07 +00:00
John Baldwin
8365f5bf7c Remove a couple of unused symbols. 2003-04-17 22:17:28 +00:00
Poul-Henning Kamp
a300701213 Don't include <sys/disklabel.h> 2003-04-16 20:57:35 +00:00
Matthew N. Dodd
2836b6d03e - Set if_unit, if_init, and ifq_maxlen.
- Remove unnecessary initializations; ether_ifattach() takes care of them.
- Change function argument types to avoid nasty casts.
2003-04-16 06:27:39 +00:00
John Baldwin
f265002902 Sync up with changes to ptrace() and use P_SHOULDSTOP instead of
a duplicate P_TRACED check.

Submitted by:	marcel
2003-04-15 16:29:39 +00:00
Maxime Henrion
0cb112309a style(9) 2003-04-15 03:11:03 +00:00
Hidetoshi Shimokawa
c8990f0d8e Restore delayed load support for the resource shortage case.
It was missed in the previous change.
Now, _bus_dmamap_load_buffer() accepts BUS_DMA_WAITOK/BUS_DMA_NOWAIT flags.

Original idea from: jake
2003-04-14 13:21:40 +00:00
Hidetoshi Shimokawa
f5270431be * Use _bus_dmamap_load_buffer() and respect maxsegsz in bus_dmamap_load().
Ignoring maxsegsz may lead to fatal data corruption for some devices.
ex. SBP-2/FireWire
We should apply this change to other platforms except for sparc64.

MFC after: 1 week
2003-04-14 04:19:42 +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
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
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
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
Jake Burkholder
87b91b10ef Add ahd. 2003-04-09 14:58: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
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
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
Matthew N. Dodd
acdf797d1a Retire these files. 2003-04-07 01:25:40 +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
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
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
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
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
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
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
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
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
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