Commit Graph

779 Commits

Author SHA1 Message Date
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
christos
53524e44ef Kill caddr_t; there will be some MI fallout, but it will be fixed shortly. 2007-03-04 05:59:00 +00:00
uwe
3cdc20a9de Brute force _lock_cas() by disabling interrupts.
Need to redo it with RAS later.
2007-02-23 03:24:47 +00:00
uwe
b2fe1ffc55 Sprinkle static so that gcc can eliminate simple helper functions that
get inlined.
2007-02-23 03:14:32 +00:00
uwe
b0513c4b84 Catch up with bool rototill. 2007-02-23 02:57:43 +00:00
uwe
7856f87f0d Add lock_stubs.S with fake _lock_cas - just to make the kernel compile
for now.
2007-02-22 22:53:26 +00:00
uwe
b8be26359e Provide an empty cpu_lwp_free2(). 2007-02-22 22:37:52 +00:00
uwe
cb750a7039 Undef __HAVE_MUTEX_STUBS, there are no mutex stubs yet. 2007-02-22 22:29:10 +00:00
thorpej
f6d76ae22a TRUE -> true, FALSE -> false 2007-02-22 16:45:48 +00:00
thorpej
712239e366 Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.
2007-02-21 22:59:35 +00:00
ad
3363855a4a Remove spllowersoftclock() and CLKF_BASEPRI(), and always dispatch callouts
via a soft interrupt. In the near future, softclock will be run from process
context.
2007-02-16 02:53:43 +00:00
ad
def3fb26c7 Add MUTEX_CLEAR_WAITERS(). 2007-02-15 22:52:42 +00:00
ad
b07ec3fc38 Merge newlock2 to head. 2007-02-09 21:55:00 +00:00
hubertf
142c2a33ba Remove duplicate #includes, patch contributed in private mail
by Slava Semushin <slava.semushin@gmail.com>.

To verify that no nasty side effects of duplicate includes (or their
removal) have an effect here, I've compiled an i386/ALL kernel with
and without the patch, and the only difference in the resulting .o
files was in shifted line numbers in some assert() calls.
The comparison of the .o files was based on the output of "objdump -D".

Thanks to martin@ for the input on testing.
2007-01-24 13:08:11 +00:00
elad
504c71d9fe Make machdep scope architecture-agnostic by removing all arch-specific
requests and centralizing them all. The result is that some of these
are not used on some architectures, but the documentation was updated
to reflect that.
2006-12-26 10:43:43 +00:00
elad
3d11477c94 Add requests indicating access to unmanaged memory for arm, pc532, powerpc,
sh3, sh5, and vax, and use them instead of KAUTH_GENERIC_ISSUSER.

Update documentation and example secmodel code.
2006-12-22 11:13:21 +00:00
scw
e07faf8a74 Replace the myriad copies of bounds_check_with_label() with a single MI
version.

Add disk_blocksize(9) so that disk drivers can record the physical
block size of a disk if it is different to DEV_BSIZE. Right now this
simply initialises dk_blkshift and dk_byteshift according to the
supplied block size. This information is used in the MI version of
bounds_check_with_label().
2006-11-25 11:59:55 +00:00
riz
11f6dc7a44 Don't worry about the ELF32_MACHDEP_ENDIANNESS macro when compiling
a host tool - it's never used there.
2006-11-25 07:32:53 +00:00
tsutsui
7cb169d2dd Disable sosend_loan() in sys/kern/uipc_socket.c temporarily on CPUs
which have virtual address indexed cache and whose pmaps don't always
allow normal shared mappings even for read only pages.

In future, these pmaps should be rewritten to handle such read only
shared mappings properly like ARM pmap, but currently we just disable
sosend_loan() to avoid unnecessary uncached mappings and cache flushes
on MIPS3 CPUs, or map/unmap thrashing on SH4.

Discussed with thorpej a while ago.
2006-11-18 14:25:39 +00:00
uwe
20e7821e8a Enforce correct userspace bounds in copy{in,out}str().
From Miod Vallat <miod@openbsd.org>.
2006-11-16 23:12:23 +00:00
uwe
ba0408a7f5 Lift extern shb_cd declaration to the top level.
Make all routines static.
2006-10-29 02:10:12 +00:00
uwe
523122cd3e Nuke GPROF cargo-cult I've been cut-n-pasting around in my drivers. 2006-10-27 00:08:32 +00:00
uwe
2909b42808 Fix __mcount to use bsrf to call _mcount. We know it's in the same
module (in the same file even), so we know the offset at link time and
don't need a reloc.  This kills the last text relocation in the sh3
libc.so.

While here, tweak the code slightly to put delay slots into use.
2006-10-26 23:54:28 +00:00
uwe
07dcd59f52 __pmap_kpte_lookup: verify that ptp is not NULL. 2006-10-24 01:56:33 +00:00
uwe
d8092bae40 Kill get_ascii and its alternative format, it's not very useful. We'd
better use it for something else later.  I'm also thinking of g/c'ing
the temp buffer and emit disassembly with db_printf direcly, and
get_ascii gets in the way.
2006-10-23 21:13:00 +00:00
uwe
9287c88e77 Const-poision. While here, rename the argument s/code/pc/. 2006-10-23 19:28:07 +00:00
uwe
351eae3599 Be careful when fetching instruction to disassemble. Check for
unalinged address, refuse to disassemble P4 area (on-chip i/o regs),
use fusword/kcopy to fetch the instruction.
2006-10-23 18:33:56 +00:00
uwe
a34468ef57 fu* function should read bytes/shorts as unsigned, so s/exts/extu/ 2006-10-23 16:28:51 +00:00
uwe
f8b92ef629 Instead of referring *code repeatedly, fetch it once into a local variable.
Identical object code for f_* is produced with -O.
2006-10-22 03:58:36 +00:00
uwe
d62bc05de1 Whitespace cosmetics in declarations of local variables. 2006-10-22 03:50:10 +00:00
uwe
e10806aaa8 Rename get_opcode argument for consistency. 2006-10-22 03:37:04 +00:00
uwe
a619033d94 SH_RCR2_BITS for bitmask_snprintf. 2006-10-19 03:26:10 +00:00
uwe
5e3c689570 Oops, don't stop rtc when enabling rtc oscillator - we would stall it
until rtc(4) attaches and starts the clock (that caused my Jornada to
lose about 12 secs during boot).
2006-10-19 00:25:18 +00:00
uwe
92dc06bfcf Don't include <machine/intr.h> in asm sources. 2006-10-15 02:11:21 +00:00
he
8bcd5596e1 Forward-declare "struct lwp" before using it in an argument declaration.
Gets rid of a recurring lint warning whenever this file is included.
2006-10-11 16:16:48 +00:00
uwe
ba3cb45cce Oops, fix bug in previous. On SH4 (two-issue) sh_clock.cpuclock is
the spin count divided by two, so introduce a variable to hold the
original number that we later use to compute pclock.
2006-10-11 03:20:01 +00:00
uwe
61a805fc2c Do calculations to estimate cpu and pclock using 64-bit and doing all
the multiplications first.  Round to nearest, instead of down.

When estimating pclock don't compute sh_clock.cpucycle_1us * 1000000
sh_clock.cpuclock is exactly that (but without rounding errors).

This improves timekeeping on my Jornada.
2006-10-11 02:31:19 +00:00