Commit Graph

561 Commits

Author SHA1 Message Date
tsutsui
e34a3b7f08 Small optimization in vmapbuf()/vunmapbuf().
BTW, should we also pass 'VM_PROT_READ|VM_PROT_WRITE' to flags
with PMAP_WIRED for pmap_enter() in vmapbuf()?
2005-01-09 17:41:34 +00:00
uwe
b667c1f82d Fix lint stub for va_start so that lint is actually happy about it. 2005-01-05 23:39:51 +00:00
tsutsui
23bf17808a Protect accesses to PTE/TLB registers with
_cpu_exception_suspend()/_cpu_exception_resume() pair.

Should fix spontaneous reboot problem on heavy load reported by
Christian Groessler on port-dreamcast.
2004-12-30 09:48:30 +00:00
chs
0ded74691b for drivers that support only one instance, use a global variable to ensure
that only one instance is configured rather than requiring that its
unit number be zero.
2004-12-13 02:14:13 +00:00
uwe
e9f575c48c First step towards bus_space - wrap register accesses into macros.
Same object code is generated.
2004-10-19 02:12:21 +00:00
uwe
4866d0ee50 KNF cosmetic. Same object code is generated.
Use continue for explicit empty loop body.
Use for (;;) instead of while (1).
Fix an indentation glitch.
2004-10-19 00:10:33 +00:00
yamt
857913deac include sys/cpu_data.h only if defined(_KERNEL) 2004-09-25 22:08:48 +00:00
yamt
d2fe4b34bb move some per-cpu data definitions to MI place so that they can be modified
without touching all ports.  discussed on tech-kern@.
2004-09-22 11:32:02 +00:00
skrll
f7155e40f6 There's no need to pass a proc value when using UIO_SYSSPACE with
vn_rdwr(9) and uiomove(9).

OK'd by Jason Thorpe
2004-09-17 14:11:20 +00:00
thorpej
6c08646cb8 Garbage-collect pagemove(); nothing use it anymore (YAY!!!) 2004-08-28 22:12:40 +00:00
yamt
3998262d5e defparam HZ. 2004-07-01 12:44:26 +00:00
thorpej
e33c2bb5d5 Add the %MAKEOPTIONSAPPEND token at the end of the file, after the
common Makefile.kern.inc has been included.
2004-06-04 04:45:49 +00:00
drochner
19f047f8d0 SIGTRAMP_VALID() should not pollute the user namespace 2004-05-10 21:51:49 +00:00
kleink
7b3b647647 Factor out W{CHAR,INT}_{MAX,MIN} into their own header file. 2004-05-08 21:51:47 +00:00
uwe
c22f771297 Register definitions for sh3 integrated DMA controller. 2004-04-08 21:02:57 +00:00
drochner
c83eb997b8 nothing cares about __HAVE_SIGINFO anymore, so nuke it 2004-03-26 21:39:57 +00:00
drochner
ae94c80224 fix references to the syscall formerly known as SYS___sigreturn14 2004-03-26 19:05:33 +00:00
uwe
44498073bf intc_intr_priority: map DMAC and IRDA interrupts. 2004-03-25 01:25:08 +00:00
uwe
1cfab0e2a0 INTEVT2 values for DMAC interrupts. 2004-03-25 01:02:30 +00:00
wiz
f0d2889eb5 Move
(c) TNF
line from 4-clause UCB to 3-clause UCB license; in other words,
remove UCB's ad clause from the license TNF grants.
There is no point in TNF demanding that UCB's ad clause be followed
when even UCB doesn't demand it any longer.

Ok'd by board@ and agc@.
2004-03-24 15:38:41 +00:00
cl
ea5ec0212d add kernel part of concurrency support for SA on MP systems
- move per VP data into struct sadata_vp referenced from l->l_savp
  * VP id
  * lock on VP data
  * LWP on VP
  * recently blocked LWP on VP
  * queue of LWPs woken which ran on this VP before sleep
  * faultaddr
  * LWP cache for upcalls
  * upcall queue
