Commit Graph

517 Commits

Author SHA1 Message Date
Jake Burkholder
218fd301cd pmap_kremove can no longer be used to remove the magic device mappings
installed with pmap_kenter_flags, since the physical addresses may not
have an associated vm_page.  Add a function to do this.

Tested by:	Tomi Vainio <Tomi.Vainio@Sun.COM>
2002-06-25 15:13:09 +00:00
Jake Burkholder
8ba3d077ff Add an MD callout like cpu_exit, but which is called after sched_lock is
obtained, when all other scheduling activity is suspended.  This is needed
on sparc64 to deactivate the vmspace of the exiting process on all cpus.
Otherwise if another unrelated process gets the exact same vmspace structure
allocated to it (same address), its address space will not be activated
properly.  This seems to fix some spontaneous signal 11 problems with smp
on sparc64.
2002-06-24 15:48:02 +00:00
Jonathan Mini
01ad8a53db Remove unused diagnostic function cread_free_thread().
Approved by:	alfred
2002-06-24 06:22:00 +00:00
Maxime Henrion
584884ca0c Add a missing prototype to fix a warning. 2002-06-23 21:29:00 +00:00
Maxime Henrion
a3dc999469 Include machine/critical.h to get missing prototypes.
Reviewed by:	tmm
2002-06-23 14:38:41 +00:00
Jake Burkholder
f5885ad905 Fix a bug related to marking pages virtually uncacheable due to illegal
dcache aliasing.  A page that already had more than 1 mapping of the
same virtual colour would not be correctly uncached.

Noticed by:	Artur Grabowski <art@openbsd.org>
2002-06-22 23:55:15 +00:00
Maxime Henrion
ea8be05a6f Warning fix.
Reviewed by:	peter
2002-06-22 20:46:59 +00:00
Jake Burkholder
4e4c1993b9 {f,s}usword -> {f,s}uword16. Implement {f,s}uword32.
Requested by:	peter
2002-06-20 20:41:57 +00:00
Peter Wemm
b23619e02a Deorbit suibyte(). It was only used for split address space systems
for supporting UIO_USERISPACE (ie: it wasn't used).
2002-06-20 07:13:35 +00:00
Peter Wemm
2f9267ec23 Move the "- 1" into the RQB_FFS(mask) macro itself so that
implementations can provide a base zero ffs function if they wish.
This changes
  #define RQB_FFS(mask) (ffs64(mask))
  foo = RQB_FFS(mask) - 1;
to
  #define RQB_FFS(mask) (ffs64(mask) - 1)
  foo = RQB_FFS(mask);
On some platforms we can get the "- 1" for free, eg: those that use the
C code for ffs64().

Reviewed by:	jake (in principle)
2002-06-20 06:21:20 +00:00
David E. O'Brien
10f80f494c Sync with i386. 2002-06-18 01:11:04 +00:00
Jake Burkholder
e3957e9d67 Add constants for the min and max prom addresses. Use these instead of
magic numbers.  Use stxa_sync instead of stxa; membar #Sync; to ensure
that no instruction is placed between the two.  This can cause random
corruption even though interrupts are already disabled.
2002-06-17 15:44:10 +00:00
Thomas Moestl
5fb49f9fd6 Add PCI bus enumeration and latency timer setup to the sparc64 MD PCI
code. Both tasks are not always performed completely by the firmware.
The former is required to get some e450 models to boot; the latter fixes
the repeated fifo underruns with hme(4)s and gem(4)s observed on some
machines (and probably performance problems with other peripherals as
well).
2002-06-12 19:20:57 +00:00
Jake Burkholder
25be55bdc3 Add code to drop to ddb when a process gets a fatal signal that usually
suggests kernel bugs (4, 10, 11).  Add a sysctl debug.debugger_on_signal
which turns this on and off, default off.
2002-06-08 07:36:28 +00:00
Jake Burkholder
1b5e0369d7 Re-enable SMP by default. 2002-06-08 07:22:36 +00:00
Jake Burkholder
6b3d95e2cf Remove test code. 2002-06-08 07:21:52 +00:00
Jake Burkholder
f5ee661c9b Remove code from trap which is handled in userland now. 2002-06-08 07:17:19 +00:00
Jake Burkholder
acb941ef8f Fix bizarre SMP problems. The secondary cpus sometimes start up with junk
in their tlb which the prom doesn't clear out, so we have to do so manually
before mapping the kernel page table or the cpu can hang due various
conditions which cause undefined behaviour from the tlb.
2002-06-08 07:10:28 +00:00
Jake Burkholder
a682b4e6e7 Comment out options SMP for now until I figure out what's going on. 2002-06-07 15:36:42 +00:00
John Baldwin
99cca534f3 - Fixup / remove obsolete comments.
- ktrace no longer requires Giant so do ktrace syscall events before and
  after acquiring and releasing Giant, respectively.
- For i386, ia32 syscalls on ia64, powerpc, and sparc64, get rid of the
  goto bad hack and instead use the model on ia64 and alpha were we
  skip the actual syscall invocation if error != 0.  This fixes a bug
  where if we the copyin() of the arguments failed for a syscall that
  was not marked MP safe, we would try to release Giant when we had
  not acquired it.
2002-06-07 05:47:35 +00:00
Jake Burkholder
a41c3573fa Use pmap_map instead of pmap_kenter to map the message buffer. Its too
early for pmap_kenter.
2002-06-05 15:36:57 +00:00
Jake Burkholder
e7dc92f0f9 Bump TSB_PAGES_SHIFT to 4. Less sucks too much. 2002-06-04 19:40:45 +00:00
Doug Rabson
99bd783419 Move the definition of ElfN_Hashelt to common headers. The only platform
which has a different definition for this is alpha.
2002-05-30 08:32:18 +00:00
Jake Burkholder
626d38b529 Forgot to commit this file. Catch up to loader->kernel abi changes. 2002-05-29 19:48:03 +00:00
Jake Burkholder
f7e0360261 Forward declare struct trapframe. 2002-05-29 19:25:14 +00:00
Jake Burkholder
819c7d570b Remove BOOTP_WIRED_TO= since I keep forgetting to take this out and screwing
over people with gems.
2002-05-29 19:22:17 +00:00
Jake Burkholder
a2b4810ee7 Don't try to flush illegal alises from the data cache in vmapbuf and
vunmapbuf, this is handled by pmap now.
2002-05-29 06:16:47 +00:00
Jake Burkholder
20bd6675fb Add an MD page flag for tracking if a page is cacheable or not, so that
we don't flush all mappings of a physical page in order to make it
virtually cachable again, if it is already cachable.
2002-05-29 06:12:13 +00:00
Jake Burkholder
468303c500 Remove an unused variable. 2002-05-29 06:10:37 +00:00
Jake Burkholder
1982efc5c2 Merge the code in pv.c into pmap.c directly. Place all page mappings onto
the pv lists in the vm_page, even unmanaged kernel mappings.  This is so
that the virtual cachability of these mappings can be tracked when a page
is mapped to more than one virtual address.  All virtually cachable
mappings of a physical page must have the same virtual colour, or illegal
alises can be created in the data cache.  This is a bit tricky because we
still have to recognize managed and unmanaged mappings, even though they
are all on the pv lists.
2002-05-29 06:08:45 +00:00
Jake Burkholder
e793e4d0b3 Add pv list linkage and a pmap pointer to struct tte. Remove separately
allocated pv entries and use the linkage in the tte for pv operations.
2002-05-29 05:56:05 +00:00
Jake Burkholder
35738638d6 Use a contrived 'tlb_entry' structure for passing the mappings for the
kernel text and data from the loader to the kernel, so that the tte format
is not part of the loader->kernel ABI.
2002-05-29 05:49:59 +00:00
Jake Burkholder
b08270ba0f Remove pmap.pm_pvlist and make the functions that use it no-ops. These are
all optimizations for architectures which have large sparse page tables,
and/or can't put the pv linkage inside of the page table entries.
2002-05-29 05:24:16 +00:00
Doug Rabson
396a429cfd Add declarations of suword32 and suword64. Add implementations of one or
the other (or both) to all the platforms. Similar for fuword32 and
fuword64.
2002-05-26 16:03:13 +00:00
Jake Burkholder
4d574756ac Convert the interrupt queue from an array to a linked list. Implement
intr_dequeue in asm so that it can easily be modified to do light weight
context switching.
2002-05-25 02:39:28 +00:00
Jake Burkholder
0679dc5f91 Try to handle "double faults" occuring at more trap levels (ie 4 :)). 2002-05-25 01:45:11 +00:00
Jake Burkholder
597e13d8c5 Minor style. 2002-05-25 01:44:08 +00:00
Jake Burkholder
d2ac231616 Make the run queue parameters machine dependent. Optimize 64 bit
architectures by using a 64 bit word for the bit array which keeps
track of non-empty queues.

