Commit Graph

1446 Commits

Author SHA1 Message Date
pavel 934634a18c Change the process/lwp flags seen by userland via sysctl back to the
P_*/L_* naming convention, and rename the in-kernel flags to avoid
conflict. (P_ -> PK_, L_ -> LW_ ). Add back the (now unused) LSDEAD
constant.

Restores source compatibility with pre-newlock2 tools like ps or top.

Reviewed by Andrew Doran.
2007-02-17 22:31:36 +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 216d01d042 Make these compile again. 2007-02-15 15:14:57 +00:00
ad 2b0ac2e782 Fix a pasto (mutex_exit -> mutex_enter). 2007-02-10 16:08:16 +00:00
ad b07ec3fc38 Merge newlock2 to head. 2007-02-09 21:55:00 +00:00
simonb 1fc6e76755 Fix a tyop in a comment. 2007-02-06 04:48:15 +00:00
freza 898efa526f Local variables bat{u,l} are only needed by OEA code, so ifdef them. 2007-02-01 19:59:03 +00:00
freza 55f2d910e2 On ibm405 (which the true meaning of PPC_IBM4XX), anything outside
kernel VM range is supposed to be mapped via reserved TLB entries,
so allow such VAs through.

Fixes kgdb failure observed by Jean-Francois Boudreault on port-powerpc
(thanks for testing, too).
2007-02-01 15:18:57 +00:00
freza 4a09a01492 Document that unprotected access to softintr cookie is safe in
softintr_disestablish(), upon request from uebayasi@.
2007-01-30 05:42:24 +00:00
freza 4bf0309687 Protect softintr queues by direct manipulation of PSL_EE because PowerPC
ports have different IPL hierarchies. On macppc, IPL_VM is below IPL_AUDIO
and IPL_SERIAL so the queues got corrupted due to priority inversion.
Also fix a race condition in softintr_schedule() when testing "si_refs > 1",
it can lead to queue corruption and subsequent panic (below). As a side
effect, using PSL_EE directly is faster than going via spl*()/splx().

