summaryrefslogtreecommitdiffstats
path: root/sys/powerpc
Commit message (Collapse)AuthorAgeFilesLines
* Set the rid for any resource obtained from rman_resource_reserve.imp2006-04-206-1/+6
|
* Add kbdmux(4). This avoids having to use the hint.pcib.1.skipslot=26marcel2006-04-071-0/+1
| | | | trick on a PowerBook G4 and friends to get the USB keyboard as ukbd0.
* Remove the unused sva and eva arguments from pmap_remove_pages().peter2006-04-032-6/+3
|
* Add a dummy implementation of bus_space_map().marcel2006-03-311-3/+9
|
* Simplify system time accounting for profiling.phk2006-02-082-8/+6
| | | | | | | | | | Rename struct thread's td_sticks to td_pticks, we will need the other name for more appropriately named use shortly. Reduce it from uint64_t to u_int. Clear td_pticks whenever we enter the kernel instead of recording its value as reference for userret(). Use the absolute value of td->pticks in userret() and eliminate third argument.
* Move the old BSD4.3 tty compatibility from (!BURN_BRIDGES && COMPAT_43)phk2006-01-101-0/+1
| | | | | | | | | | | | to COMPAT_43TTY. Add COMPAT_43TTY to NOTES and */conf/GENERIC Compile tty_compat.c only under the new option. Spit out #warning "Old BSD tty API used, please upgrade." if ioctl_compat.h gets #included from userland.
* Set the siginfo si_addr field, and also the mysterious 3rd parametergrehan2006-01-072-2/+8
| | | | | | | | to old-style signals, to be the DAR register for DSI miss exceptions. This gives the address of the access rather than the instruction address. The behaviour is now the same as on i386. Found by: libsigsegv tests
* - Make pcib_devclass private to sys/dev/pci/pci_pci.c and change all thejhb2006-01-061-5/+3
| | | | | | | various pcib drivers to use their own private devclass_t variables for their modules. - Use the DEFINE_CLASS_0() macro to declare drivers for the various pcib drivers while I'm here.
* MI changes:netchild2005-12-312-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | - provide an interface (macros) to the page coloring part of the VM system, this allows to try different coloring algorithms without the need to touch every file [1] - make the page queue tuning values readable: sysctl vm.stats.pagequeue - autotuning of the page coloring values based upon the cache size instead of options in the kernel config (disabling of the page coloring as a kernel option is still possible) MD changes: - detection of the cache size: only IA32 and AMD64 (untested) contains cache size detection code, every other arch just comes with a dummy function (this results in the use of default values like it was the case without the autotuning of the page coloring) - print some more info on Intel CPU's (like we do on AMD and Transmeta CPU's) Note to AMD owners (IA32 and AMD64): please run "sysctl vm.stats.pagequeue" and report if the cache* values are zero (= bug in the cache detection code) or not. Based upon work by: Chad David <davidc@acns.ab.ca> [1] Reviewed by: alc, arch (in 2004) Discussed with: alc, Chad David, arch (in 2004)
* Remove duplicate options (originals in sys/conf/NOTES).ru2005-12-301-2/+0
| | | | Reported by: fresh config(8)
* Add user-space profiling support. Kernel profiling still todo.grehan2005-12-291-8/+82
| | | | Obtained from: NetBSD
* Remove kern.elf32.can_exec_dyn sysctl. Instead extend Brandinfo structuresobomax2005-12-261-0/+2
| | | | | | | | | | with flags bitfield and set BI_CAN_EXEC_DYN flag for all brands that usually allow executing elf dynamic binaries (aka shared libraries). When it is requested to execute ET_DYN elf image check if this flag is on after we know the elf brand allowing execution if so. PR: kern/87615 Submitted by: Marcin Koziej <creep@desk.pl>
* Forward-declare struct trapframe to allow the aic module to compile.grehan2005-12-241-0/+2
|
* Mark the return address of the call to ast() in the generic trapgrehan2005-12-233-5/+13
| | | | | | | | | | handling code so the stack trace unwinders don't start trying to go into user-space. Found by trying to create core dumps with a KTR_COMPILE/KTR_GEOM kernel, which results in a stack_save() call in the ast() coredump path - this created a panic, and then calling 'trace' in ddb resulted in the black screen of death after printing out most of the backtrace.
* Tweak how the MD code calls the fooclock() methods some. Instead ofjhb2005-12-227-29/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
* add LINT buildsam2005-12-212-0/+86
| | | | | Discussed with: grehan MFC after: 1 week
* GC some unused frame types.jhb2005-12-162-94/+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.
* Convert to use the recently introduced set of ofw_bus_gen_get_*() formarius2005-12-032-93/+40
| | | | | | providing the ofw_bus KOBJ interface. Tested by: grehan
* - Allow duplicate "machine" directives with the same arguments.ru2005-11-272-3/+1
| | | | - Move existing "machine" directives to DEFAULTS.
* Create DEFAULTS files for alpha, ia64, powerpc, and sparc64 and movejhb2005-11-212-1/+10
| | | | | | 'device mem' over from GENERIC to DEFAULTS to be consistent with i386 and amd64. Additionally, on ia64 enable ACPI by default since ia64 requires acpi.
* Create a device node in /dev when a USB keyboard is plugged in.arun2005-11-211-0/+1
| | | | Reviewed by: grehan
* Eliminate pmap_init2(). It's no longer used.alc2005-11-202-20/+0
|
* Add definitions for 64-bit PTEsgrehan2005-11-111-10/+47
|
* ata_generic_hw takes a dev as a parameter, not a channel.grehan2005-11-111-1/+1
|
* Fix compile warning: pmap_bootstrap is now declared extern in pmap.h,grehan2005-11-112-2/+0
| | | | remove redundant declaration.
* No longer needed: replaced by mmu_if.m/pmap_dispatch.c/mmu_oea.cgrehan2005-11-091-2476/+0
|
* Apply r1.103 to correct place.grehan2005-11-091-1/+0
| | | | | | | pmap.c on PowerPC is now a combo of mmu_if.m, pmap_dispatch.c and mmu_oea.c (I forgot to delete pmap.c from CVS in last jumbo commit)
* Reimplement the reclamation of PV entries. Specifically, performalc2005-11-091-2/+0
| | | | | | | | | | | | | | | | | | reclamation synchronously from get_pv_entry() instead of asynchronously as part of the page daemon. Additionally, limit the reclamation to inactive pages unless allocation from the PV entry zone or reclamation from the inactive queue fails. Previously, reclamation destroyed mappings to both inactive and active pages. get_pv_entry() still, however, wakes up the page daemon when reclamation occurs. The reason being that the page daemon may move some pages from the active queue to the inactive queue, making some new pages available to future reclamations. Print the "reclaiming PV entries" message at most once per minute, but don't stop printing it after the fifth time. This way, we do not give the impression that the problem has gone away. Reviewed by: tegge
* Name change from pmap_* to moea_* to fit into the new order ofgrehan2005-11-082-934/+918
| | | | | | mmu implementation. This code handles the 32-bit 'OEA' MMU found on G2/G3/G4 PPC cores.
* Insert a layer of indirection to the pmap code, using a kobj forgrehan2005-11-086-4/+1248
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Finally (!?) get to the bottom of the mysterious G3 boot-time panics.grehan2005-11-071-1/+1
| | | | | | | | | | | | | After a number of tests using nop's to change the alignment, it was confirmed that the mtibat instructions should be cache-aligned. FreeScale app note AN2540 indicates that the isync before and after the mtdbat is the right thing to do, but sync/isync isn't required before the mtibat so it has been removed. Fix by using a ".balign 32" to pull the code in question to the correct alignment. MFC after: 3 days
* Copy SPRG0-3 registers at boot-time and restore when calling intogrehan2005-10-304-14/+116
| | | | | | | | | | OpenFirmware. FreeBSD/ppc uses SPRG0 as the per-cpu data area pointer, and SPRG1-3 as temporary registers during exception handling. There have been a few instances where OpenFirmware does require these to be part of it's context, such as cd-booting an eMac. reported by: many MFC after: 3 days
* In stack_save, stop when a trap-frame is encountered. This preventsgrehan2005-10-301-0/+10
| | | | | | | | | | | | trying to access user-space stack addresses when a user fault is encountered, as occurs when GEOM KTR code is handling a page fault and is using stack_save() to capture a trace for debug purposes. It may be possible to walk beyond the trap-frame if it is a kernel fault, as db_backtrace() does, but I don't think that complexity is needed in this routine. MFC after: 3 days
* Reorganize the interrupt handling code a bit to make a few things cleanerjhb2005-10-252-35/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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)
* 1. Change prototype of trapsignal and sendsig to use ksiginfo_t *, mostdavidxu2005-10-144-46/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | changes in MD code are trivial, before this change, trapsignal and sendsig use discrete parameters, now they uses member fields of ksiginfo_t structure. For sendsig, this change allows us to pass POSIX realtime signal value to user code. 2. Remove cpu_thread_siginfo, it is no longer needed because we now always generate ksiginfo_t data and feed it to libpthread. 3. Add p_sigqueue to proc structure to hold shared signals which were blocked by all threads in the proc. 4. Add td_sigqueue to thread structure to hold all signals delivered to thread. 5. i386 and amd64 now return POSIX standard si_code, other arches will be fixed. 6. In this sigqueue implementation, pending signal set is kept as before, an extra siginfo list holds additional siginfo_t data for signals. kernel code uses psignal() still behavior as before, it won't be failed even under memory pressure, only exception is when deleting a signal, we should call sigqueue_delete to remove signal from sigqueue but not SIGDELSET. Current there is no kernel code will deliver a signal with additional data, so kernel should be as stable as before, a ksiginfo can carry more information, for example, allow signal to be delivered but throw away siginfo data if memory is not enough. SIGKILL and SIGSTOP have fast path in sigqueue_add, because they can not be caught or masked. The sigqueue() syscall allows user code to queue a signal to target process, if resource is unavailable, EAGAIN will be returned as specification said. Just before thread exits, signal queue memory will be freed by sigqueue_flush. Current, all signals are allowed to be queued, not only realtime signals. Earlier patch reviewed by: jhb, deischen Tested on: i386, amd64
* Add a font width argument to vi_load_font_t, vi_save_font_t and vi_putm_tmarius2005-09-281-7/+5
| | | | | | | | | | | | | | | | and do some preparations for handling 12x22 fonts (currently lots of code implies and/or hardcodes a font width of 8 pixels). This will be required on sparc64 which uses a default font size of 12x22 in order to add font loading and saving support as well as to use a syscons(4)-supplied mouse pointer image. This API breakage is committed now so it can be MFC'ed in time for 6.0 and later on upcoming framebuffer drivers destined for use on sparc64 and which are expected to rely on using font loading internally and on a syscons(4)-supplied mouse pointer image can be easily MFC'ed to RELENG_6 rather than requiring a backport. Tested on: i386, sparc64, make universe MFC after: 1 week
* 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
* Introduce a kernel config for the Mandatory Access Control framework.csjp2005-09-181-0/+28
| | | | | | | | This kernel config briefly describes some of the major MAC policies available on FreeBSD. The hope is that this will raise the awareness about MAC and get more people interested. Discussed with: scottl
* 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
* Fix boot-time hang/panic on G3 systems when modifying IBAT0 ingrehan2005-09-103-3/+6
| | | | | | | | pmap_bootstrap by using the sync;isync big hammer to make sure all prior operations have completed. Reported by: Nathan Whitehorn <nathan at uchicago edu> MFC after: 2 days
* Move the prototypes of db_md_set_watchpoint(), db_md_clr_watchpoint()marcel2005-09-101-4/+0
| | | | and db_md_list_watchpoints() to ddb/ddb.h.
* Pass a value of type vm_prot_t to pmap_enter_quick() so that it determinealc2005-09-033-6/+9
| | | | whether the mapping should permit execute access.
* 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
* Remove unnecessary and alarming printf.grehan2005-08-161-1/+1
| | | | MFC after: 1 day
* - Add support for saving stack traces and displaying them via printf(9)jeff2005-08-031-0/+23
| | | | | | | and KTR. Contributed by: Antoine Brodin <antoine.brodin@laposte.net> Concept code from: Neal Fachan <neal@isilon.com>
* Temporary band-aid to fix hang when a process exec's Altivec instructions.grehan2005-07-306-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | trap_subr.S: declare a stub for the a-unavailable trap that does an absolute jump to the vector-assist trap. This is due to the fact that the vec-unavail trap doesn't start at a 256-byte boundary, so the trick of masking the bottom 8 bits of the link register to identify the interrupt doesn't work, so let the vec-assist case handle Altivec-disabled for the time being. Note that this will be fixed in the future with a much smaller vector code-stub (< 16 bytes) that will allow use of strange vector offsets that are also present in 4xx processors, and also allow smaller differences in vector codepaths on the G5. trap.c: Treat altivec-unavailable/assist process traps as SIGILL. Not quite correct, since altivec-assist should really be a panic, but it is fine for the moment due to the above measure. machdep.c Install the stub code for the altivec-unavailable trap, and the standard trap code at the altivec-assist. Reported by: Andreas Tobler <toa at pop agri ch> MFC after: 3 days
* 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
* Add recently invented COMPAT_FREEBSD5 option.kensmith2005-07-141-0/+1
| | | | MFC after: 3 days
OpenPOWER on IntegriCloud