summaryrefslogtreecommitdiffstats
path: root/sys/powerpc
Commit message (Collapse)AuthorAgeFilesLines
* Fix (accidental?) lock order reversal in pmap_remove. Found whengrehan2005-01-213-3/+3
| | | | a process that has mmap'd device mem exits.
* Add bus_dmamap_load_mbuf_sg() to powerpc.scottl2005-01-152-0/+32
|
* - Remove some OBE comments regarding cpu_exit(). cpu_exit() is no longerjhb2005-01-142-14/+0
| | | | | | | | the last action of kern_exit(). Instead, it is a MD callout to cleanup per-process state during exit. - Add notes of concern to Alpha and ia64 about the possible need to drop fp state in cpu_thread_exit() rather than in cpu_exit() since it is per-thread state rather than per-process.
* - allow a device hint to disable probing a slot on a Uninorth PCI bus.grehan2005-01-111-5/+12
| | | | | | | | | | | | | | | | | | e.g. at the loader: set hint.pcib.1.skipslot=26 This allows undocumented and problematic hardware on some systems to be ignored, for instance, the USB keyboard/mouse that shows up on a 12" albook that doesn't exist nor do anything other than eat up the syscons keyboard. Another one is the unused USB cell in the old 366MHz iBook that locks up the machine when probed. In a way this is temporary, since there are better fixes for the above problems, but will be useful in the meantime by allowing a keyboard to be used to help debug said fixes :) - while here remove some trailing white space
* /* -> /*- for license, minor formatting changesimp2005-01-0797-109/+109
|
* Return correct value in the lock routine.grehan2005-01-071-2/+2
|
* Correctly initialise the 2nd kernel segment, and don'tgrehan2004-12-293-3/+9
| | | | | | forget to actually install it in the segment register. This may fix some of the weird panics seen when kernel VM is heavily used.
* Modify pmap_enter_quick() so that it expects the page queues to be lockedalc2004-12-233-6/+0
| | | | | | | | | | | on entry and it assumes the responsibility for releasing the page queues lock if it must sleep. Remove a bogus comment from pmap_enter_quick(). Using the first change, modify vm_map_pmap_enter() so that the page queues lock is acquired and released once, rather than each time that a page is mapped.
* In the common case, pmap_enter_quick() completes without sleeping.alc2004-12-153-0/+24
| | | | | | | | | | | | | | | | | | In such cases, the busying of the page and the unlocking of the containing object by vm_map_pmap_enter() and vm_fault_prefault() is unnecessary overhead. To eliminate this overhead, this change modifies pmap_enter_quick() so that it expects the object to be locked on entry and it assumes the responsibility for busying the page and unlocking the object if it must sleep. Note: alpha, amd64, i386 and ia64 are the only implementations optimized by this change; arm, powerpc, and sparc64 still conservatively busy the page and unlock the object within every pmap_enter_quick() call. Additionally, this change is the first case where we synchronize access to the page's PG_BUSY flag and busy field using the containing object's lock rather than the global page queues lock. (Modifications to the page's PG_BUSY flag and busy field have asserted both locks for several weeks, enabling an incremental transition.)
* Create a new definition, PSL_KERNSET, which is used for setting thegrehan2004-11-301-1/+2
| | | | | MSR in kernel mode. Redefine PSL_USERSET in terms of this by or'ing in PSL_PR.
* Don't include sys/user.h merely for its side-effect of recursivelydas2004-11-279-11/+6
| | | | including other headers.
* Remove UAREA_PAGES.das2004-11-201-1/+0
| | | | Reviewed by: arch@
* U areas are going away, so don't allocate one for process 0.das2004-11-202-6/+0
| | | | Reviewed by: arch@
* user.h is included only to get pcb.h, so use the latter directly instead.das2004-11-201-1/+0
|
* Reduce annoying SCSI probing delay from 15 to 5 seconds in all GENRIC kernels.andre2004-11-021-1/+1
| | | | Discussed on: -current
* Implement TLS relocations for powerpc.ssouhlal2004-11-021-0/+28
| | | | Approved by: grehan (mentor)
* Stay up to date with the latest ATA developments, wheressouhlal2004-11-022-2/+4
| | | | | | ata_channel.locking now returns an int. Approved by: grehan (mentor)
* Uncomment options _KPOSIX_PRIORITY_SCHEDULING as it is enabled in thessouhlal2004-11-021-1/+1
| | | | | | other architectures, and does not give any problems. Approved by: grehan (mentor)
* - Change the ddb paging "support" to use a variable (db_lines_per_page) tojhb2004-11-011-1/+1
| | | | | | | | | | | | | | | | | control the number of lines per page rather than a constant. The variable can be examined and changed in ddb as '$lines'. Setting the variable to 0 will effectively turn off paging. - Change db_putchar() to force out pending whitespace before outputting newlines and carriage returns so that one can rub out content on the current line via '\r \r' type strings. - Change the simple pager to rub out the --More-- prompt explicitly when the routine exits. - Add some aliases to the simple pager to make it more compatible with more(1): 'e' and 'j' do a single line. 'd' does half a page, and 'f' does a full page. MFC after: 1 month Inspired by: kris
* Add sc_iostart to softc and unbreak the build.gallatin2004-09-271-0/+1
| | | | | | This was forgotten in my previous commit to add i/o port to uninorth.c Pointy-hat to: me
* Add support for i/o-ports. This was cut and pasted from grackle.cgallatin2004-09-261-3/+26
|
* - Add support for "paging" in stack trace output. That is, when you dojhb2004-09-201-1/+4
| | | | | | | | | | | | | a stack trace from ddb, the output will pause with a '--More--' prompt every 18 lines. If you hit Enter, it will print another line and prompt again. If you hit space it will output another page and then prompt. If you hit 'q' or 'x' it will abort the rest of the stack trace. - Fix the sparc64 userland stack trace to honor the total count of lines to print. This is useful if your trace happens to walk back onto 0xdeadc0de and gets stuck in an endless loop. MFC after: 1 month Tested on: i386, alpha, sparc64
* Lock the kernel pmap in pmap_kenter().alc2004-09-133-0/+6
| | | | Tested by: gallatin@
* Fix a problem with tag->boundary inheritence that has existed since day onescottl2004-09-081-6/+5
| | | | | | | | | | | | | | and was propagated to nearly every platform. The boundary of the child needs to consider the boundary of the parent and pick the minimum of the two, not the maximum. However, if either is 0 then pick the appropriate one. This bug was exposed by a recent change to ATA, which should now be fixed by this change. The alignment and maxsegsz tag attributes likely also need a similar review in the near future. This is a MT5 candidate. Reviewed by: marcel Submitted by: sos (in part)
* Refactor a bunch of scheduler code to give basically the same behaviourjulian2004-09-052-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | but with slightly cleaned up interfaces. The KSE structure has become the same as the "per thread scheduler private data" structure. In order to not make the diffs too great one is #defined as the other at this time. The KSE (or td_sched) structure is now allocated per thread and has no allocation code of its own. Concurrency for a KSEGRP is now kept track of via a simple pair of counters rather than using KSE structures as tokens. Since the KSE structure is different in each scheduler, kern_switch.c is now included at the end of each scheduler. Nothing outside the scheduler knows the contents of the KSE (aka td_sched) structure. The fields in the ksegrp structure that are to do with the scheduler's queueing mechanisms are now moved to the kg_sched structure. (per ksegrp scheduler private data structure). In other words how the scheduler queues and keeps track of threads is no-one's business except the scheduler's. This should allow people to write experimental schedulers with completely different internal structuring. A scheduler call sched_set_concurrency(kg, N) has been added that notifies teh scheduler that no more than N threads from that ksegrp should be allowed to be on concurrently scheduled. This is also used to enforce 'fainess' at this time so that a ksegrp with 10000 threads can not swamp a the run queue and force out a process with 1 thread, since the current code will not set the concurrency above NCPU, and both schedulers will not allow more than that many onto the system run queue at a time. Each scheduler should eventualy develop their own methods to do this now that they are effectively separated. Rejig libthr's kernel interface to follow the same code paths as linkse for scope system threads. This has slightly hurt libthr's performance but I will work to recover as much of it as I can. Thread exit code has been cleaned up greatly. exit and exec code now transitions a process back to 'standard non-threaded mode' before taking the next step. Reviewed by: scottl, peter MFC after: 1 week
* Remove an unneeded argument..julian2004-08-312-2/+2
| | | | | | | | | The removed argument could trivially be derived from the remaining one. That in turn should be the same as curthread, but it is possible that curthread could be expensive to derive on some syste,s so leave it as an argument. Having both proc and thread as an argumen tjust gives an opportunity for them to get out sync. MFC after: 3 days
* Remove sched_free_thread() which was only usedjulian2004-08-312-6/+0
| | | | | | | | in diagnostics. It has outlived its usefulness and has started causing panics for people who turn on DIAGNOSTIC, in what is otherwise good code. MFC after: 2 days
* - Introduce a lock for synchronizing access to the pvo and pteg tables.alc2004-08-303-24/+84
| | | | | | | - In pmap_enter(), only the acquisition and release of the page queues lock needs to check the bootstrap flag. Tested by: gallatin@
* Eliminate unnecessary indirection.alc2004-08-283-6/+6
|
* Move the kernel-specific logic to adjust frompc from MI to MD. Formarcel2004-08-271-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | these two reasons: 1. On ia64 a function pointer does not hold the address of the first instruction of a functions implementation. It holds the address of a function descriptor. Hence the user(), btrap(), eintr() and bintr() prototypes are wrong for getting the actual code address. 2. The logic forces interrupt, trap and exception entry points to be layed-out contiguously. This can not be achieved on ia64 and is generally just bad programming. The MCOUNT_FROMPC_USER macro is used to set the frompc argument to some kernel address which represents any frompc that falls outside the kernel text range. The macro can expand to ~0U to bail out in that case. The MCOUNT_FROMPC_INTR macro is used to set the frompc argument to some kernel address to represent a call to a trap or interrupt handler. This to avoid that the trap or interrupt handler appear to be called from everywhere in the call graph. The macro can expand to ~0U to prevent adjusting frompc. Note that the argument is selfpc, not frompc. This commit defines the macros on all architectures equivalently to the original code in sys/libkern/mcount.c. People can take it from here... Compile-tested on: alpha, amd64, i386, ia64 and sparc64 Boot-tested on: i386
* Always compile PFIL_HOOKS into the kernel and remove the associated kernelandre2004-08-271-1/+0
| | | | | | | | | | | compile option. All FreeBSD packet filters now use the PFIL_HOOKS API and thus it becomes a standard part of the network stack. If no hooks are connected the entire packet filter hooks section and related activities are jumped over. This removes any performance impact if no hooks are active. Both OpenBSD and DragonFlyBSD have integrated PFIL_HOOKS permanently as well.
* Add pmap locking to many of the functions.alc2004-08-264-48/+147
| | | | | | | Many thanks to Andrew Gallatin for resolving a powerpc-specific initialization problem in my original patch. Tested by: gallatin@
* Instead of "OpenFirmware", "openfirmware", etc. use the official spellingmarius2004-08-1617-22/+22
| | | | | | "Open Firmware" from IEEE 1275 and OpenFirmware.org (no pun intended). Ok'ed by: tmm
* Add /dev/mem and /dev/kmem to powerpc.ssouhlal2004-08-1610-0/+300
| | | | Approved by: grehan (mentor)
* Advertise that color is supported so that syscons doesn't come upgrehan2004-08-161-2/+2
| | | | in monochrome mode when run as init.
* - Introduce an ofw_bus kobj-interface for retrieving the OFW node and amarius2004-08-125-87/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | subset ("compatible", "device_type", "model" and "name") of the standard properties in drivers for devices on Open Firmware supported busses. The standard properties "reg", "interrupts" und "address" are not covered by this interface because they are only of interest in the respective bridge code. There's a remaining standard property "status" which is unclear how to support properly but which also isn't used in FreeBSD at present. This ofw_bus kobj-interface allows to replace the various (ebus_get_node(), ofw_pci_get_node(), etc.) and partially inconsistent (central_get_type() vs. sbus_get_device_type(), etc.) existing IVAR ones with a common one. This in turn allows to simplify and remove code-duplication in drivers for devices that can hang off of more than one OFW supported bus. - Convert the sparc64 Central, EBus, FHC, PCI and SBus bus drivers and the drivers for their children to use the ofw_bus kobj-interface. The IVAR- interfaces of the Central, EBus and FHC are entirely replaced by this. The PCI bus driver used its own kobj-interface and now also uses the ofw_bus one. The IVARs special to the SBus, e.g. for retrieving the burst size, remain. Beware: this causes an ABI-breakage for modules of drivers which used the IVAR-interfaces, i.e. esp(4), hme(4), isp(4) and uart(4), which need to be recompiled. The style-inconsistencies introduced in some of the bus drivers will be fixed by tmm@ in a generic clean-up of the respective drivers later (he requested to add the changes in the "new" style). - Convert the powerpc MacIO bus driver and the drivers for its children to use the ofw_bus kobj-interface. This invloves removing the IVARs related to the "reg" property which were unused and a leftover from the NetBSD origini of the code. There's no ABI-breakage caused by this because none of these driver are currently built as modules. There are other powerpc bus drivers which can be converted to the ofw_bus kobj-interface, e.g. the PCI bus driver, which should be done together with converting powerpc to use the OFW PCI code from sparc64. - Make the SBus and FHC front-end of zs(4) and the sparc64 eeprom(4) take advantage of the ofw_bus kobj-interface and simplify them a bit. Reviewed by: grehan, tmm Approved by: re (scottl) Discussed with: tmm Tested with: Sun AX1105, AXe, Ultra 2, Ultra 60; PPC cross-build on i386
* - Use the rman_get_* functions instead of reaching into struct resource.marius2004-08-118-20/+16
| | | | | | | | - Remove __RMAN_RESORUCE_VISIBLE again. It's no longer required either because of the above change or because struct rman is no longer hidden. Reviewed by: grehan Tested by: cross-compile on i386
* Add __elfN(dump_thread). This function is called from __elfN(coredump)marcel2004-08-111-0/+8
| | | | | | | | | to allow dumping per-thread machine specific notes. On ia64 we use this function to flush the dirty registers onto the backingstore before we write out the PRSTATUS notes. Tested on: alpha, amd64, i386, ia64 & sparc64 Not tested on: arm, powerpc
* Always isync after a mtmsr. While perhaps not strictly necessary for PSL_EEgrehan2004-08-071-1/+1
| | | | | bit banging according to the OEA, it's better to be conservative than having to continually audit uses of this inline.
* In pmap_page_protect, clear the vm page's PG_WRITEABLE flag ifgrehan2004-08-053-3/+21
| | | | | downgrading to read-only. Found by triggering the KASSERT in vm_pageout_flush().
* - Push down the acquisition and release of Giant into pmap_enter_quick()alc2004-08-043-0/+6
| | | | | on those architectures without pmap locking. - Eliminate the acquisition and release of Giant in vm_map_pmap_enter().
* Making a loadable null.ko for /dev/(null|zero) proved rathermarkm2004-08-031-1/+0
| | | | | | unpopular, so remove this (mis)feature. Encouragement provided by: jhb (and others)
* Instead of calling ia32_pause() conditionally on __i386__ or __amd64__mux2004-08-031-0/+1
| | | | | | | | | being defined, define and use a new MD macro, cpu_spinwait(). It only expands to something on i386 and amd64, so the compiled code should be identical. Name of the macro found by: jhb Reviewed by: jhb
* Remove race condition between reading of MSR, setting md_savecrit,grehan2004-08-031-6/+2
| | | | | | | | and setting MSR. This was most evident with the idle proc running with interrupts disabled and causing a lockup. Switch over to the i386 style which does things in the right order. debug assisted by: gallatin, and the invaluable KTR option.
* Remove 'device mem' from GENERIC, which markm@ mistakingly added.ssouhlal2004-08-021-1/+0
| | | | | | We don't have mem/kmem yet. Approved by: grehan (mentor)
* Kernel traps were not being passed to trap_fatal in somegrehan2004-08-022-2/+4
| | | | | | circumstances. Spotted by: gallatin
* Break out the MI part of the /dev/[k]mem and /dev/io drivers intomarkm2004-08-011-1/+3
| | | | | | | | their own directory and module, leaving the MD parts in the MD area (the MD parts _are_ part of the modules). /dev/mem and /dev/io are now loadable modules, thus taking us one step further towards a kernel created entirely out of modules. Of course, there is nothing preventing the kernel from having these statically compiled.
* - Push down the acquisition and release of Giant into pmap_protect() onalc2004-07-303-0/+12
| | | | | | | | those architectures without pmap locking. - Eliminate the acquisition and release of Giant from vm_map_protect(). (Translation: mprotect(2) runs to completion without touching Giant on alpha, amd64, i386 and ia64.)
* Add comment explaining struct reg and struct fpreg must match the trapframe.ssouhlal2004-07-291-0/+2
| | | | Approved by: grehan (mentor)
* Implement MD parts of ptrace.ssouhlal2004-07-292-26/+86
| | | | Approved by: grehan (mentor)
OpenPOWER on IntegriCloud