summaryrefslogtreecommitdiffstats
path: root/sys/powerpc
Commit message (Collapse)AuthorAgeFilesLines
* This is the first part of the new kernel memory allocator. This replacesjeff2002-03-193-0/+69
| | | | | | malloc(9) and vm_zone with a slab like allocator. Reviewed by: arch@
* Changes and fixes in preparation for UMA:benno2002-03-173-36/+87
| | | | | | - Bootstrap pvo entries are now allocated by stealing pages. - Just return if we're pmap_enter'ing a mapping that's already there. Don't remove it and re-enter it.
* Lowercase all of the trap names.benno2002-03-172-96/+96
|
* Clean up and fix up copyin and copyout.benno2002-03-172-28/+40
|
* Move the definition of PT_[GS]ET{,DB,FP}REGS from the MD ptrace.h to thedes2002-03-161-10/+0
| | | | | MI ptrace.h, since all platforms define them. Keep the MD ptrace.h around for FIX_SSTEP (which is currently only needed on Alpha).
* Correct a typo. (* that should've been &)benno2002-03-113-3/+3
|
* o Don't require long long support in bswap64() functions.mike2002-03-091-3/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | o In i386's <machine/endian.h>, macros have some advantages over inlines, so change some inlines to macros. o In i386's <machine/endian.h>, ungarbage collect word_swap_int() (previously __uint16_swap_uint32), it has some uses on i386's with PDP endianness. Submitted by: bde o Move a comment up in <machine/endian.h> that was accidentially moved down a few revisions ago. o Reenable userland's use of optimized inline-asm versions of byteorder(3) functions. o Fix ordering of prototypes vs. redefinition of byteorder(3) functions, so that the non-GCC (libc asm) case has proper prototypes. o Add proper prototypes for byteorder(3) functions in <sys/param.h>. o Prevent redundant duplicate prototypes by making use of the _BYTEORDER_PROTOTYPED define. o Move the bswap16(), bswap32(), bswap64() C functions into MD space for platforms in which asm versions don't exist. This significantly reduces the complexity of some things at the cost of duplicate code. Reviewed by: bde
* Install the DSI and ISI trap handlers and their appropriate locations.benno2002-03-072-0/+4
|
* Copy the "implementation" of pmap_prefault from sparc64.benno2002-03-073-6/+12
|
* Move tunable initialisation so it can get access to physmem.benno2002-03-072-12/+12
|
* Calculate physmem.benno2002-03-073-3/+12
|
* - Move a comment from being on the same line as a #ifdef to the linearr2002-02-282-2/+4
| | | | | | | following it. This should have gone in the previous commit, but misviewed Bruce's patch. Requested by: bde
* cpu_switch now works, for kthreads at least.benno2002-02-283-39/+78
|
* Various cleanups.benno2002-02-282-48/+44
|
* - Prevent the decrementer interrupt handler from nesting.benno2002-02-283-6/+48
| | | | - Catch some more cases of PSL_EE and PSL_RI getting out of sync.
* - Modify pmap_activate so it only marks the pmap as active.benno2002-02-284-0/+37
| | | | - Add a pmap_deactivate function.
* GC an unused variable in cpu_fork().benno2002-02-282-2/+0
|
* - Fix panic() message and a couple style nits that snuck in from thearr2002-02-282-6/+6
| | | | recent diagnostics commit (rev. 1.84).
* Make fork work, at least for kthreads. Switching still has some issues.benno2002-02-2811-110/+77
|
* - Rearrange the sequence of events in powerpc_init() somewhat.benno2002-02-282-42/+48
| | | | - Catch another instance of PSL_EE being cleared without PSL_RI.
* - When enabling/disabling interrupts, set/clear both PSL_EE and PSL_RI, notbenno2002-02-281-5/+12
| | | | | just PSL_EE. - Make cpu_critical_enter/exit independant of save_intr/restore_intr.
* Add a missing (.benno2002-02-281-1/+1
|
* Implement the following functions:benno2002-02-283-12/+93
| | | | | | - pmap_remove - pmap_kremove - pmap_qremove
* Remove most of the usage of critical_enter/exit.benno2002-02-283-87/+0
| | | | | | | | I put these in to match the use of spl*() in the NetBSD code I was basing this on, but it appears to cause problems. I'm doing this in a separate commit so as to be able to refer back if locking becomes an issue at a later stage.
* Fix a horribly suboptimal algorithm in the vm_daemon.silby2002-02-273-3/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | In order to determine what to page out, the vm_daemon checks reference bits on all pages belonging to all processes. Unfortunately, the algorithm used reacted badly with shared pages; each shared page would be checked once per process sharing it; this caused an O(N^2) growth of tlb invalidations. The algorithm has been changed so that each page will be checked only 16 times. Prior to this change, a fork/sleepbomb of 1300 processes could cause the vm_daemon to take over 60 seconds to complete, effectively freezing the system for that time period. With this change in place, the vm_daemon completes in less than a second. Any system with hundreds of processes sharing pages should benefit from this change. Note that the vm_daemon is only run when the system is under extreme memory pressure. It is likely that many people with loaded systems saw no symptoms of this problem until they reached the point where swapping began. Special thanks go to dillon, peter, and Chuck Cranor, who helped me get up to speed with vm internals. PR: 33542, 20393 Reviewed by: dillon MFC after: 1 week
* Add the following functions/macros to support byte order conversions andtmm2002-02-271-12/+0
| | | | | | | | | | | | | | | | | | | | | | | | device drivers for bus system with other endinesses than the CPU (using interfaces compatible to NetBSD): - bwap16() and bswap32(). These have optimized implementations on some architectures; for those that don't, there exist generic implementations. - macros to convert from a certain byte order to host byte order and vice versa, using a naming scheme like le16toh(), htole16(). These are implemented using the bswap functions. - stream bus space access functions, which do not perform a byte order conversion (while the normal access functions would if the bus endianess differs from the CPU endianess). htons(), htonl(), ntohs() and ntohl() are implemented using the new functions above for kernel usage. None of the above interfaces is currently exported to user land. Make use of the new functions in a few places where local implementations of the same functionality existed. Reviewed by: mike, bde Tested on alpha by: mike
* Add makeoptions NO_WERROR=true so that we can build. =)benno2002-02-261-0/+1
|
* Make atomic_cmpset_32 correctly return 0 on failure.benno2002-02-241-0/+3
|
* Don't call critical_enter()/critical_exit() around calls to pmap_pvo_enter()benno2002-02-233-24/+0
| | | | as it does it's own handling of critical sections.
* Add some DIAGNOSTIC code.julian2002-02-222-14/+26
| | | | | | | | | | | | While in userland, keep the thread's ucred reference in a shadow field so that the usual place to store it is NULL. If DIAGNOSTIC is not set, the thread ucred is kept valid until the next kernel entry, at which time it is checked against the process cred and possibly corrected. Produces a BIG speedup in kernels with INVARIANTS set. (A previous commit corrected it for the non INVARIANTS case already) Reviewed by: dillon@freebsd.org
* Add change to teh PPC to keep it in step with i386 and MI codejulian2002-02-192-6/+8
| | | | Pointy hat this direction please...
* o Move NTOHL() and associated macros into <sys/param.h>. These aremike2002-02-181-36/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | deprecated in favor of the POSIX-defined lowercase variants. o Change all occurrences of NTOHL() and associated marcros in the source tree to use the lowercase function variants. o Add missing license bits to sparc64's <machine/endian.h>. Approved by: jake o Clean up <machine/endian.h> files. o Remove unused __uint16_swap_uint32() from i386's <machine/endian.h>. o Remove prototypes for non-existent bswapXX() functions. o Include <machine/endian.h> in <arpa/inet.h> to define the POSIX-required ntohl() family of functions. o Do similar things to expose the ntohl() family in libstand, <netinet/in.h>, and <sys/param.h>. o Prepend underscores to the ntohl() family to help deal with complexities associated with having MD (asm and inline) versions, and having to prevent exposure of these functions in other headers that happen to make use of endian-specific defines. o Create weak aliases to the canonical function name to help deal with third-party software forgetting to include an appropriate header. o Remove some now unneeded pollution from <sys/types.h>. o Add missing <arpa/inet.h> includes in userland. Tested on: alpha, i386 Reviewed by: bde, jake, tmm
* style(9)obrien2002-02-181-2/+2
|
* Resurrect one of the easiest changes from my big include files roll-upwollman2002-02-151-0/+1
| | | | | | patch from a year ago: give file flags their own type. This does not (yet) change the type used by system calls or library functions. The underlying type was chosen to match what is returned by stat().
* Complete rework of the PowerPC pmap and a number of other bits in the earlybenno2002-02-1423-4449/+5133
| | | | | | | | | | | | | | boot sequence. The new pmap.c is based on NetBSD's newer pmap.c (for the mpc6xx processors) which is 70% faster than the older code that the original pmap.c was based on. It has also been based on the framework established by jake's initial sparc64 pmap.c. There is no change to how far the kernel gets (it makes it to the mountroot prompt in psim) but the new pmap code is a lot cleaner. Obtained from: NetBSD (pmap code)
* Pre-KSE/M3 commit.julian2002-02-074-24/+18
| | | | | | | | | | this is a low-functionality change that changes the kernel to access the main thread of a process via the linked list of threads rather than assuming that it is embedded in the process. It IS still embeded there but remove all teh code that assumes that in preparation for the next commit which will actually move it out. Reviewed by: peter@freebsd.org, gallatin@cs.duke.edu, benno rice,
* GC the PC_SWITCH* symbols which are not used in assembly anymore.phk2002-02-071-1/+0
|
* Compile osigreturn() unconditionally since it will always be needed onbde2002-02-012-8/+12
| | | | | | | | | | | | | | | | | | some arches and the syscall table is machine-independent. It was (bogusly) conditional on COMPAT_43, so this usually makes no difference. ia64: in addition: - replace the bogus cloned comment before osigreturn() by a correct one. osigreturn() is just a stub fo ia64's. - fix the formatting of cloned comment before sigreturn(). - fix the return code. use nosys() instead of returning ENOSYS to get the same semantics as if the syscall is not in the syscall table. Generating SIGSYS is actually correct here. - fix style bugs. powerpc: copy the cleaned up ia64 stub. This mainly fixes a bogus comment. sparc64: copy the cleaned up the ia64 stub, since there was no stub before.
* Simple fixes to get the powerpc kernel compiling again.gallatin2002-01-284-4/+4
| | | | Reviewed by: mp
* Modify the critical section API as follows:jhb2001-12-183-19/+5
| | | | | | | | | | | | | | | | | | | - The MD functions critical_enter/exit are renamed to start with a cpu_ prefix. - MI wrapper functions critical_enter/exit maintain a per-thread nesting count and a per-thread critical section saved state set when entering a critical section while at nesting level 0 and restored when exiting to nesting level 0. This moves the saved state out of spin mutexes so that interlocking spin mutexes works properly. - Most low-level MD code that used critical_enter/exit now use cpu_critical_enter/exit. MI code such as device drivers and spin mutexes use the MI wrappers. Note that since the MI wrappers store the state in the current thread, they do not have any return values or arguments. - mtx_intr_enable() is replaced with a constant CRITICAL_FORK which is assigned to curthread->td_savecrit during fork_exit(). Tested on: i386, alpha
* Overhaul the per-CPU support a bit:jhb2001-12-1115-226/+67
| | | | | | | | | | | | | | | | | | | | | | | | | - The MI portions of struct globaldata have been consolidated into a MI struct pcpu. The MD per-CPU data are specified via a macro defined in machine/pcpu.h. A macro was chosen over a struct mdpcpu so that the interface would be cleaner (PCPU_GET(my_md_field) vs. PCPU_GET(md.md_my_md_field)). - All references to globaldata are changed to pcpu instead. In a UP kernel, this data was stored as global variables which is where the original name came from. In an SMP world this data is per-CPU and ideally private to each CPU outside of the context of debuggers. This also included combining machine/globaldata.h and machine/globals.h into machine/pcpu.h. - The pointer to the thread using the FPU on i386 was renamed from npxthread to fpcurthread to be identical with other architectures. - Make the show pcpu ddb command MI with a MD callout to display MD fields. - The globaldata_register() function was renamed to pcpu_init() and now init's MI fields of a struct pcpu in addition to registering it with the internal array and list. - A pcpu_destroy() function was added to remove a struct pcpu from the internal array and list. Tested on: alpha, i386 Reviewed by: peter, jake
* Update to C99, s/__FUNCTION__/__func__/,obrien2001-12-102-2/+2
| | | | also don't use ANSI string concatenation.
* style(9)obrien2001-12-091-13/+14
|
* Allow maxusers to be specified as 0 in the kernel config, which willdillon2001-12-093-3/+5
| | | | | | | cause the system to auto-size to between 32 and 512 depending on the amount of memory. MFC after: 1 week
* Add multiple inclusion protection.jhb2001-12-061-0/+5
|
* o Stop abusing MD headers with non-MD types.mike2001-12-011-2/+0
| | | | | | | | | | | | | | | o Hide nonstandard functions and types in <netinet/in.h> when _POSIX_SOURCE is defined. o Add some missing types (required by POSIX.1-200x) to <netinet/in.h>. o Restore vendor ID from Rev 1.1 in <netinet/in.h> and make use of new __FBSDID() macro. o Fix some miscellaneous issues in <arpa/inet.h>. o Correct final argument for the inet_ntop() function (POSIX.1-200x). o Get rid of the namespace pollution from <sys/types.h> in <arpa/inet.h>. Reviewed by: fenner Partially submitted by: bde
* The interrupt nesting level is per-thread not per-CPU on FreeBSD.jhb2001-11-142-2/+0
|
* Don't enable FP in the kernel. It is not needed when -msoft-float is used.mp2001-11-132-2/+0
| | | | Reminded by: benno
* Clean up the trap handling code and make it consistent with the other platforms.mp2001-11-057-613/+895
| | | | Submitted by: jhb
* Add enable_fpu/save_fpu for handling the floating point registers in the PCB.mp2001-11-056-0/+235
| | | | Obtained from: NetBSD
OpenPOWER on IntegriCloud