Commit Graph

815 Commits

Author SHA1 Message Date
macallan
a1457f5905 change pmap_phys_address()s parameter to paddr_t since that's what it gets
fed from mmap*() anyway
approved by gimpy
2007-07-16 23:48:03 +00:00
ad
63811f5275 Generic soft interrupts are mandatory. 2007-07-14 21:48:17 +00:00
ad
88ab7da936 Merge some of the less invasive changes from the vmlocking branch:
- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
2007-07-09 20:51:58 +00:00
pooka
0bc323f5cd Initialize the link context in a signal frame to the receiving lwp's
link context instead of NULL.  Otherwise, if we got a signal while the
lwp had a link context set, the link context would be set to NULL upon
return from signal delivery.

christos@tech-kern: "I think you are right."
2007-07-08 10:19:21 +00:00
tsutsui
6a8a584d1a Remove leftover netns stuff. 2007-07-07 05:13:14 +00:00
dsl
639a2edf3b Pass TRYEMULROOT to NDINIT() instead of using CHECK_ALT_XXX.
(Code is inside a big #if 0)
2007-06-23 16:58:18 +00:00
uwe
269ff6629e In sh3_tlb_update we need to ensure we are not interrupted while
meesing with the TLB.  That would usually show up as misterious kernel
crashes under heavy load.

Prettify the code while here so that traversal of the memory mapped
TLB arrays looks congruent in all functions.

Fixes PR 34706
2007-05-27 12:21:24 +00:00
tsutsui
2ae2a9ae1e Update function names in comments. 2007-05-26 03:26:49 +00:00
uwe
6a75919c1e Clarify comments in pmap_enter. 2007-05-25 23:55:13 +00:00
tsutsui
9275ebae10 Fix prototype of cpu_switchto(9) in LINTSTUB comment. 2007-05-21 14:05:02 +00:00
uwe
1d63bcac56 Implement fast path TLB miss handling. Walk the page table without
creating a trapframe, with exceptions disabled and using only BANK1
registers.  If a valid pte is found, load it and return.  Otherwise
create a trapframe and proceed to the full-blown C handler.
2007-05-18 02:31:06 +00:00
uwe
b348c690b7 Print pc/pr when faulting in ddb, it comes in handy. 2007-05-17 22:12:08 +00:00
yamt
f03010953f merge yamt-idlelwp branch. asked by core@. some ports still needs work.
from doc/BRANCHES:

	idle lwp, and some changes depending on it.

	1. separate context switching and thread scheduling.
	   (cf. gmcgarry_ctxsw)
	2. implement idle lwp.
	3. clean up related MD/MI interfaces.
	4. make scheduler(s) modular.
2007-05-17 14:51:11 +00:00
uwe
17dd2bf13d Mark __sh4_itlb_invalidate_all we call while running on P2 with
__attribute__((always_inline)) or gcc might decide not to inline it,
resulting in P2->P1 call.
2007-03-31 22:49:49 +00:00
uwe
58951c715e In sh_clock_init just make sure that rtc oscillator is running, but
don't start rtc, so that rtc(4) can report wall time as invalid if
clock was not running on attach.
2007-03-30 00:37:51 +00:00
uwe
3ce2a9cb4d On attach check if clock is running, mark it invalid if not. Return
error from gettime method if clock is not valid.  Mark clock as valid
on settime.

Report more debugging info.
2007-03-30 00:32:58 +00:00
uwe
a4d20321d9 Re-enable interrupts in tlb_exception too. 2007-03-30 00:12:54 +00:00
uwe
86d3d1e448 Include #include <sh3/devreg.h> like other *reg.h do. 2007-03-29 23:09:41 +00:00
uwe
39792f9d55 Mark inline functions we call while running on P2 with
__attribute__((always_inline)) or gcc might decide not to inline them,
resulting in P2->P1 call while we mess with the cache, and kernel
would just hang immediately on boot.
2007-03-29 01:51:49 +00:00
uwe
5f9be1916f G/c ancient workaround that has been commented out for ages. 2007-03-28 23:59:00 +00:00
uwe
f36e3e9ebe G/c unused defines/includes. 2007-03-24 21:32:11 +00:00
uwe
fc61a45d33 There are only 32 bits in a VA, not 33 - sync comment with this harsh reality. 2007-03-21 14:50:43 +00:00
uwe
f54c2e5ccf Don't do curupte checks if the miss address is in user space. 2007-03-18 20:18:36 +00:00
uwe
911335e303 Shave off few instructions when doing ldtlb. 2007-03-17 17:23:31 +00:00
uwe
62f5ccf3c2 Cosmetic - fix local label name to match the name of the var it refers. 2007-03-17 14:23:07 +00:00
uwe
cfeed1498f sh3_switch_setup: make md_upte[] map uarea pages in reverse order so
that mapping for the bottom of the stack (practically the only page we
ever touch) is found on earlier iterations through md_upte[] in the
tlb miss handler.
2007-03-17 00:56:46 +00:00
uwe
a4c73117e3 Cosmetic changes in {sh3,sh4}_switch_setup to make them easier to read.
Same object code is generated.
2007-03-16 18:31:36 +00:00
uwe
66f80b8d65 There's no sense in duplicating function prototype in preceding comments.
While here, make ANSI'fy idle() definition.
2007-03-16 18:20:40 +00:00
uwe
ee31aeeb82 Use dt to loop over md_upte in sh3_vector_tlbmiss. Saves a few instructions. 2007-03-16 04:22:22 +00:00
uwe
7233c378a1 Comment proc_trampoline properly. 2007-03-16 02:27:16 +00:00
uwe
c67ce65c70 L_MD_PCB and L_MD_UPTE are small enough to be used as immediate values. 2007-03-16 01:30:56 +00:00
uwe
1edd00232c Comment sh3_vector_tlbmiss. Same object code is generated. 2007-03-15 23:13:59 +00:00
uwe
eae42fb475 Arrange for data blocks to start on 32B cache line boundary. 2007-03-15 01:54:18 +00:00
uwe
b602f9a09b Use .L* for local labels. Misc cosmetic.
Same object code is generated.
2007-03-15 00:00:38 +00:00
uwe
67862e14f4 s/TAB/space/ to separate instruction operands. There are quite a few
cpp macros and long src operands anyway that destroy any intended
"neatly lined up" effect that TAB was supposed to achieve.

White space change only, same object code is generated, but it is much
easier on the eyes now.
2007-03-14 22:38:00 +00:00
uwe
2d73ff48ec More nano-optimizations to mutex stubs: rely on _lock_cas to preserve
things for us to shave off a few cycles.
2007-03-14 06:42:46 +00:00
uwe
ecde82d887 Tweak to shave off a few cycles. 2007-03-14 05:38:28 +00:00
uwe
07a908343d Convert _lock_cas to RAS. Check for restart in ast() on return from interrupt. 2007-03-14 05:03:52 +00:00
uwe
7b073b8364 Oops. Don't define stubs if LOCKDEBUG. 2007-03-14 02:01:19 +00:00
uwe
beab1d398c LINTSTUB: include <sys/mutex.h> to make the lint stub lintable. 2007-03-14 01:20:20 +00:00
uwe
8e5c3b9886 Implement fast-path mutex_enter and mutex_exit stubs. 2007-03-14 01:14:25 +00:00
ad
59d979c5f1 Pass an ipl argument to pool_init/POOL_INIT to be used when initializing
the pool's lock.
2007-03-12 18:18:22 +00:00
uwe
11957bf405 Note in that TAS.B in inline asm clobbers "cc".
Use MOVT instead of clear+rotate with carry in __cpu_simple_lock_try.
2007-03-12 01:33:50 +00:00
uwe
d96c2a32bc Use simple mutexes. This file is effectively a copy of arm's one now. 2007-03-12 00:57:13 +00:00
uwe
7983f30ad7 Do cpu_exit with proper locking.
Rename assembly cpu_exit to cpu_do_exit and make a C version of
cpu_exit() to do proper locking.  While here, g/c switch_exit entry
point and don't call lwp_exit2 from cpu_exit.
From ad@

Completes PR port-sh3/35971 - my Jornada now boots to multiuser with a
LOCKDEBUG kernel.
2007-03-12 00:32:56 +00:00
uwe
f3c67932b4 Cosmetic. Group function declarations and variable definitions. 2007-03-12 00:12:29 +00:00
uwe
c24277d5f4 Factor out code to save processor state to pcb->pcb_sf switchframe
into a macro.  While here, clarify l->l_md.md_pcb->pcb_sf
vs. l->l_md.md_pcb confusion with proper naming and some comments.
Idea from OpenBSD.
2007-03-11 23:54:03 +00:00
ad
7a902dfca5 PR port-sh3/35971: Mutex error on SH3 DIAGNOSTIC kernels 2007-03-11 20:09:03 +00:00
he
8a3ceb1726 Cast to char* before doing pointer arithmetic. 2007-03-06 23:38:37 +00:00
tsutsui
1032472464 Call uvm_pageidlezero() only if uvm.page_idle_zero is true. 2007-03-04 10:41:59 +00:00