summaryrefslogtreecommitdiffstats
path: root/sys/alpha
Commit message (Collapse)AuthorAgeFilesLines
* Fixes for alpha pmap on SMP machines:jhb2002-02-062-52/+65
| | | | | | | | | | | | | | | | | | | | - Create a private list of active pmaps rather than abusing the list of all processes when we need to look up pmaps. The process list needs a sx lock and we can't be getting sx locks in the middle of cpu_switch() (pmap_activate() can call pmap_get_asn() from cpu_switch()). Instead, we protect the list with a spinlock. This also means the list is shorter since a pmap can be used by more than one process and we could (at least in thoery) dink with pmap's more than once, but now we only touch each pmap once when we have to update all of them. - Wrap pmap_activate()'s code to get a new ASN in an explicit critical section so that when it is called while doing an exec() we can't get preempted. - Replace splhigh() in pmap_growkernel() with a critical section to prevent preemption while we are adjusting the kernel page tables. - Fixes abuse of PCPU_GET(), which doesn't return an L-value. - Also adds some slight cleanups to the ASN handling by adding some macros instead of magic numbers in relation to the ASN and ASN generations. Reviewed by: dfr
* Improve the change in the previous commit: use a stub for osigreturn()bde2002-02-031-0/+4
| | | | when it is not really used instead of unconditionalizing all of it.
* Compile osigreturn() unconditionally since it will always be needed onbde2002-02-011-2/+0
| | | | | | | | | | | | | | | | | | 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.
* Regenerated file from previous commit to syscalls.mastergallatin2002-01-233-18/+6
|
* Linux/alpha uses the same BSDish return mechanism we do forgallatin2002-01-231-4/+4
| | | | | | | | getpid, getuid, getgid and pipe, since they bootstrapped from OSF/1 and never cleaned up. Switch to the native syscalls on alpha so that the above functions work MFC after: 7 days
* Don't read the sigcontext pointer directly from userspace. If the processgallatin2002-01-221-6/+14
| | | | | | is swapped out, this can cause a system panic. Copy it in, instead tested by: Bernd Walter <ticso@cicely8.cicely.de>
* Avoid __func__ string concatenationpeter2002-01-181-1/+1
|
* Allow alpha kernels to compile again- make sure opt_ddb.h is includedmjacob2002-01-172-1/+5
| | | | | | and the reference to db_regs is *extern* from alpha/include/db_machdep.h (put it in alpha/alpha/machdep.c)- this avoids the problems we've had about different 'common' sizes prohibiting the kernel from linking.
* - Catch up printtrap() to KSE by using curthread and testing it againstjhb2002-01-151-5/+9
| | | | | | | | | NULL rather than curproc. Without this, if we trap early before curthread is set, we recursively panic. - In an SMP kernel, if we trap before curthread is set, then trap is going to recursively panic trying to bump td->td_md.md_kernnest. The trap is fatal anyways, so to make debugging easier just call printtrap() to dump the trap info to the console and then halt.
* Replace ffind_* with fget calls.alfred2002-01-141-4/+2
| | | | | | | | Make fget MPsafe. Make fgetvp and fgetsock use the fget subsystem to reduce code bloat. Push giant down in fpathconf().
* SMP Lock struct file, filedesc and the global file list.alfred2002-01-132-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Seigo Tanimura (tanimura) posted the initial delta. I've polished it quite a bit reducing the need for locking and adapting it for KSE. Locks: 1 mutex in each filedesc protects all the fields. protects "struct file" initialization, while a struct file is being changed from &badfileops -> &pipeops or something the filedesc should be locked. 1 mutex in each struct file protects the refcount fields. doesn't protect anything else. the flags used for garbage collection have been moved to f_gcflag which was the FILLER short, this doesn't need locking because the garbage collection is a single threaded container. could likely be made to use a pool mutex. 1 sx lock for the global filelist. struct file * fhold(struct file *fp); /* increments reference count on a file */ struct file * fhold_locked(struct file *fp); /* like fhold but expects file to locked */ struct file * ffind_hold(struct thread *, int fd); /* finds the struct file in thread, adds one reference and returns it unlocked */ struct file * ffind_lock(struct thread *, int fd); /* ffind_hold, but returns file locked */ I still have to smp-safe the fget cruft, I'll get to that asap.
* Add missing prototype for pmap_unmapdev().jhb2002-01-111-0/+1
|
* Use a spare slot in the machine context to identify the context formatdeischen2002-01-102-1/+5
| | | | | | | | | | | and to inherently verify its validity. Alpha signal frames and trap frames are different; this field identifies which format the context is Set the machine context format (signal frame) before copying it out when sending a signal. Approved by: -arch
* Convert a bunch of 1 << PCPU_GET(cpuid) to PCPU_GET(cpumask).peter2002-01-052-6/+6
|
* Change the preemption code for software interrupt thread schedules andjhb2002-01-052-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mutex releases to not require flags for the cases when preemption is not allowed: The purpose of the MTX_NOSWITCH and SWI_NOSWITCH flags is to prevent switching to a higher priority thread on mutex releease and swi schedule, respectively when that switch is not safe. Now that the critical section API maintains a per-thread nesting count, the kernel can easily check whether or not it should switch without relying on flags from the programmer. This fixes a few bugs in that all current callers of swi_sched() used SWI_NOSWITCH, when in fact, only the ones called from fast interrupt handlers and the swi_sched of softclock needed this flag. Note that to ensure that swi_sched()'s in clock and fast interrupt handlers do not switch, these handlers have to be explicitly wrapped in critical_enter/exit pairs. Presently, just wrapping the handlers is sufficient, but in the future with the fully preemptive kernel, the interrupt must be EOI'd before critical_exit() is called. (critical_exit() can switch due to a deferred preemption in a fully preemptive kernel.) I've tested the changes to the interrupt code on i386 and alpha. I have not tested ia64, but the interrupt code is almost identical to the alpha code, so I expect it will work fine. PowerPC and ARM do not yet have interrupt code in the tree so they shouldn't be broken. Sparc64 is broken, but that's been ok'd by jake and tmm who will be fixing the interrupt code for sparc64 shortly. Reviewed by: peter Tested on: i386, alpha
* This file does not need to include procfs.h. This fixes a bunch of warnings.des2002-01-011-1/+0
|
* Use the new resource_list_print_type() function.tmm2001-12-211-1/+1
| | | | | Pass the bus device to isa_init() (this is needed for the sparc64 version).
* Introduce a standard name for the lock protecting an interrupt controllerjhb2001-12-209-22/+101
| | | | | | | | and it's associated state variables: icu_lock with the name "icu". This renames the imen_mtx for x86 SMP, but also uses the lock to protect access to the 8259 PIC on x86 UP. This also adds an appropriate lock to the various Alpha chipsets which fixes problems with Alpha SMP machines dropping interrupts with an SMP kernel.
* Fix typo. s/pa/va/. *blush*peter2001-12-201-1/+1
|
* Replace a bunch of:peter2001-12-201-28/+9
| | | | | | | | for (pv = TAILQ_FIRST(&m->md.pv_list); pv; pv = TAILQ_NEXT(pv, pv_list)) { with: TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) {
* Fix some whitespace nits, converge with other pmap.c'speter2001-12-201-6/+14
|
* Merge part of revision 1.18 of sys/i386/linux/linux_machdep.c: don't usejhb2001-12-181-2/+0
| | | | RFTHREAD in linux_clone().
* Whitespace fix.jhb2001-12-181-1/+1
|
* Modify the critical section API as follows:jhb2001-12-1811-32/+31
| | | | | | | | | | | | | | | | | | | - 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
* Small cleanups to the SMP code:jhb2001-12-171-12/+4
| | | | | | | | | | | - Axe inlvtlb_ok as it was completely redundant with smp_active. - Remove references to non-existent variable and non-existent file in i386/include/smp.h. - Don't perform initializations local to each CPU while holding the ap boot lock on i386 while an AP bootstraps itself. - Reorganize the AP startup code some to unify the latter half of the functions to bring an AP up. Eventually this might be broken out into a MI function in subr_smp.c.
* Enable UFS_DIRHASH in the GENERIC kernel.iedowse2001-12-142-0/+2
| | | | | | Suggested by: silby Reviewed by: dillon MFC after: 5 days
* Overhaul the per-CPU support a bit:jhb2001-12-1117-291/+91
| | | | | | | | | | | | | | | | | | | | | | | | | - 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
* style(9)obrien2001-12-091-9/+8
|
* Allow maxusers to be specified as 0 in the kernel config, which willdillon2001-12-093-3/+4
| | | | | | | cause the system to auto-size to between 32 and 512 depending on the amount of memory. MFC after: 1 week
* s/^options\t\t/options \t/des2001-12-041-15/+15
|
* PROCFS requires PSEUDOFS.des2001-12-043-3/+6
|
* 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
* fix DIAGNOSTIC panic caused by proc/thread typogallatin2001-11-291-1/+1
| | | | tested by: Martijn Pronk <martijn@smartie.xs4all.nl>
* The DEC kn300 has special code for console handling hardcoded here, so addjlemon2001-11-221-0/+1
| | | | | | a call to promcndetach() to explicitly turn off the prom console. Tested by: Jeff Roberson
* Cosmetic tweak to eliminate some diffspeter2001-11-161-2/+0
|
* Merge another missing part of i386/pmap.c rev 1.220. Dont blindly clearpeter2001-11-161-1/+2
| | | | | the PG_BUSY flag without using the code that wakes up something else that may be sleeping on it.
* Oops, I accidently merged a whitespace error from the original commit.peter2001-11-161-1/+1
| | | | (whitespace at end of line in rev 1.264 pmap.c). Fix them all.
* Merge rev 1.264 from i386/pmap.c (tegge via alfred):peter2001-11-161-1/+4
| | | | | | | Protect against an infinite loop when prefaulting pages. This can happen when the vm system maps past the end of an object or tries to map a zero length object, the pmap layer misses the fact that offsets wrap into negative numbers and we get stuck.
* Merge rev 1.202 from i386/pmap.c (back in 1998 by John Dyson):peter2001-11-161-0/+3
| | | | | | | Make flushing dirty pages work correctly on filesystems that unexpectedly do not complete writes even with sync I/O requests. This should help the behavior of mmaped files when using softupdates (and perhaps in other circumstances also.)
* Merge rev 1.293 of i386/pmap.c - skip PG_UNMANAGED in pmap_collect()peter2001-11-161-1/+1
|
* Converge/fix some debug code (#if 0'ed on alpha, but whatever)peter2001-11-161-15/+11
| | | | | | - use NPTEPG/NPDEPG instead of magic 1024 (important for PAE) - use pt_entry_t instead of unsigned (important for PAE) - use vm_offset_t instead of unsigned for va's (important for x86-64)
* Converge with i386/pmap.c - dont refer to curproc, use curthread.peter2001-11-161-2/+2
|
* Merge part of i386/pmap.c rev 1.220 that got missed in alpha/pmap.cpeter2001-11-161-5/+1
| | | | rev 1.10
* As part of a general cleanup and reconvergence of related pmap code,peter2001-11-161-24/+0
| | | | | start tidying up some loose ends. The DEBUG_VA stuff has long since passed its use-by date. It wasn't used on ia64 but got cut/pasted there.
* Don't call cdevsw_add().phk2001-11-041-5/+0
|
* Introduce a boot environment variable (clock_compat_osf1) which cangallatin2001-11-031-1/+26
| | | | | | | | | be set to 1 to make FreeBSD and Tru64 coexist peacefully on a dual boot system and not clobber each other's year in the TOY clock. (Tru64 uses an offset 52 years higher than one would expect) Obtained from: NetBSD MFC After: 1 week
* Remove unneeded and #if 0'ed code to register in cdevsw[]phk2001-11-031-13/+0
|
* Implement i386/i386/pmap.c 1.292 for alpha, ia64 (avoid freedillon2001-11-031-1/+17
| | | | page exhaustion / kernel panic for certain madvise() scenarios)
* o Add new header <sys/stdint.h>.mike2001-11-024-0/+470
| | | | | | | | | | | | | | | | | | | | | o Make <stdint.h> a symbolic link to <sys/stdint.h>. o Move most of <sys/inttypes.h> into <sys/stdint.h>, as per C99. o Remove <sys/inttypes.h>. o Adjust includes in sys/types.h and boot/efi/include/ia64/efibind.h to reflect new location of integer types in <sys/stdint.h>. o Remove previously symbolicly linked <inttypes.h>, instead create a new file. o Add MD headers <machine/_inttypes.h> from NetBSD. o Include <sys/stdint.h> in <inttypes.h>, as required by C99; and include <machine/_inttypes.h> in <inttypes.h>, to fill in the remaining requirements for <inttypes.h>. o Add additional integer types in <machine/ansi.h> and <machine/limits.h> which are included via <sys/stdint.h>. Partially obtain from: NetBSD Tested on: alpha, i386 Discussed on: freebsd-standards@bostonradio.org Reviewed by: bde, fenner, obrien, wollman
* Rather than just change the arguments to suser() change the function tomike2001-11-021-1/+1
| | | | | | suser_xxx() as well. Pointy hat to: rwatson
OpenPOWER on IntegriCloud