This is supposed to fix (XXX I don't have the hw):

  Panic: kernel diagnostic assert "si->si_refs > 0" failed: file
  "[...]arch/powerpc/powerpc/softintr.c" line 116

reported for example in:

  http://mail-index.netbsd.org/port-macppc/2007/01/25/0001.html

Discussed with briggs@ and macallan@.
2007-01-30 05:25:15 +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
aymeric 211211993c Basic support for RTAS (CHRP's Run-Time Abstraction Services).
Tested on the Efika; now it knows what time it is.
rtas can attach to mainbus. Not added to any kernel config file yet.
2007-01-14 22:18:02 +00:00
aymeric 0725ba2be2 disable MMU in restoremmu. This generally makes sense and is required for the
Efika
2007-01-14 22:11:27 +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
yamt 8bf7662829 merge yamt-splraiseipl branch.
- finish implementing splraiseipl (and makeiplcookie).
	  http://mail-index.NetBSD.org/tech-kern/2006/07/01/0000.html
	- complete workqueue(9) and fix its ipl problem, which is reported
	  to cause audio skipping.
	- fix netbt (at least compilation problems) for some ports.
	- fix PR/33218.
2006-12-21 15:55:21 +00:00
freza e388b581bd Welcome to evbppc/virtex -- port to Xilinx Virtex series FPGA's with embedded
ibm405d5 core.

OK by Simon Burge
2006-12-02 22:18:47 +00:00
freza e2db2efb2e Instead of mapping whole RAM with reserved TLB entries, map just enough
to ensure trap code will work (that is 0 upto ${endkernel}) and leave the
rest to pmap_tlbmiss(). Mapping whole physmem into the kernel wired way
too many TLB entries, see

  http://mail-index.netbsd.org/port-powerpc/2006/10/27/0000.html

for performance analysis. While there, be a bit more descriptive in
pmap_tlbmiss() comment and use macro instead of numeric constant.

OK by Simon Burge
2006-11-29 19:56:46 +00:00
elad 8bb202af97 Move ktrace, ptrace, systrace, and procfs to use kauth(9).
First, remove process_checkioperm() calls from MD code. Similar checks
using kauth(9) routines (on the process scope, using appropriate action)
are done in the callers.

Add secmodel back-end to handle each subsystem.
2006-11-28 17:27:09 +00:00
freza 24a77a1111 PR toolchain/35105: Don't include reloc.h, instead provide R_PPC_* defines
and make R_TYPE() use them. This is more consistent with other ports, too.

Suggested by Manuel Bouyer, ok'd by Matt Thomas.
2006-11-25 18:04:33 +00:00
garbled 9d0e6979a5 Make these files compile with -Wextra -Wno-unused. 2006-10-30 17:52:12 +00:00
garbled 8685914d8f Change an instance of curaddr to PHYS_TO_BUS_MEM(t, curaddr) in
_bus_dmamap_load_buffer, otherwise when attempting to DMA a buffer larger
than PAGE_SIZE on an arch where PHYS != BUS it will allways fail.
2006-10-27 19:36:15 +00:00
he 9ed827d944 The new gcc propagates const-ness from structs to members, so
make local variable const as well.  Avoid writing to the now-const
variable, instead do the masking before in the trapframe register
assignment.

OK'ed by thorpej and nathanw.
2006-10-24 16:53:01 +00:00
mrg 648bbec934 in cpu_dumpconf(), don't panic() if we can't bdevsw_lookup() the
dumpdev.  this occurs when we try to set the dumpdev to a device
with no driver loaded.  this fixes PR#34872.

in sys_swapctl, if bdevsw_lookup() fails, set dumpdev = NODEV
before calling cpu_dumpconf().  (this also fixes PR#34872.)

XXX: cpu_dumpconf() should probably be changed to take a dumpdev
XXX: and return an error in such cases, but that is a much more
XXX: intrusive change.

XXX2: this is only run-tested on sparc64 and compile tested on a
XXX2: couple of platforms.
2006-10-21 05:54:31 +00:00
kiyohara e95a66da33 * convert ibm4xx-based evbppc from reserved-TLB entry allocation to recently
introduced ppc4xx_tlb_reserve() API.
2006-10-16 18:14:38 +00:00
kiyohara d7e6f0e206 * convert ibm4xx-based evbppc from reserved-TLB entry allocation to recently
introduced ppc4xx_tlb_reserve() API.
* ibm405gp UART0 used to be linear mapped. The VA happens to be inside kernel
  segment, giving us the possibility of multiple VA matches in the TLB. This
  is considered "programming error" by 405 core and results in "undefined
  behaviour". We now avoid mapping peripherals in kernel segment.
* Some boards used to map hardwired RAM size. We now use the real size as
  passed in by boot firmware.
2006-10-16 18:14:37 +00:00
kiyohara c38c755c41 do bus_space_map() to get bus space handle in emacs_attach() 2006-10-16 18:14:35 +00:00
tsutsui 931bfebdc1 Fix an obvious typo. Patch from seebs in PR port-powerpc/33107. 2006-10-07 14:44:22 +00:00
chs 33c1fd1917 add support for O_DIRECT (I/O directly to application memory,
bypassing any kernel caching for file data).
2006-10-05 14:48:32 +00:00
tnozaki 44eb8f042e fix gcc -Werror -Wmissing-braces problem
mbstate_t(this is opaque object)'s initializer should be ``{ 0 }'',
so changed 1st field of union from character array to integer.
2006-10-04 13:51:59 +00:00
freza 19461b0a95 Make sure we mask statclock timer on ibm4xx systems. This avoids
pthread "related" panics like:

    panic: remrunqueue: bit 18 not set
    Stopped in pid 479.3 (exsprite) at      netbsd:cpu_Debugger+0x10:       lwz
    r
    0, r1, 0x14
    db> bt
    0x869abe00: at panic+0x1b4
    0x869abe50: at remrunqueue+0x80
    0x869abe60: at mi_switch+0x114
    0x869abea0: at sa_unblock_userret+0x4e8
    0x869abee0: at syscall_plain+0x224
    0x869abf40: user SC trap #93 by 0x41949810: srr1=0xc030
               r1=0x445fff40 cr=0x40000002 xer=0 ctr=0x41aae208 esr=0 pid=0x36

While there, cleanup IPL_ definitions somewhat and fix interrupt mask
calculation per spl(9).

OK by matt@
2006-09-27 09:11:47 +00:00
briggs 31c06a3ac5 Obvious (now that Jorge Acereda pointed it out) bug in the restoremmu
section of ENTRY(ofwr_init) (a constant offset of 4 was changed to %r4).
2006-09-25 01:45:27 +00:00
matt 6ec9b8bc84 Define a PHYSMAP_VSID for mapping pa==va. 2006-09-21 18:43:30 +00:00
matt b62d9f714a When mapping the kernel, make to update its segment register to be valid. 2006-09-19 22:15:06 +00:00
matt cbdd4e594a At the end of pmap_bootstrap, if PMAP_NEED_MAPKERNEL, map the kernel into
the kernel's pmap (text will be rx, data will be rw).
2006-09-19 20:19:53 +00:00
simonb efa68b8f30 Fix white-space nit. 2006-09-19 00:50:39 +00:00
gdamore 825211a4f8 Conversion of evbppc to generic TODR. ok freza@ 2006-09-18 22:05:47 +00:00
sanjayl e08ce7a8c2 Remove debug printf 2006-09-18 13:25:33 +00:00
gdamore d87601b78b Remove unused todclock files -- these are left overs from pre-generic-TODR. 2006-09-17 04:11:55 +00:00
yamt 9d3e3eab23 merge yamt-pdpolicy branch.
- separate page replacement policy from the rest of kernel
	- implement an alternative replacement policy
2006-09-15 15:51:12 +00:00
garbled 50c16ab16f Apply the patch found in PR/28512 and PR/23801. Ok'd by a few people.
From the PR:
The cache is flushed using the bus address where the phys address
is required.  Errors would be seen only on ports where address
translation is done between the bus and physical memory.
2006-09-07 19:13:11 +00:00
sanjayl 3c19528c31 Remove debug printf that got left in accidentally 2006-09-07 16:00:29 +00:00
ad 6c8685b2d2 Use p_find(addr, PFIND_LOCKED) in case the proclist_lock is held. 2006-09-06 23:58:20 +00:00
matt c8b1a4622f Add/rename macros (PVO_xxx_P) for testing WIRED, MANAGED, EXECUTABLE ness
of a PVO entry.  (Fixes where PVO_WIRED was tested against pvo_pt.pte_lo
instead of pvo_vaddr)
2006-09-02 17:08:44 +00:00
freza fd156a0bc9 * move the "cheating" conditional into unmapiodev() implementation
itself (instead of memio_unmap()), as it differs between OEA and
  ibm4xx.

OK by matt@
2006-08-31 23:14:38 +00:00
freza ca97defaa7 * ppc4xx_tlb_reserve(): allocate "reserved" TLB entries dynamically
* ppc4xx_tlb_mapiodev(): resolve pa to va from reserved TLB entries

OK by matt@

XXX we'll keep TLB_NRESERVED defined until we fix explora to use new API
2006-08-31 22:13:51 +00:00
freza 60d1041835 * add PVR values for Xilinx 405 cores
* don't try to decode vendor-specific PVR, print raw value instead.
* panic() if we see cache wasn't probed, we'd crash later anyway.
* rework the way PVR gets translated to core name.
* while there, normalize printf format ("%s: ...", device_xname(self), ...).

OK by matt@
2006-08-31 21:32:27 +00:00
matt 77ef4246de Call unmapiodev when unmapping bus_space to possibly reclaim the VA. 2006-08-31 18:28:47 +00:00
matt 3d324b035e Add unmapiodev(vaddr_t, vsize_t) (to be used by bus_space_unmap) 2006-08-31 18:23:40 +00:00
matt 25159b5f42 Add unmapiodev. 2006-08-31 18:18:17 +00:00