Commit Graph

3621 Commits

Author SHA1 Message Date
martin c189434481 Make kernels with options KGDB compile. (Didn't test kgdb though) 2003-05-18 16:45:21 +00:00
nakayama ca7665c318 Don't traverse here in case of sparc64 32-bit environment. 2003-05-17 02:45:04 +00:00
nakayama 6256a4034a Make sure to remove lib directories. 2003-05-17 02:30:14 +00:00
nakayama cd35e5f630 Make sure to remove proper link. 2003-05-17 02:26:27 +00:00
kleink 776138ea69 Rename <sys/float_ieee.h> to <sys/float_ieee754.h>, following libc's
convention for these.
2003-05-12 15:22:53 +00:00
thorpej e43fecb228 Change bounds_check_with_label() to take a pointer to the disk structure,
rather than the label itself.  This paves the way for some future changes.
2003-05-10 23:12:28 +00:00
thorpej 36da248c07 Back out the following chagne:
http://mail-index.netbsd.org/source-changes/2003/05/08/0068.html

There were some side-effects that I didn't anticipate, and fixing them
is proving to be more difficult than I thought, do just eject for now.
Maybe one day we can look at this again.

Fixes PR kern/21517.
2003-05-10 21:10:23 +00:00
martin f4e8d9c840 Remove a spurious Debugger() call in a "this should never happen"
(SUN4U only) code path.
2003-05-10 13:26:44 +00:00
thorpej b77900c3c2 Simplify the way the bounds of the managed kernel virtual address
space is advertised to UVM by making virtual_avail and virtual_end
first-class exported variables by UVM.  Machine-dependent code is
responsible for initializing them before main() is called.  Anything
that steals KVA must adjust these variables accordingly.

This reduces the number of instances of this info from 3 to 1, and
simplifies the pmap(9) interface by removing the pmap_virtual_space()
function call, and removing two arguments from pmap_steal_memory().

This also eliminates some kludges such as having to burn kernel_map
entries on space used by the kernel and stolen KVA.

This also eliminates use of VM_{MIN,MAX}_KERNEL_ADDRESS from MI code,
this giving MD code greater flexibility over the bounds of the managed
kernel virtual address space if a given port's specific platforms can
vary in this regard (this is especially true of the evb* ports).
2003-05-08 18:13:12 +00:00
pk d44463bc60 GC old FPU code. 2003-05-07 08:25:30 +00:00
pk c84d68a75a cpu_exit(): keep the MD FPU pointers in a consistent state since the thread
structure will linger for a while on various zombie lists.
2003-05-07 08:24:29 +00:00
pk c1b72e3dc0 Fixup comment on cpu_exit(). 2003-05-07 08:19:21 +00:00
wiz 1ffa7b76c4 DMA, not dma nor Dma. 2003-05-03 18:10:37 +00:00
dsl d91455ce26 Change return type of readdisklabel() to const char *
I hope I've found all the correct places!
2003-05-02 08:45:10 +00:00
pk 5ac72273d9 Restore TLB flushes when removing level 2 & 3 page tables (these went missing
in revision 1.242).
2003-05-01 14:14:46 +00:00
martin d7259b772a Make this compile with __FULL_SPARC_BUS_SPACE,
from Steve Rumble in PR 21398.
2003-04-30 22:12:34 +00:00
scw 8c5c893bf7 Add a BKPT_ADDR() macro which gives MD code a chance to munge a
breakpoint address before it's used. Currently a no-op on all but sh5.

This is useful on sh5, for example, to mask off the instruction
type encoding in the bottom two address bits, and makes it possible
to do "db> break $rXX" instead of manually munging the address.
2003-04-29 17:06:03 +00:00
bjh21 4be7a2dcf3 Add a new feature-test macro, _NETBSD_SOURCE. If this is defined
by the application, all NetBSD interfaces are made visible, even
if some other feature-test macro (like _POSIX_C_SOURCE) is defined.
<sys/featuretest.h> defined _NETBSD_SOURCE if none of _ANSI_SOURCE,
_POSIX_C_SOURCE and _XOPEN_SOURCE is defined, so as to preserve
existing behaviour.

This has two major advantages:
+ Programs that require non-POSIX facilities but define _POSIX_C_SOURCE
  can trivially be overruled by putting -D_NETBSD_SOURCE in their CFLAGS.
+ It makes most of the #ifs simpler, in that they're all now ORs of the
  various macros, rather than having checks for (!defined(_ANSI_SOURCE) ||
  !defined(_POSIX_C_SOURCE) || !defined(_XOPEN_SOURCE)) all over the place.

I've tried not to change the semantics of the headers in any case where
_NETBSD_SOURCE wasn't defined, but there were some places where the
current semantics were clearly mad, and retaining them was harder than
correcting them.  In particular, I've mostly normalised things so that
_ANSI_SOURCE gets you the smallest set of stuff, then _POSIX_C_SOURCE,
_XOPEN_SOURCE and _NETBSD_SOURCE in that order.

Tested by building for vax, encouraged by thorpej, and uncontested in
tech-userlevel for a week.
2003-04-28 23:16:11 +00:00
ragge d79e49080c #ifdef around end[]. 2003-04-26 14:12:22 +00:00
ragge d8c8fa8111 Add pseudo-device ksyms. 2003-04-26 14:10:04 +00:00
ragge 69a66687f8 Call ksyms_init() instead of ddb_init() in case of
NKSYMS || defined(DDB) || defined(LKM)
2003-04-26 11:05:05 +00:00
ragge 766d04f56a Add ksyms device major. 2003-04-25 21:10:46 +00:00
martin d313e6d92e Add sysmon device. 2003-04-20 16:53:46 +00:00
christos a2dfb1b570 PR/3012: Greg A. Woods: Write all float.h files [except the vax of course]
in terms of float_ieee.h
2003-04-19 23:05:28 +00:00
jdc 7a2abff303 Always include (new) cpuconf.h.
From Christopher SEKIYA in PR port-sparc/21093.
2003-04-11 13:55:24 +00:00
jdc eacecff6bb Install (new) cpuconf.h.
From Christopher SEKIYA in PR port-sparc/21093.
2003-04-11 13:54:16 +00:00
christos b9f9db3ca2 Bye Bye UCONSOLE 2003-04-10 22:06:51 +00:00
thorpej d154229cf2 Don't define PAGE_SIZE, etc. in terms of NBPG, rather use the same
logic as used by <machine/param.h> to define constant PAGE_SIZE if
possible.

Also define the minimum and maximum PAGE_SIZE that might appear in
any given configuration (4K and 8K, respectively).
2003-04-09 16:27:06 +00:00
thorpej efdd83f440 Move CPU configuration predicates to <machine/cpuconf.h>. 2003-04-09 16:22:33 +00:00
uwe b0645fe98e Add names for v8 traps (cf page 76, table 7-1).
Fix coprocessor disabled/exception traps that were placed incorrectly:
cp_disabled == 0x24 (0t36) was placed at 0x36, ditto for cp_exception.
2003-04-08 21:56:31 +00:00
uwe d7080d6b9d In msiiep_attach print \n to terminate its attachment line. 2003-04-08 15:16:14 +00:00
uwe cb7b4919ec Make v8_*_len symbols local so that they don't get in the way in ddb. 2003-04-08 01:51:46 +00:00
he b44c5e8370 Track changes introduced when UFS2 was merged, so that this builds again. 2003-04-05 08:58:55 +00:00
christos 14e617d80f try to make this work with ufs1 only. 2003-04-03 22:10:12 +00:00
thorpej 02efafccdc Use PAGE_SIZE rather than NBPG. 2003-04-02 04:35:22 +00:00
pk a63321f624 pmap_kprotect: use supervisor permissions; don't bother checking for `no
change' case, it's not worth the effort.
2003-03-25 11:33:46 +00:00
hannken f2746edc5b Explicit cast for netif.
Approved by: Matthias Drochner <drochner@netbsd.org>
2003-03-13 12:02:54 +00:00
jdc cc782e8a7e Make this compile with only SUN4 defined. 2003-03-12 07:51:00 +00:00
lukem 6107a9b605 crank memory disk from 1360 blocks to 1376 blocks 2003-03-08 00:04:36 +00:00
pk f26c7b7e7f Note a kernel pmap locking problem in pmap_kenter_pa4m(). 2003-03-03 22:43:58 +00:00
tshiozak 31e2cbf0b5 add some ISO C 1995 I18N functions and types:
btowc, wctrans, towctrans, wcscoll, wcsxfrm, wctype_t and wctrans_t.
2003-03-02 22:18:11 +00:00
pk 77accc351e Use the new pmap_kprotect() function instead of pmap_changeprot().
The latter is now a pmap internal function; and it wasn't used correctly
in mkclock.c anyway.
2003-03-02 21:42:48 +00:00
pk 22cf03a09f pmap_changeprot() is not a UVM <-> PMAP interface function; make it internal.
Provide pmap_kprotect() for MD code to change protection on a range of
kernel addresses (cuurent users: intr.c and mkclock.c).
2003-03-02 21:37:20 +00:00
pk 1b5340d327 Add support for large kernels by searching for a physical memory segment
to fit it in. As a bonus, the kernel is now also mapped to the virtual
address (i.e. KERNBASE) it is linked at.
2003-03-01 13:01:55 +00:00
perseant eab869e1c0 Make BRIDGE_IPF an option, and document it. Add it (commented) to GENERIC.
Let brconfig tell whether the bridge is using the ipfilter hook, or not.
2003-02-27 19:22:36 +00:00
pk 33bdc2efe0 Free page table pages to the same VM map they were allocated from. 2003-02-27 14:19:41 +00:00
pk 4eb3db09d9 Move all `ID prom' stuff into the prom library. 2003-02-26 17:39:05 +00:00
pk fb425a12ca Re-define `struct memarr' to have the same layout as the V2 ROM memory
property to avoid gratuitous copying in prom_makememarr().

Have prom_makememarr() accept a NULL pointer, in which case it will return
the size of the array needed to store the memory descriptors.
2003-02-26 14:25:20 +00:00
pk f5831d3d87 Store the physical memory descriptors on top of the kernel instead of
allocating a fixed sized array.
2003-02-26 14:18:24 +00:00
thorpej 3ea6b8be93 Add missing splbio() protecting of bufpool access. Add a clarifying
comment to <sys/buf.h> reminding everyone of the need for splbio().
2003-02-25 21:25:40 +00:00
thorpej eb14e86676 Add a new BUF_INIT() macro which initializes b_dep and b_interlock, and
use it.  This fixes a few places where either b_dep or b_interlock were
not properly initialized.
2003-02-25 20:35:31 +00:00
pk b69aef5f3e * Use fdloadfile() to avoid opening the the underlying device twice.
* Cleanup old stuff.
2003-02-25 08:09:30 +00:00
pk dd87308a05 Note which network boot protocol we're trying. 2003-02-25 08:06:29 +00:00
pk a8bd073e6f pv_unlink4m(): don't forget to link in a new PV entry after alias checking. 2003-02-24 15:14:51 +00:00
pk 007c1ca9cf Remove the assumption in the sun4/sun4c bootstrap code that the kernel
is always mapped using PMEGs and SMEGs starting at #0.
2003-02-21 19:07:36 +00:00
pk b7f550c62d Allow the kernel to be loaded at its link address (aka KERNBASE) by the
boot program.
2003-02-21 19:04:07 +00:00
pk b8081a591a Change locking prerequisites for the pv_changepte4m() helper function
to avoid locking recursion.
2003-02-20 16:22:49 +00:00
martin c3ed92df3e Add a few new devices. 2003-02-20 12:02:31 +00:00
pk b66bce23df Finish PV table locking. Terminology and locking strategy stolen from
the alpha port.
2003-02-19 22:27:08 +00:00
pk d286e74769 pgt_page_alloc: use uvm_km_kmemalloc() so we can honor the PR_NOWAIT flag
pmap_kenter_pa4m: lock the pmap we're working on.
2003-02-18 22:05:08 +00:00
pk 2b390d41d0 Move makememarr() into promlib.c. 2003-02-18 13:36:51 +00:00
pk c502753d44 Fix pasto in previous. 2003-02-15 13:30:11 +00:00
pk 84e3fcabb3 Redo part of rev. 1.237; the pages at KERNBASE might not be mapped when the
kernel has just been loaded.
2003-02-15 13:17:41 +00:00
pk baa98646a0 It's not necessary to complicate the computation of `va2pa_offset': we already
assume that the few leading pages in front of the kernel image are
always present.

Adjust `va2pa_offset' on sun4 and sun4c as well, so that some day we can
have the bootstrap program load the kernel some place else.
2003-02-14 22:24:58 +00:00
pk d6b6eb78e4 Move the PV list header into the VM page vm_page_md structure.
Also, start using a spin lock to protect PV list operations.
2003-02-13 09:53:20 +00:00
pk 338f31f581 Make the buffer cache code MP-safe. 2003-02-05 21:38:38 +00:00
mrg 2a81b2dfea clean up a couple of SMP comments. 2003-01-31 01:26:39 +00:00
hannken eea2fc320e Fix printf() problem caused by "daddr_t" change. 2003-01-30 16:33:50 +00:00
pk be1188e00d Provide locking required by the interrupt handlers running at IPL_SERIAL. 2003-01-28 12:35:31 +00:00
kent cd7d9faeaf Introduce BUS_DMA_NOCACHE, and bus_dmamem_map() of i386 supports it. 2003-01-28 01:07:51 +00:00
pk bfb9cac2fc Release the kernel lock in upcallret() and startlwp(). 2003-01-26 13:20:12 +00:00
fvdl a3ff3a3038 Bump daddr_t to 64 bits. Replace it with int32_t in all places where
it was used on-disk, so that on-disk formats remain the same.
Remove ufs_daddr_t and ufs_lbn_t for the time being.
2003-01-24 21:55:02 +00:00
pk f65446d08d When stopping a CPU, clear its bit from cpu_ready_mask. 2003-01-23 22:33:41 +00:00
pk a6a16741fe Optimize xcall() et.al. further by maintaining a cpuset mask of all CPUs
marked ready. This saves repeated testing for NULL pointers and the
CPUFLG_READY flag.
Also use a separate flag variable to signal xcall completion. This saves a
load and a pipeline stall.
2003-01-23 19:54:35 +00:00
pk a799bdd88d GC the per-CPU message lock.
Move the level 15 msg area further down the cpuinfo structure, as it's
used infrequently.
2003-01-23 18:49:08 +00:00
pk 39ce68a44b bogusintr: print cpu number. 2003-01-23 14:56:06 +00:00
pk 22acc2a827 Shave some code off xcall(). 2003-01-23 14:54:33 +00:00
pk 40a1653fc2 pmap_kenter_pa4m: like pmap_enk4m(), we can use setpte4m().
ctx_free: fix cache flush context for sun4/sun4c.
2003-01-23 12:48:53 +00:00
pk 698ca6fb6f LWPify cpu_debug_dump(). 2003-01-23 11:50:50 +00:00
pk 9d33cc7115 Set the interrupt target to the current CPU when directly accessing
the chip for console I/O.
2003-01-22 22:00:39 +00:00
pk 53c776f062 Add functions to set & get the interrupt target CPU. 2003-01-22 21:58:28 +00:00
sjg b3d7df8002 Don't hide bootmid behind MULTIPROCESSOR. 2003-01-21 06:18:41 +00:00
pk 26eedde15b srmmu_cache_flush: when flushing per-page and doing more than one page,
we might be crossing a segment boundary.
2003-01-20 22:15:54 +00:00
pk d823499ff4 pmap_enter4m: when installing a new PTE we don't need to invoke the elaborate
TLB de-map protocol.  In the relatively infrequent case where this function
must update an existing mapping, do the de-map explicitly before installing
the new PTE value.
2003-01-20 22:03:54 +00:00
pk ab9a8ae184 Set the system-wide cache aliasing distance according to the largest cache
found on the CPU modules (hypersparc & cypress).

Vikings have a physically indexed cache, so don't bother with computing an
aliasing distance (leaving cache_alias_dist zero disables the BAD_ALIAS macro).
2003-01-20 21:56:34 +00:00
pk b4a0aebea2 Add SUN4D case for cache alias macros. 2003-01-20 21:43:38 +00:00
pk 353e527861 Remove the restriction that the boot CPU must be the first CPU in the order
as it is presented by the PROM. This is actually amazingly less trivial
than it looks at first, since the finding the Module ID that's currently
executing your code is specific for each module type and/or manufacture.
2003-01-20 20:51:33 +00:00
pk 18f455c44f Replace some more VA2PA(<static_addr>) calls with PMAP_BOOTSTRAP_VA2PA() 2003-01-20 15:45:40 +00:00
pk 5815e88f83 De-couple some MULTIPROCESSOR and SUN4M/SUN4D dependencies. 2003-01-20 12:06:49 +00:00
pk 5be63cb4a3 xcall(): two more printf => printf_nolog 2003-01-20 00:55:52 +00:00
thorpej c464d72f40 Merge the nathanw_sa branch. 2003-01-18 06:44:56 +00:00
pk 4d7731a177 cpu_switch:
* return `switched to same process' only if that process was actually
  already on a run queue when we entered.
* skip the switch to the idle stack if we can switch immediately
* .. and because of this, don't release the scheduler lock until after
  we've fully switched to the new process's stack.
2003-01-17 14:49:45 +00:00
pk d352e8ce9c pmap_deactivate(): only update the pmap's cpuset if need to. 2003-01-17 14:15:17 +00:00
pk 1d67b9c75a Don't grab the kernel lock for system timer interrupts; this mostly prevents
stalls in system time processing.

XXX - deal with non-atomic global time variables updates later.
2003-01-17 10:36:19 +00:00
pk 2252ed574d mp_{pause,resume,halt}_cpus(): check for cpus==NULL. 2003-01-16 17:21:43 +00:00
pk c454f450b1 Define a MP version of callrom(). 2003-01-16 16:58:52 +00:00
pk 7d4c3f7430 Remove some accidental garbage. 2003-01-16 16:58:23 +00:00
pk 72c28f7bb7 Rename the current mp_{pause,resume}_cpus() => mp_{pause,resume}_cpus_ddb().
Implement mp_pause_cpus/mp_resume_cpus on top of the PROM services.
2003-01-16 16:57:43 +00:00
pk 58b50d0643 Read the CPU mailbox in the level 15 soft interrupt handler and respond
to idle and stop requests.
2003-01-16 16:27:48 +00:00
pk b418a6a59d Some PROMs get really uneasy if the prom_reboot() function is called
after the other CPUs have already return into the PROM through prom_cpustop().
So don't do it; try to halt the other CPUs only when an actual `halt'
is requested.

My guess in this case is that the PROM does not expect its original boot
CPU to call prom_cpustop(0), or possibly treats it as the equivalent of
a prom_halt() which is then called again by some other CPU. In any case,
the result is garbage.
2003-01-16 16:20:20 +00:00
pk f312ee5f9a What do you know.. the prom_cpu{stop,idle,resume} function appear to be
returning a success/fail flag. For now, use it to be informative.
2003-01-16 16:10:44 +00:00
pk 5e231ddd1c * Implement mp_halt_cpus()
* xcall: use printf_nolog()
2003-01-16 14:49:08 +00:00
pk 72286d4202 Definitions of some OBP generated CPU mailbox messages. 2003-01-16 14:43:07 +00:00
pk 26fa27a910 Fix reboot options handling; now one-letter kernel names can also be booted. 2003-01-16 11:33:21 +00:00
pk a5cea9e740 On Hypersparc MP machines, we need to flush the TLB after a page cache flush.
While the pmap functions take care of properly ordering cache and TLB flushes,
not all TLB flush requests are sent to all CPUs (due to per CPU pmap tracking)
while cache flushes are always broadcast.

XXX: need to investigate pmap tracking for cache flush operation as well.
2003-01-15 22:56:32 +00:00
pk 5bb3d93538 srmmu_cache_flush: switch MMU contexts in all places where it matters.
(incidentally, this also makes Hypersparc MP machines mostly go).
2003-01-15 16:42:27 +00:00
pk a458d9f040 Fix compiler warning induced by last change. 2003-01-15 06:57:12 +00:00
pk 9eb63b3b94 statintr: if interrupting code running below IPL_SCHED, call schedintr()
directly, saving the overhead of an extra soft interrupt.
2003-01-14 23:00:59 +00:00
pk c8226e1ce0 Define spllowerschedclock().
To be used in the same spirit as spllowersoftclock().
2003-01-14 22:58:00 +00:00
pk d45f77c6c8 Add CLKF_LOPRI() macro that allows a (timer) interrupt handler to determine
whether it is interrupting code running at a given IPL level.
2003-01-14 22:54:53 +00:00
pk ee7e8274a6 xcall: raise IPL to splsched() to prevent interrupts that take schedlock.
Otherwise we have a locking order problem with schedlock and xmsglock.
2003-01-14 17:30:55 +00:00
pk 18cd92ffe3 (Re)initialise the pmap structure fields that are not preserved on the
pmap pool cache all in one place.
2003-01-14 13:56:07 +00:00
pk b50058b483 Broadcast I-cache flush in the `Unimplemented Flush' trap handler. 2003-01-13 20:00:34 +00:00
pk b4a1c0f6a0 Reset ddb_cpuinfo when leaving DDB. 2003-01-13 19:44:53 +00:00
pk 167ce8e6d3 Fix stack tracing once again.
Also check for trap frame boundaries when fetching the return address.
2003-01-13 19:44:06 +00:00
pk df4b5f766b Remove UNLOCK_XPMSG() before cpu_halt(); it's not compatible with LOCKDEBUG
and it wan't chique in any case.
2003-01-13 16:59:17 +00:00
mrg 8d9571d120 remove cpu_hatched, cpu_hatch_sc and cpu_hatchstack. the first can use
the cpi->flags, the second is unused and the third is also cpi-idle_u.
2003-01-13 15:50:50 +00:00
pk 5642428f4e Use print_nolog() from xcall(), to avoid confounding things even further
by re-entering the scheduling code to wakeup syslog waiters.
2003-01-13 15:01:16 +00:00
pk 4641d55697 Halt any other CPUs in cpu_reboot(). 2003-01-13 01:35:45 +00:00
pk 2684c88122 fpulock: encapsulate required IPL raise in the FPU LOCK/UNLOCK macros. 2003-01-12 16:29:00 +00:00
uwe 24780840a1 Account softintr_common as uvmexp.softs, not uvmexp.intrs. 2003-01-12 06:11:01 +00:00
pk 55a3bd0a85 schedcpu() has been fixed; now we can notify another CPU about a pending
reschedule request.
2003-01-12 01:50:51 +00:00
pk c41718e9ec Remove needless indirection from the curproc() macro. 2003-01-12 01:19:00 +00:00
pk ae33d2b4e5 Use per-CPU virtual addresses for pmap_copy_page() & pmap_zero_page(). 2003-01-12 01:16:06 +00:00
pk dab556c2b1 pmap_deactivate(): arguments for sp_tlb_flush() were reversed. 2003-01-12 00:34:52 +00:00
mrg 90d9434890 keep track of which cpu's have run a pmap and only broadcast tlb flushes to
cpu's who have done so.  implement pmap_deactivate() for MULTIPROCESSOR and
call it from cpu_switch() when we are about to switch proces and when we
enter idle().

with this change, i see significantly reduced tlb IPI traffic and fork/exec
bound processes -- such as "configure" -- run significantly faster, upto
15%.  i also obvserved a small (0-2%) benefit to CPU bound tasks as well.
2003-01-11 03:40:31 +00:00
mrg e756303d08 expand db_proc_cmd() a little more. 2003-01-10 19:25:12 +00:00
pk 30cc38bdb5 Replace `want_resched' and `want_ast' globals by per-CPU variables. 2003-01-10 16:34:14 +00:00
thorpej b346ea724a Merge sparc and sparc64 <machine/signal.h>. 2003-01-09 23:25:24 +00:00
mrg 70628f1993 clean up db_proc_cmd() output slightly. 2003-01-09 18:00:51 +00:00
pk 18c8de0d93 It's now required to turn off traps in the srmmu cache flush ops in
non-MULTIPROCESSOR kernels too.
2003-01-09 12:29:52 +00:00
pk cbc8b8122d Check for existing soft interrupts too before trying to install a fast
interrupt handler.
2003-01-09 10:27:24 +00:00
mrg ec9ebd1af6 - s/xpmsg11/xpmsg15/
- clean up
- no need to reset the msg.tag
2003-01-09 05:55:30 +00:00
mrg 7386726570 remove a line accidentally commited in previous. 2003-01-09 05:27:09 +00:00
mrg 9b0c7030f5 call splclock() around the FPU_LOCK().
XXX: pk suggests we can make the this a sleeping lock.
2003-01-09 04:58:58 +00:00
pk f234ea91a2 Remove write_user_windows() from a number of `4m' functions, since we don't
switch contexts with traps enabled anymore.
2003-01-08 18:46:28 +00:00
pk f63279a9b6 Add CPUINFO_WANT_RESCHED and CPUINFO_WANT_AST 2003-01-08 17:49:39 +00:00
pk 87e0907cbb Avoid external declaration for the dummy `ross_pend' variable. 2003-01-08 17:22:09 +00:00
pk 127392a5b7 Prepare for per-CPU reschedule and AST requests. 2003-01-08 17:19:53 +00:00
pk d3db019efd Make pv_uncache() and pv_cacheflush() static functions.
Split pv_cacheflush() in sun4/sun4c and sun4m/sun4d versions.
2003-01-08 16:16:46 +00:00
pk f4018cde22 Initialise the secondary CPUs' `spc_runtime'. 2003-01-08 01:20:56 +00:00
mrg 88f08d9ac1 - add a new message tag for level15 software NMI, and switch ddb to use this
rather than the level13 software intr xpmsg area.  now DDB IPI's don't lock
the xpmsg_lock and we avoid recursion and more.
- don't actually use cpuinfo.msg.lock yet, xpmsg_lock suffices.
- reread the pending register on mbus hypersparc cpus to avoid bugs in the
h/w that cause IPI's to be missed.
2003-01-07 16:20:13 +00:00
pk 02d686d112 Simplify ddb register storage setup: remove MULTIPROCESSOR special cases
and keep the ddb register copies on the current stack always.
2003-01-07 16:03:03 +00:00
pk 469014c2cd * Maintain a pointer to the cpu_info structure of the CPU being examined.
* Force cpu_Debugger() to have a stack frame, so tracing can at least
  start off matching arguments and function calls correctly.
2003-01-07 15:15:06 +00:00
pk 004dd5ecba #include <sys/kernel.h> for `cold'. 2003-01-07 13:12:59 +00:00
pk 63b5299d1e Let all CPUs play.. 2003-01-07 12:09:00 +00:00
pk e1dfbff267 xcall: use splclock() to prevent interrupts that want the kernel lock. 2003-01-07 10:57:18 +00:00
mrg 141297688f revert (most of) previous 2003-01-07 10:31:56 +00:00
mrg c0338e49bf don't do the xcall() dance on sun4d for the cache flushing, but do make
sure we're only doing one flush at a time...
2003-01-07 05:57:37 +00:00
wiz 1035faff1d writable, not writeable. 2003-01-06 20:30:28 +00:00
pk 0a66c7efe5 Protect FPU context switching with its own lock. 2003-01-06 18:32:31 +00:00
lukem 4bb41ae2f2 Rework how KERNOBJDIR functions; now it's always determined with
cd ${KERNSRCDIR}/${KERNARCHDIR}/compile && ${PRINTOBJDIR}
This is far simpler than the previous system, and more robust with
objdirs built via BSDOBJDIR.

The previous method of finding KERNOBJDIR when using BSDOBJDIR by
referencing _SRC_TOP_OBJ_ from another directory was extremely
fragile due to the depth first tree walk by <bsd.subdir.mk>, and
the caching of _SRC_TOP_OBJ_ (with MAKEOVERRIDES) which would be
empty on the *first* pass to create fresh objdirs.

This change requires adding sys/arch/*/compile/Makefile to create
the objdir in that directory, and descending into arch/*/compile
from arch/*/Makefile.  Remove the now-unnecessary .keep_me files
whilst here.

Per lengthy discussion with Andrew Brown.
2003-01-06 17:40:18 +00:00
mrg 675149a358 - md_fpumid = -1 => md_fpu = NULL, in some #ifdef FPU_DEBUG code
- only call KERNEL_PROC_UNLOCK() if we called KERNEL_PROC_LOCK() originally.
2003-01-06 14:16:10 +00:00
pk 67998a8646 Move schedintr() to clock.c and initialise schedhz in initclocks(), so
these are available to all timer implementations.
2003-01-06 12:50:43 +00:00
pk 9a9c991837 Fix SP tlb_flush_{ctx,all} macros. 2003-01-06 12:10:46 +00:00
pk 9df7616ed3 Combine the various sun4m/sun4d TLB flush routines into a hand-coded
assembler version.
2003-01-05 19:38:42 +00:00
pk c0142e4ded Print the cpu number in many pmapdebug-controlled debug traces. 2003-01-05 19:31:12 +00:00
pk 113229a2cb trap(T_FPE): reset the `p_md.md_fpu' when preempting the FPU. 2003-01-05 19:26:17 +00:00
pk 3e2e9af6c9 Grab the kernel lock on interrupts at level IPL_CLOCK and lower. 2003-01-04 19:25:36 +00:00
pk 5e73320f0f Re-arrange the fields in struct cpu_info such that the most heavily used ones
are together, to reduce cache stomping.
2003-01-04 18:54:45 +00:00
pk f6fc3bd5fc new cpu_switch: SMP: even if we pick up the same process after idling, we
must reset its context as the process might have run on another cpu in
between and had its context changed, e.g. by exec(2).
2003-01-04 11:09:18 +00:00
mrg 277fb5e18a remove a now bogus comment from xcall() 2003-01-03 16:27:23 +00:00
mrg 68da24bd3d - remove some dead debug code
- don't cross call the smp_tlb_flush*() routines on SUN4D, just ensure
that there is only one concurrent flush happening.
2003-01-03 16:24:50 +00:00
mrg fb1500c7e1 remove dead extern fpproc/foundfpu declarations. 2003-01-03 16:21:05 +00:00
mrg 5b23b7800a FPU save is handled in xcall() now. 2003-01-03 16:20:21 +00:00
pk 444faacaac xcall(): consult the `cpuset' argument for posting the cross calls. 2003-01-03 15:49:11 +00:00
pk 0a78c9e13a Define a few XCALL? shorthand macros to avoid clutter. 2003-01-03 15:44:55 +00:00
pk ff451161e2 Finish FPU context switching on SMP systems. 2003-01-03 15:12:02 +00:00
martin 87a073002c Make the *_stream_* methods always use the *_real accessors.
Define __BUS_SPACE_HAS_STREAM_METHODS.
2003-01-03 13:23:39 +00:00
mrg 7bd617d237 part one of bus_space(9) fixes to enable bus spaces to override the
bus_space_{read,write}_[1248]() functions, which will allow 16-bit
PCMCIA support to work without additional hacks in MI drivers.
this option is not enabled yet.
2003-01-03 11:57:45 +00:00
pk 947028ed94 reverse mailbox physical address check: now warn if it's not I/O space. 2003-01-03 09:22:11 +00:00
pk 3f5be1863e srmmu cache flush: use to the CPU context parameter; this is now required. 2003-01-03 09:19:03 +00:00
mrg c79ff46cb6 don't try to setup MXCC registers on non-primary CPU's on systems without
SMP support.
2003-01-02 09:42:09 +00:00
pk 9dd42c6155 SMP: lock kernel for soft interrupts < IPL_SCHED as well. 2003-01-01 16:17:10 +00:00
pk 3607bd7dca pmap_alloc_cpu: use flags from boot cpu for now, as the passed cpu_info
structure has not been fully setup yet.
2003-01-01 15:56:11 +00:00
pk 16305a65cb prom mailbox map: look for the property `mailbox-virtual' first. 2003-01-01 15:51:00 +00:00
mrg 2fff4ee989 fix a comment. 2003-01-01 08:24:48 +00:00
mrg d06249b555 KNF. 2003-01-01 06:33:29 +00:00
thorpej 9c1214153c Use aprint_normal() for cfprint routines. 2003-01-01 02:20:47 +00:00
pk 2aac3c7c89 Slight optimisation in proc_trampoline(). 2002-12-31 17:07:36 +00:00
pk 1df04e663f Make the schedintr() code common for all timers. 2002-12-31 16:45:52 +00:00
pk 7b7269ba42 New version of cpu_switch/switchexit, mostly to simplify SMP support. It's
currently conditional on ALT_SWITCH_CODE (defaults to `on' if MULTIPROCESSOR
is defined) until more testing rounds are completed.
2002-12-31 16:17:12 +00:00
pk 3d8def4865 Use a soft interrupt scheme to schedule schedclock(), so we can make
splsched() less than splhigh().
2002-12-31 15:57:26 +00:00
pk 67e16e38a4 Define IPL_SCHED at level 11 and make splsched() use it. 2002-12-31 15:51:18 +00:00
pk d358537b64 Pass the CPU context to all TLB flush routines. Because of this (and the
fact that cache flushes are also passed the context number), most
"long-term" context switches can be eliminated from the SRMMU versions
of the pmap functions.
2002-12-31 15:23:29 +00:00
pk 83dae8a821 * map the PROM CPU mailbox if available.
* map MXCC error/status registers if available.
* add MXCC-specific module error interrupt handler.
* use high priority interrupt level in mp_pause_cpus()
2002-12-31 15:10:28 +00:00
pk 2b59d26892 Add offset for `cpuinfo.ci_tt'. 2002-12-31 15:05:48 +00:00
pk c3bb05ff5b * Add level argument to raise_ipi()
* Add diagnostic field members to cpu_info.
2002-12-31 15:04:49 +00:00
pk 5c671fd10d nmi_sun4m: run handler at splhigh() 2002-12-31 14:34:54 +00:00
pk 43b86d0b59 rwindow debug code: display the current cpu number. 2002-12-31 13:17:23 +00:00
pk a1e9e5cae8 Add some more definitions: SRMMU and MXCC reset register. 2002-12-31 12:01:27 +00:00
mrg 122353da40 rename CPU_READY() to CPU_NOTREADY() seeing that's what it checks. 2002-12-28 02:35:56 +00:00
mrg 7d51aacb32 update the vme bus_space_tag_t to reality. 2002-12-28 01:33:00 +00:00
martin ffbcb6d927 Conditionalize T_DBPAUSE trap handling on #ifdef MULTIPROCESSOR to make
single CPU kernels compile again.
2002-12-26 12:14:31 +00:00
pk f8055a350c * Use correct PC value for displaying the called function.
* Merge code to display non-kernel frames.
2002-12-23 13:21:10 +00:00
pk f953a01835 xcallintr() receive a `clockframe *' argument, not a `trapframe *'.
Setup a DDB context for paused CPUs by defining a soft trap (T_DBPAUSE)
which uses the generic trap handler code to get the trapframe constructed
and then calls on a debugger-defined `suspend' routine.
2002-12-23 00:55:16 +00:00
pk 5c62f82bdf Upon trap exit, update the trapframe with data for the running CPU rather
than the one which was the last target of the `machine cpu' command.
2002-12-23 00:42:37 +00:00
mrg 6ee482ef5b change what 'hw.model' reports to be more inline with other netbsd ports, as
well as reporting the actual machine model & cpu, rather than first configured
CPU.  changes for two machines are:

old:
	hw.model = TMS390Z50 v0 or TMS390Z55 @ 75 MHz, on-chip FPU
	hw.model = SUNW,UltraSPARC @ 143.002 MHz, version 0 FPU

new:
	hw.model = SUNW,SPARCstation-20 (TMS390Z50 v0 or TMS390Z55 @ 75 MHz, on-chip FPU)
	hw.model = SUNW,Ultra-1 (SUNW,UltraSPARC @ 143.002 MHz, version 0 FPU)

as per discussion on port-sparc & port-sparc64.
2002-12-22 02:17:24 +00:00
manu 4a06119a9d Pass the system call table to trace_enter() and ktrsys() so that it is
possible to use alternate system call tables. This is usefull for
displaying correctly the arguments in Mach binaries traces.

If NULL is given, then the regular systam call table for the process is used.
2002-12-21 16:23:56 +00:00
pk 4e0634669b * xcallintr(): use cpuinfo directly again.
* nmi_soft(): remove most of the obsoleted requests.
2002-12-21 12:55:54 +00:00