summaryrefslogtreecommitdiffstats
path: root/sys/powerpc/aim
Commit message (Collapse)AuthorAgeFilesLines
* Add a machine depended function thread_siginfo, SA signal codedavidxu2003-06-281-0/+19
| | | | | | | will use the function to construct a siginfo structure and use the result to export to userland. Reviewed by: julian
* Remove unused bootpath[] variable. It conflicted with a declarationgrehan2003-06-251-2/+0
| | | | in the sunlabel utility, causing build problems.
* Migrate the thread stack management functions from the machine-dependentalc2003-06-141-153/+0
| | | | | | | | | | | | | | | | to the machine-independent parts of the VM. At the same time, this introduces vm object locking for the non-i386 platforms. Two details: 1. KSTACK_GUARD has been removed in favor of KSTACK_GUARD_PAGES. The different machine-dependent implementations used various combinations of KSTACK_GUARD and KSTACK_GUARD_PAGES. To disable guard page, set KSTACK_GUARD_PAGES to 0. 2. Remove the (unnecessary) clearing of PG_ZERO in vm_thread_new. In 5.x, (but not 4.x,) PG_ZERO can only be set if VM_ALLOC_ZERO is passed to vm_page_alloc() or vm_page_grab().
* Move the *_new_altkstack() and *_dispose_altkstack() functions out of thealc2003-06-141-25/+0
| | | | | various pmap implementations into the machine-independent vm. They were all identical.
* GC unused cpu_wait() functionpeter2003-06-111-6/+0
|
* Change the second (and last) argument of cpu_set_upcall(). Previouslymarcel2003-06-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | we were passing in a void* representing the PCB of the parent thread. Now we pass a pointer to the parent thread itself. The prime reason for this change is to allow cpu_set_upcall() to copy (parts of) the trapframe instead of having it done in MI code in each caller of cpu_set_upcall(). Copying the trapframe cannot always be done with a simply bcopy() or may not always be optimal that way. On ia64 specifically the trapframe contains information that is specific to an entry into the kernel and can only be used by the corresponding exit from the kernel. A trapframe copied verbatim from another frame is in most cases useless without some additional normalization. Note that this change removes the assignment to td->td_frame in some implementations of cpu_set_upcall(). The assignment is redundant. A previous call to cpu_thread_setup() already did the exact same assignment. An added benefit of removing the redundant assignment is that we can now change td_pcb without nasty side-effects. This change officially marks the ability on ia64 for 1:1 threading. Not tested on: amd64, powerpc Compile & boot tested on: alpha, sparc64 Functionally tested on: i386, ia64
* Remove #include <sys/disklabel.h>phk2003-06-011-1/+0
|
* - Merge struct procsig with struct sigacts.jhb2003-05-131-4/+5
| | | | | | | | | | | | | | | | | - Move struct sigacts out of the u-area and malloc() it using the M_SUBPROC malloc bucket. - Add a small sigacts_*() API for managing sigacts structures: sigacts_alloc(), sigacts_free(), sigacts_copy(), sigacts_share(), and sigacts_shared(). - Remove the p_sigignore, p_sigacts, and p_sigcatch macros. - Add a mutex to struct sigacts that protects all the members of the struct. - Add sigacts locking. - Remove Giant from nosys(), kill(), killpg(), and kern_sigaction() now that sigacts is locked. - Several in-kernel functions such as psignal(), tdsignal(), trapsignal(), and thread_stopped() are now MP safe. Reviewed by: arch@ Approved by: re (rwatson)
* Things run thru the C preprocessor must use C-style comments.obrien2003-05-051-11/+11
|
* Back out last commits. The elf64/elf32 kernel name thing was more painpeter2003-05-011-3/+1
| | | | than it was worth.
* Fix transcription error. Use == NULL, not != NULL. Fortunately thispeter2003-04-301-1/+1
| | | | was harmless.
* Look for an elf32 kernel (powerpc) and elf64 kernel (sparc64) as wellpeter2003-04-301-1/+3
| | | | as a plain "elf kernel".
* Range check the syscall number before looking it up in the syscallnames[]jhb2003-04-301-1/+1
| | | | | | array. Submitted by: pho
* Add an argument to get_mcontext() which specified whether thedeischen2003-04-251-1/+1
| | | | | | | | | | | | | | | | | | | | syscall return values should be cleared. The system calls getcontext() and swapcontext() want to return 0 on success but these contexts can be switched to at a later time so the return values need to be cleared in the saved register sets. Other callers of get_mcontext() would normally want the context without clearing the return values. Remove the i386-specific context saving from the KSE code. get_mcontext() is not i386-specific any more. Fix a bad pointer in the alpha get_mcontext() code. The context was being bcopy()'d from &td->tf_frame, but tf_frame is itself a pointer, so the thread was being copied instead. Spotted by jake. Glanced at by: jake Reviewed by: bde (months ago)
* 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
OpenPOWER on IntegriCloud