Commit Graph

1452 Commits

Author SHA1 Message Date
thorpej c8daa94cb1 TRUE -> true, FALSE -> false 2007-02-22 16:57:56 +00:00
matt c40caef899 More boolean_t -> bool lossage. 2007-02-22 04:47:07 +00:00
thorpej dd962f8680 Pick up some additional files that were missed before due to conflicts
with newlock2 merge:

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 23:48:10 +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
mrg 4410329b87 add a pair of new bus_dma(9) functions:
int _bus_dmatag_subregion(bus_dma_tag_t tag,
				  bus_addr_t min_addr,
				  bus_addr_t max_addr,
				  bus_dma_tag_t *newtag,
				  int flags)
	void _bus_dmatag_destroy(bus_dma_tag_t tag)

that allow a (normally broken/limited) device to restrict the bus address
range it can talk to.  this is used by bce(4) to limit DMA addresses to
1GB range, the maximum the chip can address.

all this is from Yorick Hardy <yhardy@uj.ac.za> with input from several
people on tech-kern.

XXX: bus_dma(9) needs an update still.
2007-02-21 20:41:23 +00:00
ad d43ea32af9 - Add /a modifier to trace that allows a specific LWP to be selected.
- When doing trace/t, always note which pid/lid combination is being traced.
2007-02-20 01:02:02 +00:00
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