- add current concurrency and requested concurrency variables
- make process exit run LWP on all VPs
- make signal delivery consider all VPs
- make timer events consider all VPs
- add sa_newsavp to allocate new sadata_vp structure
- add sa_increaseconcurrency to prepare new VP
- make sys_sa_setconcurrency request new VP or wakeup idle VP
- make sa_yield lower current concurrency
- set sa_cpu = VP id in upcalls
- maintain cached LWPs per VP
2004-03-14 01:08:47 +00:00
uwe
590efeca88 Wrap "unknown instruction in prologue" in TRACE_DEBUG. gcc3 reorders
instructions so that prologue code and function code get mixed, and
you get a lot of noice from this printf, making traceback very hard to
read if not useless.
2004-02-23 01:06:53 +00:00
uwe
8939f2bdbd Implement proper switch_exit in assembler. Since cpu_switch is
reduced to just a call to switch_exit, g/c the C version and add a one
instruction assembler version that just falls through to switch_exit.

Addresses PR#24007 by Jaromir Dolecek <jdolecek@netbsd> and makes sh3
kernels work again after his elimination of the reaper.  Tested on hpcsh.
2004-01-18 18:54:17 +00:00
martin
da4e67accc Do not export __HAVE_RAS to userland. Applications are supposed to try
rasctl() and detect failure with EOPNOTSUPP.
2004-01-18 18:23:19 +00:00
uwe
a6ced7eb12 G/c symbols related to structs proc and mdproc. 2004-01-18 05:29:45 +00:00
uwe
dcc320b65f s/proc/lwp/ in comments. 2004-01-18 04:59:52 +00:00
tsutsui
74ba66664f MD cpu_lwp_free() should have the second arg. 2004-01-06 19:30:38 +00:00
jdolecek
089abdad44 Rearrange process exit path to avoid need to free resources from different
process context ('reaper').

From within the exiting process context:
* deactivate pmap and free vmspace while we can still block
* introduce MD cpu_lwp_free() - this cleans all MD-specific context (such
  as FPU state), and is the last potentially blocking operation;
  all of cpu_wait(), and most of cpu_exit(), is now folded into cpu_lwp_free()
* process is now immediatelly marked as zombie and made available for pickup
  by parent; the remaining last lwp continues the exit as fully detached
* MI (rather than MD) code bumps uvmexp.swtch, cpu_exit() is now same
  for both 'process' and 'lwp' exit

uvm_lwp_exit() is modified to never block; the u-area memory is now
always just linked to the list of available u-areas. Introduce (blocking)
uvm_uarea_drain(), which is called to release the excessive u-area memory;
this is called by parent within wait4(), or by pagedaemon on memory shortage.
uvm_uarea_free() is now private function within uvm_glue.c.

MD process/lwp exit code now always calls lwp_exit2() immediatelly after
switching away from the exiting lwp.

g/c now unneeded routines and variables, including the reaper kernel thread
2004-01-04 11:33:29 +00:00
pk
70f20a1217 Replace the traditional buffer memory management -- based on fixed per buffer
virtual memory reservation and a private pool of memory pages -- by a scheme
based on memory pools.

This allows better utilization of memory because buffers can now be allocated
with a granularity finer than the system's native page size (useful for
filesystems with e.g. 1k or 2k fragment sizes).  It also avoids fragmentation
of virtual to physical memory mappings (due to the former fixed virtual
address reservation) resulting in better utilization of MMU resources on some
platforms.  Finally, the scheme is more flexible by allowing run-time decisions
on the amount of memory to be used for buffers.

