Commit Graph

438 Commits

Author SHA1 Message Date
jake
368a87f05d Remove invalid KASSERTS. 2002-04-06 08:21:43 +00:00
tmm
d0e8175f2e Add missing header for the eeprom driver frontents. 2002-04-05 02:40:54 +00:00
tmm
2ef6f72545 Add MD frontents for the mk48txx driver, ported from NetBSD, and remove
stub implementations of inittodr() and resettodr(), now that the MI ones
are used.
2002-04-04 23:58:50 +00:00
jhb
db9aa81e23 Change callers of mtx_init() to pass in an appropriate lock type name. In
most cases NULL is passed, but in some cases such as network driver locks
(which use the MTX_NETWORK_LOCK macro) and UMA zone locks, a name is used.

Tested on:	i386, alpha, sparc64
2002-04-04 21:03:38 +00:00
bde
14ae95f735 Moved signal handling and rescheduling from userret() to ast() so that
they aren't in the usual path of execution for syscalls and traps.
The main complication for this is that we have to set flags to control
ast() everywhere that changes the signal mask.

Avoid locking in userret() in most of the remaining cases.

Submitted by:	luoqi (first part only, long ago, reorganized by me)
Reminded by:	dillon
2002-04-04 17:49:48 +00:00
ru
d8ffece3c4 Dike out a highly insecure UCONSOLE option.
TIOCCONS must be able to VOP_ACCESS() /dev/console to succeed.

Obtained from:	OpenBSD
2002-04-03 10:56:59 +00:00
jhb
9d3d63fcbc - Move the MI mutexes sched_lock and Giant from being declared in the
various machdep.c's to being declared in kern_mutex.c.
- Add a new function mutex_init() used to perform early initialization
  needed for mutexes such as setting up thread0's contested lock list
  and initializing MI mutexes.  Change the various MD startup routines
  to call this function instead of duplicating all the code themselves.

Tested on:	alpha, i386
2002-04-02 22:19:16 +00:00
tmm
3ac364813a Fix crashes that would happen when more than one 4MB page was used to
hold the kernel text, data and loader metadata by not using a fixed slot
to store the TSB page(s) into. Enter fake 8k page entries into the kernel
TSB that cover the 4M kernel page(s), sot that pmap_kenter() will work
without having to treat these pages as a special case.

Problem reported by:	mjacob, obrien
Problem spotted and 4M page handling proposed by:       jake
2002-04-02 17:50:13 +00:00
tmm
721449cf80 Remove the superfluous second argument from the IOTSBSLOT() macro. 2002-04-02 17:41:06 +00:00
tmm
7e32437fbb Lower UPA_MEMSTART to 0x1c000000000. This is required for some larger
Enterprise machines.
2002-04-02 17:38:52 +00:00
tmm
45398f8631 Set mp_maxid so that UMA works with SMP.
Submitted by:	jake
2002-04-02 17:37:06 +00:00
tmm
198af052bf Do not try to set up the PCI bus B error interrupt on "sabre"s, since
it is only available on "psycho"s. The same applies to the power
management interrupt, which is not enabled by default though.
2002-04-02 17:27:35 +00:00
tmm
2d73e08660 Remove a debugging panic that was triggered when a resource that was out
of range was tried to be allocated; just return failure instead.
2002-04-02 17:23:45 +00:00
dillon
3ad295d416 Stage-2 commit of the critical*() code. This re-inlines cpu_critical_enter()
and cpu_critical_exit() and moves associated critical prototypes into their
own header file, <arch>/<arch>/critical.h, which is only included by the
three MI source files that need it.

Backout and re-apply improperly comitted syntactical cleanups made to files
that were still under active development.  Backout improperly comitted program
structure changes that moved localized declarations to the top of two
procedures.  Partially re-apply one of the program structure changes to
move 'mask' into an intermediate block rather then in three separate
sub-blocks to make the code more readable.  Re-integrate bug fixes that Jake
made to the sparc64 code.

Note: In general, developers should not gratuitously move declarations out
of sub-blocks.  They are where they are for reasons of structure, grouping,
readability, compiler-localizability, and to avoid developer-introduced bugs
similar to several found in recent years in the VFS and VM code.

Reviewed by:	jake
2002-04-01 23:51:23 +00:00
jake
15dc222b82 Move the CTASSERT macro from MD code to systm.h alongside KASSERT so other
code can use it.  This takes a single constant argument and fails to compile
if it is 0 (false).  The main application of this is to make assertions about
structure sizes at compile time, in order to validate assumptions made in
other code.  Examples:

