Reorganize the way machine architectures are handled. Consolidate the kernel configurations into a single generic directory. Move machine-specific Makefile's and loader scripts into the appropriate architecture directory. Kernel and module builds also generally add sys/arch to the include path so source files that include architecture-specific headers do not have to be adjusted. sys/<ARCH> -> sys/arch/<ARCH> sys/conf/*.<ARCH> -> sys/arch/<ARCH>/conf/*.<ARCH> sys/<ARCH>/conf/<KERNEL> -> sys/config/<KERNEL>
Change the kernel dev_t, representing a pointer to a specinfo structure, to cdev_t. Change struct specinfo to struct cdev. The name 'cdev' was taken from FreeBSD. Remove the dev_t shim for the kernel. This commit generally removes the overloading of 'dev_t' between userland and the kernel. Also fix a bug in libkvm where a kernel dev_t (now cdev_t) was not being properly converted to a userland dev_t.
Import amd64 MD headers Obtained-from: FreeBSD and our sys/i386
Remove LWKT reader-writer locks (kern/lwkt_rwlock.c). Remove lwkt_wait queues (only RW locks used them). Convert remaining uses of RW locks to LOCKMGR locks. In recent months lockmgr locks have been simplified to the point where we no longer need a lighter-weight fully blocking lock. The removal also simplifies lwkt_schedule() in that it no longer needs a special case to deal with wait lists.
Replace the the buffer cache's B_READ, B_WRITE, B_FORMAT, and B_FREEBUF b_flags with a separate b_cmd field. Use b_cmd to test for I/O completion as well (getting rid of B_DONE in the process). This further simplifies the setup required to issue a buffer cache I/O. Remove a redundant header file, bus/isa/i386/isa_dma.h and merge any discrepancies into bus/isa/isavar.h. Give ISADMA_READ/WRITE/RAW their own independant flag definitions instead of trying to overload them on top of B_READ, B_WRITE, and B_RAW. Add a routine isa_dmabp() which takes a struct buf pointer and returns the ISA dma flags associated with the operation. Remove the 'clear_modify' argument to vfs_busy_pages(). Instead, vfs_busy_pages() asserts that the buffer's b_cmd is valid and then uses it to determine the action it must take.
Only define atop for _KERNEL or _KERNEL_STRUCTURES. Noticed because third-party userland code (csup) also tried to use its own atop. I tested with a buildworld and buildkernel on i386. Okayed by M. Dillon via kernel mailing list. (I didn't put this condition around ptoa because it is used in usr.bin/gcore/gcore.c.)
Get rid of the p_stat SZOMB state. p_stat can now only be SIDL, SSLEEP, or SRUN. Instead mark zombie processes with a new flag, P_ZOMBIE. The eproc code will convert P_ZOMBIE into SZOMB for /bin/ps. This further isolates the tsleep code from the process status and fixes a panic when a process in SZOMB tried to tsleep(). Reported-by: Stefan Krueger <skrueger@meinberlikomm.de>
Allow 'options SMP' *WITHOUT* 'options APIC_IO'. That is, an ability to produce an SMP-capable kernel that uses the PIC/ICU instead of the IO APICs for interrupt routing. SMP boxes with broken BIOSes (namely my Shuttle XPC SN95G5) could very well have serious interrupt routing problems when operating in IO APIC mode. One solution is to not use the IO APICs. That is, to run only the Local APICs for the SMP management. * Don't conditionalize NIDT. Just set it to 256 * Make the ICU interrupt code MP SAFE. This primarily means using the imen_spinlock to protect accesses to icu_imen. * When running SMP without APIC_IO, set the LAPIC TPR to prevent unintentional interrupts. Leave LINT0 enabled (normally with APIC_IO LINT0 is disabled when the IO APICs are activated). LINT0 is the virtual wire between the 8259 and LAPIC 0. * Get rid of NRSVIDT. Just use IDT_OFFSET instead. * Clean up all the APIC_IO tests which should have been SMP tests, and all the SMP tests which should have been APIC_IO tests. Explicitly #ifdef out all code related to the IO APICs when APIC_IO is not set.
ICU/APIC cleanup part 7/many. Get rid of most of the dependancies on ICU_LEN, NSWI, and NHWI, by creating a generous system standard maximum for hardware and software interrupts in the MI sys/interrupt.h. The interrupt architecture can then further limit available hardware and software interrupts. For example, i386 uses 32 bit masks and so is limited to 32 hardware interrupts and 32 software interrupts. The name ICU_OFFSET is confusing, rename it to IDT_OFFSET, which is what it really is. Note that this separation is possible due to recent work on the MI interrupt layer. Separate the software interrupt mask from the hardware interrupt mask in the i386 code. Get rid of rndcontrol's 16 irq limit by creating a new ioctl to iterate through interrupt numbers.
A machine-independent spinlock implementation. It has the advantages of 1. being written in C except for the most low-level atomic swap primitive, which is universally supported on current processor architectures 2. having a very small inlined memory footprint for spin_lock(), with the slow-path defered to a subroutine call 3. only requiring a bus-locked operation for lock acquisition, and not requiring a bus-locked operation for lock release 4. doing a non-bus-locked check first in the spin loop to reduce bus contention 5. doing exponential backoff in the uncommon contested case, which Sun has found to reduce bus contention by a factor of 5 or more Reviewed by: Matt Dillon
Remove all remaining SPL code. Replace the mtd_cpl field in the machine dependant thread structure and the CPL field in the interrupt stack frame with dummies (so structural sizes do not change, yet). Remove all interrupt handler SPL mask and mask pointer code. Remove all spl*() functions except for splz(). Note that doreti uses a temporary CPL mask internally to accumulate a bitmap of FAST interrupts which could not be executed due to not being able to get the BGL. This mask has no outside visibility. Note that gd_fpending and gd_ipending still exist to support critical section interrupt deferment.
Fix gcc40 compilation of lib/libsvg by merging from FreeBSD: bde 2004/03/11 05:38:54 PST FreeBSD src repository Modified files: sys/amd64/include cpufunc.h sys/i386/include cpufunc.h Log: Don't implement anything in the ffs family in <machine/cpufunc.h> in the non-_KERNEL case. This "fixes" applications that include this "kernel-only" header and also include <strings.h> (or get <strings.h> via the default _BSD_VISIBLE pollution in <string.h>. In C++ there was a fatal error: the declaration specifies C linkage but the implementation gives C++ linkage. In C there was only a static/extern mismatch if the headers were included in a certain order order, and a partially redundant declaration for all include orders; gcc emits incomplete or wrong diagnostics for these, but only for compiling with -Wsystem-headers and certain other warning options, so the problem was usually not seen for C. Ports breakage reported by: kris Revision Changes Path 1.142 +4 -0 src/sys/amd64/include/cpufunc.h 1.139 +4 -0 src/sys/i386/include/cpufunc.h