Reviewed by:	peter
2002-05-25 01:12:23 +00:00
Jake Burkholder
2dbb68a495 Update tsb_tte_enter prototype per tsb.c rev 1.20. 2002-05-21 02:15:37 +00:00
Jake Burkholder
38c04dc163 Rewrite pmap_enter to avoid copying ttes in all cases.
Pass the tte data to tsb_tte_enter instead of a whole tte, also to avoid
copying.
2002-05-21 02:14:11 +00:00
Jake Burkholder
f631b588f5 Redefine the tte accessor macros to take a pointer to a tte, instead of the
value of the tag or data field.
Add macros for getting the page shift, size and mask for the physical page
that a tte maps (which may be one of several sizes).
Use the new cache functions for invalidating single pages.
2002-05-21 00:29:02 +00:00
Jake Burkholder
b78213fb0b Add SMP aware cache flushing functions, which operate on a single physical
page.  These send IPIs if necessary in order to keep the caches in sync on
all cpus.
2002-05-20 16:30:47 +00:00
Jake Burkholder
856316e9c6 Forward declare struct trapframe. 2002-05-20 16:12:35 +00:00
Jake Burkholder
f7c81a5182 De-inline the tlb demap functions. These were so big that gcc3.1 refused
to inline them anyway.  ;)
2002-05-20 16:10:17 +00:00
Eric Melville
13d362233e Banish "priviledged" from kernel source. 2002-05-16 22:41:48 +00:00
David E. O'Brien
5aecc48bb0 style sync with other platforms. 2002-05-15 16:40:25 +00:00
Poul-Henning Kamp
6380601f64 Move MI stuff out of MD param.h files.
It can all still be overridden in the MD files should need suddenly arise.
2002-05-14 20:35:29 +00:00
Jake Burkholder
20409ddf22 Fix IF_SEXT(val, 32). The constants need to have type long to
handle size > 16.
2002-05-13 04:26:38 +00:00
Jake Burkholder
c0db03795f Add another copy of the ia64 dump_machdep.c. 2002-05-13 02:39:19 +00:00
Jake Burkholder
63fd3b0af9 Enable KTR_TRAP by default. 2002-05-12 18:10:48 +00:00