CTASSERT(sizeof(struct foo) == FOO_SIZEOF);
CTASSERT(sizeof(struct foo) == (1 << FOO_SHIFT));

Requested by:	jhb, phk
2002-04-01 21:55:00 +00:00
jake
f9f52274db ktr changes to improve performance and make writing a userland utility to
dump the trace buffer feasible.
- Remove KTR_EXTEND.  This changes the format of the trace entries when
  activated, making writing a userland tool which is not tied to a specific
  kernel configuration difficult.
- Use get_cyclecount() for timestamps.  nanotime() is much too heavy weight
  and requires recursion protection due to ktr traces occuring as a result
  of ktr traces.  KTR_VERBOSE may still require recursion protection, which
  is now conditional on it.
- Allow KTR_CPU to be overridden by MD code.  This is so that it is possible
  to trace early in startup before pcpu and/or curthread are setup.
- Add a version number for the ktr interface.  A userland tool can check this
  to detect mismatches.
- Use an array for the parameters to make decoding in userland easier.
- Add file and line recording to the non-extended traces now that the extended
  version is no more.

These changes will break gdb macros to decode the extended version of the
trace buffer which are floating around.  Users of these macros should either
use the show ktr command in ddb, or use the userland utility which can be run
on a core dump.

Approved by:	jhb
Tested on:	i386, sparc64
2002-04-01 05:35:26 +00:00
phk
87273d930a Centralize the "bootdev" and "dumpdev" variables. They are still pretty
bogus all things considered, but at least now they don't camouflage as
being MD variables.
2002-03-31 07:15:28 +00:00
alc
84ad095a1c Correct a comment: sendsig() calls the MI vm_map_growstack() but
the corresponding comment refers to a MD grow_stack() that doesn't exist.
2002-03-30 20:58:08 +00:00
jake
8f9ce8398d Remove abuse of intr_disable/restore in MI code by moving the loop in ast()
back into the calling MD code.  The MD code must ensure no races between
checking the astpening flag and returning to usermode.

Submitted by:	peter (ia64 bits)
Tested on:	alpha (peter, jeff), i386, ia64 (peter), sparc64
2002-03-29 16:35:26 +00:00
obrien
375a27ced0 Don't be too fancy with null'ed out functions.
Requested by:	jake
2002-03-28 04:33:51 +00:00
obrien
40f268c017 Add sysbeep() for the msmith RAID drivers. 2002-03-28 04:19:16 +00:00
obrien
2b39669377 style(9)
Approved by:	jake
2002-03-28 02:54:44 +00:00
jeff
dff418f166 Add a new mtx_init option "MTX_DUPOK" which allows duplicate acquires of locks
with this flag.  Remove the dup_list and dup_ok code from subr_witness.  Now
we just check for the flag instead of doing string compares.

Also, switch the process lock, process group lock, and uma per cpu locks over
to this interface.  The original mechanism did not work well for uma because
per cpu lock names are unique to each zone.

Approved by:	jhb
2002-03-27 09:23:41 +00:00
jake
5971322f85 Fix style bugs. 2002-03-27 06:50:34 +00:00
jake
f9cd124ed4 Fix breakage. 2002-03-27 06:45:48 +00:00
dillon
dc5aafeb94 Compromise for critical*()/cpu_critical*() recommit. Cleanup the interrupt
disablement assumptions in kern_fork.c by adding another API call,
cpu_critical_fork_exit().  Cleanup the td_savecrit field by moving it
from MI to MD.  Temporarily move cpu_critical*() from <arch>/include/cpufunc.h
to <arch>/<arch>/critical.c (stage-2 will clean this up).

Implement interrupt deferral for i386 that allows interrupts to remain
enabled inside critical sections.  This also fixes an IPI interlock bug,
and requires uses of icu_lock to be enclosed in a true interrupt disablement.

This is the stage-1 commit.  Stage-2 will occur after stage-1 has stabilized,
and will move cpu_critical*() into its own header file(s) + other things.
This commit may break non-i386 architectures in trivial ways.  This should
be temporary.

