summaryrefslogtreecommitdiffstats
path: root/sys/powerpc/aim
Commit message (Collapse)AuthorAgeFilesLines
* Use __FBSDID rather than rcsid[].obrien2003-04-036-24/+12
|
* - Define a new md function 'casuptr'. This atomically compares and setsjeff2003-04-011-0/+8
| | | | | | | | | | a pointer that is in user space. It will be used as the basic primitive for a kernel supported user space lock implementation. - Implement this function in x86's support.s - Provide stubs that return -1 in all other architectures. Implementations will follow along shortly. Reviewed by: jake
* - Move p->p_sigmask to td->td_sigmask. Signal masks will be per thread withjeff2003-03-311-3/+3
| | | | | | | a follow on commit to kern_sig.c - signotify() now operates on a thread since unmasked pending signals are stored in the thread. - PS_NEEDSIGCHK moves to TDF_NEEDSIGCHK.
* - Change trapsignal() to accept a thread and not a proc.jeff2003-03-311-1/+1
| | | | | | | - Change all consumers to pass in a thread. Right now this does not cause any functional changes but it will be important later when signals can be delivered to specific threads.
* Enable the FPU on first use per-thread and save state across contextgrehan2003-03-202-22/+11
| | | | | | | | | | | switches. Not as lazy as it could be. Changing FPU state with sigcontext still TODO. fpu.c - convert some asm to inline C, and macroize fpu loads/stores swtch.S - call out to save/restore fpu routines trap.c - always call enable_fpu, since this shouldn't be called once the FPU has been enabled for a thread genassym.c - define for pcb fpu flag
* Add machine check handler. While generally useful, it's required whengrehan2003-03-191-1/+1
| | | | | issuing PCI config cycles on MPC106-based PowerMacs, which cause machine checks when accessing non-existent/empty slots.
* Replace calls to WITNESS_SLEEP() and witness_list() with equivalent callsjhb2003-03-041-6/+2
| | | | to WITNESS_WARN().
* Register typo and incorrect 32-bit constant load in previous commit.grehan2003-02-261-2/+2
| | | | Resulted in AST delivery not working.
* Cleanup of the d_mmap_t interface.mux2003-02-251-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | - Get rid of the useless atop() / pmap_phys_address() detour. The device mmap handlers must now give back the physical address without atop()'ing it. - Don't borrow the physical address of the mapping in the returned int. Now we properly pass a vm_offset_t * and expect it to be filled by the mmap handler when the mapping was successful. The mmap handler must now return 0 when successful, any other value is considered as an error. Previously, returning -1 was the only way to fail. This change thus accidentally fixes some devices which were bogusly returning errno constants which would have been considered as addresses by the device pager. - Garbage collect the poorly named pmap_phys_address() now that it's no longer used. - Convert all the d_mmap_t consumers to the new API. I'm still not sure wheter we need a __FreeBSD_version bump for this, since and we didn't guarantee API/ABI stability until 5.1-RELEASE. Discussed with: alc, phk, jake Reviewed by: peter Compile-tested on: LINT (i386), GENERIC (alpha and sparc64) Runtime-tested on: i386
* Catch up to latest KSE changesgrehan2003-02-201-3/+4
|
* Back out M_* changes, per decision of the TRB.imp2003-02-191-1/+1
| | | | Approved by: trb
* - Split the struct kse into struct upcall and struct kse. struct kse willjeff2003-02-171-1/+1
| | | | | | | soon be visible only to schedulers. This greatly simplifies much the KSE code. Submitted by: davidxu
* - Move ke_sticks, ke_iticks, ke_uticks, ke_uu, ke_su, and ke_iu back intojeff2003-02-171-1/+1
| | | | | | | the proc. These counters are only examined through calcru. Submitted by: davidxu Tested on: x86, alpha, UP/SMP
* GC an unused variable.benno2003-02-051-2/+0
|
* Export the ns_per_tick variable through md_var.h rather than by declaringbenno2003-02-051-1/+1
| | | | it extern in cpu.c.
* - Use cpu_setup() instead of identifycpu().benno2003-02-051-80/+1
| | | | - Remove identifycpu().
* Replace the inline asm in delay() with a while loop. This may not be asbenno2003-02-051-8/+4
| | | | | efficient but it appears to actually work. Some investigation may be required.
* - Rename the "powerpc" timecounter to the "decrementer" timecounter.benno2003-02-052-7/+19
| | | | - Initialise it earlier.
* Split statclock into statclock and profclock, and made the method for drivingjake2003-02-031-1/+6
| | | | | | | | | | | | | statclock based on profhz when profiling is enabled MD, since most platforms don't use this anyway. This removes the need for statclock_process, whose only purpose was to subdivide profhz, and gets the profiling clock running outside of sched_lock on platforms that implement suswintr. Also changed the interface for starting and stopping the profiling clock to do just that, instead of changing the rate of statclock, since they can now be separate. Reviewed by: jhb, tmm Tested on: i386, sparc64
* Reversion of commit by Davidxu plus fixes since applied.julian2003-02-012-2/+2
| | | | | | | | I'm not convinced there is anything major wrong with the patch but them's the rules.. I am using my "David's mentor" hat to revert this as he's offline for a while.
* - add pmap_pagedaemon_waken variablegrehan2003-02-011-47/+96
| | | | | | | | | | | | | | | - remove dead code and fix warnings in pmap_zero_page/zero_page_area - implement pmap_clear_reference pmap_ts_referenced pmap_page_exists_quick pmap_remove_all - align pmap_qenter/qremove closer with i386 code - fix vm_page locking in pmap_new_thread (from benno) - add new parameter to pmap_clear_bit to return original pte value Approved by: benno
* Back out some changes that snuck in with the last commit.benno2003-01-271-177/+19
| | | | Pointy hat to: benno
* Flesh out bus_dmamap_sync.benno2003-01-271-19/+177
|
* Use td->td_sticks, not td->td_kse->ke_sticks.benno2003-01-271-1/+1
| | | | Forgotten by: davidxu
* Move UPCALL related data structure out of kse, introduce a newdavidxu2003-01-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | data structure called kse_upcall to manage UPCALL. All KSE binding and loaning code are gone. A thread owns an upcall can collect all completed syscall contexts in its ksegrp, turn itself into UPCALL mode, and takes those contexts back to userland. Any thread without upcall structure has to export their contexts and exit at user boundary. Any thread running in user mode owns an upcall structure, when it enters kernel, if the kse mailbox's current thread pointer is not NULL, then when the thread is blocked in kernel, a new UPCALL thread is created and the upcall structure is transfered to the new UPCALL thread. if the kse mailbox's current thread pointer is NULL, then when a thread is blocked in kernel, no UPCALL thread will be created. Each upcall always has an owner thread. Userland can remove an upcall by calling kse_exit, when all upcalls in ksegrp are removed, the group is atomatically shutdown. An upcall owner thread also exits when process is in exiting state. when an owner thread exits, the upcall it owns is also removed. KSE is a pure scheduler entity. it represents a virtual cpu. when a thread is running, it always has a KSE associated with it. scheduler is free to assign a KSE to thread according thread priority, if thread priority is changed, KSE can be moved from one thread to another. When a ksegrp is created, there is always N KSEs created in the group. the N is the number of physical cpu in the current system. This makes it is possible that even an userland UTS is single CPU safe, threads in kernel still can execute on different cpu in parallel. Userland calls kse_create to add more upcall structures into ksegrp to increase concurrent in userland itself, kernel is not restricted by number of upcalls userland provides. The code hasn't been tested under SMP by author due to lack of hardware. Reviewed by: julian
* Remove BAT invalidation. This is done later in the boot sequence,grehan2003-01-221-17/+0
| | | | | | | so isn't required here, and seems to cause problems when booting from disk. Approved by: benno
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-1/+1
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* Merge all the various copies of vm_fault_quick() into a singledillon2003-01-161-16/+0
| | | | portable copy.
* Merge all the various copies of vmapbuf() and vunmapbuf() into a singledillon2003-01-151-74/+0
| | | | | | | | portable copy. Note that pmap_extract() must be used instead of pmap_kextract(). This is precursor work to a reorganization of vmapbuf() to close remaining user/kernel races (which can lead to a panic).
* Add page queues locking to vunmapbuf().grehan2003-01-081-0/+2
| | | | | Obtained from: sparc64 Approved by: benno
* Sync the i-cache after copying down the interrupt codegrehan2003-01-081-0/+1
| | | | Approved by: benno
* Be more conservative about re-enabling interrupts during trap processinggrehan2003-01-081-1/+1
| | | | | | until atomic issues are fully sorted. Approved by: benno
* Fix incorrect error returns and sign-extension.grehan2003-01-081-7/+7
| | | | Approved by: benno
* Fetch the initial time from the rtc OpenFirmware node. This is a short-termgrehan2003-01-081-0/+21
| | | | | | | measure until the rtc h/w driver is written, and it's a lot better than having "jan 1 1970" on filesys times. Approved by: benno
* Unbreak the KSE code. Keep track of zobie threads using the Per-CPU storagejulian2002-12-101-1/+1
| | | | | | | | during the context switch. Rearrange thread cleanups to avoid problems with Giant. Clean threads when freed or when recycled. Approved by: re (jhb)
* Under certain circumstances, we were calling kmem_free() frommux2002-11-221-0/+5
| | | | | | | | | | i386 cpu_thread_exit(). This resulted in a panic with WITNESS since we need to hold Giant to call kmem_free(), and we weren't helding it anymore in cpu_thread_exit(). We now do this from a new MD function, cpu_thread_dtor(), called by thread_dtor(). Approved by: re@ Suggested by: jhb
* Add getcontext, setcontext, and swapcontext as system calls.deischen2002-11-161-0/+14
| | | | | | | | | | | Previously these were libc functions but were requested to be made into system calls for atomicity and to coalesce what might be two entrances into the kernel (signal mask setting and floating point trap) into one. A few style nits and comments from bde are also included. Tested on alpha by: gallatin
* Move pmap_collect() out of the machine-dependent code, rename italc2002-11-131-6/+0
| | | | | | | | to reflect its new location, and add page queue and flag locking. Notes: (1) alpha, i386, and ia64 had identical implementations of pmap_collect() in terms of machine-independent interfaces; (2) sparc64 doesn't require it; (3) powerpc had it as a TODO.
* Print real / avail memory in megabytes rather than kilobytes.des2002-11-091-4/+4
|
* Move the definitions of the hw.physmem, hw.usermem and hw.availpagestmm2002-11-071-13/+0
| | | | | | | | | | | sysctls to MI code; this reduces code duplication and makes all of them available on sparc64, and the latter two on powerpc. The semantics by the i386 and pc98 hw.availpages is slightly changed: previously, holes between ranges of available pages would be included, while they are excluded now. The new behaviour should be more correct and brings i386 in line with the other architectures. Move physmem to vm/vm_init.c, where this variable is used in MI code.
* Remove what was a temporary bogus assignment of bits of siginfo_t, as it doesjmallett2002-11-061-2/+0
| | | | | | not look like the prerequisites to fill it in properly will be in the tree for the upcoming release, but it's mostly done, so there is no need for these to stay around to remind us.
* Split 4.x and 5.x signal handling so that we can keep 4.x signalpeter2002-10-251-12/+9
| | | | | | | | | | | | | | | | handling clean and functional as 5.x evolves. This allows some of the nasty bandaids in the 5.x codepaths to be unwound. Encapsulate 4.x signal handling under COMPAT_FREEBSD4 (there is an anti-foot-shooting measure in place, 5.x folks need this for a while) and finish encapsulating the older stuff under COMPAT_43. Since the ancient stuff is required on alpha (longjmp(3) passes a 'struct osigcontext *' to the current sigreturn(2), instead of the 'ucontext_t *' that sigreturn is supposed to take), add a compile time check to prevent foot shooting there too. Add uniform COMPAT_43 stubs for ia64/sparc64/powerpc. Tested on: i386, alpha, ia64. Compiled on sparc64 (a few days ago). Approved by: re
* Add the USER_SR segment register to pcb state. Initialize correctly,grehan2002-10-212-0/+7
| | | | | | | | | and save/restore during a context switch. The USER_SR could be overwritten when the current thread was switched out with a faulting copyin/copyout. Approved by: Benno
* Clean up ddb warnings/errors and enable in GENERICgrehan2002-10-041-1/+3
| | | | | Approved by: benno Motivated by: gallatin
* - fix zero-sized stack alloc from previous commit. a default is nowgrehan2002-10-041-10/+98
| | | | | | | selected ala sparc64 - KSEIII routines implemented (taken from i386/sparc64) Approved by: Benno
* Some kernel threads try to do significant work, and the default KSTACK_PAGESscottl2002-10-021-4/+26
| | | | | | | | | | | | | doesn't give them enough stack to do much before blowing away the pcb. This adds MI and MD code to allow the allocation of an alternate kstack who's size can be speficied when calling kthread_create. Passing the value 0 prevents the alternate kstack from being created. Note that the ia64 MD code is missing for now, and PowerPC was only partially written due to the pmap.c being incomplete there. Though this patch does not modify anything to make use of the alternate kstack, acpi and usb are good candidates. Reviewed by: jake, peter, jhb
* - bring vm_mapbuf/unmapbuf in line with other archsgrehan2002-09-191-42/+25
| | | | | | - update for recent KSE changes Approved by: benno
* - make sure recoverable interrupts are re-enabled in the trap handlergrehan2002-09-191-7/+3
| | | | | | - turn on ast() loop to enable signal delivery Approved by: benno
* - worked around 32-bit big-endian syscall return value problemgrehan2002-09-191-9/+20
| | | | | | | - syscall register spills weren't copied in correctly - removed VM_PROT_READ from the fault type on write protect faults Approved by: benno
* - use BAT registers to map device space and physical memorygrehan2002-09-191-28/+134
| | | | | | | | | | - remove test in pmap_activate that prevented vmspace sharing (v/rfork) - always sync icache in pmap_enter until problems are sorted - fix incorrect use of regions in pmap_kenter - bring in pmap_release from NetBSD - fix overwrite of bootstrap flag in pmap_pvo_enter Approved by: benno
OpenPOWER on IntegriCloud