summaryrefslogtreecommitdiffstats
path: root/sys/amd64
Commit message (Collapse)AuthorAgeFilesLines
* Re-enable the lnc driver in GENERIC.paul2000-12-201-2/+2
|
* Remove the "machine dependent" KTR trace buffer ddb commands. The code wasjhb2000-12-141-101/+0
| | | | exactly the same on all platforms.
* Use _lapic+offset to access the local apic from assembly languagejake2000-12-145-23/+30
| | | | | files, rather than the symbols in globals.s. The offsets are generated by genassym.
* If we fail to emulate a vm86 trap in kernel mode, then we usejhb2000-12-131-0/+1
| | | | | | vm86_trap() to return to the calling program directly. vm86_trap() doesn't return, thus it was never returning to trap() to release Giant. Thus, release Giant before calling vm86_trap().
* - If swap metadata does not fit into the KVM, reduce the number oftanimura2000-12-131-4/+15
| | | | | | | | | | | | | | | struct swblock entries by dividing the number of the entries by 2 until the swap metadata fits. - Reject swapon(2) upon failure of swap_zone allocation. This is just a temporary fix. Better solutions include: (suggested by: dillon) o reserving swap in SWAP_META_PAGES chunks, and o swapping the swblock structures themselves. Reviewed by: alfred, dillon
* Introduce a new potientially cleaner interface for accessing per-cpujake2000-12-1311-153/+160
| | | | | | | | | | | variables from i386 assembly language. The syntax is PCPU(member) where member is the capitalized name of the per-cpu variable, without the gd_ prefix. Example: movl %eax,PCPU(CURPROC). The capitalization is due to using the offsets generated by genassym rather than the symbols provided by linking with globals.o. asmacros.h is the wrong place for this but it seemed as good a place as any for now. The old implementation in asnames.h has not been removed because it is still used to de-mangle the symbols used by the C variables for the UP case.
* Remove the COMPAT_OLDPCI option, it's going away.msmith2000-12-131-2/+1
| | | | Turn 'lnc' off in GENERIC for the moment, pending its update to newbus.
* - Change the allproc_lock to use a macro, ALLPROC_LOCK(how), insteadjake2000-12-131-3/+3
| | | | | | | | of explicit calls to lockmgr. Also provides macros for the flags pased to specify shared, exclusive or release which map to the lockmgr flags. This is so that the use of lockmgr can be easily replaced with optimized reader-writer locks. - Add some locking that I missed the first time.
* Add in symbols needed in the WITNESS_ENTER and WITNESS_EXIT macros injhb2000-12-121-0/+5
| | | | i386/include/mutex.h.
* Fix the assembly mutex macros to call the appropriate witness functions ifjhb2000-12-121-3/+38
| | | | | | the witness code is compiled in. Without this, the witness code doesn't notice that sched_lock is released by fork_trampoline() and thus gets all confused about spin lock order later on.
* - Add code to detect if a system call returns with locks other than Giantjake2000-12-121-0/+10
| | | | | | | | | held and panic if so (conditional on witness). - Change witness_list to return the number of locks held so this is easier. - Add kern/syscalls.c to the kernel build if witness is defined so that the panic message can contain the name of the offending system call. - Add assertions that Giant and sched_lock are not held when returning from a system call, which were missing for alpha and ia64.
* Remove DDB, it leaked in here with another commit.phk2000-12-111-2/+0
| | | | Submitted by: bde
* Next phase in the PCI subsystem cleanup.msmith2000-12-082-4/+54
| | | | | | | | | | | | | | | | | | | | - Move PCI core code to dev/pci. - Split bridge code out into separate modules. - Remove the descriptive strings from the bridge drivers. If you want to know what a device is, use pciconf. Add support for broadly identifying devices based on class/subclass, and for parsing a preloaded device identification database so that if you want to waste the memory, you can identify *anything* we know about. - Remove machine-dependant code from the core PCI code. APIC interrupt mapping is performed by shadowing the intline register in machine- dependant code. - Bring interrupt routing support to the Alpha (although many platforms don't yet support routing or mapping interrupts entirely correctly). This resulted in spamming <sys/bus.h> into more places than it really should have gone. - Put sys/dev on the kernel/modules include path. This avoids having to change *all* the pci*.h includes.
* Convert more malloc+bzero to malloc+M_ZERO.dwmalone2000-12-087-25/+17
| | | | | Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net>
* Revert the previous change I made to cpu_switch. It doesn't help asjake2000-12-083-5/+9
| | | | much as I thought it would and according to bde was a pessimization.
* Staticize some malloc M_ instances.phk2000-12-083-4/+6
|
* Fix a jump to the wrong label, <sigh>. Put a period at the end of ajake2000-12-081-2/+2
| | | | | | sentence in a comment. Submitted by: bde
* Argh, revert the clobber changes. Since %ecx and %edx aren't call safe,jhb2000-12-081-9/+9
| | | | | | | calling the C functions mtx_enter_hard() and mtx_exit_hard() clobbers them. Note that %eax is also not call safe, but it is already clobbered due to cmpxchg. However, now we are back to not compiling again, so these macros are still left disabled for now.
* Change the calling conventions of the MTX_ENTER macro to matchjake2000-12-081-11/+13
| | | | | | | that of MTX_EXIT. Don't assume that the reg parameter to MTX_ENTER holds curproc, load it explicitly. Put semi-colons at the end of the macros to be more consistent and so its harder to forget them when these change.
* Well, the previous commit wasn't entirely correct either. For now, justjhb2000-12-081-1/+2
| | | | | disable the optimized mutex micro-operations for the non-I386_CPU case and fall back to the C stubs that call the atomic_foo() inlines.
* Move extern tsc_present outside function to quelch a warning.phk2000-12-071-1/+4
|
* Create a pmtimer device instance for GENERIC and NEWCARD kernels by default.iwasaki2000-12-071-0/+1
| | | | Submitted by: Masayuki FUKUI <fukui@sonic.nm.fujitsu.co.jp>
* Fix broken register restraints that needlessly clobbered registers %ecxjhb2000-12-071-13/+13
| | | | and %edx resulting in gcc not having enough registers left to work with.
* This is kind of a nasty hack, but it appears to solve the Compaq DL360peter2000-12-063-6/+39
| | | | | | | | SMP problem. Compaq, in their infinite wisdom, forgot to put the IO apic intpin #0 connection to the 8259 PIC into the mptable. This hack is to look and see if intpin #0 has *no* table entry and adds a fake ExtInt entry for the remap routines to use. isa/clock.c will still test the interrupts. This entry is only ever used on an already broken system.
* Move io_apic_{read,write} from apic_ipl.s (where they do not belong) intopeter2000-12-061-4/+3
| | | | | | mpapic.c. This gives us the benefit of C type checking. These functions are not called in any critical paths and are not used by the interrupt routines.
* GC unused assembler function apic_eoi()peter2000-12-061-1/+0
|
* Remove the last of the MD netisr code. It is now all MI. Removejake2000-12-052-28/+0
| | | | | | | | spending, which was unused now that all software interrupts have their own thread. Make the legacy schednetisr use an atomic op for setting bits in the netisr mask. Reviewed by: jhb
* Cleanup some leftover lint from the old interrupt system.peter2000-12-0413-291/+84
| | | | | | | | Also, while here, run up to 32 interrupt sources on APIC systems. Normalize INTREN/INTRDIS so they are the same on both UP and SMP systems rather than sometimes a macro, and sometimes a function. Reviewed by: jhb, jakeb
* (1) Allow a stray lock prefix to be compiled out with thejake2000-12-041-16/+24
| | | | | | | | | | | | | MPLOCKED macro (2) Use decimal 12 rather than hex 0xc in an addl (3) Implement MTX_ENTER for the I386_CPU case (4) Use semi-colons between instructions to allow MTX_ENTER and MTX_ENTER_WITH_RECURSION to be assembled (5) Use incl instead of incw to increment the recusion count (6) 10 is not a valid label, use 7, 8 and 9 rather than 8, 9 and 10 (7) Sort numeric labels Submitted by: bde (2, 4, and 5)
* Change cpu_switch to explicitly popl the callers program counter andjake2000-12-033-9/+5
| | | | | | | pushl that of the new process, rather than doing a movl (%esp) and assuming that the stack has been setup right. This make the initial stack setup slightly more sane, and will make it easier to stick an interrupted process onto the run queue without its knowing.
* Namespace cleanup. Remove some #includes in favour of an explicitmarkm2000-12-023-3/+12
| | | | | | declaration. Asked for by: bde
* Fix this slightly better by using NON_GPROF_RET instead of duplicatingjhb2000-12-012-2/+2
| | | | | | hard-coded asm. Suggested by: bde
* Change doreti to take a trapframe instead of an intrframe.jake2000-12-016-21/+13
| | | | | | Remove associated pushes of dummy units to convert frame. Reviewed by: jhb
* Revert the previous change to this file. We have to hardcode in the opcodejhb2000-11-302-2/+2
| | | | | | | for return because we do Evil Things(tm) with a 'ret' macro in asmacros.h. Noticed by: markm
* Don't use p->p_sigstk.ss_flags to keep state of whether themarcel2000-11-302-6/+19
| | | | | | | | | | | | | | | process is on the alternate stack or not. For compatibility with sigstack(2) state is being updated if such is needed. We now determine whether the process is on the alternate stack by looking at its stack pointer. This allows a process to siglongjmp from a signal handler on the alternate stack to the place of the sigsetjmp on the normal stack. When maintaining state, this would have invalidated the state information and causing a subsequent signal to be delivered on the normal stack instead of the alternate stack. PR: 22286
* Increase NKPT from 17 to 30. This fixes the 4GB ram boot panic on bothpeter2000-11-301-1/+1
| | | | | | | | | | | | | -current and RELENG_4 with GENERIC. NKPT is the number of initial bootstrap page table pages we create for the kernel during startup. Once VM is up, we resize it as needed, but with 4G ram, the size of the vm_page_t structures was pushing it over the limit. The fact that trimmed down kernels boot on 4G ram machines suggests that we were pretty close to the edge. The "30" is arbitary, but smaller than the 'nkpt' variable on all machines that I checked.
* Don't wait forever for CPUs to stop or restart. Instead, give up after ajhb2000-11-283-6/+57
| | | | | | | timeout. If DIAGNOSTIC is turned on, then display a message to the console with a map of which CPUs failed to stop or restart. This gives an SMP box at least a fighting chance of getting into DDB if one of the other CPUs has interrupts disabled.
* Use atomic ops to close a race condition on the in_Debugger variable usedjhb2000-11-281-4/+3
| | | | to only allow 1 CPU at a time to (non-recursively) enter the debugger.
* Revert the last commit to the callout interface, and add a flag tojlemon2000-11-251-1/+1
| | | | | | | callout_init() indicating whether the callout is safe or not. Update the callers of callout_init() to reflect the new interface. Okayed by: Jake
* Protect the following with a lockmgr lock:jake2000-11-221-0/+3
| | | | | | | | | | | | allproc zombproc pidhashtbl proc.p_list proc.p_hash nextpid Reviewed by: jhb Obtained from: BSD/OS and netbsd
* Assembler fixes.markm2000-11-214-9/+9
| | | | | | Fix opcodes that were typed as ".byte 0xNN, 0xMM" when an older assembler could not recognise the newer Pentium instructions. Reviewed by: jhb
* Add a consistent API to a feature that most modern CPUs have; a fastmarkm2000-11-211-0/+21
| | | | | | | | | | | | | | counter register in-CPU. This is to be used as a fast "timer", where linearity is more important than time, and multiple lines in the linearity caused by multiple CPUs in an SMP machine is not a problem. This adds no code whatsoever to the FreeBSD kernel until it is actually used, and then as a single-instruction inline routine (except for the 80386 and 80486 where it is some more inline code around nanotime(9). Reviewed by: bde, kris, jhb
* Stop handcoding a couple of instructions since gas 2.10 can properlyjhb2000-11-212-2/+2
| | | | | | assemble 16-bit code. Noticed by: markm
* - Protect the callout wheel with a separate spin mutex, callout_lock.jake2000-11-191-0/+2
| | | | | | | | | | | - Use the mutex in hardclock to ensure no races between it and softclock. - Make softclock be INTR_MPSAFE and provide a flag, CALLOUT_MPSAFE, which specifies that a callout handler does not need giant. There is still no way to set this flag when regstering a callout. Reviewed by: -smp@, jlemon
* - Split the run queue and sleep queue linkage, so that a processjake2000-11-171-1/+1
| | | | | | | | | may block on a mutex while on the sleep queue without corrupting it. - Move dropping of Giant to after the acquire of sched_lock. Tested by: John Hay <jhay@icomtek.csir.co.za> jhb
* - Change extra sanity checks in cpu_switch() to be conditional on INVARIANTSjhb2000-11-172-62/+6
| | | | | | | instead of DIAGNOSTIC. - Remove the p_wchan check as it no longer applies since a process may be switched out during CURSIG() within msleep() or mawait(). - Remove an extra sanity check only needed during the early SMPng work.
* Don't release and acquire Giant in mi_switch(). Instead, release andjhb2000-11-161-0/+2
| | | | | | | | acquire Giant as needed in functions that call mi_switch(). The releases need to be done outside of the sched_lock to avoid potential deadlocks from trying to acquire Giant while interrupts are disabled. Submitted by: witness
* Assert that Giant is not owned during the main loop of ithd_loop().jhb2000-11-151-0/+1
|
* Add pmtimer device, necessary for proper time keeping when apm orimp2000-11-151-0/+2
| | | | other power management devices are enabled.
* Always enable interrupts during fork_trampoline() after releasing thejhb2000-11-142-0/+6
| | | | | | | | sched_lock. This is needed for kernel threads that are created before interrupts are enabled. kthreads created by kld's that are created at SI_SUB_KLD such as the random kthread. Tested by: phk
OpenPOWER on IntegriCloud