summaryrefslogtreecommitdiffstats
path: root/sys/powerpc/include
Commit message (Collapse)AuthorAgeFilesLines
* Add user-space profiling support. Kernel profiling still todo.grehan2005-12-291-8/+82
| | | | Obtained from: NetBSD
* Forward-declare struct trapframe to allow the aic module to compile.grehan2005-12-241-0/+2
|
* Tweak how the MD code calls the fooclock() methods some. Instead ofjhb2005-12-223-13/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | passing a pointer to an opaque clockframe structure and requiring the MD code to supply CLKF_FOO() macros to extract needed values out of the opaque structure, just pass the needed values directly. In practice this means passing the pair (usermode, pc) to hardclock() and profclock() and passing the boolean (usermode) to hardclock_cpu() and hardclock_process(). Other details: - Axe clockframe and CLKF_FOO() macros on all architectures. Basically, all the archs were taking a trapframe and converting it into a clockframe one way or another. Now they can just extract the PC and usermode values directly out of the trapframe and pass it to fooclock(). - Renamed hardclock_process() to hardclock_cpu() as the latter is more accurate. - On Alpha, we now run profclock() at hz (profhz == hz) rather than at the slower stathz. - On Alpha, for the TurboLaser machines that don't have an 8254 timecounter, call hardclock() directly. This removes an extra conditional check from every clock interrupt on Alpha on the BSP. There is probably room for even further pruning here by changing Alpha to use the simplified timecounter we use on x86 with the lapic timer since we don't get interrupts from the 8254 on Alpha anyway. - On x86, clkintr() shouldn't ever be called now unless using_lapic_timer is false, so add a KASSERT() to that affect and remove a condition to slightly optimize the non-lapic case. - Change prototypeof arm_handler_execute() so that it's first arg is a trapframe pointer rather than a void pointer for clarity. - Use KCOUNT macro in profclock() to lookup the kernel profiling bucket. Tested on: alpha, amd64, arm, i386, ia64, sparc64 Reviewed by: bde (mostly)
* GC some unused frame types.jhb2005-12-161-55/+0
| | | | Approved by: grehan
* - Cleanup whitespace and extra ()s in vtophys() macros.jhb2005-12-061-1/+1
| | | | | | | | | | | - Move vtophys() macros next to vtopte() where vtopte() exists to match comments above vtopte(). - Remove references to the alternate address space in the comment above vtopte(). amd64 never had the alternate address space, and i386 lost it prior to PAE support being added. - s/entires/entries/ in comments. Reviewed by: alc
* Drop _MACHINE_ARCH and _MACHINE defines (not to be confused withru2005-12-061-7/+0
| | | | | | | MACHINE_ARCH and MACHINE). Their purpose was to be able to test in cpp(1), but cpp(1) only understands integer type expressions. Using such unsupported expressions introduced a number of subtle bugs, which were discovered by compiling with -Wundef.
* Add definitions for 64-bit PTEsgrehan2005-11-111-10/+47
|
* Insert a layer of indirection to the pmap code, using a kobj forgrehan2005-11-082-4/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the interface. This allows run-time selection of MMU code, based on CPU-type detection, or tunable-overrides when testing new code. Pre-requisite for G5 support. conf/files.powerpc - remove pmap.c - add mmu_if.h, mmu_oea.c, pmap_dispatch.c powerpc/include/mmuvar.h - definitions for MMU implementations powerpc/include/pmap.h - remove pmap_pte_spill declaration - add pmap_mmu_install declaration - size the phys_avail array - pmap_bootstrapped is now global-scope powerpc/powerpc/machdep.c - call kobj_machdep_init early in the boot sequence to allow kobj usage prior to SI_SUB_LOCK - install the OEA pmap code. This will be moved to CPU-specific init code in the future. powerpc/powerpc/mmu_if.m - Kobj MMU interface definitions powerpc/powerpc/pmap_dispatch.c - central dispatch for pmap calls - contains the global mmu kobj and the routine to locate the the mmu implementation and init the kobj
* Reorganize the interrupt handling code a bit to make a few things cleanerjhb2005-10-251-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and increase flexibility to allow various different approaches to be tried in the future. - Split struct ithd up into two pieces. struct intr_event holds the list of interrupt handlers associated with interrupt sources. struct intr_thread contains the data relative to an interrupt thread. Currently we still provide a 1:1 relationship of events to threads with the exception that events only have an associated thread if there is at least one threaded interrupt handler attached to the event. This means that on x86 we no longer have 4 bazillion interrupt threads with no handlers. It also means that interrupt events with only INTR_FAST handlers no longer have an associated thread either. - Renamed struct intrhand to struct intr_handler to follow the struct intr_foo naming convention. This did require renaming the powerpc MD struct intr_handler to struct ppc_intr_handler. - INTR_FAST no longer implies INTR_EXCL on all architectures except for powerpc. This means that multiple INTR_FAST handlers can attach to the same interrupt and that INTR_FAST and non-INTR_FAST handlers can attach to the same interrupt. Sharing INTR_FAST handlers may not always be desirable, but having sio(4) and uhci(4) fight over an IRQ isn't fun either. Drivers can always still use INTR_EXCL to ask for an interrupt exclusively. The way this sharing works is that when an interrupt comes in, all the INTR_FAST handlers are executed first, and if any threaded handlers exist, the interrupt thread is scheduled afterwards. This type of layout also makes it possible to investigate using interrupt filters ala OS X where the filter determines whether or not its companion threaded handler should run. - Aside from the INTR_FAST changes above, the impact on MD interrupt code is mostly just 's/ithread/intr_event/'. - A new MI ddb command 'show intrs' walks the list of interrupt events dumping their state. It also has a '/v' verbose switch which dumps info about all of the handlers attached to each event. - We currently don't destroy an interrupt thread when the last threaded handler is removed because it would suck for things like ppbus(8)'s braindead behavior. The code is present, though, it is just under #if 0 for now. - Move the code to actually execute the threaded handlers for an interrrupt event into a separate function so that ithread_loop() becomes more readable. Previously this code was all in the middle of ithread_loop() and indented halfway across the screen. - Made struct intr_thread private to kern_intr.c and replaced td_ithd with a thread private flag TDP_ITHREAD. - In statclock, check curthread against idlethread directly rather than curthread's proc against idlethread's proc. (Not really related to intr changes) Tested on: alpha, amd64, i386, sparc64 Tested on: arm, ia64 (older version of patch by cognet and marcel)
* Add a new atomic_fetchadd() primitive that atomically adds a value to ajhb2005-09-271-0/+13
| | | | | | | | | variable and returns the previous value of the variable. Tested on: i386, alpha, sparc64, arm (cognet) Reviewed by: arch@ Submitted by: cognet (arm) MFC after: 1 week
* Stop using the '+' constraint modifier with inline assembly. The '+'jhb2005-09-151-12/+12
| | | | | | | | | | constraint is actually only allowed for register operands. Instead, use separate input and output memory constraints. Education from: alc Reviewed by: alc Tested on: i386, alpha MFC after: 1 week
* Move MINSIGSTKSZ from <machine/signal.h> to <machine/_limits.h> and renamestefanf2005-08-202-4/+3
| | | | | | | | | | it to __MINSIGSTKSZ. Define MINSIGSTKSZ in <sys/signal.h>. This is done in order to use MINSIGSTKSZ for the macro PTHREAD_STACK_MIN in <pthread.h> (soon <limits.h>) without having to include the whole <sys/signal.h> header. Discussed with: bde
* Convert the atomic_ptr() operations over to operating on uintptr_tjhb2005-07-151-63/+20
| | | | | | | | | | variables rather than void * variables. This makes it easier and simpler to get asm constraints and volatile keywords correct. MFC after: 3 days Tested on: i386, alpha, sparc64 Compiled on: ia64, powerpc, amd64 Kernel toolchain busted on: arm
* Unbreak the PowerPC GENERIC build.jkoshy2005-06-111-2/+6
| | | | Reviewed by: delphij
* MFP4:jkoshy2005-06-091-0/+15
| | | | | | | | | | | | | | | | - Implement sampling modes and logging support in hwpmc(4). - Separate MI and MD parts of hwpmc(4) and allow sharing of PMC implementations across different architectures. Add support for P4 (EMT64) style PMCs to the amd64 code. - New pmcstat(8) options: -E (exit time counts) -W (counts every context switch), -R (print log file). - pmc(3) API changes, improve our ability to keep ABI compatibility in the future. Add more 'alias' names for commonly used events. - bug fixes & documentation.
* Remove bus_{mem,p}io.h and related code for a micro-optimization on i386nyan2005-05-292-66/+0
| | | | | | and amd64. The optimization is a trivial on recent machines. Reviewed by: -arch (imp, marcel, dfr)
* Add empty header (except of the multiple-inclusion protection) tomarcel2005-04-201-0/+10
| | | | get hwpmc(4) to compile on this platform.
* Break out the definition of bus_space_{tag,handle}_t and a few other typesimp2005-04-182-12/+47
| | | | | | | | | | into _bus.h to help with name space polution from including all of bus.h. In a few days, I'll commit changes to the MI code to take advantage of thse sepration (after I've made sure that these changes don't break anything in the main tree, I've tested in my trees, but you never know...). Suggested by: bde (in 2002 or 2003 I think) Reviewed in principle by: jhb
* Divorce critical sections from spinlocks. Critical sections as denoted byjhb2005-04-042-91/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | critical_enter() and critical_exit() are now solely a mechanism for deferring kernel preemptions. They no longer have any affect on interrupts. This means that standalone critical sections are now very cheap as they are simply unlocked integer increments and decrements for the common case. Spin mutexes now use a separate KPI implemented in MD code: spinlock_enter() and spinlock_exit(). This KPI is responsible for providing whatever MD guarantees are needed to ensure that a thread holding a spin lock won't be preempted by any other code that will try to lock the same lock. For now all archs continue to block interrupts in a "spinlock section" as they did formerly in all critical sections. Note that I've also taken this opportunity to push a few things into MD code rather than MI. For example, critical_fork_exit() no longer exists. Instead, MD code ensures that new threads have the correct state when they are created. Also, we no longer try to fixup the idlethreads for APs in MI code. Instead, each arch sets the initial curthread and adjusts the state of the idle thread it borrows in order to perform the initial context switch. This change is largely a big NOP, but the cleaner separation it provides will allow for more efficient alternative locking schemes in other parts of the kernel (bare critical sections rather than per-CPU spin mutexes for per-CPU data for example). Reviewed by: grehan, cognet, arch@, others Tested on: i386, alpha, sparc64, powerpc, arm, possibly more
* Refactor the bus_dma header files so that the interface is described inscottl2005-03-142-182/+34
| | | | | | | | | | sys/bus_dma.h instead of being copied in every single arch. This slightly reorders a flag that was specific to AXP and thus changes the ABI there. The interface still relies on bus_space definitions found in <machine/bus.h> so it cannot be included on its own yet, but that will be fixed at a later date. Add an MD <machine/bus_dma.h> for ever arch for consistency and to allow for future MD augmentation of the API. sparc64 makes heavy use of this right now due to its different bus_dma implemenation.
* netchild's mega-patch to isolate compiler dependencies into a centraljoerg2005-03-028-24/+43
| | | | | | | | | | | | | | | | place. This moves the dependency on GCC's and other compiler's features into the central sys/cdefs.h file, while the individual source files can then refer to #ifdef __COMPILER_FEATURE_FOO where they by now used to refer to #if __GNUC__ > 3.1415 && __BARC__ <= 42. By now, GCC and ICC (the Intel compiler) have been actively tested on IA32 platforms by netchild. Extension to other compilers is supposed to be possible, of course. Submitted by: netchild Reviewed by: various developers on arch@, some time ago
* Use a common multi-inclusion protection, and add such aru2005-02-191-4/+4
| | | | protection to alpha/include/exec.h.
* Convert bus_space_barrier() into a null inline function rather than angrehan2005-02-041-2/+9
| | | | empty macro to avoid many compile warnings in the USB code.
* - add definitions for MPC7447A/7448 (i.e. miniMac)grehan2005-02-041-1/+3
| | | | | | - expand MPC745X_P macro to include these Obtained from: NetBSD
* HID0 updates:grehan2005-02-041-3/+6
| | | | | | - updated relevant models for High BAT enable bit - fixed bug in BHTCLR/XAEN constants - added LRSTK and FOLD bits
* - change all u_int_XX to uint_XXgrehan2005-02-011-39/+39
| | | | - cast param for atomic_subtract_long, since Netgraph uses it.
* Add bus_dmamap_load_mbuf_sg() to powerpc.scottl2005-01-151-0/+3
|
* /* -> /*- for license, minor formatting changesimp2005-01-0735-35/+35
|
* 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.
* Remove UAREA_PAGES.das2004-11-201-1/+0
| | | | Reviewed by: arch@
* Implement TLS relocations for powerpc.ssouhlal2004-11-021-0/+28
| | | | Approved by: grehan (mentor)
* 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
* Add pmap locking to many of the functions.alc2004-08-261-0/+15
| | | | | | | Many thanks to Andrew Gallatin for resolving a powerpc-specific initialization problem in my original patch. Tested by: gallatin@
* Add /dev/mem and /dev/kmem to powerpc.ssouhlal2004-08-163-0/+43
| | | | Approved by: grehan (mentor)
* 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.
* 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.
* Add comment explaining struct reg and struct fpreg must match the trapframe.ssouhlal2004-07-291-0/+2
| | | | Approved by: grehan (mentor)
* Pass a thread argument into cpu_critical_{enter,exit}() rather thanrwatson2004-07-271-6/+4
| | | | | | | | | dereference curthread. It is called only from critical_{enter,exit}(), which already dereferences curthread. This doesn't seem to affect SMP performance in my benchmarks, but improves MySQL transaction throughput by about 1% on UP on my Xeon. Head nodding: jhb, bmilekic
* Properly implement kdb_cpu_{set|clear}_singlestep to allow DDB togrehan2004-07-271-0/+4
| | | | continue from breakpoints.
* Let ddb know powerpc is big endian so as to make ddb outputgallatin2004-07-231-0/+2
| | | | | | human readable. Obtained from: sparc64/include/db_machdep.h
* Update the callframe structure to leave space for the frame pointergrehan2004-07-221-0/+2
| | | | | | | | | and saved link register as per the ABI call sequence. Update code that uses this (fork_trampoline etc) to use the correct genassym'd offsets. This fixes the 'invalid LR' message when backtracing kernel threads in DDB.
* Fix printing of long doubles to match the size thatgallatin2004-07-191-9/+9
| | | | | | | | | | | | | gcc is using. This fixes devstat consumers (like vmstat, iostat, systat) so they don't print crazy zillion digit numbers for disk transfers and bandwidth. According to gcc, long doubles are 64-bits, rather than 128 bits like the SVR4 ABI spec wants them to be.. Note that MacOSX also treats long doubles as 64-bits, and not 128 bits, so we are in good company. Reviewed by: das Approved by: grehan
* Make FLT_ROUNDS correctly reflect the dynamic rounding mode.das2004-07-191-1/+5
|
* Use the version field to identify the partial context used bygrehan2004-07-191-0/+1
| | | | KSE process-scope threads.
* Gratuitous namechange to avoid low-level association with ddb.grehan2004-07-121-1/+1
|
* Add prototype for KDB's makectx routinegrehan2004-07-121-0/+2
|
* Remove old NetBSD-derived unused code and stuff that is now obsoletegrehan2004-07-121-33/+12
| | | | due to KDB.
* DDB -> KDB, and rename low-level trap handler to avoid name conflict.grehan2004-07-121-4/+4
|
* kdb.h for PowerPC. Stubs for now.grehan2004-07-121-0/+49
|
OpenPOWER on IntegriCloud