Reviewed by:	core
Approved by:	core
2002-03-27 05:39:23 +00:00
tmm
583691785f Add missing includes for the KTRACE case. 2002-03-25 04:54:19 +00:00
tmm
b562cca381 Add missing declarations. 2002-03-25 04:53:18 +00:00
tmm
2cd706e7dc Make this compile (submitted by jake), add a missing include. 2002-03-25 04:38:48 +00:00
tmm
ed02ae39ee Remove second copy of iommu_decode_fault() which I accidentially added.
Pointy hat to:	tmm
2002-03-25 04:34:52 +00:00
obrien
8842976cdd Guard against redefining __gnuc_va_list. 2002-03-24 11:25:46 +00:00
tmm
6f021cf47c Revamp the busdma implementation a bit:
- change the IOMMU support code so that it supports overcommittting the
  available DVMA memory, while still allocating as lazily as possible.
  This is achieved by limiting the preallocation, and deferring the
  allocation to map load time when it fails. In the latter case, the
  DVMA memory reserved for unloaded maps can be stolen to free up enough
  memory for loading a map.
- allow NULL settings in the method tables, and search the parent tags
  until an appropriate implementation is found. This allows to remove some
  kluges in the old implementation.
2002-03-24 02:50:53 +00:00
tmm
4e36f116b7 Fix sparc64_bus_mem_unmap() to pass the right address to kmem_free(). 2002-03-24 02:33:09 +00:00
tmm
521e80e700 Make the OpenFirmware interrupt mapping code more generic, to reduce
the bus-dependent code and to be able to support more systems. The core
of the new code is mostly obtained from NetBSD.
Kluge the interrupt routing methods of the psycho and apb drivers so
that an intline of 0 can be handled for now; real routing is still not
possible (all intline registers are preinitialized instead); this will
require a sparc64-specific adaption of the driver for generic PCI-PCI
bridges with a custom routing method to work right.
2002-03-24 02:11:06 +00:00
tmm
587f263c4d Map the device memory belonging to resources of type SYS_RES_MEMORY into
KVA upon activation so that rman_get_virtual() works as expected.
2002-03-24 01:51:29 +00:00
tmm
b0d3f0a8e8 Add code to print the fault virtual address for uncorrectable DMA errors
caused by IOMMU misses to aid debugging. This will only work on
UltraSPARC-IIi and IIe.
2002-03-23 20:42:23 +00:00
tmm
5421e07c01 De-__P(), de-K&R, remove superfluous comments and prototypes, some
style fixes. No functional changes.
2002-03-23 20:27:32 +00:00
tmm
19e3f6c78e De-K&R. 2002-03-23 20:22:19 +00:00
tmm
74ef80464b Fix syscall ktraceing. 2002-03-23 20:11:38 +00:00
tmm
1e5e916f70 Make this compile without options DDB; use intr_disable() instead of
fiddling with PSTATE_IE manually.
2002-03-23 20:09:48 +00:00
tmm
70f12c6e8c Decruft some #if 0'ed code. 2002-03-23 20:05:42 +00:00
tmm
14c3939bc9 Add PCIfunctions 2 and 3 of the PCIO2 chip to the intpin quirk table. 2002-03-23 20:04:10 +00:00
jake
f739cf3a06 Machine must be non-static for COMPAT_43 to compile. This is used in bsd/os
1.x compatibility code, which I'm sure we all use every day.
2002-03-23 17:13:45 +00:00
jake
5930ad2e2a Cleanup the trace back routine slightly. Print the leaf return value so
that traps inside of leaf functions are less confusing.  Add a function
to print a non-symbolic trace of the user stack.
2002-03-23 17:04:41 +00:00
jake
9bffad8891 Sync with other arches; add bloat. 2002-03-23 16:55:37 +00:00
jake
f11b0f8cfb Fix a deadlock condition with tlb shootdown ipi delivery. Since ipis are
not blocked by raising the pil, a reciever may be interrupted while holding
a spinlock.  If the sender does not defer interrupts throughout the entire
operation it may be interrupted and try to acquire a spinlock held by a
reciever, leading to a deadlock due to the synchronization used by the
ipi handlers themselves.

Submitted by:	tmm
2002-03-23 04:20:00 +00:00
jake
d0a6197c00 Backout intrusive ktr traces in tlb fault handlers which have served their
purpose.
2002-03-23 03:25:09 +00:00
obrien
4c2f517045 ASM versions of __FBSDID. 2002-03-23 02:01:27 +00:00
imp
7ca3d3c8ba intr_disable returns register_t 2002-03-21 06:21:32 +00:00
jeff
70ff425bc3 Remove references to vm_zone.h and switch over to the new uma API.
Reviewed by:	jake
2002-03-21 02:30:27 +00:00