On the other hand, the effectiveness of the LRU queue for buffer recycling
may be somewhat reduced compared to the traditional method since, due to the
nature of the pool based memory allocation, the actual least recently used
buffer may release its memory to a pool different from the one needed by a
newly allocated buffer. However, this effect will kick in only if the
system is under memory pressure.
2003-12-30 12:33:13 +00:00
christos
a21fdf3b43 bye, bye _MCONTEXT_TO_SIGCONTEXT and vice versa. 2003-11-25 23:11:52 +00:00
uwe
2d6cce4c99 Cosmetic: in sh_vector_generic use named label instead of numeric
label for the curlwp address.  Same object code is generated.
2003-11-24 23:24:18 +00:00
uwe
0457f27ac6 Old sigcode (to be copied out to the bottom of the user stack) is only
necessary for COMPAT_16.
2003-11-24 04:59:24 +00:00
uwe
139976ff9c Cosmetic: u_int32_t -> uint32_t in comments, trim trailing whitespace.
Add __KERNEL_RCSID.
2003-11-24 04:47:42 +00:00
uwe
ce26539142 Add __KERNEL_RCSID. 2003-11-24 04:16:51 +00:00
uwe
62410eae0a Definition of __KERNEL_RCSID for asm files. 2003-11-24 04:07:22 +00:00
uwe
72a0bf93df In db_disasm call get_ascii only if necessary. 2003-11-24 03:33:02 +00:00
uwe
0cfca60cdf general_exception() now receives TEA as a third argument. For user
mode EXPEVT_ADDR_ERR_{LD,ST} traps pass it as ksi_addr, also use it to
decide if this is a SIGBUS (unaliged access) or SIGSEGV (kernel VA
access).

Report EXPEVT_TLB_PROT_LD as SEGV_ACCERR, not SEGV_MAPERR.

While here, consistently use standard uint32_t instead of u_int32_t.
2003-11-24 03:11:16 +00:00
uwe
721c1a1815 Pass TEA to general_exception. While here add a couple of comments. 2003-11-24 03:06:01 +00:00
uwe
9d0d2c7461 Implement siginfo for sh3. 2003-11-23 23:13:11 +00:00
uwe
94c8b6c69f Add _UC_SETSTACK, _UC_CLRSTACK flags. Add __fpr_fpul to __fpregset_t
and redefine __fpr_regs as an array of 32 ints (SH3E has 16, SH4 has
32 32-bit FP registers) to reserve the space for FPU registers - we
will properly redefine this as a union when we do support FPU.
2003-11-22 17:05:53 +00:00
uwe
246d903de4 In intc_intr_priority() don't panic if the evtcode is not one of
those, that have their priority set in IPR registers, e.g. IRL
interrupts on Dreamcast.  Reported by Christian Groessler.
2003-11-20 01:22:19 +00:00
uwe
66008dfef1 Fix cpu_switchto() to correctly prepare new lwp before switching to it.
Fixes PR port-sh3/19956.

Big thanks to Christian Limpach <cl@> for pointing this out and
explaning what the fix is.
2003-11-16 00:07:13 +00:00
uwe
60f0942660 Tweak KDASSERT to avoid double negation. 2003-11-15 23:47:58 +00:00
uwe
81468ece49 Register definitions for SH7709 DAC. 2003-11-05 03:08:13 +00:00
uwe
7dac2eaa7a Add closing parenthesis missed in previous. 2003-11-05 01:43:16 +00:00
dsl
2ffbd2ab99 Remove p_nras from struct proc - use LIST_EMPTY(&p->p_raslist) instead.
Remove p_raslock and rename p_lwplock p_lock (one lock is enough).
Simplify window test when adding a ras and correct test on VM_MAXUSER_ADDRESS.
Avoid unpredictable branch in i386 locore.S
(pad fields left in struct proc to avoid kernel bump)
2003-11-04 10:33:15 +00:00
uwe
399158308d Redo a quick hack for intc_intr_disable() and intc_intr_enable() to have
a saner interface/semantic.
2003-11-04 03:13:48 +00:00
uwe
818209017c In intc_intr_priority init iprreg to pacify gcc. 2003-11-01 02:24:49 +00:00
tsutsui
d135aa4588 In swap_endian_disklabel(), don't forget copy members which are not
needed to byteswap.
2003-10-31 17:04:12 +00:00
cl
ef56cc40ab Reduce code duplication by adding mi_userret() in sys/userret.h
containing signal posting, kernel-exit handling and sa_upcall processing.

XXX the pc532, sparc, sparc64 and vax ports should have their
XXX userret() code rearranged to use this.
2003-10-31 16:44:34 +00:00