freebsd-dev/sys/powerpc/powerpc
Marius Strobl d7ecd801ed As it turns out, r186347 actually is insufficient to avoid the use of the
curthread-accessing part of mtx_{,un}lock(9) when using a r210623-style
curthread implementation on sparc64, crashing the kernel in its early
cycles as PCPU isn't set up, yet (and can't be set up as OFW is one of the
things we need for that, which leads to a chicken-and-egg problem). What
happens is that due to the fact that the idea of r210623 actually is to
allow the compiler to cache invocations of curthread, it factors out
obtaining curthread needed for both mtx_lock(9) and mtx_unlock(9) to
before the branch based on kobj_mutex_inited when compiling the kernel
without the debugging options. So change kobj_class_compile_static(9)
to just never acquire kobj_mtx, effectively restricting it to its
documented use, and add a kobj_init_static(9) for initializing objects
using a class compiled with the former and that also avoids using mutex(9)
(and malloc(9)). Also assert in both of these functions that they are
used in their intended way only.
While at it, inline kobj_register_method() and kobj_unregister_method()
as there wasn't much point for factoring them out in the first place
and so that a reader of the code has to figure out the locking for
fewer functions missing a KOBJ_ASSERT.
Tested on powerpc{,64} by andreast.

Reviewed by:	nwhitehorn (earlier version), jhb
MFC after:	3 days
2011-11-15 20:11:03 +00:00
..
altivec.c
atomic.S
autoconf.c
bcopy.c MFppc64: 2010-07-09 14:01:18 +00:00
bus_machdep.c Enforce a memory barrier in stream operations, as is done on other 2011-10-15 23:15:55 +00:00
busdma_machdep.c Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs. 2011-11-07 15:43:11 +00:00
copystr.c
cpu.c Revert r225875, r225877: 2011-10-03 21:19:15 +00:00
db_disasm.c
db_hwwatch.c
db_interface.c MFppc64: 2010-07-13 05:32:19 +00:00
db_trace.c Add leading zeros when printing the stackframe on __powerpc64__. 2011-06-23 09:43:53 +00:00
dump_machdep.c Add the watchdogs patting during the (shutdown time) disk syncing and 2011-04-28 16:02:05 +00:00
elf32_machdep.c Extend struct sysvec with new method sv_schedtail, which is used for an 2011-03-08 19:01:45 +00:00
elf64_machdep.c Extend struct sysvec with new method sv_schedtail, which is used for an 2011-03-08 19:01:45 +00:00
exec_machdep.c In order to maximize the re-usability of kernel code in user space this 2011-09-16 13:58:51 +00:00
fpu.c
fuswintr.c
gdb_machdep.c
genassym.c Restructure the way the copyin/copyout segment is stored to prevent a 2010-10-30 23:07:30 +00:00
in_cksum.c MFppc64: 2010-07-13 05:32:19 +00:00
intr_machdep.c Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs. 2011-11-07 06:44:47 +00:00
iommu_if.m Provide a simple IOMMU framework on PowerPC, which is required to support 2010-12-03 16:37:37 +00:00
mem.c Add reader/writer lock around mem_range_attr_get() and mem_range_attr_set(). 2011-01-17 22:58:28 +00:00
mmu_if.m Split the vm_page flags PG_WRITEABLE and PG_REFERENCED into atomic 2011-09-06 10:30:11 +00:00
mp_machdep.c MFC 2011-06-24 16:35:40 +00:00
openpic.c Make the intended change. 2011-05-10 13:48:21 +00:00
pic_if.m Add the powerpc support. 2011-05-09 16:16:15 +00:00
platform_if.m Add some platform KOBJ extensions and continue integrating PowerPC 2010-11-12 04:18:19 +00:00
platform.c As it turns out, r186347 actually is insufficient to avoid the use of the 2011-11-15 20:11:03 +00:00
pmap_dispatch.c As it turns out, r186347 actually is insufficient to avoid the use of the 2011-11-15 20:11:03 +00:00
sc_machdep.c
setjmp.S MFppc64: 2010-07-13 05:32:19 +00:00
sigcode32.S MFppc64: 2010-07-13 05:32:19 +00:00
sigcode64.S MFppc64: 2010-07-13 05:32:19 +00:00
stack_machdep.c MFppc64: 2010-07-13 05:32:19 +00:00
suswintr.c
syncicache.c MFppc64: 2010-07-13 05:32:19 +00:00
sys_machdep.c MFppc64: 2010-07-13 05:32:19 +00:00
uio_machdep.c Put the general logic for being a CPU hog into a new function 2011-02-02 16:35:10 +00:00