summaryrefslogtreecommitdiffstats
path: root/sys/powerpc
Commit message (Collapse)AuthorAgeFilesLines
* Move vm_page_zero_idle() from machine-dependant sections to adillon2001-07-052-142/+0
| | | | | machine-independant source file, vm/vm_zeroidle.c. It was exactly the same for all platforms and updating them all was getting annoying.
* Reorg vm_page.c into vm_page.c, vm_pageq.c, and vm_contig.c (for contigmalloc).dillon2001-07-042-2/+2
| | | | | | | | | | | Also removed some spl's and added some VM mutexes, but they are not actually used yet, so this commit does not really make any operational changes to the system. vm_page.c relates to vm_page_t manipulation, including high level deactivation, activation, etc... vm_pageq.c relates to finding free pages and aquiring exclusive access to a page queue (exclusivity part not yet implemented). And the world still builds... :-)
* With Alfred's permission, remove vm_mtx in favor of a fine-grained approachdillon2001-07-042-24/+18
| | | | | | | | | (this commit is just the first stage). Also add various GIANT_ macros to formalize the removal of Giant, making it easy to test in a more piecemeal fashion. These macros will allow us to test fine-grained locks to a degree before removing Giant, and also after, and to remove Giant in a piecemeal fashion via sysctl's on those subsystems which the authors believe can operate without Giant.
* Allow Giant to be recursed when a process terminates.jhb2001-07-032-4/+4
|
* Don't need the .keep_me files. Obrien and I committed past each other.imp2001-07-012-1/+1
| | | | | | | Add 0-9 to the list of possible kernel names at matsushita-san's suggestion. Submitted by: Makoto MATSUSHITA-san <matusita@jp.FreeBSD.org>
* Don't include machine/autoconf.h for now. It's not used and is breaking thebenno2001-07-011-0/+3
| | | | build.
* Register definitions for the OpenPIC used in various models ofbenno2001-07-011-0/+93
| | | | | | iMac/PowerMac/iBook/PowerBook. Obtained from: NetBSD
* Add TRAPF_* macros required by MI-ification of ast() and userret().benno2001-07-011-0/+3
| | | | Submitted by: Mark Peek <mark@whistle.com>
* Ensure sys/${MACHINE}/compile/FOO existsobrien2001-06-301-0/+0
| | | | Reviewed by: arch, imp, peter, and the USENIX terminal room secret kernel cabal
* Really do proper keepme files in the compile directories. Useimp2001-06-302-0/+1
| | | | | | | | | | .cvsignore file for [A-Za-z]* to keep these directories around rather than waste a file on .keepme. This should also make people's built trees place nice with CVS. Idea for .cvsignore: peter (although I suggested the regexp) Pointed out by: Makoto MATSUSHITA-san <matusita@jp.FreeBSD.org> Llama's costuming by: Fernamdo Llamas
* Ensure sys/${MACHINE}/compile/FOO existsobrien2001-06-301-0/+0
| | | | | Reviewed by: arch, imp, peter and the USENIX terminal room secret kernel cabal
* Move ast() and userret() to sys/kern/subr_trap.c now that they are MI.jhb2001-06-292-16/+0
|
* Add a new MI pointer to the process' trapframe p_frame instead of usingjhb2001-06-292-2/+1
| | | | | | various differently named pointers buried under p_md. Reviewed by: jake (in principle)
* Put back the two semicolons I accidentally lost while reformatting this tobenno2001-06-281-2/+2
| | | | | | bring it closer to style(9). Spotted by: Mark Peek <mark@whistle.com>
* Code for dealing with external interrupts.benno2001-06-271-0/+832
| | | | Obtained from: NetBSD
* Fix comment breakage.benno2001-06-2712-139/+498
|
* Fix the atomic_*_32 operations. These were written before I had the abilitybenno2001-06-273-55/+78
| | | | | to test them properly and before I had a working knowledge of GCC asm constraints.
* Don't initialise ret in atomic_cmpset_32.benno2001-06-261-2/+1
| | | | Add more synchronisation.
* Fix asm constraints for atomic_cmpset_32. This fix may also be neededbenno2001-06-241-1/+1
| | | | elsewhere.
* More verbose version of identifycpu() which also contains many more CPUbenno2001-06-192-48/+98
| | | | | | | | versions/revisions. Modified from the original patch to mark G3 and G4 processors as such. Submitted by: Jeff Schottmiller <jeff@neoscale.com>
* The final commit for the first phase of PowerPC support.benno2001-06-171-0/+31
| | | | | | This adds the config stuff needed to build kernels. Reviewed by: obrien
* This commit (along with one pending in sys/dev/ofw and one in sys/conf) givebenno2001-06-1625-487/+606
| | | | | | | | | | | | | us our first minimal glimpse of PowerPC support. With this code we can get to the "mountroot>" prompt on my Apple iMac. We can't get any further due to lack of clock and interrupt handling, among other things. This does however mean that pmap and VM are initialising. We're fairly dependant on OpenFirmware at this point, but I hope to add support for other classes of firmware at a later stage. Reviewed by: obrien, dfr
* Add CVS id.obrien2001-06-151-1/+2
|
* Bring in NetBSD code used in the PowerPC port.benno2001-06-1049-0/+17592
| | | | | Reviewed by: obrien, dfr Obtained from: NetBSD
* fix RCS ID style nitobrien2001-06-091-1/+1
|
* ID style nit.obrien2001-06-091-1/+1
|
* Style fix FreeBSD ID, and change continuation style slightly.obrien2001-06-091-4/+3
|
* Properly wrap mtx_intr_enable() macro in "do $bla while (0)"phk2001-06-021-1/+1
|
* GC #if 0'd calls to releasing and acquiring the old style giant kerneljhb2001-05-292-12/+0
| | | | lock.
* - FDESC, FIFO, NULL, PORTAL, PROC, UMAP and UNION fileru2001-05-231-1/+1
| | | | | | | | | | | | | | | systems were repo-copied from sys/miscfs to sys/fs. - Renamed the following file systems and their modules: fdesc -> fdescfs, portal -> portalfs, union -> unionfs. - Renamed corresponding kernel options: FDESC -> FDESCFS, PORTAL -> PORTALFS, UNION -> UNIONFS. - Install header files for the above file systems. - Removed bogus -I${.CURDIR}/../../sys CFLAGS from userland Makefiles.
* catch these files up to their i386 neighbors to make alpha bootgallatin2001-05-212-12/+32
| | | | prior to the vm_mtx
* Make _BSD_TIME_T_ (time_t) an `int' rather than `long'. This will helpobrien2001-05-181-1/+1
| | | | | | | flag errors where programmers assume time_t is a long, which it is not on 64-bit platforms. Submitted by: bde
* Style changes -- revert ordering to mostly two revs ago.obrien2001-05-181-61/+64
| | | | | | Embellish some comments, fix tab'ing. Requested by: bde
* Consistently define the rune types.obrien2001-05-161-4/+14
| | | | Follow NetBSD's lead and add a _BSD_MBSTATE_T_ type.
* Move the int typedefs to the top so they can be used in defining other types.obrien2001-05-161-19/+24
| | | | | | Ensure every platform has __offsetof. Make multiple inclusion detection consistent with other <platform>/include/*.h files.
* Lock the procfs functions for doing a single step and reading/writingjhb2001-05-161-28/+16
| | | | | | registers better. Hold sched_lock not only for checking the flag but also while performing the actual operation to ensure the process doesn't get swapped out by another CPU while we the operation is being performed.
* Trim lots of stuff that is now in MI code along with MD alpha code.jhb2001-05-101-324/+7
|
* Undo part of the tangle of having sys/lock.h and sys/mutex.h included inmarkm2001-05-011-4/+5
| | | | | | | | | | | other "system" header files. Also help the deprecation of lockmgr.h by making it a sub-include of sys/lock.h and removing sys/lockmgr.h form kernel .c files. Sort sys/*.h includes where possible in affected files. OK'ed by: bde (with reservations)
* Overhaul of the SMP code. Several portions of the SMP kernel support havejhb2001-04-273-15/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | been made machine independent and various other adjustments have been made to support Alpha SMP. - It splits the per-process portions of hardclock() and statclock() off into hardclock_process() and statclock_process() respectively. hardclock() and statclock() call the *_process() functions for the current process so that UP systems will run as before. For SMP systems, it is simply necessary to ensure that all other processors execute the *_process() functions when the main clock functions are triggered on one CPU by an interrupt. For the alpha 4100, clock interrupts are delievered in a staggered broadcast fashion, so we simply call hardclock/statclock on the boot CPU and call the *_process() functions on the secondaries. For x86, we call statclock and hardclock as usual and then call forward_hardclock/statclock in the MD code to send an IPI to cause the AP's to execute forwared_hardclock/statclock which then call the *_process() functions. - forward_signal() and forward_roundrobin() have been reworked to be MI and to involve less hackery. Now the cpu doing the forward sets any flags, etc. and sends a very simple IPI_AST to the other cpu(s). AST IPIs now just basically return so that they can execute ast() and don't bother with setting the astpending or needresched flags themselves. This also removes the loop in forward_signal() as sched_lock closes the race condition that the loop worked around. - need_resched(), resched_wanted() and clear_resched() have been changed to take a process to act on rather than assuming curproc so that they can be used to implement forward_roundrobin() as described above. - Various other SMP variables have been moved to a MI subr_smp.c and a new header sys/smp.h declares MI SMP variables and API's. The IPI API's from machine/ipl.h have moved to machine/smp.h which is included by sys/smp.h. - The globaldata_register() and globaldata_find() functions as well as the SLIST of globaldata structures has become MI and moved into subr_smp.c. Also, the globaldata list is only available if SMP support is compiled in. Reviewed by: jake, peter Looked over by: eivind
* Initialize p_md.md_kernnest to 1 for newly fork'd processes since theyjhb2001-04-262-0/+12
| | | | start off in the kernel.
* Add a new field 'md_kernnest' to the alpha machine dependent processjhb2001-04-241-0/+3
| | | | | | | | | | | | | | | | | | | | | structure. This field keeps track of how many levels deep we are nested into the kernel. The nesting level is bumped at the start of a trap, interrupt, syscall, or exception and is decremented on return. This is used to detect the case when the kernel is returning back to a kernel context in exception_return(). If we are returning to the kernel we need to update the globaldata pointer register saved in the stack frame in case we have switched CPU's between taking the initial interrupt that saved the frame and returning. If we don't do this fixup it is possible for a CPU to use the wrong per-cpu data. On UP systems this is not a problem, so the code is conditional on SMP. A count was used instead of simply checking the process status register in the frame during exception_return() since there are critical sections at the very start and end of a trap, exception, or interrupt from userland in which we could trash the t7 register being used in userland. The counter is incremented after adn before these critical sections respectively so that we will not overwrite the saved t7 register if we are interrupted during one of these critical sections.
* Fix includes so it compiles again.mjacob2001-04-231-1/+2
|
* Convert the protection of hte i8254 from critical_enter/exit like it isjhb2001-04-181-0/+3
| | | | on the x86.
* Blow away the panic mutex in favor of using a single atomic_cmpset() on ajhb2001-04-171-4/+0
| | | | | | panic_cpu shared variable. I used a simple atomic operation here instead of a spin lock as it seemed to be excessive overhead. Also, this can avoid recursive panics if, for example, witness is broken.
* Rework the witness code to work with sx locks as well as mutexes.jhb2001-03-282-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Introduce lock classes and lock objects. Each lock class specifies a name and set of flags (or properties) shared by all locks of a given type. Currently there are three lock classes: spin mutexes, sleep mutexes, and sx locks. A lock object specifies properties of an additional lock along with a lock name and all of the extra stuff needed to make witness work with a given lock. This abstract lock stuff is defined in sys/lock.h. The lockmgr constants, types, and prototypes have been moved to sys/lockmgr.h. For temporary backwards compatability, sys/lock.h includes sys/lockmgr.h. - Replace proc->p_spinlocks with a per-CPU list, PCPU(spinlocks), of spin locks held. By making this per-cpu, we do not have to jump through magic hoops to deal with sched_lock changing ownership during context switches. - Replace proc->p_heldmtx, formerly a list of held sleep mutexes, with proc->p_sleeplocks, which is a list of held sleep locks including sleep mutexes and sx locks. - Add helper macros for logging lock events via the KTR_LOCK KTR logging level so that the log messages are consistent. - Add some new flags that can be passed to mtx_init(): - MTX_NOWITNESS - specifies that this lock should be ignored by witness. This is used for the mutex that blocks a sx lock for example. - MTX_QUIET - this is not new, but you can pass this to mtx_init() now and no events will be logged for this lock, so that one doesn't have to change all the individual mtx_lock/unlock() operations. - All lock objects maintain an initialized flag. Use this flag to export a mtx_initialized() macro that can be safely called from drivers. Also, we on longer walk the all_mtx list if MUTEX_DEBUG is defined as witness performs the corresponding checks using the initialized flag. - The lock order reversal messages have been improved to output slightly more accurate file and line numbers.
* - Switch from using save/disable/restore_intr to using critical_enter/exitjhb2001-03-281-23/+1
| | | | | | | | | | | | | | | | | and change the u_int mtx_saveintr member of struct mtx to a critical_t mtx_savecrit. - On the alpha we no longer need a custom _get_spin_lock() macro to avoid an extra PAL call, so remove it. - Partially fix using mutexes with WITNESS in modules. Change all the _mtx_{un,}lock_{spin,}_flags() macros to accept explicit file and line parameters and rename them to use a prefix of two underscores. Inside of kern_mutex.c, generate wrapper functions for _mtx_{un,}lock_{spin,}_flags() (only using a prefix of one underscore) that are called from modules. The macros mtx_{un,}lock_{spin,}_flags() are mapped to the __mtx_* macros inside of the kernel to inline the usual case of mutex operations and map to the internal _mtx_* functions in the module case so that modules will use WITNESS and KTR logging if the kernel is compiled with support for it.
* - Include <machine/prom.h> to get the prototype for prom_halt().jhb2001-03-281-1/+1
| | | | | | | | - If there is no gdb device, just return without trying to return any value since gdb_handle_exception() returns void. - When calling prom_halt(), pass in a value telling it to actually halt and not to randomly choose whether or not to halt or reboot depending on whatever value happened to be in a0 when the call was made.
* Unbreak build on alpha.ume2001-03-241-3/+0
| | | | | | | - Move in_port_t to sys/types.h. - Nuke in_addr_t from each endian.h. Reported by: jhb
* Use a generic implementation of the Fowler/Noll/Vo hash (FNV hash).peter2001-03-171-0/+1
| | | | | | | | | | | | | | | | | Make the name cache hash as well as the nfsnode hash use it. As a special tweak, create an unsigned version of register_t. This allows us to use a special tweak for the 64 bit versions that significantly speeds up the i386 version (ie: int64 XOR int64 is slower than int64 XOR int32). The code layout is a little strange for the string function, but I was able to get between 5 to 10% improvement over the original version I started with. The layout affects gcc code generation choices and this way was fastest on x86 and alpha. Note that 'CPUTYPE=p3' etc makes a fair difference to this. It is around 45% faster with -march=pentiumpro on a p6 cpu.
* remove bogus check -- for kernel threads we fork off of proc0, not curprocgallatin2001-03-152-4/+0
| | | | | | | This was causing panics when modules which create kthreads were loaded after boot. pointed out by: jake, jhb
OpenPOWER on IntegriCloud